[SCM] Audacity debian packaging branch, upstream, updated. upstream/1.3.7-2-g1fb1770

bdrung-guest at users.alioth.debian.org bdrung-guest at users.alioth.debian.org
Fri Jul 17 12:52:12 UTC 2009


The following commit has been merged in the upstream branch:
commit 1fb1770234ae7b5b4546685f6cc14ab9114bc908
Author: Benjamin Drung <bdrung at gmail.com>
Date:   Fri Jul 17 14:50:12 2009 +0200

    Add new files missed in the previous commit.

diff --git a/images/AudacityLogoAlpha.xpm b/images/AudacityLogoAlpha.xpm
new file mode 100644
index 0000000..0ec0160
--- /dev/null
+++ b/images/AudacityLogoAlpha.xpm
@@ -0,0 +1,833 @@
+/* XPM */
+static const char * AudacityLogoAlpha_xpm[] = {
+"48 48 782 2",
+"  	c None",
+". 	c #01019E",
+"+ 	c #00009C",
+"@ 	c #0000A5",
+"# 	c #0000AB",
+"$ 	c #0000AC",
+"% 	c #0000A1",
+"& 	c #000092",
+"* 	c #00008F",
+"= 	c #0B0BB3",
+"- 	c #0B0BB9",
+"; 	c #0808B7",
+"> 	c #0909A6",
+", 	c #080897",
+"' 	c #08088C",
+") 	c #060684",
+"! 	c #060683",
+"~ 	c #040486",
+"{ 	c #02028E",
+"] 	c #010196",
+"^ 	c #01019B",
+"/ 	c #00009B",
+"( 	c #00008E",
+"_ 	c #0000AF",
+": 	c #1212C8",
+"< 	c #2222C4",
+"[ 	c #141492",
+"} 	c #0A0A5A",
+"| 	c #050539",
+"1 	c #010133",
+"2 	c #00002B",
+"3 	c #000029",
+"4 	c #00002C",
+"5 	c #000030",
+"6 	c #000031",
+"7 	c #000038",
+"8 	c #000045",
+"9 	c #00004D",
+"0 	c #000060",
+"a 	c #01017E",
+"b 	c #000095",
+"c 	c #000080",
+"d 	c #0A0AC0",
+"e 	c #3333CF",
+"f 	c #26268B",
+"g 	c #000018",
+"h 	c #000022",
+"i 	c #000043",
+"j 	c #000047",
+"k 	c #00004F",
+"l 	c #00007B",
+"m 	c #000091",
+"n 	c #000081",
+"o 	c #2020CF",
+"p 	c #3838A4",
+"q 	c #090939",
+"r 	c #00000A",
+"s 	c #000048",
+"t 	c #00005F",
+"u 	c #000082",
+"v 	c #00006D",
+"w 	c #0C0CB4",
+"x 	c #3E3ED7",
+"y 	c #22226E",
+"z 	c #01011A",
+"A 	c #00005D",
+"B 	c #000077",
+"C 	c #000084",
+"D 	c #00006A",
+"E 	c #0F0FA9",
+"F 	c #2D2DD1",
+"G 	c #1D1D5D",
+"H 	c #00000F",
+"I 	c #00007F",
+"J 	c #000066",
+"K 	c #2424D3",
+"L 	c #363677",
+"M 	c #00000E",
+"N 	c #000067",
+"O 	c #00007E",
+"P 	c #000071",
+"Q 	c #00005B",
+"R 	c #1F1FCE",
+"S 	c #323295",
+"T 	c #000072",
+"U 	c #000088",
+"V 	c #0505AF",
+"W 	c #2F2FC1",
+"X 	c #00001C",
+"Y 	c #00004C",
+"Z 	c #1313C1",
+"` 	c #121267",
+" .	c #00007C",
+"..	c #1313B8",
+"+.	c #070733",
+"@.	c #0101A5",
+"#.	c #101099",
+"$.	c #000026",
+"%.	c #000086",
+"&.	c #0000B9",
+"*.	c #0D0D79",
+"=.	c #000049",
+"-.	c #0101B6",
+";.	c #080867",
+">.	c #B67504",
+",.	c #AB8703",
+"'.	c #0101A6",
+").	c #010148",
+"!.	c #0202B3",
+"~.	c #050563",
+"{.	c #A77D04",
+"].	c #C87303",
+"^.	c #C39904",
+"/.	c #0101AD",
+"(.	c #0303AB",
+"_.	c #1F1FCC",
+":.	c #121262",
+"<.	c #4E4EAE",
+"[.	c #B39305",
+"}.	c #C78803",
+"|.	c #B08F04",
+"1.	c #B89A05",
+"2.	c #D56E03",
+"3.	c #D4A602",
+"4.	c #B98804",
+"5.	c #B98204",
+"6.	c #2C2C9E",
+"7.	c #0909B4",
+"8.	c #090972",
+"9.	c #0707C0",
+"0.	c #0000CA",
+"a.	c #2828C2",
+"b.	c #00003E",
+"c.	c #15159E",
+"d.	c #06065B",
+"e.	c #B09105",
+"f.	c #D2B804",
+"g.	c #DA8F02",
+"h.	c #C69D03",
+"i.	c #AA8C04",
+"j.	c #C4A504",
+"k.	c #E07303",
+"l.	c #E4B203",
+"m.	c #CDBA03",
+"n.	c #B09003",
+"o.	c #AB8D05",
+"p.	c #C68B04",
+"q.	c #C18804",
+"r.	c #21219D",
+"s.	c #0D0DB7",
+"t.	c #3434B6",
+"u.	c #0B0BC2",
+"v.	c #0606CD",
+"w.	c #6565E0",
+"x.	c #070780",
+"y.	c #040495",
+"z.	c #01014F",
+"A.	c #B38804",
+"B.	c #D7B504",
+"C.	c #E9D703",
+"D.	c #E78F03",
+"E.	c #D5A302",
+"F.	c #BC9E05",
+"G.	c #CFAD04",
+"H.	c #E97703",
+"I.	c #EFB902",
+"J.	c #E6D803",
+"K.	c #D7A402",
+"L.	c #BCA104",
+"M.	c #C0A504",
+"N.	c #D18903",
+"O.	c #C98904",
+"P.	c #050589",
+"Q.	c #0000B0",
+"R.	c #4343C9",
+"S.	c #040492",
+"T.	c #000064",
+"U.	c #0909B9",
+"V.	c #0101CB",
+"W.	c #6868E0",
+"X.	c #6868C7",
+"Y.	c #000058",
+"Z.	c #D2A104",
+"`.	c #ECC703",
+" +	c #F6EC01",
+".+	c #F08602",
+"++	c #E0A402",
+"@+	c #C9AC04",
+"#+	c #D8B504",
+"$+	c #EE7A02",
+"%+	c #F5BD01",
+"&+	c #F3E801",
+"*+	c #E8A402",
+"=+	c #D3BB03",
+"-+	c #D0B704",
+";+	c #DA8803",
+">+	c #CE8C02",
+",+	c #0000B1",
+"'+	c #0F0FB6",
+")+	c #1616A7",
+"!+	c #00007A",
+"~+	c #000061",
+"{+	c #0000C3",
+"]+	c #2323CE",
+"^+	c #A4A4E5",
+"/+	c #171795",
+"(+	c #000051",
+"_+	c #02024F",
+":+	c #C6A904",
+"<+	c #E5B803",
+"[+	c #F4C601",
+"}+	c #FBF601",
+"|+	c #F67D01",
+"1+	c #E8A502",
+"2+	c #D3B903",
+"3+	c #E0BA03",
+"4+	c #F27B01",
+"5+	c #F9BE00",
+"6+	c #F9EE01",
+"7+	c #F29C01",
+"8+	c #E1CE03",
+"9+	c #DDC904",
+"0+	c #E38D03",
+"a+	c #D68D02",
+"b+	c #0505B2",
+"c+	c #1414AA",
+"d+	c #000085",
+"e+	c #000069",
+"f+	c #00004E",
+"g+	c #0303AC",
+"h+	c #0000C5",
+"i+	c #6F6FDC",
+"j+	c #4C4CBE",
+"k+	c #C28C04",
+"l+	c #E2CB04",
+"m+	c #F1C702",
+"n+	c #F9C901",
+"o+	c #FEFB00",
+"p+	c #F97201",
+"q+	c #EEA402",
+"r+	c #DDC504",
+"s+	c #E6BD03",
+"t+	c #F77B01",
+"u+	c #FBB201",
+"v+	c #FDEF00",
+"w+	c #F88A00",
+"x+	c #EFDA02",
+"y+	c #EADB03",
+"z+	c #EC9202",
+"A+	c #E29403",
+"B+	c #BEAA04",
+"C+	c #B19904",
+"D+	c #B58004",
+"E+	c #080790",
+"F+	c #040488",
+"G+	c #1111AA",
+"H+	c #00008D",
+"I+	c #000073",
+"J+	c #000054",
+"K+	c #000044",
+"L+	c #0101B7",
+"M+	c #1414C7",
+"N+	c #7474D6",
+"O+	c #06069C",
+"P+	c #030495",
+"Q+	c #03024F",
+"R+	c #D59604",
+"S+	c #EFDE02",
+"T+	c #F7D001",
+"U+	c #FBCA00",
+"V+	c #FDFA00",
+"W+	c #FA6601",
+"X+	c #F3A002",
+"Y+	c #E5D103",
+"Z+	c #EDC103",
+"`+	c #F97601",
+" @	c #FDAA00",
+".@	c #FEEB00",
+"+@	c #FC7F00",
+"@@	c #F8BD01",
+"#@	c #F4EF01",
+"$@	c #F39401",
+"%@	c #EB9B02",
+"&@	c #D5C303",
+"*@	c #D6C303",
+"=@	c #DA7F02",
+"-@	c #CCBE03",
+";@	c #161383",
+">@	c #030389",
+",@	c #000090",
+"'@	c #00007D",
+")@	c #00005C",
+"!@	c #000041",
+"~@	c #0000BF",
+"{@	c #2A2AC8",
+"]@	c #3737BB",
+"^@	c #030394",
+"/@	c #04034F",
+"(@	c #AB8B05",
+"_@	c #E09603",
+":@	c #F5E902",
+"<@	c #FBD100",
+"[@	c #FCC900",
+"}@	c #FDF200",
+"|@	c #FC5B01",
+"1@	c #F79B01",
+"2@	c #EEDF02",
+"3@	c #F3C601",
+"4@	c #FB6F01",
+"5@	c #FD9D00",
+"6@	c #FEE100",
+"7@	c #FD7301",
+"8@	c #FB9200",
+"9@	c #FBFD00",
+"0@	c #F99700",
+"a@	c #F39301",
+"b@	c #E7DC03",
+"c@	c #EAD202",
+"d@	c #ED8902",
+"e@	c #EBDF02",
+"f@	c #D0A700",
+"g@	c #2F2874",
+"h@	c #02028A",
+"i@	c #000063",
+"j@	c #00003F",
+"k@	c #0202A2",
+"l@	c #0000BC",
+"m@	c #2C2CC4",
+"n@	c #1313A7",
+"o@	c #040496",
+"p@	c #0C094C",
+"q@	c #C3A704",
+"r@	c #EA9703",
+"s@	c #FAF201",
+"t@	c #FCD001",
+"u@	c #FDC500",
+"v@	c #FFDA00",
+"w@	c #FD5301",
+"x@	c #FB8C01",
+"y@	c #F8ED01",
+"z@	c #F9C900",
+"A@	c #FC6201",
+"B@	c #FE8E01",
+"C@	c #FEC900",
+"D@	c #FD5E00",
+"E@	c #FE6601",
+"F@	c #FDFF00",
+"G@	c #FC9100",
+"H@	c #FB8501",
+"I@	c #F5F302",
+"J@	c #F6CC01",
+"K@	c #F99401",
+"L@	c #F7E901",
+"M@	c #E7B200",
+"N@	c #4A4168",
+"O@	c #01018A",
+"P@	c #000093",
+"Q@	c #00008A",
+"R@	c #000036",
+"S@	c #00009E",
+"T@	c #0101B9",
+"U@	c #2222BC",
+"V@	c #07079D",
+"W@	c #060596",
+"X@	c #201B49",
+"Y@	c #C2A604",
+"Z@	c #E3CC03",
+"`@	c #F39001",
+" #	c #FCF800",
+".#	c #FDCB00",
+"+#	c #FDAC00",
+"@#	c #FDC000",
+"##	c #FE4800",
+"$#	c #FC7100",
+"%#	c #FCB600",
+"&#	c #FD5500",
+"*#	c #FD7E00",
+"=#	c #FEA300",
+"-#	c #FD5200",
+";#	c #FD3E00",
+">#	c #FEF300",
+",#	c #FE7A00",
+"'#	c #FC6B01",
+")#	c #FBFB00",
+"!#	c #FBBB00",
+"~#	c #FC7201",
+"{#	c #FBE400",
+"]#	c #F6AA00",
+"^#	c #665D5E",
+"/#	c #00008B",
+"(#	c #00008C",
+"_#	c #00006E",
+":#	c #0000AA",
+"<#	c #0101B5",
+"[#	c #1717B5",
+"}#	c #040499",
+"|#	c #070697",
+"1#	c #352F46",
+"2#	c #EAD502",
+"3#	c #F5AA02",
+"4#	c #FA7B01",
+"5#	c #FEF000",
+"6#	c #FEBE00",
+"7#	c #FD8B00",
+"8#	c #FEAE00",
+"9#	c #FD3900",
+"0#	c #FD4900",
+"a#	c #FEFC00",
+"b#	c #FD9500",
+"c#	c #FD4600",
+"d#	c #FE7300",
+"e#	c #FD7A00",
+"f#	c #FE4200",
+"g#	c #FD1F00",
+"h#	c #FEC600",
+"i#	c #FD5400",
+"j#	c #FE4700",
+"k#	c #FDE200",
+"l#	c #FD8E00",
+"m#	c #FE5000",
+"n#	c #FCCD00",
+"o#	c #FF9800",
+"p#	c #786C58",
+"q#	c #000070",
+"r#	c #00002F",
+"s#	c #0101B1",
+"t#	c #1010B0",
+"u#	c #030398",
+"v#	c #080798",
+"w#	c #3F3044",
+"x#	c #F9EC01",
+"y#	c #F95C00",
+"z#	c #FD5F01",
+"A#	c #FECA00",
+"B#	c #FE6200",
+"C#	c #FE8D00",
+"D#	c #FE2A00",
+"E#	c #FEEE00",
+"F#	c #FE6D00",
+"G#	c #FD3300",
+"H#	c #FF7000",
+"I#	c #FD4A00",
+"J#	c #FD2B00",
+"K#	c #FF0D00",
+"L#	c #FD8300",
+"M#	c #FE3300",
+"N#	c #FE1E00",
+"O#	c #FEA600",
+"P#	c #FE3100",
+"Q#	c #FE8F00",
+"R#	c #FF8600",
+"S#	c #7C5458",
+"T#	c #0B0BAC",
+"U#	c #020297",
+"V#	c #00002A",
+"W#	c #090999",
+"X#	c #401A44",
+"Y#	c #FCEE00",
+"Z#	c #FD3200",
+"`#	c #FEA200",
+" $	c #FD6000",
+".$	c #FE3F00",
+"+$	c #FE4500",
+"@$	c #FD2500",
+"#$	c #FD1E00",
+"$$	c #FEBC00",
+"%$	c #FD3800",
+"&$	c #FE2100",
+"*$	c #FD5700",
+"=$	c #FF1E00",
+"-$	c #FE1600",
+";$	c #FF0800",
+">$	c #FD2A00",
+",$	c #FE1A00",
+"'$	c #FF1000",
+")$	c #FE2000",
+"!$	c #FE1500",
+"~$	c #FE3800",
+"{$	c #FF7300",
+"]$	c #7C2957",
+"^$	c #00038C",
+"/$	c #00003A",
+"($	c #000028",
+"_$	c #000094",
+":$	c #0000A8",
+"<$	c #0707A9",
+"[$	c #090A99",
+"}$	c #400944",
+"|$	c #FBD701",
+"1$	c #FE2500",
+"2$	c #FE2300",
+"3$	c #FE1F00",
+"4$	c #FD2300",
+"5$	c #FE9800",
+"6$	c #FD1C00",
+"7$	c #FE1800",
+"8$	c #FD1B00",
+"9$	c #FE0D00",
+"0$	c #FE0A00",
+"a$	c #FE0C00",
+"b$	c #FF0900",
+"c$	c #FE1200",
+"d$	c #FE1000",
+"e$	c #FE0900",
+"f$	c #FE1400",
+"g$	c #FF3800",
+"h$	c #7E1A56",
+"i$	c #00048C",
+"j$	c #000033",
+"k$	c #000023",
+"l$	c #0000A3",
+"m$	c #0202A5",
+"n$	c #04049B",
+"o$	c #0A062B",
+"p$	c #0A0B9A",
+"q$	c #420544",
+"r$	c #FDAB01",
+"s$	c #FE1B00",
+"t$	c #FE1700",
+"u$	c #FE1D00",
+"v$	c #FE5F00",
+"w$	c #FE4300",
+"x$	c #FD7200",
+"y$	c #FE0F00",
+"z$	c #FD1100",
+"A$	c #FF0F00",
+"B$	c #FE1300",
+"C$	c #FD1300",
+"D$	c #FD1800",
+"E$	c #FE1900",
+"F$	c #FE1100",
+"G$	c #FF2D00",
+"H$	c #7E1C57",
+"I$	c #000087",
+"J$	c #00001F",
+"K$	c #0000A0",
+"L$	c #03039C",
+"M$	c #0D082B",
+"N$	c #090A9A",
+"O$	c #430A43",
+"P$	c #FB6200",
+"Q$	c #FE3400",
+"R$	c #FE3600",
+"S$	c #FE3B00",
+"T$	c #FEB900",
+"U$	c #FE5C00",
+"V$	c #FE5700",
+"W$	c #FE2800",
+"X$	c #FD3400",
+"Y$	c #FE2B00",
+"Z$	c #FE4A00",
+"`$	c #FD4400",
+" %	c #FE4100",
+".%	c #FE5500",
+"+%	c #FE5A00",
+"@%	c #FD2C00",
+"#%	c #FD6300",
+"$%	c #FF3F00",
+"%%	c #7C2157",
+"&%	c #00001D",
+"*%	c #000099",
+"=%	c #010193",
+"-%	c #0F092B",
+";%	c #090A9B",
+">%	c #411044",
+",%	c #FC3000",
+"'%	c #FE2D00",
+")%	c #FD8F00",
+"!%	c #FE6000",
+"~%	c #FE5B00",
+"{%	c #FE6400",
+"]%	c #FEDA00",
+"^%	c #FD5600",
+"/%	c #FE4B00",
+"(%	c #FE4F00",
+"_%	c #FE4000",
+":%	c #FD7B00",
+"<%	c #FD6800",
+"[%	c #FE4D00",
+"}%	c #FD9600",
+"|%	c #FD7100",
+"1%	c #FE5D00",
+"2%	c #FDEA00",
+"3%	c #FE8600",
+"4%	c #FE7800",
+"5%	c #FDBB00",
+"6%	c #FF9900",
+"7%	c #773459",
+"8%	c #00028C",
+"9%	c #000015",
+"0%	c #000097",
+"a%	c #010195",
+"b%	c #0F0A2B",
+"c%	c #09099A",
+"d%	c #413244",
+"e%	c #FB4201",
+"f%	c #FE4401",
+"g%	c #FE9100",
+"h%	c #FE6800",
+"i%	c #FEA800",
+"j%	c #FE6D01",
+"k%	c #FDE600",
+"l%	c #FDBE00",
+"m%	c #FE9300",
+"n%	c #FE6600",
+"o%	c #FE9500",
+"p%	c #FEDB00",
+"q%	c #FE8900",
+"r%	c #FCAD01",
+"s%	c #FCFF01",
+"t%	c #FC9B01",
+"u%	c #FDBF00",
+"v%	c #FCD200",
+"w%	c #FFC400",
+"x%	c #74605A",
+"y%	c #1010A9",
+"z%	c #000055",
+"A%	c #0C072B",
+"B%	c #09079A",
+"C%	c #404644",
+"D%	c #F65B01",
+"E%	c #FB8400",
+"F%	c #FFFF00",
+"G%	c #FDDF00",
+"H%	c #FC7300",
+"I%	c #FAEB01",
+"J%	c #FAE101",
+"K%	c #FD6801",
+"L%	c #FE7C00",
+"M%	c #FD6D00",
+"N%	c #FDF000",
+"O%	c #FDA600",
+"P%	c #FC7A01",
+"Q%	c #FDFE00",
+"R%	c #FBA401",
+"S%	c #F9BE01",
+"T%	c #F8F501",
+"U%	c #F8A001",
+"V%	c #F9D801",
+"W%	c #F5DB01",
+"X%	c #F1C300",
+"Y%	c #625760",
+"Z%	c #0606B2",
+"`%	c #0A0AA3",
+" &	c #00006B",
+".&	c #00000D",
+"+&	c #000019",
+"@&	c #000078",
+"#&	c #000083",
+"$&	c #000053",
+"%&	c #080698",
+"&&	c #373546",
+"*&	c #ED8E02",
+"=&	c #F9A401",
+"-&	c #FDB700",
+";&	c #FFFE00",
+">&	c #FDA800",
+",&	c #FDF400",
+"'&	c #FA8000",
+")&	c #F5E402",
+"!&	c #F4EA02",
+"~&	c #FA7500",
+"{&	c #FCBF00",
+"]&	c #FD8700",
+"^&	c #FC8E01",
+"/&	c #FCFF00",
+"(&	c #FBAD00",
+"_&	c #FA9800",
+":&	c #F8F801",
+"<&	c #F7BB01",
+"[&	c #F6B700",
+"}&	c #F3EC02",
+"|&	c #F29D01",
+"1&	c #EFD902",
+"2&	c #E1C603",
+"3&	c #D0A800",
+"4&	c #3E316D",
+"5&	c #0505B3",
+"6&	c #00006F",
+"7&	c #050497",
+"8&	c #2B2347",
+"9&	c #E0B904",
+"0&	c #F4A802",
+"a&	c #FBC401",
+"b&	c #FCC000",
+"c&	c #FCF500",
+"d&	c #F69202",
+"e&	c #EAD703",
+"f&	c #EADC03",
+"g&	c #F69002",
+"h&	c #FBC200",
+"i&	c #FC8E00",
+"j&	c #FAAF01",
+"k&	c #F7F402",
+"l&	c #F5A801",
+"m&	c #F2B302",
+"n&	c #EDDF03",
+"o&	c #EEC202",
+"p&	c #F2B102",
+"q&	c #F0E703",
+"r&	c #EB9F02",
+"s&	c #DBC204",
+"t&	c #B89705",
+"u&	c #1A1480",
+"v&	c #0101A8",
+"w&	c #000006",
+"x&	c #000062",
+"y&	c #00005A",
+"z&	c #000056",
+"A&	c #00002E",
+"B&	c #030291",
+"C&	c #1D1546",
+"D&	c #CBA905",
+"E&	c #EBB703",
+"F&	c #F6C601",
+"G&	c #FAF301",
+"H&	c #F9EA01",
+"I&	c #EEA702",
+"J&	c #DFC903",
+"K&	c #DEC704",
+"L&	c #EFA202",
+"M&	c #F9C501",
+"N&	c #F99301",
+"O&	c #F4C702",
+"P&	c #EDE003",
+"Q&	c #EDA002",
+"R&	c #E6B903",
+"S&	c #DDC404",
+"T&	c #E2C004",
+"U&	c #EDAB03",
+"V&	c #EDE102",
+"W&	c #E2A403",
+"X&	c #C0A503",
+"Y&	c #06058D",
+"Z&	c #020282",
+"`&	c #0000AE",
+" *	c #000017",
+".*	c #000008",
+"+*	c #000050",
+"@*	c #010070",
+"#*	c #1C1239",
+"$*	c #D2AD05",
+"%*	c #E5B703",
+"&*	c #EDD803",
+"**	c #EDC603",
+"=*	c #EDD502",
+"-*	c #DFAE03",
+";*	c #C9AB04",
+">*	c #CAAB05",
+",*	c #E6B303",
+"'*	c #F6C302",
+")*	c #F49B01",
+"!*	c #EAD102",
+"~*	c #E1CB04",
+"{*	c #E19603",
+"]*	c #D3B504",
+"^*	c #C4A305",
+"/*	c #D0B205",
+"(*	c #E3A603",
+"_*	c #E7D603",
+":*	c #D6A603",
+"<*	c #B99205",
+"[*	c #C8A306",
+"}*	c #CEA704",
+"|*	c #CBA604",
+"1*	c #B99505",
+"2*	c #AC8606",
+"3*	c #D4B105",
+"4*	c #ECBF03",
+"5*	c #E9A402",
+"6*	c #DCC304",
+"7*	c #CCAE05",
+"8*	c #CA8F04",
+"9*	c #B79805",
+"0*	c #B18E06",
+"a*	c #CD9805",
+"b*	c #D3B703",
+"c*	c #C29B04",
+"d*	c #B08906",
+"e*	c #D0AD05",
+"f*	c #D0A204",
+"g*	c #BC9C05",
+"                                        . + @ # $ % & *                                         ",
+"                                  = - ; > , ' ) ! ~ { ] ^ / (                                   ",
+"                            _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b * c                             ",
+"                          d e f 4 g h                     i j k l m n                           ",
+"                        o p q r                                 s t n u v                       ",
+"                    w x y z                                         A B C D                     ",
+"                  E F G H                                             t B I J                   ",
+"                  K L M                                                 N O P Q                 ",
+"                R S M                                                     T U t                 ",
+"              V W X                                                         u C Y               ",
+"              Z ` g                                                          .m t               ",
+"              ..+.                                                            m l i             ",
+"            @.#.$.                                                            %.( j             ",
+"            &.*.$.                                                              ^ =.            ",
+"            -.;.                              >.,.                              '.).            ",
+"            !.~.                      {.      ].^.                              /.).            ",
+"          (._.:.    <.              [.}.|.  1.2.3.        4.5.            6.    7.8.D           ",
+"        9.0.a.b.    c.d.          e.f.g.h.i.j.k.l.m.n.  o.p.q.            r.    s.t.n T         ",
+"      u.v.w.x.3     y.z.        A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.            P.    Q.R.S.P T.      ",
+"    U.V.W.X.Y.3     y.z.        Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+            P.    ,+'+)+!+~+Y.    ",
+"    {+]+^+/+(+3     y._+      :+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+            P.    ,+b+c+d+e+f+(+  ",
+"  g+h+i+j+u (+3     y._+    k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+    E+F+    ,+b+G+H+I+J+K+  ",
+"  L+M+N+O+I (+3     P+Q+    R+S+T+U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@  ;@>@    ,+b+G+,@'@)@!@  ",
+"  ~@{@]@& I (+3     ^@/@  (@_@:@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@g at h@    ,+b+G+& d+i at j@b.",
+"k at l@m at n@* c (+3     o at p@  q at r@s at t@u at v@w at x@y at z@A at B@C at D@E at F@G at H@I at J@K at L@M at N@O@    ,+b+G+P at Q@e+j at R@",
+"S at T@U at V@* c (+3     W at X@Y at Z@`@ #.#+#@###$# #%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#    ,+b+G+P@(#_#!@6 ",
+":#<#[#}#* c (+3     |#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#(#    ,+b+G+P at H+q#!@r#",
+"# s#t#u#, at c (+3     v#w#x#y#z#A#=#B#C#D#D#E#F#G#H#I#J#K#L#M#N#O#-#P#Q#R#S#(#    ,+b+G+P@( P j at 4 ",
+"@ $ T#U#, at c (+V#    W#X#Y#Z#G#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$I#)$!$~${$]$^$    ,+b+G+P at H+v /$($",
+"_$:$<$u#, at c (+V#    [$}$|$,$1$-#2$)$3$1$4$5$6$7$8$9$0$0$a$a$b$c$d$e$f$g$h$i$    ,+b+G+P@/#N j$k$",
+"H+l$m$n$, at c (+V#o$  p$q$r$d$3$s$t$u$2$v$w$x$y$z$c$A$A$B$C$d$)$-$D$E$F$G$H$i$    ,+b+G+P at I$)@3 J$",
+"  + K$L$, at c (+V#M$  N$O$P$B$&#&$Q$R$S$T$U$V$3$4$2$W$X$Y$Z$`$ %.%+%@%#%$%%%i$    ,+b+G+& '@Y &%k$",
+"  m *%^ =%I (+V#-%  ;%>%,%'%)%!%~%{%+%]%C#^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%    ,+b+G+* v 7 9%  ",
+"  d+, at 0%a%c (+V#b%  c%d%e%f%g%6 at h%i%j%k%l%v$m%n%1%C at o%{%p%q%r%s%t%u%v%w%x%(#    ,+b+y%C z%h H   ",
+"    d+(#m n (+V#A%  B%C%D%E%i%F%7#G%H%I%J%K%5%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%/#    ,+Z%`% &R at .&+&  ",
+"    @&l C #&$&3     %&&&*&=&-&;&>&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&3&4&h@    ,+5&h at i 9%M     ",
+"      P 6&B Q 3     7&8&9&0&a&a#b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&  u&>@    ,+v&$&+&w&      ",
+"        x&y&z&A&    B&C&D&E&F&G&n+H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&    Y&Z&    `&_# *.*        ",
+"          +*8 A&    @*#*  $*%*&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*        x&    u $. *          ",
+"                            <*[*}*|*1*  2*3*4*5*6*7*8*9*  0*a*b*c*                              ",
+"                                          d*e*f*g*                                              ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments.h b/images/MusicalInstruments.h
new file mode 100644
index 0000000..b4fa666
--- /dev/null
+++ b/images/MusicalInstruments.h
@@ -0,0 +1,41 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  MusicalInstruments.h
+
+  Vaughan Johnson, January 2007
+
+  Includes musical instrument images for use in MixerTrackCluster.
+
+**********************************************************************/
+
+#include "MusicalInstruments/acoustic_guitar_gtr.xpm"
+#include "MusicalInstruments/acoustic_piano_pno.xpm"
+#include "MusicalInstruments/back_vocal_bg_vox.xpm"
+#include "MusicalInstruments/clap.xpm"
+
+#include "MusicalInstruments/drums_dr.xpm"
+#include "MusicalInstruments/electric_bass_guitar_bs_gtr.xpm"
+#include "MusicalInstruments/electric_guitar_gtr.xpm"
+#include "MusicalInstruments/electric_piano_pno_key.xpm"
+
+#include "MusicalInstruments/kick.xpm"
+#include "MusicalInstruments/loop.xpm"
+#include "MusicalInstruments/organ_org.xpm"
+#include "MusicalInstruments/perc.xpm"
+
+#include "MusicalInstruments/sax.xpm"
+#include "MusicalInstruments/snare.xpm"
+#include "MusicalInstruments/string_violin_cello.xpm"
+#include "MusicalInstruments/synth.xpm"
+
+#include "MusicalInstruments/tambo.xpm"
+#include "MusicalInstruments/trumpet_horn.xpm"
+#include "MusicalInstruments/turntable.xpm"
+#include "MusicalInstruments/vibraphone_vibes.xpm"
+
+#include "MusicalInstruments/vocal_vox.xpm"
+
+// This one should always be last, so it wins when best score is 0.
+#include "MusicalInstruments/_default_instrument.xpm"
diff --git a/images/MusicalInstruments/_default_instrument.xpm b/images/MusicalInstruments/_default_instrument.xpm
new file mode 100644
index 0000000..7413d68
--- /dev/null
+++ b/images/MusicalInstruments/_default_instrument.xpm
@@ -0,0 +1,781 @@
+/* XPM */
+static char * _default_instrument_xpm[] = {
+"48 48 730 2",
+"  	c #969696",
+". 	c #0303BF",
+"+ 	c #0202BD",
+"@ 	c #0303BA",
+"# 	c #0404B7",
+"$ 	c #0303B3",
+"% 	c #0202B0",
+"& 	c #0101AD",
+"* 	c #0101A9",
+"= 	c #0000A6",
+"- 	c #0000A2",
+"; 	c #0808C7",
+"> 	c #0A0AC5",
+", 	c #1515C1",
+"' 	c #1212A8",
+") 	c #0C0C87",
+"! 	c #07076B",
+"~ 	c #05055A",
+"{ 	c #030352",
+"] 	c #020253",
+"^ 	c #02025B",
+"/ 	c #020269",
+"( 	c #01017C",
+"_ 	c #01018F",
+": 	c #01019A",
+"< 	c #000098",
+"[ 	c #000095",
+"} 	c #1515CB",
+"| 	c #2222B7",
+"1 	c #181877",
+"2 	c #04043B",
+"3 	c #00002A",
+"4 	c #000027",
+"5 	c #00002B",
+"6 	c #000030",
+"7 	c #000031",
+"8 	c #000034",
+"9 	c #00003A",
+"0 	c #000045",
+"a 	c #000051",
+"b 	c #00006F",
+"c 	c #01018A",
+"d 	c #00008F",
+"e 	c #00008A",
+"f 	c #1111CD",
+"g 	c #3232C3",
+"h 	c #1E1E6E",
+"i 	c #000025",
+"j 	c #00004A",
+"k 	c #000053",
+"l 	c #00006D",
+"m 	c #000088",
+"n 	c #000082",
+"o 	c #1E1ED0",
+"p 	c #3E3EA8",
+"q 	c #05052E",
+"r 	c #00001F",
+"s 	c #000056",
+"t 	c #000060",
+"u 	c #00007F",
+"v 	c #00007D",
+"w 	c #000077",
+"x 	c #2323D1",
+"y 	c #37378F",
+"z 	c #01011E",
+"A 	c #000026",
+"B 	c #000066",
+"C 	c #00007C",
+"D 	c #000078",
+"E 	c #00006E",
+"F 	c #1B1BD0",
+"G 	c #363690",
+"H 	c #00001B",
+"I 	c #000081",
+"J 	c #000070",
+"K 	c #0C0CCC",
+"L 	c #3A3AB1",
+"M 	c #010120",
+"N 	c #000079",
+"O 	c #000086",
+"P 	c #000062",
+"Q 	c #2828CA",
+"R 	c #0C0C42",
+"S 	c #000085",
+"T 	c #000058",
+"U 	c #0909C7",
+"V 	c #22228F",
+"W 	c #00001E",
+"X 	c #00008D",
+"Y 	c #1212C2",
+"Z 	c #080844",
+"` 	c #000028",
+" .	c #000097",
+"..	c #01016C",
+"+.	c #000046",
+"@.	c #1111AE",
+"#.	c #000029",
+"$.	c #00009D",
+"%.	c #010185",
+"&.	c #000041",
+"*.	c #0101BB",
+"=.	c #0A0A93",
+"-.	c #F8C707",
+";.	c #F4BB07",
+">.	c #020298",
+",.	c #0000B5",
+"'.	c #070783",
+").	c #00002E",
+"!.	c #F8C208",
+"~.	c #F3C507",
+"{.	c #F2BC08",
+"].	c #F7C206",
+"^.	c #F4AD06",
+"/.	c #DBB506",
+"(.	c #F7BC07",
+"_.	c #EFC307",
+":.	c #0303A3",
+"<.	c #00003C",
+"[.	c #0404BE",
+"}.	c #0F0F84",
+"|.	c #F8C009",
+"1.	c #F8BB06",
+"2.	c #F4C006",
+"3.	c #E9BD07",
+"4.	c #EFBF07",
+"5.	c #F7AA05",
+"6.	c #F4B205",
+"7.	c #E0BD06",
+"8.	c #F2BD08",
+"9.	c #F7AF06",
+"0.	c #EEC606",
+"a.	c #0808AB",
+"b.	c #010147",
+"c.	c #0B0BCC",
+"d.	c #1313CD",
+"e.	c #1E1E79",
+"f.	c #000033",
+"g.	c #3E3EC0",
+"h.	c #00006C",
+"i.	c #F8CD07",
+"j.	c #F9C105",
+"k.	c #F5B605",
+"l.	c #EAC206",
+"m.	c #EDC307",
+"n.	c #F7A204",
+"o.	c #F7B404",
+"p.	c #EDCF05",
+"q.	c #E1BB06",
+"r.	c #E3B607",
+"s.	c #F2C407",
+"t.	c #F6A305",
+"u.	c #ECC406",
+"v.	c #3A3AB2",
+"w.	c #1919B9",
+"x.	c #15158D",
+"y.	c #0909CD",
+"z.	c #1111CE",
+"A.	c #2F2FBD",
+"B.	c #000044",
+"C.	c #000032",
+"D.	c #0606A7",
+"E.	c #04044E",
+"F.	c #F9C407",
+"G.	c #FADD05",
+"H.	c #FAC503",
+"I.	c #F6A804",
+"J.	c #ECC906",
+"K.	c #EFC906",
+"L.	c #F89904",
+"M.	c #FAB503",
+"N.	c #F6E104",
+"O.	c #F1BE05",
+"P.	c #ECC606",
+"Q.	c #F2CC06",
+"R.	c #F59504",
+"S.	c #EABF05",
+"T.	c #070789",
+"U.	c #0303B1",
+"V.	c #4444C0",
+"W.	c #0A0ACC",
+"X.	c #0F0FCE",
+"Y.	c #9090E5",
+"Z.	c #1B1B8C",
+"`.	c #0505A6",
+" +	c #06054B",
+".+	c #F9C908",
+"++	c #FBBA05",
+"@+	c #FCEC03",
+"#+	c #FCC502",
+"$+	c #F89603",
+"%+	c #F0D105",
+"&+	c #F1CF05",
+"*+	c #F99503",
+"=+	c #FCB302",
+"-+	c #FBED02",
+";+	c #F7B603",
+">+	c #F1D305",
+",+	c #F4D305",
+"'+	c #F58A04",
+")+	c #EBC105",
+"!+	c #C39F06",
+"~+	c #060688",
+"{+	c #0000AF",
+"]+	c #2121BA",
+"^+	c #050591",
+"/+	c #00005E",
+"(+	c #0404CA",
+"_+	c #6A6ADE",
+":+	c #6E6ECA",
+"<+	c #00006A",
+"[+	c #07054B",
+"}+	c #F6C408",
+"|+	c #FAD606",
+"1+	c #FBB603",
+"2+	c #FDEF02",
+"3+	c #FDC001",
+"4+	c #FA8802",
+"5+	c #F2D804",
+"6+	c #F3D505",
+"7+	c #FB9202",
+"8+	c #FDB401",
+"9+	c #FDF401",
+"0+	c #FAA502",
+"a+	c #F5DC04",
+"b+	c #F5DB04",
+"c+	c #F78603",
+"d+	c #EDC205",
+"e+	c #D5B006",
+"f+	c #CFA806",
+"g+	c #060687",
+"h+	c #0000B0",
+"i+	c #0B0BB3",
+"j+	c #0A0A9C",
+"k+	c #00005B",
+"l+	c #0404C7",
+"m+	c #1717CA",
+"n+	c #8383DC",
+"o+	c #0D0D9A",
+"p+	c #000064",
+"q+	c #09064A",
+"r+	c #E3B008",
+"s+	c #F9BD06",
+"t+	c #FBE304",
+"u+	c #FCB702",
+"v+	c #FEF201",
+"w+	c #FEB401",
+"x+	c #FC8101",
+"y+	c #F6DC04",
+"z+	c #FC8502",
+"A+	c #FEAE01",
+"B+	c #FEF501",
+"C+	c #FD8D01",
+"D+	c #F9E203",
+"E+	c #F9E703",
+"F+	c #F98503",
+"G+	c #F1C604",
+"H+	c #E8C406",
+"I+	c #EBBE06",
+"J+	c #EDC306",
+"K+	c #050586",
+"L+	c #0909B2",
+"M+	c #09099F",
+"N+	c #000083",
+"O+	c #000063",
+"P+	c #000049",
+"Q+	c #0101C3",
+"R+	c #3B3BCE",
+"S+	c #3C3CBB",
+"T+	c #01018D",
+"U+	c #0B084A",
+"V+	c #E9B908",
+"W+	c #FABE04",
+"X+	c #FCED02",
+"Y+	c #FEB301",
+"Z+	c #FFF400",
+"`+	c #FEA701",
+" @	c #FD7A01",
+".@	c #F8E003",
+"+@	c #F8E403",
+"@@	c #FD7F01",
+"#@	c #FEA601",
+"$@	c #FFED00",
+"%@	c #FE7B01",
+"&@	c #FDD202",
+"*@	c #FCF102",
+"=@	c #FB8502",
+"-@	c #F6CD03",
+";@	c #F2D505",
+">@	c #F5BB04",
+",@	c #F6CC04",
+"'@	c #EDCC05",
+")@	c #73605A",
+"!@	c #0909B1",
+"~@	c #0909A0",
+"{@	c #0202C0",
+"]@	c #0202BF",
+"^@	c #4040C9",
+"/@	c #0F0FA1",
+"(@	c #00008B",
+"_@	c #120D48",
+":@	c #EDC207",
+"<@	c #FBB704",
+"[@	c #FEF302",
+"}@	c #FEAD01",
+"|@	c #FFF500",
+"1@	c #FE9601",
+"2@	c #FE7201",
+"3@	c #FBE202",
+"4@	c #FBE802",
+"5@	c #FE7701",
+"6@	c #FE9B01",
+"7@	c #FFD500",
+"8@	c #FF7001",
+"9@	c #FEB501",
+"0@	c #FEF901",
+"a@	c #FD8101",
+"b@	c #FACA02",
+"c@	c #FAB002",
+"d@	c #FCE102",
+"e@	c #F5C504",
+"f@	c #8D784B",
+"g@	c #0D0B41",
+"h@	c #00004D",
+"i@	c #00003F",
+"j@	c #0101BC",
+"k@	c #0505BC",
+"l@	c #2D2DBD",
+"m@	c #040497",
+"n@	c #040331",
+"o@	c #0606A6",
+"p@	c #271F43",
+"q@	c #DAB006",
+"r@	c #F4D206",
+"s@	c #FCAE03",
+"t@	c #FEA201",
+"u@	c #FFF000",
+"v@	c #FF7E01",
+"w@	c #FE6A01",
+"x@	c #FDE201",
+"y@	c #FDE001",
+"z@	c #FE6E01",
+"A@	c #FF8D00",
+"B@	c #FFA800",
+"C@	c #FF6400",
+"D@	c #FF8B00",
+"E@	c #FFF200",
+"F@	c #FE7601",
+"G@	c #FDC301",
+"H@	c #FCF202",
+"I@	c #FD9901",
+"J@	c #FEEC01",
+"K@	c #F9B103",
+"L@	c #9C8A43",
+"M@	c #27203A",
+"N@	c #010190",
+"O@	c #00007E",
+"P@	c #000052",
+"Q@	c #0101B7",
+"R@	c #0606B9",
+"S@	c #1D1DB2",
+"T@	c #020294",
+"U@	c #0A072F",
+"V@	c #0707A5",
+"W@	c #3F353D",
+"X@	c #F2CF04",
+"Y@	c #FBE303",
+"Z@	c #FD9602",
+"`@	c #FFFB00",
+" #	c #FF9201",
+".#	c #FFDB00",
+"+#	c #FF6200",
+"@#	c #FF5F00",
+"##	c #FECD01",
+"$#	c #FEC901",
+"%#	c #FF7E00",
+"&#	c #FF7D00",
+"*#	c #FF5600",
+"=#	c #FF6800",
+"-#	c #FFCA00",
+";#	c #FF6700",
+">#	c #FEF301",
+",#	c #FFDD00",
+"'#	c #FC8F02",
+")#	c #A79A3E",
+"!#	c #463934",
+"~#	c #241D71",
+"{#	c #010191",
+"]#	c #000055",
+"^#	c #0000B3",
+"/#	c #0505B4",
+"(#	c #1313AB",
+"_#	c #010193",
+":#	c #0F092E",
+"<#	c #0908A4",
+"[#	c #4B3C3A",
+"}#	c #FBCF02",
+"|#	c #FDB601",
+"1#	c #FE6F01",
+"2#	c #FF7700",
+"3#	c #FFB700",
+"4#	c #FF3D00",
+"5#	c #FF5100",
+"6#	c #FFAB00",
+"7#	c #FFA300",
+"8#	c #FF7100",
+"9#	c #FF5300",
+"0#	c #FF3F00",
+"a#	c #FF3E00",
+"b#	c #FF7F00",
+"c#	c #FF6F00",
+"d#	c #FFC300",
+"e#	c #FF5200",
+"f#	c #FFB101",
+"g#	c #FE5E01",
+"h#	c #AC9D3C",
+"i#	c #594930",
+"j#	c #31276B",
+"k#	c #000084",
+"l#	c #0303B0",
+"m#	c #0D0DA7",
+"n#	c #010192",
+"o#	c #120C2D",
+"p#	c #0A09A4",
+"q#	c #4D2B3A",
+"r#	c #FED001",
+"s#	c #FE6101",
+"t#	c #FF4701",
+"u#	c #FFD400",
+"v#	c #FF4700",
+"w#	c #FF8500",
+"x#	c #FF1B00",
+"y#	c #FF4000",
+"z#	c #FF8800",
+"A#	c #FF7500",
+"B#	c #FF4100",
+"C#	c #FF2600",
+"D#	c #FF2500",
+"E#	c #FF2800",
+"F#	c #FF3500",
+"G#	c #FF2E00",
+"H#	c #FF6600",
+"I#	c #FF3200",
+"J#	c #FF6300",
+"K#	c #FE3601",
+"L#	c #AD813C",
+"M#	c #5F4D2F",
+"N#	c #342A68",
+"O#	c #000054",
+"P#	c #000024",
+"Q#	c #0000AA",
+"R#	c #0101AB",
+"S#	c #0909A5",
+"T#	c #150E2D",
+"U#	c #0B09A3",
+"V#	c #4E1839",
+"W#	c #FEB801",
+"X#	c #FF3900",
+"Y#	c #FF2900",
+"Z#	c #FF7B00",
+"`#	c #FF1800",
+" $	c #FF3300",
+".$	c #FF4D00",
+"+$	c #FF2B00",
+"@$	c #FF0F00",
+"#$	c #FF1000",
+"$$	c #FF0D00",
+"%$	c #FF0E00",
+"&$	c #FF1200",
+"*$	c #FF1600",
+"=$	c #FF1500",
+"-$	c #FF1C00",
+";$	c #FF2100",
+">$	c #AC543C",
+",$	c #5E4D2F",
+"'$	c #332968",
+")$	c #000080",
+"!$	c #00004E",
+"~$	c #000021",
+"{$	c #0000A7",
+"]$	c #0606A4",
+"^$	c #170F2D",
+"/$	c #AD7E0A",
+"($	c #0B0AA3",
+"_$	c #4E1339",
+":$	c #FE8E00",
+"<$	c #FF2000",
+"[$	c #FF1F00",
+"}$	c #FF1700",
+"|$	c #FF2200",
+"1$	c #FF5B00",
+"2$	c #FF4800",
+"3$	c #FF2F00",
+"4$	c #FF1A00",
+"5$	c #FF0C00",
+"6$	c #FF1300",
+"7$	c #FF1D00",
+"8$	c #AC263C",
+"9$	c #5E4C2F",
+"0$	c #00007A",
+"a$	c #00001C",
+"b$	c #0000A0",
+"c$	c #0303A1",
+"d$	c #020296",
+"e$	c #19112D",
+"f$	c #B5850A",
+"g$	c #0C0AA2",
+"h$	c #4F1239",
+"i$	c #FE6201",
+"j$	c #FF1900",
+"k$	c #FF4200",
+"l$	c #FF2300",
+"m$	c #FF3100",
+"n$	c #FF9D00",
+"o$	c #FF5700",
+"p$	c #FF2700",
+"q$	c #FF5000",
+"r$	c #FF2C00",
+"s$	c #AB2D3C",
+"t$	c #01018E",
+"u$	c #000036",
+"v$	c #01019C",
+"w$	c #1C132D",
+"x$	c #BC8B0A",
+"y$	c #0C0BA2",
+"z$	c #4F1339",
+"A$	c #FE3B01",
+"B$	c #FF9600",
+"C$	c #FF3B00",
+"D$	c #FF8400",
+"E$	c #FF8900",
+"F$	c #FFD000",
+"G$	c #FF5800",
+"H$	c #FF3600",
+"I$	c #FF3C00",
+"J$	c #FFB500",
+"K$	c #FF7501",
+"L$	c #FF4900",
+"M$	c #FFBC00",
+"N$	c #FE4C01",
+"O$	c #AB6B3C",
+"P$	c #000022",
+"Q$	c #000091",
+"R$	c #010197",
+"S$	c #00008C",
+"T$	c #BD8B0A",
+"U$	c #4E2739",
+"V$	c #FE4E01",
+"W$	c #FF4B01",
+"X$	c #FFAA00",
+"Y$	c #FF9400",
+"Z$	c #FF7400",
+"`$	c #FFA601",
+" %	c #FFF100",
+".%	c #FF6C01",
+"+%	c #FFC900",
+"@%	c #FF8A00",
+"#%	c #FF6B00",
+"$%	c #FFEE00",
+"%%	c #FED901",
+"&%	c #FEE401",
+"*%	c #FE8401",
+"=%	c #FD9601",
+"-%	c #AA963D",
+";%	c #574530",
+">%	c #302669",
+",%	c #09099E",
+"'%	c #000014",
+")%	c #000089",
+"!%	c #000090",
+"~%	c #19102D",
+"{%	c #AE7C0B",
+"]%	c #4E4439",
+"^%	c #FC7301",
+"/%	c #FFAF00",
+"(%	c #FEB000",
+"_%	c #FEBC01",
+":%	c #FEF601",
+"<%	c #FE8F01",
+"[%	c #FFA100",
+"}%	c #FFA801",
+"|%	c #FE9801",
+"1%	c #FEFB00",
+"2%	c #FE9101",
+"3%	c #FDE801",
+"4%	c #FDE401",
+"5%	c #FDA301",
+"6%	c #F9BD03",
+"7%	c #A28F41",
+"8%	c #423334",
+"9%	c #221A6E",
+"0%	c #050593",
+"a%	c #000087",
+"b%	c #000068",
+"c%	c #110B2E",
+"d%	c #493F3B",
+"e%	c #F99902",
+"f%	c #FFE800",
+"g%	c #FFBE00",
+"h%	c #FED101",
+"i%	c #FDBF02",
+"j%	c #FBEC03",
+"k%	c #FDAB02",
+"l%	c #FE9F01",
+"m%	c #FE9201",
+"n%	c #FDBA01",
+"o%	c #FDF202",
+"p%	c #FCAB02",
+"q%	c #FCE202",
+"r%	c #FBDF02",
+"s%	c #F6DF04",
+"t%	c #EEC205",
+"u%	c #8A7149",
+"v%	c #20173A",
+"w%	c #100C75",
+"x%	c #0606AE",
+"y%	c #010172",
+"z%	c #00000C",
+"A%	c #000072",
+"B%	c #000069",
+"C%	c #070430",
+"D%	c #0706A5",
+"E%	c #40333D",
+"F%	c #F4BD04",
+"G%	c #FCCE02",
+"H%	c #FEC401",
+"I%	c #FEC301",
+"J%	c #FDE601",
+"K%	c #FABE03",
+"L%	c #F7DF04",
+"M%	c #FAC003",
+"N%	c #FDAC01",
+"O%	c #FEAF01",
+"P%	c #FDB101",
+"Q%	c #FCF002",
+"R%	c #FBB302",
+"S%	c #F8E303",
+"T%	c #FABA03",
+"U%	c #FADD02",
+"V%	c #F9DD03",
+"W%	c #F5B304",
+"X%	c #E7C306",
+"Y%	c #D0A507",
+"Z%	c #624B56",
+"`%	c #090740",
+" &	c #010195",
+".&	c #00003B",
+"+&	c #00000F",
+"@&	c #000018",
+"#&	c #00005C",
+"$&	c #000039",
+"%&	c #010133",
+"&&	c #03029E",
+"*&	c #34273D",
+"=&	c #EBBF06",
+"-&	c #F8D104",
+";&	c #FBCD02",
+">&	c #FDF501",
+",&	c #FCC702",
+"'&	c #FCEA02",
+")&	c #F5BD04",
+"!&	c #F1D105",
+"~&	c #F7CE04",
+"{&	c #FCB002",
+"]&	c #FDB701",
+"^&	c #FBC602",
+"/&	c #F9E403",
+"(&	c #F8B203",
+"_&	c #F4CE04",
+":&	c #F1D205",
+"<&	c #F6C204",
+"[&	c #F9D803",
+"}&	c #F7DA03",
+"|&	c #EFB605",
+"1&	c #D0A906",
+"2&	c #2E2267",
+"3&	c #02027D",
+"4&	c #030342",
+"5&	c #0000A5",
+"6&	c #00000D",
+"7&	c #000019",
+"8&	c #020173",
+"9&	c #493234",
+"0&	c #D6A208",
+"a&	c #ECC307",
+"b&	c #F4C805",
+"c&	c #F7DE04",
+"d&	c #F7CC04",
+"e&	c #F4DA04",
+"f&	c #ECBD06",
+"g&	c #E6BD06",
+"h&	c #F1CE06",
+"i&	c #FABB03",
+"j&	c #FBBD02",
+"k&	c #F7D304",
+"l&	c #F3D605",
+"m&	c #F3B004",
+"n&	c #ECC706",
+"o&	c #EFC406",
+"p&	c #F4D304",
+"q&	c #E7B806",
+"r&	c #BB9506",
+"s&	c #D09909",
+"t&	c #DDAB08",
+"u&	c #E2B407",
+"v&	c #E3B507",
+"w&	c #DEB207",
+"x&	c #D1A407",
+"y&	c #D09E08",
+"z&	c #E7BB07",
+"A&	c #F5CB05",
+"B&	c #F6C104",
+"C&	c #F0CE05",
+"D&	c #E8C106",
+"E&	c #E6B406",
+"F&	c #DBB106",
+"G&	c #D1A207",
+"H&	c #DFAF07",
+"I&	c #EABD07",
+"J&	c #E9C006",
+"K&	c #D7AD06",
+"L&	c #D29B09",
+"M&	c #E6B707",
+"N&	c #E8BA06",
+"O&	c #DCB206",
+"P&	c #CD9F07",
+"Q&	c #C99A07",
+"R&	c #B98C07",
+"S&	c #CC9808",
+"T&	c #CA9908",
+"U&	c #B48807",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                      . + @ # $ % & * = -                                       ",
+"                                ; > , ' ) ! ~ { ] ^ / ( _ : < [                                 ",
+"                              } | 1 2 3 4 4 5 5 6 7 8 9 0 a b c d e                             ",
+"                          f g h i i                         j k l m n                           ",
+"                        o p q r                                 s t u v w                       ",
+"                      x y z A                                       B C D E                     ",
+"                    F G H                                             b I J                     ",
+"                  K L M                                                 N O P                   ",
+"                  Q R A                                                   S w T                 ",
+"                U V W                                                     e X s                 ",
+"                Y Z `                                                        ...+.              ",
+"                @.#.                                                        $.%.&.              ",
+"              *.=.5                           -.;.                            >.&.              ",
+"              ,.'.).                  !.~.  {.].^./.      (._.                :.<.              ",
+"              [.}.8                 |.1.2.3.4.5.6.7.    8.9.0.                a.b.              ",
+"            c.d.e.f.  g.h.          i.j.k.l.m.n.o.p.q.r.s.t.u.          v.    w.x.C             ",
+"          y.z.A.B.C.  D.E.        F.G.H.I.J.K.L.M.N.O.P.Q.R.S.          T.    U.V.I l           ",
+"        W.X.Y.Z.f.C.  `. +      .+++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+        ~+    {+]+^+b /+        ",
+"        (+_+:+<+7 C.  `.[+    }+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+      g+    h+i+j+D k+s       ",
+"      l+m+n+o+p+7 C.  `.q+  r+s+t+u+v+w+x+b+y+z+A+B+C+D+E+F+G+H+I+J+    K+    h+L+M+N+O+P+      ",
+"      Q+R+S+T+p+7 C.  `.U+  V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@K+    h+!@~@e E P+P+    ",
+"    {@]@^@/@(@p+7 f.  `._@  :@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@+ at c@d at e@f at K+g@  h+!@~@_ w h at i@    ",
+"    j at k@l at m@(@p+7 n@  o at p@q at r@s at 0@t at u@v at w@x at y@z at A@B at C@D at E@F at G@H at I@J at K@L at K+M@  h+!@~@N at O@P at 8     ",
+"    Q at R@S at T@(@p+7 U@  V at W@X at Y@Z@`@ #.#+#@###$#C@%#&#*#=#-#;##@>#F@,#'#)#K+!#~#h+!@~@{#n ]#).    ",
+"    ^#/#(#_#(@p+7 :#  <#[#}#|#1#|@2#3#4#5#6#7#*#8#9#0#a#b#9#c#d#e#f#g#h#K+i#j#h+!@~@{#k#s 5     ",
+"    {+l#m#n#(@p+7 o#  p#q#r#s#t#u#v#w#x#y#z#A#B#@#C#D#E#F#G#0#H#I#J#K#L#K+M#N#h+!@~@{#N+O#A P#  ",
+"    Q#R#S#_#(@p+7 T#  U#V#W#X#Y#Z#C#y#`# $C at .$+$G#@$#$$$%$&$*$`#=$-$;$>$K+,$'$h+!@~@{#)$!$~$    ",
+"    = {$]$T@(@p+7 ^$/$($_$:$<$[$C#}$|$[$1$2$3$4$$$@$5$@$&$5$*$*$6$&$7$8$K+9$'$h+!@~@N at 0$B.a$    ",
+"    - b$c$d$(@p+7 e$f$g$h$i$j$k$l$m$m$1$n$v#;$<$-$Y#<$-$o$p$E#q$r$a#+$s$K+,$'$h+!@~@t$E u$a$    ",
+"      < v$>.(@p+7 w$x$y$z$A$E#B$C$D$y#E$F$5#m$G$H$w#.$I$J$q$K$,#L$M$N$O$K+9$'$h+!@~@m k+i P$    ",
+"      Q$[ R$S$p+7 w$T$y$U$V$W$X$Y$6#Z$`$ %.%Z#8#*#+%@%#%$%8@%%&%*%Z+=%-%K+;%>%h+!@,%w &.'%4     ",
+"      d )%!%X p+7 ~%{%($]%^%6@/%F$3#(%_%:%<%[%z#8# %}%|%1%2%3%4%5%9+6%7%K+8%9%h+!@0%T P#'%      ",
+"        u I a%b%7 c%  <#d%e%G at 9@f%g%h%i%j%k%`+l%m%0 at w+n%o%p%q%r%c at s%t%u%K+v%w%h+x%y%7 z%P$      ",
+"          b A%B%f.C%  D%E%F%G%H%|@I%J%K%L%M%N%O%P%Q%R%b at S%T%U%V%W%X%Y%Z%K+`%  {+ &.&+&@&        ",
+"          E #&s $&%&  &&*&=&-&;&>&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&1&  2&3&4&  5&h at 6&7&          ",
+"              h at u$9   8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&g&o&, at p&q&r&    t     P r P#            ",
+"                            s&t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&I&J&K&                              ",
+"                                          L&M&N&O&P&Q&R&    S&T&U&                              ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/acoustic_guitar_gtr.xpm b/images/MusicalInstruments/acoustic_guitar_gtr.xpm
new file mode 100644
index 0000000..7e8bb79
--- /dev/null
+++ b/images/MusicalInstruments/acoustic_guitar_gtr.xpm
@@ -0,0 +1,986 @@
+/* XPM */
+static char * acoustic_guitar_gtr_xpm[] = {
+"48 48 935 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #5F5F4F",
+"@ 	c #84774B",
+"# 	c #B49F49",
+"$ 	c #B9A748",
+"% 	c #978A49",
+"& 	c #635E4C",
+"* 	c #57554F",
+"= 	c #69604E",
+"- 	c #85794A",
+"; 	c #F1D946",
+"> 	c #FEEF63",
+", 	c #FEF769",
+"' 	c #FEF96B",
+") 	c #FEF96E",
+"! 	c #FEF261",
+"~ 	c #AE9C47",
+"{ 	c #878787",
+"] 	c #5A544E",
+"^ 	c #8B6D49",
+"/ 	c #B98746",
+"( 	c #AC7C46",
+"_ 	c #5B534A",
+": 	c #9B8947",
+"< 	c #FCEB5C",
+"[ 	c #FCEF62",
+"} 	c #FCEA61",
+"| 	c #FCEA62",
+"1 	c #FCEA63",
+"2 	c #FCEE62",
+"3 	c #FCF76A",
+"4 	c #FCFA73",
+"5 	c #D4BE43",
+"6 	c #767676",
+"7 	c #5D5B4F",
+"8 	c #886E48",
+"9 	c #A37345",
+"0 	c #B98344",
+"a 	c #A47344",
+"b 	c #AF7B44",
+"c 	c #715943",
+"d 	c #838486",
+"e 	c #7E7148",
+"f 	c #FBE75B",
+"g 	c #FBEA63",
+"h 	c #FBE661",
+"i 	c #FBE75F",
+"j 	c #FBE860",
+"k 	c #FBEB62",
+"l 	c #FBEC61",
+"m 	c #FBED63",
+"n 	c #FBF268",
+"o 	c #BAA042",
+"p 	c #636566",
+"q 	c #4F514E",
+"r 	c #816D48",
+"s 	c #AF8344",
+"t 	c #BA8443",
+"u 	c #B47C43",
+"v 	c #9D6E43",
+"w 	c #936943",
+"x 	c #936A43",
+"y 	c #755B3F",
+"z 	c #34383F",
+"A 	c #8E7E46",
+"B 	c #F9E055",
+"C 	c #F9E65F",
+"D 	c #F9E55A",
+"E 	c #F9E55D",
+"F 	c #F9E65D",
+"G 	c #F9E75E",
+"H 	c #F9E75D",
+"I 	c #F9E556",
+"J 	c #F9E658",
+"K 	c #F9EB5F",
+"L 	c #F9E45E",
+"M 	c #8E793F",
+"N 	c #665843",
+"O 	c #A77C42",
+"P 	c #B78041",
+"Q 	c #BA8541",
+"R 	c #AB7441",
+"S 	c #A06F41",
+"T 	c #946941",
+"U 	c #7E5F3B",
+"V 	c #473A2D",
+"W 	c #23262A",
+"X 	c #2A3038",
+"Y 	c #6F7276",
+"Z 	c #5B5C5C",
+"` 	c #6A6148",
+" .	c #8E7E44",
+"..	c #B39B41",
+"+.	c #C5A740",
+"@.	c #C0A440",
+"#.	c #AF9941",
+"$.	c #9F8B42",
+"%.	c #8E7E43",
+"&.	c #7E7345",
+"*.	c #776D45",
+"=.	c #907E43",
+"-.	c #D2B340",
+";.	c #F7E05A",
+">.	c #F7E361",
+",.	c #F7E258",
+"'.	c #F7E456",
+").	c #F7E25C",
+"!.	c #F7E25B",
+"~.	c #F7E256",
+"{.	c #F7E251",
+"].	c #F7E255",
+"^.	c #F7DF55",
+"/.	c #F7D747",
+"(.	c #DFB63F",
+"_.	c #BF8E3F",
+":.	c #B97D3F",
+"<.	c #B27B3F",
+"[.	c #B07A3F",
+"}.	c #A4733F",
+"|.	c #986C3F",
+"1.	c #83613B",
+"2.	c #59462E",
+"3.	c #202120",
+"4.	c #191D22",
+"5.	c #21262C",
+"6.	c #2B3239",
+"7.	c #6F7376",
+"8.	c #54514B",
+"9.	c #927C42",
+"0.	c #E0BD3D",
+"a.	c #F5D244",
+"b.	c #F5D64C",
+"c.	c #F5D94D",
+"d.	c #F5DA50",
+"e.	c #F5DB52",
+"f.	c #F5DB50",
+"g.	c #F5DC4E",
+"h.	c #F5DC50",
+"i.	c #F5DC54",
+"j.	c #F5E158",
+"k.	c #F5E05A",
+"l.	c #F5E054",
+"m.	c #F5E056",
+"n.	c #F5DE4D",
+"o.	c #F5D749",
+"p.	c #F5D74D",
+"q.	c #F5D74A",
+"r.	c #F5DA4B",
+"s.	c #F5DB4C",
+"t.	c #F5D33E",
+"u.	c #DBB53D",
+"v.	c #BD8D3D",
+"w.	c #A46A3D",
+"x.	c #B0753D",
+"y.	c #B0793D",
+"z.	c #9F713D",
+"A.	c #996A3D",
+"B.	c #8C643B",
+"C.	c #5C4630",
+"D.	c #2B2823",
+"E.	c #171B1F",
+"F.	c #1B2025",
+"G.	c #22282E",
+"H.	c #2A3138",
+"I.	c #323A43",
+"J.	c #786843",
+"K.	c #D9B43C",
+"L.	c #F3D044",
+"M.	c #F3D143",
+"N.	c #F3D03D",
+"O.	c #F3D23E",
+"P.	c #F3D241",
+"Q.	c #F3D441",
+"R.	c #F3D541",
+"S.	c #F3D643",
+"T.	c #F3D742",
+"U.	c #F3D741",
+"V.	c #F3D947",
+"W.	c #F3DA4B",
+"X.	c #F3DC48",
+"Y.	c #F3DB4C",
+"Z.	c #F3DC4D",
+"`.	c #F3D546",
+" +	c #E9C23B",
+".+	c #D1AC3B",
+"++	c #CAA33B",
+"@+	c #D6AB3B",
+"#+	c #DFB43B",
+"$+	c #CDA63B",
+"%+	c #B8883B",
+"&+	c #B2793B",
+"*+	c #B77B3B",
+"=+	c #B97E3B",
+"-+	c #A16F3B",
+";+	c #96693B",
+">+	c #8F653B",
+",+	c #634B33",
+"'+	c #342C25",
+")+	c #161A1E",
+"!+	c #1A1E23",
+"~+	c #20252B",
+"{+	c #272D34",
+"]+	c #2E363E",
+"^+	c #5B6166",
+"/+	c #836F40",
+"(+	c #EBC639",
+"_+	c #F1CE40",
+":+	c #EFCB39",
+"<+	c #ECC939",
+"[+	c #EECC39",
+"}+	c #F1CF3B",
+"|+	c #F1D03F",
+"1+	c #F1D13F",
+"2+	c #F1D33E",
+"3+	c #F1D440",
+"4+	c #F1D443",
+"5+	c #F1D543",
+"6+	c #F1D746",
+"7+	c #F1D748",
+"8+	c #F1D944",
+"9+	c #F1D439",
+"0+	c #DAB239",
+"a+	c #987C39",
+"b+	c #605539",
+"c+	c #614C39",
+"d+	c #7D5F39",
+"e+	c #826139",
+"f+	c #A36A39",
+"g+	c #C27C39",
+"h+	c #C28639",
+"i+	c #B87F39",
+"j+	c #A56E39",
+"k+	c #8F6239",
+"l+	c #8A6039",
+"m+	c #6D4733",
+"n+	c #191A1D",
+"o+	c #181C20",
+"p+	c #1E2328",
+"q+	c #252B32",
+"r+	c #2C343C",
+"s+	c #333B44",
+"t+	c #705F40",
+"u+	c #ECC136",
+"v+	c #EEC837",
+"w+	c #E9C636",
+"x+	c #EBC736",
+"y+	c #E9C736",
+"z+	c #E8C836",
+"A+	c #EECC36",
+"B+	c #EECE3B",
+"C+	c #EECF3E",
+"D+	c #EED13D",
+"E+	c #EED340",
+"F+	c #EED345",
+"G+	c #EED244",
+"H+	c #EED23E",
+"I+	c #EED43D",
+"J+	c #EED13E",
+"K+	c #EED240",
+"L+	c #EED441",
+"M+	c #E6BD36",
+"N+	c #8A7336",
+"O+	c #3D3B3B",
+"P+	c #4B3D38",
+"Q+	c #574436",
+"R+	c #594336",
+"S+	c #564136",
+"T+	c #835D36",
+"U+	c #BD8236",
+"V+	c #B07636",
+"W+	c #A76F36",
+"X+	c #B07A36",
+"Y+	c #986436",
+"Z+	c #904D36",
+"`+	c #56342C",
+" @	c #313942",
+".@	c #878686",
+"+@	c #D4AC34",
+"@@	c #ECC336",
+"#@	c #E4BF34",
+"$@	c #E5C234",
+"%@	c #E7C434",
+"&@	c #E7C534",
+"*@	c #E5C534",
+"=@	c #EAC834",
+"-@	c #ECCB38",
+";@	c #ECCF3A",
+">@	c #ECD043",
+",@	c #ECD045",
+"'@	c #ECCE3C",
+")@	c #ECCC36",
+"!@	c #ECCF38",
+"~@	c #ECCF3D",
+"{@	c #ECD341",
+"]@	c #ECCB40",
+"^@	c #C7A034",
+"/@	c #5D4B34",
+"(@	c #503F34",
+"_@	c #5D4934",
+":@	c #5B4534",
+"<@	c #594234",
+"[@	c #513F34",
+"}@	c #634934",
+"|@	c #976834",
+"1@	c #C08834",
+"2@	c #ECC034",
+"3@	c #B99234",
+"4@	c #774534",
+"5@	c #5D352C",
+"6@	c #232022",
+"7@	c #1F242A",
+"8@	c #2A3139",
+"9@	c #484E55",
+"0@	c #867138",
+"a@	c #E9BD33",
+"b@	c #E3B831",
+"c@	c #E3BD31",
+"d@	c #E2BF31",
+"e@	c #E5C131",
+"f@	c #E6C331",
+"g@	c #E5C331",
+"h@	c #E8C631",
+"i@	c #E9C835",
+"j@	c #E9CA38",
+"k@	c #E7C331",
+"l@	c #AD9031",
+"m@	c #BCA131",
+"n@	c #E9CB3D",
+"o@	c #E9CB3B",
+"p@	c #E9CD37",
+"q@	c #E9CF3E",
+"r@	c #E9D243",
+"s@	c #E9CB41",
+"t@	c #B49131",
+"u@	c #584131",
+"v@	c #564031",
+"w@	c #594031",
+"x@	c #534031",
+"y@	c #4F3E31",
+"z@	c #553D31",
+"A@	c #9D7331",
+"B@	c #E9CC46",
+"C@	c #E9DB4F",
+"D@	c #775A2E",
+"E@	c #342224",
+"F@	c #18191D",
+"G@	c #1C2126",
+"H@	c #767576",
+"I@	c #CDA52E",
+"J@	c #E6BD30",
+"K@	c #DFB82E",
+"L@	c #DFBA2E",
+"M@	c #E3BE2E",
+"N@	c #E2BF2E",
+"O@	c #E5C12E",
+"P@	c #E6C22E",
+"Q@	c #E4C32E",
+"R@	c #E6C531",
+"S@	c #E6C132",
+"T@	c #D6AE2E",
+"U@	c #56422E",
+"V@	c #453F2E",
+"W@	c #D5B72E",
+"X@	c #E6CD41",
+"Y@	c #E6CA39",
+"Z@	c #E6CD3D",
+"`@	c #E6CF45",
+" #	c #E6CA44",
+".#	c #BE9B2E",
+"+#	c #55402E",
+"@#	c #50392E",
+"##	c #4F3A2E",
+"$#	c #473A2E",
+"%#	c #473C2E",
+"&#	c #40332E",
+"*#	c #43382E",
+"=#	c #CAA62E",
+"-#	c #E6DA55",
+";#	c #E6D94C",
+">#	c #4D3E24",
+",#	c #15191C",
+"'#	c #1C2025",
+")#	c #2F373F",
+"!#	c #5B523C",
+"~#	c #DFB42C",
+"{#	c #DFBA2C",
+"]#	c #DDB82C",
+"^#	c #DEB92C",
+"/#	c #E1BC2C",
+"(#	c #E2BD2C",
+"_#	c #E0BD2C",
+":#	c #DFBD2C",
+"<#	c #DFBF2C",
+"[#	c #E4C42C",
+"}#	c #E4C030",
+"|#	c #D4AA2C",
+"1#	c #6A582C",
+"2#	c #2C2C2F",
+"3#	c #957F2C",
+"4#	c #E4CB42",
+"5#	c #E4CA3E",
+"6#	c #E4CA3C",
+"7#	c #E4CE45",
+"8#	c #E4CA43",
+"9#	c #DFB82C",
+"0#	c #775F2C",
+"a#	c #332C35",
+"b#	c #3E2D2D",
+"c#	c #41312C",
+"d#	c #342D2F",
+"e#	c #2C2C2E",
+"f#	c #7A642C",
+"g#	c #C7A32C",
+"h#	c #E4D54E",
+"i#	c #E4DC59",
+"j#	c #A78D28",
+"k#	c #2D2B26",
+"l#	c #252B31",
+"m#	c #2F363F",
+"n#	c #766532",
+"o#	c #DDB629",
+"p#	c #DAB429",
+"q#	c #DDB729",
+"r#	c #DAB629",
+"s#	c #DBB629",
+"t#	c #DFBA29",
+"u#	c #DFBC29",
+"v#	c #DDBB29",
+"w#	c #DFBF29",
+"x#	c #E0BF29",
+"y#	c #E1C22D",
+"z#	c #D1A929",
+"A#	c #5E4829",
+"B#	c #292A2F",
+"C#	c #88632F",
+"D#	c #E1C22A",
+"E#	c #E1CA3F",
+"F#	c #E1C83C",
+"G#	c #E1C93C",
+"H#	c #E1CC41",
+"I#	c #D9B329",
+"J#	c #AE8729",
+"K#	c #775D29",
+"L#	c #4E3A29",
+"M#	c #342F2B",
+"N#	c #413C29",
+"O#	c #7E6629",
+"P#	c #937529",
+"Q#	c #796729",
+"R#	c #E1D04C",
+"S#	c #E1D756",
+"T#	c #E1D858",
+"U#	c #CEBB2E",
+"V#	c #796B2E",
+"W#	c #3E403F",
+"X#	c #8C702B",
+"Y#	c #DBB126",
+"Z#	c #D4AF26",
+"`#	c #D8B326",
+" $	c #DBB526",
+".$	c #D9B626",
+"+$	c #DCB926",
+"@$	c #DDBB26",
+"#$	c #DBBC26",
+"$$	c #DDBD26",
+"%$	c #DEBD28",
+"&$	c #DEBE2A",
+"*$	c #D4B126",
+"=$	c #644C26",
+"-$	c #26262A",
+";$	c #513E33",
+">$	c #C19A26",
+",$	c #DEC63C",
+"'$	c #DEC435",
+")$	c #DEC339",
+"!$	c #C6A826",
+"~$	c #5C4E26",
+"{$	c #564626",
+"]$	c #8F6F26",
+"^$	c #9B7926",
+"/$	c #967A26",
+"($	c #917426",
+"_$	c #796326",
+":$	c #383226",
+"<$	c #6B5D26",
+"[$	c #DECE4D",
+"}$	c #DED050",
+"|$	c #DED556",
+"1$	c #DEDC5F",
+"2$	c #DED963",
+"3$	c #AE992B",
+"4$	c #717476",
+"5$	c #927529",
+"6$	c #D9B224",
+"7$	c #D2AE24",
+"8$	c #D9B124",
+"9$	c #D9B424",
+"0$	c #D9B624",
+"a$	c #DCB824",
+"b$	c #D9B824",
+"c$	c #DCBA24",
+"d$	c #DCBD25",
+"e$	c #DCBC27",
+"f$	c #977624",
+"g$	c #2F2428",
+"h$	c #24272D",
+"i$	c #77542C",
+"j$	c #DCB931",
+"k$	c #DCC536",
+"l$	c #CCAF24",
+"m$	c #494124",
+"n$	c #242427",
+"o$	c #242627",
+"p$	c #2B2929",
+"q$	c #3D3424",
+"r$	c #3E3524",
+"s$	c #393324",
+"t$	c #252A2A",
+"u$	c #242424",
+"v$	c #988424",
+"w$	c #DCD248",
+"x$	c #DCCD4B",
+"y$	c #DCD053",
+"z$	c #DCD35B",
+"A$	c #DCD968",
+"B$	c #D6C642",
+"C$	c #383937",
+"D$	c #8B7026",
+"E$	c #D8AF21",
+"F$	c #D0AC21",
+"G$	c #D5B121",
+"H$	c #D7B421",
+"I$	c #D6B321",
+"J$	c #D9B521",
+"K$	c #D7B521",
+"L$	c #D5B421",
+"M$	c #D5B521",
+"N$	c #D9B922",
+"O$	c #D9BC2B",
+"P$	c #CEA821",
+"Q$	c #5B4321",
+"R$	c #212123",
+"S$	c #332C31",
+"T$	c #BE9121",
+"U$	c #D9C439",
+"V$	c #998421",
+"W$	c #212124",
+"X$	c #212627",
+"Y$	c #232828",
+"Z$	c #252727",
+"`$	c #232325",
+" %	c #232328",
+".%	c #353321",
+"+%	c #D6C321",
+"@%	c #D9D249",
+"#%	c #D9D34D",
+"$%	c #D9D654",
+"%%	c #D9D758",
+"&%	c #D9D25B",
+"*%	c #A58722",
+"=%	c #282D31",
+"-%	c #705B28",
+";%	c #D6AE1E",
+">%	c #CFAB1E",
+",%	c #D2AD1E",
+"'%	c #D3B01E",
+")%	c #D5B11E",
+"!%	c #D4B11E",
+"~%	c #D2B31E",
+"{%	c #D5B61E",
+"]%	c #D6B61F",
+"^%	c #D6B71E",
+"/%	c #D6B220",
+"(%	c #AB821E",
+"_%	c #3F2F1E",
+":%	c #1E1E25",
+"<%	c #513F1E",
+"[%	c #C4A11E",
+"}%	c #96821E",
+"|%	c #1E1E20",
+"1%	c #1E2527",
+"2%	c #222522",
+"3%	c #212623",
+"4%	c #202520",
+"5%	c #252222",
+"6%	c #29251E",
+"7%	c #AE9D1E",
+"8%	c #D6D24C",
+"9%	c #D6C643",
+"0%	c #D6C535",
+"a%	c #D6C029",
+"b%	c #C9A91E",
+"c%	c #9D6B1E",
+"d%	c #422B1E",
+"e%	c #21272D",
+"f%	c #4D462D",
+"g%	c #CEA91B",
+"h%	c #D0AA1B",
+"i%	c #D2AC1B",
+"j%	c #D2AE1B",
+"k%	c #D1AE1B",
+"l%	c #D3B11B",
+"m%	c #D3B21D",
+"n%	c #D1B11B",
+"o%	c #CDAD1B",
+"p%	c #CBAB1B",
+"q%	c #CFAD1B",
+"r%	c #D3A91B",
+"s%	c #A2791B",
+"t%	c #47341B",
+"u%	c #1B1B1D",
+"v%	c #594C1B",
+"w%	c #B49A1B",
+"x%	c #322D1B",
+"y%	c #1B1B1F",
+"z%	c #1B2323",
+"A%	c #1B1E21",
+"B%	c #1B1B1B",
+"C%	c #2C2C1B",
+"D%	c #9F8A1B",
+"E%	c #CCAC1B",
+"F%	c #97761B",
+"G%	c #77521B",
+"H%	c #5F3F1B",
+"I%	c #4F2F1B",
+"J%	c #48231B",
+"K%	c #3F201A",
+"L%	c #211D1E",
+"M%	c #303740",
+"N%	c #3C3C36",
+"O%	c #BF9819",
+"P%	c #D1AA1A",
+"Q%	c #CEA819",
+"R%	c #CEA919",
+"S%	c #CEAB19",
+"T%	c #D1AD1A",
+"U%	c #D1AC19",
+"V%	c #CFAC19",
+"W%	c #CDAA19",
+"X%	c #CBA719",
+"Y%	c #CBA819",
+"Z%	c #CAAA19",
+"`%	c #CAA819",
+" &	c #CBAB19",
+".&	c #CEA719",
+"+&	c #BA9219",
+"@&	c #594519",
+"#&	c #19191D",
+"$&	c #997E19",
+"%&	c #A58D19",
+"&&	c #352E19",
+"*&	c #19191E",
+"=&	c #251E1A",
+"-&	c #615519",
+";&	c #AF9B19",
+">&	c #A27919",
+",&	c #4E2819",
+"'&	c #2D1919",
+")&	c #27181B",
+"!&	c #221719",
+"~&	c #201718",
+"{&	c #201A19",
+"]&	c #1B1A1D",
+"^&	c #1D2227",
+"/&	c #272E35",
+"(&	c #363B40",
+"_&	c #8E6F1B",
+":&	c #CEA81C",
+"<&	c #CAA316",
+"[&	c #CBA716",
+"}&	c #CEAA16",
+"|&	c #CEA917",
+"1&	c #CAA716",
+"2&	c #C8A416",
+"3&	c #C9A616",
+"4&	c #C9A316",
+"5&	c #C7A316",
+"6&	c #C8A516",
+"7&	c #CBA616",
+"8&	c #C9A916",
+"9&	c #CEB021",
+"0&	c #C5A116",
+"a&	c #7E6516",
+"b&	c #BB9E16",
+"c&	c #CEB92A",
+"d&	c #C2A916",
+"e&	c #A08916",
+"f&	c #A18A16",
+"g&	c #BDA416",
+"h&	c #CEBE2C",
+"i&	c #A88816",
+"j&	c #472016",
+"k&	c #291716",
+"l&	c #1A1718",
+"m&	c #16171B",
+"n&	c #171A1E",
+"o&	c #191D21",
+"p&	c #1B2024",
+"q&	c #262D33",
+"r&	c #707376",
+"s&	c #534624",
+"t&	c #CBA317",
+"u&	c #CAA813",
+"v&	c #C8A613",
+"w&	c #C5A313",
+"x&	c #C39F13",
+"y&	c #C8A313",
+"z&	c #C5A213",
+"A&	c #C3A113",
+"B&	c #C49F13",
+"C&	c #C4A013",
+"D&	c #C7A113",
+"E&	c #C8A513",
+"F&	c #C7A613",
+"G&	c #CBAB14",
+"H&	c #CBAD1F",
+"I&	c #CBAE20",
+"J&	c #CBAE1D",
+"K&	c #CBB01A",
+"L&	c #CBB322",
+"M&	c #CBB426",
+"N&	c #CBB425",
+"O&	c #CBBC27",
+"P&	c #CBAE18",
+"Q&	c #543713",
+"R&	c #211415",
+"S&	c #15171B",
+"T&	c #181C21",
+"U&	c #282F36",
+"V&	c #2C333B",
+"W&	c #323A42",
+"X&	c #353533",
+"Y&	c #AC8A12",
+"Z&	c #C9A614",
+"`&	c #BF9B11",
+" *	c #C09B11",
+".*	c #C09D11",
+"+*	c #C29E11",
+"@*	c #C29D11",
+"#*	c #BF9A11",
+"$*	c #C29B11",
+"%*	c #C39D11",
+"&*	c #C3A111",
+"**	c #C4A211",
+"=*	c #C8A711",
+"-*	c #C9A813",
+";*	c #C9A914",
+">*	c #C9AB14",
+",*	c #C9AD17",
+"'*	c #C9AE1C",
+")*	c #C9AF1D",
+"!*	c #C9B01E",
+"~*	c #C9B225",
+"{*	c #8D6B11",
+"]*	c #201213",
+"^*	c #17181B",
+"/*	c #23292F",
+"(*	c #2F363E",
+"_*	c #5C6166",
+":*	c #333941",
+"<*	c #56451A",
+"[*	c #C69D11",
+"}*	c #C19B0E",
+"|*	c #BC980E",
+"1*	c #BE9A0E",
+"2*	c #BD980E",
+"3*	c #C0980E",
+"4*	c #BF9A0E",
+"5*	c #BF9C0E",
+"6*	c #C19F0E",
+"7*	c #C0A00E",
+"8*	c #C6A40E",
+"9*	c #C6A50F",
+"0*	c #C6A50E",
+"a*	c #C6A710",
+"b*	c #C6A914",
+"c*	c #C6AB16",
+"d*	c #C6AB17",
+"e*	c #C6AD1B",
+"f*	c #C6AF25",
+"g*	c #C1A30E",
+"h*	c #3A2510",
+"i*	c #312E2F",
+"j*	c #97740E",
+"k*	c #C49D0D",
+"l*	c #BA930C",
+"m*	c #BA950C",
+"n*	c #BC980C",
+"o*	c #BE9A0C",
+"p*	c #BE9B0C",
+"q*	c #BF9D0C",
+"r*	c #BD9C0C",
+"s*	c #BC9C0C",
+"t*	c #BD9D0C",
+"u*	c #C0A00C",
+"v*	c #C4A50C",
+"w*	c #C4A511",
+"x*	c #C4A615",
+"y*	c #C4A714",
+"z*	c #C4A912",
+"A*	c #C4A811",
+"B*	c #C4A917",
+"C*	c #C4AD25",
+"D*	c #80620C",
+"E*	c #181215",
+"F*	c #242A31",
+"G*	c #3E331D",
+"H*	c #B48A0A",
+"I*	c #BD940A",
+"J*	c #B8920A",
+"K*	c #BB960A",
+"L*	c #BE980A",
+"M*	c #BE9A0A",
+"N*	c #BD990A",
+"O*	c #BD9A0A",
+"P*	c #BB990A",
+"Q*	c #B8980A",
+"R*	c #B9990A",
+"S*	c #BE9F0A",
+"T*	c #C2A50C",
+"U*	c #C2A411",
+"V*	c #C2A410",
+"W*	c #C2A614",
+"X*	c #C2A413",
+"Y*	c #C2A711",
+"Z*	c #C2A91B",
+"`*	c #B8940A",
+" =	c #3B1E0B",
+".=	c #19181C",
+"+=	c #2D343C",
+"@=	c #2C3137",
+"#=	c #5D4711",
+"$=	c #BB9008",
+"%=	c #B89308",
+"&=	c #B89208",
+"*=	c #BB9508",
+"==	c #BB9708",
+"-=	c #B99508",
+";=	c #B99608",
+">=	c #B89708",
+",=	c #B79608",
+"'=	c #B69708",
+")=	c #BA9C08",
+"!=	c #C0A209",
+"~=	c #C0A30E",
+"{=	c #C0A409",
+"]=	c #C0A40F",
+"^=	c #C0A413",
+"/=	c #C0A819",
+"(=	c #C0A416",
+"_=	c #714908",
+":=	c #210E0F",
+"<=	c #1B1F24",
+"[=	c #282A2D",
+"}=	c #5F480E",
+"|=	c #B68B06",
+"1=	c #B68E06",
+"2=	c #B58F06",
+"3=	c #B79306",
+"4=	c #B89406",
+"5=	c #B69306",
+"6=	c #B79606",
+"7=	c #B69506",
+"8=	c #B79806",
+"9=	c #BA9B06",
+"0=	c #BD9F06",
+"a=	c #BEA00C",
+"b=	c #BEA20D",
+"c=	c #BEA20F",
+"d=	c #BEA71E",
+"e=	c #BEA51B",
+"f=	c #795506",
+"g=	c #351108",
+"h=	c #19171A",
+"i=	c #2D353D",
+"j=	c #25282B",
+"k=	c #513C0D",
+"l=	c #AB7E04",
+"m=	c #B98D04",
+"n=	c #B28D04",
+"o=	c #AD8B04",
+"p=	c #B39104",
+"q=	c #B89504",
+"r=	c #B99804",
+"s=	c #B79A04",
+"t=	c #B89804",
+"u=	c #BC9C04",
+"v=	c #BCA00B",
+"w=	c #BCA212",
+"x=	c #BCA41F",
+"y=	c #BCA012",
+"z=	c #6F5204",
+"A=	c #250C06",
+"B=	c #181414",
+"C=	c #2E353D",
+"D=	c #23272D",
+"E=	c #352712",
+"F=	c #7E5C05",
+"G=	c #AD8303",
+"H=	c #B58E03",
+"I=	c #B99403",
+"J=	c #B89403",
+"K=	c #B89603",
+"L=	c #B69603",
+"M=	c #BB9D0A",
+"N=	c #BBA213",
+"O=	c #BBA012",
+"P=	c #997E05",
+"Q=	c #3D2D0A",
+"R=	c #170B0D",
+"S=	c #181315",
+"T=	c #23282E",
+"U=	c #2E353E",
+"V=	c #838586",
+"W=	c #22201D",
+"X=	c #382A0E",
+"Y=	c #6E5005",
+"Z=	c #A27D01",
+"`=	c #AD8801",
+" -	c #B48B01",
+".-	c #B68E01",
+"+-	c #B08C01",
+"@-	c #A28101",
+"#-	c #715A04",
+"$-	c #3F310A",
+"%-	c #1D1B14",
+"&-	c #15181C",
+"*-	c #23282F",
+"=-	c #16191D",
+"--	c #1B1F23",
+";-	c #1E2329",
+">-	c #20262B",
+",-	c #2C333A",
+"'-	c #303841",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . + @ # $ % & . . . . . . . . . . . * = . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . - ; > , ' ) ! ~ { . . . . . . . ] ^ / ( _ . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . : < [ } | 1 2 3 4 5 6 . . . . 7 8 9 0 a b c d . ",
+". . . . . . . . . . . . . . . . . . . . . . . e f g h i j k g l m n o p . q r s t u v w x y z . ",
+". . . . . . . . . . . . . . . . . . . . . . A B C D E F G H D I J K L M N O P Q R S T U V W X Y ",
+". . . . . . . . . Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.).!.~.{.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.",
+". . . . . . . 8.9.0.a.b.c.d.d.e.f.g.h.i.j.k.l.m.j.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.. ",
+". . . . . . J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+. . ",
+". . . . . /+(+_+:+<+[+}+|+1+2+3+4+5+6+7+5+5+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+. . . . ",
+". . . . t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+o+5.X  @. . . . . . ",
+". . . . at +@@@#@$@%@&@*@=@-@;@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at . . . . . . . ",
+". . . 0 at a@b at c@d at e@f at g@h at i@j at k@l at m@n at o@p at q@r at s@t at u@v at w@x at y@y at z@A at B@C at D@E at F@G@{+I.. . . . . . . . ",
+". . H at I@J at K@L at M@N at O@P at Q@R at S@T at U@V at W@X at Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#q+)#. . . . . . . . . ",
+". . !#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#. . . . . . . . . . ",
+". . n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#. . . . . . . . . . ",
+". . X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$. . . . . . . . . ",
+". . 5$6$7$8$9$0$0$a$b$c$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$. . . . . . . . . ",
+". . D$E$F$G$H$I$H$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$`$ %W$.%+%@%#%$%%%&%*%=%I.. . . . . . . . ",
+". . -%;%>%,%'%'%'%)%!%~%{%]%^%/%(%_%:%<%[%}%|%1%2%3%4%5%|%6%7%8%9%0%a%b%c%d%e%m#. . . . . . . . ",
+". . f%g%h%i%j%j%k%j%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%z%A%B%C%D%E%F%G%H%I%J%K%L%G.M%. . . . . . . . ",
+". . N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&*&=&-&;&>&,&'&)&!&~&{&]&^&/&s+. . . . . . . . ",
+". . (&_&:&<&[&}&|&1&2&3&4&5&6&7&1&8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&7 at q&)#. . . . . . . . . ",
+". . r&s&t&u&v&w&x&y&z&A&B&C&D&E&v&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&^&5.l#U&V&W&. . . . . . . . . . ",
+". . . X&Y&Z&`& *.*+*@*#*$*%*&***=*-*-*;*>*>*,*'*)*!*~*{*]*^*p&/*H.(*I._*. . . . . . . . . . . . ",
+". . . :*<*[*}*|*1*2*3*3*4*5*6*7*8*9*0*a*b*b*c*d*e*f*g*h*m&'#q+]+7.. . . . . . . . . . . . . . . ",
+". . . . i*j*k*l*m*n*o*o*p*q*r*s*t*u*v*w*x*y*z*A*B*C*D*E*!+F*)#. . . . . . . . . . . . . . . . . ",
+". . . .  @G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=5.+=. . . . . . . . . . . . . . . . . . ",
+". . . . . @=#=$=%=&=*===-=;=>=,='=)=!=~={=]=^=/=(=_=:=<={+s+. . . . . . . . . . . . . . . . . . ",
+". . . . . s+[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=d=e=f=g=h=~+i=. . . . . . . . . . . . . . . . . . . ",
+". . . . . . M%j=k=l=m=n=o=p=q=r=s=t=u=v=w=x=y=z=A=B=<=q&s+. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . C=D=E=F=G=H=I=J=K=K=L=M=N=O=P=Q=R=S=4.T=U=. . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . V=C=F*W=X=Y=Z=`= -.-+- at -#-$-%-&-o+G@*-V&7.. . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . )#/&~+<=E.=-&-&-&-&-=-E.--;-/*U&]+7.. . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . s+r+{+*->-7 at 7@7 at 7@>-*-{+,-'-^+. . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . 9@ @)#(*]+]+(*)# @9 at . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/acoustic_piano_pno.xpm b/images/MusicalInstruments/acoustic_piano_pno.xpm
new file mode 100644
index 0000000..e6b68d7
--- /dev/null
+++ b/images/MusicalInstruments/acoustic_piano_pno.xpm
@@ -0,0 +1,801 @@
+/* XPM */
+static char * acoustic_piano_pno_xpm[] = {
+"48 48 750 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #5A6060",
+"@ 	c #777A7A",
+"# 	c #4F5455",
+"$ 	c #535248",
+"% 	c #565952",
+"& 	c #393D38",
+"* 	c #31332E",
+"= 	c #3C3A36",
+"- 	c #302C27",
+"; 	c #353434",
+"> 	c #4E5254",
+", 	c #7A7A6F",
+"' 	c #807259",
+") 	c #41371F",
+"! 	c #3A3522",
+"~ 	c #2C2A1B",
+"{ 	c #232114",
+"] 	c #211E14",
+"^ 	c #010000",
+"/ 	c #2F3130",
+"( 	c #6F6E65",
+"_ 	c #8A7350",
+": 	c #452F16",
+"< 	c #32200A",
+"[ 	c #271A09",
+"} 	c #393224",
+"| 	c #49453B",
+"1 	c #252119",
+"2 	c #282823",
+"3 	c #77776B",
+"4 	c #705A48",
+"5 	c #2A0D03",
+"6 	c #2F160A",
+"7 	c #341D11",
+"8 	c #332018",
+"9 	c #2B1C18",
+"0 	c #392F2F",
+"a 	c #3F3C3D",
+"b 	c #4F5757",
+"c 	c #716F60",
+"d 	c #564529",
+"e 	c #220E08",
+"f 	c #251115",
+"g 	c #2D1A1B",
+"h 	c #3A2624",
+"i 	c #382420",
+"j 	c #24110D",
+"k 	c #291C1A",
+"l 	c #2F2829",
+"m 	c #404142",
+"n 	c #4E5555",
+"o 	c #515857",
+"p 	c #958969",
+"q 	c #5F4525",
+"r 	c #230F07",
+"s 	c #221913",
+"t 	c #1D1614",
+"u 	c #251A1A",
+"v 	c #32221D",
+"w 	c #372419",
+"x 	c #271408",
+"y 	c #2D1F13",
+"z 	c #150D06",
+"A 	c #0D0602",
+"B 	c #343534",
+"C 	c #757676",
+"D 	c #4D5151",
+"E 	c #5D615E",
+"F 	c #A39674",
+"G 	c #624A1F",
+"H 	c #321804",
+"I 	c #2D1818",
+"J 	c #241715",
+"K 	c #1C1310",
+"L 	c #221717",
+"M 	c #342723",
+"N 	c #281A12",
+"O 	c #20120A",
+"P 	c #291E15",
+"Q 	c #0C0401",
+"R 	c #110B06",
+"S 	c #2E2C2C",
+"T 	c #333132",
+"U 	c #2F2E2F",
+"V 	c #3F4041",
+"W 	c #828475",
+"X 	c #B3A27D",
+"Y 	c #564325",
+"Z 	c #2A1705",
+"` 	c #2F1E13",
+" .	c #2C1B18",
+"..	c #2B181B",
+"+.	c #251517",
+"@.	c #211616",
+"#.	c #291E1E",
+"$.	c #1E1313",
+"%.	c #120A0A",
+"&.	c #0E0706",
+"*.	c #070100",
+"=.	c #231E1C",
+"-.	c #353233",
+";.	c #312F31",
+">.	c #333232",
+",.	c #303030",
+"'.	c #505656",
+").	c #606660",
+"!.	c #928974",
+"~.	c #3E311D",
+"{.	c #170A00",
+"].	c #201507",
+"^.	c #1F140B",
+"/.	c #1C110F",
+"(.	c #1B1112",
+"_.	c #1A0F10",
+":.	c #201313",
+"<.	c #1F1313",
+"[.	c #130808",
+"}.	c #090201",
+"|.	c #0B0503",
+"1.	c #120D0A",
+"2.	c #302B28",
+"3.	c #333031",
+"4.	c #323031",
+"5.	c #868888",
+"6.	c #585D5A",
+"7.	c #837857",
+"8.	c #312A21",
+"9.	c #090200",
+"0.	c #0B0504",
+"a.	c #0A0603",
+"b.	c #0C0905",
+"c.	c #0D0A0A",
+"d.	c #141212",
+"e.	c #140D0D",
+"f.	c #160A0A",
+"g.	c #190F0F",
+"h.	c #0C0403",
+"i.	c #0E0806",
+"j.	c #100C08",
+"k.	c #292421",
+"l.	c #383330",
+"m.	c #2F2C2D",
+"n.	c #363536",
+"o.	c #424444",
+"p.	c #696D6D",
+"q.	c #656B66",
+"r.	c #979580",
+"s.	c #80745C",
+"t.	c #2C190C",
+"u.	c #0F0A0D",
+"v.	c #0D0B0F",
+"w.	c #080609",
+"x.	c #050507",
+"y.	c #010302",
+"z.	c #000100",
+"A.	c #000200",
+"B.	c #050301",
+"C.	c #080100",
+"D.	c #1F1715",
+"E.	c #1E1815",
+"F.	c #15110E",
+"G.	c #292522",
+"H.	c #35312E",
+"I.	c #302B29",
+"J.	c #403E3F",
+"K.	c #5A5F5F",
+"L.	c #B0AD8B",
+"M.	c #918759",
+"N.	c #271A0B",
+"O.	c #110306",
+"P.	c #0A0307",
+"Q.	c #070206",
+"R.	c #060203",
+"S.	c #050304",
+"T.	c #080707",
+"U.	c #0A0A08",
+"V.	c #080806",
+"W.	c #0A0604",
+"X.	c #0E0604",
+"Y.	c #251E1C",
+"Z.	c #211C19",
+"`.	c #27221F",
+" +	c #302C29",
+".+	c #312F2B",
+"++	c #565755",
+"@+	c #6B6C66",
+"#+	c #7A6E59",
+"$+	c #170D04",
+"%+	c #0D0501",
+"&+	c #0D0707",
+"*+	c #150B0A",
+"=+	c #180E0D",
+"-+	c #180F0E",
+";+	c #16110F",
+">+	c #120E0B",
+",+	c #0A0704",
+"'+	c #0E0705",
+")+	c #140D0A",
+"!+	c #25211E",
+"~+	c #433F3C",
+"{+	c #3D3E3B",
+"]+	c #3F443B",
+"^+	c #2B2920",
+"/+	c #362D2D",
+"(+	c #201518",
+"_+	c #201619",
+":+	c #1E1916",
+"<+	c #1B1C11",
+"[+	c #190F08",
+"}+	c #160B07",
+"|+	c #110804",
+"1+	c #0F0702",
+"2+	c #0D0702",
+"3+	c #090401",
+"4+	c #0B0502",
+"5+	c #0C0805",
+"6+	c #1A1714",
+"7+	c #3E3A34",
+"8+	c #5F5F5C",
+"9+	c #777A79",
+"0+	c #25261C",
+"a+	c #1D1B11",
+"b+	c #1D1B12",
+"c+	c #222018",
+"d+	c #232219",
+"e+	c #25241B",
+"f+	c #2A291F",
+"g+	c #2A2524",
+"h+	c #282221",
+"i+	c #332E26",
+"j+	c #2F2921",
+"k+	c #3D3227",
+"l+	c #4E3C35",
+"m+	c #58403C",
+"n+	c #675757",
+"o+	c #91807A",
+"p+	c #C3A98C",
+"q+	c #635E56",
+"r+	c #505053",
+"s+	c #514D4D",
+"t+	c #525150",
+"u+	c #777979",
+"v+	c #565B59",
+"w+	c #454038",
+"x+	c #231D15",
+"y+	c #252019",
+"z+	c #262119",
+"A+	c #27221A",
+"B+	c #29241C",
+"C+	c #2B261E",
+"D+	c #342E28",
+"E+	c #493646",
+"F+	c #715561",
+"G+	c #A98282",
+"H+	c #733F36",
+"I+	c #6D2E21",
+"J+	c #89423B",
+"K+	c #8D4542",
+"L+	c #8A4649",
+"M+	c #954C42",
+"N+	c #9E5138",
+"O+	c #774949",
+"P+	c #71444E",
+"Q+	c #803D37",
+"R+	c #7F3928",
+"S+	c #693529",
+"T+	c #68302E",
+"U+	c #6C403E",
+"V+	c #5F4340",
+"W+	c #584D4A",
+"X+	c #505455",
+"Y+	c #383836",
+"Z+	c #36332E",
+"`+	c #5F514A",
+" @	c #876860",
+".@	c #96756B",
+"+@	c #7D6150",
+"@@	c #2C1D0A",
+"#@	c #261E17",
+"$@	c #261E19",
+"%@	c #271F19",
+"&@	c #2A211C",
+"*@	c #2D2520",
+"=@	c #312923",
+"-@	c #38312D",
+";@	c #454653",
+">@	c #8E8186",
+",@	c #9F796D",
+"'@	c #804429",
+")@	c #8D3F1E",
+"!@	c #89361C",
+"~@	c #823020",
+"{@	c #7F2E1F",
+"]@	c #9D4121",
+"^@	c #A65029",
+"/@	c #704137",
+"(@	c #774C4A",
+"_@	c #984F39",
+":@	c #9D491F",
+"<@	c #7F3913",
+"[@	c #79251C",
+"}@	c #7B2E28",
+"|@	c #793B35",
+"1@	c #754841",
+"2@	c #5F4941",
+"3@	c #4E5354",
+"4@	c #1D1D1C",
+"5@	c #16110C",
+"6@	c #270E0C",
+"7@	c #3F140F",
+"8@	c #5C3029",
+"9@	c #3D2518",
+"0@	c #201806",
+"a@	c #271D18",
+"b@	c #2A201D",
+"c@	c #2B221E",
+"d@	c #2B211E",
+"e@	c #2F2522",
+"f@	c #322724",
+"g@	c #3E3633",
+"h@	c #485E5E",
+"i@	c #97A095",
+"j@	c #7F674A",
+"k@	c #7C481B",
+"l@	c #8D4611",
+"m@	c #893D0D",
+"n@	c #813811",
+"o@	c #883E19",
+"p@	c #A34A16",
+"q@	c #A4561C",
+"r@	c #805E42",
+"s@	c #6C4D3A",
+"t@	c #9E6137",
+"u@	c #C07737",
+"v@	c #C18548",
+"w@	c #B27B6E",
+"x@	c #996861",
+"y@	c #68413B",
+"z@	c #311A17",
+"A@	c #6C5A56",
+"B@	c #767575",
+"C@	c #242C33",
+"D@	c #212629",
+"E@	c #2C2222",
+"F@	c #321616",
+"G@	c #280C0D",
+"H@	c #1D100E",
+"I@	c #11140C",
+"J@	c #150D0B",
+"K@	c #1C1211",
+"L@	c #29201E",
+"M@	c #2D2321",
+"N@	c #312726",
+"O@	c #423A38",
+"P@	c #666E69",
+"Q@	c #A39D8F",
+"R@	c #745338",
+"S@	c #985D36",
+"T@	c #A25525",
+"U@	c #A14E1F",
+"V@	c #A05024",
+"W@	c #A25029",
+"X@	c #AD4F1D",
+"Y@	c #AE581C",
+"Z@	c #7C5032",
+"`@	c #754B3B",
+" #	c #AF6B43",
+".#	c #B96A31",
+"+#	c #B27743",
+"@#	c #90857A",
+"##	c #1B1411",
+"$#	c #050000",
+"%#	c #000000",
+"&#	c #5F5B5E",
+"*#	c #7F8284",
+"=#	c #4F5558",
+"-#	c #252630",
+";#	c #1D262A",
+">#	c #222726",
+",#	c #2D2322",
+"'#	c #2E1F21",
+")#	c #302929",
+"!#	c #303431",
+"~#	c #2E2926",
+"{#	c #201917",
+"]#	c #1A1411",
+"^#	c #100A08",
+"/#	c #140E0B",
+"(#	c #18120F",
+"_#	c #26201D",
+":#	c #564E4B",
+"<#	c #7A6762",
+"[#	c #3B1A11",
+"}#	c #7F4D40",
+"|#	c #844530",
+"1#	c #8D462A",
+"2#	c #A35939",
+"3#	c #985038",
+"4#	c #984A2C",
+"5#	c #9C4D20",
+"6#	c #895C4A",
+"7#	c #784D4C",
+"8#	c #B77866",
+"9#	c #A76448",
+"0#	c #7F5641",
+"a#	c #7A807C",
+"b#	c #0B100F",
+"c#	c #000303",
+"d#	c #5E5F61",
+"e#	c #808586",
+"f#	c #363236",
+"g#	c #0E070A",
+"h#	c #141B18",
+"i#	c #17241C",
+"j#	c #22241E",
+"k#	c #292422",
+"l#	c #292324",
+"m#	c #232221",
+"n#	c #2A2825",
+"o#	c #35332F",
+"p#	c #33312D",
+"q#	c #34322E",
+"r#	c #33322E",
+"s#	c #2A2824",
+"t#	c #1A1E1C",
+"u#	c #090C0F",
+"v#	c #28292F",
+"w#	c #18141B",
+"x#	c #170C0F",
+"y#	c #2A120C",
+"z#	c #432518",
+"A#	c #36201C",
+"B#	c #331913",
+"C#	c #3A180D",
+"D#	c #302622",
+"E#	c #221A22",
+"F#	c #251211",
+"G#	c #403130",
+"H#	c #ABB2BA",
+"I#	c #89858A",
+"J#	c #0F0C0E",
+"K#	c #020101",
+"L#	c #5C5E5A",
+"M#	c #727878",
+"N#	c #323435",
+"O#	c #121313",
+"P#	c #020200",
+"Q#	c #030402",
+"R#	c #0F0E0C",
+"S#	c #2C2B28",
+"T#	c #252321",
+"U#	c #232220",
+"V#	c #292921",
+"W#	c #27281F",
+"X#	c #2D2C26",
+"Y#	c #3F3E3A",
+"Z#	c #565552",
+"`#	c #82827F",
+" $	c #8D8E8E",
+".$	c #6A6C6C",
+"+$	c #737576",
+"@$	c #1D1F20",
+"#$	c #2F3132",
+"$$	c #C8CBCD",
+"%$	c #898889",
+"&$	c #0E0D0D",
+"*$	c #595959",
+"=$	c #636969",
+"-$	c #393D41",
+";$	c #363636",
+">$	c #808080",
+",$	c #5D5C5C",
+"'$	c #1F1E1D",
+")$	c #0C0C0B",
+"!$	c #2B2A29",
+"~$	c #373635",
+"{$	c #353432",
+"]$	c #404037",
+"^$	c #393931",
+"/$	c #272621",
+"($	c #302F2B",
+"_$	c #53524F",
+":$	c #8B8A88",
+"<$	c #BEBEBE",
+"[$	c #E1E1E1",
+"}$	c #989898",
+"|$	c #141313",
+"1$	c #010101",
+"2$	c #010100",
+"3$	c #313131",
+"4$	c #C9C8C8",
+"5$	c #888888",
+"6$	c #0F0F0F",
+"7$	c #555656",
+"8$	c #626969",
+"9$	c #4E5255",
+"0$	c #3A3A3A",
+"a$	c #9B9B9B",
+"b$	c #C5C4C3",
+"c$	c #D5D4D2",
+"d$	c #AAA9A7",
+"e$	c #5F5E5C",
+"f$	c #12110F",
+"g$	c #10100E",
+"h$	c #2B2A25",
+"i$	c #3C3B35",
+"j$	c #3A3934",
+"k$	c #3E3D3A",
+"l$	c #51504E",
+"m$	c #898787",
+"n$	c #B4B4B4",
+"o$	c #D0D0D0",
+"p$	c #B1B1B1",
+"q$	c #252525",
+"r$	c #CACACA",
+"s$	c #8A8A8A",
+"t$	c #0C0B0B",
+"u$	c #0E0E0E",
+"v$	c #3D4040",
+"w$	c #606366",
+"x$	c #262525",
+"y$	c #1A191A",
+"z$	c #4D4C49",
+"A$	c #C5C4C2",
+"B$	c #CDCCCA",
+"C$	c #999896",
+"D$	c #575655",
+"E$	c #1D1C1A",
+"F$	c #0F0E0A",
+"G$	c #262522",
+"H$	c #3A3937",
+"I$	c #545252",
+"J$	c #828081",
+"K$	c #B2B2B2",
+"L$	c #D7D7D7",
+"M$	c #828282",
+"N$	c #0C0C0C",
+"O$	c #CFCFCF",
+"P$	c #7C7B7B",
+"Q$	c #262727",
+"R$	c #414343",
+"S$	c #4E5353",
+"T$	c #858686",
+"U$	c #36393A",
+"V$	c #373737",
+"W$	c #2B2A28",
+"X$	c #201E1C",
+"Y$	c #282624",
+"Z$	c #636260",
+"`$	c #91908E",
+" %	c #ABAAA8",
+".%	c #A8A7A5",
+"+%	c #8A8985",
+"@%	c #686764",
+"#%	c #42413E",
+"$%	c #1A1918",
+"%%	c #060505",
+"&%	c #060406",
+"*%	c #363436",
+"=%	c #646464",
+"-%	c #848484",
+";%	c #2F2F2F",
+">%	c #030303",
+",%	c #020202",
+"'%	c #D8D8D8",
+")%	c #3D3F3D",
+"!%	c #292826",
+"~%	c #2F2E2C",
+"{%	c #343230",
+"]%	c #373633",
+"^%	c #555451",
+"/%	c #949390",
+"(%	c #BDBCBA",
+"_%	c #DBDADA",
+":%	c #C0BEC0",
+"<%	c #5F5D60",
+"[%	c #18171A",
+"}%	c #131313",
+"|%	c #0B0B0B",
+"1%	c #2D2D2D",
+"2%	c #7E7E7E",
+"3%	c #3D4343",
+"4%	c #21201E",
+"5%	c #2C2A28",
+"6%	c #3E3E3B",
+"7%	c #454442",
+"8%	c #4F4D4B",
+"9%	c #5C5A5B",
+"0%	c #696769",
+"a%	c #9B989C",
+"b%	c #A7A5A9",
+"c%	c #242328",
+"d%	c #151515",
+"e%	c #050404",
+"f%	c #2F3232",
+"g%	c #343B3A",
+"h%	c #0F0F0E",
+"i%	c #191918",
+"j%	c #555A59",
+"k%	c #5A5E5E",
+"l%	c #696A69",
+"m%	c #605F5F",
+"n%	c #767576",
+"o%	c #898788",
+"p%	c #7C7B7D",
+"q%	c #878688",
+"r%	c #2B2A2D",
+"s%	c #040404",
+"t%	c #060606",
+"u%	c #050505",
+"v%	c #090909",
+"w%	c #0F1010",
+"x%	c #1B1B1B",
+"y%	c #2E3131",
+"z%	c #373E40",
+"A%	c #131414",
+"B%	c #848686",
+"C%	c #4E5454",
+"D%	c #5E5F5F",
+"E%	c #979797",
+"F%	c #1C1C1C",
+"G%	c #030202",
+"H%	c #040303",
+"I%	c #111111",
+"J%	c #4D5454",
+"K%	c #282C2C",
+"L%	c #5F6366",
+"M%	c #141414",
+"N%	c #181818",
+"O%	c #343737",
+"P%	c #404040",
+"Q%	c #515151",
+"R%	c #525151",
+"S%	c #444646",
+"T%	c #272A2A",
+"U%	c #242626",
+"V%	c #1A1B1B",
+"W%	c #2C2F2F",
+"X%	c #232727",
+"Y%	c #171718",
+"Z%	c #2D3030",
+"`%	c #434242",
+" &	c #383838",
+".&	c #9C9C9C",
+"+&	c #6D7474",
+"@&	c #202121",
+"#&	c #0A0A0A",
+"$&	c #3E4242",
+"%&	c #353939",
+"&&	c #242828",
+"*&	c #1A1B1C",
+"=&	c #0D0E0E",
+"-&	c #4C4B4B",
+";&	c #494949",
+">&	c #575A5A",
+",&	c #3B3D3D",
+"'&	c #080909",
+")&	c #3A3E3F",
+"!&	c #080808",
+"~&	c #2C3030",
+"{&	c #1C1E20",
+"]&	c #0D0E0F",
+"^&	c #292C2C",
+"/&	c #4E4E4E",
+"(&	c #464646",
+"_&	c #373C3C",
+":&	c #3E4040",
+"<&	c #727476",
+"[&	c #100F10",
+"}&	c #323737",
+"|&	c #1C1F22",
+"1&	c #272B2B",
+"2&	c #535353",
+"3&	c #4D4D4D",
+"4&	c #343939",
+"5&	c #3C3F3F",
+"6&	c #0E0F11",
+"7&	c #353A3A",
+"8&	c #1A1C20",
+"9&	c #0E0F10",
+"0&	c #737676",
+"a&	c #252929",
+"b&	c #575656",
+"c&	c #2E3535",
+"d&	c #383B3B",
+"e&	c #0E0F0F",
+"f&	c #161514",
+"g&	c #383D3C",
+"h&	c #211F14",
+"i&	c #252727",
+"j&	c #605C5C",
+"k&	c #565656",
+"l&	c #313737",
+"m&	c #4D5555",
+"n&	c #323636",
+"o&	c #151616",
+"p&	c #73664C",
+"q&	c #696C6A",
+"r&	c #585C58",
+"s&	c #747561",
+"t&	c #282A29",
+"u&	c #565252",
+"v&	c #3F3F3F",
+"w&	c #626666",
+"x&	c #2E3232",
+"y&	c #1D1E1F",
+"z&	c #6B6960",
+"A&	c #868889",
+"B&	c #727565",
+"C&	c #2C2C2C",
+"D&	c #3B3637",
+"E&	c #4B4A4A",
+"F&	c #626767",
+"G&	c #2F3333",
+"H&	c #232424",
+"I&	c #363838",
+"J&	c #0F0808",
+"K&	c #1C1717",
+"L&	c #292727",
+"M&	c #696B6B",
+"N&	c #303434",
+"O&	c #272929",
+"P&	c #545858",
+"Q&	c #413E3E",
+"R&	c #1C1213",
+"S&	c #0C0506",
+"T&	c #020000",
+"U&	c #181919",
+"V&	c #333737",
+"W&	c #2A2C2C",
+"X&	c #535555",
+"Y&	c #474444",
+"Z&	c #322E2F",
+"`&	c #222021",
+" *	c #1E1F1F",
+".*	c #383D3D",
+"+*	c #3A3F3F",
+"@*	c #313333",
+"#*	c #42433E",
+"$*	c #170705",
+"%*	c #433B37",
+"&*	c #51544F",
+"**	c #81715B",
+"=*	c #63635B",
+"-*	c #868787",
+";*	c #7D745D",
+">*	c #5E615B",
+",*	c #545A57",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . # $ % & * = - ; > . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . , ' ) ! ~ { ] ^ / . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . ( _ : < [ } | 1 2 . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4 5 6 7 8 9 0 a b . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . c d e f g h i j k l m n @ . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . o p q r s t u v w x y z A B C D . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . E F G H I J K L M N O P Q R S T U V . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . W X Y Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.. . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . ).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.S . 5.. . . . . . ",
+". . . . . . . . . . . . . . . . . . . . 6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.. . . . . . . ",
+". . . . . . . . . . . . . . . . . . q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.. . . . . . . . . ",
+". . . . . . . . . . . . . . . . . 5.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++p.. . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . @+#+$+%+&+*+=+-+-+;+>+,+'+)+!+~+H.{+. . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . ]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+. . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . 0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+. . . . . . . . . . . ",
+". . . . . . . . . . . . . v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+. . . . . . ",
+". . . . . . . . Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1 at 2@3 at . . . . . ",
+". . . . . . . . 4 at 5@6 at 7@8 at 9@0 at a@b at c@d at e@f at g@h at i@j at k@l at m@n at o@p at q@r at s@t at u@v at w@x at y@z at A@B at . . . . . ",
+". . . . . . . . C at D@E at F@G at H@I at J@K at L@L at M@N at O@P at Q@R at S@T at U@V at W@X at Y@Z@`@ #.#+#@###$#%#&#*#. . . . . ",
+". . . . . . . =#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#%#d#e#. . . . . ",
+". . . . . . 5.f#g#h#i#j#k#l#m#n#.+o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#%#L#M#. . . . . ",
+". . . . . N#O#%#%#P#Q#R#S#T#U#V#W#X#r#Y#Z#`# $.$+$@$%#%#%#%#%#%#%#%#%##$$$%$&$%#%#*$=$. . . . . ",
+". . . . -$;$>$,$'$%#%#)$!$~${$]$^$/$($Y#_$:$<$[$}$|$%#1$1$1$1$1$1$2$%#3$4$5$6$%#%#7$8$. . . . . ",
+". . . . 9$0$a$b$c$d$e$f$%#%#g$h$i$j$j$k$l$m$n$o$p$q$%#1$1$1$1$1$1$%#%#,.r$s$t$%#u$v$5.. . . . . ",
+". . . . w$x$y$!$z$:$A$B$C$D$E$%#%#F$G$H$I$J$K$L$M$N$%#1$1$1$1$1$1$1$%#,.O$P$Q$R$S$@ . . . . . . ",
+". . . . . T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%1$1$1$,%,%1$1$,%%#;%'%7$. . . . . . . . . . ",
+". . . . . . . . 5.. )%!%~%{%]%^%/%(%_%:%<%[%}%|%1$1$1$1$1$1$,%1$,%,%%#1%2%T$. . . . . . . . . . ",
+". . . . . . . . . . 3%4%5%6%7%8%D$9%0%a%b%c%%#%#1$>%1$%#1$1$,%>%,%>%1$d%e%f%p.. . . . . . . . . ",
+". . . . . . . . . . g%h%i%j%k%l%m%n%o%p%q%r%1$,%>%s%,%t%u%u%t%u%v%6$w%x%%#y%. . . . . . . . . . ",
+". . . . . . . . . . z%A%x%n B%. p.C%D%-%E%F%%#>%G%u%s%s%s%t%H%I%. J%@ y%^ K%. . . . . . . . . . ",
+". . . . . . . . . . L%M%N%C%. . B%5.O%P%Q%R%S%T%U%V%t%u%%#N$W%T$. . . K%H%X%. . . . . . . . . . ",
+". . . . . . . . . . . Y%M%5.. . . @ Z%`% &.&+&. J%5.@&%##&$&. . . . . %&H%&&. . . . . . . . . . ",
+". . . . . . . . . . . *&=&. . . . @ W%-&;&>&. . . . ,&%#'&5.. . . . . )&!&~&. . . . . . . . . . ",
+". . . . . . . . . . . {&]&. . . . 5.^&/&(&_&. 5.. . :&K#!&. . . . . . <&[&}&. . . . . . . . . . ",
+". . . . . . . . . . . |&6$B%. . . 5.1&2&3&4&. 5.. . 5&s%N$. . . . . . . 6&7&. . . . . . . . . . ",
+". . . . . . . . . . . 8&9&0&. . . . a&b&Q%c&5.. . . d&H%e&. . . . . . . f&g&. . . . . . . . . . ",
+". . . . . . . . . . . G$h&. . . . . i&j&k&l&m&. . . n&K#o&. . . . . . . p&q&. . . . . . . . . . ",
+". . . . . . . . . . . r&s&. . . . . t&u&v&w&p.. . . x&1$y&. . . . . . . z&. . . . . . . . . . . ",
+". . . . . . . . . . . A&B&. . . . 5.C&D&E&F&. . . . G&^ H&. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . I&J&K&L&M&. . . . N&K#O&. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . P&Q&R&S&T&U&. . . . V&K#W&. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . K.X&Y&Z&`& *. . . . .*K#y%. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . +*%#@*. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . #*$*%*. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . &***=*. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . -*;*>*. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . ,*. . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/back_vocal_bg_vox.xpm b/images/MusicalInstruments/back_vocal_bg_vox.xpm
new file mode 100644
index 0000000..17edeb6
--- /dev/null
+++ b/images/MusicalInstruments/back_vocal_bg_vox.xpm
@@ -0,0 +1,581 @@
+/* XPM */
+static char * back_vocal_bg_vox_xpm[] = {
+"48 48 530 2",
+"  	c #969696",
+". 	c #636A71",
+"+ 	c #5D6771",
+"@ 	c #66707A",
+"# 	c #58626C",
+"$ 	c #5F6975",
+"% 	c #818D9D",
+"& 	c #8B97A5",
+"* 	c #949EA8",
+"= 	c #788389",
+"- 	c #4C555C",
+"; 	c #6C7073",
+"> 	c #535C65",
+", 	c #656D78",
+"' 	c #7B8390",
+") 	c #A2A9B9",
+"! 	c #A4B0C0",
+"~ 	c #5F6877",
+"{ 	c #444E58",
+"] 	c #3B464C",
+"^ 	c #273037",
+"/ 	c #293239",
+"( 	c #343A46",
+"_ 	c #818386",
+": 	c #4F5A5C",
+"< 	c #586464",
+"[ 	c #65716F",
+"} 	c #717B7A",
+"| 	c #79847E",
+"1 	c #97A29A",
+"2 	c #9EA9A1",
+"3 	c #ACB7B3",
+"4 	c #A9B2B7",
+"5 	c #9EA6B3",
+"6 	c #B1B8CB",
+"7 	c #7F8899",
+"8 	c #2F3847",
+"9 	c #121C26",
+"0 	c #0A131A",
+"a 	c #060F16",
+"b 	c #1C232B",
+"c 	c #2B313D",
+"d 	c #343A48",
+"e 	c #545F65",
+"f 	c #859191",
+"g 	c #A2AEAA",
+"h 	c #A7B4AB",
+"i 	c #ACB9AF",
+"j 	c #BAC6BC",
+"k 	c #B7C3B5",
+"l 	c #C2CFBD",
+"m 	c #B2BFAD",
+"n 	c #ACB8AC",
+"o 	c #919B9C",
+"p 	c #6D7582",
+"q 	c #787E94",
+"r 	c #5B6475",
+"s 	c #3A4352",
+"t 	c #232B36",
+"u 	c #00070E",
+"v 	c #00050D",
+"w 	c #252B37",
+"x 	c #6D6F75",
+"y 	c #576266",
+"z 	c #97A49D",
+"A 	c #8C9990",
+"B 	c #859288",
+"C 	c #7F8980",
+"D 	c #768173",
+"E 	c #6F7A69",
+"F 	c #6A7662",
+"G 	c #677264",
+"H 	c #5D6665",
+"I 	c #494F5B",
+"J 	c #62677B",
+"K 	c #535A6C",
+"L 	c #373E4E",
+"M 	c #222A35",
+"N 	c #00070F",
+"O 	c #020911",
+"P 	c #21252E",
+"Q 	c #242834",
+"R 	c #333645",
+"S 	c #858788",
+"T 	c #5A6567",
+"U 	c #5E6A68",
+"V 	c #57635F",
+"W 	c #55615D",
+"X 	c #565F5A",
+"Y 	c #555F57",
+"Z 	c #4C564D",
+"` 	c #6D776E",
+" .	c #5B645F",
+"..	c #51595C",
+"+.	c #3C424E",
+"@.	c #4A4F62",
+"#.	c #4D5466",
+"$.	c #192030",
+"%.	c #101622",
+"&.	c #0B121A",
+"*.	c #0A0E17",
+"=.	c #1F232C",
+"-.	c #303440",
+";.	c #73787A",
+">.	c #636769",
+",.	c #363B3F",
+"'.	c #7A7F83",
+").	c #4C5157",
+"!.	c #454952",
+"~.	c #393D48",
+"{.	c #393D49",
+"].	c #3C4355",
+"^.	c #0F1525",
+"/.	c #040A16",
+"(.	c #080F17",
+"_.	c #0D111A",
+":.	c #363845",
+"<.	c #292D39",
+"[.	c #848894",
+"}.	c #424652",
+"|.	c #424651",
+"1.	c #393E51",
+"2.	c #2F3545",
+"3.	c #212733",
+"4.	c #242831",
+"5.	c #464A53",
+"6.	c #61646D",
+"7.	c #565865",
+"8.	c #1E2628",
+"9.	c #899291",
+"0.	c #3B4443",
+"a.	c #464E50",
+"b.	c #3D444A",
+"c.	c #3D444C",
+"d.	c #3E454B",
+"e.	c #414850",
+"f.	c #4A505C",
+"g.	c #727886",
+"h.	c #9298A6",
+"i.	c #ABB1BD",
+"j.	c #989FA7",
+"k.	c #6E757B",
+"l.	c #505662",
+"m.	c #1F262E",
+"n.	c #878E94",
+"o.	c #434A50",
+"p.	c #3E454D",
+"q.	c #3D434F",
+"r.	c #474D5B",
+"s.	c #444B51",
+"t.	c #676E76",
+"u.	c #9197A3",
+"v.	c #ADB3C1",
+"w.	c #9DA3B1",
+"x.	c #8F95A1",
+"y.	c #828991",
+"z.	c #656C72",
+"A.	c #313743",
+"B.	c #2A3139",
+"C.	c #7E858B",
+"D.	c #5A6167",
+"E.	c #575E66",
+"F.	c #656B77",
+"G.	c #767C8A",
+"H.	c #8B9298",
+"I.	c #A6ADB5",
+"J.	c #C5CBD7",
+"K.	c #B0B6C4",
+"L.	c #464C58",
+"M.	c #3C434B",
+"N.	c #2A3137",
+"O.	c #1F2531",
+"P.	c #2D3540",
+"Q.	c #515C60",
+"R.	c #4E595D",
+"S.	c #6B7278",
+"T.	c #7F878A",
+"U.	c #767F7E",
+"V.	c #AAB3B0",
+"W.	c #ACB5B2",
+"X.	c #B7C0BF",
+"Y.	c #C3CBCE",
+"Z.	c #CAD1D7",
+"`.	c #B2B9C1",
+" +	c #AAB1BB",
+".+	c #AEB4C2",
+"++	c #7A8090",
+"@+	c #444A5A",
+"#+	c #262C3A",
+"$+	c #141B25",
+"%+	c #010810",
+"&+	c #0A101C",
+"*+	c #1D232F",
+"=+	c #262E39",
+"-+	c #7B8688",
+";+	c #AAB6B6",
+">+	c #B1BDBD",
+",+	c #BAC4BC",
+"'+	c #BFC9C0",
+")+	c #B6C1B3",
+"!+	c #BEC9B9",
+"~+	c #B8C3B3",
+"{+	c #AAB4AB",
+"]+	c #A2ACA4",
+"^+	c #7D848C",
+"/+	c #6A717B",
+"(+	c #7A808E",
+"_+	c #515767",
+":+	c #393F4F",
+"<+	c #323846",
+"[+	c #0F1620",
+"}+	c #000109",
+"|+	c #010713",
+"1+	c #1B212D",
+"2+	c #272F3A",
+"3+	c #818D8D",
+"4+	c #A0ACAA",
+"5+	c #99A5A1",
+"6+	c #818B80",
+"7+	c #758072",
+"8+	c #798473",
+"9+	c #75816D",
+"0+	c #67735F",
+"a+	c #6B7665",
+"b+	c #606B5D",
+"c+	c #6B756A",
+"d+	c #525963",
+"e+	c #424854",
+"f+	c #656B7B",
+"g+	c #4C5164",
+"h+	c #2F3447",
+"i+	c #2B3141",
+"j+	c #070D19",
+"k+	c #00010B",
+"l+	c #020814",
+"m+	c #1C222E",
+"n+	c #596563",
+"o+	c #626E6A",
+"p+	c #57645D",
+"q+	c #67706D",
+"r+	c #626C63",
+"s+	c #5B655A",
+"t+	c #656F64",
+"u+	c #5C6560",
+"v+	c #6B7471",
+"w+	c #505761",
+"x+	c #363C48",
+"y+	c #585E6E",
+"z+	c #515669",
+"A+	c #1F2437",
+"B+	c #161C2C",
+"C+	c #090F1B",
+"D+	c #080F19",
+"E+	c #050B17",
+"F+	c #6B6F73",
+"G+	c #828485",
+"H+	c #4D5955",
+"I+	c #4E5B54",
+"J+	c #4F565E",
+"K+	c #4D545A",
+"L+	c #4D5557",
+"M+	c #47504F",
+"N+	c #7C8584",
+"O+	c #ADB5B7",
+"P+	c #596066",
+"Q+	c #4D545C",
+"R+	c #4A515B",
+"S+	c #3D4353",
+"T+	c #101528",
+"U+	c #040A1A",
+"V+	c #050C16",
+"W+	c #25292A",
+"X+	c #7C7D7F",
+"Y+	c #DFE3E4",
+"Z+	c #42474B",
+"`+	c #3F4953",
+" @	c #353F49",
+".@	c #373F4A",
+"+@	c #353B47",
+"@@	c #2B2F3B",
+"#@	c #0F111E",
+"$@	c #151424",
+"%@	c #191627",
+"&@	c #222A37",
+"*@	c #313946",
+"=@	c #2A2E31",
+"-@	c #828385",
+";@	c #E4E8EB",
+">@	c #41464C",
+",@	c #444E5A",
+"'@	c #3B4350",
+")@	c #3E4450",
+"!@	c #434753",
+"~@	c #2E303D",
+"{@	c #343440",
+"]@	c #42424E",
+"^@	c #525A67",
+"/@	c #5B6370",
+"(@	c #525965",
+"_@	c #2B2E33",
+":@	c #7C7D82",
+"<@	c #DDE0E5",
+"[@	c #3E424B",
+"}@	c #404751",
+"|@	c #3D4454",
+"1@	c #3E4555",
+"2@	c #434B58",
+"3@	c #414550",
+"4@	c #434750",
+"5@	c #6D7079",
+"6@	c #95989F",
+"7@	c #ABB3C0",
+"8@	c #ADB5C2",
+"9@	c #8C94A1",
+"0@	c #6C7481",
+"a@	c #555D6A",
+"b@	c #2A2D32",
+"c@	c #7E7F84",
+"d@	c #E1E4EB",
+"e@	c #3F434C",
+"f@	c #414852",
+"g@	c #404757",
+"h@	c #3D4552",
+"i@	c #3C4250",
+"j@	c #3F4551",
+"k@	c #575E68",
+"l@	c #B2B9BF",
+"m@	c #B5BCC2",
+"n@	c #A1A9B6",
+"o@	c #7A828F",
+"p@	c #565E6B",
+"q@	c #555A63",
+"r@	c #23272A",
+"s@	c #7E7F83",
+"t@	c #DEE1E6",
+"u@	c #474C52",
+"v@	c #444B53",
+"w@	c #444B55",
+"x@	c #49505A",
+"y@	c #757E87",
+"z@	c #A0A9B2",
+"A@	c #C7D0D9",
+"B@	c #CCD5DE",
+"C@	c #78818A",
+"D@	c #4A525F",
+"E@	c #3C4451",
+"F@	c #3F4754",
+"G@	c #353D4A",
+"H@	c #272F3C",
+"I@	c #858687",
+"J@	c #363A39",
+"K@	c #868887",
+"L@	c #D7DBDC",
+"M@	c #787D80",
+"N@	c #7D8588",
+"O@	c #8C9292",
+"P@	c #9DA5A7",
+"Q@	c #ADB5B8",
+"R@	c #B5BEC5",
+"S@	c #BFC8D1",
+"T@	c #C2CCD8",
+"U@	c #A3ACBB",
+"V@	c #333F4F",
+"W@	c #28303D",
+"X@	c #1F2734",
+"Y@	c #0F1724",
+"Z@	c #0A121F",
+"`@	c #18202D",
+" #	c #212936",
+".#	c #29313E",
+"+#	c #57616B",
+"@#	c #646E78",
+"##	c #677576",
+"$#	c #808A8B",
+"%#	c #979D99",
+"&#	c #989D97",
+"*#	c #C4C7C0",
+"=#	c #ECF1EB",
+"-#	c #CBD1CF",
+";#	c #D3DCDB",
+">#	c #D8E0D5",
+",#	c #DDE4DD",
+"'#	c #C7D0CD",
+")#	c #9FA9AB",
+"!#	c #97A1AB",
+"~#	c #8C98A8",
+"{#	c #69748A",
+"]#	c #29354D",
+"^#	c #333B48",
+"/#	c #1E2633",
+"(#	c #08101D",
+"_#	c #00010E",
+":#	c #1C2431",
+"<#	c #232B38",
+"[#	c #A0AAB4",
+"}#	c #C8D2DC",
+"|#	c #CAD9D6",
+"1#	c #D8E3DF",
+"2#	c #DCE3DC",
+"3#	c #D4DAD0",
+"4#	c #CFD2C9",
+"5#	c #C6CCC2",
+"6#	c #C0C7C0",
+"7#	c #BDC6C1",
+"8#	c #A7B09F",
+"9#	c #A7AFA2",
+"0#	c #8B958D",
+"a#	c #5F696B",
+"b#	c #6E7882",
+"c#	c #6B768A",
+"d#	c #49556F",
+"e#	c #374260",
+"f#	c #424A57",
+"g#	c #171F2C",
+"h#	c #030B18",
+"i#	c #020A17",
+"j#	c #1D2532",
+"k#	c #323A47",
+"l#	c #6D787A",
+"m#	c #B1BDBB",
+"n#	c #BBC7C5",
+"o#	c #AAB89F",
+"p#	c #9CAA91",
+"q#	c #94A289",
+"r#	c #88967D",
+"s#	c #7B8A73",
+"t#	c #7C8B74",
+"u#	c #798871",
+"v#	c #6F7E67",
+"w#	c #717E60",
+"x#	c #727E6A",
+"y#	c #697271",
+"z#	c #848689",
+"A#	c #494D68",
+"B#	c #8285A4",
+"C#	c #565A75",
+"D#	c #3D415A",
+"E#	c #454955",
+"F#	c #1F232F",
+"G#	c #00020E",
+"H#	c #00000C",
+"I#	c #0B0F1B",
+"J#	c #181C28",
+"K#	c #272B37",
+"L#	c #353945",
+"M#	c #636A6B",
+"N#	c #6E7A7A",
+"O#	c #6C7876",
+"P#	c #687564",
+"Q#	c #616E5D",
+"R#	c #63705F",
+"S#	c #657261",
+"T#	c #626F5E",
+"U#	c #606D5C",
+"V#	c #667362",
+"W#	c #606C56",
+"X#	c #667163",
+"Y#	c #5F6769",
+"Z#	c #353952",
+"`#	c #6A6E89",
+" $	c #595E74",
+".$	c #292E42",
+"+$	c #2D313D",
+"@$	c #1E222E",
+"#$	c #0D111D",
+"$$	c #060A16",
+"%$	c #0A0E1A",
+"&$	c #171B27",
+"*$	c #2C303C",
+"=$	c #535E60",
+"-$	c #54605C",
+";$	c #505C58",
+">$	c #535E58",
+",$	c #515C56",
+"'$	c #4B5650",
+")$	c #69726D",
+"!$	c #919B93",
+"~$	c #576359",
+"{$	c #5C6763",
+"]$	c #576067",
+"^$	c #2E344A",
+"/$	c #51586B",
+"($	c #5F6676",
+"_$	c #0E1420",
+":$	c #0B111D",
+"<$	c #030915",
+"[$	c #161C28",
+"}$	c #303642",
+"|$	c #8C9194",
+"1$	c #E0E5E8",
+"2$	c #293042",
+"3$	c #2E3545",
+"4$	c #1D262D",
+"5$	c #000511",
+"6$	c #0C121E",
+"7$	c #232935",
+"8$	c #353841",
+"9$	c #898C93",
+"0$	c #F0F1F6",
+"a$	c #303843",
+"b$	c #323B42",
+"c$	c #161E29",
+"d$	c #151D28",
+"e$	c #1B232E",
+"f$	c #28303B",
+"g$	c #383840",
+"h$	c #8F8E94",
+"i$	c #EFEEF3",
+"j$	c #323A45",
+"k$	c #313944",
+"l$	c #3E454F",
+"m$	c #393A3C",
+"n$	c #959394",
+"o$	c #F0ECEB",
+"p$	c #838485",
+"q$	c #363636",
+"r$	c #959490",
+"s$	c #EDEAE5",
+"t$	c #373739",
+"u$	c #929091",
+"v$	c #F2EEED",
+"w$	c #38393B",
+"x$	c #3C3D41",
+"y$	c #929294",
+"z$	c #E9E9E9",
+"A$	c #33363B",
+"B$	c #8C9093",
+"C$	c #F3F4F8",
+"D$	c #8F949A",
+"E$	c #E2E7ED",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                . + @ #                                         ",
+"                                              $ % & * = - ;                                     ",
+"                                        > , ' ) ! ~ { ] ^ / ( _                                 ",
+"                          : < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d                                 ",
+"                      e f g h i j k l m n o p q r s t u v b w x                                 ",
+"                      y f z A B C D E F G H I J K L M N O P Q R                                 ",
+"                      S T U V W X Y Z `  ...+. at .#.$.%.&.*.=.-.                                  ",
+"                              ;.>.  ,.'.).!.~.{.].^./.(._.P :.                                  ",
+"                                    <.[.}.}.|.~.1.2.3.4.5.6.7.                                  ",
+"                                    8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.                              ",
+"                                    m.n.o.p.q.r.s.t.u.v.w.x.y.z.+.A.                            ",
+"                                    B.C.D.E.F.G.H.I.J.K.g.L.M.N.O.w P.                          ",
+"                            Q.R.S.T.U.V.W.X.Y.Z.`. +.+++ at +#+$+%+&+*+=+                          ",
+"                        S -+;+>+,+'+)+!+~+)+{+]+^+/+(+_+:+<+[+}+|+1+2+                          ",
+"                        Q.3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+P.                          ",
+"                          n+o+p+q+ .r+s+t+C u+v+w+x+y+z+A+B+C+D+E+*+F+                          ",
+"                        G+  H+I+J+K+L+M+N+O+P+Q+R+3.S+ at .T+U+j+V+j+*+                            ",
+"                                      W+X+Y+Z+s.`+ @. at +@@@#@$@%@&@*@                            ",
+"                                      =@-@;@>@c.,@'@'@)@!@~@{@]@^@/@(@                          ",
+"                                      _@:@<@[@}@|@1 at 2@q.3 at 4@5 at 6@7 at 8@9 at 0@a@                      ",
+"                                      b at c@d at e@f at g@h at i@j at k@^+l at m@n at 5 9 at o@p at q@                    ",
+"                                      r at s@t at u@v at w@x at k@y at z@A at B@C at D@2 at E@F at G@H@*@                  ",
+"                                    I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@Y at Z@`@ #.#                  ",
+"                            +#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#(#:#<#                  ",
+"                          @#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#_#i#g#j#k#                ",
+"                          l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#                ",
+"                        G+M#N#O#P#Q#R#S#T#U#R#V#W#X#Y#  Z#`# $.$+$@$#$$$%$&$*$                  ",
+"                            =$: -$;$;$>$,$'$)$!$~${$]$  ^$/$($&@&+_$:$l+<$[$}$                  ",
+"                            S               |$1$        2$3$  4$5$/./.l+6$7$                    ",
+"                                          8$9$0$          a$  b$c$d$d$e$f$                      ",
+"                                          g$h$i$                j$k$l$                          ",
+"                                          m$n$o$                                                ",
+"                                        p$q$r$s$                                                ",
+"                                          t$u$v$                                                ",
+"                                          w$n$v$                                                ",
+"                                          x$y$z$                                                ",
+"                                        G+A$B$C$                                                ",
+"                                            D$E$                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/clap.xpm b/images/MusicalInstruments/clap.xpm
new file mode 100644
index 0000000..b850ef9
--- /dev/null
+++ b/images/MusicalInstruments/clap.xpm
@@ -0,0 +1,638 @@
+/* XPM */
+static char * clap_xpm[] = {
+"48 48 587 2",
+"  	c #969696",
+". 	c #57575F",
+"+ 	c #535860",
+"@ 	c #535B63",
+"# 	c #59575F",
+"$ 	c #615454",
+"% 	c #6C5F5F",
+"& 	c #826763",
+"* 	c #545258",
+"= 	c #5B585F",
+"- 	c #816062",
+"; 	c #AE574B",
+"> 	c #B7694B",
+", 	c #C5724D",
+"' 	c #99513D",
+") 	c #5E5759",
+"! 	c #4E525E",
+"~ 	c #81685F",
+"{ 	c #BA654A",
+"] 	c #CA6343",
+"^ 	c #CE794C",
+"/ 	c #C05D2F",
+"( 	c #CF6646",
+"_ 	c #8E6D67",
+": 	c #7F8285",
+"< 	c #7D6463",
+"[ 	c #AA734B",
+"} 	c #C6764D",
+"| 	c #E18E6A",
+"1 	c #B26E40",
+"2 	c #C86E43",
+"3 	c #C97D6B",
+"4 	c #5A575C",
+"5 	c #7D6360",
+"6 	c #BF7749",
+"7 	c #B87342",
+"8 	c #DD896B",
+"9 	c #CA7458",
+"0 	c #AF6F48",
+"a 	c #E19370",
+"b 	c #A6736B",
+"c 	c #5E595F",
+"d 	c #B16F54",
+"e 	c #C87843",
+"f 	c #DC8F67",
+"g 	c #CD755F",
+"h 	c #B76553",
+"i 	c #E39B7F",
+"j 	c #E18E6B",
+"k 	c #7D564B",
+"l 	c #7D8185",
+"m 	c #54565E",
+"n 	c #57585F",
+"o 	c #7E8285",
+"p 	c #696E74",
+"q 	c #5C5C61",
+"r 	c #917264",
+"s 	c #B7714E",
+"t 	c #DE8D72",
+"u 	c #ED9573",
+"v 	c #BA6D54",
+"w 	c #D08E82",
+"x 	c #FAA78F",
+"y 	c #C56436",
+"z 	c #7F5037",
+"A 	c #4B5863",
+"B 	c #4F555E",
+"C 	c #9B6C63",
+"D 	c #9D7060",
+"E 	c #6B6363",
+"F 	c #4C545F",
+"G 	c #565861",
+"H 	c #8B675E",
+"I 	c #B66945",
+"J 	c #BA603A",
+"K 	c #E88F78",
+"L 	c #DB825F",
+"M 	c #BD7053",
+"N 	c #E9A38F",
+"O 	c #CB795B",
+"P 	c #A24F28",
+"Q 	c #775B4D",
+"R 	c #495560",
+"S 	c #686E74",
+"T 	c #C67D6B",
+"U 	c #CD724E",
+"V 	c #BB8160",
+"W 	c #B47B64",
+"X 	c #A66957",
+"Y 	c #C37A5D",
+"Z 	c #C16D41",
+"` 	c #A95731",
+" .	c #C9745A",
+"..	c #B96440",
+"+.	c #D58765",
+"@.	c #DC9175",
+"#.	c #AB5B39",
+"$.	c #A56545",
+"%.	c #605959",
+"&.	c #CF8774",
+"*.	c #CD6F4A",
+"=.	c #BB733F",
+"-.	c #C87F53",
+";.	c #BD7351",
+">.	c #C27E58",
+",.	c #CF8E60",
+"'.	c #B47348",
+").	c #B37051",
+"!.	c #BD734E",
+"~.	c #E29772",
+"{.	c #C07654",
+"].	c #A85E38",
+"^.	c #A7775E",
+"/.	c #50555C",
+"(.	c #686E75",
+"_.	c #CD8875",
+":.	c #C37046",
+"<.	c #8E4C15",
+"[.	c #A66638",
+"}.	c #C18462",
+"|.	c #BD8762",
+"1.	c #BC895B",
+"2.	c #C49065",
+"3.	c #B47F5E",
+"4.	c #AE6E4C",
+"5.	c #A9633C",
+"6.	c #995227",
+"7.	c #A06643",
+"8.	c #685F5D",
+"9.	c #CB8F7C",
+"0.	c #BE7B50",
+"a.	c #803D09",
+"b.	c #9F5A33",
+"c.	c #BA7B61",
+"d.	c #CA9375",
+"e.	c #BB8760",
+"f.	c #C7926C",
+"g.	c #C89074",
+"h.	c #A86E4F",
+"i.	c #9A5B33",
+"j.	c #9B582B",
+"k.	c #966B4E",
+"l.	c #525860",
+"m.	c #C9998A",
+"n.	c #CA8C69",
+"o.	c #843E11",
+"p.	c #A75E39",
+"q.	c #BA755C",
+"r.	c #C4876D",
+"s.	c #D09575",
+"t.	c #BC8362",
+"u.	c #CB9174",
+"v.	c #B97F63",
+"w.	c #A36642",
+"x.	c #A16C44",
+"y.	c #685D55",
+"z.	c #5E676E",
+"A.	c #C59E93",
+"B.	c #DB9379",
+"C.	c #8A471C",
+"D.	c #9F5B32",
+"E.	c #D48D6D",
+"F.	c #CB856A",
+"G.	c #CF8E72",
+"H.	c #BD8463",
+"I.	c #B07D56",
+"J.	c #BF8369",
+"K.	c #A56D4B",
+"L.	c #926F4A",
+"M.	c #585C61",
+"N.	c #7B7F83",
+"O.	c #CA9D8D",
+"P.	c #ED9C7B",
+"Q.	c #9B572E",
+"R.	c #914D27",
+"S.	c #D79171",
+"T.	c #E49E82",
+"U.	c #C78669",
+"V.	c #BE8360",
+"W.	c #B27C56",
+"X.	c #AE7554",
+"Y.	c #B37F58",
+"Z.	c #97734C",
+"`.	c #5A5D60",
+" +	c #D09B87",
+".+	c #F89F78",
+"++	c #B7724D",
+"@+	c #A05C3A",
+"#+	c #BE7758",
+"$+	c #EAA585",
+"%+	c #D89676",
+"&+	c #B37552",
+"*+	c #B37953",
+"=+	c #A9754E",
+"-+	c #AC7C50",
+";+	c #A0774D",
+">+	c #645A50",
+",+	c #535C65",
+"'+	c #7C6B69",
+")+	c #D98B68",
+"!+	c #C8815F",
+"~+	c #B47051",
+"{+	c #B16A4A",
+"]+	c #D38D6B",
+"^+	c #E09C79",
+"/+	c #B2714E",
+"(+	c #A26441",
+"_+	c #AD7B4F",
+":+	c #A5774A",
+"<+	c #AA7950",
+"[+	c #8C694C",
+"}+	c #585758",
+"|+	c #5E5A5E",
+"1+	c #D48E6E",
+"2+	c #DD9677",
+"3+	c #C68366",
+"4+	c #B06847",
+"5+	c #BE7452",
+"6+	c #E89F7C",
+"7+	c #D08B68",
+"8+	c #A46340",
+"9+	c #AD794F",
+"0+	c #B9865F",
+"a+	c #B77B5A",
+"b+	c #A97451",
+"c+	c #6F5F52",
+"d+	c #4A535E",
+"e+	c #55575F",
+"f+	c #DE9A80",
+"g+	c #EAA288",
+"h+	c #D28E73",
+"i+	c #B86F4E",
+"j+	c #AB623D",
+"k+	c #DD936F",
+"l+	c #E49E7B",
+"m+	c #B06E4C",
+"n+	c #AA734D",
+"o+	c #C88F70",
+"p+	c #CC876F",
+"q+	c #C17C55",
+"r+	c #956C46",
+"s+	c #575A5B",
+"t+	c #B3887B",
+"u+	c #EBA98F",
+"v+	c #D8967B",
+"w+	c #BA7657",
+"x+	c #9B5830",
+"y+	c #B67144",
+"z+	c #DD976F",
+"A+	c #C67F61",
+"B+	c #B7765A",
+"C+	c #C6866E",
+"D+	c #C8886F",
+"E+	c #BA7B53",
+"F+	c #8F5D2F",
+"G+	c #6A5A4B",
+"H+	c #4B545F",
+"I+	c #605C61",
+"J+	c #E2AA8E",
+"K+	c #DB9E82",
+"L+	c #B77A5C",
+"M+	c #96572D",
+"N+	c #96551F",
+"O+	c #CE895B",
+"P+	c #DC9177",
+"Q+	c #CF826D",
+"R+	c #C58268",
+"S+	c #AC7656",
+"T+	c #9E6C42",
+"U+	c #875322",
+"V+	c #735333",
+"W+	c #4C5055",
+"X+	c #615D60",
+"Y+	c #DAA784",
+"Z+	c #D59D79",
+"`+	c #B47755",
+" @	c #975829",
+".@	c #8E4B11",
+"+@	c #C47B4B",
+"@@	c #EB9C7E",
+"#@	c #DE9073",
+"$@	c #C68565",
+"%@	c #A46D49",
+"&@	c #936131",
+"*@	c #885720",
+"=@	c #795226",
+"-@	c #5A554D",
+";@	c #666D75",
+">@	c #B59684",
+",@	c #DFA87F",
+"'@	c #C78F68",
+")@	c #AF724C",
+"!@	c #995825",
+"~@	c #8D480B",
+"{@	c #B76B38",
+"]@	c #EB9A79",
+"^@	c #DD8F6D",
+"/@	c #B5754F",
+"(@	c #936037",
+"_@	c #8D5E29",
+":@	c #8A5B1F",
+"<@	c #80541C",
+"[@	c #6F5E44",
+"}@	c #4A545C",
+"|@	c #49515A",
+"1@	c #E5B496",
+"2@	c #EDAE85",
+"3@	c #C88B66",
+"4@	c #B4754F",
+"5@	c #9F5D29",
+"6@	c #8A4307",
+"7@	c #A75C29",
+"8@	c #E59674",
+"9@	c #DC8E69",
+"0@	c #AE6D45",
+"a@	c #8B592E",
+"b@	c #90632D",
+"c@	c #8A5C1E",
+"d@	c #805317",
+"e@	c #725733",
+"f@	c #494D51",
+"g@	c #656466",
+"h@	c #E2AD91",
+"i@	c #FCB591",
+"j@	c #E8A282",
+"k@	c #C27D5B",
+"l@	c #A86434",
+"m@	c #914D12",
+"n@	c #9A5521",
+"o@	c #DE9572",
+"p@	c #EA9C75",
+"q@	c #C07D56",
+"r@	c #96643B",
+"s@	c #8F6230",
+"t@	c #916227",
+"u@	c #88581E",
+"v@	c #6F4F24",
+"w@	c #5C5955",
+"x@	c #575C60",
+"y@	c #73716D",
+"z@	c #D4AE93",
+"A@	c #FDC19E",
+"B@	c #F2A588",
+"C@	c #CB7D63",
+"D@	c #A55A3B",
+"E@	c #A86133",
+"F@	c #A16026",
+"G@	c #AA6835",
+"H@	c #E19D7B",
+"I@	c #F2A580",
+"J@	c #CF8B65",
+"K@	c #9B6A43",
+"L@	c #835727",
+"M@	c #8F5E24",
+"N@	c #936329",
+"O@	c #875F2B",
+"P@	c #6B5B47",
+"Q@	c #535A62",
+"R@	c #4D525B",
+"S@	c #C7AB91",
+"T@	c #FFD8AA",
+"U@	c #F7C39E",
+"V@	c #E4AD8C",
+"W@	c #CD916C",
+"X@	c #AB6944",
+"Y@	c #AD663F",
+"Z@	c #BF7449",
+"`@	c #B76D40",
+" #	c #C17D57",
+".#	c #DC9D7E",
+"+#	c #EEA388",
+"@#	c #D9916F",
+"##	c #A56B3D",
+"$#	c #845218",
+"%#	c #825414",
+"&#	c #93662E",
+"*#	c #9D6E40",
+"=#	c #7D6239",
+"-#	c #66604D",
+";#	c #4B525A",
+">#	c #636266",
+",#	c #C9A78F",
+"'#	c #FFD0A5",
+")#	c #F3BD97",
+"!#	c #E2AF8B",
+"~#	c #C89874",
+"{#	c #B18055",
+"]#	c #AA7449",
+"^#	c #BD7D53",
+"/#	c #CC865E",
+"(#	c #B36C48",
+"_#	c #965230",
+":#	c #B57451",
+"<#	c #DD987F",
+"[#	c #D49272",
+"}#	c #A7703E",
+"|#	c #7F5314",
+"1#	c #785012",
+"2#	c #8D6533",
+"3#	c #A07450",
+"4#	c #9D7845",
+"5#	c #806535",
+"6#	c #676159",
+"7#	c #4A525D",
+"8#	c #7F8184",
+"9#	c #5A5C61",
+"0#	c #CDA78D",
+"a#	c #FFCCA2",
+"b#	c #F3BA92",
+"c#	c #E3AD84",
+"d#	c #CD9B72",
+"e#	c #B5865E",
+"f#	c #A67649",
+"g#	c #9A6D47",
+"h#	c #876D5D",
+"i#	c #836E63",
+"j#	c #805E4B",
+"k#	c #884F2C",
+"l#	c #A65E2E",
+"m#	c #C0825F",
+"n#	c #C28C69",
+"o#	c #A57946",
+"p#	c #795518",
+"q#	c #765219",
+"r#	c #946F42",
+"s#	c #A9815F",
+"t#	c #B08460",
+"u#	c #AE8256",
+"v#	c #967351",
+"w#	c #8C755E",
+"x#	c #616060",
+"y#	c #4A525A",
+"z#	c #696D73",
+"A#	c #606064",
+"B#	c #D2AA91",
+"C#	c #FFCAA0",
+"D#	c #F2B98F",
+"E#	c #E5AD81",
+"F#	c #CF9B70",
+"G#	c #BA8B60",
+"H#	c #A77C52",
+"I#	c #997046",
+"J#	c #746351",
+"K#	c #54585E",
+"L#	c #886142",
+"M#	c #A45E24",
+"N#	c #AB6F42",
+"O#	c #A97649",
+"P#	c #996C33",
+"Q#	c #7A5113",
+"R#	c #876024",
+"S#	c #AC8353",
+"T#	c #BC8D69",
+"U#	c #C39070",
+"V#	c #C48E6B",
+"W#	c #BE8A5A",
+"X#	c #B88752",
+"Y#	c #A5825A",
+"Z#	c #8B7661",
+"`#	c #50565C",
+" $	c #56595F",
+".$	c #C8A38C",
+"+$	c #E3B596",
+"@$	c #FFC69F",
+"#$	c #F0B892",
+"$$	c #E4AC82",
+"%$	c #D39D71",
+"&$	c #BB8B61",
+"*$	c #A57D52",
+"=$	c #9A734B",
+"-$	c #72614F",
+";$	c #4E555D",
+">$	c #665D56",
+",$	c #96663A",
+"'$	c #9D6232",
+")$	c #905B2B",
+"!$	c #8A5821",
+"~$	c #825519",
+"{$	c #996C30",
+"]$	c #B1804B",
+"^$	c #B88054",
+"/$	c #C38A67",
+"($	c #CC9471",
+"_$	c #CB9467",
+":$	c #C38F5B",
+"<$	c #C28F5B",
+"[$	c #BE9065",
+"}$	c #907763",
+"|$	c #5C5D61",
+"1$	c #5D5D62",
+"2$	c #C9A58D",
+"3$	c #FFCFA6",
+"4$	c #FFC59D",
+"5$	c #EFB694",
+"6$	c #E4AC87",
+"7$	c #D59E76",
+"8$	c #BF8D63",
+"9$	c #A97E54",
+"0$	c #96734B",
+"a$	c #75624B",
+"b$	c #55595F",
+"c$	c #4D555E",
+"d$	c #6B625B",
+"e$	c #875F41",
+"f$	c #8D613B",
+"g$	c #8C6439",
+"h$	c #8C6534",
+"i$	c #916836",
+"j$	c #956736",
+"k$	c #A16B3E",
+"l$	c #BB875B",
+"m$	c #CF9D72",
+"n$	c #D8A37A",
+"o$	c #D49D77",
+"p$	c #CB9770",
+"q$	c #C4936C",
+"r$	c #BC8E66",
+"s$	c #91755D",
+"t$	c #726B6A",
+"u$	c #C9A48C",
+"v$	c #FFCEA4",
+"w$	c #F9C59E",
+"x$	c #F0BD99",
+"y$	c #E4AE8D",
+"z$	c #D59E7B",
+"A$	c #BF8C64",
+"B$	c #A87B52",
+"C$	c #95704A",
+"D$	c #76634C",
+"E$	c #5F605E",
+"F$	c #655D5B",
+"G$	c #655C56",
+"H$	c #655F58",
+"I$	c #645C51",
+"J$	c #796248",
+"K$	c #A07955",
+"L$	c #BD9363",
+"M$	c #D3A372",
+"N$	c #DCA985",
+"O$	c #DDA68C",
+"P$	c #D39E85",
+"Q$	c #C89778",
+"R$	c #C0956C",
+"S$	c #BE9161",
+"T$	c #B6875A",
+"U$	c #FFCAA9",
+"V$	c #FEC5A0",
+"W$	c #FABF9A",
+"X$	c #F3BB97",
+"Y$	c #E5AF8E",
+"Z$	c #D1A27E",
+"`$	c #BC8C67",
+" %	c #A7784E",
+".%	c #997043",
+"+%	c #78644B",
+"@%	c #5C5E5E",
+"#%	c #4F565E",
+"$%	c #5E5F60",
+"%%	c #A28261",
+"&%	c #CC9968",
+"*%	c #D19D73",
+"=%	c #D5A07A",
+"-%	c #D49F7C",
+";%	c #CB9C7A",
+">%	c #BE9673",
+",%	c #C29367",
+"'%	c #C39062",
+")%	c #EFC1A2",
+"!%	c #ECB896",
+"~%	c #E8B190",
+"{%	c #E1AA8C",
+"]%	c #D19C7F",
+"^%	c #B8906F",
+"/%	c #A27A56",
+"(%	c #926B44",
+"_%	c #8A683E",
+":%	c #706452",
+"<%	c #535B62",
+"[%	c #907964",
+"}%	c #B58861",
+"|%	c #BA8C65",
+"1%	c #C2936A",
+"2%	c #C3956E",
+"3%	c #BE9471",
+"4%	c #B48F71",
+"5%	c #B78E6B",
+"6%	c #B88C67",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                            . +                                 ",
+"                                                    @ # $ % & *                                 ",
+"                                                  = - ; > , ' )                                 ",
+"                                                ! ~ { ] ^ / ( _                                 ",
+"                                              : < [ } | 1 2 3 4                                 ",
+"                                              5 6 7 8 9 0 a b                                   ",
+"                                            c d e f g h i j k l                                 ",
+"                              m n o p     q r s t u v w x y z A                                 ",
+"                              B C D E F G H I J K L M N O P Q R                                 ",
+"                              S T U V W X Y Z `  ...+. at .#.$.%.                                  ",
+"                              : &.*.=.-.;.>.,.'.).!.~.{.].^./.                                  ",
+"                              (._.:.<.[.}.|.1.2.3.4.5.6.7.8.                                    ",
+"                                9.0.a.b.c.d.e.f.g.h.i.j.k.l.                                    ",
+"                                m.n.o.p.q.r.s.t.u.v.w.x.y.                                      ",
+"                              z.A.B.C.D.E.F.G.H.I.J.K.L.M.                                      ",
+"                              N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`.                                      ",
+"                                 +.+++ at +#+$+%+&+*+=+-+;+>+,+                                    ",
+"                                '+)+!+~+{+]+^+/+(+_+:+<+[+}+                                    ",
+"                                |+1+2+3+4+5+6+7+8+9+0+a+b+c+d+                                  ",
+"                                e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+                                  ",
+"                                : t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+                                ",
+"                                  I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+                                ",
+"                                  X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@                              ",
+"                                  >@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@                              ",
+"                                |@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@                              ",
+"                                g at h@i at j@k at l@m at n@o at p@q at r@s at t@u at v@w@                              ",
+"                            x at y@z at A@B at C@D at E@F at G@H at I@J at K@L at M@N at O@P at Q@                            ",
+"                          R at S@T at U@V at W@X at Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#                          ",
+"                        >#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7#                        ",
+"                    8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#                    ",
+"                  z#A#B#C#D#E#F#G#H#I#J#    K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`#                  ",
+"              :  $.$+$@$#$$$%$&$*$=$-$;$      >$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$                ",
+"              1$2$3$4$5$6$7$8$9$0$a$b$        c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$d$              ",
+"            t$u$v$w$x$y$z$A$B$C$D$E$              9#F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$              ",
+"            U$V$W$X$Y$Z$`$ %.%+%@%                          #%$%%%&%*%=%-%;%>%,%'%              ",
+"            )%!%~%{%]%^%/%(%_%:%<%                            ;@[%}%|%1%2%3%4%5%6%              ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/drums_dr.xpm b/images/MusicalInstruments/drums_dr.xpm
new file mode 100644
index 0000000..0250673
--- /dev/null
+++ b/images/MusicalInstruments/drums_dr.xpm
@@ -0,0 +1,879 @@
+/* XPM */
+static char * drums_dr_xpm[] = {
+"48 48 828 2",
+"  	c #969696",
+". 	c #707477",
+"+ 	c #989386",
+"@ 	c #ABA58C",
+"# 	c #B2A88D",
+"$ 	c #C3B192",
+"% 	c #BBAA8B",
+"& 	c #A28D77",
+"* 	c #A79888",
+"= 	c #A29A8A",
+"- 	c #8E8B82",
+"; 	c #6F7270",
+"> 	c #555C63",
+", 	c #A99B8A",
+"' 	c #D6BC7E",
+") 	c #D4B678",
+"! 	c #D1B177",
+"~ 	c #D3B377",
+"{ 	c #D0AC6F",
+"] 	c #B79645",
+"^ 	c #A27F27",
+"/ 	c #BF9849",
+"( 	c #D2B175",
+"_ 	c #D2B275",
+": 	c #CEB575",
+"< 	c #C1AC7C",
+"[ 	c #968F85",
+"} 	c #4D565F",
+"| 	c #B4A58A",
+"1 	c #D0B675",
+"2 	c #D2B573",
+"3 	c #D1B275",
+"4 	c #CFB578",
+"5 	c #C79E5C",
+"6 	c #AD802F",
+"7 	c #A67B22",
+"8 	c #AE8631",
+"9 	c #BC9653",
+"0 	c #CEAB68",
+"a 	c #CDAA64",
+"b 	c #CCA863",
+"c 	c #C5A461",
+"d 	c #8A8880",
+"e 	c #8A887A",
+"f 	c #C6B579",
+"g 	c #CCB36B",
+"h 	c #D1AC66",
+"i 	c #CBA661",
+"j 	c #C89C56",
+"k 	c #C59548",
+"l 	c #C7A051",
+"m 	c #C3A458",
+"n 	c #C4A25A",
+"o 	c #C5A25A",
+"p 	c #C7A65E",
+"q 	c #B19E6C",
+"r 	c #616564",
+"s 	c #707376",
+"t 	c #4A5055",
+"u 	c #32363D",
+"v 	c #424545",
+"w 	c #5F5B54",
+"x 	c #726951",
+"y 	c #81765B",
+"z 	c #96845F",
+"A 	c #82795A",
+"B 	c #827D5F",
+"C 	c #747054",
+"D 	c #6F6A5D",
+"E 	c #575551",
+"F 	c #33373A",
+"G 	c #2A3036",
+"H 	c #313941",
+"I 	c #555E66",
+"J 	c #676E74",
+"K 	c #7B7C7E",
+"L 	c #868584",
+"M 	c #787A78",
+"N 	c #606364",
+"O 	c #434549",
+"P 	c #2B2F34",
+"Q 	c #2B2F33",
+"R 	c #636261",
+"S 	c #25282C",
+"T 	c #1F2327",
+"U 	c #1E2227",
+"V 	c #1F2328",
+"W 	c #1F2429",
+"X 	c #22272D",
+"Y 	c #282F36",
+"Z 	c #323A42",
+"` 	c #5D646B",
+" .	c #818387",
+"..	c #ABA7A4",
+"+.	c #D8D2C8",
+"@.	c #EAE5D9",
+"#.	c #EAE1CF",
+"$.	c #F0E6D4",
+"%.	c #EEE7D5",
+"&.	c #F1EBDB",
+"*.	c #E1DAD1",
+"=.	c #BAB8AF",
+"-.	c #787978",
+";.	c #706D6C",
+">.	c #2C3136",
+",.	c #232930",
+"'.	c #272D33",
+").	c #2A3037",
+"!.	c #2E353C",
+"~.	c #333B43",
+"{.	c #5B626A",
+"].	c #545C66",
+"^.	c #505760",
+"/.	c #8D847D",
+"(.	c #B2A69D",
+"_.	c #FEF3E9",
+":.	c #FFFFF3",
+"<.	c #FFFFF7",
+"[.	c #FFFDEE",
+"}.	c #FFFDEF",
+"|.	c #FEF8EC",
+"1.	c #F9F1E9",
+"2.	c #EFE9DB",
+"3.	c #B7B0A2",
+"4.	c #747267",
+"5.	c #343B42",
+"6.	c #313840",
+"7.	c #3B434C",
+"8.	c #535860",
+"9.	c #77797D",
+"0.	c #938F8D",
+"a.	c #B2ACA9",
+"b.	c #C4C0B7",
+"c.	c #BBB7A9",
+"d.	c #B3B0A1",
+"e.	c #C2BDAE",
+"f.	c #A2A093",
+"g.	c #9F9F99",
+"h.	c #84888B",
+"i.	c #60676D",
+"j.	c #87888A",
+"k.	c #696F74",
+"l.	c #4D555E",
+"m.	c #737172",
+"n.	c #5C554F",
+"o.	c #697186",
+"p.	c #94929B",
+"q.	c #9E9899",
+"r.	c #ACA5A4",
+"s.	c #A09A98",
+"t.	c #9C9A92",
+"u.	c #979592",
+"v.	c #7C7D8D",
+"w.	c #545C73",
+"x.	c #7F786F",
+"y.	c #68655E",
+"z.	c #333A41",
+"A.	c #3A424B",
+"B.	c #878482",
+"C.	c #B4ABA2",
+"D.	c #DFD4CA",
+"E.	c #E7DCD3",
+"F.	c #EFE5DB",
+"G.	c #F8EEE5",
+"H.	c #F3E8DF",
+"I.	c #F3E8DC",
+"J.	c #F6ECD9",
+"K.	c #EEE5D2",
+"L.	c #F0E7DB",
+"M.	c #ECE4DA",
+"N.	c #D3CDBC",
+"O.	c #B1ADA1",
+"P.	c #7D7F83",
+"Q.	c #656970",
+"R.	c #757574",
+"S.	c #6C6B6A",
+"T.	c #6A6E71",
+"U.	c #696C71",
+"V.	c #60666B",
+"W.	c #545D65",
+"X.	c #5B6067",
+"Y.	c #3C4047",
+"Z.	c #181D29",
+"`.	c #293145",
+" +	c #2C364B",
+".+	c #3D4966",
+"++	c #2A3247",
+"@+	c #222939",
+"#+	c #2A3246",
+"$+	c #232A3B",
+"%+	c #0E1118",
+"&+	c #464449",
+"*+	c #696760",
+"=+	c #32383E",
+"-+	c #40464E",
+";+	c #929390",
+">+	c #9D9992",
+",+	c #8390AF",
+"'+	c #DBD8D7",
+")+	c #E8E4E0",
+"!+	c #E6E5E8",
+"~+	c #E9E7E9",
+"{+	c #EFEAE8",
+"]+	c #F0EBE7",
+"^+	c #EEE9E7",
+"/+	c #EFEAE4",
+"(+	c #EFEAE3",
+"_+	c #EAE5E3",
+":+	c #C8CAD3",
+"<+	c #635C58",
+"[+	c #2C2C2C",
+"}+	c #212121",
+"|+	c #202020",
+"1+	c #2B2C2C",
+"2+	c #57575A",
+"3+	c #5C626A",
+"4+	c #4E5660",
+"5+	c #6A6F72",
+"6+	c #333941",
+"7+	c #000000",
+"8+	c #030406",
+"9+	c #0B0D12",
+"0+	c #252730",
+"a+	c #7A7666",
+"b+	c #494E52",
+"c+	c #545A5F",
+"d+	c #797B7D",
+"e+	c #414758",
+"f+	c #516187",
+"g+	c #5A6C97",
+"h+	c #5D709C",
+"i+	c #7D8EB5",
+"j+	c #8797BB",
+"k+	c #8C9ABD",
+"l+	c #99A6C3",
+"m+	c #A0ABC7",
+"n+	c #8897BB",
+"o+	c #5D6C8F",
+"p+	c #39352F",
+"q+	c #2B2B2B",
+"r+	c #262626",
+"s+	c #1E1E1E",
+"t+	c #1B1B1B",
+"u+	c #2C2D2C",
+"v+	c #525A61",
+"w+	c #565F66",
+"x+	c #576274",
+"y+	c #313846",
+"z+	c #000001",
+"A+	c #141822",
+"B+	c #010102",
+"C+	c #050609",
+"D+	c #0D1016",
+"E+	c #38393F",
+"F+	c #7D7968",
+"G+	c #555A5C",
+"H+	c #52575D",
+"I+	c #5F6366",
+"J+	c #2F3546",
+"K+	c #1E2533",
+"L+	c #212737",
+"M+	c #202532",
+"N+	c #38435D",
+"O+	c #3A4562",
+"P+	c #4C5B7F",
+"Q+	c #363F57",
+"R+	c #3B3D49",
+"S+	c #262A32",
+"T+	c #1A1D25",
+"U+	c #272727",
+"V+	c #161616",
+"W+	c #151515",
+"X+	c #0E0E0E",
+"Y+	c #070707",
+"Z+	c #6D757F",
+"`+	c #394255",
+" @	c #1B212E",
+".@	c #283043",
+"+@	c #171A22",
+"@@	c #4D514E",
+"#@	c #676159",
+"$@	c #777263",
+"%@	c #4E5356",
+"&@	c #454B50",
+"*@	c #787877",
+"=@	c #686A70",
+"-@	c #363E52",
+";@	c #131721",
+">@	c #151822",
+",@	c #242A37",
+"'@	c #0B0D13",
+")@	c #07090E",
+"!@	c #090C10",
+"~@	c #0B0B0B",
+"{@	c #020202",
+"]@	c #131313",
+"^@	c #6E7278",
+"/@	c #424E66",
+"(@	c #10131B",
+"_@	c #202636",
+":@	c #020304",
+"<@	c #0E1117",
+"[@	c #64605C",
+"}@	c #787166",
+"|@	c #7A7977",
+"1@	c #696B6C",
+"2@	c #9C9591",
+"3@	c #565B6A",
+"4@	c #141823",
+"5@	c #1D2026",
+"6@	c #242529",
+"7@	c #07080D",
+"8@	c #4D4E4F",
+"9@	c #010101",
+"0@	c #3E3F40",
+"a@	c #31353A",
+"b@	c #2E363E",
+"c@	c #5A6068",
+"d@	c #404B64",
+"e@	c #0C0E14",
+"f@	c #191E2B",
+"g@	c #32333F",
+"h@	c #766F63",
+"i@	c #807A6D",
+"j@	c #606161",
+"k@	c #706E70",
+"l@	c #262D40",
+"m@	c #161A26",
+"n@	c #525250",
+"o@	c #2E2D2D",
+"p@	c #141416",
+"q@	c #131414",
+"r@	c #141515",
+"s@	c #1C1D1D",
+"t@	c #2C2D2D",
+"u@	c #38393A",
+"v@	c #393A3D",
+"w@	c #212529",
+"x@	c #24292F",
+"y@	c #646C7B",
+"z@	c #333E56",
+"A@	c #040507",
+"B@	c #11141C",
+"C@	c #010203",
+"D@	c #31353D",
+"E@	c #625D4E",
+"F@	c #646052",
+"G@	c #3F4347",
+"H@	c #2F353B",
+"I@	c #6B6D6E",
+"J@	c #515457",
+"K@	c #3A3B45",
+"L@	c #262931",
+"M@	c #11151D",
+"N@	c #272F42",
+"O@	c #252C3E",
+"P@	c #20232A",
+"Q@	c #1A1D27",
+"R@	c #323641",
+"S@	c #4B4D56",
+"T@	c #4F4E52",
+"U@	c #63615E",
+"V@	c #282B2E",
+"W@	c #25272B",
+"X@	c #606261",
+"Y@	c #6D6C67",
+"Z@	c #2C2F32",
+"`@	c #1E2226",
+" #	c #293037",
+".#	c #333B44",
+"+#	c #545B63",
+"@#	c #505C78",
+"##	c #3C3D43",
+"$#	c #23252D",
+"%#	c #31394B",
+"&#	c #191B25",
+"*#	c #282A32",
+"=#	c #3C3E42",
+"-#	c #78776F",
+";#	c #68665E",
+">#	c #959187",
+",#	c #3D4045",
+"'#	c #2B3136",
+")#	c #2D3237",
+"!#	c #414245",
+"~#	c #676761",
+"{#	c #6D6B67",
+"]#	c #545962",
+"^#	c #50535D",
+"/#	c #807866",
+"(#	c #5D5851",
+"_#	c #6D6B6A",
+":#	c #5E5D5E",
+"<#	c #1D2125",
+"[#	c #1D2226",
+"}#	c #23282E",
+"|#	c #777876",
+"1#	c #6E6C64",
+"2#	c #2B3034",
+"3#	c #1F242A",
+"4#	c #23292F",
+"5#	c #282E35",
+"6#	c #2D343C",
+"7#	c #5D6166",
+"8#	c #5D5E5C",
+"9#	c #6D6A67",
+"0#	c #726A5F",
+"a#	c #645B47",
+"b#	c #48423A",
+"c#	c #606058",
+"d#	c #5B5A57",
+"e#	c #494A4A",
+"f#	c #474849",
+"g#	c #6C6A5F",
+"h#	c #B1AA9F",
+"i#	c #747374",
+"j#	c #5C5F63",
+"k#	c #41474D",
+"l#	c #31363D",
+"m#	c #282D34",
+"n#	c #23282D",
+"o#	c #22272B",
+"p#	c #292C31",
+"q#	c #2C2F31",
+"r#	c #23272B",
+"s#	c #202428",
+"t#	c #1F2326",
+"u#	c #22282E",
+"v#	c #31383F",
+"w#	c #7D7F7E",
+"x#	c #777978",
+"y#	c #2F343A",
+"z#	c #2A3139",
+"A#	c #303740",
+"B#	c #5B6166",
+"C#	c #2C3239",
+"D#	c #262C31",
+"E#	c #23272C",
+"F#	c #272B2D",
+"G#	c #323537",
+"H#	c #3D4149",
+"I#	c #5B5A56",
+"J#	c #4F4B3C",
+"K#	c #736E5B",
+"L#	c #9C9586",
+"M#	c #4E5467",
+"N#	c #2E374C",
+"O#	c #58606E",
+"P#	c #888884",
+"Q#	c #555A5E",
+"R#	c #30373E",
+"S#	c #262C32",
+"T#	c #242A31",
+"U#	c #252B32",
+"V#	c #2B3239",
+"W#	c #2F373F",
+"X#	c #484E55",
+"Y#	c #7C7F81",
+"Z#	c #313942",
+"`#	c #323A43",
+" $	c #2C333B",
+".$	c #262C33",
+"+$	c #292E35",
+"@$	c #474B52",
+"#$	c #72809B",
+"$$	c #5B6D93",
+"%$	c #53607B",
+"&$	c #3A4561",
+"*$	c #60564E",
+"=$	c #565A66",
+"-$	c #3C4457",
+";$	c #81807B",
+">$	c #7E7F7D",
+",$	c #3F464E",
+"'$	c #363E46",
+")$	c #313841",
+"!$	c #7C7D7F",
+"~$	c #7F8184",
+"{$	c #494F55",
+"]$	c #6F7376",
+"^$	c #6F7784",
+"/$	c #7C8BAD",
+"($	c #7F8FB6",
+"_$	c #6477A5",
+":$	c #37415B",
+"<$	c #222837",
+"[$	c #37425C",
+"}$	c #5E6371",
+"|$	c #1C2330",
+"1$	c #1A202D",
+"2$	c #2B3246",
+"3$	c #8A8681",
+"4$	c #797D7D",
+"5$	c #7B7B7D",
+"6$	c #848688",
+"7$	c #838486",
+"8$	c #727D90",
+"9$	c #9BA8C6",
+"0$	c #A7B1CC",
+"a$	c #6F81AC",
+"b$	c #323D55",
+"c$	c #495779",
+"d$	c #151924",
+"e$	c #2E374B",
+"f$	c #1A202C",
+"g$	c #171C28",
+"h$	c #2D374D",
+"i$	c #808081",
+"j$	c #686A6C",
+"k$	c #838586",
+"l$	c #6B7588",
+"m$	c #5D6C91",
+"n$	c #7888B1",
+"o$	c #B7C0D3",
+"p$	c #DCDEE4",
+"q$	c #D7D4D4",
+"r$	c #C3BBB2",
+"s$	c #A8A092",
+"t$	c #5B6680",
+"u$	c #444C5E",
+"v$	c #1D2431",
+"w$	c #0F1219",
+"x$	c #687087",
+"y$	c #686C6D",
+"z$	c #8A8A8D",
+"A$	c #747577",
+"B$	c #7C8081",
+"C$	c #999385",
+"D$	c #BAC2D4",
+"E$	c #EAEBEE",
+"F$	c #EEEFF0",
+"G$	c #EBEBEB",
+"H$	c #E8E9E9",
+"I$	c #E6E6E7",
+"J$	c #DBDBDB",
+"K$	c #CFCDC8",
+"L$	c #C9C4C0",
+"M$	c #868687",
+"N$	c #242B3C",
+"O$	c #48546E",
+"P$	c #374059",
+"Q$	c #040508",
+"R$	c #686C72",
+"S$	c #5A6168",
+"T$	c #928F8E",
+"U$	c #878685",
+"V$	c #787B80",
+"W$	c #A9A9A2",
+"X$	c #E7E6E3",
+"Y$	c #F6F6F6",
+"Z$	c #F0F0F0",
+"`$	c #E7E7E7",
+" %	c #E4E4E4",
+".%	c #E0E0E0",
+"+%	c #DCDDDD",
+"@%	c #DCDCDC",
+"#%	c #D6D6D7",
+"$%	c #CBCAC4",
+"%%	c #AA9984",
+"&%	c #494F64",
+"*%	c #1D2432",
+"=%	c #222937",
+"-%	c #656A69",
+";%	c #939597",
+">%	c #969694",
+",%	c #837A75",
+"'%	c #837C75",
+")%	c #5E6164",
+"!%	c #7C8182",
+"~%	c #E4E3E1",
+"{%	c #F4F5F6",
+"]%	c #EFEFEF",
+"^%	c #ECECEC",
+"/%	c #E8E8E8",
+"(%	c #E5E5E5",
+"_%	c #E1E1E1",
+":%	c #DDDDDD",
+"<%	c #D9D9D9",
+"[%	c #D5D5D5",
+"}%	c #D1D1D1",
+"|%	c #D0D0D1",
+"1%	c #C4C1BF",
+"2%	c #968F83",
+"3%	c #373D4F",
+"4%	c #12161E",
+"5%	c #6A6C6B",
+"6%	c #979794",
+"7%	c #5B6168",
+"8%	c #797877",
+"9%	c #858483",
+"0%	c #67696C",
+"a%	c #6A6D72",
+"b%	c #B3B5B4",
+"c%	c #F4F4F4",
+"d%	c #F1F1F1",
+"e%	c #EDEDED",
+"f%	c #E9E9E9",
+"g%	c #E6E6E6",
+"h%	c #E2E2E2",
+"i%	c #DEDEDE",
+"j%	c #DADADA",
+"k%	c #D6D6D6",
+"l%	c #D2D2D2",
+"m%	c #CECECE",
+"n%	c #C9C9C9",
+"o%	c #C7C7C7",
+"p%	c #BDBAB9",
+"q%	c #909092",
+"r%	c #676869",
+"s%	c #596169",
+"t%	c #878887",
+"u%	c #888684",
+"v%	c #53585E",
+"w%	c #474D53",
+"x%	c #908C88",
+"y%	c #828385",
+"z%	c #393F45",
+"A%	c #64686D",
+"B%	c #7A7D80",
+"C%	c #525B63",
+"D%	c #D6D6D5",
+"E%	c #F5F5F5",
+"F%	c #EEEEEE",
+"G%	c #EAEAEA",
+"H%	c #E3E3E3",
+"I%	c #D7D7D7",
+"J%	c #D3D3D3",
+"K%	c #CFCFCF",
+"L%	c #CBCBCB",
+"M%	c #C6C6C6",
+"N%	c #C3C3C3",
+"O%	c #C6C7C8",
+"P%	c #B3B0AB",
+"Q%	c #2D3344",
+"R%	c #6E7072",
+"S%	c #71757B",
+"T%	c #7F8383",
+"U%	c #7C7F7E",
+"V%	c #7B7E80",
+"W%	c #6C6F71",
+"X%	c #64676A",
+"Y%	c #7A797B",
+"Z%	c #818180",
+"`%	c #6F7172",
+" &	c #767779",
+".&	c #9A9692",
+"+&	c #878684",
+"@&	c #676D71",
+"#&	c #E3E2E1",
+"$&	c #D4D4D4",
+"%&	c #D0D0D0",
+"&&	c #CCCCCC",
+"*&	c #C8C8C8",
+"=&	c #BFBFBF",
+"-&	c #BEBEBE",
+";&	c #B6B6B3",
+">&	c #515663",
+",&	c #2E384E",
+"'&	c #2D374C",
+")&	c #6F6E69",
+"!&	c #43484D",
+"~&	c #848687",
+"{&	c #75787D",
+"]&	c #323941",
+"^&	c #32393F",
+"/&	c #30373D",
+"(&	c #373E44",
+"_&	c #41484F",
+":&	c #4A4F57",
+"<&	c #5F646A",
+"[&	c #6F7375",
+"}&	c #676B70",
+"|&	c #E1E1DE",
+"1&	c #EEEEEF",
+"2&	c #CDCDCD",
+"3&	c #C5C5C5",
+"4&	c #C0C0C0",
+"5&	c #BCBCBC",
+"6&	c #B9B9B9",
+"7&	c #B8B8B9",
+"8&	c #737E93",
+"9&	c #404E6C",
+"0&	c #525B6E",
+"a&	c #717373",
+"b&	c #61666A",
+"c&	c #474E55",
+"d&	c #303840",
+"e&	c #323942",
+"f&	c #5C6166",
+"g&	c #4D535A",
+"h&	c #73777B",
+"i&	c #515961",
+"j&	c #535B62",
+"k&	c #D6D6D4",
+"l&	c #DFDFDF",
+"m&	c #CACACA",
+"n&	c #C2C2C2",
+"o&	c #BDBDBD",
+"p&	c #BABABA",
+"q&	c #B6B6B6",
+"r&	c #ABA9A2",
+"s&	c #44516F",
+"t&	c #4F5A73",
+"u&	c #293042",
+"v&	c #515357",
+"w&	c #30373F",
+"x&	c #707479",
+"y&	c #5D6268",
+"z&	c #5B6269",
+"A&	c #C3C4C0",
+"B&	c #D8D8D8",
+"C&	c #BBBBBB",
+"D&	c #B7B7B7",
+"E&	c #B3B3B3",
+"F&	c #B3B3B4",
+"G&	c #AFAEAC",
+"H&	c #42506F",
+"I&	c #313C53",
+"J&	c #4D5978",
+"K&	c #5E5D5B",
+"L&	c #303336",
+"M&	c #262B31",
+"N&	c #787A7E",
+"O&	c #585E64",
+"P&	c #A1A39F",
+"Q&	c #E2E2E1",
+"R&	c #E2E2E3",
+"S&	c #C4C4C4",
+"T&	c #B8B8B8",
+"U&	c #B4B4B4",
+"V&	c #B0B0B0",
+"W&	c #AFAFAF",
+"X&	c #A9A8A7",
+"Y&	c #686F84",
+"Z&	c #4B5775",
+"`&	c #545D76",
+" *	c #2B2E30",
+".*	c #1E2328",
+"+*	c #545C65",
+"@*	c #5A626B",
+"#*	c #596068",
+"$*	c #797D7F",
+"%*	c #D6D5D4",
+"&*	c #E0E0E1",
+"**	c #C1C1C1",
+"=*	c #B5B5B5",
+"-*	c #B1B1B1",
+";*	c #AEAEAE",
+">*	c #ADADAD",
+",*	c #A8A7A6",
+"'*	c #A69C8F",
+")*	c #92877F",
+"!*	c #6F6E6D",
+"~*	c #21252A",
+"{*	c #242A30",
+"]*	c #666C72",
+"^*	c #A0A1A1",
+"/*	c #B2B2B2",
+"(*	c #ACACAC",
+"_*	c #ABABAB",
+":*	c #A9A7A5",
+"<*	c #948A7C",
+"[*	c #958C80",
+"}*	c #4F5154",
+"|*	c #878889",
+"1*	c #C0C1BB",
+"2*	c #AAAAAA",
+"3*	c #B1ACA6",
+"4*	c #837E78",
+"5*	c #6A6865",
+"6*	c #626161",
+"7*	c #636869",
+"8*	c #AFAFAD",
+"9*	c #CBCBCC",
+"0*	c #ABACAC",
+"a*	c #8A8582",
+"b*	c #434446",
+"c*	c #393D41",
+"d*	c #6E6F70",
+"e*	c #686B6D",
+"f*	c #30363B",
+"g*	c #898A8A",
+"h*	c #A9AAAA",
+"i*	c #AAA8A6",
+"j*	c #938D87",
+"k*	c #303235",
+"l*	c #1D2124",
+"m*	c #21262C",
+"n*	c #2B3138",
+"o*	c #707374",
+"p*	c #7E817D",
+"q*	c #515A61",
+"r*	c #343C44",
+"s*	c #2F363E",
+"t*	c #2B3137",
+"u*	c #646869",
+"v*	c #A9A9A8",
+"w*	c #B6B6B5",
+"x*	c #ABABAA",
+"y*	c #ACACAA",
+"z*	c #9F9D9C",
+"A*	c #85827F",
+"B*	c #454647",
+"C*	c #2B323A",
+"D*	c #535B60",
+"E*	c #707577",
+"F*	c #696D72",
+"G*	c #5A6167",
+"H*	c #272C32",
+"I*	c #303337",
+"J*	c #4B4D4F",
+"K*	c #5C5E5F",
+"L*	c #666667",
+"M*	c #4C4D4F",
+"N*	c #202429",
+"O*	c #252B31",
+"P*	c #6F7276",
+"Q*	c #60656B",
+"R*	c #6B6D6F",
+"S*	c #5B6268",
+"T*	c #2C343C",
+"U*	c #272E34",
+"V*	c #20252A",
+"W*	c #292F36",
+"X*	c #585D64",
+"Y*	c #525559",
+"Z*	c #2D353D",
+"`*	c #2C333A",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                    . + @ # $ % & * = - ; >                                                     ",
+"                  , ' ) ! ~ { ] ^ / ( _ : < [ }                                                 ",
+"                  | 1 2 3 4 5 6 7 8 9 0 a b c d                                                 ",
+"                    e f g h i j k l m n o p q r s                                               ",
+"                    t u v w x y z A B C D E F G H                                               ",
+"              I J K L M N O P Q R S T U V W X Y Z                                               ",
+"        `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.).!.~.      {.].                                        ",
+"      ^./.(._.:.<.[.}.:.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.    k.l.                      ",
+"        m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.              ",
+"        X.Y.Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+}+[+[+|+1+2+3+          ",
+"      4+5+6+7+7+7+8+9+7+7+7+7+0+a+b+c+d+e+ at +f+g+h+i+j+k+l+m+n+i+o+p+q+q+r+|+|+s+s+t+u+v+        ",
+"      w+x+y+z+7+7+9+A+7+B+C+D+E+F+G+H+I+J+A+K+L+M+N+O+ +P+f+Q+R+S+T+U+t+t+V+W+W+s+X+Y+          ",
+"      w+Z+`+7+7+7+ @. at 7+7++@@@#@$@%@&@*@=@-@;@7+7+>@, at B+8+B+'@)@7+!@X+~@~@Y+{@]@s+7+7+  ~.      ",
+"        ^@/@7+z+7+(@_ at 7+7+:@<@[@}@|@1 at 2@3 at 4@)@7+7+5 at 6@7+7+7+7 at C+)@8 at Y+7+{@9 at 7+7+7+9@0 at a@b@      ",
+"        c at d@7+7+7+e at f@7+7+7+7+g at h@i at j@k at l@:@B+7+7+Z.m at 7+7+7+7+7+e@n at o@p at q@r at s@t at u@v at w@x at b@      ",
+"        y at z@z+7+7+A at B@7+7+7+C at D@E at F@G at H@I at J@K at L@M at N@O at M@P at Q@R at S@T at U@V at W@X at Y@Z at T `@T X  #.#      ",
+"        +#@#.+##$#Z.%#D+&#*#=#-#;#>#,#G '#)#!#E ~#{#]#^#/#(#_#:#Z@<#[#}#|#1#2#3#4#5#6#.#        ",
+"          7#J at 8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#s#T t#W u#5#v#w#x#y#z#A#B#            ",
+"          .#C#D#E#F#G#S P H#I#J#K#L#M#N#O#P#Q#R#).S#T#u#}#,.U#5#V#W#X#  w#Y#6+Z#                ",
+"            `# $5#.$+$@$#$$$%$&$*$=$-$M at 4@$+;$>$,$'$~.)$)$Z#.#B#        !$~${$]$                ",
+"                s   ^$/$($_$:$<$[$}$|$ @L+1$1$2$3$4$                    5$6${$7$                ",
+"                  8$9$($0$a$:$b$c$L+d$e$f$g$m at 4@h$w#                    i$j$7#k$                ",
+"                l$m$n$o$p$q$r$s$t$u$v$ @f$w$l at x$d$$+y$                  z$A$s                   ",
+"              B$C$D$E$F$G$H$I$J$K$L$M$#+N$K+O$P$Q$Q$R$                S$T$U$                    ",
+"            V$W$X$Y$Z$G$`$ %.%+%@%#%$%%%&%P$*%M at d$%+=%-%            ;%>%,%'%)%                  ",
+"            !%~%{%]%^%/%(%_%:%<%[%}%|%1%2%3%%+;@4%B at 9+5%7#        6%>%7%8%9%0%a%                ",
+"            b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%g$%+A+%+A at r%6+    s%t%u%v%w%x%y%z%A%B%              ",
+"          C%D%E%F%G%`$H%.%J$I%J%K%L%M%N%O%P%Q%(@K+m at 1$R%R#  S%T%U%V%W%X%Y%Z%`% &.&+&j.          ",
+"          @&#&d%G$/% %_%:%<%$&%&&&*&N%=&-&;&>&B at 4@,&'&)&!&~&{&    {$Z ]&^&/&(&_&:&<&[&7%        ",
+"          }&|&1&f%(%h%i%j%k%l%2&n%3&4&5&6&7&8&M@`.9&9&0&a&b&  k$c&Z Z#Z Z#d&d&e&~.f&g&h&i&      ",
+"          j&k&e%`$H%l&J$I%J%m%m&M%n&o&p&q&5&r&`.,&s&t&u&v&w&X#]$k$                ]$    x&y&z&  ",
+"            A&G% %.%@%B&$&K%L%o%N%=&C&D&E&F&G&H&I&J&K&L&M&6#c&                          N&  O&  ",
+"            P&Q&R&:%<%[%}%2&*&S&4&5&T&U&V&W&X&Y&Z&`& *.*.$d&                                    ",
+"      +*@*#*$*%*&*j%k%l%m%m&3&**o&6&=*-*;*>*,*'*)*!*~*{*b@                                  7$  ",
+"    7#]*      ^*<%<%J%K%L%o%N%-&p&q&/*W&(*_*:*<*[*}*x@ $7$                                      ",
+"            s |*1*J%l%&&*&S&=&C&T&U&V&>*2*2*3*4*5*6*  s                                         ",
+"                7*8*9*m&3&**o&6&=*-*;*2*0*:*a*b*s#c*d*e*                                        ",
+"                ]&f*g*N%N%=&p&D&E&W&>*h*i*j*k*l*m*n*s o*p*q*  r*                                ",
+"                k$s*t*u*v*6&w*/*>*x*y*z*A*B*U u#C*`#    D*E*F*G*                                ",
+"                    H n*H*I*J*K*L*M* *T U N*O*6#P*          Q*R*S*                              ",
+"                      .#T*U*{*X V*W V*m*{*W*W#k$              X*Y*                              ",
+"                          c&d&Z* $`*6#W#Z P*                                                    ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/electric_bass_guitar_bs_gtr.xpm b/images/MusicalInstruments/electric_bass_guitar_bs_gtr.xpm
new file mode 100644
index 0000000..7001f4f
--- /dev/null
+++ b/images/MusicalInstruments/electric_bass_guitar_bs_gtr.xpm
@@ -0,0 +1,917 @@
+/* XPM */
+static char * electric_bass_guitar_bs_gtr_xpm[] = {
+"48 48 866 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #5E5761",
+"@ 	c #63656B",
+"# 	c #5B6066",
+"$ 	c #50565D",
+"% 	c #87888A",
+"& 	c #7B6F68",
+"* 	c #B88B6E",
+"= 	c #916D48",
+"- 	c #3A373C",
+"; 	c #B19E8D",
+"> 	c #EACEB3",
+", 	c #F4CFAE",
+"' 	c #E5BD9B",
+") 	c #EDC097",
+"! 	c #E6B081",
+"~ 	c #B99C80",
+"{ 	c #79726B",
+"] 	c #CD9F81",
+"^ 	c #B8805D",
+"/ 	c #8A5B2B",
+"( 	c #623E28",
+"_ 	c #373C44",
+": 	c #B09C8A",
+"< 	c #EBCAAE",
+"[ 	c #F6CEA9",
+"} 	c #E3B48B",
+"| 	c #EBB786",
+"1 	c #E6A467",
+"2 	c #B8987A",
+"3 	c #545658",
+"4 	c #BB9279",
+"5 	c #CF9672",
+"6 	c #AE6D45",
+"7 	c #8A4319",
+"8 	c #553E26",
+"9 	c #2F343C",
+"0 	c #AF9A87",
+"a 	c #E7BE9E",
+"b 	c #F2C49A",
+"c 	c #DDA172",
+"d 	c #E4AA79",
+"e 	c #DEA26E",
+"f 	c #AD8D70",
+"g 	c #393B3F",
+"h 	c #838486",
+"i 	c #6C635A",
+"j 	c #CB9370",
+"k 	c #C1825B",
+"l 	c #AD6031",
+"m 	c #8E4718",
+"n 	c #4E351C",
+"o 	c #292D34",
+"p 	c #AF9884",
+"q 	c #E7B997",
+"r 	c #F1C095",
+"s 	c #E3A36D",
+"t 	c #ECB27E",
+"u 	c #E2A777",
+"v 	c #A5876C",
+"w 	c #323336",
+"x 	c #333B44",
+"y 	c #826656",
+"z 	c #C98A5F",
+"A 	c #B47147",
+"B 	c #AE5C28",
+"C 	c #974B1B",
+"D 	c #5E3D19",
+"E 	c #27272E",
+"F 	c #323A43",
+"G 	c #AE9782",
+"H 	c #E8BA91",
+"I 	c #EEBE92",
+"J 	c #C38F63",
+"K 	c #E6B17C",
+"L 	c #E9B079",
+"M 	c #A68970",
+"N 	c #2F3135",
+"O 	c #313841",
+"P 	c #82604D",
+"Q 	c #BE7546",
+"R 	c #B2693C",
+"S 	c #B05C25",
+"T 	c #A45420",
+"U 	c #793C17",
+"V 	c #2A252A",
+"W 	c #303841",
+"X 	c #B49E8A",
+"Y 	c #E1B38E",
+"Z 	c #E3B589",
+"` 	c #AC7A52",
+" .	c #D6A376",
+"..	c #DEA773",
+"+.	c #A5896C",
+"@.	c #303234",
+"#.	c #303840",
+"$.	c #6E5243",
+"%.	c #C26F3A",
+"&.	c #B46737",
+"*.	c #AE5B27",
+"=.	c #AC5723",
+"-.	c #984B1B",
+";.	c #523A1E",
+">.	c #2F353D",
+",.	c #AF9887",
+"'.	c #F3CBA6",
+").	c #EDBE93",
+"!.	c #E3A96E",
+"~.	c #E4AD7B",
+"{.	c #D9A477",
+"].	c #AC9071",
+"^.	c #333434",
+"/.	c #5A4C3D",
+"(.	c #AF5C28",
+"_.	c #B36231",
+":.	c #B15A23",
+"<.	c #AB5722",
+"[.	c #8D461D",
+"}.	c #44373D",
+"|.	c #717376",
+"1.	c #C09A7E",
+"2.	c #F0CDA9",
+"3.	c #EABF94",
+"4.	c #DBA16D",
+"5.	c #E0AD7C",
+"6.	c #D2A06F",
+"7.	c #AD8F71",
+"8.	c #333435",
+"9.	c #303740",
+"0.	c #413F3D",
+"a.	c #9C5021",
+"b.	c #AA521A",
+"c.	c #A95924",
+"d.	c #AF5A26",
+"e.	c #B8612B",
+"f.	c #B56532",
+"g.	c #A46841",
+"h.	c #866652",
+"i.	c #6D645D",
+"j.	c #947B6D",
+"k.	c #E4B28D",
+"l.	c #FAD4AB",
+"m.	c #E4B98C",
+"n.	c #AB7652",
+"o.	c #D8A879",
+"p.	c #E7AF75",
+"q.	c #B39271",
+"r.	c #353536",
+"s.	c #2F373F",
+"t.	c #4A5055",
+"u.	c #7C4929",
+"v.	c #BC591A",
+"w.	c #A85621",
+"x.	c #A95824",
+"y.	c #BA652D",
+"z.	c #AF5C27",
+"A.	c #C27748",
+"B.	c #C3835A",
+"C.	c #BB8765",
+"D.	c #CA9270",
+"E.	c #E7AD84",
+"F.	c #EACFA1",
+"G.	c #EABC8C",
+"H.	c #DBA067",
+"I.	c #E6B47E",
+"J.	c #DBA974",
+"K.	c #B19171",
+"L.	c #353535",
+"M.	c #746660",
+"N.	c #685F55",
+"O.	c #44392D",
+"P.	c #A34B15",
+"Q.	c #AD5823",
+"R.	c #A6531F",
+"S.	c #A8521A",
+"T.	c #B35C25",
+"U.	c #B4612F",
+"V.	c #BC6F3E",
+"W.	c #BF7C52",
+"X.	c #BD7548",
+"Y.	c #E4A779",
+"Z.	c #E6C996",
+"`.	c #EAB584",
+" +	c #E3A16B",
+".+	c #E7B17F",
+"++	c #D9A474",
+"@+	c #B99675",
+"#+	c #393737",
+"$+	c #6F6B66",
+"%+	c #C19071",
+"&+	c #AA704A",
+"*+	c #5B4937",
+"=+	c #34393E",
+"-+	c #7C4623",
+";+	c #B35B24",
+">+	c #A2531F",
+",+	c #B45D25",
+"'+	c #B1581E",
+")+	c #B35C24",
+"!+	c #B9612B",
+"~+	c #B15F2C",
+"{+	c #BD6830",
+"]+	c #E19B6B",
+"^+	c #E8C48D",
+"/+	c #DDA97C",
+"(+	c #A77250",
+"_+	c #D6A575",
+":+	c #E8AD79",
+"<+	c #C09A77",
+"[+	c #3D3B3A",
+"}+	c #A88A7A",
+"|+	c #C08966",
+"1+	c #AC6335",
+"2+	c #7F421E",
+"3+	c #3A3938",
+"4+	c #5C6166",
+"5+	c #4B3C2C",
+"6+	c #AE5924",
+"7+	c #A75621",
+"8+	c #AE5823",
+"9+	c #B0541A",
+"0+	c #B4561C",
+"a+	c #B6591F",
+"b+	c #B1571E",
+"c+	c #BB5C21",
+"d+	c #DF9561",
+"e+	c #DFBD86",
+"f+	c #E5AF7C",
+"g+	c #C98D55",
+"h+	c #E0A974",
+"i+	c #EDAE75",
+"j+	c #B68E6F",
+"k+	c #2D2C2A",
+"l+	c #676664",
+"m+	c #BA8D73",
+"n+	c #B2714A",
+"o+	c #A44C14",
+"p+	c #813C10",
+"q+	c #41362B",
+"r+	c #484E55",
+"s+	c #37393B",
+"t+	c #81441B",
+"u+	c #A84D14",
+"v+	c #B15B24",
+"w+	c #AF5419",
+"x+	c #B4551A",
+"y+	c #B9581B",
+"z+	c #BC5A1B",
+"A+	c #DD925D",
+"B+	c #D9B47D",
+"C+	c #E3AC75",
+"D+	c #CD894C",
+"E+	c #E4AA6F",
+"F+	c #F3B272",
+"G+	c #C5956F",
+"H+	c #443729",
+"I+	c #34373E",
+"J+	c #55585C",
+"K+	c #736F6B",
+"L+	c #B3937E",
+"M+	c #B7805D",
+"N+	c #A25728",
+"O+	c #9B4712",
+"P+	c #7F3A10",
+"Q+	c #453025",
+"R+	c #373E44",
+"S+	c #5E3C28",
+"T+	c #B45F29",
+"U+	c #AB511A",
+"V+	c #B5551B",
+"W+	c #B6581A",
+"X+	c #B15318",
+"Y+	c #BE5A1C",
+"Z+	c #DC8D57",
+"`+	c #D9B178",
+" @	c #D7A06C",
+".@	c #976333",
+"+@	c #D4A06B",
+"@@	c #F6BD79",
+"#@	c #D4A27A",
+"$@	c #846039",
+"%@	c #866C50",
+"&@	c #A1886C",
+"*@	c #B58F79",
+"=@	c #C09478",
+"-@	c #BA8564",
+";@	c #A8653A",
+">@	c #9C4713",
+",@	c #984613",
+"'@	c #79380F",
+")@	c #3A2E23",
+"!@	c #2C333B",
+"~@	c #413C37",
+"{@	c #A26034",
+"]@	c #AF5A25",
+"^@	c #AA561F",
+"/@	c #B5571D",
+"(@	c #B35318",
+"_@	c #DE9360",
+":@	c #DCBC8C",
+"<@	c #E7B380",
+"[@	c #DBA168",
+"}@	c #EDBE88",
+"|@	c #F7CD90",
+"1@	c #DBA984",
+"2@	c #9F613B",
+"3@	c #AB724D",
+"4@	c #BA7E59",
+"5@	c #B87F5C",
+"6@	c #B57B57",
+"7@	c #AC6940",
+"8@	c #A14C16",
+"9@	c #994612",
+"0@	c #914312",
+"a@	c #5D2F12",
+"b@	c #252526",
+"c@	c #2B323A",
+"d@	c #3E4043",
+"e@	c #955D3B",
+"f@	c #B66432",
+"g@	c #BA6936",
+"h@	c #B15920",
+"i@	c #BC5A1C",
+"j@	c #B65719",
+"k@	c #DB8951",
+"l@	c #D1743C",
+"m@	c #DD8F5A",
+"n@	c #E09663",
+"o@	c #D58049",
+"p@	c #D78B53",
+"q@	c #9E5526",
+"r@	c #A55E31",
+"s@	c #B1693B",
+"t@	c #B26A3D",
+"u@	c #AE6333",
+"v@	c #A4501B",
+"w@	c #9C4812",
+"x@	c #934411",
+"y@	c #853C0F",
+"z@	c #4A3219",
+"A@	c #1F242A",
+"B@	c #2C343C",
+"C@	c #878687",
+"D@	c #9A6648",
+"E@	c #BD7343",
+"F@	c #BD703F",
+"G@	c #B05822",
+"H@	c #BA5A1E",
+"I@	c #B9571A",
+"J@	c #D8864B",
+"K@	c #C65E1D",
+"L@	c #D3814A",
+"M@	c #D3824B",
+"N@	c #BA591D",
+"O@	c #CB7F4B",
+"P@	c #AE551E",
+"Q@	c #AB5822",
+"R@	c #B05924",
+"S@	c #AC5119",
+"T@	c #A54B14",
+"U@	c #9A4713",
+"V@	c #924412",
+"W@	c #6D310B",
+"X@	c #271F18",
+"Y@	c #23282E",
+"Z@	c #9B6F56",
+"`@	c #BF784D",
+" #	c #BF7444",
+".#	c #DA8850",
+"+#	c #CB6624",
+"@#	c #D4834B",
+"##	c #C8611E",
+"$#	c #D5854B",
+"%#	c #CF8149",
+"&#	c #B4541A",
+"*#	c #B4551B",
+"=#	c #B35419",
+"-#	c #AD5218",
+";#	c #A24B14",
+">#	c #944412",
+",#	c #883E11",
+"'#	c #432C15",
+")#	c #1B1F24",
+"!#	c #272D34",
+"~#	c #68625D",
+"{#	c #BA8665",
+"]#	c #CA885D",
+"^#	c #BF7445",
+"/#	c #B45E26",
+"(#	c #BB5819",
+"_#	c #D9874D",
+":#	c #CB6425",
+"<#	c #D7844B",
+"[#	c #C9621F",
+"}#	c #C25C1D",
+"|#	c #D08149",
+"1#	c #B25318",
+"2#	c #AC5218",
+"3#	c #924311",
+"4#	c #76360D",
+"5#	c #24201C",
+"6#	c #4F5358",
+"7#	c #AF8D76",
+"8#	c #CC916B",
+"9#	c #C68459",
+"0#	c #B36432",
+"a#	c #B85D25",
+"b#	c #BD5B1D",
+"c#	c #D9874C",
+"d#	c #B45419",
+"e#	c #B55719",
+"f#	c #AE5218",
+"g#	c #9F4B13",
+"h#	c #9A4813",
+"i#	c #733915",
+"j#	c #232120",
+"k#	c #252B31",
+"l#	c #313942",
+"m#	c #7C746A",
+"n#	c #CB9978",
+"o#	c #C38760",
+"p#	c #B87143",
+"q#	c #B7642F",
+"r#	c #B65920",
+"s#	c #C15A1C",
+"t#	c #DB8B53",
+"u#	c #CC692A",
+"v#	c #C96221",
+"w#	c #BA5819",
+"x#	c #AF5218",
+"y#	c #A14C13",
+"z#	c #9C4913",
+"A#	c #753A17",
+"B#	c #262524",
+"C#	c #2A3138",
+"D#	c #6F7376",
+"E#	c #5B5C5E",
+"F#	c #C99E83",
+"G#	c #CB916D",
+"H#	c #C9885D",
+"I#	c #BA6B39",
+"J#	c #BA6127",
+"K#	c #B75A1D",
+"L#	c #DB8C55",
+"M#	c #CC6829",
+"N#	c #DA894F",
+"O#	c #C45F1E",
+"P#	c #823B0F",
+"Q#	c #2E2A25",
+"R#	c #A78978",
+"S#	c #D39B79",
+"T#	c #CD9068",
+"U#	c #BA6F40",
+"V#	c #BF652E",
+"W#	c #BB5C20",
+"X#	c #BB591A",
+"Y#	c #AF5318",
+"Z#	c #763307",
+"`#	c #A96A3E",
+" $	c #893D0D",
+".$	c #A7693D",
+"+$	c #7A3408",
+"@$	c #9E643A",
+"#$	c #783307",
+"$$	c #A2673C",
+"%$	c #642701",
+"&$	c #96430F",
+"*$	c #B05318",
+"=$	c #AA4D15",
+"-$	c #9E4913",
+";$	c #6F471D",
+">$	c #2C282F",
+",$	c #786C67",
+"'$	c #D29E7D",
+")$	c #D09772",
+"!$	c #BB774A",
+"~$	c #BC6834",
+"{$	c #BF6125",
+"]$	c #291825",
+"^$	c #786D69",
+"/$	c #534845",
+"($	c #826D66",
+"_$	c #483E41",
+":$	c #7A695E",
+"<$	c #423A3C",
+"[$	c #7F7065",
+"}$	c #000718",
+"|$	c #410000",
+"1$	c #AD5217",
+"2$	c #A54D14",
+"3$	c #A44D14",
+"4$	c #9B4713",
+"5$	c #593C1F",
+"6$	c #363C42",
+"7$	c #525459",
+"8$	c #BE947B",
+"9$	c #D19773",
+"0$	c #C98961",
+"a$	c #BE6F3D",
+"b$	c #BE632A",
+"c$	c #BD5C1E",
+"d$	c #C15B1D",
+"e$	c #251117",
+"f$	c #73635A",
+"g$	c #48342D",
+"h$	c #7A6057",
+"i$	c #3C2D2D",
+"j$	c #745F51",
+"k$	c #392528",
+"l$	c #766055",
+"m$	c #0A0E19",
+"n$	c #5A1504",
+"o$	c #A74D14",
+"p$	c #863E10",
+"q$	c #4B3D2E",
+"r$	c #917B6F",
+"s$	c #E1A782",
+"t$	c #BB7245",
+"u$	c #C06831",
+"v$	c #BF6023",
+"w$	c #BF5B1E",
+"x$	c #883C0C",
+"y$	c #42221F",
+"z$	c #816B64",
+"A$	c #593F39",
+"B$	c #826A5A",
+"C$	c #4F3F3C",
+"D$	c #877060",
+"E$	c #4D3835",
+"F$	c #816B60",
+"G$	c #0A070E",
+"H$	c #570800",
+"I$	c #AE5217",
+"J$	c #7B3E18",
+"K$	c #3D3A37",
+"L$	c #545659",
+"M$	c #D19B7A",
+"N$	c #CE916B",
+"O$	c #C7855B",
+"P$	c #BD6B38",
+"Q$	c #BF6227",
+"R$	c #C25D1E",
+"S$	c #B67241",
+"T$	c #94420E",
+"U$	c #B37040",
+"V$	c #93430F",
+"W$	c #B06E40",
+"X$	c #AA6C3E",
+"Y$	c #793307",
+"Z$	c #A64E14",
+"`$	c #A34B14",
+" %	c #A04B14",
+".%	c #643B22",
+"+%	c #32343B",
+"@%	c #937F6C",
+"#%	c #DE9F78",
+"$%	c #C08158",
+"%%	c #B96E3F",
+"&%	c #BA632D",
+"*%	c #BE5E20",
+"=%	c #BE5B1D",
+"-%	c #CC6627",
+";%	c #BB5D5D",
+">%	c #A04913",
+",%	c #91410E",
+"'%	c #873D0E",
+")%	c #523D25",
+"!%	c #AB8065",
+"~%	c #D59066",
+"{%	c #C17A4D",
+"]%	c #BA6834",
+"^%	c #BD6026",
+"/%	c #BF5C1F",
+"(%	c #9F663A",
+"_%	c #622701",
+":%	c #AB5621",
+"<%	c #B16C68",
+"[%	c #A74C14",
+"}%	c #8D3F0E",
+"|%	c #783B14",
+"1%	c #535352",
+"2%	c #AF7B5A",
+"3%	c #D08556",
+"4%	c #C06F3E",
+"5%	c #BA622C",
+"6%	c #BD5D1F",
+"7%	c #28171E",
+"8%	c #746362",
+"9%	c #412D33",
+"0%	c #745F59",
+"a%	c #392C35",
+"b%	c #78605A",
+"c%	c #372931",
+"d%	c #6D5C58",
+"e%	c #000013",
+"f%	c #4E0C00",
+"g%	c #A04B13",
+"h%	c #974512",
+"i%	c #863D0E",
+"j%	c #292F37",
+"k%	c #6F7276",
+"l%	c #6A5946",
+"m%	c #C58157",
+"n%	c #CA7845",
+"o%	c #C36B33",
+"p%	c #BE6125",
+"q%	c #BC5B1D",
+"r%	c #6E2D03",
+"s%	c #22181E",
+"t%	c #746564",
+"u%	c #452E32",
+"v%	c #786258",
+"w%	c #3C2E38",
+"x%	c #76615B",
+"y%	c #37292F",
+"z%	c #705D55",
+"A%	c #00041A",
+"B%	c #490F01",
+"C%	c #B6561A",
+"D%	c #A44B14",
+"E%	c #8B3E0E",
+"F%	c #853B0D",
+"G%	c #232930",
+"H%	c #323A42",
+"I%	c #5B4834",
+"J%	c #B46B3E",
+"K%	c #C06730",
+"L%	c #C06327",
+"M%	c #311919",
+"N%	c #74645E",
+"O%	c #472E2C",
+"P%	c #7A6056",
+"Q%	c #3E3133",
+"R%	c #7A6259",
+"S%	c #3C2A2D",
+"T%	c #766159",
+"U%	c #050215",
+"V%	c #560D00",
+"W%	c #AB756D",
+"X%	c #A74F17",
+"Y%	c #7C370B",
+"Z%	c #79360C",
+"`%	c #21262C",
+" &	c #403E3C",
+".&	c #8E4D23",
+"+&	c #B0561C",
+"@&	c #BC591B",
+"#&	c #8A3D0C",
+"$&	c #B87343",
+"%&	c #AE6E3F",
+"&&	c #A14A13",
+"*&	c #C6601E",
+"=&	c #B45755",
+"-&	c #A44D16",
+";&	c #7B360B",
+">&	c #7F3C15",
+",&	c #2F363F",
+"'&	c #494F55",
+")&	c #573B1E",
+"!&	c #B35D25",
+"~&	c #B35319",
+"{&	c #B05218",
+"]&	c #A74F16",
+"^&	c #994812",
+"/&	c #883D0F",
+"(&	c #793B14",
+"_&	c #2E363E",
+":&	c #363535",
+"<&	c #994E1E",
+"[&	c #A54C15",
+"}&	c #AF5118",
+"|&	c #B15218",
+"1&	c #B25218",
+"2&	c #D1814A",
+"3&	c #C87C47",
+"4&	c #AB4E15",
+"5&	c #C15C1D",
+"6&	c #A64C14",
+"7&	c #914211",
+"8&	c #803B0F",
+"9&	c #562F17",
+"0&	c #20252B",
+"a&	c #323941",
+"b&	c #5F3E1A",
+"c&	c #AE5117",
+"d&	c #B9937E",
+"e&	c #B9A08A",
+"f&	c #9E8271",
+"g&	c #BC9D88",
+"h&	c #A17F71",
+"i&	c #C29C84",
+"j&	c #A67A6C",
+"k&	c #BF9C80",
+"l&	c #A98D7C",
+"m&	c #C86423",
+"n&	c #C66326",
+"o&	c #A84E17",
+"p&	c #81390D",
+"q&	c #833A0D",
+"r&	c #6A310C",
+"s&	c #392A1A",
+"t&	c #21272D",
+"u&	c #313335",
+"v&	c #75401E",
+"w&	c #AC5923",
+"x&	c #A64E16",
+"y&	c #A84F16",
+"z&	c #AB5117",
+"A&	c #A94D15",
+"B&	c #C05B1D",
+"C&	c #DC8B6E",
+"D&	c #AAA7A2",
+"E&	c #A8886F",
+"F&	c #AA836F",
+"G&	c #B18877",
+"H&	c #AC8872",
+"I&	c #A6846C",
+"J&	c #A38069",
+"K&	c #B29175",
+"L&	c #9E9383",
+"M&	c #A17C78",
+"N&	c #B25519",
+"O&	c #BD5A1C",
+"P&	c #A0887F",
+"Q&	c #A74E17",
+"R&	c #76340A",
+"S&	c #7C3D14",
+"T&	c #402B13",
+"U&	c #1F2020",
+"V&	c #252B32",
+"W&	c #322B24",
+"X&	c #783C16",
+"Y&	c #984712",
+"Z&	c #A95822",
+"`&	c #AA5723",
+" *	c #9D4A13",
+".*	c #9E4A13",
+"+*	c #AA5622",
+"@*	c #D09690",
+"#*	c #ABA89D",
+"$*	c #AE8B74",
+"%*	c #A9907C",
+"&*	c #A38676",
+"**	c #A18A76",
+"=*	c #9E8A78",
+"-*	c #A38774",
+";*	c #A08471",
+">*	c #AD9E8B",
+",*	c #B49D93",
+"'*	c #AE5118",
+")*	c #8E3F0D",
+"!*	c #9F4913",
+"~*	c #9B4913",
+"{*	c #823A0D",
+"]*	c #7A370D",
+"^*	c #472E15",
+"/*	c #181619",
+"(*	c #1F2429",
+"_*	c #2B3239",
+":*	c #2E353D",
+"<*	c #2C2926",
+"[*	c #5C3D1B",
+"}*	c #964E20",
+"|*	c #9D501F",
+"1*	c #9A4E1E",
+"2*	c #9C4E1E",
+"3*	c #964C1D",
+"4*	c #B67979",
+"5*	c #989E8B",
+"6*	c #A28166",
+"7*	c #A28066",
+"8*	c #9E7D64",
+"9*	c #9E7D63",
+"0*	c #9E8164",
+"a*	c #A98C6C",
+"b*	c #A7896C",
+"c*	c #B0A28F",
+"d*	c #9C8885",
+"e*	c #8F4010",
+"f*	c #864216",
+"g*	c #893E0F",
+"h*	c #873D0F",
+"i*	c #80390D",
+"j*	c #71330C",
+"k*	c #3F2211",
+"l*	c #16191C",
+"m*	c #1C2126",
+"n*	c #262D33",
+"o*	c #2C333A",
+"p*	c #22272D",
+"q*	c #392921",
+"r*	c #703B1A",
+"s*	c #8F471B",
+"t*	c #894419",
+"u*	c #90481A",
+"v*	c #926562",
+"w*	c #8B716A",
+"x*	c #89716E",
+"y*	c #8B7B75",
+"z*	c #92857C",
+"A*	c #928179",
+"B*	c #8C776D",
+"C*	c #8A766D",
+"D*	c #887970",
+"E*	c #7F4445",
+"F*	c #7D3D15",
+"G*	c #7B3C15",
+"H*	c #74330B",
+"I*	c #74340B",
+"J*	c #5A3814",
+"K*	c #302317",
+"L*	c #16191D",
+"M*	c #1D2126",
+"N*	c #262C32",
+"O*	c #2D343C",
+"P*	c #212328",
+"Q*	c #36261D",
+"R*	c #493119",
+"S*	c #573018",
+"T*	c #683718",
+"U*	c #723814",
+"V*	c #7D3F19",
+"W*	c #82421A",
+"X*	c #84431B",
+"Y*	c #8A471C",
+"Z*	c #914A1E",
+"`*	c #944C1E",
+" =	c #8B471D",
+".=	c #81421A",
+"+=	c #783D18",
+"@=	c #684118",
+"#=	c #633D14",
+"$=	c #5A3816",
+"%=	c #462F15",
+"&=	c #392816",
+"*=	c #1C1919",
+"==	c #191D21",
+"-=	c #272E35",
+";=	c #313941",
+">=	c #2A3139",
+",=	c #1E2329",
+"'=	c #26231F",
+")=	c #322619",
+"!=	c #392419",
+"~=	c #382319",
+"{=	c #3B2518",
+"]=	c #5C3015",
+"^=	c #583816",
+"/=	c #3A2416",
+"(=	c #332117",
+"_=	c #332619",
+":=	c #342719",
+"<=	c #312417",
+"[=	c #251F1A",
+"}=	c #171A1E",
+"|=	c #1B2025",
+"1=	c #242A30",
+"2=	c #1D2227",
+"3=	c #1A1E23",
+"4=	c #1E2328",
+"5=	c #292F36",
+"6=	c #293037",
+"7=	c #282E35",
+"8=	c #262C33",
+"9=	c #2E353E",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . + @ . . . . . . # $ % . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . & * = - . . . . . ; > , ' ) ! ~ . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . { ] ^ / ( _ . . . . : < [ } | 1 2 . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . 3 4 5 6 7 8 9 . . . . 0 a b c d e f g h . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . i j k l m n o # . . . p q r s t u v w x . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . y z A B C D E F . . . G H I J K L M N O . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . P Q R S T U V W . . . X Y Z `  ...+. at .#.. . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . $.%.&.*.=.-.;.>.. . . ,.'.).!.~.{.].^.#.. . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . /.(._.B :.<.[.}.|.. . 1.2.3.4.5.6.7.8.9.. . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . 0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.. . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.s.. . . . . M.N.. . . . . . . . . . . ",
+". . . . . . . . . . . O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++ at +#+s.. . . . $+%+&+*+. . . . . . . . . . ",
+". . . . . . . . . . . =+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+s.. . . . }+|+1+2+3+. . . . . . . . . ",
+". . . . . . . . . . . 4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+s.. . . l+m+n+o+p+q+r+. . . . . . . . ",
+". . . . . . . . . . . . s+t+u+v+w+x+y+w+z+A+B+C+D+E+F+G+H+I+. J+K+L+M+N+O+P+Q+s.. . . . . . . . ",
+". . . . . . . . . . . . R+S+T+e.U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@!@. . . . . . . . ",
+". . . . . . . . . . . . . ~@{@]@^@/@y+(@Y+_@:@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at . . . . . . . . ",
+". . . . . . . . . . . . . d at e@f at g@h at i@j at Y+k@l at m@l at n@o at p@q at r@s at t@u at v@w at x@y at z@A at B@. . . . . . . . ",
+". . . . . . . . . . . . . C at D@E at F@G at H@I at v.J@K at L@K at M@N at O@P at Q@6+R at S@T at U@V at W@X at Y@9.. . . . . . . . ",
+". . . . . . . . . . . . . . Z@`@ #R at H@j at v..#+#@###$#v.%#&#*#0+=#-#;#>#,#'#)#!#x . . . . . . . . ",
+". . . . . . . . . . . . . ~#{#]#^#/#H at j@(#_#:#<#[#<#}#|#(@(@I at 1#2#;#3#4#5#A@!@. . . . . . . . . ",
+". . . . . . . . . . . . 6#7#8#9#0#a#b#v.v._#+#c#[#@#Y+|#d#j@(#e#f#g#h#i#j#k#l#. . . . . . . . . ",
+". . . . . . . . . . . . m#n#o#p#q#r#z+I at s#t#u#_#v#L at Y+@#j at d#(#w#x#y#z#A#B#C#D#. . . . . . . . . ",
+". . . . . . . . . . . E#F#G#H#I#J#K#z+Y+v#L#M#N#v#J at v#_#O#Y+I at j@f#T at O+P#Q#B at . . . . . . . . . . ",
+". . . . . . . . . . . R#S#T#U#V#W#X#O#Y#Z#`# $.$+$@$#$$$%$&$v.I@*$=$-$w@;$>$. . . . . . . . . . ",
+". . . . . . . . . . ,$'$)$!$~${$b#s#:#+$]$^$/$($_$:$<$[$}$|$(#Y+j at 1$2$3$4$5$6$. . . . . . . . . ",
+". . . . . . . . . 7$8$9$0$a$b$c$d$}#+##$e$f$g$h$i$j$k$l$m$n$v.}#v.(@Y#o$3$p$q$. . . . . . . . . ",
+". . . . . . . . . r$s$8#t$u$v$w$}#}#v#x$y$z$A$B$C$D$E$F$G$H$v.}#Y+j at X+I$2$3$J$K$. . . . . . . . ",
+". . . . . . . . L$M$N$O$P$Q$c$R$}#Y+O#v.I$S$T$U$V$W$ $X$Y$Z$}#}#s#}#(@Y#*$`$ %.%+%. . . . . . . ",
+". . . . . . . . @%#%$%%%&%*%=%s#}#Y+s#K at -%Z+-%.#v#c#v#c#+#v#O#Y+##I at Y#}#;%>%,%'%)%h . . . . . . ",
+". . . . . . . . !%~%{%]%^%/%}#s#Y+}#v#Y#Z#X$+$(%Y$$$Z#@$_%:%O#K@}#v.(@+#<%[%}%U@|%9.. . . . . . ",
+". . . . . . . 1%2%3%4%5%6%=%s#}#Y+}#:##$7%8%9%0%a%b%c%d%e%f%s#v#s#Y+v.I at I@-#g%h%i%j%k%. . . . . ",
+". . . . . . . l%m%n%o%p%q%v.s#s#v.s#v#r%s%t%u%v%w%x%y%z%A%B%Y++#s#Y+v#O#=#C%D%E%F%G%H%. . . . . ",
+". . . . . . . I%J%K%L%*%x+(#s#}#v.Y+v#Y$M%N%O%P%Q%R%S%T%U%V%}#v#}#s#I at s#w#W%X%Y%Z%`%9.. . . . . ",
+". . . . . . .  &.&+&@&z+(@j at v.v.(#v.s#Y##&$&V$%&#&W$#&%&Y$&&}#O#}#Y+I@(@*&=&-&;&>&A@,&. . . . . ",
+". . . . . . . '&)&!&~&w#1#(@I at v.(#(#(#d#}#t#+#J@}#@#}#L@}#}#}#}#}#K@(#1#{&]&^&/&(&A at _&. . . . . ",
+". . . . . . . . :&<&[&}&|&1&e#j at I@v.(#(#v#@#v.2&X+3&(@3&4&I at I@(#Y+}#5&6&o+z#7&8&9&0&s.. . . . . ",
+". . . . . . . . a&b&Q.`$c&}&|&1&e#e#d#[#d&e&f&g&h&i&j&k&l&(#u+e#X#~&m&n&o&p&q&r&s&t&#.. . . . . ",
+". . . . . . . . . u&v&w&-&x&y&z&f#A&B&C&D&E&F&G&H&I&J&K&L&M&1&A&N&o+O&P&Q&R&S&T&U&V&x . . . . . ",
+". . . . . . . . . l#W&X&Y&Z&`& *.*+*n&@*#*$*%*&***=*-*;*>*,*'*)*!*~*Y&V@{*]*^*/*(*_*h . . . . . ",
+". . . . . . . . . . :*<*[*}*|*1*2*3*I$4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*q&i*j*k*l*m*n*l#. . . . . . ",
+". . . . . . . . . . k%o*p*q*r*s*s*t*u*X%v*w*x*y*z*A*B*C*D*E*F*G*H*I*W at J*K*L*M*N*s.. . . . . . . ",
+". . . . . . . . . . . 4+O*k#P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*=l*==A at -=W . . . . . . . . ",
+". . . . . . . . . . . . . ;=>=G%,=)#'=)=!=~=)={=]=^=/=(=_=:=<=[=}===|=A at 1=_*F . . . . . . . . . ",
+". . . . . . . . . . . . . . h W o*-=1=t&(*2=M*m*)#3=3=)#m*M*2=4=`%k#5=O*l#h . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . # l#_&!@>=C#6=7=8=8=7=6=C#C#o*9=l#k%. . . . . . . . . . . . . ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/electric_guitar_gtr.xpm b/images/MusicalInstruments/electric_guitar_gtr.xpm
new file mode 100644
index 0000000..b193ebb
--- /dev/null
+++ b/images/MusicalInstruments/electric_guitar_gtr.xpm
@@ -0,0 +1,1093 @@
+/* XPM */
+static char * electric_guitar_gtr_xpm[] = {
+"48 48 1042 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #405267",
+"@ 	c #405469",
+"# 	c #405061",
+"$ 	c #40546A",
+"% 	c #47709F",
+"& 	c #4B7FBA",
+"* 	c #4571A2",
+"= 	c #455B74",
+"- 	c #3F5874",
+"; 	c #3F4C5B",
+"> 	c #415E7E",
+", 	c #4777AD",
+"' 	c #4676AB",
+") 	c #465F7C",
+"! 	c #465A70",
+"~ 	c #465E79",
+"{ 	c #3C5A7B",
+"] 	c #38404A",
+"^ 	c #3F4F61",
+"/ 	c #415A77",
+"( 	c #466587",
+"_ 	c #466282",
+": 	c #455668",
+"< 	c #454F5B",
+"[ 	c #44586F",
+"} 	c #344D68",
+"| 	c #2B3744",
+"1 	c #333A42",
+"2 	c #38414B",
+"3 	c #545A62",
+"4 	c #5D6164",
+"5 	c #405064",
+"6 	c #435A73",
+"7 	c #495664",
+"8 	c #4A5765",
+"9 	c #4A5664",
+"0 	c #485360",
+"a 	c #415A74",
+"b 	c #2C445F",
+"c 	c #1E262E",
+"d 	c #232930",
+"e 	c #2E363E",
+"f 	c #37404A",
+"g 	c #485059",
+"h 	c #717271",
+"i 	c #CEC3A7",
+"j 	c #B8A27E",
+"k 	c #4D5054",
+"l 	c #46627F",
+"m 	c #4E5A68",
+"n 	c #515D6A",
+"o 	c #51647B",
+"p 	c #4F5D6D",
+"q 	c #4B5F72",
+"r 	c #314864",
+"s 	c #1B2228",
+"t 	c #1E2328",
+"u 	c #282E35",
+"v 	c #323A43",
+"w 	c #707478",
+"x 	c #51575E",
+"y 	c #938F84",
+"z 	c #EED8A8",
+"A 	c #FBE2A6",
+"B 	c #E3BF8A",
+"C 	c #8D7C66",
+"D 	c #47607C",
+"E 	c #516274",
+"F 	c #57616D",
+"G 	c #596C82",
+"H 	c #576D85",
+"I 	c #535E6A",
+"J 	c #45607B",
+"K 	c #283544",
+"L 	c #22282D",
+"M 	c #313841",
+"N 	c #646668",
+"O 	c #ACA08D",
+"P 	c #F8E1B2",
+"Q 	c #F9DAA0",
+"R 	c #F5CB8B",
+"S 	c #F9D294",
+"T 	c #BBA17A",
+"U 	c #494B4D",
+"V 	c #4A525A",
+"W 	c #496079",
+"X 	c #55687C",
+"Y 	c #636C76",
+"Z 	c #6A7987",
+"` 	c #697F97",
+" .	c #63768D",
+"..	c #5B656F",
+"+.	c #455E7A",
+"@.	c #28313B",
+"#.	c #2E343B",
+"$.	c #333C44",
+"%.	c #7C7976",
+"&.	c #C9B799",
+"*.	c #F6D499",
+"=.	c #F8D396",
+"-.	c #F8D79D",
+";.	c #F2CA90",
+">.	c #B99C75",
+",.	c #545048",
+"'.	c #353A3F",
+").	c #353E48",
+"!.	c #495A6D",
+"~.	c #54708A",
+"{.	c #656E78",
+"].	c #72818F",
+"^.	c #758BA1",
+"/.	c #738CA8",
+"(.	c #6A839E",
+"_.	c #616E7C",
+":.	c #4F667E",
+"<.	c #2F3840",
+"[.	c #363E45",
+"}.	c #4D545A",
+"|.	c #4B5158",
+"1.	c #928A80",
+"2.	c #E3CCA3",
+"3.	c #F6DCA5",
+"4.	c #F6D38D",
+"5.	c #EDC182",
+"6.	c #E5B87D",
+"7.	c #B6A07B",
+"8.	c #43403B",
+"9.	c #20252A",
+"0.	c #2A3038",
+"a.	c #353D47",
+"b.	c #475460",
+"c.	c #536A82",
+"d.	c #646E77",
+"e.	c #747F8B",
+"f.	c #7D92A7",
+"g.	c #7B99B6",
+"h.	c #7799BB",
+"i.	c #7093B3",
+"j.	c #637484",
+"k.	c #555F69",
+"l.	c #3F536A",
+"m.	c #3A424B",
+"n.	c #4F5459",
+"o.	c #77736D",
+"p.	c #CAB291",
+"q.	c #E9C997",
+"r.	c #F4D59A",
+"s.	c #F2D190",
+"t.	c #F3D08E",
+"u.	c #CEA468",
+"v.	c #715F4C",
+"w.	c #1B1E21",
+"x.	c #1D2125",
+"y.	c #2E353E",
+"z.	c #4B5460",
+"A.	c #566879",
+"B.	c #667381",
+"C.	c #747E89",
+"D.	c #7E91A5",
+"E.	c #83A0BC",
+"F.	c #81A6C9",
+"G.	c #7BA5CD",
+"H.	c #72A1CD",
+"I.	c #6390BC",
+"J.	c #556981",
+"K.	c #495460",
+"L.	c #3D5772",
+"M.	c #47698D",
+"N.	c #A8977C",
+"O.	c #E4C28F",
+"P.	c #E3C091",
+"Q.	c #D5AC7A",
+"R.	c #ECC281",
+"S.	c #F2CB8F",
+"T.	c #CFB286",
+"U.	c #625849",
+"V.	c #171B1F",
+"W.	c #1C2126",
+"X.	c #242A30",
+"Y.	c #2D343C",
+"Z.	c #353E47",
+"`.	c #555D66",
+" +	c #4F5C6D",
+".+	c #5A697A",
+"++	c #6A7783",
+"@+	c #76808B",
+"#+	c #81A2C0",
+"$+	c #81AAD1",
+"%+	c #80B0DA",
+"&+	c #7BAEDB",
+"*+	c #97C1ED",
+"=+	c #E0E1E3",
+"-+	c #66A0DD",
+";+	c #47596D",
+">+	c #487BB3",
+",+	c #94ACC1",
+"'+	c #ECCA90",
+")+	c #EEC785",
+"!+	c #D9AC77",
+"~+	c #D6A470",
+"{+	c #EDBD7E",
+"]+	c #C1A179",
+"^+	c #62584B",
+"/+	c #181B20",
+"(+	c #1E2329",
+"_+	c #272D34",
+":+	c #2F373F",
+"<+	c #363F49",
+"[+	c #525B66",
+"}+	c #46505C",
+"|+	c #4D5C6B",
+"1+	c #556D86",
+"2+	c #627284",
+"3+	c #6D7883",
+"4+	c #788491",
+"5+	c #7E92A7",
+"6+	c #7FA0BE",
+"7+	c #7FAED6",
+"8+	c #7EB3E2",
+"9+	c #78B1E2",
+"0+	c #9FBFDF",
+"a+	c #EDE9E0",
+"b+	c #F2F2F2",
+"c+	c #C5CCD4",
+"d+	c #6B98C8",
+"e+	c #A7B2B8",
+"f+	c #EFC789",
+"g+	c #D7B17B",
+"h+	c #E1B77C",
+"i+	c #EFBD7F",
+"j+	c #E8B57D",
+"k+	c #9C7E5B",
+"l+	c #463D35",
+"m+	c #1B1E22",
+"n+	c #1F242A",
+"o+	c #292F37",
+"p+	c #323A42",
+"q+	c #404F60",
+"r+	c #425263",
+"s+	c #465C73",
+"t+	c #4D6986",
+"u+	c #547393",
+"v+	c #5F7790",
+"w+	c #6A7885",
+"x+	c #74808B",
+"y+	c #788A9B",
+"z+	c #7C99B2",
+"A+	c #7EA4C4",
+"B+	c #7DACD6",
+"C+	c #7BB2E1",
+"D+	c #75AFE3",
+"E+	c #9DBDDE",
+"F+	c #ECE3D9",
+"G+	c #F1F1F0",
+"H+	c #E5DDCD",
+"I+	c #DEC396",
+"J+	c #EDC07E",
+"K+	c #D6AE77",
+"L+	c #D8AF7A",
+"M+	c #DDAB6D",
+"N+	c #E5B371",
+"O+	c #E7B981",
+"P+	c #76624C",
+"Q+	c #2E2B27",
+"R+	c #191D21",
+"S+	c #20252B",
+"T+	c #333B44",
+"U+	c #4B525A",
+"V+	c #3D4B5C",
+"W+	c #3A5879",
+"X+	c #3C536A",
+"Y+	c #415366",
+"Z+	c #4A5B6E",
+"`+	c #5E6F7F",
+" @	c #697786",
+".@	c #718291",
+"+@	c #778EA4",
+"@@	c #7996B1",
+"#@	c #7B9FC1",
+"$@	c #7BAAD2",
+"%@	c #7AAFDC",
+"&@	c #79B2E3",
+"*@	c #80B7EB",
+"=@	c #BDC7D1",
+"-@	c #DDD9D1",
+";@	c #ECEEEF",
+">@	c #EBE2CE",
+",@	c #DEB484",
+"'@	c #D6B076",
+")@	c #D3AC76",
+"!@	c #C89C66",
+"~@	c #CEA269",
+"{@	c #E8B475",
+"]@	c #C39665",
+"^@	c #5F4E3C",
+"/@	c #232323",
+"(@	c #1A1E23",
+"_@	c #22282E",
+":@	c #2B323A",
+"<@	c #333C45",
+"[@	c #4D5966",
+"}@	c #36516D",
+"|@	c #354C64",
+"1@	c #3B4A5B",
+"2@	c #444F5B",
+"3@	c #505B65",
+"4@	c #606D79",
+"5@	c #707C89",
+"6@	c #788998",
+"7@	c #7991A8",
+"8@	c #7798B5",
+"9@	c #79A4C8",
+"0@	c #79AAD2",
+"a@	c #79AFDC",
+"b@	c #77B5E9",
+"c@	c #94BDE4",
+"d@	c #CFCECD",
+"e@	c #EDE5DA",
+"f@	c #E9E7E4",
+"g@	c #D5D5D3",
+"h@	c #D2CFCA",
+"i@	c #E7DFCC",
+"j@	c #E7C48E",
+"k@	c #CD9B63",
+"l@	c #BA8B5B",
+"m@	c #DCA96B",
+"n@	c #DAA869",
+"o@	c #9F7E5A",
+"p@	c #40382F",
+"q@	c #161A1E",
+"r@	c #252B31",
+"s@	c #2D353D",
+"t@	c #717478",
+"u@	c #3C4D60",
+"v@	c #354C65",
+"w@	c #304459",
+"x@	c #324151",
+"y@	c #3B4C5E",
+"z@	c #45596D",
+"A@	c #4E6377",
+"B@	c #64798C",
+"C@	c #7C91A4",
+"D@	c #889FB4",
+"E@	c #89A4BD",
+"F@	c #83A8C7",
+"G@	c #7AA7CD",
+"H@	c #76ABD9",
+"I@	c #75B8EF",
+"J@	c #ABC2D9",
+"K@	c #D4D3CB",
+"L@	c #E6E2D9",
+"M@	c #EDEBEA",
+"N@	c #ECECEC",
+"O@	c #E8E8E8",
+"P@	c #D9D4CA",
+"Q@	c #C1BAAC",
+"R@	c #D9D8D2",
+"S@	c #E7DEC6",
+"T@	c #E4B57B",
+"U@	c #D3995B",
+"V@	c #C19864",
+"W@	c #806C56",
+"X@	c #262626",
+"Y@	c #181C20",
+"Z@	c #1F2429",
+"`@	c #303840",
+" #	c #3A5069",
+".#	c #314963",
+"+#	c #2E3945",
+"@#	c #33404D",
+"##	c #3E5268",
+"$#	c #4B6784",
+"%#	c #516F8C",
+"&#	c #5F7E9A",
+"*#	c #7A9AB7",
+"=#	c #86A9C6",
+"-#	c #8CAFCF",
+";#	c #8EB5D4",
+">#	c #89B9E1",
+",#	c #B6C9DC",
+"'#	c #DDD5CC",
+")#	c #EAE0D0",
+"!#	c #EDEAE2",
+"~#	c #E6ECED",
+"{#	c #E3E6EB",
+"]#	c #E8E8EA",
+"^#	c #E4E2E2",
+"/#	c #E1DFDC",
+"(#	c #E4E0D5",
+"_#	c #CEC8B8",
+":#	c #C5C0BB",
+"<#	c #DFE2E5",
+"[#	c #E5DFC2",
+"}#	c #C8A46E",
+"|#	c #76614D",
+"1#	c #36373B",
+"2#	c #191D22",
+"3#	c #21262C",
+"4#	c #2A3138",
+"5#	c #3C4E61",
+"6#	c #2F465E",
+"7#	c #2D3741",
+"8#	c #32404D",
+"9#	c #3D5067",
+"0#	c #486683",
+"a#	c #527392",
+"b#	c #5D7E9F",
+"c#	c #7193B4",
+"d#	c #85ABCC",
+"e#	c #8CB6D7",
+"f#	c #8CB8DA",
+"g#	c #8FC5F0",
+"h#	c #E9E2D9",
+"i#	c #EEEBE6",
+"j#	c #ECEDEC",
+"k#	c #EBEBEB",
+"l#	c #E1E0E0",
+"m#	c #D6D5D5",
+"n#	c #DEDDDD",
+"o#	c #E2E0DA",
+"p#	c #DEDFD7",
+"q#	c #E2E3DD",
+"r#	c #D9D6D0",
+"s#	c #BDB9B3",
+"t#	c #CBCBC9",
+"u#	c #E3E3E3",
+"v#	c #BEAE99",
+"w#	c #564542",
+"x#	c #3A3D45",
+"y#	c #2B3239",
+"z#	c #343C45",
+"A#	c #3C4E63",
+"B#	c #2E4660",
+"C#	c #2A3440",
+"D#	c #2F3A46",
+"E#	c #384C61",
+"F#	c #43607D",
+"G#	c #507190",
+"H#	c #5A7EA1",
+"I#	c #6B93B7",
+"J#	c #79A3C9",
+"K#	c #87B4DA",
+"L#	c #8AB9DE",
+"M#	c #8AC2EF",
+"N#	c #E8E3DE",
+"O#	c #EEEEED",
+"P#	c #EAEAEA",
+"Q#	c #E9E9E9",
+"R#	c #E7E7E7",
+"S#	c #D9D8D4",
+"T#	c #C5C3BC",
+"U#	c #CECDC8",
+"V#	c #DCDDD7",
+"W#	c #DCDFDD",
+"X#	c #DDDFE0",
+"Y#	c #E1E1E1",
+"Z#	c #D3D0CD",
+"`#	c #BEBBB5",
+" $	c #C7C8C7",
+".$	c #D4CFC9",
+"+$	c #79685E",
+"@$	c #423F49",
+"#$	c #2F353C",
+"$$	c #323A41",
+"%$	c #2E4E70",
+"&$	c #27303B",
+"*$	c #29333E",
+"=$	c #324252",
+"-$	c #3D5874",
+";$	c #4A6F94",
+">$	c #5783AC",
+",$	c #6492BA",
+"'$	c #76A6CE",
+")$	c #7EB1DA",
+"!$	c #81B6E0",
+"~$	c #81B9E3",
+"{$	c #E1DAD6",
+"]$	c #DEDDDB",
+"^$	c #D5D5D2",
+"/$	c #DEDEDF",
+"($	c #D4D4D5",
+"_$	c #D8D9D6",
+":$	c #D1D1C9",
+"<$	c #BEBFB8",
+"[$	c #D2D4D4",
+"}$	c #DCDEDD",
+"|$	c #DDDDDB",
+"1$	c #DFDEDE",
+"2$	c #DFDFDF",
+"3$	c #CAC8C4",
+"4$	c #BBB9B4",
+"5$	c #DCDBDB",
+"6$	c #C1B8AD",
+"7$	c #584944",
+"8$	c #3C3D43",
+"9$	c #3D444A",
+"0$	c #747578",
+"a$	c #575458",
+"b$	c #585456",
+"c$	c #75777A",
+"d$	c #70757A",
+"e$	c #273A4F",
+"f$	c #242E39",
+"g$	c #283441",
+"h$	c #33495E",
+"i$	c #3E6283",
+"j$	c #4C7CA8",
+"k$	c #5B92C4",
+"l$	c #6EA6D3",
+"m$	c #7EB4DE",
+"n$	c #82B9E3",
+"o$	c #7FB8E3",
+"p$	c #82BCEE",
+"q$	c #E2E2E2",
+"r$	c #E6E6E6",
+"s$	c #E1E1E0",
+"t$	c #CFCEC9",
+"u$	c #B1AEA8",
+"v$	c #C8C7C7",
+"w$	c #D5D4D7",
+"x$	c #D8D9D8",
+"y$	c #D7D8D3",
+"z$	c #C2C4BE",
+"A$	c #BBBDB9",
+"B$	c #D6D5CD",
+"C$	c #DCDCD7",
+"D$	c #DCDADA",
+"E$	c #DADCDB",
+"F$	c #DBDADA",
+"G$	c #D5D5D5",
+"H$	c #DCDCDC",
+"I$	c #ACA196",
+"J$	c #574B46",
+"K$	c #494039",
+"L$	c #4D4B4A",
+"M$	c #756F6F",
+"N$	c #A29C9A",
+"O$	c #766D6B",
+"P$	c #3F4045",
+"Q$	c #364250",
+"R$	c #24364B",
+"S$	c #232D38",
+"T$	c #283545",
+"U$	c #334D67",
+"V$	c #42698F",
+"W$	c #5086B6",
+"X$	c #629DCE",
+"Y$	c #78B1DC",
+"Z$	c #84BAE4",
+"`$	c #86BCE5",
+" %	c #80BBEC",
+".%	c #D1D2D2",
+"+%	c #DFE1E1",
+"@%	c #CBCBC6",
+"#%	c #AFAFA5",
+"$%	c #B6B5B1",
+"%%	c #D6D5D9",
+"&%	c #D8D8D9",
+"*%	c #D8D9D7",
+"=%	c #D2D5D0",
+"-%	c #BBBCB4",
+";%	c #C0BEB2",
+">%	c #D3D2CE",
+",%	c #DBDADB",
+"'%	c #DADADA",
+")%	c #DBDBDB",
+"!%	c #C1B9B1",
+"~%	c #A39588",
+"{%	c #9F978F",
+"]%	c #B4B2AF",
+"^%	c #CBC8C6",
+"/%	c #ACA6A4",
+"(%	c #605E5F",
+"_%	c #32373E",
+":%	c #313942",
+"<%	c #34414F",
+"[%	c #213246",
+"}%	c #202A35",
+"|%	c #253545",
+"1%	c #304D6B",
+"2%	c #406F98",
+"3%	c #518DBF",
+"4%	c #68A5D5",
+"5%	c #7AB5E0",
+"6%	c #84BCE4",
+"7%	c #88BFE6",
+"8%	c #82BCE6",
+"9%	c #68B1EA",
+"0%	c #96A9BE",
+"a%	c #9498A3",
+"b%	c #B8BDC0",
+"c%	c #D7D8D6",
+"d%	c #C3C3BC",
+"e%	c #B1B2A8",
+"f%	c #C6C6C5",
+"g%	c #D7D8D8",
+"h%	c #D5D7D7",
+"i%	c #D8D8D7",
+"j%	c #CCCBC6",
+"k%	c #B3AEA9",
+"l%	c #C0BEBE",
+"m%	c #D8D8D8",
+"n%	c #BEBCBE",
+"o%	c #565356",
+"p%	c #2C2F34",
+"q%	c #334150",
+"r%	c #1F2E3F",
+"s%	c #1E262F",
+"t%	c #223140",
+"u%	c #2D4B67",
+"v%	c #3B6B96",
+"w%	c #518EC0",
+"x%	c #6CA9D8",
+"y%	c #7EB9E2",
+"z%	c #84BDE6",
+"A%	c #84BEE6",
+"B%	c #7DB8E2",
+"C%	c #5FA5DC",
+"D%	c #6E86A5",
+"E%	c #57545B",
+"F%	c #6E7178",
+"G%	c #CBCED2",
+"H%	c #D4D3D0",
+"I%	c #AFAFA7",
+"J%	c #ABADA8",
+"K%	c #C9CCCD",
+"L%	c #D4D5D6",
+"M%	c #D5D4D2",
+"N%	c #C8C5C4",
+"O%	c #C9C8C8",
+"P%	c #D6D6D6",
+"Q%	c #D3D3D5",
+"R%	c #C8C8CA",
+"S%	c #9D9899",
+"T%	c #545053",
+"U%	c #25262B",
+"V%	c #1D2126",
+"W%	c #262C32",
+"X%	c #354250",
+"Y%	c #1D2D3D",
+"Z%	c #1C232C",
+"`%	c #1F2E3D",
+" &	c #2A4561",
+".&	c #35618B",
+"+&	c #4D89BB",
+"@&	c #6CA8D6",
+"#&	c #7CB7DF",
+"$&	c #82BBE2",
+"%&	c #82BCE5",
+"&&	c #77ABD2",
+"*&	c #908F97",
+"=&	c #7C8492",
+"-&	c #757175",
+";&	c #433A3B",
+">&	c #787B83",
+",&	c #CBCED1",
+"'&	c #BCBAB8",
+")&	c #9B9A96",
+"!&	c #B9BBB9",
+"~&	c #D1D3D4",
+"{&	c #D3D4D4",
+"]&	c #D4D4D4",
+"^&	c #CBCBCB",
+"/&	c #BDBDBD",
+"(&	c #A1A1A4",
+"_&	c #7D7C81",
+":&	c #504E51",
+"<&	c #2B2A2D",
+"[&	c #1C1F23",
+"}&	c #1B1F24",
+"|&	c #23292F",
+"1&	c #363E48",
+"2&	c #20364F",
+"3&	c #1A212A",
+"4&	c #1B2836",
+"5&	c #243D55",
+"6&	c #2F587E",
+"7&	c #4680AF",
+"8&	c #67A1CC",
+"9&	c #77B0D9",
+"0&	c #7AB6DE",
+"a&	c #7BB9E3",
+"b&	c #73ACD3",
+"c&	c #848592",
+"d&	c #797C8B",
+"e&	c #80838A",
+"f&	c #58504F",
+"g&	c #2D2C34",
+"h&	c #8A949B",
+"i&	c #CECECE",
+"j&	c #A09C9A",
+"k&	c #ACA9AB",
+"l&	c #D2D2D2",
+"m&	c #D2D1D1",
+"n&	c #D1D1D1",
+"o&	c #CDCCCD",
+"p&	c #A09EA0",
+"q&	c #676667",
+"r&	c #494949",
+"s&	c #2D2D30",
+"t&	c #1E1F23",
+"u&	c #1A1C20",
+"v&	c #1D2227",
+"w&	c #293D53",
+"x&	c #182029",
+"y&	c #18222D",
+"z&	c #1E3145",
+"A&	c #294B69",
+"B&	c #3C6E98",
+"C&	c #5D97C0",
+"D&	c #6EAAD2",
+"E&	c #74B2DD",
+"F&	c #77B6E2",
+"G&	c #75B5E1",
+"H&	c #659FC9",
+"I&	c #807D86",
+"J&	c #777D86",
+"K&	c #6F7079",
+"L&	c #413E44",
+"M&	c #555B61",
+"N&	c #C1C5C7",
+"O&	c #B6B4B2",
+"P&	c #B1AEB0",
+"Q&	c #CFD0CF",
+"R&	c #D0D0D0",
+"S&	c #CCCDCD",
+"T&	c #C6C5C4",
+"U&	c #C9C7C3",
+"V&	c #BCB6B0",
+"W&	c #B5B1B1",
+"X&	c #5E5D5E",
+"Y&	c #27272B",
+"Z&	c #1C1F21",
+"`&	c #171A1E",
+" *	c #181C21",
+".*	c #1B2024",
+"+*	c #293037",
+"@*	c #313B48",
+"#*	c #182330",
+"$*	c #161D26",
+"%*	c #182838",
+"&*	c #213E57",
+"**	c #335D81",
+"=*	c #4E86B1",
+"-*	c #63A1CC",
+";*	c #6CACD7",
+">*	c #72B1DB",
+",*	c #7AB7DE",
+"'*	c #70B0DD",
+")*	c #5D91B9",
+"!*	c #717482",
+"~*	c #6E747D",
+"{*	c #666265",
+"]*	c #616162",
+"^*	c #A6ADB1",
+"/*	c #CDCECE",
+"(*	c #C1BFC5",
+"_*	c #BBBABE",
+":*	c #C5C5C5",
+"<*	c #BBBABC",
+"[*	c #ABAAA9",
+"}*	c #ADA8A5",
+"|*	c #BDBAB6",
+"1*	c #B8B2AD",
+"2*	c #6C6060",
+"3*	c #1B1C20",
+"4*	c #2C333B",
+"5*	c #353D46",
+"6*	c #203348",
+"7*	c #141A22",
+"8*	c #14202E",
+"9*	c #193049",
+"0*	c #264B6B",
+"a*	c #3F729A",
+"b*	c #5893BE",
+"c*	c #62A5D0",
+"d*	c #6CACD4",
+"e*	c #7AB6DB",
+"f*	c #69ABD6",
+"g*	c #6686A5",
+"h*	c #5F6170",
+"i*	c #575B61",
+"j*	c #726E6A",
+"k*	c #959897",
+"l*	c #AEB1B5",
+"m*	c #A3A1A5",
+"n*	c #9A9A9A",
+"o*	c #A0A0A0",
+"p*	c #A5A4A6",
+"q*	c #A3A0A1",
+"r*	c #B8B6B5",
+"s*	c #C3C3C5",
+"t*	c #847F82",
+"u*	c #3A3535",
+"v*	c #262D33",
+"w*	c #343D46",
+"x*	c #374049",
+"y*	c #2C3A49",
+"z*	c #14202D",
+"A*	c #121922",
+"B*	c #132538",
+"C*	c #1B3A57",
+"D*	c #2D5D82",
+"E*	c #4681AB",
+"F*	c #5595C1",
+"G*	c #62A2CB",
+"H*	c #76B2D7",
+"I*	c #7BB9DD",
+"J*	c #74B7E0",
+"K*	c #5FA2CD",
+"L*	c #617998",
+"M*	c #4D5869",
+"N*	c #265C94",
+"O*	c #70849B",
+"P*	c #A2A7AC",
+"Q*	c #AAACB1",
+"R*	c #AFAEB3",
+"S*	c #B4B3BB",
+"T*	c #B6B3B9",
+"U*	c #C0BDBF",
+"V*	c #BFC1C3",
+"W*	c #848186",
+"X*	c #2E2B2F",
+"Y*	c #1F2024",
+"Z*	c #292F36",
+"`*	c #1E344D",
+" =	c #101A26",
+".=	c #101C2A",
+"+=	c #132940",
+"@=	c #1E4363",
+"#=	c #31658B",
+"$=	c #4585B0",
+"%=	c #569BC6",
+"&=	c #6FB0D6",
+"*=	c #77B9DC",
+"==	c #74B8DD",
+"-=	c #67B0DA",
+";=	c #4B98CB",
+">=	c #2B78B4",
+",=	c #1F68A7",
+"'=	c #297BCB",
+")=	c #B3B2B3",
+"!=	c #BCC0C9",
+"~=	c #BCB9C4",
+"{=	c #C3C0C8",
+"]=	c #C4C0C0",
+"^=	c #C1BFBD",
+"/=	c #9C9898",
+"(=	c #463F40",
+"_=	c #202023",
+":=	c #262C33",
+"<=	c #2D3843",
+"[=	c #13273E",
+"}=	c #0E161F",
+"|=	c #0F1B29",
+"1=	c #142B41",
+"2=	c #1F4968",
+"3=	c #2D6B96",
+"4=	c #438BB8",
+"5=	c #62A8D0",
+"6=	c #6AB0D7",
+"7=	c #6BB3DB",
+"8=	c #65B2DA",
+"9=	c #56A5D4",
+"0=	c #3893CF",
+"a=	c #2C86C7",
+"b=	c #2582CA",
+"c=	c #BBB3AC",
+"d=	c #BFC3CB",
+"e=	c #B3B1BB",
+"f=	c #B6B5BA",
+"g=	c #C4C3C2",
+"h=	c #B8B7B4",
+"i=	c #6C6667",
+"j=	c #252326",
+"k=	c #1A1E22",
+"l=	c #23282F",
+"m=	c #222F3E",
+"n=	c #0D151F",
+"o=	c #0C151F",
+"p=	c #0E1F31",
+"q=	c #143654",
+"r=	c #1D527D",
+"s=	c #3074A2",
+"t=	c #4E98C1",
+"u=	c #5CA7CE",
+"v=	c #60AED5",
+"w=	c #5FABD1",
+"x=	c #5791B1",
+"y=	c #4482A5",
+"z=	c #388BBD",
+"A=	c #2D88C8",
+"B=	c #C2B7AF",
+"C=	c #B7B9C2",
+"D=	c #95969C",
+"E=	c #ADADB1",
+"F=	c #C4C4C4",
+"G=	c #9F9B9C",
+"H=	c #3A3539",
+"I=	c #191C20",
+"J=	c #172432",
+"K=	c #0B141F",
+"L=	c #0C1623",
+"M=	c #0F263D",
+"N=	c #144165",
+"O=	c #205C87",
+"P=	c #397DA8",
+"Q=	c #4C96BF",
+"R=	c #55A3CD",
+"S=	c #57A1C7",
+"T=	c #52778E",
+"U=	c #456A81",
+"V=	c #3E82A9",
+"W=	c #3290CC",
+"X=	c #C2B8B3",
+"Y=	c #CACDCE",
+"Z=	c #B9B9BD",
+"`=	c #BDBDBE",
+" -	c #C0BEC0",
+".-	c #6C6569",
+"+-	c #212025",
+"@-	c #1C2025",
+"#-	c #2A323B",
+"$-	c #121E2B",
+"%-	c #09121C",
+"&-	c #0A1927",
+"*-	c #0D2B46",
+"=-	c #134368",
+"--	c #1F5C86",
+";-	c #327BA7",
+">-	c #3F93BE",
+",-	c #4592BB",
+"'-	c #40728D",
+")-	c #3A738F",
+"!-	c #3582AA",
+"~-	c #2F95CE",
+"{-	c #C8BEBC",
+"]-	c #CECFCF",
+"^-	c #C5C5C7",
+"/-	c #C2C2C2",
+"(-	c #9C969B",
+"_-	c #322E32",
+":-	c #1A1D21",
+"<-	c #252D36",
+"[-	c #0E1823",
+"}-	c #07111D",
+"|-	c #081B2D",
+"1-	c #0B2A47",
+"2-	c #0E3F62",
+"3-	c #16517A",
+"4-	c #216F9A",
+"5-	c #2C80A8",
+"6-	c #2E81A5",
+"7-	c #358BB5",
+"8-	c #3288B0",
+"9-	c #4395C6",
+"0-	c #BFBBBC",
+"a-	c #C2C5CD",
+"b-	c #B3B4BB",
+"c-	c #A4A0A6",
+"d-	c #585156",
+"e-	c #1B1C1F",
+"f-	c #303841",
+"g-	c #222A32",
+"h-	c #0D151E",
+"i-	c #06101C",
+"j-	c #071627",
+"k-	c #09223B",
+"l-	c #0B3251",
+"m-	c #11466A",
+"n-	c #1D709C",
+"o-	c #5297C5",
+"p-	c #559AC9",
+"q-	c #257EA6",
+"r-	c #2584B4",
+"s-	c #9AADC4",
+"t-	c #ACAEB3",
+"u-	c #949498",
+"v-	c #646066",
+"w-	c #2B282C",
+"x-	c #2F363F",
+"y-	c #202832",
+"z-	c #0D131A",
+"A-	c #040B13",
+"B-	c #04101D",
+"C-	c #05182B",
+"D-	c #072239",
+"E-	c #0F496C",
+"F-	c #3784B8",
+"G-	c #3385B7",
+"H-	c #16658A",
+"I-	c #125A7E",
+"J-	c #5688BD",
+"K-	c #91A3B4",
+"L-	c #2063AA",
+"M-	c #0D2A4B",
+"N-	c #1C1E22",
+"O-	c #2C333A",
+"P-	c #222A31",
+"Q-	c #0F1822",
+"R-	c #040D16",
+"S-	c #030D19",
+"T-	c #03111E",
+"U-	c #061F33",
+"V-	c #0B5783",
+"W-	c #0C5983",
+"X-	c #0C3F5D",
+"Y-	c #0B2F48",
+"Z-	c #093757",
+"`-	c #04325E",
+" ;	c #09233D",
+".;	c #141C26",
+"+;	c #282F36",
+"@;	c #252B32",
+"#;	c #131D28",
+"$;	c #07111C",
+"%;	c #020D1A",
+"&;	c #020E1D",
+"*;	c #032037",
+"=;	c #062B46",
+"-;	c #061F35",
+";;	c #071B2E",
+">;	c #082B4C",
+",;	c #0E1E30",
+"';	c #141A21",
+");	c #1B2229",
+"!;	c #0D161F",
+"~;	c #03101D",
+"{;	c #011327",
+"];	c #03223E",
+"^;	c #072A4D",
+"/;	c #0C243E",
+"(;	c #161F29",
+"_;	c #2A3139",
+":;	c #23282E",
+"<;	c #1B1F25",
+"[;	c #0F1F31",
+"};	c #132436",
+"|;	c #2F363E",
+"1;	c #303740",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ # . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . $ % & * = - . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . ; > , ' ) ! ~ { ] . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . ^ / ( _ : < [ } | 1 2 . . . . . . 3 4 . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . 5 6 7 8 9 0 a b c d e f . . . . g h i j k . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . l m n o p q r s t u v w . . . x y z A B C . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . D E F G H I J K L u M 2 . . . N O P Q R S T U V ",
+". . . . . . . . . . . . . . . . . . . . . . . W X Y Z `  ...+. at .#.$.2 . . . %.&.*.=.-.;.>.,.'.).",
+". . . . . . . . . . . . . . . . . . . . . . !.~.{.].^./.(._.:.<.[.}.. . |.1.2.3.4.5.6.7.8.9.0.a.",
+". . . . . . . . . . . . . . . . . . . . . b.c.d.e.f.g.h.i.j.k.l.m.. n.o.p.q.r.s.t.u.v.w.x.d y.f ",
+". . . . . . . . . . . . . . . . . . . . z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.. ",
+". . . . . . . . . . . . . . . . . . `. +.+++ at +D.#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+. . ",
+". . . . . . . . . . . . . . . [+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+2 . . . ",
+". . . . . . . . . . . . q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+0.T+U+. . . . ",
+". . . . . . . . . V+W+X+Y+Z+c.`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@w . . . . . ",
+". . . . . . . [@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@g at h@i at j@k at l@m at n@o at p@q at W.r@s at a.t@. . . . . . ",
+". . . . . u at v@w at x@y at z@A at B@C at D@E at F@G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@Y at Z@_+`@<+. . . . . . . . ",
+". . . .  #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#v 2 . . . . . . . . . ",
+". . . 5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#k#l#m#n#o#p#q#r#s#t#u#v#w#x#S+y#z#t at . . . . . . . . . . ",
+". . A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#u#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$w . . . . . . . . . . . ",
+". . %$&$*$=$-$;$>$,$'$)$!$~${$N at Q#]$^$/$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$9$. . 0$a$b$c$. . . . . . ",
+". d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$H$H$I$J$K$L$b$M$N$O$P$] . . . . . ",
+". Q$R$S$T$U$V$W$X$Y$Z$`$n$ %.%+%H$@%#%$%%%&%*%=%-%;%>%,%'%)%)%)%)%)%!%~%{%]%^%/%(%_%:%V . . . . ",
+". <%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%m%m%m%m%m%m%m%m%m#m%n%o%p%X.e f . . . . ",
+". q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%G%H%I%J%K%L%G$M%N%O%P%P%P%P%P%P%P%G$Q%R%S%T%U%V%W%M U+. . . . ",
+". X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&;&>&,&'&)&!&~&{&]&]&]&]&]&]&]&]&^&/&(&_&:&<&[&}&|&Y.1&. . . . . ",
+". 2 2&3&4&5&6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&i&l&l&l&l&m&n&l&o&p&q&r&s&t&u&R+v&r at s@Z.. . . . . . ",
+". U+w&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&R&S&T&U&V&W&X&Y&Z&`& *.*(+|&+*`@<+. . . . . . . ",
+". . @*#*$*%*&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*1*2*3*q@}&S+X.u 4*`@5*U+. . . . . . . . ",
+". . 1&6*7*8*9*0*a*b*c*d*e*,*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*V.Z at v*Y.:%w*x*U+. . . . . . . . . . ",
+". . U+y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*t Z*:%f t at . . . . . . . . . . . . . ",
+". . . z#`* =.=+=@=#=$=%=&=*===-=;=>=,='=)=!=~={=]=^=/=(=_=.*:=:%U+. . . . . . . . . . . . . . . ",
+". . . 2 <=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=d=e=f=g=h=i=j=k=l=e f . . . . . . . . . . . . . . . . ",
+". . . . z#m=n=o=p=q=r=s=t=u=v=w=x=y=z=A=B=C=D=E=F=G=H=I=S+:@Z.. . . . . . . . . . . . . . . . . ",
+". . . . U+:+J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=`= -.-+- at -_+v . . . . . . . . . . . . . . . . . . ",
+". . . . . 1&#-$-%-&-*-=---;->-,-'-)-!-~-{-]-^-/-(-_-:-_ at e 2 . . . . . . . . . . . . . . . . . . ",
+". . . . . . T+<-[-}-|-1-2-3-4-5-6-7-8-9-0-a-b-c-d-e-v&+*w*. . . . . . . . . . . . . . . . . . . ",
+". . . . . . U+f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-(@X.`@U+. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . f x-y-z-A-B-C-D-E-F-G-H-I-J-K-L-M-N-S+O-1&. . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . x*e P-Q-R-S-T-U-V-W-X-Y-Z-`- ;.;v&+;T+. . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . <+e @;#;$;%;&;*;=;-;;;>;,;';W.v*M V . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . f `@_+);!;~;{;];^;/;(; *t _+`@f . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . 2 v _;:;<;7*[;};Y at W._@4#:%2 . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . t at Z.|;+;l=n+9.l=+;e 5*U+. . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . 2 w*`@s at s@1;z#2 . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . w 2 2 U+. . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/electric_piano_pno_key.xpm b/images/MusicalInstruments/electric_piano_pno_key.xpm
new file mode 100644
index 0000000..b76e880
--- /dev/null
+++ b/images/MusicalInstruments/electric_piano_pno_key.xpm
@@ -0,0 +1,913 @@
+/* XPM */
+static char * electric_piano_pno_key_xpm[] = {
+"48 48 862 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #4C5068",
+"@ 	c #57577F",
+"# 	c #4D4F77",
+"$ 	c #474870",
+"% 	c #45456B",
+"& 	c #47476E",
+"* 	c #46486A",
+"= 	c #53526C",
+"- 	c #434265",
+"; 	c #434365",
+"> 	c #464665",
+", 	c #484567",
+"' 	c #444366",
+") 	c #424365",
+"! 	c #454667",
+"~ 	c #444566",
+"{ 	c #464D67",
+"] 	c #535579",
+"^ 	c #5A5A91",
+"/ 	c #505083",
+"( 	c #434572",
+"_ 	c #40416A",
+": 	c #3F3F6C",
+"< 	c #3C3F67",
+"[ 	c #44466D",
+"} 	c #44466E",
+"| 	c #43456E",
+"1 	c #46476F",
+"2 	c #3F4067",
+"3 	c #43426D",
+"4 	c #42416C",
+"5 	c #45456F",
+"6 	c #484775",
+"7 	c #4B4C7E",
+"8 	c #4C517D",
+"9 	c #52537D",
+"0 	c #4C4D82",
+"a 	c #464573",
+"b 	c #2A283D",
+"c 	c #1F1F31",
+"d 	c #202135",
+"e 	c #161828",
+"f 	c #2C314E",
+"g 	c #313654",
+"h 	c #303453",
+"i 	c #353758",
+"j 	c #161723",
+"k 	c #2B2E49",
+"l 	c #303152",
+"m 	c #37385A",
+"n 	c #3E406A",
+"o 	c #494B7C",
+"p 	c #4C5180",
+"q 	c #51507E",
+"r 	c #4C4A7E",
+"s 	c #444473",
+"t 	c #252435",
+"u 	c #1A1A29",
+"v 	c #212337",
+"w 	c #141420",
+"x 	c #0A0A10",
+"y 	c #13141F",
+"z 	c #151520",
+"A 	c #101015",
+"B 	c #13141C",
+"C 	c #0D0E14",
+"D 	c #1E1F33",
+"E 	c #212135",
+"F 	c #323456",
+"G 	c #4A5082",
+"H 	c #4E5182",
+"I 	c #69686D",
+"J 	c #51464C",
+"K 	c #55393E",
+"L 	c #56393D",
+"M 	c #5B3A3D",
+"N 	c #5C3B3E",
+"O 	c #5E3B3E",
+"P 	c #5F3B3E",
+"Q 	c #603A3C",
+"R 	c #5D414A",
+"S 	c #50507F",
+"T 	c #4B4878",
+"U 	c #43446D",
+"V 	c #2E2F48",
+"W 	c #2A2C46",
+"X 	c #202137",
+"Y 	c #22243B",
+"Z 	c #1F1F33",
+"` 	c #24233A",
+" .	c #26263D",
+"..	c #25253A",
+"+.	c #1F2032",
+"@.	c #202034",
+"#.	c #2C2F4B",
+"$.	c #323254",
+"%.	c #3A3B61",
+"&.	c #4D5082",
+"*.	c #525890",
+"=.	c #4A4A65",
+"-.	c #5B5055",
+";.	c #503C45",
+">.	c #4D3D45",
+",.	c #696166",
+"'.	c #787376",
+").	c #594F55",
+"!.	c #473B44",
+"~.	c #4B3D44",
+"{.	c #502E33",
+"].	c #761F1E",
+"^.	c #6C1C1D",
+"/.	c #671819",
+"(.	c #711A1A",
+"_.	c #771B1A",
+":.	c #801C1B",
+"<.	c #861D1B",
+"[.	c #8A1F1C",
+"}.	c #8E1C18",
+"|.	c #6F394B",
+"1.	c #484B79",
+"2.	c #484570",
+"3.	c #44456D",
+"4.	c #42446C",
+"5.	c #3E416A",
+"6.	c #3C406A",
+"7.	c #3F426A",
+"8.	c #41466D",
+"9.	c #3F446B",
+"0.	c #3F4066",
+"a.	c #3E4066",
+"b.	c #404168",
+"c.	c #40426A",
+"d.	c #41436A",
+"e.	c #40416C",
+"f.	c #454675",
+"g.	c #4A5289",
+"h.	c #675480",
+"i.	c #902221",
+"j.	c #8E1F1B",
+"k.	c #831D1A",
+"l.	c #841D1B",
+"m.	c #7E1C1B",
+"n.	c #731A19",
+"o.	c #681616",
+"p.	c #681716",
+"q.	c #6F1F1E",
+"r.	c #592526",
+"s.	c #34333C",
+"t.	c #1D0C11",
+"u.	c #32151C",
+"v.	c #361A20",
+"w.	c #37181D",
+"x.	c #38161B",
+"y.	c #38171A",
+"z.	c #3D1619",
+"A.	c #3F1619",
+"B.	c #3E161A",
+"C.	c #3D1414",
+"D.	c #403148",
+"E.	c #494775",
+"F.	c #47426A",
+"G.	c #43436A",
+"H.	c #3F4269",
+"I.	c #3E3F67",
+"J.	c #3A3E64",
+"K.	c #3C3E64",
+"L.	c #3E4166",
+"M.	c #3E4367",
+"N.	c #3C3D62",
+"O.	c #3D3F64",
+"P.	c #404269",
+"Q.	c #44446F",
+"R.	c #41436B",
+"S.	c #464874",
+"T.	c #4C5385",
+"U.	c #555786",
+"V.	c #571E22",
+"W.	c #541B1A",
+"X.	c #581F21",
+"Y.	c #4F1A1D",
+"Z.	c #511F22",
+"`.	c #471A1D",
+" +	c #481C20",
+".+	c #411A1E",
+"++	c #441C21",
+"@+	c #391619",
+"#+	c #261D21",
+"$+	c #1E1B22",
+"%+	c #03060A",
+"&+	c #000002",
+"*+	c #000103",
+"=+	c #000000",
+"-+	c #22253A",
+";+	c #4C4B75",
+">+	c #454267",
+",+	c #423F64",
+"'+	c #3D3D61",
+")+	c #3A3B5E",
+"!+	c #3A3C5F",
+"~+	c #3B3C60",
+"{+	c #393C5E",
+"]+	c #383C5E",
+"^+	c #3A3C61",
+"/+	c #393C61",
+"(+	c #393E62",
+"_+	c #393F65",
+":+	c #3A3E65",
+"<+	c #3E4064",
+"[+	c #3E426B",
+"}+	c #40426D",
+"|+	c #434778",
+"1+	c #424D7A",
+"2+	c #00050A",
+"3+	c #000102",
+"4+	c #000101",
+"5+	c #000203",
+"6+	c #000303",
+"7+	c #000204",
+"8+	c #05090A",
+"9+	c #101114",
+"0+	c #313840",
+"a+	c #1F141B",
+"b+	c #151317",
+"c+	c #18181E",
+"d+	c #18191D",
+"e+	c #17191B",
+"f+	c #18191B",
+"g+	c #17171B",
+"h+	c #161619",
+"i+	c #171619",
+"j+	c #37374A",
+"k+	c #565778",
+"l+	c #52506E",
+"m+	c #4F4B6A",
+"n+	c #4C4865",
+"o+	c #474361",
+"p+	c #474564",
+"q+	c #494562",
+"r+	c #48445D",
+"s+	c #474460",
+"t+	c #494865",
+"u+	c #454764",
+"v+	c #444763",
+"w+	c #464A68",
+"x+	c #474867",
+"y+	c #484667",
+"z+	c #494769",
+"A+	c #49486F",
+"B+	c #494975",
+"C+	c #494A70",
+"D+	c #0F0E10",
+"E+	c #080808",
+"F+	c #090909",
+"G+	c #090809",
+"H+	c #070607",
+"I+	c #070506",
+"J+	c #060505",
+"K+	c #050505",
+"L+	c #050405",
+"M+	c #020303",
+"N+	c #2F373F",
+"O+	c #757376",
+"P+	c #4D5567",
+"Q+	c #505A6E",
+"R+	c #5D6679",
+"S+	c #5B677A",
+"T+	c #5C687B",
+"U+	c #616A7D",
+"V+	c #626B7D",
+"W+	c #505969",
+"X+	c #4F5A6A",
+"Y+	c #4F5A69",
+"Z+	c #575E72",
+"`+	c #60677D",
+" @	c #5F687B",
+".@	c #63697E",
+"+@	c #666D82",
+"@@	c #5F647C",
+"#@	c #666B84",
+"$@	c #677088",
+"%@	c #6C758C",
+"&@	c #6C748A",
+"*@	c #687487",
+"=@	c #697A8D",
+"-@	c #6C7A8D",
+";@	c #6F7C8E",
+">@	c #6D798B",
+",@	c #6E7A8D",
+"'@	c #69788C",
+")@	c #6A758B",
+"!@	c #717A90",
+"~@	c #728291",
+"{@	c #718A96",
+"]@	c #708B97",
+"^@	c #6E8694",
+"/@	c #69798A",
+"(@	c #667186",
+"_@	c #647082",
+":@	c #5B657B",
+"<@	c #4F5970",
+"[@	c #414A5E",
+"}@	c #545867",
+"|@	c #383B44",
+"1@	c #0E0E11",
+"2@	c #0B0F14",
+"3@	c #46434A",
+"4@	c #47484E",
+"5@	c #404248",
+"6@	c #272D30",
+"7@	c #272A31",
+"8@	c #11171A",
+"9@	c #16181A",
+"0@	c #06090B",
+"a@	c #1D1F22",
+"b@	c #191C21",
+"c@	c #4C4C51",
+"d@	c #545057",
+"e@	c #4A4B51",
+"f@	c #4E4D54",
+"g@	c #57565B",
+"h@	c #282C32",
+"i@	c #0F1821",
+"j@	c #222530",
+"k@	c #29262E",
+"l@	c #26252E",
+"m@	c #272A34",
+"n@	c #202D38",
+"o@	c #1E2C39",
+"p@	c #202A36",
+"q@	c #202937",
+"r@	c #1E2735",
+"s@	c #1F2935",
+"t@	c #222B37",
+"u@	c #242D39",
+"v@	c #27323E",
+"w@	c #293740",
+"x@	c #25343D",
+"y@	c #24303B",
+"z@	c #222C38",
+"A@	c #1D2732",
+"B@	c #2F3B48",
+"C@	c #303C49",
+"D@	c #3B4854",
+"E@	c #262D36",
+"F@	c #292B30",
+"G@	c #241F23",
+"H@	c #373233",
+"I@	c #504A4C",
+"J@	c #797275",
+"K@	c #817B7E",
+"L@	c #767074",
+"M@	c #5E5559",
+"N@	c #4A4148",
+"O@	c #2F242A",
+"P@	c #3A3037",
+"Q@	c #372C31",
+"R@	c #362E34",
+"S@	c #3C3339",
+"T@	c #635E66",
+"U@	c #74717A",
+"V@	c #615D67",
+"W@	c #605D66",
+"X@	c #716D73",
+"Y@	c #413D47",
+"Z@	c #4B444E",
+"`@	c #493F49",
+" #	c #453D48",
+".#	c #49404C",
+"+#	c #43404A",
+"@#	c #403E48",
+"##	c #3B3A43",
+"$#	c #3B3941",
+"%#	c #39373F",
+"&#	c #37363D",
+"*#	c #37353E",
+"=#	c #36353F",
+"-#	c #35353E",
+";#	c #33353D",
+">#	c #31323A",
+",#	c #2D2E37",
+"'#	c #2D2E36",
+")#	c #494B55",
+"!#	c #5D5D66",
+"~#	c #575660",
+"{#	c #585760",
+"]#	c #332E37",
+"^#	c #18171B",
+"/#	c #606166",
+"(#	c #190F0F",
+"_#	c #98A0A1",
+":#	c #DDDCDC",
+"<#	c #E1DCDB",
+"[#	c #B8C2C7",
+"}#	c #BFC9CD",
+"|#	c #D5D5D6",
+"1#	c #D8D6D8",
+"2#	c #CBCCCF",
+"3#	c #DCD4D5",
+"4#	c #C6C7CC",
+"5#	c #BAC0C4",
+"6#	c #C7C9CD",
+"7#	c #DAD2D3",
+"8#	c #C1C3C6",
+"9#	c #D2CED0",
+"0#	c #D4CED0",
+"a#	c #BFC1C5",
+"b#	c #CCCDD1",
+"c#	c #E1DEDE",
+"d#	c #E1DEDF",
+"e#	c #DDDEDF",
+"f#	c #E9E5E4",
+"g#	c #D5DBDC",
+"h#	c #D7DCDE",
+"i#	c #DDDEE0",
+"j#	c #E4E2E2",
+"k#	c #D7D9DA",
+"l#	c #E6E3E2",
+"m#	c #E4E2E3",
+"n#	c #DCDCDF",
+"o#	c #DBDBDD",
+"p#	c #E6E2E2",
+"q#	c #DDDEDD",
+"r#	c #E1E2E1",
+"s#	c #E9E4E3",
+"t#	c #DEE0E0",
+"u#	c #D2D7D8",
+"v#	c #D7D8D8",
+"w#	c #DCDBDC",
+"x#	c #CDD0D3",
+"y#	c #C6CECF",
+"z#	c #DAE1E2",
+"A#	c #5C5A5D",
+"B#	c #1F252A",
+"C#	c #312C30",
+"D#	c #250A09",
+"E#	c #3C3A3E",
+"F#	c #D2D0D5",
+"G#	c #E1D9DB",
+"H#	c #A8A5AA",
+"I#	c #AEA9AE",
+"J#	c #D0C7C9",
+"K#	c #CEC1C4",
+"L#	c #C1B3B6",
+"M#	c #D7C8CE",
+"N#	c #9A93A0",
+"O#	c #958D94",
+"P#	c #A399A0",
+"Q#	c #CBBBC0",
+"R#	c #968D93",
+"S#	c #C5B7BC",
+"T#	c #BAABAF",
+"U#	c #8E8488",
+"V#	c #94878D",
+"W#	c #C5B4B9",
+"X#	c #AE9EA2",
+"Y#	c #9C8F95",
+"Z#	c #D7C6C7",
+"`#	c #92898B",
+" $	c #9A8D91",
+".$	c #A09598",
+"+$	c #C8B7B8",
+"@$	c #96888D",
+"#$	c #B9AAAB",
+"$$	c #C0ADB2",
+"%$	c #988A91",
+"&$	c #998991",
+"*$	c #C4B0B3",
+"=$	c #AD9CA0",
+"-$	c #9E9197",
+";$	c #D3BCC0",
+">$	c #AA9FA5",
+",$	c #97909A",
+"'$	c #95919E",
+")$	c #CEBFC1",
+"!$	c #9F9DA5",
+"~$	c #8C8A97",
+"{$	c #565C69",
+"]$	c #261718",
+"^$	c #241D1D",
+"/$	c #131415",
+"($	c #040303",
+"_$	c #666B69",
+":$	c #DCE9E4",
+"<$	c #D4E4DE",
+"[$	c #D4E2DC",
+"}$	c #D8E3DE",
+"|$	c #D7E4DF",
+"1$	c #D7E3DD",
+"2$	c #D8E4E0",
+"3$	c #DAE5E0",
+"4$	c #D8E4E1",
+"5$	c #D9E4E2",
+"6$	c #D9E5E2",
+"7$	c #D8E2E0",
+"8$	c #DBE4E4",
+"9$	c #D8E1E1",
+"0$	c #DAE4E4",
+"a$	c #DDE8E9",
+"b$	c #DAE5E5",
+"c$	c #D9E4E5",
+"d$	c #DFEAEA",
+"e$	c #DDE7E7",
+"f$	c #E2EBEA",
+"g$	c #E5EDEB",
+"h$	c #E6F0EF",
+"i$	c #E5EBEB",
+"j$	c #EBF0EE",
+"k$	c #EBEFEE",
+"l$	c #E4E9E6",
+"m$	c #E6EBEB",
+"n$	c #EBF1EF",
+"o$	c #EAF0EF",
+"p$	c #E7EDEB",
+"q$	c #ECF4F3",
+"r$	c #EDF3F2",
+"s$	c #EEF2F1",
+"t$	c #EDF2F3",
+"u$	c #F4FAF8",
+"v$	c #F1F8F6",
+"w$	c #F7FAFA",
+"x$	c #9B989D",
+"y$	c #020000",
+"z$	c #121111",
+"A$	c #121213",
+"B$	c #070808",
+"C$	c #0D0F0F",
+"D$	c #141B18",
+"E$	c #131C19",
+"F$	c #121917",
+"G$	c #141A18",
+"H$	c #131817",
+"I$	c #131818",
+"J$	c #141919",
+"K$	c #14191A",
+"L$	c #161C1C",
+"M$	c #161B1B",
+"N$	c #161A1A",
+"O$	c #171B1B",
+"P$	c #141718",
+"Q$	c #141818",
+"R$	c #141A1B",
+"S$	c #151A1C",
+"T$	c #151B1C",
+"U$	c #15191C",
+"V$	c #161B1D",
+"W$	c #14191B",
+"X$	c #161C1D",
+"Y$	c #191F1E",
+"Z$	c #1B2121",
+"`$	c #1A2021",
+" %	c #1D2424",
+".%	c #202828",
+"+%	c #1E2728",
+"@%	c #1D2626",
+"#%	c #1F2929",
+"$%	c #212C2D",
+"%%	c #222D2F",
+"&%	c #243031",
+"*%	c #253131",
+"=%	c #293537",
+"-%	c #2B383A",
+";%	c #313D3D",
+">%	c #354041",
+",%	c #384243",
+"'%	c #3D4749",
+")%	c #2B3134",
+"!%	c #030506",
+"~%	c #0B0E0D",
+"{%	c #1B1416",
+"]%	c #020200",
+"^%	c #0D0F11",
+"/%	c #3F292E",
+"(%	c #282026",
+"_%	c #2B232B",
+":%	c #2A282F",
+"<%	c #1E1D21",
+"[%	c #1A1619",
+"}%	c #301B1F",
+"|%	c #331D21",
+"1%	c #282730",
+"2%	c #29252E",
+"3%	c #29232D",
+"4%	c #28232B",
+"5%	c #28232D",
+"6%	c #28242E",
+"7%	c #27222B",
+"8%	c #25212A",
+"9%	c #24212A",
+"0%	c #20222B",
+"a%	c #331A1F",
+"b%	c #1D1A1E",
+"c%	c #181C21",
+"d%	c #1A1D23",
+"e%	c #1C1B20",
+"f%	c #1F161C",
+"g%	c #241216",
+"h%	c #181217",
+"i%	c #171319",
+"j%	c #171218",
+"k%	c #171318",
+"l%	c #161317",
+"m%	c #141217",
+"n%	c #141318",
+"o%	c #151419",
+"p%	c #16151B",
+"q%	c #16171B",
+"r%	c #231213",
+"s%	c #191013",
+"t%	c #0F0A0C",
+"u%	c #1A171D",
+"v%	c #19181D",
+"w%	c #18171D",
+"x%	c #2A1F24",
+"y%	c #86888B",
+"z%	c #33363F",
+"A%	c #6A4347",
+"B%	c #623F45",
+"C%	c #62464E",
+"D%	c #664249",
+"E%	c #787377",
+"F%	c #4B323A",
+"G%	c #50404B",
+"H%	c #55363D",
+"I%	c #743C3E",
+"J%	c #4A363B",
+"K%	c #31232A",
+"L%	c #28272D",
+"M%	c #373F47",
+"N%	c #744042",
+"O%	c #533D43",
+"P%	c #67454A",
+"Q%	c #694248",
+"R%	c #656066",
+"S%	c #4E444D",
+"T%	c #58383E",
+"U%	c #623B40",
+"V%	c #58383B",
+"W%	c #362A33",
+"X%	c #2E262C",
+"Y%	c #38444E",
+"Z%	c #7C3C3D",
+"`%	c #534249",
+" &	c #6A4449",
+".&	c #6F4448",
+"+&	c #69656B",
+"@&	c #553A42",
+"#&	c #4F3A41",
+"$&	c #673A3E",
+"%&	c #3B2F37",
+"&&	c #33282E",
+"*&	c #404752",
+"=&	c #873837",
+"-&	c #51484F",
+";&	c #6A434A",
+">&	c #6A4349",
+",&	c #878689",
+"'&	c #69646A",
+")&	c #878688",
+"!&	c #563941",
+"~&	c #4F3F49",
+"{&	c #6A3A3A",
+"]&	c #40333B",
+"^&	c #4D3F46",
+"/&	c #5E6066",
+"(&	c #382C33",
+"_&	c #474B55",
+":&	c #943D38",
+"<&	c #6E4549",
+"[&	c #714248",
+"}&	c #4D4650",
+"|&	c #4F454E",
+"1&	c #5C383E",
+"2&	c #4E4750",
+"3&	c #713735",
+"4&	c #463741",
+"5&	c #3C3036",
+"6&	c #33333B",
+"7&	c #41343A",
+"8&	c #4D4B54",
+"9&	c #9C3D37",
+"0&	c #784346",
+"a&	c #6F4247",
+"b&	c #4F464F",
+"c&	c #50474E",
+"d&	c #5D393F",
+"e&	c #868586",
+"f&	c #7C3837",
+"g&	c #4A3E47",
+"h&	c #3D272B",
+"i&	c #322B2F",
+"j&	c #443B43",
+"k&	c #5D4850",
+"l&	c #A23F38",
+"m&	c #744346",
+"n&	c #754146",
+"o&	c #52464E",
+"p&	c #5F393E",
+"q&	c #853A38",
+"r&	c #51454C",
+"s&	c #422529",
+"t&	c #422C31",
+"u&	c #6C4549",
+"v&	c #9C423D",
+"w&	c #6F4145",
+"x&	c #6C4248",
+"y&	c #53464F",
+"z&	c #4E464F",
+"A&	c #5C383F",
+"B&	c #4D3F47",
+"C&	c #893E3E",
+"D&	c #60454A",
+"E&	c #3F282D",
+"F&	c #848586",
+"G&	c #4A2F34",
+"H&	c #7B4544",
+"I&	c #8D4240",
+"J&	c #703E42",
+"K&	c #6B4147",
+"L&	c #55474F",
+"M&	c #4D4851",
+"N&	c #5D3A41",
+"O&	c #543D42",
+"P&	c #824342",
+"Q&	c #684349",
+"R&	c #3C2E34",
+"S&	c #3A373C",
+"T&	c #482F35",
+"U&	c #874442",
+"V&	c #7E3F40",
+"W&	c #6C3E43",
+"X&	c #684147",
+"Y&	c #58474F",
+"Z&	c #5B5860",
+"`&	c #5D3940",
+" *	c #543C41",
+".*	c #704345",
+"+*	c #6F4346",
+"@*	c #40333A",
+"#*	c #372F32",
+"$*	c #858586",
+"%*	c #463339",
+"&*	c #94433E",
+"**	c #6E4042",
+"=*	c #764042",
+"-*	c #614148",
+";*	c #5A474E",
+">*	c #4D4952",
+",*	c #593C44",
+"'*	c #5A3B3F",
+")*	c #594047",
+"!*	c #794241",
+"~*	c #443C44",
+"{*	c #2F272A",
+"]*	c #3A373F",
+"^*	c #4E3B40",
+"/*	c #94403A",
+"(*	c #6A4446",
+"_*	c #714045",
+":*	c #5B464E",
+"<*	c #5B5960",
+"[*	c #593B42",
+"}*	c #5E3D40",
+"|*	c #4E454D",
+"1*	c #7D3C3B",
+"2*	c #42434D",
+"3*	c #3B2524",
+"4*	c #413338",
+"5*	c #814846",
+"6*	c #764547",
+"7*	c #60424A",
+"8*	c #5C474E",
+"9*	c #69686E",
+"0*	c #563F46",
+"a*	c #574347",
+"b*	c #704042",
+"c*	c #464650",
+"d*	c #402424",
+"e*	c #573132",
+"f*	c #878687",
+"g*	c #814746",
+"h*	c #614A4F",
+"i*	c #69696E",
+"j*	c #763C3B",
+"k*	c #4F4952",
+"l*	c #41282A",
+"m*	c #393D43",
+"n*	c #653635",
+"o*	c #924841",
+"p*	c #2E2629",
+"q*	c #2F2D31",
+"r*	c #833B38",
+"s*	c #524B52",
+"t*	c #493033",
+"u*	c #3B3438",
+"v*	c #683835",
+"w*	c #613A3A",
+"x*	c #31373F",
+"y*	c #0C0A0B",
+"z*	c #5E3738",
+"A*	c #878587",
+"B*	c #54383C",
+"C*	c #3A2E30",
+"D*	c #45393C",
+"E*	c #6E3B3A",
+"F*	c #26292E",
+"G*	c #020101",
+"H*	c #080809",
+"I*	c #494F55",
+"J*	c #573F44",
+"K*	c #3C2929",
+"L*	c #503637",
+"M*	c #6D4344",
+"N*	c #212328",
+"O*	c #060507",
+"P*	c #323941",
+"Q*	c #4D464E",
+"R*	c #572A28",
+"S*	c #683530",
+"T*	c #5E474A",
+"U*	c #202125",
+"V*	c #1C1515",
+"W*	c #0E0C0D",
+"X*	c #333B43",
+"Y*	c #4D4A53",
+"Z*	c #5F2A27",
+"`*	c #7C342A",
+" =	c #544C52",
+".=	c #202024",
+"+=	c #543D3C",
+"@=	c #211A1B",
+"#=	c #484E55",
+"$=	c #66302D",
+"%=	c #626266",
+"&=	c #7C3C36",
+"*=	c #2F2E35",
+"==	c #4A434B",
+"-=	c #322A2E",
+";=	c #763834",
+">=	c #44363A",
+",=	c #505055",
+"'=	c #7E574F",
+")=	c #9D5449",
+"!=	c #804C48",
+"~=	c #7C5C57",
+"{=	c #695554",
+"]=	c #504C51",
+"^=	c #7D544D",
+"/=	c #4F4D54",
+"(=	c #504952",
+"_=	c #696462",
+":=	c #81645A",
+"<=	c #664B4B",
+"[=	c #6B4949",
+"}=	c #78777A",
+"|=	c #75443F",
+"1=	c #553D3C",
+"2=	c #4D484E",
+"3=	c #80473D",
+"4=	c #2E3037",
+"5=	c #373032",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . + @ # $ % & * = - ; > , ' ) ! ~ * { . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . 9 0 a b c d e f g h i j k l m n o p . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . q r s t u v w x y z A B C D E F G H . . . . . . . . . . . . . . . ",
+". . . . . I J K L M N O P Q R S T U V W X Y Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.).!.~.. . . . . . ",
+". . . . {.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.5 e.f.g.h.i.j.k.l.m.n.o.p.q.r.. . . . ",
+". . . s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.0.H.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++ at +#+. . . ",
+". . . $+%+&+*+=+=+=+=+=+=+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+=+3+4+5+4+6+5+7+8+9+0+. . ",
+". . . a+b+c+d+e+f+g+f+h+i+b+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+J+K+L+M+N+. . ",
+". . . O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@$@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@. . . ",
+". . |@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@g at h@i at j@k at l@m at n@o at p@q at r@s at t@u at v@w at x@y at z@A at B@C at v@D at E@F at . . ",
+". . G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@3 at Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#,#'#)#!#~#{#]#^#. . ",
+". /#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#. ",
+". C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$. ",
+". /$($_$:$<$[$}$|$1$2$3$}$4$5$6$7$8$9$0$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$. ",
+". A$B$C$D$E$F$G$H$I$J$K$L$M$N$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%. ",
+". {%]%=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+^%. ",
+". /%(%_%:%<%[%}%|%1%2%3%4%5%6%5%7%8%9%0%a%b%c%b at d%e%f%g%h%i%j%k%l%m%m%n%o%p%p%q%r%s%t%u%v%w%x%. ",
+". . . . y%>#z%A%B%. . . . . . . . . . C%D%. . . . E%F%G%H%. . . . . . . . . . . I%J%K%. . . . . ",
+". . . . . L%M%N%O%. . . . . . . . . P%Q%. . . . . . R%. S%T%. . . . . . . . . . U%V%W%. . . . . ",
+". . . . . X%Y%Z%`%. . . . . . . .  &.&. . . . . . . . . . +&@&. . . . . . . . . #&$&%&. . . . . ",
+". . . . . &&*&=&-&. . . . . . . ;&>&. . . . . . . ,&'&. . . )&!&. . . . . . . . ~&{&]&^&. . . . ",
+". . . . /&(&_&:&. . . . . . . <&[&. . . . . . . . }&|&. . . . . 1&. . . . . . . 2&3&4&5&. . . . ",
+". . . . 6&7&8&9&. . . . . . 0&a&. . . . . . . . . b&c&. . . . . . d&e&. . . . . . f&g&h&. . . . ",
+". . . . i&j&k&l&. . . . . m&n&. . . . . . . . . . o&c&. . . . . . . p&e&. . . . . q&r&s&. . . . ",
+". . . . t&. u&v&. . . . w&x&. . . . . . . . . . . y&z&. . . . . . . . A&B&. . . . C&D&E&F&. . . ",
+". . . . G&. H&I&. . . J&K&. . . . . . . . . . . . L&M&. . . . . . . . . N&O&. . . P&Q&R&S&. . . ",
+". . . . T&. U&V&. . W&X&. . . . . . . . . . . . . Y&Z&. . . . . . . . . . `& *. . .*+*@*#*. . . ",
+". . . $*%*. &***. =*-*. . . . . . . . . . . . . . ;*>*. . . . . . . . . . . ,*'*. )*!*~*{*. . . ",
+". . . ]*^*. /*(*_*D%. . . . . . . . . . . . . . . :*<*. . . . . . . . . . . . [*}*|*1*2*3*. . . ",
+". . . 4*^&. 5*6*7*. . . . . . . . . . . . . . . . 8*9*. . . . . . . . . . . . . 0*a*b*c*d*. . . ",
+". . . e*f*. g*. . . . . . . . . . . . . . . . . . h*i*. . . . . . . . . . . . . . . j*k*l*m*. . ",
+". . . n*I . o*. . . . . . . . . . . . . . . . . . p*q*. . . . . . . . . . . . . . . r*s*t*u*. . ",
+". . . v*. . w*. . . . . . . . . . . . . . . . . x*($y*. . . . . . . . . . . . . . . z*A*B*C*. . ",
+". . D*E*. . . . . . . . . . . . . . . . . . . . F*G*H*I*. . . . . . . . . . . . . . . . J*K*. . ",
+". . L*M*. . . . . . . . . . . . . . . . . . . . N*=+O*P*. . . . . . . . . . . . . . . . Q*R*. . ",
+". . S*T*. . . . . . . . . . . . . . . . . . . . U*V*W*X*. . . . . . . . . . . . . . . . Y*Z*. . ",
+". . `* =. . . . . . . . . . . . . . . . . . . . .=+=@=#=. . . . . . . . . . . . . . . . . $=%=. ",
+". . &=. . . . . . . . . . . . . . . . . . . . . *===-=. . . . . . . . . . . . . . . . . . ;=>=. ",
+". ,='=. . . . . . . . . . . . . . . . . . . . . . )=!=. . . . . . . . . . . . . . . . . . ~={=. ",
+". ]=^=. . . . . . . . . . . . . . . . . . . . . . /=(=. . . . . . . . . . . . . . . . . . _=:=. ",
+". <=[=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . }=|=. ",
+". 1=2=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3=. ",
+". 4=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5=. ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/kick.xpm b/images/MusicalInstruments/kick.xpm
new file mode 100644
index 0000000..1d4a45b
--- /dev/null
+++ b/images/MusicalInstruments/kick.xpm
@@ -0,0 +1,307 @@
+/* XPM */
+static char * kick_xpm[] = {
+"48 48 256 2",
+"  	c #FFFFFF",
+". 	c #636363",
+"+ 	c #8C8C8C",
+"@ 	c #A5A5A5",
+"# 	c #ADADAD",
+"$ 	c #B5B5B5",
+"% 	c #BDBDBD",
+"& 	c #C6C6C6",
+"* 	c #D6D6D6",
+"= 	c #DEDEDE",
+"- 	c #E7E7E7",
+"; 	c #ADA5A5",
+"> 	c #C6BDBD",
+", 	c #524A4A",
+"' 	c #A58C8C",
+") 	c #6B4A42",
+"! 	c #CEBDB5",
+"~ 	c #A5948C",
+"{ 	c #5A4A42",
+"] 	c #634231",
+"^ 	c #6B4229",
+"/ 	c #C66321",
+"( 	c #E79452",
+"_ 	c #C6BDB5",
+": 	c #A59C94",
+"< 	c #EF7B10",
+"[ 	c #FFEFDE",
+"} 	c #524A42",
+"| 	c #393129",
+"1 	c #D6B594",
+"2 	c #EF8C29",
+"3 	c #CEC6BD",
+"4 	c #ADA59C",
+"5 	c #AD9C84",
+"6 	c #F7DEBD",
+"7 	c #CEB594",
+"8 	c #C6AD8C",
+"9 	c #DEB57B",
+"0 	c #DEAD6B",
+"a 	c #4A3921",
+"b 	c #C69452",
+"c 	c #5A4221",
+"d 	c #6B4208",
+"e 	c #D6C6AD",
+"f 	c #BDAD94",
+"g 	c #CEB58C",
+"h 	c #C6AD84",
+"i 	c #5A4A31",
+"j 	c #FFAD21",
+"k 	c #4A3108",
+"l 	c #847B6B",
+"m 	c #635A4A",
+"n 	c #CE8C18",
+"o 	c #BDB5A5",
+"p 	c #CEBD9C",
+"q 	c #C6B594",
+"r 	c #CEB584",
+"s 	c #847352",
+"t 	c #FFC652",
+"u 	c #C69431",
+"v 	c #ADA594",
+"w 	c #736B5A",
+"x 	c #312918",
+"y 	c #947B42",
+"z 	c #DECEA5",
+"A 	c #D6C69C",
+"B 	c #CEBD94",
+"C 	c #EFC663",
+"D 	c #9C7B29",
+"E 	c #9C7310",
+"F 	c #5A4208",
+"G 	c #FFBD10",
+"H 	c #FFB500",
+"I 	c #CEB56B",
+"J 	c #C6AD63",
+"K 	c #CEC6AD",
+"L 	c #BDB59C",
+"M 	c #ADA58C",
+"N 	c #9C947B",
+"O 	c #948C73",
+"P 	c #736B52",
+"Q 	c #D6C694",
+"R 	c #BDAD7B",
+"S 	c #9C8439",
+"T 	c #292108",
+"U 	c #C6BD9C",
+"V 	c #9C8C52",
+"W 	c #E7CE73",
+"X 	c #736329",
+"Y 	c #FFD64A",
+"Z 	c #524208",
+"` 	c #CEA510",
+" .	c #CEC6A5",
+"..	c #ADA584",
+"+.	c #C6BD94",
+"@.	c #C6B56B",
+"#.	c #948442",
+"$.	c #C6AD4A",
+"%.	c #B59C31",
+"&.	c #312908",
+"*.	c #FFD629",
+"=.	c #9C8418",
+"-.	c #D6CEA5",
+";.	c #CEC69C",
+">.	c #EFDE84",
+",.	c #CEBD6B",
+"'.	c #9C8C42",
+").	c #F7DE63",
+"!.	c #AD9C42",
+"~.	c #393108",
+"{.	c #736310",
+"].	c #8C8452",
+"^.	c #F7E78C",
+"/.	c #F7E784",
+"(.	c #847B42",
+"_.	c #736B39",
+":.	c #EFDE73",
+"<.	c #9C8C31",
+"[.	c #423908",
+"}.	c #FFF7BD",
+"|.	c #9C945A",
+"1.	c #948C52",
+"2.	c #CEBD42",
+"3.	c #FFE74A",
+"4.	c #FFE731",
+"5.	c #EFE79C",
+"6.	c #FFF7A5",
+"7.	c #F7EF9C",
+"8.	c #D6CE84",
+"9.	c #C6BD73",
+"0.	c #B5AD63",
+"a.	c #9C9452",
+"b.	c #ADA552",
+"c.	c #9C9442",
+"d.	c #8C8431",
+"e.	c #B5A518",
+"f.	c #F7EF94",
+"g.	c #EFE78C",
+"h.	c #C6BD5A",
+"i.	c #9C9431",
+"j.	c #DECE08",
+"k.	c #F7EF73",
+"l.	c #FFF763",
+"m.	c #D6CE42",
+"n.	c #9C9410",
+"o.	c #ADADA5",
+"p.	c #B5B5AD",
+"q.	c #94948C",
+"r.	c #9C9C94",
+"s.	c #A5A59C",
+"t.	c #6B6B63",
+"u.	c #BDBDAD",
+"v.	c #C6C6B5",
+"w.	c #B5B5A5",
+"x.	c #63635A",
+"y.	c #FFFFE7",
+"z.	c #8C8C7B",
+"A.	c #848473",
+"B.	c #C6C6AD",
+"C.	c #424239",
+"D.	c #737363",
+"E.	c #DEDEBD",
+"F.	c #CECEAD",
+"G.	c #C6C6A5",
+"H.	c #FFFFC6",
+"I.	c #212118",
+"J.	c #393929",
+"K.	c #737352",
+"L.	c #525239",
+"M.	c #D6D694",
+"N.	c #ADAD73",
+"O.	c #4A4A31",
+"P.	c #5A5A39",
+"Q.	c #EFEF94",
+"R.	c #393921",
+"S.	c #636339",
+"T.	c #525229",
+"U.	c #8C8C42",
+"V.	c #4A4A21",
+"W.	c #5A5A21",
+"X.	c #181808",
+"Y.	c #848421",
+"Z.	c #212108",
+"`.	c #FFFF18",
+" +	c #101000",
+".+	c #4A5210",
+"++	c #C6DE42",
+"@+	c #737B52",
+"#+	c #6B7352",
+"$+	c #C6CEB5",
+"%+	c #4A5239",
+"&+	c #BDC6AD",
+"*+	c #6B7B5A",
+"=+	c #B5BDAD",
+"-+	c #525A4A",
+";+	c #6B8C52",
+">+	c #EFF7EF",
+",+	c #A5ADA5",
+"'+	c #737B73",
+")+	c #4A524A",
+"!+	c #B5CEB5",
+"~+	c #6B7B6B",
+"{+	c #527B5A",
+"]+	c #ADEFBD",
+"^+	c #638C73",
+"/+	c #9CD6B5",
+"(+	c #73847B",
+"_+	c #9CADA5",
+":+	c #A5BDB5",
+"<+	c #8CC6B5",
+"[+	c #94EFD6",
+"}+	c #5A847B",
+"|+	c #5ABDAD",
+"1+	c #D6EFEF",
+"2+	c #526363",
+"3+	c #7BADAD",
+"4+	c #638C8C",
+"5+	c #ADD6DE",
+"6+	c #9CC6CE",
+"7+	c #6B949C",
+"8+	c #3984A5",
+"9+	c #849CAD",
+"0+	c #52A5DE",
+"a+	c #B5D6EF",
+"b+	c #BDC6CE",
+"c+	c #39526B",
+"d+	c #637394",
+"e+	c #B5BDCE",
+"f+	c #8C9CCE",
+"g+	c #B5B5BD",
+"h+	c #ADADB5",
+"i+	c #94949C",
+"j+	c #84848C",
+"k+	c #73738C",
+"l+	c #9494B5",
+"m+	c #BDBDE7",
+"n+	c #ADADEF",
+"o+	c #524A6B",
+"p+	c #CEBDF7",
+"q+	c #BDA5EF",
+"r+	c #6B5A8C",
+"s+	c #948C9C",
+"t+	c #C6BDCE",
+"u+	c #945AC6",
+"v+	c #BDADC6",
+"w+	c #B594C6",
+"x+	c #EF94FF",
+"y+	c #B5A5B5",
+"z+	c #EFA5CE",
+"A+	c #FFEFF7",
+"B+	c #B5A5AD",
+"C+	c #EFBDD6",
+"D+	c #A58C94",
+"E+	c #634A52",
+"F+	c #000000",
+"G+	c #C0C0C0",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+[.F+F+F+ +&.T T ~.i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+R   [ [ C+[ 6 ! D i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+]+R 1 M.M.8.8.>.g.>.Q.6.:.{.}.g.i+i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+N i+r.M.M.g.Q >.M.M.>.>.>.>.k./.d.^.>+:.  i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+N (.g 8.M.>.z :.Q.Q.g.Q.f.^.5.>.k.        |.+.i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+F /.R 8.8.>.g.b.>.Q.Q.^././.f.k.6.        y.}.}.h.i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+y <.#+|.8.b.S.T.i W.].Q Q 6.f.7.6.f.          6.H.}./.N.i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+8+i+'.|.F X T x &.&.&.&.X.Z.Z.[.h.+.M.M.        y.6.H.6.k.).* i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+y _.T  +q+u.o.; L v 4 4 f 4 4 |.b.h+&.m+      y.y.y.6./.:.g.).N.i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+{.v v w.o w.L L 4 L w.w.w.w.4 4 4 e E R.$+7.6.}.}.^.>.Q.g.>.E.o i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+N.4 4 w.L w.L G.G.B.K B.K K B.B.G.o o w.4 B+,.[..+8.6.^.Q.g.:.>.g.Y.i+i+i+i+",
+"i+i+i+i+i+i+i+F+i+: L L L G.G.G.u.G.K e B.K K K B.B.-.B.G.&+ .o f B+Z J.{+7.k.f.>.:.).d.|.i+i+i+",
+"i+i+i+i+i+i+i+i+: 4 w.o B.B.B.! F.B.K ! K K K K K K $+v.! ! -.G.o L 4 4 J.&.^.Q.Q.5.5.b.h M i+i+",
+"i+i+i+i+i+i+N : f L 7 B.G. . .e K K -.e -.F.F.e e e -.-.-.e -.K p B.o L 4 %+&.:.g.g.$+9.J ..i+i+",
+"i+i+i+i+i+i+v v v L o G.G.K A  . . .$+$+e ! v.K K K A K K K A B. .G.L L s.o T i.g.B v. at .@.,.i+i+",
+"i+i+i+i+F+v s.4 L o U G.B.K F.K K v.$+F.F.F.B. .e e e K F.K K -.B.G.B.B.o 4 B+Z.%+T.N.9.0. at .i+u ",
+"i+i+i+F+_.f f L U G.o  . .&+B.B.-.K F.K F.e v.-.e e e -.-.e  . .B.G.G.G.&+o s.s A.N.l 9.0.N.(.F ",
+"i+i+i+i+L f L o U o G.G. .o B.v. .B.-.A B. .K  .K K  .K K  . .B.B.G.G.u.U U w.s.D.c+X h.0.h.h F+",
+"i+i+F+i+f f q +.U U U U U  .o G. .G.B. . . .B.K  . .p K B.K B.&+ . .p  .U U o L : 9+V N...&.N.F ",
+"i+i+F+M 8 L q q B G.o p G.G.B. .B.G. . . .&+-.B.K K -.!+-.G. . . .;. .p G.U U L L D+J.T.b..+a.X ",
+"i+i+i+M L 8 8 U G.q U  .B.G. .B. . . . .B.v.B. .B.B. .F. . .G. .G.G.F.B.u.U G.+.G.M 7 X.N.U.S _.",
+"# i+F+8 8 q f 7 q G.U o o G.o  . .v. .u. .B.B.G. . . .B.K  . .p G.G. .G.&+L G.U U q 5 T @.|.U._.",
+"t.X.P 4 f f +.q U U o U G.B.B.G. .B.B.G. .K B.B.K K G. .K ;.G.p  .u. .G.G.o G.U U U 8 m .+S |.i+",
+"z.F+N.f f 8 q o U o +.p G.G.U G.G.G.u.G.;.p G.G.B.B.p B.B.;.Q G. .p p o G.U o B U +.q q x |.m.i+",
+"x  +5 f 8 q q L q U q U o o G.B.B.G.B.G. .B.B.G.B.B. .B.&+ .B.G.;.G.B.o U B o U U U q 8 T e.3 i+",
+"i+i+8 M f f U q U U U o p o u.G. .B. .K  . .G.B.K K p  .B.K K  .G.;.p G. .G.U U B U +.8 ~.i+i+i+",
+"i+i+5 8 8 f q +.q U U U +.U G.p  .B.B.u.B. .B.G.B.B.G.o G. .p G. .G.G.G.p U U +.+.U L +.' i+i+i+",
+"i+i+E+M 8 f f f q U p U U o o G.U o p o &+ .o B.u.u.G.G.G.U ;. .B. .B.G.p U G.U +.+.+.8 4 i+i+i+",
+"i+i+I.8 f q 8 f L U U U o o G.B.G. .B.B.o  .p G.B.B. .G.G.;. .G.B. .o p ;.p U B U U +.+.y+i+i+i+",
+"i+{.X.M 8 8 8 q q q U p U G.U o  .U G.p G. .G. .K K  . .U  .G.G.;.;.G.p o B U +.q +.+.+.M i+i+i+",
+"i+F+F+5 f f f q U q U q o U +. .G.p B. .B.o G. .G.G.B. .p K G.G.G.B.G.U U U p q +.f q +.$ i+i+i+",
+"i+i+i+5 r f f q 8 U L L B.p o  .B.p G.B. .G. .G.B.B.o ;.p G.G.G.U U U G.U U +.q U +.f +.N i+i+i+",
+"i+i+i+F+h M M h 8 L U U U p p o A U p U G.G.U G. . .G.U p G. .G.o p U U p U q +.8 7 +.8 i+i+i+i+",
+"i+i+i+i+N q 8 M f f 8 q q U o o U G.o o p o  .p o o G.U U o G.p U U o U U U U +.f q L q i+i+i+i+",
+"i+i+i+F+ +v f q f f q q q L U U o o o o U o o o U U +.G.U U o  .o G.U G.U U L 8 q +.+.h i+i+i+i+",
+"i+i+i+i+ +v f M f f f q q q q p o U G.p 7 U o U  . .U U B  .p  .U U U o L L L U +.8 8 8 y+i+i+i+",
+"i+i+i+* i+F+M M 5 5 4 f 8 f U U o p U U o o U q o o U q p o o U o U q f q L f q f f 8 i+i+i+i+i+",
+"i+i+i+i+i+N i+q.M ~ M v f q q q U p U q p U o U U U U o 7 U U p U q 8 L L f f f f 8 f i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+~ ~ : v M M 8 q q U o U q U p q L L q U q U q q q q f L f f M ..f 7 i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+R F+: : : M v M f 8 q q U U U U U U U f L q L L f U f f L L : v M : J.i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+v ~ ~ v v f L f 8 q f L q q o o U U q L q L f f f f M M M 5 i+w+v i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+N ~ 5 M v 4 f L 8 f f f 8 L L L L 8 q M f f M M v v M M i i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+F+v ..~ : M v f f M f f M L L 8 f 8 f f f M ..M v M : ~ i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+x.A+: M M M M M M v f f f f M M M v M M 5 M : M A.i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+% t )+ +$ 5 ~ M : : v 5 f f v v M v M M : ~ M ' i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+= 5.i+i+l L M ..~ M M M M M : ~ r...D+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+2 i+i+i+i+i+T T T x x F+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+",
+"i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+ + + + +Z._.i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+"};
diff --git a/images/MusicalInstruments/loop.xpm b/images/MusicalInstruments/loop.xpm
new file mode 100644
index 0000000..d91447a
--- /dev/null
+++ b/images/MusicalInstruments/loop.xpm
@@ -0,0 +1,1009 @@
+/* XPM */
+static char * loop_xpm[] = {
+"48 48 958 2",
+"  	c #969696",
+". 	c #6E4137",
+"+ 	c #787678",
+"@ 	c #696669",
+"# 	c #B5501D",
+"$ 	c #554544",
+"% 	c #914A2C",
+"& 	c #544445",
+"* 	c #D28537",
+"= 	c #7A3F2B",
+"- 	c #524445",
+"; 	c #D68634",
+"> 	c #B17B3B",
+", 	c #878687",
+"' 	c #534446",
+") 	c #61423D",
+"! 	c #E09842",
+"~ 	c #8D3C1C",
+"{ 	c #6B4236",
+"] 	c #E19842",
+"^ 	c #D1892F",
+"/ 	c #5B5559",
+"( 	c #4E4448",
+"_ 	c #5B4240",
+": 	c #99360F",
+"< 	c #FDA439",
+"[ 	c #86462A",
+"} 	c #A63C0B",
+"| 	c #753F2F",
+"1 	c #AE4305",
+"2 	c #A73607",
+"3 	c #504347",
+"4 	c #564444",
+"5 	c #534445",
+"6 	c #D36A17",
+"7 	c #FFA339",
+"8 	c #874B2D",
+"9 	c #B85C14",
+"0 	c #9E431B",
+"a 	c #AF4808",
+"b 	c #C05E0B",
+"c 	c #534648",
+"d 	c #773E2F",
+"e 	c #D4832D",
+"f 	c #FFA43A",
+"g 	c #8A391C",
+"h 	c #8A4E30",
+"i 	c #BC6316",
+"j 	c #B15B20",
+"k 	c #6D4233",
+"l 	c #AB642A",
+"m 	c #B64D03",
+"n 	c #C4660F",
+"o 	c #69453C",
+"p 	c #524344",
+"q 	c #C14A0F",
+"r 	c #534344",
+"s 	c #903714",
+"t 	c #D57E26",
+"u 	c #A93A00",
+"v 	c #4D4547",
+"w 	c #824D35",
+"x 	c #BA6016",
+"y 	c #B34B18",
+"z 	c #AE561A",
+"A 	c #62453F",
+"B 	c #C36914",
+"C 	c #BF4D07",
+"D 	c #C0610D",
+"E 	c #4E464A",
+"F 	c #704436",
+"G 	c #67453C",
+"H 	c #993413",
+"I 	c #D48832",
+"J 	c #CD9841",
+"K 	c #D77823",
+"L 	c #AB3E00",
+"M 	c #B94507",
+"N 	c #AA6C3A",
+"O 	c #C4681A",
+"P 	c #724232",
+"Q 	c #79402F",
+"R 	c #9D3509",
+"S 	c #AD4F19",
+"T 	c #FFA53B",
+"U 	c #544B4C",
+"V 	c #BD5F09",
+"W 	c #DB7B27",
+"X 	c #CB6A12",
+"Y 	c #99411E",
+"Z 	c #89472E",
+"` 	c #A4653A",
+" .	c #D6812D",
+"..	c #F8A135",
+"+.	c #64433B",
+"@.	c #D6731A",
+"#.	c #AF3F02",
+"$.	c #D38E3C",
+"%.	c #CD953D",
+"&.	c #C18C3D",
+"*.	c #924024",
+"=.	c #AA4014",
+"-.	c #8B5134",
+";.	c #C66821",
+">.	c #B24D10",
+",.	c #4E4648",
+"'.	c #C46D29",
+").	c #AB4B04",
+"!.	c #E19F37",
+"~.	c #CB923B",
+"{.	c #C15519",
+"].	c #D36013",
+"^.	c #FCA338",
+"/.	c #D69E3F",
+"(.	c #AE3C03",
+"_.	c #FFA43B",
+":.	c #CB913A",
+"<.	c #D6741B",
+"[.	c #E19B35",
+"}.	c #C99943",
+"|.	c #B25221",
+"1.	c #AB3904",
+"2.	c #D89D3F",
+"3.	c #FAA136",
+"4.	c #514446",
+"5.	c #CB8F39",
+"6.	c #CF6B15",
+"7.	c #775129",
+"8.	c #EBA031",
+"9.	c #D09F42",
+"0.	c #D15A16",
+"a.	c #D5741E",
+"b.	c #F19A36",
+"c.	c #D29E40",
+"d.	c #C05407",
+"e.	c #D29F41",
+"f.	c #FFA53A",
+"g.	c #D49E40",
+"h.	c #FBA237",
+"i.	c #FBA234",
+"j.	c #D39B3E",
+"k.	c #BC5A25",
+"l.	c #D6741E",
+"m.	c #F09936",
+"n.	c #F29F34",
+"o.	c #D59F3F",
+"p.	c #863A1F",
+"q.	c #D49E41",
+"r.	c #D49E3E",
+"s.	c #DCA139",
+"t.	c #FBA231",
+"u.	c #F1AA41",
+"v.	c #D89F3B",
+"w.	c #D66015",
+"x.	c #E0A03A",
+"y.	c #FAA133",
+"z.	c #934724",
+"A.	c #FCA335",
+"B.	c #D09D41",
+"C.	c #FFA437",
+"D.	c #D47119",
+"E.	c #DBA03B",
+"F.	c #FCA337",
+"G.	c #D9A03A",
+"H.	c #FCA332",
+"I.	c #4F474B",
+"J.	c #FCA232",
+"K.	c #CA9A42",
+"L.	c #64413D",
+"M.	c #CE601D",
+"N.	c #E1A03B",
+"O.	c #FAA130",
+"P.	c #4B454A",
+"Q.	c #D29C41",
+"R.	c #FDA436",
+"S.	c #BC530B",
+"T.	c #DBA03D",
+"U.	c #D6A03E",
+"V.	c #CD9C3F",
+"W.	c #F7A22F",
+"X.	c #8E9C5D",
+"Y.	c #2D3020",
+"Z.	c #C99D41",
+"`.	c #F8A129",
+" +	c #C99C3B",
+".+	c #F9A028",
+"++	c #CE892D",
+"@+	c #F7A028",
+"#+	c #C79940",
+"$+	c #D19E3D",
+"%+	c #D39D3E",
+"&+	c #D19E42",
+"*+	c #FBA232",
+"=+	c #A64514",
+"-+	c #FAA02D",
+";+	c #C09844",
+">+	c #BD4603",
+",+	c #CE590C",
+"'+	c #DCA036",
+")+	c #F7A12F",
+"!+	c #CE7A28",
+"~+	c #CF9E3E",
+"{+	c #C99B3D",
+"]+	c #F8A12C",
+"^+	c #C3A54A",
+"/+	c #5C8F5D",
+"(+	c #1B3F30",
+"_+	c #10110C",
+":+	c #C6983F",
+"<+	c #F5A127",
+"[+	c #C8983B",
+"}+	c #F6A228",
+"|+	c #C79D3B",
+"1+	c #F1A125",
+"2+	c #C99233",
+"3+	c #FAA12D",
+"4+	c #CB9D3F",
+"5+	c #CB9C3C",
+"6+	c #C99D3C",
+"7+	c #F9A029",
+"8+	c #CE882A",
+"9+	c #F5A026",
+"0+	c #BF9443",
+"a+	c #D18F2F",
+"b+	c #878688",
+"c+	c #CA540B",
+"d+	c #D39F3E",
+"e+	c #F4A026",
+"f+	c #CB9C3F",
+"g+	c #F7A02B",
+"h+	c #CC9D3F",
+"i+	c #F8A128",
+"j+	c #CA9B3E",
+"k+	c #F8A12D",
+"l+	c #CC9D3D",
+"m+	c #CC8B2E",
+"n+	c #D7AB45",
+"o+	c #29553E",
+"p+	c #12211B",
+"q+	c #29A67A",
+"r+	c #C89233",
+"s+	c #EEA023",
+"t+	c #CA912E",
+"u+	c #C79939",
+"v+	c #EAA11D",
+"w+	c #CC8B28",
+"x+	c #F5A027",
+"y+	c #C99B3B",
+"z+	c #F2A025",
+"A+	c #C89738",
+"B+	c #C79D39",
+"C+	c #C18B33",
+"D+	c #D0922E",
+"E+	c #6D4234",
+"F+	c #D65F08",
+"G+	c #F0A024",
+"H+	c #C89C3B",
+"I+	c #C99437",
+"J+	c #C99A3A",
+"K+	c #F5A023",
+"L+	c #C69A3B",
+"M+	c #CC8C23",
+"N+	c #8C914A",
+"O+	c #15251D",
+"P+	c #1E4E3B",
+"Q+	c #49D494",
+"R+	c #1AD59C",
+"S+	c #C99537",
+"T+	c #EEA120",
+"U+	c #E9A01D",
+"V+	c #CA9028",
+"W+	c #E7A016",
+"X+	c #CD851B",
+"Y+	c #C79537",
+"Z+	c #EDA21B",
+"`+	c #CA9130",
+" @	c #C69836",
+".@	c #C4862A",
+"+@	c #E49E20",
+"@@	c #944117",
+"#@	c #D68F2C",
+"$@	c #C69A3C",
+"%@	c #EBA01D",
+"&@	c #ECA11F",
+"*@	c #CB8D2C",
+"=@	c #EEA11B",
+"-@	c #C89331",
+";@	c #EFA225",
+">@	c #CE8619",
+",@	c #5B7141",
+"'@	c #0D1714",
+")@	c #258B66",
+"!@	c #23DCA0",
+"~@	c #20CA94",
+"{@	c #1AD59B",
+"]@	c #0D110C",
+"^@	c #CA9027",
+"/@	c #E8A11C",
+"(@	c #D08315",
+"_@	c #E5A014",
+":@	c #CF8616",
+"<@	c #DE9F1C",
+"[@	c #CF7E0B",
+"}@	c #CB8D29",
+"|@	c #E9A017",
+"1@	c #CB8F27",
+"2@	c #CA912A",
+"3@	c #C58022",
+"4@	c #E5A11E",
+"5@	c #69676A",
+"6@	c #54494A",
+"7@	c #AC3C00",
+"8@	c #E49E23",
+"9@	c #C69631",
+"0@	c #E7A116",
+"a@	c #CE841C",
+"b@	c #CA902A",
+"c@	c #D19E2D",
+"d@	c #293E2B",
+"e@	c #172F24",
+"f@	c #26C28E",
+"g@	c #19D59B",
+"h@	c #18C691",
+"i@	c #14CA94",
+"j@	c #0E110C",
+"k@	c #CE871A",
+"l@	c #E8A111",
+"m@	c #D27B00",
+"n@	c #DB9E1E",
+"o@	c #CF8106",
+"p@	c #D39C24",
+"q@	c #CF7900",
+"r@	c #E7A11B",
+"s@	c #D08516",
+"t@	c #E4A014",
+"u@	c #CE881B",
+"v@	c #CE820D",
+"w@	c #E7A010",
+"x@	c #CC8819",
+"y@	c #D99F19",
+"z@	c #C67C15",
+"A@	c #E5A11A",
+"B@	c #9D320B",
+"C@	c #C07324",
+"D@	c #BE5000",
+"E@	c #D79F20",
+"F@	c #CD8312",
+"G@	c #DC9F17",
+"H@	c #CF7400",
+"I@	c #E7A011",
+"J@	c #CC881A",
+"K@	c #D99F1A",
+"L@	c #985F12",
+"M@	c #111A15",
+"N@	c #23654C",
+"O@	c #31DB9B",
+"P@	c #24CF97",
+"Q@	c #19C791",
+"R@	c #20CF98",
+"S@	c #0C100B",
+"T@	c #A86A11",
+"U@	c #745519",
+"V@	c #64481F",
+"W@	c #C49327",
+"X@	c #D17A00",
+"Y@	c #CA9927",
+"Z@	c #CE7400",
+"`@	c #D99F22",
+" #	c #D07D00",
+".#	c #D0810E",
+"+#	c #DAA01F",
+"@#	c #CF800C",
+"##	c #CE9C28",
+"$#	c #C8770F",
+"%#	c #D29D26",
+"&#	c #B94300",
+"*#	c #CC9C2A",
+"=#	c #C86500",
+"-#	c #CB9B22",
+";#	c #CE7A00",
+">#	c #D19C23",
+",#	c #C76901",
+"'#	c #DB9F1F",
+")#	c #DB9E1F",
+"!#	c #CF800D",
+"~#	c #9A7523",
+"{#	c #25180B",
+"]#	c #25A177",
+"^#	c #2FE1A2",
+"/#	c #16D49A",
+"(#	c #1AD99C",
+"_#	c #1DD198",
+":#	c #1AD69C",
+"<#	c #0B120E",
+"[#	c #83BA71",
+"}#	c #74A160",
+"|#	c #3F5A3B",
+"1#	c #846D2B",
+"2#	c #58350E",
+"3#	c #8E6921",
+"4#	c #CC7000",
+"5#	c #D49C27",
+"6#	c #D47800",
+"7#	c #D09C28",
+"8#	c #D17800",
+"9#	c #D29D27",
+"0#	c #D37800",
+"a#	c #D39C26",
+"b#	c #CD9928",
+"c#	c #C57208",
+"d#	c #CC9A2E",
+"e#	c #C15500",
+"f#	c #CC9C2F",
+"g#	c #CF7800",
+"h#	c #CF8800",
+"i#	c #CE7600",
+"j#	c #C99927",
+"k#	c #C36601",
+"l#	c #D39C27",
+"m#	c #987223",
+"n#	c #311F0B",
+"o#	c #14DC9F",
+"p#	c #1DCE97",
+"q#	c #1BC892",
+"r#	c #17CC95",
+"s#	c #1BD097",
+"t#	c #0A120E",
+"u#	c #1AE4A6",
+"v#	c #1BE4A6",
+"w#	c #62B779",
+"x#	c #577A4C",
+"y#	c #4D3212",
+"z#	c #806324",
+"A#	c #CE7100",
+"B#	c #CE9C2D",
+"C#	c #D07700",
+"D#	c #CB9524",
+"E#	c #CE7200",
+"F#	c #CD9B2C",
+"G#	c #D17600",
+"H#	c #CB9729",
+"I#	c #C46F05",
+"J#	c #C8992F",
+"K#	c #CC6E00",
+"L#	c #C99A30",
+"M#	c #CF7200",
+"N#	c #CA972E",
+"O#	c #C86D00",
+"P#	c #CB9122",
+"Q#	c #C36600",
+"R#	c #CD9B2D",
+"S#	c #987123",
+"T#	c #241808",
+"U#	c #22D89E",
+"V#	c #18DA9F",
+"W#	c #14D89E",
+"X#	c #1AE3A5",
+"Y#	c #41D899",
+"Z#	c #3D7853",
+"`#	c #885010",
+" $	c #937128",
+".$	c #CE7300",
+"+$	c #CB9126",
+"@$	c #CD6F00",
+"#$	c #CA9A2E",
+"$$	c #CC7200",
+"%$	c #CC9022",
+"&$	c #C36B07",
+"*$	c #C9922B",
+"=$	c #CB6F00",
+"-$	c #C7962F",
+";$	c #CB7100",
+">$	c #CB912C",
+",$	c #CA6F00",
+"'$	c #C98F26",
+")$	c #50532F",
+"!$	c #896924",
+"~$	c #CA9B2E",
+"{$	c #CD7200",
+"]$	c #4C2C0E",
+"^$	c #173125",
+"/$	c #17BD8B",
+"($	c #1BC792",
+"_$	c #0C100A",
+":$	c #8F8B46",
+"<$	c #6CB878",
+"[$	c #31E2A3",
+"}$	c #62CB8A",
+"|$	c #686433",
+"1$	c #91530E",
+"2$	c #CB6D00",
+"3$	c #C99630",
+"4$	c #CC8E27",
+"5$	c #C26C06",
+"6$	c #C9902D",
+"7$	c #C76C00",
+"8$	c #C79230",
+"9$	c #C97000",
+"0$	c #CB8C28",
+"a$	c #C96D00",
+"b$	c #67814D",
+"c$	c #25B080",
+"d$	c #140F07",
+"e$	c #A86813",
+"f$	c #C9902A",
+"g$	c #1F5540",
+"h$	c #152D23",
+"i$	c #22C991",
+"j$	c #17CB95",
+"k$	c #1EDCA1",
+"l$	c #21D39A",
+"m$	c #1EC993",
+"n$	c #0D100B",
+"o$	c #9E5A07",
+"p$	c #97641D",
+"q$	c #855419",
+"r$	c #889A57",
+"s$	c #4EDB99",
+"t$	c #40DC9D",
+"u$	c #6A5A29",
+"v$	c #8C5C1B",
+"w$	c #C96E00",
+"x$	c #C9902C",
+"y$	c #CE8620",
+"z$	c #C06B0E",
+"A$	c #CA8D2E",
+"B$	c #C76C01",
+"C$	c #C98C2D",
+"D$	c #C86D08",
+"E$	c #7C6730",
+"F$	c #24E2A4",
+"G$	c #606336",
+"H$	c #212317",
+"I$	c #BE8D31",
+"J$	c #C76E03",
+"K$	c #C28023",
+"L$	c #C86D02",
+"M$	c #798C4F",
+"N$	c #276249",
+"O$	c #13261E",
+"P$	c #1CC892",
+"Q$	c #28D198",
+"R$	c #20D89E",
+"S$	c #C66F0D",
+"T$	c #CD831E",
+"U$	c #91500F",
+"V$	c #A16D26",
+"W$	c #9C641F",
+"X$	c #62C887",
+"Y$	c #52D695",
+"Z$	c #AC7928",
+"`$	c #C56A00",
+" %	c #C88D2A",
+".%	c #C76E08",
+"+%	c #BC670D",
+"@%	c #CB882B",
+"#%	c #C46A07",
+"$%	c #C88C2F",
+"%%	c #C46B08",
+"&%	c #704B1D",
+"*%	c #4EB17B",
+"=%	c #64D792",
+"-%	c #224230",
+";%	c #473D1F",
+">%	c #BE660A",
+",%	c #C07A22",
+"'%	c #C87713",
+")%	c #976221",
+"!%	c #C78126",
+"~%	c #2E664A",
+"{%	c #2AC590",
+"]%	c #0D110B",
+"^%	c #C56D0A",
+"/%	c #CD8220",
+"(%	c #C4670F",
+"_%	c #C9862C",
+":%	c #905115",
+"<%	c #885D25",
+"[%	c #48DC9B",
+"}%	c #809F5E",
+"|%	c #8A4C0F",
+"1%	c #CA872B",
+"2%	c #C56C04",
+"3%	c #CD7F1F",
+"4%	c #B96512",
+"5%	c #CB842C",
+"6%	c #C16708",
+"7%	c #CA852F",
+"8%	c #C36910",
+"9%	c #4C371B",
+"0%	c #22E2A4",
+"a%	c #39E0A0",
+"b%	c #52C98B",
+"c%	c #18140C",
+"d%	c #44270E",
+"e%	c #CD8123",
+"f%	c #C9761B",
+"g%	c #CB8226",
+"h%	c #CB8022",
+"i%	c #C58B37",
+"j%	c #3E6A49",
+"k%	c #101D17",
+"l%	c #26C28D",
+"m%	c #0F100B",
+"n%	c #C26A0B",
+"o%	c #CD7B20",
+"p%	c #C06714",
+"q%	c #CB822E",
+"r%	c #C16912",
+"s%	c #CA7926",
+"t%	c #919E5A",
+"u%	c #53C085",
+"v%	c #603612",
+"w%	c #C1690E",
+"x%	c #CE7C21",
+"y%	c #B96519",
+"z%	c #CA7F2B",
+"A%	c #BF6613",
+"B%	c #C06912",
+"C%	c #8E662D",
+"D%	c #8C6B33",
+"E%	c #5B3513",
+"F%	c #CB802F",
+"G%	c #BE650E",
+"H%	c #CB822D",
+"I%	c #BF6811",
+"J%	c #CC802F",
+"K%	c #BC6618",
+"L%	c #526C46",
+"M%	c #0F1813",
+"N%	c #26BA89",
+"O%	c #0E0F0B",
+"P%	c #BE640D",
+"Q%	c #CB7F31",
+"R%	c #BD6418",
+"S%	c #CC7D2E",
+"T%	c #BF681B",
+"U%	c #C9792D",
+"V%	c #5D764A",
+"W%	c #50CD90",
+"X%	c #764112",
+"Y%	c #CA812C",
+"Z%	c #CA7A26",
+"`%	c #B8631A",
+" &	c #CC7E31",
+".&	c #BD6619",
+"+&	c #CB7E30",
+"@&	c #C1681B",
+"#&	c #8F5A27",
+"$&	c #43DA9B",
+"%&	c #819257",
+"&&	c #5A3414",
+"*&	c #CB7D30",
+"=&	c #BF6619",
+"-&	c #BE6719",
+";&	c #CD7C30",
+">&	c #B9631B",
+",&	c #CA7B31",
+"'&	c #635D35",
+")&	c #26A97C",
+"!&	c #0E0F0A",
+"~&	c #BA6215",
+"{&	c #CA7C31",
+"]&	c #BB621B",
+"^&	c #CA7A32",
+"/&	c #BD671E",
+"(&	c #BD702D",
+"_&	c #5AA671",
+":&	c #61B47B",
+"<&	c #6C3D16",
+"[&	c #CA7C2C",
+"}&	c #BF681A",
+"|&	c #C8782C",
+"1&	c #B5621E",
+"2&	c #CA7A30",
+"3&	c #BC631C",
+"4&	c #C97B33",
+"5&	c #9A5D29",
+"6&	c #668C5A",
+"7&	c #48D99B",
+"8&	c #6F5B2F",
+"9&	c #4D311A",
+"0&	c #BC6319",
+"a&	c #BD651E",
+"b&	c #B8601E",
+"c&	c #C97936",
+"d&	c #B9621F",
+"e&	c #7A5E35",
+"f&	c #101B15",
+"g&	c #0D0E09",
+"h&	c #BA621B",
+"i&	c #C77A38",
+"j&	c #BA621D",
+"k&	c #C87938",
+"l&	c #BB651F",
+"m&	c #848853",
+"n&	c #7E7947",
+"o&	c #301D0F",
+"p&	c #CA7A33",
+"q&	c #BF681D",
+"r&	c #C77830",
+"s&	c #B46122",
+"t&	c #BA621E",
+"u&	c #C97938",
+"v&	c #BB6521",
+"w&	c #4E321B",
+"x&	c #5B3A1B",
+"y&	c #66D493",
+"z&	c #3EDF9F",
+"A&	c #35DFA1",
+"B&	c #878850",
+"C&	c #6E3D17",
+"D&	c #B06B32",
+"E&	c #BA641F",
+"F&	c #B96122",
+"G&	c #C5773C",
+"H&	c #B95F23",
+"I&	c #C7783B",
+"J&	c #A26226",
+"K&	c #2B2719",
+"L&	c #B7601D",
+"M&	c #B95F21",
+"N&	c #8D592F",
+"O&	c #4A845B",
+"P&	c #84B775",
+"Q&	c #B1692F",
+"R&	c #904E1B",
+"S&	c #C97A39",
+"T&	c #BC6620",
+"U&	c #C57434",
+"V&	c #B26023",
+"W&	c #BA6024",
+"X&	c #C8793C",
+"Y&	c #BA6225",
+"Z&	c #C5753B",
+"`&	c #B96224",
+" *	c #795933",
+".*	c #56CB8E",
+"+*	c #24E2A5",
+"@*	c #24E3A5",
+"#*	c #51B580",
+"$*	c #436345",
+"%*	c #2D2114",
+"&*	c #8B542E",
+"**	c #A25524",
+"=*	c #C5773E",
+"-*	c #B85F25",
+";*	c #C67540",
+">*	c #C37138",
+",*	c #88471C",
+"'*	c #6F5434",
+")*	c #517954",
+"!*	c #43C68E",
+"~*	c #82BF7F",
+"{*	c #462B16",
+"]*	c #6C4125",
+"^*	c #BA6125",
+"/*	c #C7783D",
+"(*	c #BA6323",
+"_*	c #C27037",
+":*	c #B15F26",
+"<*	c #C6753E",
+"[*	c #B75E24",
+"}*	c #C57740",
+"|*	c #B96229",
+"1*	c #C6733E",
+"2*	c #B86126",
+"3*	c #50321F",
+"4*	c #603C1E",
+"5*	c #93BC7C",
+"6*	c #56C18A",
+"7*	c #679D6A",
+"8*	c #5F9265",
+"9*	c #757F51",
+"0*	c #768559",
+"a*	c #569466",
+"b*	c #569F70",
+"c*	c #49BE88",
+"d*	c #3BDFA1",
+"e*	c #808954",
+"f*	c #744629",
+"g*	c #583219",
+"h*	c #C3713C",
+"i*	c #C77640",
+"j*	c #B86329",
+"k*	c #C36F3C",
+"l*	c #B15B29",
+"m*	c #C77243",
+"n*	c #B65C29",
+"o*	c #C87343",
+"p*	c #B9602C",
+"q*	c #C37042",
+"r*	c #B75C2A",
+"s*	c #C97446",
+"t*	c #B65928",
+"u*	c #653F27",
+"v*	c #816439",
+"w*	c #6DAE7A",
+"x*	c #40DDA0",
+"y*	c #7E9E67",
+"z*	c #6F5132",
+"A*	c #502B18",
+"B*	c #4E2F1E",
+"C*	c #B85F2C",
+"D*	c #C36D41",
+"E*	c #B55B28",
+"F*	c #C57141",
+"G*	c #B7612C",
+"H*	c #C26C40",
+"I*	c #AE5B2B",
+"J*	c #C57145",
+"K*	c #B65C2D",
+"L*	c #C77146",
+"M*	c #B85E2F",
+"N*	c #C56F46",
+"O*	c #B65C2E",
+"P*	c #C87247",
+"Q*	c #B4582B",
+"R*	c #A8633F",
+"S*	c #A35227",
+"T*	c #42291D",
+"U*	c #413220",
+"V*	c #9E9E68",
+"W*	c #70B57C",
+"X*	c #55D597",
+"Y*	c #87B880",
+"Z*	c #7D754A",
+"`*	c #6F4730",
+" =	c #8E4725",
+".=	c #915335",
+"+=	c #B75A2D",
+"@=	c #B76130",
+"#=	c #C16A42",
+"$=	c #B55B2D",
+"%=	c #C67246",
+"&=	c #B75F2D",
+"*=	c #C16C43",
+"==	c #AF582F",
+"-=	c #C6714B",
+";=	c #B3592D",
+">=	c #C66E4A",
+",=	c #B65C31",
+"'=	c #C46D49",
+")=	c #B45A2E",
+"!=	c #C7724C",
+"~=	c #B4582D",
+"{=	c #CA744C",
+"]=	c #B45A30",
+"^=	c #C46F49",
+"/=	c #B95F32",
+"(=	c #9F5C3D",
+"_=	c #562D1B",
+":=	c #A66040",
+"<=	c #8A5934",
+"[=	c #8E7C53",
+"}=	c #8E8C5A",
+"|=	c #637955",
+"1=	c #8A915E",
+"2=	c #929364",
+"3=	c #7F8555",
+"4=	c #5D7452",
+"5=	c #6D5A37",
+"6=	c #543A2A",
+"7=	c #964B2A",
+"8=	c #A95F40",
+"9=	c #57301D",
+"0=	c #6D3E2B",
+"a=	c #A3502E",
+"b=	c #B65A2F",
+"c=	c #C5704A",
+"d=	c #B75C30",
+"e=	c #BF6945",
+"f=	c #B35A2D",
+"g=	c #B65C30",
+"h=	c #C06744",
+"i=	c #AF5831",
+"j=	c #C36C48",
+"k=	c #B55932",
+"l=	c #C56E4A",
+"m=	c #B65A33",
+"n=	c #C26A48",
+"o=	c #B55934",
+"p=	c #C36C47",
+"q=	c #B1562F",
+"r=	c #C8734D",
+"s=	c #B35732",
+"t=	c #C36A48",
+"u=	c #B75D35",
+"v=	c #935438",
+"w=	c #6C3822",
+"x=	c #73402E",
+"y=	c #884427",
+"z=	c #935237",
+"A=	c #A14F2D",
+"B=	c #98583C",
+"C=	c #743D24",
+"D=	c #9A5238",
+"E=	c #8B4629",
+"F=	c #5F3526",
+"G=	c #994E2D",
+"H=	c #C06645",
+"I=	c #C36C4A",
+"J=	c #B75B34",
+"K=	c #C16B46",
+"L=	c #B45831",
+"M=	c #C26C49",
+"N=	c #B75B33",
+"O=	c #C16646",
+"P=	c #C36D4A",
+"Q=	c #B45B34",
+"R=	c #BF6545",
+"S=	c #AD5731",
+"T=	c #B45933",
+"U=	c #B45833",
+"V=	c #B65A35",
+"W=	c #B45935",
+"X=	c #B55835",
+"Y=	c #B25431",
+"Z=	c #B75B36",
+"`=	c #B15631",
+" -	c #B75B35",
+".-	c #B15432",
+"+-	c #B35832",
+"@-	c #B55A34",
+"#-	c #B35833",
+"$-	c #B35531",
+"%-	c #B35332",
+"&-	c #B75D36",
+"*-	c #B25531",
+"=-	c #B65A34",
+"--	c #B15430",
+";-	c #B45835",
+">-	c #B25732",
+",-	c #B55933",
+"'-	c #B35632",
+")-	c #B05937",
+"!-	c #AF5030",
+"~-	c #B15231",
+"{-	c #B25532",
+"]-	c #B35533",
+"^-	c #B15233",
+"/-	c #AF4E31",
+"(-	c #B35834",
+"_-	c #B04F30",
+":-	c #B25734",
+"<-	c #AF502D",
+"[-	c #B25533",
+"}-	c #B05331",
+"|-	c #B15433",
+"1-	c #B25534",
+"2-	c #B05532",
+"3-	c #B04F32",
+"4-	c #B04F31",
+"5-	c #B25731",
+"6-	c #B35434",
+"7-	c #B25232",
+"8-	c #B05333",
+"9-	c #A95031",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                            . +                 ",
+"                                                                          @ #       $           ",
+"                                    %                                     & *       = -         ",
+"                                    ;       >                         , ' ) !       ~ {         ",
+"                                    ]       ^ /                     , ( _ : <       [ }         ",
+"                                  | <       1 2                   3 4 3 5 6 7   ,   8 9         ",
+"                                  0 7       a b                 c 3 d 5 _ e f g     h i         ",
+"                                  j 7 , k l m n                 o p q r s t 7 u v   w x         ",
+"                            y @   z f   A B C D         E   F   G H I p J K f L M   N O         ",
+"                    P     Q R     S T , U V W X         Y   Z   `  ...+.f @.f #.$.  %.&.        ",
+"                *., =.  -.;...+   >.f ,.'.).!.~.        {.u ].  ^./.f (._.:.f <.^.  [.}.        ",
+"                |.1.].+ ^.2.3.4.f 5.f 6.^.7.8.9.        0.a.b.  7 c.7 d.7 e.f.g.h.  i.j.        ",
+"                k.l.m.E n.o.7 p.7 c.7 q.3.r.i.s.t.  u.v.w.x.y.z.A.B.C.D.A.E.F.G.H.I.J.K.        ",
+"        L.      M.N.O.P.A.Q.R.S.A.T.A.U.H.V.t.G.W.X.Y.Z.`. +.+++ at +#+t.$+t.%+t.&+*+=+-+;+        ",
+"        >+      ,+'+)+!+t.V.H.~+O.r.t.&+t.{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+ at +5+]+6+7+8+9+0+        ",
+"        a+b+    c+d+e+f+g+5+3+h+i+j+k+l+7+m+n+o+p+q+_+r+s+t+1+u+v+w+x+y+z+{+e+A+<+B+1+C+        ",
+"        D+    E+F+l+G+H+x+I+}+J+K+L+z+M+v+N+O+P+Q+R+_+S+T+M+U+V+W+X+T+Y+Z+I+T+`+1+ @Z+.@        ",
+"        +@    @@#@$@%@A+&@*@s+`+=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@U+}@|@1@/@M+v+2 at W+3@        ",
+"        4 at 5@6 at 7@8 at 9@0 at a@v+b at v+b@W+X+c at d@e at f@g at h@i at g@j at k@l at m@n at o@p at q@r at s@t at u@l at v@w at x@y at z@        ",
+"        A at B@C at D@E at F@G at H@I at J@l at J@K at L@M at N@O at P@Q at Q@R@{@S at T@U at V@W at X@Y at Z@`@ #E at .#+#m at n@@###$#        ",
+"        %#&#*#=#-#;#>#,#'#@#)#!#~#{#]#^#/#Q@(#_#g@:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#X at b#c#        ",
+"        d#e#f#g#h#i#j#k#l#X at l#X at m#n#o#p#q#r#s#q#g at g@t#u#u#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#        ",
+"        J#K#L#M#N#O#P#Q#R#G#F#G#S#T#U#q#i at V#i at s#W#R+t#u#u#X#u#u#u#Y#Z#`# $.$+$@$#$$$%$&$        ",
+"        *$=$-$;$>$,$'$)$!$$$~${$%$]$^$/$($p#q#($r#R+_$:$<$[$v#u#v#u#u#}$|$1$M+2$3$$$4$5$        ",
+"        6$7$8$9$0$a$b$c$d$e$3$$$f$O#g$h$i$j$k$l$m$g at n$o$p$q$r$s$u#u#u#X#t$u$v$w$x$9$y$z$        ",
+"        A$B$C$D$A$E$F$u#G$H$I$J$K$L$M$N$O$P$Q$R$m$R+_$S$T$U$V$W$X$u#v#u#v#Y$Z$`$ %.%T$+%        ",
+"        @%#%$%%%&%*%u#X#=%-%;%>%,%'%)%!%~%p+{%R at m$g@]%^%/%(%_%:%<%[%u#v#X#u#}%|%1%2%3%4%        ",
+"        5%6%7%8%9%0%u#v#a%b%c%d%e%f%g%h%i%j%k%l%/#g at m%n%o%p%q%r%s%t%v#u#u#X#u%v%_%w%x%y%        ",
+"        z%A%q%B%C%u#v#v#u#X#D%E%F%G%H%I%J%K%L%M%N%{@O%P%Q%R%S%T%U%V%u#v#u#u#W%X%Y%r%Z%`%        ",
+"         &.&+&@&#&$&u#u#X#u#%&&&*&=&+&-&;&>&,&'&M%)&!&~&{&]&^&/&(&_&u#u#v#u#:&<&[&}&|&1&        ",
+"        2&3&4&/&5&6&u#v#F$X#7&8&9&0&^&a&^&b&c&d&e&f&g&h&i&j&k&l&m&u#u#u#v#u#n&o&p&q&r&s&        ",
+"        k&t&u&v&w&x&y&u#z&v#z&A&B&C&D&E&u&F&G&H&I&J&K&L&I&M&N&O&X#v#v#u#u#P&Q&R&S&T&U&V&        ",
+"        I&W&X&Y&Z&`& *.*+*u#@*v#u##*$*%*&***=*-*;*F&>*,*'*)*!*X#v#X#u#X#~*{*]*^*/*(*_*:*        ",
+"        <*[*}*|*1*2*3*4*5*u#v#u#v#v#X#A&6*7*8*9*0*a*b*c*v#u#v#v#u#u#d*e*f*g*h*-*i*j*k*l*        ",
+"        m*n*o*p*q*r*s*t*u*v*w*@*u#u#u#u#X#u#u#u#u#u#v#u#v#v#u#v#x*y*z*A*B*C*D*E*F*G*H*I*        ",
+"        J*K*L*M*N*O*P*Q*R*S*T*U*V*W*x*X#u#u#v#u#X#u#u#u#v#X*Y*Z*`* =.=+=L*@=#=$=%=&=*===        ",
+"        -=;=>=,='=)=!=~={=]=^=/=(=_=:=<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=^=b=c=d=e=f=c=g=h=i=        ",
+"        j=k=l=m=n=o=p=q=r=s=t=u='=m=v=w=x=y=z=A=B=C=D=E=F=G=H=m=I=J=K=L=M=N=O=L=P=Q=R=S=        ",
+"        T=U=V=W=X=U=V=Y=Z=`=T= -.-T=T=+-U=@-#-$-V=`= -V=%-&-*-o==---;-T=>-=-,-'-o==-*-)-        ",
+"        !-~-{-]-^-.-.-/-(-_---:-<-[-}-^-.-|-1-}-2-3-:-{-4-5-!-[-.-4-[-6-7-8-.-^-.-.-3-9-        ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/organ_org.xpm b/images/MusicalInstruments/organ_org.xpm
new file mode 100644
index 0000000..b3682cf
--- /dev/null
+++ b/images/MusicalInstruments/organ_org.xpm
@@ -0,0 +1,913 @@
+/* XPM */
+static char * organ_org_xpm[] = {
+"48 48 862 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #4C5068",
+"@ 	c #57577F",
+"# 	c #4D4F77",
+"$ 	c #474870",
+"% 	c #45456B",
+"& 	c #47476E",
+"* 	c #46486A",
+"= 	c #53526C",
+"- 	c #434265",
+"; 	c #434365",
+"> 	c #464665",
+", 	c #484567",
+"' 	c #444366",
+") 	c #424365",
+"! 	c #454667",
+"~ 	c #444566",
+"{ 	c #464D67",
+"] 	c #535579",
+"^ 	c #5A5A91",
+"/ 	c #505083",
+"( 	c #434572",
+"_ 	c #40416A",
+": 	c #3F3F6C",
+"< 	c #3C3F67",
+"[ 	c #44466D",
+"} 	c #44466E",
+"| 	c #43456E",
+"1 	c #46476F",
+"2 	c #3F4067",
+"3 	c #43426D",
+"4 	c #42416C",
+"5 	c #45456F",
+"6 	c #484775",
+"7 	c #4B4C7E",
+"8 	c #4C517D",
+"9 	c #52537D",
+"0 	c #4C4D82",
+"a 	c #464573",
+"b 	c #2A283D",
+"c 	c #1F1F31",
+"d 	c #202135",
+"e 	c #161828",
+"f 	c #2C314E",
+"g 	c #313654",
+"h 	c #303453",
+"i 	c #353758",
+"j 	c #161723",
+"k 	c #2B2E49",
+"l 	c #303152",
+"m 	c #37385A",
+"n 	c #3E406A",
+"o 	c #494B7C",
+"p 	c #4C5180",
+"q 	c #51507E",
+"r 	c #4C4A7E",
+"s 	c #444473",
+"t 	c #252435",
+"u 	c #1A1A29",
+"v 	c #212337",
+"w 	c #141420",
+"x 	c #0A0A10",
+"y 	c #13141F",
+"z 	c #151520",
+"A 	c #101015",
+"B 	c #13141C",
+"C 	c #0D0E14",
+"D 	c #1E1F33",
+"E 	c #212135",
+"F 	c #323456",
+"G 	c #4A5082",
+"H 	c #4E5182",
+"I 	c #69686D",
+"J 	c #51464C",
+"K 	c #55393E",
+"L 	c #56393D",
+"M 	c #5B3A3D",
+"N 	c #5C3B3E",
+"O 	c #5E3B3E",
+"P 	c #5F3B3E",
+"Q 	c #603A3C",
+"R 	c #5D414A",
+"S 	c #50507F",
+"T 	c #4B4878",
+"U 	c #43446D",
+"V 	c #2E2F48",
+"W 	c #2A2C46",
+"X 	c #202137",
+"Y 	c #22243B",
+"Z 	c #1F1F33",
+"` 	c #24233A",
+" .	c #26263D",
+"..	c #25253A",
+"+.	c #1F2032",
+"@.	c #202034",
+"#.	c #2C2F4B",
+"$.	c #323254",
+"%.	c #3A3B61",
+"&.	c #4D5082",
+"*.	c #525890",
+"=.	c #4A4A65",
+"-.	c #5B5055",
+";.	c #503C45",
+">.	c #4D3D45",
+",.	c #696166",
+"'.	c #787376",
+").	c #594F55",
+"!.	c #473B44",
+"~.	c #4B3D44",
+"{.	c #502E33",
+"].	c #761F1E",
+"^.	c #6C1C1D",
+"/.	c #671819",
+"(.	c #711A1A",
+"_.	c #771B1A",
+":.	c #801C1B",
+"<.	c #861D1B",
+"[.	c #8A1F1C",
+"}.	c #8E1C18",
+"|.	c #6F394B",
+"1.	c #484B79",
+"2.	c #484570",
+"3.	c #44456D",
+"4.	c #42446C",
+"5.	c #3E416A",
+"6.	c #3C406A",
+"7.	c #3F426A",
+"8.	c #41466D",
+"9.	c #3F446B",
+"0.	c #3F4066",
+"a.	c #3E4066",
+"b.	c #404168",
+"c.	c #40426A",
+"d.	c #41436A",
+"e.	c #40416C",
+"f.	c #454675",
+"g.	c #4A5289",
+"h.	c #675480",
+"i.	c #902221",
+"j.	c #8E1F1B",
+"k.	c #831D1A",
+"l.	c #841D1B",
+"m.	c #7E1C1B",
+"n.	c #731A19",
+"o.	c #681616",
+"p.	c #681716",
+"q.	c #6F1F1E",
+"r.	c #592526",
+"s.	c #34333C",
+"t.	c #1D0C11",
+"u.	c #32151C",
+"v.	c #361A20",
+"w.	c #37181D",
+"x.	c #38161B",
+"y.	c #38171A",
+"z.	c #3D1619",
+"A.	c #3F1619",
+"B.	c #3E161A",
+"C.	c #3D1414",
+"D.	c #403148",
+"E.	c #494775",
+"F.	c #47426A",
+"G.	c #43436A",
+"H.	c #3F4269",
+"I.	c #3E3F67",
+"J.	c #3A3E64",
+"K.	c #3C3E64",
+"L.	c #3E4166",
+"M.	c #3E4367",
+"N.	c #3C3D62",
+"O.	c #3D3F64",
+"P.	c #404269",
+"Q.	c #44446F",
+"R.	c #41436B",
+"S.	c #464874",
+"T.	c #4C5385",
+"U.	c #555786",
+"V.	c #571E22",
+"W.	c #541B1A",
+"X.	c #581F21",
+"Y.	c #4F1A1D",
+"Z.	c #511F22",
+"`.	c #471A1D",
+" +	c #481C20",
+".+	c #411A1E",
+"++	c #441C21",
+"@+	c #391619",
+"#+	c #261D21",
+"$+	c #1E1B22",
+"%+	c #03060A",
+"&+	c #000002",
+"*+	c #000103",
+"=+	c #000000",
+"-+	c #22253A",
+";+	c #4C4B75",
+">+	c #454267",
+",+	c #423F64",
+"'+	c #3D3D61",
+")+	c #3A3B5E",
+"!+	c #3A3C5F",
+"~+	c #3B3C60",
+"{+	c #393C5E",
+"]+	c #383C5E",
+"^+	c #3A3C61",
+"/+	c #393C61",
+"(+	c #393E62",
+"_+	c #393F65",
+":+	c #3A3E65",
+"<+	c #3E4064",
+"[+	c #3E426B",
+"}+	c #40426D",
+"|+	c #434778",
+"1+	c #424D7A",
+"2+	c #00050A",
+"3+	c #000102",
+"4+	c #000101",
+"5+	c #000203",
+"6+	c #000303",
+"7+	c #000204",
+"8+	c #05090A",
+"9+	c #101114",
+"0+	c #313840",
+"a+	c #1F141B",
+"b+	c #151317",
+"c+	c #18181E",
+"d+	c #18191D",
+"e+	c #17191B",
+"f+	c #18191B",
+"g+	c #17171B",
+"h+	c #161619",
+"i+	c #171619",
+"j+	c #37374A",
+"k+	c #565778",
+"l+	c #52506E",
+"m+	c #4F4B6A",
+"n+	c #4C4865",
+"o+	c #474361",
+"p+	c #474564",
+"q+	c #494562",
+"r+	c #48445D",
+"s+	c #474460",
+"t+	c #494865",
+"u+	c #454764",
+"v+	c #444763",
+"w+	c #464A68",
+"x+	c #474867",
+"y+	c #484667",
+"z+	c #494769",
+"A+	c #49486F",
+"B+	c #494975",
+"C+	c #494A70",
+"D+	c #0F0E10",
+"E+	c #080808",
+"F+	c #090909",
+"G+	c #090809",
+"H+	c #070607",
+"I+	c #070506",
+"J+	c #060505",
+"K+	c #050505",
+"L+	c #050405",
+"M+	c #020303",
+"N+	c #2F373F",
+"O+	c #757376",
+"P+	c #4D5567",
+"Q+	c #505A6E",
+"R+	c #5D6679",
+"S+	c #5B677A",
+"T+	c #5C687B",
+"U+	c #616A7D",
+"V+	c #626B7D",
+"W+	c #505969",
+"X+	c #4F5A6A",
+"Y+	c #4F5A69",
+"Z+	c #575E72",
+"`+	c #60677D",
+" @	c #5F687B",
+".@	c #63697E",
+"+@	c #666D82",
+"@@	c #5F647C",
+"#@	c #666B84",
+"$@	c #677088",
+"%@	c #6C758C",
+"&@	c #6C748A",
+"*@	c #687487",
+"=@	c #697A8D",
+"-@	c #6C7A8D",
+";@	c #6F7C8E",
+">@	c #6D798B",
+",@	c #6E7A8D",
+"'@	c #69788C",
+")@	c #6A758B",
+"!@	c #717A90",
+"~@	c #728291",
+"{@	c #718A96",
+"]@	c #708B97",
+"^@	c #6E8694",
+"/@	c #69798A",
+"(@	c #667186",
+"_@	c #647082",
+":@	c #5B657B",
+"<@	c #4F5970",
+"[@	c #414A5E",
+"}@	c #545867",
+"|@	c #383B44",
+"1@	c #0E0E11",
+"2@	c #0B0F14",
+"3@	c #46434A",
+"4@	c #47484E",
+"5@	c #404248",
+"6@	c #272D30",
+"7@	c #272A31",
+"8@	c #11171A",
+"9@	c #16181A",
+"0@	c #06090B",
+"a@	c #1D1F22",
+"b@	c #191C21",
+"c@	c #4C4C51",
+"d@	c #545057",
+"e@	c #4A4B51",
+"f@	c #4E4D54",
+"g@	c #57565B",
+"h@	c #282C32",
+"i@	c #0F1821",
+"j@	c #222530",
+"k@	c #29262E",
+"l@	c #26252E",
+"m@	c #272A34",
+"n@	c #202D38",
+"o@	c #1E2C39",
+"p@	c #202A36",
+"q@	c #202937",
+"r@	c #1E2735",
+"s@	c #1F2935",
+"t@	c #222B37",
+"u@	c #242D39",
+"v@	c #27323E",
+"w@	c #293740",
+"x@	c #25343D",
+"y@	c #24303B",
+"z@	c #222C38",
+"A@	c #1D2732",
+"B@	c #2F3B48",
+"C@	c #303C49",
+"D@	c #3B4854",
+"E@	c #262D36",
+"F@	c #292B30",
+"G@	c #241F23",
+"H@	c #373233",
+"I@	c #504A4C",
+"J@	c #797275",
+"K@	c #817B7E",
+"L@	c #767074",
+"M@	c #5E5559",
+"N@	c #4A4148",
+"O@	c #2F242A",
+"P@	c #3A3037",
+"Q@	c #372C31",
+"R@	c #362E34",
+"S@	c #3C3339",
+"T@	c #635E66",
+"U@	c #74717A",
+"V@	c #615D67",
+"W@	c #605D66",
+"X@	c #716D73",
+"Y@	c #413D47",
+"Z@	c #4B444E",
+"`@	c #493F49",
+" #	c #453D48",
+".#	c #49404C",
+"+#	c #43404A",
+"@#	c #403E48",
+"##	c #3B3A43",
+"$#	c #3B3941",
+"%#	c #39373F",
+"&#	c #37363D",
+"*#	c #37353E",
+"=#	c #36353F",
+"-#	c #35353E",
+";#	c #33353D",
+">#	c #31323A",
+",#	c #2D2E37",
+"'#	c #2D2E36",
+")#	c #494B55",
+"!#	c #5D5D66",
+"~#	c #575660",
+"{#	c #585760",
+"]#	c #332E37",
+"^#	c #18171B",
+"/#	c #606166",
+"(#	c #190F0F",
+"_#	c #98A0A1",
+":#	c #DDDCDC",
+"<#	c #E1DCDB",
+"[#	c #B8C2C7",
+"}#	c #BFC9CD",
+"|#	c #D5D5D6",
+"1#	c #D8D6D8",
+"2#	c #CBCCCF",
+"3#	c #DCD4D5",
+"4#	c #C6C7CC",
+"5#	c #BAC0C4",
+"6#	c #C7C9CD",
+"7#	c #DAD2D3",
+"8#	c #C1C3C6",
+"9#	c #D2CED0",
+"0#	c #D4CED0",
+"a#	c #BFC1C5",
+"b#	c #CCCDD1",
+"c#	c #E1DEDE",
+"d#	c #E1DEDF",
+"e#	c #DDDEDF",
+"f#	c #E9E5E4",
+"g#	c #D5DBDC",
+"h#	c #D7DCDE",
+"i#	c #DDDEE0",
+"j#	c #E4E2E2",
+"k#	c #D7D9DA",
+"l#	c #E6E3E2",
+"m#	c #E4E2E3",
+"n#	c #DCDCDF",
+"o#	c #DBDBDD",
+"p#	c #E6E2E2",
+"q#	c #DDDEDD",
+"r#	c #E1E2E1",
+"s#	c #E9E4E3",
+"t#	c #DEE0E0",
+"u#	c #D2D7D8",
+"v#	c #D7D8D8",
+"w#	c #DCDBDC",
+"x#	c #CDD0D3",
+"y#	c #C6CECF",
+"z#	c #DAE1E2",
+"A#	c #5C5A5D",
+"B#	c #1F252A",
+"C#	c #312C30",
+"D#	c #250A09",
+"E#	c #3C3A3E",
+"F#	c #D2D0D5",
+"G#	c #E1D9DB",
+"H#	c #A8A5AA",
+"I#	c #AEA9AE",
+"J#	c #D0C7C9",
+"K#	c #CEC1C4",
+"L#	c #C1B3B6",
+"M#	c #D7C8CE",
+"N#	c #9A93A0",
+"O#	c #958D94",
+"P#	c #A399A0",
+"Q#	c #CBBBC0",
+"R#	c #968D93",
+"S#	c #C5B7BC",
+"T#	c #BAABAF",
+"U#	c #8E8488",
+"V#	c #94878D",
+"W#	c #C5B4B9",
+"X#	c #AE9EA2",
+"Y#	c #9C8F95",
+"Z#	c #D7C6C7",
+"`#	c #92898B",
+" $	c #9A8D91",
+".$	c #A09598",
+"+$	c #C8B7B8",
+"@$	c #96888D",
+"#$	c #B9AAAB",
+"$$	c #C0ADB2",
+"%$	c #988A91",
+"&$	c #998991",
+"*$	c #C4B0B3",
+"=$	c #AD9CA0",
+"-$	c #9E9197",
+";$	c #D3BCC0",
+">$	c #AA9FA5",
+",$	c #97909A",
+"'$	c #95919E",
+")$	c #CEBFC1",
+"!$	c #9F9DA5",
+"~$	c #8C8A97",
+"{$	c #565C69",
+"]$	c #261718",
+"^$	c #241D1D",
+"/$	c #131415",
+"($	c #040303",
+"_$	c #666B69",
+":$	c #DCE9E4",
+"<$	c #D4E4DE",
+"[$	c #D4E2DC",
+"}$	c #D8E3DE",
+"|$	c #D7E4DF",
+"1$	c #D7E3DD",
+"2$	c #D8E4E0",
+"3$	c #DAE5E0",
+"4$	c #D8E4E1",
+"5$	c #D9E4E2",
+"6$	c #D9E5E2",
+"7$	c #D8E2E0",
+"8$	c #DBE4E4",
+"9$	c #D8E1E1",
+"0$	c #DAE4E4",
+"a$	c #DDE8E9",
+"b$	c #DAE5E5",
+"c$	c #D9E4E5",
+"d$	c #DFEAEA",
+"e$	c #DDE7E7",
+"f$	c #E2EBEA",
+"g$	c #E5EDEB",
+"h$	c #E6F0EF",
+"i$	c #E5EBEB",
+"j$	c #EBF0EE",
+"k$	c #EBEFEE",
+"l$	c #E4E9E6",
+"m$	c #E6EBEB",
+"n$	c #EBF1EF",
+"o$	c #EAF0EF",
+"p$	c #E7EDEB",
+"q$	c #ECF4F3",
+"r$	c #EDF3F2",
+"s$	c #EEF2F1",
+"t$	c #EDF2F3",
+"u$	c #F4FAF8",
+"v$	c #F1F8F6",
+"w$	c #F7FAFA",
+"x$	c #9B989D",
+"y$	c #020000",
+"z$	c #121111",
+"A$	c #121213",
+"B$	c #070808",
+"C$	c #0D0F0F",
+"D$	c #141B18",
+"E$	c #131C19",
+"F$	c #121917",
+"G$	c #141A18",
+"H$	c #131817",
+"I$	c #131818",
+"J$	c #141919",
+"K$	c #14191A",
+"L$	c #161C1C",
+"M$	c #161B1B",
+"N$	c #161A1A",
+"O$	c #171B1B",
+"P$	c #141718",
+"Q$	c #141818",
+"R$	c #141A1B",
+"S$	c #151A1C",
+"T$	c #151B1C",
+"U$	c #15191C",
+"V$	c #161B1D",
+"W$	c #14191B",
+"X$	c #161C1D",
+"Y$	c #191F1E",
+"Z$	c #1B2121",
+"`$	c #1A2021",
+" %	c #1D2424",
+".%	c #202828",
+"+%	c #1E2728",
+"@%	c #1D2626",
+"#%	c #1F2929",
+"$%	c #212C2D",
+"%%	c #222D2F",
+"&%	c #243031",
+"*%	c #253131",
+"=%	c #293537",
+"-%	c #2B383A",
+";%	c #313D3D",
+">%	c #354041",
+",%	c #384243",
+"'%	c #3D4749",
+")%	c #2B3134",
+"!%	c #030506",
+"~%	c #0B0E0D",
+"{%	c #1B1416",
+"]%	c #020200",
+"^%	c #0D0F11",
+"/%	c #3F292E",
+"(%	c #282026",
+"_%	c #2B232B",
+":%	c #2A282F",
+"<%	c #1E1D21",
+"[%	c #1A1619",
+"}%	c #301B1F",
+"|%	c #331D21",
+"1%	c #282730",
+"2%	c #29252E",
+"3%	c #29232D",
+"4%	c #28232B",
+"5%	c #28232D",
+"6%	c #28242E",
+"7%	c #27222B",
+"8%	c #25212A",
+"9%	c #24212A",
+"0%	c #20222B",
+"a%	c #331A1F",
+"b%	c #1D1A1E",
+"c%	c #181C21",
+"d%	c #1A1D23",
+"e%	c #1C1B20",
+"f%	c #1F161C",
+"g%	c #241216",
+"h%	c #181217",
+"i%	c #171319",
+"j%	c #171218",
+"k%	c #171318",
+"l%	c #161317",
+"m%	c #141217",
+"n%	c #141318",
+"o%	c #151419",
+"p%	c #16151B",
+"q%	c #16171B",
+"r%	c #231213",
+"s%	c #191013",
+"t%	c #0F0A0C",
+"u%	c #1A171D",
+"v%	c #19181D",
+"w%	c #18171D",
+"x%	c #2A1F24",
+"y%	c #86888B",
+"z%	c #33363F",
+"A%	c #6A4347",
+"B%	c #623F45",
+"C%	c #62464E",
+"D%	c #664249",
+"E%	c #787377",
+"F%	c #4B323A",
+"G%	c #50404B",
+"H%	c #55363D",
+"I%	c #743C3E",
+"J%	c #4A363B",
+"K%	c #31232A",
+"L%	c #28272D",
+"M%	c #373F47",
+"N%	c #744042",
+"O%	c #533D43",
+"P%	c #67454A",
+"Q%	c #694248",
+"R%	c #656066",
+"S%	c #4E444D",
+"T%	c #58383E",
+"U%	c #623B40",
+"V%	c #58383B",
+"W%	c #362A33",
+"X%	c #2E262C",
+"Y%	c #38444E",
+"Z%	c #7C3C3D",
+"`%	c #534249",
+" &	c #6A4449",
+".&	c #6F4448",
+"+&	c #69656B",
+"@&	c #553A42",
+"#&	c #4F3A41",
+"$&	c #673A3E",
+"%&	c #3B2F37",
+"&&	c #33282E",
+"*&	c #404752",
+"=&	c #873837",
+"-&	c #51484F",
+";&	c #6A434A",
+">&	c #6A4349",
+",&	c #878689",
+"'&	c #69646A",
+")&	c #878688",
+"!&	c #563941",
+"~&	c #4F3F49",
+"{&	c #6A3A3A",
+"]&	c #40333B",
+"^&	c #4D3F46",
+"/&	c #5E6066",
+"(&	c #382C33",
+"_&	c #474B55",
+":&	c #943D38",
+"<&	c #6E4549",
+"[&	c #714248",
+"}&	c #4D4650",
+"|&	c #4F454E",
+"1&	c #5C383E",
+"2&	c #4E4750",
+"3&	c #713735",
+"4&	c #463741",
+"5&	c #3C3036",
+"6&	c #33333B",
+"7&	c #41343A",
+"8&	c #4D4B54",
+"9&	c #9C3D37",
+"0&	c #784346",
+"a&	c #6F4247",
+"b&	c #4F464F",
+"c&	c #50474E",
+"d&	c #5D393F",
+"e&	c #868586",
+"f&	c #7C3837",
+"g&	c #4A3E47",
+"h&	c #3D272B",
+"i&	c #322B2F",
+"j&	c #443B43",
+"k&	c #5D4850",
+"l&	c #A23F38",
+"m&	c #744346",
+"n&	c #754146",
+"o&	c #52464E",
+"p&	c #5F393E",
+"q&	c #853A38",
+"r&	c #51454C",
+"s&	c #422529",
+"t&	c #422C31",
+"u&	c #6C4549",
+"v&	c #9C423D",
+"w&	c #6F4145",
+"x&	c #6C4248",
+"y&	c #53464F",
+"z&	c #4E464F",
+"A&	c #5C383F",
+"B&	c #4D3F47",
+"C&	c #893E3E",
+"D&	c #60454A",
+"E&	c #3F282D",
+"F&	c #848586",
+"G&	c #4A2F34",
+"H&	c #7B4544",
+"I&	c #8D4240",
+"J&	c #703E42",
+"K&	c #6B4147",
+"L&	c #55474F",
+"M&	c #4D4851",
+"N&	c #5D3A41",
+"O&	c #543D42",
+"P&	c #824342",
+"Q&	c #684349",
+"R&	c #3C2E34",
+"S&	c #3A373C",
+"T&	c #482F35",
+"U&	c #874442",
+"V&	c #7E3F40",
+"W&	c #6C3E43",
+"X&	c #684147",
+"Y&	c #58474F",
+"Z&	c #5B5860",
+"`&	c #5D3940",
+" *	c #543C41",
+".*	c #704345",
+"+*	c #6F4346",
+"@*	c #40333A",
+"#*	c #372F32",
+"$*	c #858586",
+"%*	c #463339",
+"&*	c #94433E",
+"**	c #6E4042",
+"=*	c #764042",
+"-*	c #614148",
+";*	c #5A474E",
+">*	c #4D4952",
+",*	c #593C44",
+"'*	c #5A3B3F",
+")*	c #594047",
+"!*	c #794241",
+"~*	c #443C44",
+"{*	c #2F272A",
+"]*	c #3A373F",
+"^*	c #4E3B40",
+"/*	c #94403A",
+"(*	c #6A4446",
+"_*	c #714045",
+":*	c #5B464E",
+"<*	c #5B5960",
+"[*	c #593B42",
+"}*	c #5E3D40",
+"|*	c #4E454D",
+"1*	c #7D3C3B",
+"2*	c #42434D",
+"3*	c #3B2524",
+"4*	c #413338",
+"5*	c #814846",
+"6*	c #764547",
+"7*	c #60424A",
+"8*	c #5C474E",
+"9*	c #69686E",
+"0*	c #563F46",
+"a*	c #574347",
+"b*	c #704042",
+"c*	c #464650",
+"d*	c #402424",
+"e*	c #573132",
+"f*	c #878687",
+"g*	c #814746",
+"h*	c #614A4F",
+"i*	c #69696E",
+"j*	c #763C3B",
+"k*	c #4F4952",
+"l*	c #41282A",
+"m*	c #393D43",
+"n*	c #653635",
+"o*	c #924841",
+"p*	c #2E2629",
+"q*	c #2F2D31",
+"r*	c #833B38",
+"s*	c #524B52",
+"t*	c #493033",
+"u*	c #3B3438",
+"v*	c #683835",
+"w*	c #613A3A",
+"x*	c #31373F",
+"y*	c #0C0A0B",
+"z*	c #5E3738",
+"A*	c #878587",
+"B*	c #54383C",
+"C*	c #3A2E30",
+"D*	c #45393C",
+"E*	c #6E3B3A",
+"F*	c #26292E",
+"G*	c #020101",
+"H*	c #080809",
+"I*	c #494F55",
+"J*	c #573F44",
+"K*	c #3C2929",
+"L*	c #503637",
+"M*	c #6D4344",
+"N*	c #212328",
+"O*	c #060507",
+"P*	c #323941",
+"Q*	c #4D464E",
+"R*	c #572A28",
+"S*	c #683530",
+"T*	c #5E474A",
+"U*	c #202125",
+"V*	c #1C1515",
+"W*	c #0E0C0D",
+"X*	c #333B43",
+"Y*	c #4D4A53",
+"Z*	c #5F2A27",
+"`*	c #7C342A",
+" =	c #544C52",
+".=	c #202024",
+"+=	c #543D3C",
+"@=	c #211A1B",
+"#=	c #484E55",
+"$=	c #66302D",
+"%=	c #626266",
+"&=	c #7C3C36",
+"*=	c #2F2E35",
+"==	c #4A434B",
+"-=	c #322A2E",
+";=	c #763834",
+">=	c #44363A",
+",=	c #505055",
+"'=	c #7E574F",
+")=	c #9D5449",
+"!=	c #804C48",
+"~=	c #7C5C57",
+"{=	c #695554",
+"]=	c #504C51",
+"^=	c #7D544D",
+"/=	c #4F4D54",
+"(=	c #504952",
+"_=	c #696462",
+":=	c #81645A",
+"<=	c #664B4B",
+"[=	c #6B4949",
+"}=	c #78777A",
+"|=	c #75443F",
+"1=	c #553D3C",
+"2=	c #4D484E",
+"3=	c #80473D",
+"4=	c #2E3037",
+"5=	c #373032",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . + @ # $ % & * = - ; > , ' ) ! ~ * { . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . 9 0 a b c d e f g h i j k l m n o p . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . q r s t u v w x y z A B C D E F G H . . . . . . . . . . . . . . . ",
+". . . . . I J K L M N O P Q R S T U V W X Y Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.).!.~.. . . . . . ",
+". . . . {.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.5 e.f.g.h.i.j.k.l.m.n.o.p.q.r.. . . . ",
+". . . s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.0.H.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++ at +#+. . . ",
+". . . $+%+&+*+=+=+=+=+=+=+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+=+3+4+5+4+6+5+7+8+9+0+. . ",
+". . . a+b+c+d+e+f+g+f+h+i+b+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+J+K+L+M+N+. . ",
+". . . O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@$@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@. . . ",
+". . |@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@g at h@i at j@k at l@m at n@o at p@q at r@s at t@u at v@w at x@y at z@A at B@C at v@D at E@F at . . ",
+". . G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@3 at Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#,#'#)#!#~#{#]#^#. . ",
+". /#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#. ",
+". C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$. ",
+". /$($_$:$<$[$}$|$1$2$3$}$4$5$6$7$8$9$0$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$. ",
+". A$B$C$D$E$F$G$H$I$J$K$L$M$N$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%. ",
+". {%]%=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+^%. ",
+". /%(%_%:%<%[%}%|%1%2%3%4%5%6%5%7%8%9%0%a%b%c%b at d%e%f%g%h%i%j%k%l%m%m%n%o%p%p%q%r%s%t%u%v%w%x%. ",
+". . . . y%>#z%A%B%. . . . . . . . . . C%D%. . . . E%F%G%H%. . . . . . . . . . . I%J%K%. . . . . ",
+". . . . . L%M%N%O%. . . . . . . . . P%Q%. . . . . . R%. S%T%. . . . . . . . . . U%V%W%. . . . . ",
+". . . . . X%Y%Z%`%. . . . . . . .  &.&. . . . . . . . . . +&@&. . . . . . . . . #&$&%&. . . . . ",
+". . . . . &&*&=&-&. . . . . . . ;&>&. . . . . . . ,&'&. . . )&!&. . . . . . . . ~&{&]&^&. . . . ",
+". . . . /&(&_&:&. . . . . . . <&[&. . . . . . . . }&|&. . . . . 1&. . . . . . . 2&3&4&5&. . . . ",
+". . . . 6&7&8&9&. . . . . . 0&a&. . . . . . . . . b&c&. . . . . . d&e&. . . . . . f&g&h&. . . . ",
+". . . . i&j&k&l&. . . . . m&n&. . . . . . . . . . o&c&. . . . . . . p&e&. . . . . q&r&s&. . . . ",
+". . . . t&. u&v&. . . . w&x&. . . . . . . . . . . y&z&. . . . . . . . A&B&. . . . C&D&E&F&. . . ",
+". . . . G&. H&I&. . . J&K&. . . . . . . . . . . . L&M&. . . . . . . . . N&O&. . . P&Q&R&S&. . . ",
+". . . . T&. U&V&. . W&X&. . . . . . . . . . . . . Y&Z&. . . . . . . . . . `& *. . .*+*@*#*. . . ",
+". . . $*%*. &***. =*-*. . . . . . . . . . . . . . ;*>*. . . . . . . . . . . ,*'*. )*!*~*{*. . . ",
+". . . ]*^*. /*(*_*D%. . . . . . . . . . . . . . . :*<*. . . . . . . . . . . . [*}*|*1*2*3*. . . ",
+". . . 4*^&. 5*6*7*. . . . . . . . . . . . . . . . 8*9*. . . . . . . . . . . . . 0*a*b*c*d*. . . ",
+". . . e*f*. g*. . . . . . . . . . . . . . . . . . h*i*. . . . . . . . . . . . . . . j*k*l*m*. . ",
+". . . n*I . o*. . . . . . . . . . . . . . . . . . p*q*. . . . . . . . . . . . . . . r*s*t*u*. . ",
+". . . v*. . w*. . . . . . . . . . . . . . . . . x*($y*. . . . . . . . . . . . . . . z*A*B*C*. . ",
+". . D*E*. . . . . . . . . . . . . . . . . . . . F*G*H*I*. . . . . . . . . . . . . . . . J*K*. . ",
+". . L*M*. . . . . . . . . . . . . . . . . . . . N*=+O*P*. . . . . . . . . . . . . . . . Q*R*. . ",
+". . S*T*. . . . . . . . . . . . . . . . . . . . U*V*W*X*. . . . . . . . . . . . . . . . Y*Z*. . ",
+". . `* =. . . . . . . . . . . . . . . . . . . . .=+=@=#=. . . . . . . . . . . . . . . . . $=%=. ",
+". . &=. . . . . . . . . . . . . . . . . . . . . *===-=. . . . . . . . . . . . . . . . . . ;=>=. ",
+". ,='=. . . . . . . . . . . . . . . . . . . . . . )=!=. . . . . . . . . . . . . . . . . . ~={=. ",
+". ]=^=. . . . . . . . . . . . . . . . . . . . . . /=(=. . . . . . . . . . . . . . . . . . _=:=. ",
+". <=[=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . }=|=. ",
+". 1=2=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3=. ",
+". 4=. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5=. ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/perc.xpm b/images/MusicalInstruments/perc.xpm
new file mode 100644
index 0000000..5e4f122
--- /dev/null
+++ b/images/MusicalInstruments/perc.xpm
@@ -0,0 +1,421 @@
+/* XPM */
+static char * perc_xpm[] = {
+"48 48 370 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #7A7A7A",
+"@ 	c #686868",
+"# 	c #595959",
+"$ 	c #44494E",
+"% 	c #999999",
+"& 	c #A6A6A6",
+"* 	c #D9D9D9",
+"= 	c #B8B8B8",
+"- 	c #8B8B8B",
+"; 	c #C9C9C9",
+"> 	c #52545A",
+", 	c #A58680",
+"' 	c #B18E85",
+") 	c #BC9386",
+"! 	c #B88C7E",
+"~ 	c #AE8375",
+"{ 	c #AB8573",
+"] 	c #AD8B79",
+"^ 	c #AE917D",
+"/ 	c #AB927D",
+"( 	c #A3907A",
+"_ 	c #918472",
+": 	c #867E6C",
+"< 	c #847E6F",
+"[ 	c #7F7B70",
+"} 	c #73736D",
+"| 	c #646666",
+"1 	c #3F4751",
+"2 	c #5E5356",
+"3 	c #97726A",
+"4 	c #8A706B",
+"5 	c #87736B",
+"6 	c #837068",
+"7 	c #836F67",
+"8 	c #968172",
+"9 	c #9E8B79",
+"0 	c #A4937F",
+"a 	c #AC9B85",
+"b 	c #B3A68C",
+"c 	c #B5AB90",
+"d 	c #B6AC90",
+"e 	c #B4AA8E",
+"f 	c #ADA48A",
+"g 	c #A29C87",
+"h 	c #8F8A7B",
+"i 	c #81796D",
+"j 	c #4B4A51",
+"k 	c #956157",
+"l 	c #BA7160",
+"m 	c #9D6A5E",
+"n 	c #855E54",
+"o 	c #795850",
+"p 	c #84665B",
+"q 	c #A78B6B",
+"r 	c #AF9773",
+"s 	c #A28F72",
+"t 	c #97876F",
+"u 	c #A18F71",
+"v 	c #A99775",
+"w 	c #B09B77",
+"x 	c #B29A75",
+"y 	c #AE946F",
+"z 	c #A68D6B",
+"A 	c #927D62",
+"B 	c #7E6C5A",
+"C 	c #3D4752",
+"D 	c #685254",
+"E 	c #DA7B66",
+"F 	c #EC886D",
+"G 	c #C37964",
+"H 	c #995C4F",
+"I 	c #905548",
+"J 	c #B0755A",
+"K 	c #DBAB6F",
+"L 	c #E1B575",
+"M 	c #BC996B",
+"N 	c #957B5A",
+"O 	c #9D7B51",
+"P 	c #A37D4E",
+"Q 	c #A9814E",
+"R 	c #AF824F",
+"S 	c #B27F4C",
+"T 	c #AF7C48",
+"U 	c #926C44",
+"V 	c #40454F",
+"W 	c #825651",
+"X 	c #F28B6F",
+"Y 	c #EB9A7E",
+"Z 	c #A16E60",
+"` 	c #6C4E4A",
+" .	c #7C5547",
+"..	c #C0875C",
+"+.	c #F9CB84",
+"@.	c #FFD488",
+"#.	c #CEAB76",
+"$.	c #A48966",
+"%.	c #C59A61",
+"&.	c #DDA65E",
+"*.	c #EAAE64",
+"=.	c #EDB069",
+"-.	c #EDAA63",
+";.	c #E5A65D",
+">.	c #AE8552",
+",.	c #735F48",
+"'.	c #E6E6E6",
+").	c #49464D",
+"!.	c #9A6158",
+"~.	c #FE9D7F",
+"{.	c #E5A489",
+"].	c #95645A",
+"^.	c #574043",
+"/.	c #745646",
+"(.	c #CF9A64",
+"_.	c #FDDF98",
+":.	c #F2D18E",
+"<.	c #917D62",
+"[.	c #484647",
+"}.	c #997B57",
+"|.	c #CE9C5B",
+"1.	c #E4AB63",
+"2.	c #E2AA6B",
+"3.	c #DFA261",
+"4.	c #D6A060",
+"5.	c #8C714F",
+"6.	c #3E3D3B",
+"7.	c #52484E",
+"8.	c #A86C60",
+"9.	c #FEAB8F",
+"0.	c #E6AE95",
+"a.	c #BF735F",
+"b.	c #97574E",
+"c.	c #A46D53",
+"d.	c #DAA96E",
+"e.	c #FDE9B0",
+"f.	c #F7D799",
+"g.	c #B69467",
+"h.	c #856E56",
+"i.	c #B99264",
+"j.	c #CC9B5C",
+"k.	c #D39E5C",
+"l.	c #D5A164",
+"m.	c #CB9258",
+"n.	c #CC9B62",
+"o.	c #A8875C",
+"p.	c #76624A",
+"q.	c #56494D",
+"r.	c #AC7265",
+"s.	c #FCB195",
+"t.	c #E8B097",
+"u.	c #DC7D63",
+"v.	c #C36654",
+"w.	c #C27B59",
+"x.	c #DFB076",
+"y.	c #FCECBD",
+"z.	c #FCDC9D",
+"A.	c #E6B36F",
+"B.	c #D5A369",
+"C.	c #DBA86C",
+"D.	c #CB995B",
+"E.	c #C69356",
+"F.	c #CB975D",
+"G.	c #BD8851",
+"H.	c #C39561",
+"I.	c #BE9563",
+"J.	c #A98153",
+"K.	c #53494D",
+"L.	c #A86F62",
+"M.	c #FAA98D",
+"N.	c #E7A88E",
+"O.	c #D67862",
+"P.	c #B85E4F",
+"Q.	c #BA7455",
+"R.	c #DEB076",
+"S.	c #FCE8B8",
+"T.	c #F8D699",
+"U.	c #E8B46D",
+"V.	c #DFA966",
+"W.	c #C49256",
+"X.	c #BE8C52",
+"Y.	c #C08F56",
+"Z.	c #B6854E",
+"`.	c #B88C5B",
+" +	c #B08859",
+".+	c #9D764A",
+"++	c #4B474D",
+"@+	c #9D655B",
+"#+	c #F3957A",
+"$+	c #E5987F",
+"%+	c #D4775F",
+"&+	c #B55E4F",
+"*+	c #B47153",
+"=+	c #D7A870",
+"-+	c #FCDFA6",
+";+	c #F8D08E",
+">+	c #E2AE69",
+",+	c #D3A161",
+"'+	c #CC9A5C",
+")+	c #BF8D54",
+"!+	c #B78750",
+"~+	c #B5874F",
+"{+	c #AE814B",
+"]+	c #B08554",
+"^+	c #A57C4F",
+"/+	c #916B41",
+"(+	c #43444C",
+"_+	c #925C54",
+":+	c #EE876E",
+"<+	c #E78E76",
+"[+	c #D47760",
+"}+	c #B45D4E",
+"|+	c #AE674D",
+"1+	c #CE9A66",
+"2+	c #FBD393",
+"3+	c #F7C985",
+"4+	c #E0AC69",
+"5+	c #D29F5F",
+"6+	c #C9975B",
+"7+	c #BE8D55",
+"8+	c #B68750",
+"9+	c #B1854C",
+"0+	c #AA7E4A",
+"a+	c #A97E4F",
+"b+	c #9E7649",
+"c+	c #8B683D",
+"d+	c #3C444E",
+"e+	c #795451",
+"f+	c #D97964",
+"g+	c #E8876D",
+"h+	c #D47861",
+"i+	c #B76050",
+"j+	c #AA624C",
+"k+	c #C0885D",
+"l+	c #F2C17D",
+"m+	c #F7C67E",
+"n+	c #E3AF6C",
+"o+	c #D09C5C",
+"p+	c #C59357",
+"q+	c #B98A53",
+"r+	c #B18450",
+"s+	c #AC804C",
+"t+	c #A57B4A",
+"u+	c #A07948",
+"v+	c #916D40",
+"w+	c #7F6039",
+"x+	c #3B4651",
+"y+	c #5A4B50",
+"z+	c #BD6E60",
+"A+	c #EA856B",
+"B+	c #D37962",
+"C+	c #BC6754",
+"D+	c #A65E4D",
+"E+	c #AE7456",
+"F+	c #E7B171",
+"G+	c #F4C178",
+"H+	c #E3B06C",
+"I+	c #CD9A5D",
+"J+	c #BF8F56",
+"K+	c #B18552",
+"L+	c #A87E4D",
+"M+	c #A37A49",
+"N+	c #9F7849",
+"O+	c #977245",
+"P+	c #86643C",
+"Q+	c #755837",
+"R+	c #444750",
+"S+	c #97645C",
+"T+	c #E9876E",
+"U+	c #D47C64",
+"V+	c #C06E5A",
+"W+	c #A55C4E",
+"X+	c #A3664F",
+"Y+	c #DEA76F",
+"Z+	c #F0BC75",
+"`+	c #E2B06A",
+" @	c #C99B5F",
+".@	c #B88C56",
+"+@	c #A8804F",
+"@@	c #9D784A",
+"#@	c #987446",
+"$@	c #987448",
+"%@	c #906C42",
+"&@	c #7E5E3B",
+"*@	c #6C543B",
+"=@	c #3D4651",
+"-@	c #705857",
+";@	c #E18670",
+">@	c #D87F69",
+",@	c #C5735E",
+"'@	c #A95F50",
+")@	c #A56551",
+"!@	c #D7A36F",
+"~@	c #EDBB78",
+"{@	c #E1B06E",
+"]@	c #C5985E",
+"^@	c #AF8753",
+"/@	c #9E7A4D",
+"(@	c #957248",
+"_@	c #937045",
+":@	c #927045",
+"<@	c #89653C",
+"[@	c #71583B",
+"}@	c #5A5045",
+"|@	c #534E54",
+"1@	c #D0806E",
+"2@	c #D8806A",
+"3@	c #C77560",
+"4@	c #AA6153",
+"5@	c #A46253",
+"6@	c #C69369",
+"7@	c #E0B173",
+"8@	c #D9AB6B",
+"9@	c #BA8F5A",
+"0@	c #A67F52",
+"a@	c #937149",
+"b@	c #896A43",
+"c@	c #886941",
+"d@	c #886842",
+"e@	c #826039",
+"f@	c #5F503F",
+"g@	c #454952",
+"h@	c #A76F65",
+"i@	c #E5866F",
+"j@	c #DF8169",
+"k@	c #BE6B5A",
+"l@	c #B06455",
+"m@	c #C08363",
+"n@	c #DAA66E",
+"o@	c #D4A769",
+"p@	c #B18958",
+"q@	c #9E794F",
+"r@	c #8B6B45",
+"s@	c #80633F",
+"t@	c #7F623E",
+"u@	c #81613D",
+"v@	c #765937",
+"w@	c #4C4A47",
+"x@	c #3F4752",
+"y@	c #5E5255",
+"z@	c #AE7063",
+"A@	c #C97864",
+"B@	c #B36959",
+"C@	c #A25F50",
+"D@	c #A06655",
+"E@	c #B78961",
+"F@	c #C19A63",
+"G@	c #AE8957",
+"H@	c #98764B",
+"I@	c #856741",
+"J@	c #7C5F3C",
+"K@	c #7B5D3C",
+"L@	c #7A5B3A",
+"M@	c #594E41",
+"N@	c #40474F",
+"O@	c #3E4650",
+"P@	c #5A4F50",
+"Q@	c #7A5854",
+"R@	c #7E5751",
+"S@	c #72504B",
+"T@	c #674846",
+"U@	c #7E6250",
+"V@	c #9C7F59",
+"W@	c #A28256",
+"X@	c #8C6F4B",
+"Y@	c #7B6241",
+"Z@	c #755B3C",
+"`@	c #74593C",
+" #	c #6F563B",
+".#	c #47494B",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . + @ + + # @ # @ # # # $ $ $ $ $ $ . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . $ # @ @ @ @ @ # + @ $ # @ @ @ @ $ . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . $ $ + + @ @ @ + @ # $ @ @ @ @ @ $ . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . @ $ $ $ $ $ $ $ $ $ # @ @ @ @ @ # . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . % % . % % . % % & . + + & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . = = . = = . = = & * + * & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . = = . = = . = = & * - * % * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . ; ; . ; ; . ; ; & * - * - * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . = = . = = . = = & * - * - * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . & & . & & . & & & * % * - * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . % % . % % . % % & * % * & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . + + . + + . + + & * % * & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . + + . + + . + + & * % * & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . + + . + + . + + & * - * & * . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ . @ @ . - . & * - * = * . . . . . . ",
+". . . . . . . > , ' ) ! ~ { ] ^ / ( _ : : < [ } | . . . @ @ . @ @ . . . & * - * = * . . . . . . ",
+". . . . . . 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i . . . @ @ . @ @ . . . . . - * = * . . . . . . ",
+". . . . . . j k l m n o p q r s t u v w x y z A B $ . . @ @ . - . . . . . . - - ; * . . . . . . ",
+". . . . . C D E F G H I J K L M N O P Q R S T U $ $ . . @ @ . ; . . . . . . + + * ; . . . . . . ",
+". . . . . V W X Y Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.$ . . + + . . . . . . . . . . '.& . . . . . . ",
+". . . . . ).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.$ . . - - . . . . . . . . . . . % . . . . . . ",
+". . . . . 7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.$ . . - - . . . . . . . . . . . % . . . . . . ",
+". . . . . q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . K.L.M.N.O.P.Q.R.S.T.U.V.l.W.X.Y.Z.`. +.+$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . ++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . (+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . R+S+T+U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . =@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@$ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . |@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@$ $ . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . g at h@i at j@k at l@m at n@o at p@q at r@s at t@u at v@w@$ . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . x at y@z at A@B at C@D at E@F at G@H at I@J at K@L at M@N@$ . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . O at P@Q at R@S at T@U at V@W at X@Y at Z@`@ #.#C . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/sax.xpm b/images/MusicalInstruments/sax.xpm
new file mode 100644
index 0000000..0daf2f9
--- /dev/null
+++ b/images/MusicalInstruments/sax.xpm
@@ -0,0 +1,510 @@
+/* XPM */
+static char * sax_xpm[] = {
+"48 48 459 2",
+"  	c #969696",
+". 	c #75797D",
+"+ 	c #6D6B58",
+"@ 	c #797344",
+"# 	c #6F683E",
+"$ 	c #606770",
+"% 	c #706A47",
+"& 	c #927D1E",
+"* 	c #D4BD46",
+"= 	c #CBAE36",
+"- 	c #967E1C",
+"; 	c #606156",
+"> 	c #5C6266",
+", 	c #80794D",
+"' 	c #A88C1C",
+") 	c #72725E",
+"! 	c #5C6364",
+"~ 	c #606665",
+"{ 	c #8E8652",
+"] 	c #978228",
+"^ 	c #596066",
+"/ 	c #7B6E36",
+"( 	c #9B8014",
+"_ 	c #9D8938",
+": 	c #5A6166",
+"< 	c #5D6365",
+"[ 	c #85793D",
+"} 	c #646454",
+"| 	c #5C6265",
+"1 	c #C1A63B",
+"2 	c #9F892B",
+"3 	c #565544",
+"4 	c #525B64",
+"5 	c #7C7859",
+"6 	c #A79856",
+"7 	c #787352",
+"8 	c #937E27",
+"9 	c #948540",
+"0 	c #5D6263",
+"a 	c #656A66",
+"b 	c #827C52",
+"c 	c #565D62",
+"d 	c #807D60",
+"e 	c #CEAE2D",
+"f 	c #7E6F2B",
+"g 	c #808285",
+"h 	c #717263",
+"i 	c #737056",
+"j 	c #535B63",
+"k 	c #686C66",
+"l 	c #AA9639",
+"m 	c #D2B843",
+"n 	c #585647",
+"o 	c #585F68",
+"p 	c #575A53",
+"q 	c #1E1E18",
+"r 	c #575E66",
+"s 	c #545C62",
+"t 	c #9D8A3D",
+"u 	c #D7B730",
+"v 	c #73662C",
+"w 	c #6A6E72",
+"x 	c #60676F",
+"y 	c #2A2D32",
+"z 	c #08090A",
+"A 	c #53595F",
+"B 	c #8A7F50",
+"C 	c #E0BA27",
+"D 	c #A18C32",
+"E 	c #60676E",
+"F 	c #212326",
+"G 	c #0B0C0E",
+"H 	c #585F66",
+"I 	c #737363",
+"J 	c #D9B524",
+"K 	c #CBAF3F",
+"L 	c #646452",
+"M 	c #555D65",
+"N 	c #2D2F32",
+"O 	c #313337",
+"P 	c #817131",
+"Q 	c #DEBE3A",
+"R 	c #706A3F",
+"S 	c #60676D",
+"T 	c #575F65",
+"U 	c #565138",
+"V 	c #877421",
+"W 	c #8A7727",
+"X 	c #626764",
+"Y 	c #5E6465",
+"Z 	c #787249",
+"` 	c #7B6A22",
+" .	c #907E29",
+"..	c #615E4A",
+"+.	c #606566",
+"@.	c #7A785F",
+"#.	c #807C5C",
+"$.	c #8A8254",
+"%.	c #857F58",
+"&.	c #6C6E66",
+"*.	c #6B6D64",
+"=.	c #978643",
+"-.	c #8D7E3B",
+";.	c #705E0F",
+">.	c #616666",
+",.	c #676B66",
+"'.	c #827F5E",
+").	c #F0E6A9",
+"!.	c #E8D478",
+"~.	c #CDA721",
+"{.	c #C49C13",
+"].	c #BF950B",
+"^.	c #C89F07",
+"/.	c #BFA124",
+"(.	c #626666",
+"_.	c #887C43",
+":.	c #BDA43F",
+"<.	c #837228",
+"[.	c #5E5A3E",
+"}.	c #7A785D",
+"|.	c #CCAC25",
+"1.	c #CFAE35",
+"2.	c #AA8216",
+"3.	c #8C5E01",
+"4.	c #794C00",
+"5.	c #7F5302",
+"6.	c #9F7901",
+"7.	c #857A43",
+"8.	c #7A7656",
+"9.	c #C7AF49",
+"0.	c #C2A837",
+"a.	c #756F4D",
+"b.	c #6A6F75",
+"c.	c #555D63",
+"d.	c #847B47",
+"e.	c #9C7800",
+"f.	c #866103",
+"g.	c #78560F",
+"h.	c #7E632A",
+"i.	c #9A7F36",
+"j.	c #AA8E1D",
+"k.	c #6F7063",
+"l.	c #6C6E62",
+"m.	c #A99540",
+"n.	c #C0A949",
+"o.	c #95802A",
+"p.	c #5E6466",
+"q.	c #666A66",
+"r.	c #B18F0D",
+"s.	c #D2B028",
+"t.	c #CCAF3A",
+"u.	c #E4D281",
+"v.	c #EFDC85",
+"w.	c #A19141",
+"x.	c #596064",
+"y.	c #6C6A53",
+"z.	c #A49246",
+"A.	c #BEA541",
+"B.	c #BCA233",
+"C.	c #615B39",
+"D.	c #525A61",
+"E.	c #AF8E0E",
+"F.	c #EBC933",
+"G.	c #E7C847",
+"H.	c #F0DE88",
+"I.	c #EDD983",
+"J.	c #978943",
+"K.	c #646350",
+"L.	c #8A7730",
+"M.	c #897A39",
+"N.	c #897A3C",
+"O.	c #746627",
+"P.	c #5D6265",
+"Q.	c #535B62",
+"R.	c #987A0A",
+"S.	c #E4C232",
+"T.	c #E2C446",
+"U.	c #EEDC8F",
+"V.	c #E8CF60",
+"W.	c #898253",
+"X.	c #646864",
+"Y.	c #B2A04E",
+"Z.	c #A99543",
+"`.	c #C6AF4D",
+" +	c #776929",
+".+	c #686B60",
+"++	c #646766",
+"@+	c #A58713",
+"#+	c #E2C131",
+"$+	c #E2C549",
+"%+	c #F0E0A0",
+"&+	c #E0C139",
+"*+	c #707164",
+"=+	c #545C64",
+"-+	c #6D6849",
+";+	c #B09E50",
+">+	c #BAAA59",
+",+	c #AF982F",
+"'+	c #797555",
+")+	c #6F6950",
+"!+	c #C1A223",
+"~+	c #DFBD2B",
+"{+	c #E6CE66",
+"]+	c #F8E79A",
+"^+	c #C3A522",
+"/+	c #5D5F5D",
+"(+	c #575F66",
+"_+	c #64645A",
+":+	c #9C852F",
+"<+	c #C2AB48",
+"[+	c #B39C3F",
+"}+	c #817331",
+"|+	c #7B6D39",
+"1+	c #D1B026",
+"2+	c #DEBC26",
+"3+	c #ECDC93",
+"4+	c #F4DB6E",
+"5+	c #C0AA52",
+"6+	c #737275",
+"7+	c #655E40",
+"8+	c #A79854",
+"9+	c #AF9943",
+"0+	c #C4AF4E",
+"a+	c #9A8018",
+"b+	c #6C6E64",
+"c+	c #646764",
+"d+	c #AD9121",
+"e+	c #E9C526",
+"f+	c #ECCE47",
+"g+	c #FAEA9E",
+"h+	c #DAC04F",
+"i+	c #D9CFA4",
+"j+	c #A2A2A4",
+"k+	c #877A43",
+"l+	c #B6A356",
+"m+	c #AC9D62",
+"n+	c #9A842A",
+"o+	c #7D764C",
+"p+	c #776F49",
+"q+	c #CAA91F",
+"r+	c #D2B123",
+"s+	c #D6C167",
+"t+	c #ECD672",
+"u+	c #D2BD64",
+"v+	c #ADA796",
+"w+	c #8E866B",
+"x+	c #A48D34",
+"y+	c #B59D39",
+"z+	c #A69340",
+"A+	c #7F7332",
+"B+	c #696B62",
+"C+	c #B29516",
+"D+	c #C6A829",
+"E+	c #7E6D27",
+"F+	c #8D8046",
+"G+	c #C1AB50",
+"H+	c #9A8E5C",
+"I+	c #7A7457",
+"J+	c #B19F4D",
+"K+	c #C7B35B",
+"L+	c #AC9845",
+"M+	c #A68D20",
+"N+	c #747460",
+"O+	c #525A62",
+"P+	c #6A6133",
+"Q+	c #B5981C",
+"R+	c #8F7C2A",
+"S+	c #4A421F",
+"T+	c #98873C",
+"U+	c #BBAB60",
+"V+	c #75725F",
+"W+	c #655926",
+"X+	c #AB9948",
+"Y+	c #ACA476",
+"Z+	c #857B43",
+"`+	c #6F684B",
+" @	c #75610F",
+".@	c #897A31",
+"+@	c #574D23",
+"@@	c #726942",
+"#@	c #DBC360",
+"$@	c #AD9C50",
+"%@	c #A59753",
+"&@	c #B49E46",
+"*@	c #8F7D33",
+"=@	c #AE9C4A",
+"-@	c #897B33",
+";@	c #606666",
+">@	c #696A62",
+",@	c #A9890D",
+"'@	c #B59B2B",
+")@	c #6E622D",
+"!@	c #87783D",
+"~@	c #B6A661",
+"{@	c #A5985F",
+"]@	c #6E6644",
+"^@	c #B3A055",
+"/@	c #C5B674",
+"(@	c #B5A25B",
+"_@	c #E1C033",
+":@	c #7F7C5C",
+"<@	c #565D64",
+"[@	c #7D6921",
+"}@	c #C5A622",
+"|@	c #9A872F",
+"1@	c #71642E",
+"2@	c #CBB458",
+"3@	c #BAA95F",
+"4@	c #797251",
+"5@	c #5B5438",
+"6@	c #7F6F28",
+"7@	c #A7954C",
+"8@	c #E1C450",
+"9@	c #968741",
+"0@	c #766C45",
+"a@	c #C2A11D",
+"b@	c #9A8529",
+"c@	c #4A4321",
+"d@	c #9D8C42",
+"e@	c #BFAB57",
+"f@	c #868062",
+"g@	c #918451",
+"h@	c #9B8B47",
+"i@	c #A18E39",
+"j@	c #E6C84E",
+"k@	c #AE972D",
+"l@	c #646966",
+"m@	c #5E6366",
+"n@	c #84752F",
+"o@	c #ECC72D",
+"p@	c #7F6D1E",
+"q@	c #453D20",
+"r@	c #C7B24E",
+"s@	c #AB9C5D",
+"t@	c #857E64",
+"u@	c #A3924C",
+"v@	c #988C5B",
+"w@	c #AB9F66",
+"x@	c #CFB02A",
+"y@	c #827D57",
+"z@	c #575E64",
+"A@	c #716A47",
+"B@	c #A99234",
+"C@	c #E8C738",
+"D@	c #A48F31",
+"E@	c #90834D",
+"F@	c #AB9C53",
+"G@	c #8C8053",
+"H@	c #948038",
+"I@	c #998327",
+"J@	c #9E9160",
+"K@	c #B09B47",
+"L@	c #8D7F38",
+"M@	c #777256",
+"N@	c #A88A13",
+"O@	c #A68F2C",
+"P@	c #B39F46",
+"Q@	c #D2BB56",
+"R@	c #BEAF6C",
+"S@	c #93885D",
+"T@	c #AA9A55",
+"U@	c #A48E36",
+"V@	c #978840",
+"W@	c #BBA853",
+"X@	c #B19623",
+"Y@	c #6F7164",
+"Z@	c #596065",
+"`@	c #857433",
+" #	c #B8991B",
+".#	c #BFA63F",
+"+#	c #B4A04B",
+"@#	c #A5954F",
+"##	c #847E5E",
+"$#	c #9D9059",
+"%#	c #E0CC6C",
+"&#	c #BCB17D",
+"*#	c #AEA36E",
+"=#	c #BAA02C",
+"-#	c #847B4E",
+";#	c #686D6A",
+">#	c #9F8418",
+",#	c #BBA239",
+"'#	c #DBC876",
+")#	c #BCA855",
+"!#	c #787251",
+"~#	c #676760",
+"{#	c #9A873D",
+"]#	c #C1AD5A",
+"^#	c #B9B38F",
+"/#	c #BFAA53",
+"(#	c #93822E",
+"_#	c #5F6566",
+":#	c #606771",
+"<#	c #BEB495",
+"[#	c #AA901F",
+"}#	c #C5AA34",
+"|#	c #CCB869",
+"1#	c #A5975C",
+"2#	c #8C897F",
+"3#	c #8F8462",
+"4#	c #A08829",
+"5#	c #BEAB56",
+"6#	c #D0BC66",
+"7#	c #B99C1F",
+"8#	c #75755F",
+"9#	c #535C65",
+"0#	c #C1B797",
+"a#	c #AB9125",
+"b#	c #DFC03F",
+"c#	c #DEC55E",
+"d#	c #AB922F",
+"e#	c #B39842",
+"f#	c #B99B31",
+"g#	c #B7A346",
+"h#	c #CBBA6B",
+"i#	c #CAAD35",
+"j#	c #8B7F42",
+"k#	c #C9C2AD",
+"l#	c #AA9231",
+"m#	c #DBBD3B",
+"n#	c #D4C060",
+"o#	c #B69D39",
+"p#	c #BD9A18",
+"q#	c #DCBD3A",
+"r#	c #D9C56A",
+"s#	c #B4A14C",
+"t#	c #917C21",
+"u#	c #626766",
+"v#	c #AE9B4E",
+"w#	c #B5971D",
+"x#	c #B4A046",
+"y#	c #C4B36B",
+"z#	c #C5B570",
+"A#	c #E2CD71",
+"B#	c #E5CA52",
+"C#	c #A48811",
+"D#	c #645F3B",
+"E#	c #666E77",
+"F#	c #666A68",
+"G#	c #7D7132",
+"H#	c #7D6916",
+"I#	c #7C7042",
+"J#	c #9C905B",
+"K#	c #BDA53E",
+"L#	c #BA9D1D",
+"M#	c #8E7610",
+"N#	c #646762",
+"O#	c #646C75",
+"P#	c #5D6466",
+"Q#	c #565546",
+"R#	c #464023",
+"S#	c #907F37",
+"T#	c #8A804D",
+"U#	c #777661",
+"V#	c #626768",
+"W#	c #5E6770",
+"X#	c #545D67",
+"Y#	c #A7A8A5",
+"Z#	c #596168",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                    . + @ #   $                 ",
+"                                                                    % & * = - ;                 ",
+"                                                                > , ' ) ! ~ { ] ^               ",
+"                                                                / ( _ :     < [ }               ",
+"                                                              | 1 2 3 4       5 6               ",
+"                                                              7 8 9 0         a b c             ",
+"                                                            d e f   g           h i j           ",
+"                                                          k l m n o               p q r         ",
+"                                                        s t u v w                 x y z A       ",
+"                                                        B C D   .                   E F G H     ",
+"                                                      I J K L                         M N O     ",
+"                                                    ^ P Q R S                                   ",
+"                                                  T U V W X                                     ",
+"                                                Y Z `  ...                                      ",
+"                        +. at .#.$.%.&.            *.=.-.;.>.                                      ",
+"                  ,.'.).!.~.{.].^./.|         (._.:.<.[.                                        ",
+"                  }.|.1.2.3.4.5.6.7.        . 8.9.0.a.b.                                        ",
+"                  c.d.e.f.g.h.i.j.k.        l.m.n.o.p.                                          ",
+"                    q.r.s.t.u.v.w.x.    . y.z.A.B.C.                                            ",
+"                    D.E.F.G.H.I.J.      K.L.M.N.O.P.                                            ",
+"                    Q.R.S.T.U.V.W.    X.Y.Z.`. +.+                                              ",
+"                    ++ at +#+$+%+&+*+  =+-+;+>+,+'+                                                ",
+"                    )+!+~+{+]+^+/+(+_+:+<+[+}+g                                                 ",
+"                    |+1+2+3+4+5+6+7+8+9+0+a+b+                                                  ",
+"                  c+d+e+f+g+h+i+j+k+l+m+n+o+                                                    ",
+"                  p+q+r+s+t+u+v+w+x+y+z+A+x.                                                    ",
+"                B+C+D+E+F+G+H+I+J+K+L+M+N+                                                      ",
+"              O+P+Q+R+S+T+U+V+W+X+Y+P Z+                                                        ",
+"              `+ @. at +@@@#@$@%@&@*@=@-@;@                                                        ",
+"            >@,@'@)@!@~@{@]@^@/@(@_@:@                                                          ",
+"          <@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9@                                                            ",
+"          0 at a@b at c@d at e@f at g@h at i@j at k@l@                                                            ",
+"        m at n@o at p@q at r@s at t@u at v@w at x@y@                                                              ",
+"      z at A@B at C@D at E@F at G@H at I@J at K@L at s                                                               ",
+"      M at N@O at P@Q at R@S at T@U at V@W at X@Y@                                                                ",
+"    Z@`@ #.#+#@###$#%#&#*#=#-#                                                                  ",
+"    ;#>#,#'#)#!#~#{#]#^#/#(#_#                                                                  ",
+"  :#<#[#}#|#1#2#3#4#5#6#7#8#                                                                    ",
+"  9#0#a#b#c#d#e#f#g#h#i#j#                                                                      ",
+"    k#l#m#n#o#p#q#r#s#t#u#                                                                      ",
+"      v#w#x#y#z#A#B#C#D#                                                                        ",
+"    E#F#G#H#I#J#K#L#M#N#                                                                        ",
+"    O#  P#Q#R#S#T#U#V#                                                                          ",
+"    W#    X#Y#  Z#                                                                              ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/snare.xpm b/images/MusicalInstruments/snare.xpm
new file mode 100644
index 0000000..223767f
--- /dev/null
+++ b/images/MusicalInstruments/snare.xpm
@@ -0,0 +1,1420 @@
+/* XPM */
+static char * snare_xpm[] = {
+"48 48 1369 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #5B6066",
+"@ 	c #1D1F2D",
+"# 	c #1B2531",
+"$ 	c #393F4B",
+"% 	c #3F3E4C",
+"& 	c #80778A",
+"* 	c #978FA5",
+"= 	c #8B8A9C",
+"- 	c #919CA4",
+"; 	c #8C9CA3",
+"> 	c #242E32",
+", 	c #3D444E",
+"' 	c #60646C",
+") 	c #3B404B",
+"! 	c #3D424D",
+"~ 	c #3E434E",
+"{ 	c #3A424C",
+"] 	c #494656",
+"^ 	c #B0A5BA",
+"/ 	c #CEC4DC",
+"( 	c #BFBFD2",
+"_ 	c #C1CCD3",
+": 	c #B9C9D1",
+"< 	c #273236",
+"[ 	c #3D434D",
+"} 	c #2F3740",
+"| 	c #1A1F25",
+"1 	c #48535A",
+"2 	c #7D9297",
+"3 	c #6A8187",
+"4 	c #69767E",
+"5 	c #6F707C",
+"6 	c #726F7E",
+"7 	c #868093",
+"8 	c #847F93",
+"9 	c #6E6F81",
+"0 	c #88939F",
+"a 	c #B2C3C9",
+"b 	c #2A3836",
+"c 	c #3D444D",
+"d 	c #30343C",
+"e 	c #3A3C41",
+"f 	c #565C64",
+"g 	c #5A636B",
+"h 	c #65727C",
+"i 	c #7E919D",
+"j 	c #6C828E",
+"k 	c #647177",
+"l 	c #78797C",
+"m 	c #7A797E",
+"n 	c #6D6C74",
+"o 	c #71717C",
+"p 	c #5D606B",
+"q 	c #8C95A0",
+"r 	c #67757A",
+"s 	c #2C3938",
+"t 	c #363D43",
+"u 	c #525A59",
+"v 	c #656D6C",
+"w 	c #6B706E",
+"x 	c #777B7B",
+"y 	c #7E8486",
+"z 	c #7E868B",
+"A 	c #707A82",
+"B 	c #737F87",
+"C 	c #7B827C",
+"D 	c #888C7C",
+"E 	c #8A8C7E",
+"F 	c #81857E",
+"G 	c #828684",
+"H 	c #93979A",
+"I 	c #696F75",
+"J 	c #353D41",
+"K 	c #2B3537",
+"L 	c #5B5F66",
+"M 	c #3C414C",
+"N 	c #3B3F4B",
+"O 	c #2F3539",
+"P 	c #6C7570",
+"Q 	c #8E9994",
+"R 	c #808884",
+"S 	c #767C7A",
+"T 	c #7D8382",
+"U 	c #868B8D",
+"V 	c #6C7479",
+"W 	c #798186",
+"X 	c #8C9186",
+"Y 	c #939880",
+"Z 	c #929782",
+"` 	c #909689",
+" .	c #8A8F88",
+"..	c #B1B7B7",
+"+.	c #4B5054",
+"@.	c #2A2F33",
+"#.	c #293234",
+"$.	c #60646A",
+"%.	c #565C63",
+"&.	c #616E7B",
+"*.	c #6A7889",
+"=.	c #6D7B84",
+"-.	c #7E8B8C",
+";.	c #909A92",
+">.	c #8A9081",
+",.	c #878A77",
+"'.	c #8F9279",
+").	c #929478",
+"!.	c #838668",
+"~.	c #8C8E70",
+"{.	c #909372",
+"].	c #929975",
+"^.	c #97A17F",
+"/.	c #909A83",
+"(.	c #677061",
+"_.	c #797E79",
+":.	c #454447",
+"<.	c #333136",
+"[.	c #35363B",
+"}.	c #2A2B33",
+"|.	c #3D424E",
+"1.	c #5C6066",
+"2.	c #585F61",
+"3.	c #798385",
+"4.	c #8797A3",
+"5.	c #8C9EAE",
+"6.	c #8C9DA4",
+"7.	c #869390",
+"8.	c #8B9282",
+"9.	c #8F9375",
+"0.	c #989971",
+"a.	c #989766",
+"b.	c #9A9A63",
+"c.	c #9B9B5F",
+"d.	c #98985B",
+"e.	c #939562",
+"f.	c #9DA47D",
+"g.	c #A6B28E",
+"h.	c #7B886E",
+"i.	c #535F4E",
+"j.	c #585A55",
+"k.	c #4E474A",
+"l.	c #534750",
+"m.	c #433A43",
+"n.	c #302B2F",
+"o.	c #49505A",
+"p.	c #575F65",
+"q.	c #636D70",
+"r.	c #717D7C",
+"s.	c #818E8E",
+"t.	c #828D8D",
+"u.	c #868F8B",
+"v.	c #8C9488",
+"w.	c #8D937E",
+"x.	c #909373",
+"y.	c #919367",
+"z.	c #9A9966",
+"A.	c #999860",
+"B.	c #97985C",
+"C.	c #96985B",
+"D.	c #95985C",
+"E.	c #9FA179",
+"F.	c #898D75",
+"G.	c #7A836F",
+"H.	c #596659",
+"I.	c #515A54",
+"J.	c #514F53",
+"K.	c #564952",
+"L.	c #58434F",
+"M.	c #281920",
+"N.	c #464040",
+"O.	c #333842",
+"P.	c #3E4549",
+"Q.	c #7B8687",
+"R.	c #7F8B8B",
+"S.	c #7B898A",
+"T.	c #7C8A8A",
+"U.	c #788078",
+"V.	c #868978",
+"W.	c #97987F",
+"X.	c #929472",
+"Y.	c #94966C",
+"Z.	c #979765",
+"`.	c #999861",
+" +	c #9D9C64",
+".+	c #939559",
+"++	c #8E9156",
+"@+	c #959861",
+"#+	c #ACAE8D",
+"$+	c #6E7061",
+"%+	c #4A5248",
+"&+	c #4B5753",
+"*+	c #495052",
+"=+	c #403D47",
+"-+	c #544452",
+";+	c #462E3D",
+">+	c #0C0001",
+",+	c #48403E",
+"'+	c #5C626C",
+")+	c #50565D",
+"!+	c #4F5657",
+"~+	c #7A8483",
+"{+	c #7B8680",
+"]+	c #7C897F",
+"^+	c #859282",
+"/+	c #838D6E",
+"(+	c #8F936B",
+"_+	c #99986D",
+":+	c #999465",
+"<+	c #9B9662",
+"[+	c #9A9760",
+"}+	c #989860",
+"|+	c #959864",
+"1+	c #929769",
+"2+	c #999D78",
+"3+	c #808267",
+"4+	c #828278",
+"5+	c #636766",
+"6+	c #53615B",
+"7+	c #515D5D",
+"8+	c #555960",
+"9+	c #544B56",
+"0+	c #432A35",
+"a+	c #391F29",
+"b+	c #110005",
+"c+	c #493C40",
+"d+	c #4A494E",
+"e+	c #3F484B",
+"f+	c #4A5459",
+"g+	c #5D686D",
+"h+	c #788189",
+"i+	c #848D93",
+"j+	c #818A8A",
+"k+	c #777E74",
+"l+	c #868C74",
+"m+	c #8E9470",
+"n+	c #949B6B",
+"o+	c #929F60",
+"p+	c #969F5C",
+"q+	c #9A975A",
+"r+	c #9F9158",
+"s+	c #A4945B",
+"t+	c #9D955B",
+"u+	c #959862",
+"v+	c #8F996F",
+"w+	c #87937A",
+"x+	c #888D8C",
+"y+	c #666577",
+"z+	c #53516A",
+"A+	c #525E67",
+"B+	c #566F65",
+"C+	c #565E5B",
+"D+	c #615960",
+"E+	c #7F686F",
+"F+	c #4E2423",
+"G+	c #41231E",
+"H+	c #16070B",
+"I+	c #362432",
+"J+	c #58484B",
+"K+	c #4E5C52",
+"L+	c #64736F",
+"M+	c #7B8987",
+"N+	c #6A7675",
+"O+	c #7E8983",
+"P+	c #899183",
+"Q+	c #898F73",
+"R+	c #91946A",
+"S+	c #9E9E68",
+"T+	c #999A5D",
+"U+	c #959C5E",
+"V+	c #939B60",
+"W+	c #989861",
+"X+	c #9B9261",
+"Y+	c #9E9265",
+"Z+	c #A19A71",
+"`+	c #9E9F7D",
+" @	c #858B77",
+".@	c #6C756F",
+"+@	c #6A707C",
+"@@	c #6C6F8A",
+"#@	c #626479",
+"$@	c #58625E",
+"%@	c #5E6E56",
+"&@	c #56513F",
+"*@	c #4D3732",
+"=@	c #8D6966",
+"-@	c #855446",
+";@	c #553424",
+">@	c #1E0E0D",
+",@	c #170512",
+"'@	c #5D4A53",
+")@	c #363741",
+"!@	c #30353C",
+"~@	c #3D4444",
+"{@	c #6C7775",
+"]@	c #69736C",
+"^@	c #758275",
+"/@	c #727F6D",
+"(@	c #818E72",
+"_@	c #8F9976",
+":@	c #929A6F",
+"<@	c #919563",
+"[@	c #9D9E66",
+"}@	c #999960",
+"|@	c #999560",
+"1@	c #979462",
+"2@	c #989A65",
+"3@	c #9A9F6B",
+"4@	c #95976F",
+"5@	c #A9A790",
+"6@	c #ADA7A0",
+"7@	c #6D656E",
+"8@	c #565463",
+"9@	c #7A8291",
+"0@	c #768592",
+"a@	c #6C7375",
+"b@	c #6E6C5D",
+"c@	c #7C7358",
+"d@	c #58432C",
+"e@	c #3C180D",
+"f@	c #80544B",
+"g@	c #986B59",
+"h@	c #4C2515",
+"i@	c #2A0C0A",
+"j@	c #100000",
+"k@	c #655559",
+"l@	c #1E161C",
+"m@	c #5C5F66",
+"n@	c #24272C",
+"o@	c #55575C",
+"p@	c #696E6B",
+"q@	c #6F7669",
+"r@	c #7D886F",
+"s@	c #808D69",
+"t@	c #869366",
+"u@	c #8F9A68",
+"v@	c #929D66",
+"w@	c #939963",
+"x@	c #999C67",
+"y@	c #989967",
+"z@	c #95946A",
+"A@	c #99986F",
+"B@	c #9C9D71",
+"C@	c #9D9F74",
+"D@	c #939377",
+"E@	c #95948B",
+"F@	c #95949D",
+"G@	c #6C6A7E",
+"H@	c #57596D",
+"I@	c #727882",
+"J@	c #76817C",
+"K@	c #70735D",
+"L@	c #746846",
+"M@	c #7E6340",
+"N@	c #674325",
+"O@	c #53260E",
+"P@	c #794935",
+"Q@	c #916751",
+"R@	c #5C2F21",
+"S@	c #320A07",
+"T@	c #140000",
+"U@	c #5F5351",
+"V@	c #514F54",
+"W@	c #4A4F5B",
+"X@	c #3B3D4B",
+"Y@	c #61646E",
+"Z@	c #56595F",
+"`@	c #6C6768",
+" #	c #797165",
+".#	c #8A896C",
+"+#	c #919664",
+"@#	c #98A25D",
+"##	c #909F4F",
+"$#	c #8F9E4C",
+"%#	c #93A056",
+"&#	c #959F63",
+"*#	c #92986B",
+"=#	c #949879",
+"-#	c #919987",
+";#	c #9AA291",
+">#	c #999B84",
+",#	c #96927E",
+"'#	c #888681",
+")#	c #727586",
+"!#	c #6B7498",
+"~#	c #667397",
+"{#	c #606D81",
+"]#	c #676B5E",
+"^#	c #767446",
+"/#	c #797427",
+"(#	c #816114",
+"_#	c #894A13",
+":#	c #8A4C17",
+"<#	c #7E3F0D",
+"[#	c #6C3208",
+"}#	c #7E593D",
+"|#	c #7C4337",
+"1#	c #4B1007",
+"2#	c #280B03",
+"3#	c #3F392C",
+"4#	c #9CA2A5",
+"5#	c #646C7C",
+"6#	c #3B414C",
+"7#	c #494D59",
+"8#	c #6B6A77",
+"9#	c #44474D",
+"0#	c #535856",
+"a#	c #5E6158",
+"b#	c #736E5C",
+"c#	c #948B6F",
+"d#	c #9F9C73",
+"e#	c #979A60",
+"f#	c #939C54",
+"g#	c #93A052",
+"h#	c #909E54",
+"i#	c #909C5D",
+"j#	c #8F9668",
+"k#	c #909576",
+"l#	c #929786",
+"m#	c #8C9D9A",
+"n#	c #879A9B",
+"o#	c #747B77",
+"p#	c #7C7771",
+"q#	c #817E7D",
+"r#	c #788086",
+"s#	c #6C7D89",
+"t#	c #647B7F",
+"u#	c #738372",
+"v#	c #787749",
+"w#	c #796820",
+"x#	c #84740C",
+"y#	c #896907",
+"z#	c #91570E",
+"A#	c #9C6018",
+"B#	c #884B0B",
+"C#	c #6C3200",
+"D#	c #71452A",
+"E#	c #935B4E",
+"F#	c #5C2914",
+"G#	c #472D0B",
+"H#	c #201B0C",
+"I#	c #7F8689",
+"J#	c #AAB8CB",
+"K#	c #3D4450",
+"L#	c #393D49",
+"M#	c #1E1C2A",
+"N#	c #4D4C58",
+"O#	c #282B2C",
+"P#	c #30342F",
+"Q#	c #57604E",
+"R#	c #5C6147",
+"S#	c #9F9B78",
+"T#	c #999166",
+"U#	c #969260",
+"V#	c #98995E",
+"W#	c #929958",
+"X#	c #929D5C",
+"Y#	c #94A167",
+"Z#	c #949C6F",
+"`#	c #899070",
+" $	c #939785",
+".$	c #8D938E",
+"+$	c #687B84",
+"@$	c #6D8494",
+"#$	c #78838D",
+"$$	c #707274",
+"%$	c #797C77",
+"&$	c #737D71",
+"*$	c #6E7E69",
+"=$	c #7D8D69",
+"-$	c #79814A",
+";$	c #8A7F31",
+">$	c #876D0C",
+",$	c #957E02",
+"'$	c #A58714",
+")$	c #8B5F10",
+"!$	c #976411",
+"~$	c #935C08",
+"{$	c #7E4304",
+"]$	c #7F492B",
+"^$	c #AF7D6C",
+"/$	c #522A0D",
+"($	c #3E2B02",
+"_$	c #39331A",
+":$	c #545A5C",
+"<$	c #ADBCCF",
+"[$	c #151F2C",
+"}$	c #23222B",
+"|$	c #282732",
+"1$	c #47474D",
+"2$	c #2A2D29",
+"3$	c #3F4336",
+"4$	c #687157",
+"5$	c #6A704E",
+"6$	c #9A996F",
+"7$	c #9A9464",
+"8$	c #979561",
+"9$	c #999A64",
+"0$	c #929962",
+"a$	c #949E6B",
+"b$	c #99A477",
+"c$	c #949D7B",
+"d$	c #878D77",
+"e$	c #8C9084",
+"f$	c #898E8B",
+"g$	c #6E7C8A",
+"h$	c #738597",
+"i$	c #77828D",
+"j$	c #717676",
+"k$	c #7C8072",
+"l$	c #747B62",
+"m$	c #757D56",
+"n$	c #888B55",
+"o$	c #8A8640",
+"p$	c #94812A",
+"q$	c #8D6E0C",
+"r$	c #957903",
+"s$	c #A58713",
+"t$	c #8B640E",
+"u$	c #966611",
+"v$	c #945E09",
+"w$	c #773D03",
+"x$	c #753B21",
+"y$	c #A1715D",
+"z$	c #5C3C1D",
+"A$	c #4A3A11",
+"B$	c #39311B",
+"C$	c #5B6064",
+"D$	c #A1AFC2",
+"E$	c #1A2633",
+"F$	c #333439",
+"G$	c #717277",
+"H$	c #2B2E2C",
+"I$	c #2D3225",
+"J$	c #3F432A",
+"K$	c #7D845D",
+"L$	c #939C69",
+"M$	c #929758",
+"N$	c #989C5F",
+"O$	c #969C69",
+"P$	c #949B77",
+"Q$	c #959B87",
+"R$	c #A1A7A0",
+"S$	c #949C9F",
+"T$	c #8B9199",
+"U$	c #7D818B",
+"V$	c #7C7D87",
+"W$	c #82818E",
+"X$	c #7F7F94",
+"Y$	c #808298",
+"Z$	c #7B7E88",
+"`$	c #7A7B70",
+" %	c #848258",
+".%	c #8B7E35",
+"+%	c #937B1B",
+"@%	c #AC8A13",
+"#%	c #B68A12",
+"$%	c #AB790B",
+"%%	c #AC750A",
+"&%	c #9C6A02",
+"*%	c #A3800E",
+"=%	c #8F760E",
+"-%	c #986E13",
+";%	c #925E09",
+">%	c #682B00",
+",%	c #641606",
+"'%	c #754A32",
+")%	c #79724E",
+"!%	c #655F3C",
+"~%	c #383022",
+"{%	c #7A7981",
+"]%	c #788495",
+"^%	c #202935",
+"/%	c #54555B",
+"(%	c #616469",
+"_%	c #353737",
+":%	c #2A2E25",
+"<%	c #393D2B",
+"[%	c #7D8265",
+"}%	c #939A70",
+"|%	c #89925E",
+"1%	c #919B61",
+"2%	c #919D63",
+"3%	c #919C68",
+"4%	c #99A37F",
+"5%	c #A0AC97",
+"6%	c #909A96",
+"7%	c #8F97A2",
+"8%	c #82899C",
+"9%	c #80869A",
+"0%	c #797D8F",
+"a%	c #767887",
+"b%	c #807F8B",
+"c%	c #837D87",
+"d%	c #8C7E84",
+"e%	c #947A74",
+"f%	c #8C6751",
+"g%	c #9A6D39",
+"h%	c #B98B33",
+"i%	c #A27413",
+"j%	c #A47000",
+"k%	c #C2880E",
+"l%	c #C98212",
+"m%	c #B05D08",
+"n%	c #974A01",
+"o%	c #975F04",
+"p%	c #966F10",
+"q%	c #8E5409",
+"r%	c #703000",
+"s%	c #6F2900",
+"t%	c #762309",
+"u%	c #6E4027",
+"v%	c #8A8065",
+"w%	c #544B36",
+"x%	c #3E352E",
+"y%	c #A3A1AA",
+"z%	c #777F8E",
+"A%	c #293039",
+"B%	c #6F7178",
+"C%	c #6B6E74",
+"D%	c #313332",
+"E%	c #282B20",
+"F%	c #3C412E",
+"G%	c #8B9072",
+"H%	c #8E956B",
+"I%	c #8A915E",
+"J%	c #919B62",
+"K%	c #939F66",
+"L%	c #929E6B",
+"M%	c #9CA885",
+"N%	c #A8B5A2",
+"O%	c #8F9A99",
+"P%	c #878F9C",
+"Q%	c #848BA1",
+"R%	c #83889E",
+"S%	c #7A7E91",
+"T%	c #757786",
+"U%	c #7D7D88",
+"V%	c #857D85",
+"W%	c #917F82",
+"X%	c #977A71",
+"Y%	c #90644D",
+"Z%	c #9F6B35",
+"`%	c #C08C31",
+" &	c #A47212",
+".&	c #9E6900",
+"+&	c #CC8F11",
+"@&	c #DA9018",
+"#&	c #AA5305",
+"$&	c #914000",
+"%&	c #945802",
+"&&	c #986E10",
+"*&	c #894D04",
+"=&	c #662400",
+"-&	c #702900",
+";&	c #792609",
+">&	c #8F856B",
+",&	c #514834",
+"'&	c #3F3630",
+")&	c #AEACB5",
+"!&	c #7D8694",
+"~&	c #2E353E",
+"{&	c #575A65",
+"]&	c #989DA2",
+"^&	c #1E2322",
+"/&	c #2A2F27",
+"(&	c #686E60",
+"_&	c #8C907E",
+":&	c #9EA28B",
+"<&	c #95997E",
+"[&	c #8A8C71",
+"}&	c #979C85",
+"|&	c #A0B2A4",
+"1&	c #79908B",
+"2&	c #6E8383",
+"3&	c #72868D",
+"4&	c #778B96",
+"5&	c #7E8F9F",
+"6&	c #818FA0",
+"7&	c #8791A0",
+"8&	c #838A96",
+"9&	c #7C828C",
+"0&	c #7E787A",
+"a&	c #8B634B",
+"b&	c #9C5326",
+"c&	c #AB4C12",
+"d&	c #C3520D",
+"e&	c #D95C11",
+"f&	c #D4590B",
+"g&	c #C2510D",
+"h&	c #AD4407",
+"i&	c #A23A01",
+"j&	c #9E3203",
+"k&	c #A63203",
+"l&	c #AC380C",
+"m&	c #A63308",
+"n&	c #8F1A04",
+"o&	c #8D1703",
+"p&	c #9F2C14",
+"q&	c #952E17",
+"r&	c #843216",
+"s&	c #5D1C08",
+"t&	c #845756",
+"u&	c #644B58",
+"v&	c #99979F",
+"w&	c #595D64",
+"x&	c #373A45",
+"y&	c #36383B",
+"z&	c #777A84",
+"A&	c #B4BBBF",
+"B&	c #5A6060",
+"C&	c #545A56",
+"D&	c #A6ABA3",
+"E&	c #9FA398",
+"F&	c #9B9D8F",
+"G&	c #999B8E",
+"H&	c #8C8E82",
+"I&	c #7E807E",
+"J&	c #7D8D97",
+"K&	c #6B8294",
+"L&	c #788F9E",
+"M&	c #6E8693",
+"N&	c #788B97",
+"O&	c #8B98A1",
+"P&	c #878E92",
+"Q&	c #878787",
+"R&	c #8C8684",
+"S&	c #847C7A",
+"T&	c #88746C",
+"U&	c #8F4E2D",
+"V&	c #A53D01",
+"W&	c #C54F02",
+"X&	c #DE5F07",
+"Y&	c #DC5004",
+"Z&	c #C93501",
+"`&	c #B01A02",
+" *	c #A10F00",
+".*	c #9E1407",
+"+*	c #AC2F16",
+"@*	c #A42A0A",
+"#*	c #971804",
+"$*	c #990C03",
+"%*	c #A40C03",
+"&*	c #9A0B02",
+"**	c #AB231E",
+"=*	c #9F2925",
+"-*	c #84341D",
+";*	c #62180C",
+">*	c #652936",
+",*	c #876B83",
+"'*	c #747882",
+")*	c #4B5359",
+"!*	c #4C4E55",
+"~*	c #211F20",
+"{*	c #4A515B",
+"]*	c #8B9493",
+"^*	c #798489",
+"/*	c #697283",
+"(*	c #8B90A6",
+"_*	c #888C9B",
+":*	c #818386",
+"<*	c #787C7D",
+"[*	c #7F829B",
+"}*	c #80829E",
+"|*	c #7B809B",
+"1*	c #7B889F",
+"2*	c #738093",
+"3*	c #888893",
+"4*	c #9A8483",
+"5*	c #9E6B5C",
+"6*	c #9A543A",
+"7*	c #A75834",
+"8*	c #A6582F",
+"9*	c #A35B32",
+"0*	c #9B5D38",
+"a*	c #B1571F",
+"b*	c #D55106",
+"c*	c #C33602",
+"d*	c #BA2201",
+"e*	c #C41F01",
+"f*	c #B40F00",
+"g*	c #B71708",
+"h*	c #B41C0E",
+"i*	c #AB1610",
+"j*	c #A60D0A",
+"k*	c #9D0802",
+"l*	c #960400",
+"m*	c #A7140A",
+"n*	c #A8201E",
+"o*	c #A62631",
+"p*	c #8C1D2E",
+"q*	c #6D1722",
+"r*	c #631729",
+"s*	c #98657C",
+"t*	c #86768C",
+"u*	c #627277",
+"v*	c #374647",
+"w*	c #525356",
+"x*	c #3D424C",
+"y*	c #727C78",
+"z*	c #7B888D",
+"A*	c #6A738B",
+"B*	c #74799B",
+"C*	c #7A7E97",
+"D*	c #7C808A",
+"E*	c #6D7279",
+"F*	c #727B8D",
+"G*	c #8287AA",
+"H*	c #827EA2",
+"I*	c #7E819F",
+"J*	c #7889A3",
+"K*	c #718398",
+"L*	c #878B96",
+"M*	c #9C807D",
+"N*	c #A15E4A",
+"O*	c #9D401E",
+"P*	c #B04719",
+"Q*	c #B44D15",
+"R*	c #AE5720",
+"S*	c #A16740",
+"T*	c #B7632C",
+"U*	c #DC5308",
+"V*	c #B22300",
+"W*	c #A80F00",
+"X*	c #C71F00",
+"Y*	c #B81100",
+"Z*	c #C1200E",
+"`*	c #BA200E",
+" =	c #A70808",
+".=	c #AA0309",
+"+=	c #A30502",
+"@=	c #930200",
+"#=	c #A2140B",
+"$=	c #AE2B2B",
+"%=	c #A32737",
+"&=	c #83132C",
+"*=	c #5E031C",
+"==	c #5F122D",
+"-=	c #BA8BA5",
+";=	c #85788D",
+">=	c #607578",
+",=	c #2D403F",
+"'=	c #495058",
+")=	c #4E5660",
+"!=	c #778BA0",
+"~=	c #6F829F",
+"{=	c #6A7C8C",
+"]=	c #768A81",
+"^=	c #7C907D",
+"/=	c #809487",
+"(=	c #7D8688",
+"_=	c #8D7B70",
+":=	c #A8766B",
+"<=	c #A14E54",
+"[=	c #A42C37",
+"}=	c #B82229",
+"|=	c #C51E1D",
+"1=	c #C51D0C",
+"2=	c #D03009",
+"3=	c #D23D0F",
+"4=	c #E3511D",
+"5=	c #CD5129",
+"6=	c #A66354",
+"7=	c #AD5F47",
+"8=	c #C22D07",
+"9=	c #CC1A04",
+"0=	c #CD160A",
+"a=	c #D21512",
+"b=	c #C3070A",
+"c=	c #BF0202",
+"d=	c #B50C0C",
+"e=	c #991317",
+"f=	c #A3231D",
+"g=	c #9D180D",
+"h=	c #A01712",
+"i=	c #AA2023",
+"j=	c #951524",
+"k=	c #962640",
+"l=	c #812D4C",
+"m=	c #925F7C",
+"n=	c #9E849C",
+"o=	c #676473",
+"p=	c #636871",
+"q=	c #63686D",
+"r=	c #505456",
+"s=	c #555C6D",
+"t=	c #817D96",
+"u=	c #726875",
+"v=	c #81685C",
+"w=	c #825B42",
+"x=	c #905A47",
+"y=	c #A05D4F",
+"z=	c #A3542F",
+"A=	c #B0431B",
+"B=	c #C22A17",
+"C=	c #D91A0E",
+"D=	c #E71109",
+"E=	c #E40E02",
+"F=	c #DC1700",
+"G=	c #DA2506",
+"H=	c #D4290C",
+"I=	c #D92A15",
+"J=	c #D12B21",
+"K=	c #BA4B46",
+"L=	c #A54C43",
+"M=	c #A7241B",
+"N=	c #CD1A13",
+"O=	c #D30D12",
+"P=	c #C10012",
+"Q=	c #C20A17",
+"R=	c #C1150F",
+"S=	c #A7110C",
+"T=	c #A1241C",
+"U=	c #9F251B",
+"V=	c #9A1511",
+"W=	c #A91F25",
+"X=	c #971320",
+"Y=	c #810F24",
+"Z=	c #842D48",
+"`=	c #95647E",
+" -	c #9B89A0",
+".-	c #7F8495",
+"+-	c #44525C",
+"@-	c #4F5A5F",
+"#-	c #636367",
+"$-	c #373434",
+"%-	c #585463",
+"&-	c #7B4A55",
+"*-	c #904137",
+"=-	c #A5351D",
+"--	c #C1351E",
+";-	c #D93D23",
+">-	c #DC4716",
+",-	c #D83E06",
+"'-	c #E9390D",
+")-	c #EF2A03",
+"!-	c #E51A03",
+"~-	c #D30D01",
+"{-	c #DA2002",
+"]-	c #DE2807",
+"^-	c #CA1406",
+"/-	c #C8060C",
+"(-	c #D00B17",
+"_-	c #CA2828",
+":-	c #B64F4C",
+"<-	c #963C45",
+"[-	c #A5151D",
+"}-	c #C90D1A",
+"|-	c #CB1824",
+"1-	c #C63225",
+"2-	c #B83B0D",
+"3-	c #B93D0D",
+"4-	c #C84025",
+"5-	c #A61216",
+"6-	c #A61226",
+"7-	c #9E152C",
+"8-	c #8C1A2F",
+"9-	c #8B3C51",
+"0-	c #A5778C",
+"a-	c #8A7D8D",
+"b-	c #696D7E",
+"c-	c #6A7682",
+"d-	c #545F69",
+"e-	c #525D62",
+"f-	c #414444",
+"g-	c #393D45",
+"h-	c #5F6066",
+"i-	c #773C42",
+"j-	c #9A3C30",
+"k-	c #BA351C",
+"l-	c #DB371B",
+"m-	c #EF3919",
+"n-	c #F54B15",
+"o-	c #EC4508",
+"p-	c #F4400E",
+"q-	c #F12E00",
+"r-	c #DF1A00",
+"s-	c #C50700",
+"t-	c #D52003",
+"u-	c #E63008",
+"v-	c #CB0F05",
+"w-	c #C4000A",
+"x-	c #CC0013",
+"y-	c #CB171D",
+"z-	c #C05558",
+"A-	c #904557",
+"B-	c #94101F",
+"C-	c #C50F1E",
+"D-	c #D62832",
+"E-	c #C9452A",
+"F-	c #B14606",
+"G-	c #CB560F",
+"H-	c #DD4B2A",
+"I-	c #A90714",
+"J-	c #B01331",
+"K-	c #970D29",
+"L-	c #8D213A",
+"M-	c #965569",
+"N-	c #BDA0B2",
+"O-	c #7A7988",
+"P-	c #4F5A68",
+"Q-	c #6F7B88",
+"R-	c #5F6872",
+"S-	c #515B5E",
+"T-	c #3D4349",
+"U-	c #56454C",
+"V-	c #8D5B42",
+"W-	c #B56032",
+"X-	c #D66428",
+"Y-	c #EC6522",
+"Z-	c #EC6318",
+"`-	c #E96017",
+" ;	c #F26526",
+".;	c #FE5C27",
+"+;	c #ED360E",
+"@;	c #DD1E03",
+"#;	c #E82D0C",
+"$;	c #E42D0D",
+"%;	c #C61402",
+"&;	c #C31806",
+"*;	c #CB2410",
+"=;	c #CF3626",
+"-;	c #BF614F",
+";;	c #95684F",
+">;	c #A45E36",
+",;	c #BE5B1E",
+"';	c #CD641C",
+");	c #DF7322",
+"!;	c #C9610B",
+"~;	c #BD3F03",
+"{;	c #C7321D",
+"];	c #B02736",
+"^;	c #B44561",
+"/;	c #A44B67",
+"(;	c #A4647C",
+"_;	c #866378",
+":;	c #807788",
+"<;	c #6C7382",
+"[;	c #64727E",
+"};	c #7A8791",
+"|;	c #505762",
+"1;	c #5C3F2B",
+"2;	c #B37241",
+"3;	c #C76823",
+"4;	c #E67720",
+"5;	c #DF771A",
+"6;	c #E57E27",
+"7;	c #E26A21",
+"8;	c #E75621",
+"9;	c #E53A0B",
+"0;	c #EE370A",
+"a;	c #F94818",
+"b;	c #E54011",
+"c;	c #D7480B",
+"d;	c #DD640E",
+"e;	c #DC7214",
+"f;	c #DE7F1B",
+"g;	c #C88D2A",
+"h;	c #A08D34",
+"i;	c #968B34",
+"j;	c #B8A521",
+"k;	c #D79A13",
+"l;	c #DA640C",
+"m;	c #CC580F",
+"n;	c #BB4C08",
+"o;	c #BD542D",
+"p;	c #B97174",
+"q;	c #B390A1",
+"r;	c #927F93",
+"s;	c #948498",
+"t;	c #7C6E85",
+"u;	c #625C71",
+"v;	c #737888",
+"w;	c #6D7B86",
+"x;	c #4B5B5F",
+"y;	c #3C404A",
+"z;	c #1E0A00",
+"A;	c #905C3E",
+"B;	c #B76630",
+"C;	c #CF6C1A",
+"D;	c #D47111",
+"E;	c #DE7C19",
+"F;	c #DA6F12",
+"G;	c #DE6A1A",
+"H;	c #E36817",
+"I;	c #E36412",
+"J;	c #F0761B",
+"K;	c #EC7C14",
+"L;	c #EB8F0F",
+"M;	c #E39E09",
+"N;	c #DEA90A",
+"O;	c #DFB905",
+"P;	c #D2B806",
+"Q;	c #B9A819",
+"R;	c #988F32",
+"S;	c #AE9822",
+"T;	c #D88B13",
+"U;	c #D0500E",
+"V;	c #B15610",
+"W;	c #B68636",
+"X;	c #BB9B75",
+"Y;	c #A295A0",
+"Z;	c #8B96A7",
+"`;	c #738692",
+" >	c #6B7583",
+".>	c #79758A",
+"+>	c #746B7F",
+"@>	c #797686",
+"#>	c #555C67",
+"$>	c #333D44",
+"%>	c #3F454E",
+"&>	c #282727",
+"*>	c #6B4E35",
+"=>	c #B27A47",
+"->	c #BF6C1A",
+";>	c #D0690A",
+">>	c #DA7208",
+",>	c #DE8115",
+"'>	c #EE9B2D",
+")>	c #EC9E2F",
+"!>	c #DA8715",
+"~>	c #E8941A",
+"{>	c #EEA015",
+"]>	c #E8A907",
+"^>	c #D6AB00",
+"/>	c #D4B900",
+"(>	c #D9CA00",
+"_>	c #D5C700",
+":>	c #CCBC13",
+"<>	c #AE9D40",
+"[>	c #A47F1D",
+"}>	c #CC740B",
+"|>	c #D9641B",
+"1>	c #A36A12",
+"2>	c #A7A153",
+"3>	c #B3B3A2",
+"4>	c #898FAB",
+"5>	c #687F97",
+"6>	c #6A8993",
+"7>	c #607580",
+"8>	c #797F90",
+"9>	c #757382",
+"0>	c #6C6774",
+"a>	c #5D646C",
+"b>	c #918D84",
+"c>	c #A08A64",
+"d>	c #AA792E",
+"e>	c #DB8923",
+"f>	c #DD8509",
+"g>	c #DC9B14",
+"h>	c #DEB11F",
+"i>	c #D9B11B",
+"j>	c #D9AB0F",
+"k>	c #EAB31A",
+"l>	c #F1BB1B",
+"m>	c #EABE0F",
+"n>	c #DEC306",
+"o>	c #D8CE07",
+"p>	c #D1CD05",
+"q>	c #D0BE06",
+"r>	c #CDA51B",
+"s>	c #B78745",
+"t>	c #976627",
+"u>	c #A9732E",
+"v>	c #B7865D",
+"w>	c #93855B",
+"x>	c #898C6E",
+"y>	c #929695",
+"z>	c #7D8A94",
+"A>	c #6F848E",
+"B>	c #758A94",
+"C>	c #657982",
+"D>	c #5C6B71",
+"E>	c #575B66",
+"F>	c #53525E",
+"G>	c #3C434F",
+"H>	c #2B3952",
+"I>	c #B5CEE0",
+"J>	c #6D7C70",
+"K>	c #958E50",
+"L>	c #DBAC3B",
+"M>	c #EEB118",
+"N>	c #EEC919",
+"O>	c #E5D410",
+"P>	c #D8CB04",
+"Q>	c #DCCE03",
+"R>	c #E9D20F",
+"S>	c #F4D51F",
+"T>	c #F7D624",
+"U>	c #F6D71F",
+"V>	c #E3C915",
+"W>	c #BCA80C",
+"X>	c #A6800B",
+"Y>	c #AC6729",
+"Z>	c #B66E64",
+"`>	c #976C69",
+" ,	c #85897F",
+".,	c #85AAAB",
+"+,	c #869DAC",
+"@,	c #757B9C",
+"#,	c #6F7B94",
+"$,	c #778B81",
+"%,	c #818F88",
+"&,	c #7E848B",
+"*,	c #5A676E",
+"=,	c #39484B",
+"-,	c #3B444D",
+";,	c #5B5F68",
+">,	c #39415D",
+",,	c #9CABCA",
+"',	c #6D757B",
+"),	c #858154",
+"!,	c #A98923",
+"~,	c #E7B423",
+"{,	c #F5C11B",
+"],	c #F9C40D",
+"^,	c #EEBC02",
+"/,	c #DDB300",
+"(,	c #DAB404",
+"_,	c #DCB016",
+":,	c #DCA321",
+"<,	c #DA8B1C",
+"[,	c #D87D1A",
+"},	c #BF7A33",
+"|,	c #9A6243",
+"1,	c #975F65",
+"2,	c #A5819A",
+"3,	c #9994B2",
+"4,	c #849FAD",
+"5,	c #83A5A4",
+"6,	c #938E9A",
+"7,	c #8C80A6",
+"8,	c #7782A5",
+"9,	c #828F8B",
+"0,	c #686B64",
+"a,	c #5C5D64",
+"b,	c #4C535E",
+"c,	c #8990B4",
+"d,	c #A9ACBD",
+"e,	c #635E46",
+"f,	c #755C0F",
+"g,	c #C0921E",
+"h,	c #D49614",
+"i,	c #E29708",
+"j,	c #E49E02",
+"k,	c #DB9E07",
+"l,	c #C79610",
+"m,	c #B98716",
+"n,	c #A15D0C",
+"o,	c #8E2C00",
+"p,	c #B2451F",
+"q,	c #DB8C7B",
+"r,	c #D29FAD",
+"s,	c #B893B4",
+"t,	c #9A92B7",
+"u,	c #7989B1",
+"v,	c #7492A9",
+"w,	c #8BA29F",
+"x,	c #9C8D92",
+"y,	c #8E7D9F",
+"z,	c #666E8D",
+"A,	c #687075",
+"B,	c #303232",
+"C,	c #323841",
+"D,	c #676D88",
+"E,	c #9197A8",
+"F,	c #7A7970",
+"G,	c #867349",
+"H,	c #C8A460",
+"I,	c #D3A457",
+"J,	c #D69D48",
+"K,	c #DCA346",
+"L,	c #DCA74D",
+"M,	c #C79B4D",
+"N,	c #B38849",
+"O,	c #9F6D43",
+"P,	c #874931",
+"Q,	c #975747",
+"R,	c #B58C86",
+"S,	c #B69FAB",
+"T,	c #A897AF",
+"U,	c #9393AD",
+"V,	c #818FAA",
+"W,	c #7D93A4",
+"X,	c #8D9E9F",
+"Y,	c #888288",
+"Z,	c #6F6981",
+"`,	c #484C5B",
+" '	c #3A404B",
+".'	c #5E636C",
+"+'	c #5E6675",
+"@'	c #959DB2",
+"#'	c #9194A7",
+"$'	c #BBB7C9",
+"%'	c #BDB5C8",
+"&'	c #B7A7B9",
+"*'	c #B9A2B7",
+"='	c #BFA5BB",
+"-'	c #AC96AD",
+";'	c #998BA6",
+">'	c #8E8CA8",
+",'	c #6F7B99",
+"''	c #667A99",
+")'	c #768EA2",
+"!'	c #849AA7",
+"~'	c #8C9FAA",
+"{'	c #8C9DA6",
+"]'	c #8A969D",
+"^'	c #717880",
+"/'	c #72787F",
+"('	c #4F5660",
+"_'	c #384049",
+":'	c #6F7988",
+"<'	c #788B9D",
+"['	c #859BAC",
+"}'	c #8B9EAE",
+"|'	c #96A6B4",
+"1'	c #8F9BA8",
+"2'	c #848E9D",
+"3'	c #7A8999",
+"4'	c #8295A8",
+"5'	c #86A0B8",
+"6'	c #7495B1",
+"7'	c #6C8EAA",
+"8'	c #7E95A7",
+"9'	c #909CA6",
+"0'	c #939FA7",
+"a'	c #8F9AA3",
+"b'	c #6A737C",
+"c'	c #2C3038",
+"d'	c #2D313B",
+"e'	c #3C424C",
+"f'	c #353B49",
+"g'	c #7C8CA0",
+"h'	c #6A8098",
+"i'	c #869BB1",
+"j'	c #8C9FB2",
+"k'	c #869AA9",
+"l'	c #91A6B5",
+"m'	c #8BA2B4",
+"n'	c #7992A6",
+"o'	c #7C99B1",
+"p'	c #8BABC8",
+"q'	c #7697B2",
+"r'	c #7B8EA0",
+"s'	c #9BA4AE",
+"t'	c #79838B",
+"u'	c #3C414D",
+"v'	c #5C6B81",
+"w'	c #778497",
+"x'	c #8692A2",
+"y'	c #8694A0",
+"z'	c #8A9AA5",
+"A'	c #8395A2",
+"B'	c #718595",
+"C'	c #687D90",
+"D'	c #698199",
+"E'	c #5B738A",
+"F'	c #647381",
+"G'	c #575E68",
+"H'	c #393F4A",
+"I'	c #3B3D48",
+"J'	c #2E2530",
+"K'	c #47444A",
+"L'	c #4C4F52",
+"M'	c #464A4B",
+"N'	c #404546",
+"O'	c #36383A",
+"P'	c #32353B",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . @ # $ . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . % & * = - ; > , . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . ' . ) ! ~ { ] ^ / ( _ : < [ . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . ' } | 1 2 3 4 5 6 7 8 9 0 a b c . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . d e f g h i j k l m n o p q r s + . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . t u v w x y z A B C D E F G H I J K . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . L M N O P Q R S T U V W X Y Z `  ...+. at .#.. . . . . . ",
+". . . . . . . . . . . . . . . . . . . . $.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.. . . . . ",
+". . . . . . . . . . . . . . . . . . |.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.. . . . . ",
+". . . . . . . . . . . . . . . . . o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.. . . . . ",
+". . . . . . . . . . . . . . . L O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+,+. . . . . ",
+". . . . . . . . . . . . . L . '+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+. . . . ",
+". . . . . . . . . . . . e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+' . . . ",
+". . . . . . . . . . . P.K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@. . . ",
+". . . . . . . . . L !@~@{@]@^@/@(@_@:@<@[@}@|@1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c at d@e at f@g at h@i at j@k at l@m at . . ",
+". . . . . . . . . . n at o@p at q@r at s@t at u@v at w@x at y@z at A@B at C@D at E@F at G@H at I@J at K@L at M@N at O@P at Q@R at S@T at U@V at . . . ",
+". . . . . . . W at X@Y at Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#. . ",
+". . . . . 6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#D#E#F#G#H#I#J#K#. ",
+". . . . L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$. ",
+". . . L }$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$. ",
+". . . F$G$H$I$J$K$L$V+M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%{%]%^%. ",
+". . /%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%. ",
+". . B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&;&u%>&,&'&)&!&~&. ",
+". {&]&^&/&(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&. ",
+". z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*%*&***=*-*;*>*,*'*)*!*~*. ",
+". {*]*^*/*(*_*:*<*9&[*}*|*1*2*3*4*5*6*7*8*9*0*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*. ",
+". . y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*===-=;=>=,=. . . ",
+". . '=)=!=~={=]=^=/=(=_=:=<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=d=e=f=g=h=i=j=k=l=m=n=o=p=q=r=. . . ",
+". . . . s=t=u=v=w=x=y=z=A=B=C=D=E=F=G=H=I=J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=`= -.-+- at -#-$-. . . ",
+". . . . . %-&-*-=---;->-,-'-)-!-~-{-]-^-/-(-_-:-<-[-}-|-1-2-3-4-5-6-7-8-9-0-a-b-c-d-e-f-g-. . . ",
+". . . . . h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-. . . . ",
+". . . . . . U-V-W-X-Y-Z-`- ;.;+;@;#;$;%;&;*;=;-;;;>;,;';);!;~;{;];^;/;(;_;:;<;[;};|;$.. . . . . ",
+". . . . . . . 1;2;3;4;5;6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;. . . . . . . ",
+". . . . . . y;z;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;`; >.>+>@>#>$>. . . . . . . ",
+". . . . . . %>&>*>=>->;>>>,>'>)>!>~>{>]>^>/>(>_>:><>[>}>|>1>2>3>4>5>6>7>8>9>0>. . . . . . . . . ",
+". . . . . . . a>b>c>d>e>f>g>h>i>j>k>l>m>n>o>p>q>r>s>t>u>v>w>x>y>z>A>B>C>D>E>F>. . . . . . . . . ",
+". . . . . . G>H>I>J>K>L>M>N>O>P>Q>R>S>T>U>V>W>X>Y>Z>`> ,.,+,@,#,$,%,&,*,=,-,. . . . . . . . . . ",
+". . . . . . ;,>,,,',),!,~,{,],^,/,(,_,:,<,[,},|,1,2,3,4,5,6,7,8,9,0,a,. . . . . . . . . . . . . ",
+". . . . . . . b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,. . . . . . . . . . . . . ",
+". . . . . . . ' D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,`, '.'. . . . . . . . . . . . . . ",
+". . . . . . . . 1.+'@'#'$'%'&'*'='-';'>',''')'!'~'{']'^'/'('_'. . . . . . . . . . . . . . . . . ",
+". . . . . . . . . ' :'<'['}'|'1'2'3'4'5'6'7'8'9'0'a'b'c'd'. . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'. u'. . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . .'v'w'x'y'z'A'B'C'D'E'F'G'H'. . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . I'J'K'L'M'N'O'P'. . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/string_violin_cello.xpm b/images/MusicalInstruments/string_violin_cello.xpm
new file mode 100644
index 0000000..41bc6f3
--- /dev/null
+++ b/images/MusicalInstruments/string_violin_cello.xpm
@@ -0,0 +1,650 @@
+/* XPM */
+static char * string_violin_cello_xpm[] = {
+"48 48 599 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #959595",
+"@ 	c #939293",
+"# 	c #8B8587",
+"$ 	c #908D8D",
+"% 	c #909191",
+"& 	c #8B8C8E",
+"* 	c #8C8D8E",
+"= 	c #919192",
+"- 	c #838082",
+"; 	c #766E72",
+"> 	c #7E7B7D",
+", 	c #949494",
+"' 	c #7B7F82",
+") 	c #75797D",
+"! 	c #808183",
+"~ 	c #69676B",
+"{ 	c #625F65",
+"] 	c #6F6F74",
+"^ 	c #858688",
+"/ 	c #939494",
+"( 	c #797D80",
+"_ 	c #5A6167",
+": 	c #5A5F63",
+"< 	c #595E63",
+"[ 	c #5F646A",
+"} 	c #7C7E81",
+"| 	c #929293",
+"1 	c #929393",
+"2 	c #7C7F82",
+"3 	c #5F656A",
+"4 	c #575C62",
+"5 	c #585D63",
+"6 	c #7E8082",
+"7 	c #7C8084",
+"8 	c #646B72",
+"9 	c #586068",
+"0 	c #5C6369",
+"a 	c #596067",
+"b 	c #6D7176",
+"c 	c #87888A",
+"d 	c #7D8084",
+"e 	c #666B74",
+"f 	c #5A616B",
+"g 	c #626870",
+"h 	c #7A7D81",
+"i 	c #868889",
+"j 	c #909192",
+"k 	c #7F8185",
+"l 	c #646A73",
+"m 	c #636971",
+"n 	c #959494",
+"o 	c #929292",
+"p 	c #929090",
+"q 	c #929190",
+"r 	c #929191",
+"s 	c #919191",
+"t 	c #808387",
+"u 	c #60666F",
+"v 	c #585F6A",
+"w 	c #626971",
+"x 	c #7B7E82",
+"y 	c #918D8C",
+"z 	c #868180",
+"A 	c #857C78",
+"B 	c #887C77",
+"C 	c #867F7C",
+"D 	c #7F7E7F",
+"E 	c #919090",
+"F 	c #919293",
+"G 	c #5E666F",
+"H 	c #545C66",
+"I 	c #5F666E",
+"J 	c #7E8084",
+"K 	c #959493",
+"L 	c #938C89",
+"M 	c #896B5E",
+"N 	c #885941",
+"O 	c #8B5234",
+"P 	c #8E502F",
+"Q 	c #885134",
+"R 	c #745E55",
+"S 	c #827874",
+"T 	c #8C8A8A",
+"U 	c #7C8085",
+"V 	c #606872",
+"W 	c #555D68",
+"X 	c #5D646C",
+"Y 	c #808285",
+"Z 	c #949393",
+"` 	c #908885",
+" .	c #87695E",
+"..	c #915134",
+"+.	c #9D471A",
+"@.	c #A54512",
+"#.	c #A34212",
+"$.	c #963C15",
+"%.	c #823F26",
+"&.	c #705246",
+"*.	c #696466",
+"=.	c #5F6771",
+"-.	c #59636E",
+";.	c #626972",
+">.	c #909091",
+",.	c #939394",
+"'.	c #8B8889",
+").	c #81706C",
+"!.	c #864B38",
+"~.	c #9A3F1A",
+"{.	c #A6400E",
+"].	c #A9410C",
+"^.	c #A23C0F",
+"/.	c #933514",
+"(.	c #7F341C",
+"_.	c #644640",
+":.	c #565259",
+"<.	c #555B67",
+"[.	c #636972",
+"}.	c #7D8185",
+"|.	c #8A8B8C",
+"1.	c #7B7273",
+"2.	c #75504B",
+"3.	c #8A331D",
+"4.	c #9C3510",
+"5.	c #A0390F",
+"6.	c #9A3A11",
+"7.	c #8F3816",
+"8.	c #813822",
+"9.	c #6C3F39",
+"0.	c #5D4E55",
+"a.	c #5B525A",
+"b.	c #625758",
+"c.	c #746966",
+"d.	c #8E8B89",
+"e.	c #7F8082",
+"f.	c #6D595B",
+"g.	c #73332A",
+"h.	c #8B220C",
+"i.	c #952E11",
+"j.	c #912F11",
+"k.	c #873014",
+"l.	c #7B3521",
+"m.	c #6C423A",
+"n.	c #595563",
+"o.	c #5F5967",
+"p.	c #725451",
+"q.	c #80503B",
+"r.	c #855C42",
+"s.	c #887B72",
+"t.	c #878182",
+"u.	c #775654",
+"v.	c #76281C",
+"w.	c #892510",
+"x.	c #8B2811",
+"y.	c #822A16",
+"z.	c #763021",
+"A.	c #673F3B",
+"B.	c #5A5563",
+"C.	c #5F5F73",
+"D.	c #6F5A62",
+"E.	c #8E4931",
+"F.	c #A54613",
+"G.	c #9E5320",
+"H.	c #7C6553",
+"I.	c #7F7E7E",
+"J.	c #898080",
+"K.	c #775652",
+"L.	c #712B1F",
+"M.	c #88240F",
+"N.	c #842917",
+"O.	c #773125",
+"P.	c #664143",
+"Q.	c #5B5362",
+"R.	c #615E71",
+"S.	c #705E68",
+"T.	c #854835",
+"U.	c #9D461D",
+"V.	c #AF4F11",
+"W.	c #AE5813",
+"X.	c #966130",
+"Y.	c #87807B",
+"Z.	c #8C8C8E",
+"`.	c #88898B",
+" +	c #838687",
+".+	c #898485",
+"++	c #7F6766",
+"@+	c #75413A",
+"#+	c #792A1B",
+"$+	c #7F2B19",
+"%+	c #753328",
+"&+	c #644347",
+"*+	c #5B5262",
+"=+	c #5F5C6E",
+"-+	c #6F5B62",
+";+	c #844A38",
+">+	c #96411D",
+",+	c #A84815",
+"'+	c #B65710",
+")+	c #B46112",
+"!+	c #9D632E",
+"~+	c #8C8075",
+"{+	c #93918F",
+"]+	c #8E8C8C",
+"^+	c #7A767A",
+"/+	c #726D72",
+"(+	c #7D797A",
+"_+	c #868182",
+":+	c #6D6669",
+"<+	c #725C5B",
+"[+	c #72433F",
+"}+	c #752C22",
+"|+	c #7D2717",
+"1+	c #793122",
+"2+	c #634242",
+"3+	c #585261",
+"4+	c #5D5A6E",
+"5+	c #6D5860",
+"6+	c #834C3D",
+"7+	c #953F1A",
+"8+	c #A34311",
+"9+	c #AE5010",
+"0+	c #B85C0D",
+"a+	c #9A6434",
+"b+	c #897F76",
+"c+	c #919292",
+"d+	c #868688",
+"e+	c #868081",
+"f+	c #7D6F6F",
+"g+	c #6B5153",
+"h+	c #634346",
+"i+	c #694F4F",
+"j+	c #705857",
+"k+	c #623D3D",
+"l+	c #61312C",
+"m+	c #69281F",
+"n+	c #762215",
+"o+	c #7F2514",
+"p+	c #793527",
+"q+	c #5F4C50",
+"r+	c #5D5967",
+"s+	c #6B5862",
+"t+	c #814D43",
+"u+	c #96411B",
+"v+	c #A24010",
+"w+	c #AB4B0D",
+"x+	c #B4580B",
+"y+	c #B75D0B",
+"z+	c #AD5D19",
+"A+	c #956641",
+"B+	c #89837F",
+"C+	c #939291",
+"D+	c #939292",
+"E+	c #868384",
+"F+	c #696266",
+"G+	c #694E4D",
+"H+	c #6A433F",
+"I+	c #672722",
+"J+	c #631914",
+"K+	c #5E241E",
+"L+	c #5C2A23",
+"M+	c #641711",
+"N+	c #641E14",
+"O+	c #6D2315",
+"P+	c #7A2513",
+"Q+	c #832A16",
+"R+	c #833924",
+"S+	c #754841",
+"T+	c #735455",
+"U+	c #814F46",
+"V+	c #954326",
+"W+	c #A44211",
+"X+	c #AB490B",
+"Y+	c #B0550C",
+"Z+	c #B65B0B",
+"`+	c #B25D16",
+" @	c #A46331",
+".@	c #94715B",
+"+@	c #928E8B",
+"@@	c #939393",
+"#@	c #888383",
+"$@	c #74605F",
+"%@	c #6F4039",
+"&@	c #73281A",
+"*@	c #702113",
+"=@	c #701B11",
+"-@	c #6B1911",
+";@	c #5E1B13",
+">@	c #541B13",
+",@	c #5A1B14",
+"'@	c #6D281A",
+")@	c #84341D",
+"!@	c #91371B",
+"~@	c #913314",
+"{@	c #953513",
+"]@	c #8C3B26",
+"^@	c #8E3F27",
+"/@	c #99401F",
+"(@	c #A54312",
+"_@	c #AD4B09",
+":@	c #B15B0A",
+"<@	c #B1570A",
+"[@	c #A85C1C",
+"}@	c #9B6539",
+"|@	c #94755E",
+"1@	c #958E89",
+"2@	c #8F8F90",
+"3@	c #686D73",
+"4@	c #716C6E",
+"5@	c #795F5A",
+"6@	c #733A31",
+"7@	c #79200F",
+"8@	c #7B2310",
+"9@	c #7D2212",
+"0@	c #7F2115",
+"a@	c #7F2019",
+"b@	c #78201B",
+"c@	c #691F15",
+"d@	c #6A2015",
+"e@	c #782B1C",
+"f@	c #8C3E29",
+"g@	c #97482C",
+"h@	c #954020",
+"i@	c #953413",
+"j@	c #8D2D15",
+"k@	c #933714",
+"l@	c #9A4114",
+"m@	c #9B4819",
+"n@	c #954E1E",
+"o@	c #97531E",
+"p@	c #8D552B",
+"q@	c #82634C",
+"r@	c #88786D",
+"s@	c #938B86",
+"t@	c #969493",
+"u@	c #969595",
+"v@	c #949595",
+"w@	c #717175",
+"x@	c #77625F",
+"y@	c #7B453B",
+"z@	c #732114",
+"A@	c #7A1D0C",
+"B@	c #7D2211",
+"C@	c #7F2313",
+"D@	c #7F2413",
+"E@	c #802414",
+"F@	c #802215",
+"G@	c #7C1F11",
+"H@	c #771E10",
+"I@	c #7A2519",
+"J@	c #843627",
+"K@	c #8F4830",
+"L@	c #954D2D",
+"M@	c #963C19",
+"N@	c #882E10",
+"O@	c #8A3813",
+"P@	c #8E4621",
+"Q@	c #8D5739",
+"R@	c #896753",
+"S@	c #856957",
+"T@	c #74645B",
+"U@	c #7D7773",
+"V@	c #8C8A89",
+"W@	c #898A8B",
+"X@	c #736E6F",
+"Y@	c #76514B",
+"Z@	c #793125",
+"`@	c #771B0D",
+" #	c #792013",
+".#	c #7B2215",
+"+#	c #7A2212",
+"@#	c #792311",
+"##	c #7A2211",
+"$#	c #7D2111",
+"%#	c #811F0F",
+"&#	c #7D1F10",
+"*#	c #7A2115",
+"=#	c #7F2C1F",
+"-#	c #8B3D28",
+";#	c #944A2B",
+">#	c #8F3F1D",
+",#	c #7F3012",
+"'#	c #7F391C",
+")#	c #85553D",
+"!#	c #8C7265",
+"~#	c #8D8480",
+"{#	c #898484",
+"]#	c #7E7F82",
+"^#	c #8A8A8C",
+"/#	c #808284",
+"(#	c #6A6465",
+"_#	c #6A3F38",
+":#	c #732518",
+"<#	c #7A1D0F",
+"[#	c #792116",
+"}#	c #772116",
+"|#	c #712010",
+"1#	c #701F10",
+"2#	c #701F12",
+"3#	c #711F12",
+"4#	c #742010",
+"5#	c #782514",
+"6#	c #7B2415",
+"7#	c #832816",
+"8#	c #8D321A",
+"9#	c #923B1E",
+"0#	c #82381B",
+"a#	c #792B14",
+"b#	c #743B2A",
+"c#	c #7D6259",
+"d#	c #8D8784",
+"e#	c #8C8C8D",
+"f#	c #6C6A6B",
+"g#	c #663E39",
+"h#	c #702316",
+"i#	c #7A1E0F",
+"j#	c #782315",
+"k#	c #712115",
+"l#	c #6A1E12",
+"m#	c #641B12",
+"n#	c #5E1B14",
+"o#	c #5B1D16",
+"p#	c #5C2215",
+"q#	c #692818",
+"r#	c #7A2D16",
+"s#	c #892D10",
+"t#	c #922E10",
+"u#	c #8D3017",
+"v#	c #772B17",
+"w#	c #772417",
+"x#	c #6D423E",
+"y#	c #726769",
+"z#	c #848688",
+"A#	c #6C6A6C",
+"B#	c #623F39",
+"C#	c #6C2417",
+"D#	c #791E0F",
+"E#	c #702015",
+"F#	c #651D14",
+"G#	c #581B16",
+"H#	c #4A1B17",
+"I#	c #3F1C17",
+"J#	c #401E19",
+"K#	c #58251B",
+"L#	c #762B17",
+"M#	c #8B2E11",
+"N#	c #933012",
+"O#	c #883117",
+"P#	c #692D17",
+"Q#	c #6C3522",
+"R#	c #785C55",
+"S#	c #898180",
+"T#	c #7B7A7B",
+"U#	c #685453",
+"V#	c #6A312A",
+"W#	c #761E11",
+"X#	c #772112",
+"Y#	c #6D2014",
+"Z#	c #611C15",
+"`#	c #511B17",
+" $	c #461C18",
+".$	c #441D19",
+"+$	c #471F1B",
+"@$	c #64261B",
+"#$	c #802B16",
+"$$	c #932F13",
+"%$	c #9A3215",
+"&$	c #943219",
+"*$	c #7D2C11",
+"=$	c #77301A",
+"-$	c #775249",
+";$	c #837977",
+">$	c #8D8C8D",
+",$	c #766F70",
+"'$	c #674846",
+")$	c #682920",
+"!$	c #732113",
+"~$	c #691E13",
+"{$	c #571D16",
+"]$	c #4C1D18",
+"^$	c #4D1D18",
+"/$	c #571E18",
+"($	c #612219",
+"_$	c #742815",
+":$	c #8A2E11",
+"<$	c #973310",
+"[$	c #9D3613",
+"}$	c #9D3615",
+"|$	c #923110",
+"1$	c #822B12",
+"2$	c #744A41",
+"3$	c #7A7070",
+"4$	c #8B8B8C",
+"5$	c #888788",
+"6$	c #746767",
+"7$	c #643F3C",
+"8$	c #63241D",
+"9$	c #5D1D17",
+"0$	c #4F1E18",
+"a$	c #4E1F18",
+"b$	c #5A1F17",
+"c$	c #6C2017",
+"d$	c #752415",
+"e$	c #802A11",
+"f$	c #8E310F",
+"g$	c #98370F",
+"h$	c #9D3A10",
+"i$	c #9F3A11",
+"j$	c #9A3711",
+"k$	c #83361E",
+"l$	c #79564F",
+"m$	c #807878",
+"n$	c #8E8E8F",
+"o$	c #8A8585",
+"p$	c #716262",
+"q$	c #56383A",
+"r$	c #4B2324",
+"s$	c #4C201A",
+"t$	c #572016",
+"u$	c #692016",
+"v$	c #7A2217",
+"w$	c #7D2714",
+"x$	c #862D11",
+"y$	c #8F3410",
+"z$	c #97390F",
+"A$	c #9C3C0F",
+"B$	c #9E3C0F",
+"C$	c #963911",
+"D$	c #7C4A38",
+"E$	c #84716B",
+"F$	c #908C8B",
+"G$	c #8B8A8B",
+"H$	c #676569",
+"I$	c #423A3F",
+"J$	c #4E2723",
+"K$	c #662117",
+"L$	c #782115",
+"M$	c #7E2516",
+"N$	c #822B14",
+"O$	c #8A3113",
+"P$	c #913613",
+"Q$	c #973911",
+"R$	c #9C3A0F",
+"S$	c #9D3A0E",
+"T$	c #913713",
+"U$	c #7A564A",
+"V$	c #8B8280",
+"W$	c #8E8E8E",
+"X$	c #646365",
+"Y$	c #543E3F",
+"Z$	c #68291E",
+"`$	c #7E220F",
+" %	c #852712",
+".%	c #8C2F14",
+"+%	c #8C3010",
+"@%	c #913311",
+"#%	c #953411",
+"$%	c #9A340D",
+"%%	c #993610",
+"&%	c #854932",
+"*%	c #756764",
+"=%	c #898888",
+"-%	c #959495",
+";%	c #8A8A8A",
+">%	c #746665",
+",%	c #6F443C",
+"'%	c #782D1A",
+")%	c #842309",
+"!%	c #8A2A0F",
+"~%	c #8C2C10",
+"{%	c #8E2B0D",
+"]%	c #8D3115",
+"^%	c #864530",
+"/%	c #7F6259",
+"(%	c #8A8483",
+"_%	c #8C8786",
+":%	c #806C68",
+"<%	c #784F45",
+"[%	c #783827",
+"}%	c #7C2B15",
+"|%	c #7E2B17",
+"1%	c #7E2C19",
+"2%	c #7E3120",
+"3%	c #7D4134",
+"4%	c #7E5F58",
+"5%	c #8E8A89",
+"6%	c #7F7472",
+"7%	c #6E5853",
+"8%	c #683D34",
+"9%	c #6D4844",
+"0%	c #755E5D",
+"a%	c #877E7E",
+"b%	c #959594",
+"c%	c #77777A",
+"d%	c #656266",
+"e%	c #666569",
+"f%	c #6C676A",
+"g%	c #6F6D70",
+"h%	c #7D7E80",
+". . . . . . . . . . . . . . . . . . . . . . . . + + + + . + + + + + . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . + + + + + . + + + . + + + + . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . + + . . . . . . . . + + . + + + . + + + + . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . + + + + + . . . . . . . . . . . . . . + + + . . . . . . . . ",
+". . . . . . . . . . . . . . . . . + + + + + + + . . . . . . . . . . . . . + + + . . . . . . . . ",
+". . . . . . . . . . . . . . . . + . + + + + + . . . . . . . . . . . . . . + + + . + . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ # $ + + . . . . . ",
+". . . . . . . . . . . . . + + + . . . . . . . . . . . . . . . . . . % & * = - ; > * , + + . . . ",
+". . . . . . . . . . . . + + + + . . . . . . . . . . . . . . . . . . & ' ) ! ~ { ] ^ + + + + . . ",
+". . . . . . . . . . . . + + . . . . . . . . . . . . . . . . . . . . / ( _ : < [ } | . + + + . . ",
+". . . . . . . . . . . + + . . . . . . . . . . . . . . . . . . . . . 1 2 3 4 5 [ 6 , . + + + . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 7 8 9 0 a b c + . . . . . . ",
+". . . . . . . . + + + . . . . . . . . . . . . . . . . . . . . + 1 d e f g h h i = . . . . . . . ",
+". . . . . . . . + + + . . . . . . . . . . . . . . . . . . . + j k l f m h | , + . . . . . . . . ",
+". . . . . . . . + . . . . . . . . . . . + n o p q r s + . + j t u v w x | . . . . . . . . . . . ",
+". . . . . + + . . . . . . . . . . . . + + y z A B C D E + F t G H I J | . . . . . . . . . . + . ",
+". . . . . + + . . . . . . . . . . . . K L M N O P Q R S T U V W X Y j + . . . . . . . . . . . . ",
+". . . . . + + . . . . . . . . . . . Z `  ...+. at .#.$.%.&.*.=.-.;.Y >.+ . . . . . . . . . . + . + ",
+". . . . + + . . . . . . . . . . . ,.'.).!.~.{.].^./.(._.:.<.[.}.o + . . . . . . . . . . . . . . ",
+". . . . + + . . . . . . . . . . + |.1.2.3.4.5.6.7.8.9.0.a.b.c.d.+ . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . + e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.E + . . . . . . . . . . . . . + ",
+". . . . + . . . . . . . . . . . . t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.% . . . . . . . . . . + . . . ",
+". . . . . . . . . . . . . . . . . J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.r . . . . . . . . . . + + . . ",
+". . . . . . . . . . . Z.`.>.+  +.+++ at +#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+. . . . . . . . . + + + + . ",
+"+ + . . . . . + + + ]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+)+a+b+{+. . . . . . . . + + + + + . ",
+"+ + . . . . + c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+. . . . . . . . + + + + + . ",
+". . . . + + D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @. at +@n . . . . . . . + + . . . . . ",
+". . . . c+@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1 at + + . . . . . . . + + . . . . . ",
+". . + 2 at 3@4 at 5@6 at 7@8 at 9@0 at a@b at c@d at e@f at g@h at i@j at k@l at m@n at o@p at q@r at s@t at u@. . . . . . . . + + . . . . . ",
+". + v at o w at x@y at z@A at B@C at D@E at F@G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@K . . . . . . . . . . . . . + . . . ",
+"+ + @@W at X@Y at Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#,.. . . . . . . . . . . . . . . . . . ",
+"+ + 1 /#(#_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#. . + + . . . . . . . . . . + + . . . . . . . ",
+". . , e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#. . . . . . . . . . . . + + + + . . . . . . . ",
+". . + s A#B#C#D#*#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#+ . . . . . . . . . . . . + + + + . . . . . . . ",
+". . + v at T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$s . . . . . . . . . . . . + + + + . . . . . . . ",
+"+ + + + >$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$. . . . . . . . . . . . . + . . . . . . . . . ",
+". + + + . 5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$. . . . . . . . . + + . . . . . . . . . . . . ",
+". + . + . . o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$. . . . . . . . . . + + . . . . . . . . . . . . ",
+". . + + + . . G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$+ . . . . . . . . . . + + . . . . . . . . . . . . ",
+". . + + + . . + W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%+ . . . . . . . . . . . + . . . . . . . . . . . . ",
+". . + + + . . . -%;%>%,%'%)%!%!%~%{%]%^%/%(%o + . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . _%:%<%[%}%|%1%2%3%4%V$D++ . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . + . . . . 5%6%7%8%_#9.9%0%a%b%+ . . . . . + + . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . + + + + e#c%d%e%f%g%h%+ . . . . + + + + . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . + + + + . + , >.2@, + + + . . + + + . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . + + + + . + + + + + + + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . + + + . + + + . . . . + + . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . + . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/synth.xpm b/images/MusicalInstruments/synth.xpm
new file mode 100644
index 0000000..93d429d
--- /dev/null
+++ b/images/MusicalInstruments/synth.xpm
@@ -0,0 +1,414 @@
+/* XPM */
+static char * synth_xpm[] = {
+"48 48 363 2",
+"  	c None",
+". 	c #969696",
+"+ 	c #727272",
+"@ 	c #787878",
+"# 	c #7D7B7F",
+"$ 	c #7A797E",
+"% 	c #7C7B7F",
+"& 	c #7B7B7C",
+"* 	c #767675",
+"= 	c #737373",
+"- 	c #747474",
+"; 	c #797979",
+"> 	c #919191",
+", 	c #848583",
+"' 	c #666275",
+") 	c #676183",
+"! 	c #676181",
+"~ 	c #676185",
+"{ 	c #67607D",
+"] 	c #6B6A6E",
+"^ 	c #898A85",
+"/ 	c #8F8F91",
+"( 	c #8B8B8A",
+"_ 	c #8B8B8B",
+": 	c #8D8D8D",
+"< 	c #8F8F8F",
+"[ 	c #999999",
+"} 	c #8A8A8A",
+"| 	c #949494",
+"1 	c #9A9A9A",
+"2 	c #8E8E8E",
+"3 	c #8C8C8C",
+"4 	c #898989",
+"5 	c #979797",
+"6 	c #E6E5E8",
+"7 	c #756E7E",
+"8 	c #2A1800",
+"9 	c #4D730C",
+"0 	c #42630D",
+"a 	c #43610D",
+"b 	c #4A6C0C",
+"c 	c #2D4700",
+"d 	c #2C2E2A",
+"e 	c #B8B3C4",
+"f 	c #DDDDDB",
+"g 	c #C6C6C6",
+"h 	c #C8C8C8",
+"i 	c #CACACA",
+"j 	c #C9C9C9",
+"k 	c #B8B8B8",
+"l 	c #B4B4B4",
+"m 	c #CCCCCC",
+"n 	c #CDCDCD",
+"o 	c #CBCBCB",
+"p 	c #BABABA",
+"q 	c #D9D9D9",
+"r 	c #CECECE",
+"s 	c #2E353E",
+"t 	c #444B54",
+"u 	c #FFFFFF",
+"v 	c #8E7EA8",
+"w 	c #4E8A00",
+"x 	c #C3FF0D",
+"y 	c #ADFF11",
+"z 	c #ACFF11",
+"A 	c #AFFF12",
+"B 	c #ACFF06",
+"C 	c #87F900",
+"D 	c #C6CFBA",
+"E 	c #FFF7FF",
+"F 	c #F3F7F0",
+"G 	c #F0F1F0",
+"H 	c #F1F1F1",
+"I 	c #F3F3F3",
+"J 	c #F8F8F8",
+"K 	c #BDBDBD",
+"L 	c #6F6F6F",
+"M 	c #C0C0C0",
+"N 	c #FBFBFB",
+"O 	c #F9F9F9",
+"P 	c #BFBFBF",
+"Q 	c #989898",
+"R 	c #6C6C6C",
+"S 	c #C4C4C4",
+"T 	c #6D6D6D",
+"U 	c #FDFDFD",
+"V 	c #FCFCFC",
+"W 	c #FAFAFA",
+"X 	c #1A1E23",
+"Y 	c #2C333B",
+"Z 	c #8A77A3",
+"` 	c #587A00",
+" .	c #B8FF08",
+"..	c #9FFF0C",
+"+.	c #9DFF0C",
+"@.	c #9FFF0D",
+"#.	c #97FF00",
+"$.	c #80EA00",
+"%.	c #E6E9D2",
+"&.	c #FFF9FF",
+"*.	c #F0F2F0",
+"=.	c #F2F2F2",
+"-.	c #F5F5F5",
+";.	c #7F7F7F",
+">.	c #2A2A2A",
+",.	c #151515",
+"'.	c #838383",
+").	c #888888",
+"!.	c #2D2D2D",
+"~.	c #7B7B7B",
+"{.	c #303030",
+"].	c #1B1B1B",
+"^.	c #F7F7F7",
+"/.	c #15181C",
+"(.	c #282F36",
+"_.	c #8F7EA5",
+":.	c #236200",
+"<.	c #8CFF00",
+"[.	c #84EA00",
+"}.	c #7FE900",
+"|.	c #7EE900",
+"1.	c #7DE900",
+"2.	c #80E900",
+"3.	c #82EA00",
+"4.	c #71E700",
+"5.	c #5AD300",
+"6.	c #D5E2C0",
+"7.	c #EEEFEE",
+"8.	c #EFEFEF",
+"9.	c #F0F0F0",
+"0.	c #ADADAD",
+"a.	c #343434",
+"b.	c #383838",
+"c.	c #9C9C9C",
+"d.	c #F6F6F6",
+"e.	c #B3B3B3",
+"f.	c #3A3A3A",
+"g.	c #353535",
+"h.	c #939393",
+"i.	c #424242",
+"j.	c #2F2F2F",
+"k.	c #EEEEEE",
+"l.	c #161A1E",
+"m.	c #293037",
+"n.	c #F0F0F1",
+"o.	c #D0CBD6",
+"p.	c #C4CDB3",
+"q.	c #E8F7C5",
+"r.	c #DEEFC3",
+"s.	c #E2EFC3",
+"t.	c #E8F4CB",
+"u.	c #F0F9D5",
+"v.	c #E9F4CC",
+"w.	c #E2F0C5",
+"x.	c #E2EEC5",
+"y.	c #E0EFC3",
+"z.	c #EAF4CF",
+"A.	c #EDF5C9",
+"B.	c #E3EEC2",
+"C.	c #FCFCFF",
+"D.	c #FAF9FA",
+"E.	c #FEFEFE",
+"F.	c #DCDCDC",
+"G.	c #EBEBEB",
+"H.	c #EAEAEA",
+"I.	c #E3E3E2",
+"J.	c #EAEAEC",
+"K.	c #EDECF0",
+"L.	c #D8CEDC",
+"M.	c #ECE1E4",
+"N.	c #FFF3FC",
+"O.	c #F4E7FF",
+"P.	c #E3D4F5",
+"Q.	c #E7DBFA",
+"R.	c #E0D3E1",
+"S.	c #E6DEE2",
+"T.	c #FFF2FB",
+"U.	c #F5E9FF",
+"V.	c #E6D7FA",
+"W.	c #E9DCFA",
+"X.	c #D5D2DA",
+"Y.	c #BFC0BD",
+"Z.	c #B5B5B5",
+"`.	c #C2C2C2",
+" +	c #D3D3D3",
+".+	c #D0D0D0",
+"++	c #DADADA",
+"@+	c #D1D1D1",
+"#+	c #C7C7C7",
+"$+	c #DBDBDB",
+"%+	c #D4D4D4",
+"&+	c #E5E5E5",
+"*+	c #E8E8E8",
+"=+	c #DDDDDD",
+"-+	c #E3E3E1",
+";+	c #92948F",
+">+	c #A1A39D",
+",+	c #A5A6A4",
+"'+	c #626360",
+")+	c #343532",
+"!+	c #000000",
+"~+	c #585956",
+"{+	c #ADAEAA",
+"]+	c #A4A5A2",
+"^+	c #656764",
+"/+	c #323330",
+"(+	c #464745",
+"_+	c #B6B6B5",
+":+	c #A6A6A6",
+"<+	c #A2A2A2",
+"[+	c #B2B2B2",
+"}+	c #AAAAAA",
+"|+	c #373737",
+"1+	c #3B3B3B",
+"2+	c #BCBCBC",
+"3+	c #ABABAB",
+"4+	c #3F3F3F",
+"5+	c #393939",
+"6+	c #AEAEAE",
+"7+	c #D2D2D2",
+"8+	c #A1A1A1",
+"9+	c #EDEDED",
+"0+	c #E9E9E9",
+"a+	c #414141",
+"b+	c #212121",
+"c+	c #757575",
+"d+	c #4A4A4A",
+"e+	c #050505",
+"f+	c #5B5B5B",
+"g+	c #E0E0E0",
+"h+	c #585858",
+"i+	c #1C1C1C",
+"j+	c #0C0C0C",
+"k+	c #454545",
+"l+	c #606060",
+"m+	c #262626",
+"n+	c #0D0D0D",
+"o+	c #464646",
+"p+	c #656565",
+"q+	c #272727",
+"r+	c #131313",
+"s+	c #404040",
+"t+	c #C3C3C3",
+"u+	c #DFDFDF",
+"v+	c #9B9B9B",
+"w+	c #F4F4F4",
+"x+	c #ECECEC",
+"y+	c #494949",
+"z+	c #010101",
+"A+	c #505050",
+"B+	c #2B2B2B",
+"C+	c #0B0B0B",
+"D+	c #636363",
+"E+	c #E2E2E2",
+"F+	c #5E5E5E",
+"G+	c #4C4C4C",
+"H+	c #666666",
+"I+	c #111111",
+"J+	c #515151",
+"K+	c #6A6A6A",
+"L+	c #191919",
+"M+	c #4D4D4D",
+"N+	c #DEDEDE",
+"O+	c #A8A8A8",
+"P+	c #BBBBBB",
+"Q+	c #E7E7E7",
+"R+	c #4B4B4B",
+"S+	c #2E2E2E",
+"T+	c #777777",
+"U+	c #525252",
+"V+	c #292929",
+"W+	c #626262",
+"X+	c #D6D6D6",
+"Y+	c #282828",
+"Z+	c #121212",
+"`+	c #686868",
+" @	c #313131",
+".@	c #101010",
+"+@	c #4E4E4E",
+"@@	c #474747",
+"#@	c #A7A7A7",
+"$@	c #C1C1C1",
+"%@	c #9D9D9D",
+"&@	c #E3E3E3",
+"*@	c #767676",
+"=@	c #535353",
+"-@	c #616161",
+";@	c #5F5F5F",
+">@	c #141414",
+",@	c #333333",
+"'@	c #484848",
+")@	c #E4E4E4",
+"!@	c #E6E6E6",
+"~@	c #565656",
+"{@	c #323232",
+"]@	c #020202",
+"^@	c #2C2C2C",
+"/@	c #0F0F0F",
+"(@	c #D5D5D5",
+"_@	c #171717",
+":@	c #4F4F4F",
+"<@	c #E1E1E1",
+"[@	c #D8D8D8",
+"}@	c #363636",
+"|@	c #242424",
+"1@	c #3D3D3D",
+"2@	c #202020",
+"3@	c #595959",
+"4@	c #1E1E1E",
+"5@	c #080808",
+"6@	c #252525",
+"7@	c #090909",
+"8@	c #444444",
+"9@	c #0A0A0A",
+"0@	c #D7D7D7",
+"a@	c #9E9E9E",
+"b@	c #878787",
+"c@	c #9F9F9F",
+"d@	c #ACACAC",
+"e@	c #707070",
+"f@	c #858585",
+"g@	c #868686",
+"h@	c #C5C5C5",
+"i@	c #CFCFCF",
+"j@	c #B6B6B6",
+"k@	c #B9B9B9",
+"l@	c #BEBEBE",
+"m@	c #A9A9A9",
+"n@	c #B1B1B1",
+"o@	c #909090",
+"p@	c #A0A0A0",
+"q@	c #7A7A7A",
+"r@	c #A5A5A5",
+"s@	c #B0B0B0",
+"t@	c #828282",
+"u@	c #6E6E6E",
+"v@	c #6B6B6B",
+"w@	c #717171",
+"x@	c #16191D",
+"y@	c #2A3138",
+"z@	c #404141",
+"A@	c #3D3D3E",
+"B@	c #3B3B3C",
+"C@	c #3C3C3C",
+"D@	c #15181B",
+"E@	c #292F37",
+"F@	c #313841",
+"G@	c #181B20",
+"H@	c #111316",
+"I@	c #121518",
+"J@	c #121519",
+"K@	c #131619",
+"L@	c #2D353D",
+"M@	c #1F2429",
+"N@	c #1B1F24",
+"O@	c #1C2025",
+"P@	c #1C2126",
+"Q@	c #1B2024",
+"R@	c #2E363E",
+"S@	c #343C45",
+"T@	c #323A43",
+"U@	c #333B44",
+"V@	c #343C46",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . + @ # $ $ $ $ $ $ $ $ $ $ $ % & * = = = = = = = = = = = = - = = = = = - = = = ; + . . . . . ",
+". . > , ' ) ! ! ! ! ! ! ! ! ! ~ { ] ^ / ( _ _ : < . [ < } _ < | 1 2 3 } < | [ > 4 5 < . . . . . ",
+". . 6 7 8 9 0 a a a a a a a a b c d e f g h h i j k l m n j o p l m m o o p l i o q r s t . . . ",
+". . u v w x y z z z z z z z A B C D E F G H I J K > L M N O P Q R P N O S . T l U V W X Y . . . ",
+". . u Z `  ...+.+.+.+.+.+.+. at .#.$.%.&.*.=.=.-.u ;.>.,.'.u u ).!.,.~.V U . {.].L =.u ^./.(.. . . ",
+". . u _.:.<.[.}.|.1.|.2.2.2.3.4.5.6.&.7.8.8.9.V 0.a.b.c.d.V e.f.g.h.H N K i.j.2 k.V d.l.m.. . . ",
+". . n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.u D.W O W V U E.q =.J V E.u q 9.J V U u F.G.H.d.=.l.m.. . . ",
+". . I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.K Z.`.q  +h .+i i ++ +j @+n #+$+%+i n @+q &+k.*+l.m.. . . ",
+". . =+-+;+>+,+'+)+!+~+{+]+^+/+!+(+_+:+<+[+}+L |+!+1+2+3+- 4+!+5+6+e.@ i.!+{.c.< q G.F.l.m.. . . ",
+". . 7+n 8+9+0+a+b+!+c+u H d+].e+f+u %+g+u ^.h+i+j+k+u u l+m+n+o+O u p+q+r+s+$+<+t+u+.+l.m.. . . ",
+". . i S v+w+x+y+{.z+; u ^.A+B+C+D+u ++E+u ^.F+q+,.G+u u H+j.I+J+O u K+{.L+M+N+O+P+ +i l.m.. . . ",
+". . S 2+1 9+Q+R+S+!+T+u =.U+V+C+W+u X+=+u w+l+Y+Z+G+u V `+ @. at +@-.u K+ @].@@$+#@Z.o S l.m.. . . ",
+". . $@p %@G.&@R+S+!+*@u H =@Y+C+- at u X+++u 9.;@Y+>@M+u W p+{.I+M+=.u K+,@].'@q }+l j $@l.m.. . . ",
+". . m #+}+)@!@~@{@]@T+u I F+^@/@l+u (@$+u =.K+B+_ at G+u E.+ a.r+:@8.u c+|+i+'@(@l $@q r l.m.. . . ",
+". . &@<@$@&+[@}@|@!+L u G.1 at 2@z+3 at u (@++u G.y+4 at 5@i.u J J+6 at 7@8 at H u ~@6 at I+f.%+S =+-.!@l.m.. . . ",
+". . =.I %+Q+3+!+Z+!+H+u j !+n+!+A+E. +q E..+5 at 9@!+|+u F./@9@!+1+k.V n+.@!+!.h  +H V ^.l.m.. . . ",
+". . =.H 0@=+H.a at T+b@#@x+w+a at L 3 c@&+ at +q ^.H #@T 3 [ &+N d at e@f at v+q u 6+= g at c.K 0 at H V ^.l.m.. . . ",
+". . &+)@ +0 at d.U m W H Q+O d.`.u H H.r q 9.J U P u 9.&+^.u h at J W !@w+u t+=.U %+7+<@w+0+l.m.. . . ",
+". . @+i at j q 9+&+%+9+H 9+8.u+m w+=.=.o [@H 8.&@i I k.9+k.)@m x+I 9+9+!@o Q+H N+i n u+0 at l.m.. . . ",
+". . j@[+k at q G.E+.+Q+x+0+x+$+#+x+x+9+o X+k.x+E+g G.0+0+x+g+j !@9+0+G.&@h E+x+N+l@[+`.P+l.m.. . . ",
+". . 5 > m@[@x+N+.+G.H.)@0+$+i 9.Q+G.i F.8.Q+<@#+9.!@!@*+u+j G.x+)@H.<@#+u+9+F.n at o@p@%@l.m.. . . ",
+". . q at c+r@h S M P #+S $@t+`.l at j M g l at g S t+S 2+h $@$@t+`.l at g S $@t+S K `.t+j s at T+;.t at l.m.. . . ",
+". . u at R + e at v@R u at K+v@v at v@T e at K+v@K+e at T v at v@v at w@K+v at v@v at T e at K+v@v at v@v at e@T K+L + v at - w at x@y at . . . ",
+". . z at z@A at f.B@1+1+1+1+1+1+1+f.1+1+1+f.1+1+1+1+f.1+1+1+1+1+f.1+1+1+1+1+f.1+1+f.C at s+k+i.D@E at . . . ",
+". . . F at G@H at I@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@J at J@I at H@K@(.. . . ",
+". . . L at M@N at O@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at P@P at Q@M at R@. . . ",
+". . . . S at T@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@U at U@T at V@. . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "};
diff --git a/images/MusicalInstruments/tambo.xpm b/images/MusicalInstruments/tambo.xpm
new file mode 100644
index 0000000..a88162a
--- /dev/null
+++ b/images/MusicalInstruments/tambo.xpm
@@ -0,0 +1,1184 @@
+/* XPM */
+static char * tambo_xpm[] = {
+"48 48 1133 2",
+"  	c #969696",
+". 	c #7F8285",
+"+ 	c #6C7270",
+"@ 	c #7D8176",
+"# 	c #6F716F",
+"$ 	c #48525B",
+"% 	c #4C555E",
+"& 	c #586066",
+"* 	c #5E656D",
+"= 	c #5D6269",
+"- 	c #5F5A54",
+"; 	c #3D382E",
+"> 	c #28241E",
+", 	c #393238",
+"' 	c #615D62",
+") 	c #504C4E",
+"! 	c #4D4B4A",
+"~ 	c #58595B",
+"{ 	c #535B64",
+"] 	c #4D565D",
+"^ 	c #6A6F6D",
+"/ 	c #7C7E78",
+"( 	c #87857F",
+"_ 	c #8E887D",
+": 	c #746450",
+"< 	c #705F4A",
+"[ 	c #594A37",
+"} 	c #4E4134",
+"| 	c #4D4343",
+"1 	c #625959",
+"2 	c #463D3C",
+"3 	c #2F2A27",
+"4 	c #3A3431",
+"5 	c #6F6D6F",
+"6 	c #606468",
+"7 	c #7F7A71",
+"8 	c #867F72",
+"9 	c #847E74",
+"0 	c #A69F8E",
+"a 	c #BFBA96",
+"b 	c #DBD0A3",
+"c 	c #DFCFA3",
+"d 	c #E6D1A6",
+"e 	c #E2CBA1",
+"f 	c #D1B992",
+"g 	c #D7BF99",
+"h 	c #DBC5A0",
+"i 	c #B09C79",
+"j 	c #786A4C",
+"k 	c #928468",
+"l 	c #8D8062",
+"m 	c #776C4E",
+"n 	c #786F52",
+"o 	c #8F866B",
+"p 	c #686D6B",
+"q 	c #626668",
+"r 	c #847A6B",
+"s 	c #71644D",
+"t 	c #716146",
+"u 	c #645133",
+"v 	c #9D8A6A",
+"w 	c #978763",
+"x 	c #998963",
+"y 	c #CAB68C",
+"z 	c #D8BF90",
+"A 	c #CBB27E",
+"B 	c #DCC08B",
+"C 	c #E8CD96",
+"D 	c #E9D299",
+"E 	c #E4CE97",
+"F 	c #E6D29C",
+"G 	c #DECB96",
+"H 	c #DDCA95",
+"I 	c #D8C692",
+"J 	c #C9B986",
+"K 	c #CAB987",
+"L 	c #BFB285",
+"M 	c #A49D7C",
+"N 	c #7F7F6E",
+"O 	c #5A6164",
+"P 	c #7B7E81",
+"Q 	c #525960",
+"R 	c #6F6554",
+"S 	c #766953",
+"T 	c #5B4B33",
+"U 	c #554427",
+"V 	c #766244",
+"W 	c #968165",
+"X 	c #6C5942",
+"Y 	c #685338",
+"Z 	c #9C8561",
+"` 	c #8B7246",
+" .	c #AC935F",
+"..	c #E3CE95",
+"+.	c #F2DA9E",
+"@.	c #E5D091",
+"#.	c #D2BF83",
+"$.	c #C5AF81",
+"%.	c #A58F64",
+"&.	c #947D52",
+"*.	c #A38B63",
+"=.	c #987F56",
+"-.	c #A0875E",
+";.	c #B69C71",
+">.	c #C2A778",
+",.	c #C8B281",
+"'.	c #C5BC8E",
+").	c #96947E",
+"!.	c #606462",
+"~.	c #49515B",
+"{.	c #5E656C",
+"].	c #7C7669",
+"^.	c #685A41",
+"/.	c #93846A",
+"(.	c #6F5C43",
+"_.	c #655036",
+":.	c #917C61",
+"<.	c #A8937B",
+"[.	c #8D7A67",
+"}.	c #69533D",
+"|.	c #8C775A",
+"1.	c #D8C49D",
+"2.	c #FFEEC3",
+"3.	c #E5D4A6",
+"4.	c #C0B38C",
+"5.	c #9E9570",
+"6.	c #988E6D",
+"7.	c #A19687",
+"8.	c #706153",
+"9.	c #634F41",
+"0.	c #8A7466",
+"a.	c #543B2C",
+"b.	c #6F5443",
+"c.	c #8E705A",
+"d.	c #A88970",
+"e.	c #9F8462",
+"f.	c #A69767",
+"g.	c #C8B98B",
+"h.	c #C7B891",
+"i.	c #A09783",
+"j.	c #515860",
+"k.	c #6C7172",
+"l.	c #DCD0B5",
+"m.	c #857454",
+"n.	c #604E32",
+"o.	c #766549",
+"p.	c #B2A085",
+"q.	c #816C53",
+"r.	c #907962",
+"s.	c #DFCAB3",
+"t.	c #8A7860",
+"u.	c #B6A88C",
+"v.	c #FBEDCF",
+"w.	c #FAEBC9",
+"x.	c #C0B296",
+"y.	c #797771",
+"z.	c #49525D",
+"A.	c #525963",
+"B.	c #66666A",
+"C.	c #676365",
+"D.	c #564E4C",
+"E.	c #5E4D43",
+"F.	c #513B2D",
+"G.	c #78614A",
+"H.	c #715B3E",
+"I.	c #67512E",
+"J.	c #8E7852",
+"K.	c #BBA67E",
+"L.	c #C9B48C",
+"M.	c #8F8A7C",
+"N.	c #C4BBA2",
+"O.	c #C4B285",
+"P.	c #897850",
+"Q.	c #8D7B56",
+"R.	c #D8C4A6",
+"S.	c #E1CDB5",
+"T.	c #7C6953",
+"U.	c #746049",
+"V.	c #98866B",
+"W.	c #DCCCAC",
+"X.	c #FFF4D2",
+"Y.	c #ECDDBD",
+"Z.	c #AEA48D",
+"`.	c #49525A",
+" +	c #4A5561",
+".+	c #5E605A",
+"++	c #58513E",
+"@+	c #554A31",
+"#+	c #58492B",
+"$+	c #5B492B",
+"%+	c #6E563F",
+"&+	c #543C1F",
+"*+	c #816A4A",
+"=+	c #BEA884",
+"-+	c #C0AE83",
+";+	c #7D7D73",
+">+	c #707471",
+",+	c #B3AC94",
+"'+	c #E8D4B1",
+")+	c #D2C18D",
+"!+	c #D9CA8C",
+"~+	c #EEE1A8",
+"{+	c #F4E6BF",
+"]+	c #A79681",
+"^+	c #AF9D89",
+"/+	c #9E8E6E",
+"(+	c #E7DAAD",
+"_+	c #FFF0C8",
+":+	c #DAC7A8",
+"<+	c #B3A48B",
+"[+	c #81807B",
+"}+	c #5F6559",
+"|+	c #625E41",
+"1+	c #685C42",
+"2+	c #634E3D",
+"3+	c #573F33",
+"4+	c #8C7C68",
+"5+	c #726A47",
+"6+	c #675B48",
+"7+	c #9D8B81",
+"8+	c #C3AF85",
+"9+	c #C3B57B",
+"0+	c #606564",
+"a+	c #424C58",
+"b+	c #83857F",
+"c+	c #F2E5B8",
+"d+	c #F5E2AC",
+"e+	c #F1DBAB",
+"f+	c #F8E6AC",
+"g+	c #F6E7A5",
+"h+	c #EEE1A1",
+"i+	c #EBDEAC",
+"j+	c #DACCA8",
+"k+	c #E1D2B1",
+"l+	c #F7EAC1",
+"m+	c #FDF0C1",
+"n+	c #DCC9A4",
+"o+	c #7F6F52",
+"p+	c #776E5F",
+"q+	c #5E656A",
+"r+	c #586164",
+"s+	c #797661",
+"t+	c #72644A",
+"u+	c #68523D",
+"v+	c #755C4B",
+"w+	c #806F55",
+"x+	c #90875F",
+"y+	c #7C705A",
+"z+	c #6A5C55",
+"A+	c #737165",
+"B+	c #C3AF6E",
+"C+	c #928B73",
+"D+	c #515960",
+"E+	c #D2C7AC",
+"F+	c #F2E0B1",
+"G+	c #EAD79F",
+"H+	c #EFDA9A",
+"I+	c #EAD699",
+"J+	c #E9D59A",
+"K+	c #EFDCA2",
+"L+	c #F1E2A8",
+"M+	c #F4E6AD",
+"N+	c #F4E8B5",
+"O+	c #F3E6BB",
+"P+	c #B9B199",
+"Q+	c #646664",
+"R+	c #696B6D",
+"S+	c #4B535C",
+"T+	c #515962",
+"U+	c #74726B",
+"V+	c #9B8768",
+"W+	c #AA9372",
+"X+	c #8A734F",
+"Y+	c #766336",
+"Z+	c #624D2C",
+"`+	c #5D544D",
+" @	c #51585A",
+".@	c #BAA466",
+"+@	c #BAA882",
+"@@	c #4E555F",
+"#@	c #9F9B91",
+"$@	c #E9D7AF",
+"%@	c #E1CC9A",
+"&@	c #ECD8A0",
+"*@	c #E9D690",
+"=@	c #E5CF96",
+"-@	c #F1D8A9",
+";@	c #FCE5B2",
+">@	c #F5E4A7",
+",@	c #EBDF9A",
+"'@	c #F3E6AC",
+")@	c #CAC1A4",
+"!@	c #525A61",
+"~@	c #7B7E82",
+"{@	c #515961",
+"]@	c #A99A78",
+"^@	c #A89261",
+"/@	c #B4966A",
+"(@	c #9D8353",
+"_@	c #B19870",
+":@	c #988260",
+"<@	c #97845D",
+"[@	c #AF9457",
+"}@	c #C4AC7D",
+"|@	c #797773",
+"1@	c #98968E",
+"2@	c #DFCBAA",
+"3@	c #93805F",
+"4@	c #686457",
+"5@	c #76766C",
+"6@	c #E9D497",
+"7@	c #D7BF91",
+"8@	c #CBB599",
+"9@	c #BAAC95",
+"0@	c #E9D79F",
+"a@	c #F3E6A3",
+"b@	c #CDC497",
+"c@	c #676B6D",
+"d@	c #9E9371",
+"e@	c #AA9559",
+"f@	c #B28F61",
+"g@	c #B89769",
+"h@	c #AE9467",
+"i@	c #B59D6A",
+"j@	c #B4975D",
+"k@	c #B89860",
+"l@	c #C2A676",
+"m@	c #A89D86",
+"n@	c #6D6F71",
+"o@	c #B5A388",
+"p@	c #9F8664",
+"q@	c #7B7264",
+"r@	c #354252",
+"s@	c #666A6A",
+"t@	c #CCB78A",
+"u@	c #8A7C66",
+"v@	c #454B53",
+"w@	c #656767",
+"x@	c #DCCF9E",
+"y@	c #86877A",
+"z@	c #928B71",
+"A@	c #A49054",
+"B@	c #A4855C",
+"C@	c #9A8268",
+"D@	c #A18D65",
+"E@	c #A9955C",
+"F@	c #B49962",
+"G@	c #B89768",
+"H@	c #BA9D6F",
+"I@	c #BEAE89",
+"J@	c #4A535D",
+"K@	c #626568",
+"L@	c #9C8B73",
+"M@	c #88704F",
+"N@	c #6B5331",
+"O@	c #7D684A",
+"P@	c #B0A28B",
+"Q@	c #988C78",
+"R@	c #A59379",
+"S@	c #626363",
+"T@	c #364150",
+"U@	c #918C7D",
+"V@	c #EDD9AE",
+"W@	c #A39C88",
+"X@	c #828072",
+"Y@	c #A8935C",
+"Z@	c #8D7B61",
+"`@	c #47515E",
+" #	c #7B7864",
+".#	c #A5955A",
+"+#	c #7F775D",
+"@#	c #706860",
+"##	c #AC936D",
+"$#	c #B8A77E",
+"%#	c #414A55",
+"&#	c #4B555E",
+"*#	c #7A6E5E",
+"=#	c #876F51",
+"-#	c #9B7F5D",
+";#	c #523717",
+">#	c #7F684E",
+",#	c #B3A38E",
+"'#	c #7E7162",
+")#	c #534336",
+"!#	c #7C6D50",
+"~#	c #BEB693",
+"{#	c #E4D5A0",
+"]#	c #CCBF96",
+"^#	c #595F65",
+"/#	c #70716C",
+"(#	c #968456",
+"_#	c #6D5841",
+":#	c #6E6464",
+"<#	c #8A8267",
+"[#	c #A2985F",
+"}#	c #5B5C4B",
+"|#	c #394658",
+"1#	c #786F60",
+"2#	c #B7A478",
+"3#	c #404A56",
+"4#	c #636463",
+"5#	c #75634D",
+"6#	c #977F61",
+"7#	c #8B6F4E",
+"8#	c #5E4325",
+"9#	c #846F56",
+"0#	c #A89A89",
+"a#	c #91867A",
+"b#	c #453529",
+"c#	c #B4A681",
+"d#	c #F4E7A8",
+"e#	c #DCD090",
+"f#	c #858574",
+"g#	c #656866",
+"h#	c #72613D",
+"i#	c #685444",
+"j#	c #483938",
+"k#	c #7B775B",
+"l#	c #787644",
+"m#	c #716547",
+"n#	c #665854",
+"o#	c #887A61",
+"p#	c #B7A577",
+"q#	c #50585F",
+"r#	c #4D555F",
+"s#	c #7B7060",
+"t#	c #695841",
+"u#	c #8E7C62",
+"v#	c #725E41",
+"w#	c #675335",
+"x#	c #827151",
+"y#	c #B1A082",
+"z#	c #8A7559",
+"A#	c #846849",
+"B#	c #EDD5AD",
+"C#	c #E8D7A6",
+"D#	c #A5A387",
+"E#	c #585F62",
+"F#	c #69624B",
+"G#	c #665A47",
+"H#	c #40372D",
+"I#	c #56553F",
+"J#	c #78765C",
+"K#	c #53453D",
+"L#	c #4B3324",
+"M#	c #B59F6B",
+"N#	c #CCBD85",
+"O#	c #6C6F6D",
+"P#	c #9A886C",
+"Q#	c #897559",
+"R#	c #816D50",
+"S#	c #5F4C2E",
+"T#	c #847355",
+"U#	c #7F6E4F",
+"V#	c #B5A483",
+"W#	c #725D3A",
+"X#	c #C1A278",
+"Y#	c #F3D9AD",
+"Z#	c #CCBC97",
+"`#	c #606769",
+" $	c #606567",
+".$	c #706B57",
+"+$	c #665947",
+"@$	c #3F3629",
+"#$	c #464530",
+"$$	c #696552",
+"%$	c #675855",
+"&$	c #624C3D",
+"*$	c #C0AD76",
+"=$	c #D1C589",
+"-$	c #696C6C",
+";$	c #AD9E85",
+">$	c #C4AB85",
+",$	c #908573",
+"'$	c #6D5F48",
+")$	c #846F4E",
+"!$	c #AC997A",
+"~$	c #A99575",
+"{$	c #7E6D50",
+"]$	c #7F6B47",
+"^$	c #EDD29E",
+"/$	c #E0CA98",
+"($	c #958F7D",
+"_$	c #72716B",
+":$	c #746951",
+"<$	c #6D5B4B",
+"[$	c #493B31",
+"}$	c #423D28",
+"|$	c #7F7964",
+"1$	c #8A7872",
+"2$	c #785F4F",
+"3$	c #C9B57F",
+"4$	c #D1C38B",
+"5$	c #65696B",
+"6$	c #C6AC80",
+"7$	c #B39565",
+"8$	c #68645A",
+"9$	c #3A4653",
+"0$	c #B3A286",
+"a$	c #C4AE8B",
+"b$	c #928A7C",
+"c$	c #6C5F4A",
+"d$	c #BAA781",
+"e$	c #E5CE92",
+"f$	c #C7B585",
+"g$	c #837D6F",
+"h$	c #968667",
+"i$	c #817163",
+"j$	c #41332B",
+"k$	c #5D523A",
+"l$	c #897D64",
+"m$	c #8F786E",
+"n$	c #957A66",
+"o$	c #DBC78F",
+"p$	c #D0C48E",
+"q$	c #606569",
+"r$	c #888475",
+"s$	c #C3A36D",
+"t$	c #B2915B",
+"u$	c #796F5D",
+"v$	c #4F555B",
+"w$	c #B29F7F",
+"x$	c #A89069",
+"y$	c #3E4750",
+"z$	c #3F4957",
+"A$	c #B3A585",
+"B$	c #D9C482",
+"C$	c #ACA37F",
+"D$	c #998C76",
+"E$	c #A78F69",
+"F$	c #685B4F",
+"G$	c #3D4855",
+"H$	c #6C695D",
+"I$	c #948363",
+"J$	c #705C51",
+"K$	c #816651",
+"L$	c #CDBA82",
+"M$	c #C9BE8B",
+"N$	c #5B6168",
+"O$	c #9E9277",
+"P$	c #C6A36A",
+"Q$	c #C3A067",
+"R$	c #BFA06E",
+"S$	c #BEA173",
+"T$	c #C2A577",
+"U$	c #B1976E",
+"V$	c #575A5C",
+"W$	c #5B5D5F",
+"X$	c #BAA67E",
+"Y$	c #D1C082",
+"Z$	c #848476",
+"`$	c #565D63",
+" %	c #B69A6D",
+".%	c #9A8165",
+"+%	c #6C645D",
+"@%	c #877D64",
+"#%	c #A18B5F",
+"$%	c #5B5A57",
+"%%	c #474D56",
+"&%	c #BBA976",
+"*%	c #BCB283",
+"=%	c #49535D",
+"-%	c #5C6368",
+";%	c #AE9B77",
+">%	c #C29E65",
+",%	c #C9A46C",
+"'%	c #C5A06A",
+")%	c #BF9D66",
+"!%	c #C2A06C",
+"~%	c #C3A371",
+"{%	c #B49B72",
+"]%	c #B4996D",
+"^%	c #C9AE7B",
+"/%	c #C0B388",
+"(%	c #535B60",
+"_%	c #747371",
+":%	c #BA9E72",
+"<%	c #BB9C67",
+"[%	c #B8976B",
+"}%	c #B7986F",
+"|%	c #B79F66",
+"1%	c #B0985E",
+"2%	c #A18667",
+"3%	c #A68F76",
+"4%	c #BDA86E",
+"5%	c #B5AF85",
+"6%	c #7A7B75",
+"7%	c #BCA478",
+"8%	c #BD9965",
+"9%	c #C29F68",
+"0%	c #C19E68",
+"a%	c #BC9861",
+"b%	c #B7945C",
+"c%	c #BC9961",
+"d%	c #C7A368",
+"e%	c #C09C60",
+"f%	c #CAAB73",
+"g%	c #A69E87",
+"h%	c #8E857A",
+"i%	c #B99967",
+"j%	c #C09A59",
+"k%	c #C29D62",
+"l%	c #B79861",
+"m%	c #B69E5A",
+"n%	c #BB9F5C",
+"o%	c #C4A074",
+"p%	c #C6A177",
+"q%	c #CDB478",
+"r%	c #ADA883",
+"s%	c #817F74",
+"t%	c #B39C6E",
+"u%	c #BE9C6A",
+"v%	c #C39E6C",
+"w%	c #BA9761",
+"x%	c #BC9760",
+"y%	c #BE9960",
+"z%	c #C19B5F",
+"A%	c #C5A062",
+"B%	c #C19B59",
+"C%	c #D1B079",
+"D%	c #747571",
+"E%	c #535C64",
+"F%	c #A7967F",
+"G%	c #B59767",
+"H%	c #A0875A",
+"I%	c #837252",
+"J%	c #AA9361",
+"K%	c #BFA65C",
+"L%	c #C3A75F",
+"M%	c #C7A372",
+"N%	c #C8A478",
+"O%	c #D3BA7C",
+"P%	c #858675",
+"Q%	c #928C79",
+"R%	c #B59D6E",
+"S%	c #99835D",
+"T%	c #63605D",
+"U%	c #8C7D60",
+"V%	c #BE9E63",
+"W%	c #AD8F69",
+"X%	c #A88B6D",
+"Y%	c #BD9A63",
+"Z%	c #BF9C5A",
+"`%	c #C8AF84",
+" &	c #545C64",
+".&	c #7A756C",
+"+&	c #BBA07E",
+"@&	c #9C8B70",
+"#&	c #465059",
+"$&	c #334152",
+"%&	c #727262",
+"&&	c #ABA16C",
+"*&	c #827B62",
+"=&	c #A38D70",
+"-&	c #CAA874",
+";&	c #DDC78C",
+">&	c #606666",
+",&	c #948C7A",
+"'&	c #B1996D",
+")&	c #786A51",
+"!&	c #3D4654",
+"~&	c #6F6B5E",
+"{&	c #B89C62",
+"]&	c #86745D",
+"^&	c #444D58",
+"/&	c #97825E",
+"(&	c #BD9E5B",
+"_&	c #C3AD87",
+":&	c #4A545F",
+"<&	c #4A525C",
+"[&	c #9D8C73",
+"}&	c #8F7856",
+"|&	c #847865",
+"1&	c #51595F",
+"2&	c #4B535B",
+"3&	c #908873",
+"4&	c #696E68",
+"5&	c #2D3B4E",
+"6&	c #656361",
+"7&	c #D7B786",
+"8&	c #B3A587",
+"9&	c #8D8779",
+"0&	c #96805C",
+"a&	c #7A644C",
+"b&	c #766155",
+"c&	c #8D7A5E",
+"d&	c #A99162",
+"e&	c #716454",
+"f&	c #364354",
+"g&	c #83785F",
+"h&	c #C4A864",
+"i&	c #BDAA85",
+"j&	c #70716E",
+"k&	c #917D60",
+"l&	c #79664A",
+"m&	c #564A37",
+"n&	c #7A756A",
+"o&	c #786F63",
+"p&	c #A29585",
+"q&	c #767571",
+"r&	c #374350",
+"s&	c #606260",
+"t&	c #D1BA99",
+"u&	c #6F7070",
+"v&	c #81796D",
+"w&	c #695337",
+"x&	c #6E5A4A",
+"y&	c #46312B",
+"z&	c #7F6B53",
+"A&	c #9D8B64",
+"B&	c #85715F",
+"C&	c #8B807C",
+"D&	c #9E8D68",
+"E&	c #BBA262",
+"F&	c #A79B7F",
+"G&	c #48525E",
+"H&	c #7E7669",
+"I&	c #77664C",
+"J&	c #66563E",
+"K&	c #655B4B",
+"L&	c #7E7769",
+"M&	c #92896F",
+"N&	c #857C6F",
+"O&	c #958A7F",
+"P&	c #5D6162",
+"Q&	c #8D8A77",
+"R&	c #A9A18E",
+"S&	c #4E5761",
+"T&	c #65594C",
+"U&	c #644F3B",
+"V&	c #5B483C",
+"W&	c #3D2A2A",
+"X&	c #6E5D4A",
+"Y&	c #7C7257",
+"Z&	c #75675B",
+"`&	c #664F42",
+" *	c #A18C63",
+".*	c #C0A86B",
+"+*	c #A59A7F",
+"@*	c #737474",
+"#*	c #7B6953",
+"$*	c #74644C",
+"%*	c #625440",
+"&*	c #554B3C",
+"**	c #6F6856",
+"=*	c #9A9671",
+"-*	c #8B816F",
+";*	c #A49587",
+">*	c #CBBF9B",
+",*	c #DACF9C",
+"'*	c #7D7F76",
+")*	c #60656A",
+"!*	c #716557",
+"~*	c #624E3B",
+"{*	c #584538",
+"]*	c #3F2D2B",
+"^*	c #5D4F3A",
+"/*	c #565956",
+"(*	c #444A52",
+"_*	c #5C493E",
+":*	c #9F8B64",
+"<*	c #BFA86A",
+"[*	c #A99D81",
+"}*	c #5A6065",
+"|*	c #AF9E85",
+"1*	c #917C5D",
+"2*	c #867459",
+"3*	c #564833",
+"4*	c #706454",
+"5*	c #6F654F",
+"6*	c #807D53",
+"7*	c #9A8F71",
+"8*	c #C3B298",
+"9*	c #E4D5A8",
+"0*	c #CFC899",
+"a*	c #5D6467",
+"b*	c #575E65",
+"c*	c #7D7368",
+"d*	c #5E4C37",
+"e*	c #513E2A",
+"f*	c #5F4C44",
+"g*	c #75664D",
+"h*	c #6C6A58",
+"i*	c #454C56",
+"j*	c #524136",
+"k*	c #9A8760",
+"l*	c #C5AD6F",
+"m*	c #AC9F83",
+"n*	c #A39683",
+"o*	c #D1B186",
+"p*	c #A08863",
+"q*	c #777266",
+"r*	c #908771",
+"s*	c #867761",
+"t*	c #827258",
+"u*	c #9E966E",
+"v*	c #B9AD87",
+"w*	c #E2CDA6",
+"x*	c #E1CEA5",
+"y*	c #84847A",
+"z*	c #817C78",
+"A*	c #725E46",
+"B*	c #614C30",
+"C*	c #7F6C5D",
+"D*	c #766949",
+"E*	c #676A5E",
+"F*	c #484E59",
+"G*	c #534135",
+"H*	c #947F58",
+"I*	c #C1A869",
+"J*	c #AC9D7D",
+"K*	c #737473",
+"L*	c #D3B489",
+"M*	c #E3BC83",
+"N*	c #918267",
+"O*	c #3D4956",
+"P*	c #989386",
+"Q*	c #B3A182",
+"R*	c #867C6B",
+"S*	c #8B8777",
+"T*	c #BDAC84",
+"U*	c #E9CE9F",
+"V*	c #AA9C89",
+"W*	c #505861",
+"X*	c #877D6D",
+"Y*	c #76603C",
+"Z*	c #8A755E",
+"`*	c #9D8F6C",
+" =	c #817B57",
+".=	c #757068",
+"+=	c #645244",
+"@=	c #968159",
+"#=	c #C5AA6E",
+"$=	c #C3AF8B",
+"%=	c #636B6E",
+"&=	c #CBBC98",
+"*=	c #DEBC87",
+"==	c #E2B87E",
+"-=	c #D6B582",
+";=	c #C2AE86",
+">=	c #C9B998",
+",=	c #BEAC8C",
+"'=	c #666968",
+")=	c #4F5661",
+"!=	c #CAB693",
+"~=	c #E2C79B",
+"{=	c #6F6E6F",
+"]=	c #606467",
+"^=	c #B49C78",
+"/=	c #876D45",
+"(=	c #997F54",
+"_=	c #9D8157",
+":=	c #8F7254",
+"<=	c #60442D",
+"[=	c #917557",
+"}=	c #C3A97D",
+"|=	c #C6B590",
+"1=	c #515A61",
+"2=	c #BFB38A",
+"3=	c #D3BD87",
+"4=	c #D9BB86",
+"5=	c #DCB887",
+"6=	c #DAB787",
+"7=	c #DABC8C",
+"8=	c #D3BA89",
+"9=	c #D1BC85",
+"0=	c #C9B686",
+"a=	c #CBB696",
+"b=	c #DBC4A3",
+"c=	c #958E82",
+"d=	c #A59678",
+"e=	c #C0A676",
+"f=	c #A68A59",
+"g=	c #BFA172",
+"h=	c #AE8C65",
+"i=	c #72512F",
+"j=	c #8A6C48",
+"k=	c #BAA071",
+"l=	c #D1BF8F",
+"m=	c #7A7E7A",
+"n=	c #5A6066",
+"o=	c #B6A787",
+"p=	c #D9C288",
+"q=	c #D2BA80",
+"r=	c #D3B780",
+"s=	c #D7B785",
+"t=	c #DABA88",
+"u=	c #DABA86",
+"v=	c #D5B981",
+"w=	c #D4BD82",
+"x=	c #DEC98F",
+"y=	c #E2CBA5",
+"z=	c #989287",
+"A=	c #7C7A6F",
+"B=	c #BBA97B",
+"C=	c #B9A472",
+"D=	c #B9A16D",
+"E=	c #C1A475",
+"F=	c #AF9265",
+"G=	c #AF9363",
+"H=	c #BBA266",
+"I=	c #CBB67D",
+"J=	c #89877F",
+"K=	c #4D5560",
+"L=	c #AEA081",
+"M=	c #D3BE84",
+"N=	c #D4BB82",
+"O=	c #D1B67C",
+"P=	c #CDB176",
+"Q=	c #D2B478",
+"R=	c #D8B97E",
+"S=	c #DABD84",
+"T=	c #DABF89",
+"U=	c #DAC28F",
+"V=	c #DEC99D",
+"W=	c #9E998B",
+"X=	c #49525B",
+"Y=	c #98937B",
+"Z=	c #B5A778",
+"`=	c #B19E6D",
+" -	c #BDA575",
+".-	c #C1A576",
+"+-	c #BBA06C",
+"@-	c #BBA060",
+"#-	c #C6B072",
+"$-	c #9A9484",
+"%-	c #9E907C",
+"&-	c #C8AE79",
+"*-	c #D3B875",
+"=-	c #D3B57D",
+"--	c #D5B77D",
+";-	c #CFB374",
+">-	c #D3B774",
+",-	c #D9BE7C",
+"'-	c #D9C085",
+")-	c #D7BF8D",
+"!-	c #DFC89C",
+"~-	c #B6AA94",
+"{-	c #565D62",
+"]-	c #9C967B",
+"^-	c #82724A",
+"/-	c #8B754E",
+"(-	c #BBA27B",
+"_-	c #B99F73",
+":-	c #C0A56F",
+"<-	c #BEA96E",
+"[-	c #CEBE91",
+"}-	c #B3AA92",
+"|-	c #5E6367",
+"1-	c #4C565E",
+"2-	c #7C7B6F",
+"3-	c #AE9976",
+"4-	c #BE9E6E",
+"5-	c #C59E64",
+"6-	c #C69E5F",
+"7-	c #CDAB75",
+"8-	c #D8B980",
+"9-	c #D3B879",
+"0-	c #D4BC79",
+"a-	c #D9C383",
+"b-	c #D8C38C",
+"c-	c #DCC79B",
+"d-	c #C6B79E",
+"e-	c #5E6368",
+"f-	c #696E70",
+"g-	c #72674F",
+"h-	c #4E3A1F",
+"i-	c #866E54",
+"j-	c #A58B6E",
+"k-	c #7D643F",
+"l-	c #B49F6E",
+"m-	c #C5B379",
+"n-	c #D9C996",
+"o-	c #B7AB8C",
+"p-	c #63686B",
+"q-	c #75766F",
+"r-	c #AFA06F",
+"s-	c #B9A05C",
+"t-	c #BD9C5A",
+"u-	c #C2995E",
+"v-	c #C99861",
+"w-	c #CA9A64",
+"x-	c #C3A169",
+"y-	c #CDB076",
+"z-	c #CCB378",
+"A-	c #CEBA81",
+"B-	c #D9C893",
+"C-	c #D5C69B",
+"D-	c #A49D8C",
+"E-	c #575D63",
+"F-	c #53585C",
+"G-	c #605542",
+"H-	c #534230",
+"I-	c #4F3929",
+"J-	c #685240",
+"K-	c #5E4931",
+"L-	c #7D6846",
+"M-	c #B49F6A",
+"N-	c #C9B781",
+"O-	c #C6B785",
+"P-	c #88877C",
+"Q-	c #333F4E",
+"R-	c #595C63",
+"S-	c #91847A",
+"T-	c #BDA272",
+"U-	c #B79A54",
+"V-	c #B8974C",
+"W-	c #B9934F",
+"X-	c #BC935A",
+"Y-	c #C39663",
+"Z-	c #C39864",
+"`-	c #C7A86D",
+" ;	c #CAAF77",
+".;	c #CFBA86",
+"+;	c #D1C195",
+"@;	c #AFA790",
+"#;	c #7A7C78",
+"$;	c #595D5B",
+"%;	c #625840",
+"&;	c #534534",
+"*;	c #59483C",
+"=;	c #4B392D",
+"-;	c #7C6B5B",
+";;	c #7B6853",
+">;	c #6E5534",
+",;	c #B59F74",
+"';	c #D6C490",
+");	c #ADA583",
+"!;	c #6F716E",
+"~;	c #6E6D6C",
+"{;	c #716E6A",
+"];	c #867E6E",
+"^;	c #9F9173",
+"/;	c #B39873",
+"(;	c #B89B6D",
+"_;	c #C3A571",
+":;	c #AA956E",
+"<;	c #918066",
+"[;	c #897962",
+"};	c #917958",
+"|;	c #A58552",
+"1;	c #C6A86B",
+"2;	c #D0B373",
+"3;	c #D1B97F",
+"4;	c #CEBC91",
+"5;	c #8F8D83",
+"6;	c #5E6465",
+"7;	c #827C61",
+"8;	c #544833",
+"9;	c #6D5F51",
+"0;	c #65574B",
+"a;	c #9F9385",
+"b;	c #BEAE9F",
+"c;	c #816556",
+"d;	c #7C6445",
+"e;	c #B4A171",
+"f;	c #CDBD88",
+"g;	c #C6B68B",
+"h;	c #B6A180",
+"i;	c #A38D69",
+"j;	c #A58E5E",
+"k;	c #A79154",
+"l;	c #AB9550",
+"m;	c #AC9454",
+"n;	c #BEA26E",
+"o;	c #82786D",
+"p;	c #52555E",
+"q;	c #505660",
+"r;	c #616365",
+"s;	c #B2A173",
+"t;	c #CAB672",
+"u;	c #D4BD7C",
+"v;	c #C3B38A",
+"w;	c #777873",
+"x;	c #6D7070",
+"y;	c #646158",
+"z;	c #726A5C",
+"A;	c #7C7363",
+"B;	c #9E9683",
+"C;	c #BFB6A1",
+"D;	c #C1B29B",
+"E;	c #928268",
+"F;	c #786C50",
+"G;	c #A7997D",
+"H;	c #CDB794",
+"I;	c #DBC099",
+"J;	c #CCB184",
+"K;	c #B59865",
+"L;	c #B3945A",
+"M;	c #B19555",
+"N;	c #B29456",
+"O;	c #B89664",
+"P;	c #B9976E",
+"Q;	c #BA9C77",
+"R;	c #C1A881",
+"S;	c #C9B68B",
+"T;	c #B4A989",
+"U;	c #767773",
+"V;	c #4A535B",
+"W;	c #565C61",
+"X;	c #595F63",
+"Y;	c #75746D",
+"Z;	c #9A9485",
+"`;	c #999686",
+" >	c #7D7D76",
+".>	c #525A62",
+"+>	c #474F5B",
+"@>	c #71706F",
+"#>	c #8F877B",
+"$>	c #B1A38A",
+"%>	c #D3BD98",
+"&>	c #C0AA85",
+"*>	c #B39F76",
+"=>	c #B49E72",
+"->	c #B49D71",
+";>	c #BEA478",
+">>	c #D3B88B",
+",>	c #C3AE8A",
+"'>	c #A09581",
+")>	c #757572",
+"!>	c #4B545E",
+"~>	c #3B4552",
+"{>	c #3B4651",
+"]>	c #3C4652",
+"^>	c #394451",
+"/>	c #384350",
+"(>	c #46505A",
+"_>	c #454F58",
+":>	c #4B535A",
+"<>	c #485159",
+"[>	c #51585F",
+"}>	c #676B6B",
+"|>	c #4F5860",
+"                                                      . + @ # $ % &                             ",
+"                                                  * = - ; > , ' ) ! ~ {                         ",
+"                                    .     ] ^ / ( _ : < [ } | 1 2 3 4 5                         ",
+"                                6 7 8 9 0 a b c d e f g h i j k l m n o p                       ",
+"                              q r s t u v w x y z A B C D E F G H I J K L M N O                 ",
+"                          P Q R S T U V W X Y Z `  ...+. at .#.$.%.&.*.=.-.;.>.,.'.).!.~.          ",
+"                          {.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.        ",
+"                        k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.    z.  A.B.C.D.E.F.G.H.I.J.K.L.M.        ",
+"                        N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`.               +.+++ at +#+$+%+&+*+=+-+;+      ",
+"                    >+,+'+)+!+~+{+]+^+/+(+_+:+<+[+                  }+|+1+2+3+4+5+6+7+8+9+0+    ",
+"                a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+                  r+s+t+u+v+w+x+y+z+A+B+C+    ",
+"                D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+                      T+U+V+W+X+Y+Z+`+ @. at +@@@  ",
+"              . #@$@%@&@*@=@-@;@>@,@'@)@!@                            ~@{@]@^@/@(@_@:@<@[@}@|@  ",
+"              1 at 2@3 at 4@5 at 6@7 at 8@9 at 0@a at b@c@                                  d at e@f at g@h at i@j at k@l at m@  ",
+"            n at o@p at q@r at s@t at u@v at w@e+x at y@                                    z at A@B at C@D at E@F at G@H at I@J@",
+"          K at L@M at N@O at P@Q at R@S at T@U at V@W@                                      X at Y@Z@`@ #.#+#@###$#%#",
+"        &#*#=#-#;#>#,#'#)#!#~#{#]#^#                                      /#(#_#:#<#[#}#|#1#2#3#",
+"        4#5#6#7#8#9#0#a#b#c#d#e#f#                                        g#h#i#j#k#l#m#n#o#p#q#",
+"      r#s#t#u#v#w#x#y#z#A#B#C#D#                                          E#F#G#H#I#J#K#L#M#N#O#",
+"      |@P#Q#R#S#T#U#V#W#X#Y#Z#`#                                           $.$+$@$#$$$%$&$*$=$-$",
+"      ;$>$,$'$)$!$~${$]$^$/$($                                            _$:$<$[$}$|$1$2$3$4$5$",
+"    s at 6$7$8$9$0$a$b$c$d$e$f$s@                                            g$h$i$j$k$l$m$n$o$p$q$",
+"    r$s$t$u$v$w$x$y$z$A$B$C$                                            . D$E$F$G$H$I$J$K$L$M$N$",
+"    O$P$Q$R$S$T$U$V$W$X$Y$Z$                                            `$~$ %.%+%@%#%$%%%&%*%=%",
+"  -%;%>%,%'%)%!%~%{%]%^%/%(%                                            _%:%<%[%}%|%1%2%3%4%5%  ",
+"  6%7%8%9%0%a%b%c%d%e%f%g%                                              h%i%j%k%l%m%n%o%p%q%r%  ",
+"  s%t%u%v%w%x%y%z%A%B%C%D%                                            E%F%G%H%I%J%K%L%M%N%O%P%  ",
+"  Q%R%S%T%U%V%W%X%Y%Z%`% &                                            .&+&@&#&$&%&&&*&=&-&;&>&  ",
+"  ,&'&)&!&~&{&]&^&/&(&_&:&                                          <&[&}&|&1&2&3&4&5&6&7&8&    ",
+"  9&0&a&b&c&d&e&f&g&h&i&                                            j&k&l&m&n&o&p&q&r&s&t&u&    ",
+"  v&w&x&y&z&A&B&C&D&E&F&                                          G&H&I&J&K&L&M&N&O&P&Q&R&      ",
+"S&T&U&V&W&X&Y&Z&`& *.*+*                                          @*#*$*%*&***=*-*;*>*,*'*      ",
+")*!*~*{*]*^*/*(*_*:*<*[*                                        }*|*1*2*3*4*5*6*7*8*9*0*a*      ",
+"b*c*d*e*f*g*h*i*j*k*l*m*                                        n*o*p*q*r*s*t*u*v*w*x*y*        ",
+"  z*A*B*C*D*E*F*G*H*I*J*                                      K*L*M*N*O*P*Q*R*S*T*U*V*          ",
+"  W*X*Y*Z*`* =.=+=@=#=$=                                    %=&=*===-=;=>=,='=)=!=~={=          ",
+"    ]=^=/=(=_=:=<=[=}=|=1=                                ]=2=3=4=5=6=7=8=9=0=a=b=c=            ",
+"      d=e=f=g=h=i=j=k=l=m=                              n=o=p=q=r=s=t=u=v=w=x=y=z=              ",
+"      A=B=C=D=E=F=G=H=I=J=~@                          K=L=M=N=O=P=Q=R=S=T=U=V=W=X=              ",
+"      . Y=Z=`= -.-+- at -#-$-                          T+%-&-*-=---;->-,-'-)-!-~-%                 ",
+"        {-]-^-/-(-_-:-<-[-}-|-                  1-2-3-4-5-6-7-8-9-0-a-b-c-d-e-                  ",
+"          f-g-h-i-j-k-l-m-n-o-p-              q-r-s-t-u-v-w-x-y-z-A-B-C-D-E-                    ",
+"          F-G-H-I-J-K-L-M-N-O-P-Q-        R-S-T-U-V-W-X-Y-Z-`- ;.;+;@;#;                        ",
+"          $;%;&;*;=;-;;;>;,;';);!;~;{;];^;/;(;_;:;<;[;};|;1;2;3;4;5;.                           ",
+"          6;7;8;9;0;a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;                              ",
+"            x;y;z;A;B;C;D;E;F;G;H;I;J;K;L;M;N;L;O;P;Q;R;S;T;U;V;                                ",
+"                W;X;Y;Z;`; >.>+>@>#>$>%>&>*>=>->;>>>,>'>)>                                      ",
+"                      % !>~>{>]>^>/>(>`$2&_>:><>[>}>|>                                          "};
diff --git a/images/MusicalInstruments/trumpet_horn.xpm b/images/MusicalInstruments/trumpet_horn.xpm
new file mode 100644
index 0000000..38827ce
--- /dev/null
+++ b/images/MusicalInstruments/trumpet_horn.xpm
@@ -0,0 +1,97 @@
+/* XPM */
+static char * trumpet_horn_xpm[] = {
+"48 48 46 1",
+" 	c #969696",
+".	c #C7A179",
+"+	c #6F6F70",
+"@	c #FCECBB",
+"#	c #8C735A",
+"$	c #626262",
+"%	c #D5BD94",
+"&	c #FFD69C",
+"*	c #DEAD6B",
+"=	c #89898A",
+"-	c #FFC67B",
+";	c #D6BD94",
+">	c #B59C63",
+",	c #7C7D7D",
+"'	c #CEA57B",
+")	c #9C7339",
+"!	c #875C39",
+"~	c #BD8C52",
+"{	c #FFEFBD",
+"]	c #E79C4A",
+"^	c #635239",
+"/	c #212121",
+"(	c #7C7C7D",
+"_	c #948C84",
+":	c #C67321",
+"<	c #6F6F6F",
+"[	c #DDDDC6",
+"}	c #898989",
+"|	c #61513A",
+"1	c #B55A29",
+"2	c #424242",
+"3	c #000000",
+"4	c #EFBDB5",
+"5	c #636363",
+"6	c #592E0C",
+"7	c #BD735A",
+"8	c #414447",
+"9	c #DEDEC6",
+"0	c #3E4853",
+"a	c #844218",
+"b	c #8C2100",
+"c	c #7C7C7C",
+"d	c #AE9172",
+"e	c #ADADAD",
+"f	c #FEEEBD",
+"g	c #CDA47B",
+"                                                ",
+"                                                ",
+"                                       .++      ",
+"                                       @#$      ",
+"                                      +%&*=     ",
+"                                       &&-$     ",
+"                                      =&&-$=    ",
+"                                     $$-;->$    ",
+"                                   ,$''>*--$    ",
+"                                  $$)>>****$    ",
+"                                 $$!~&&*~**$$   ",
+"                               ,$$>{&&&);]-^$,  ",
+"                              $$$;{*---!*;*>//( ",
+"                             $__{;:~*))~~;*&!!$ ",
+"                         $$$$_{{;:~]:~~;&&{&>>$ ",
+"                      +  ;$$;'))-**!<<<<<<<&&&$ ",
+"                     +[= )_{'~--*^<<( }(  <^!!$$",
+"                    |/)+ &>1:;<<<<<       </22/$",
+"                    ^/)$$&>1:;<<<<      (<</22/$",
+"                    ^3^~~4)*';;;!/,    </^>255!$",
+"                   ,)>&>>67;*!!!~:5<< <'*'>-~~#$",
+"                  $$')6>>;-*-2282_1'{&&~!##&>>^$",
+"               /__9&-]';;-!~]22022~)1aa!1~*$$$$$",
+"              $_{{&]{;-~~&a#15^^2;~)_55)]*!$+((=",
+"             +^&**;{)#&::~b!>***-b!-111!$$$     ",
+"            ,>&&&&&!/c#111*-**!!^~:*>$$$$$      ",
+"           ,;&;>cccccc#''-*!!!))-~/>^$$$$=      ",
+"          $${&&cccc/cc'**~11~!>>>22-2//$+       ",
+"        $$$&*'cc   c***;;)-6~!!!*//&]))$=       ",
+"        d&&>-'c    ;*-~**~6~~!66:)-)#//+        ",
+"   +$$++'&&>-'c   c;*-~**~6~~!66:)-)#//+        ",
+"  =__e&&5$$/-~c  cc-~)1~~--~6:77**/$$$$         ",
+"   f{9&5$$$/])c}}c5-/2]--*-66'&&*$$$$+=         ",
+"   g';$$+  $*~cc//>*~-*!!22~*>66$$+=            ",
+"   $$!$     $*]cccc&~]2//;&*$$$$+               ",
+"   ,+       $/-cccc/!)'&&)/$$$+                 ",
+"            ,$_>55c^*]->>/$+,                   ",
+"             +$*~~--$$/$$+=                     ",
+"              +$$$$$$$$+                        ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                "};
diff --git a/images/MusicalInstruments/turntable.xpm b/images/MusicalInstruments/turntable.xpm
new file mode 100644
index 0000000..79441b1
--- /dev/null
+++ b/images/MusicalInstruments/turntable.xpm
@@ -0,0 +1,736 @@
+/* XPM */
+static char * turntable_xpm[] = {
+"48 48 685 2",
+"  	c #969696",
+". 	c #6A6D70",
+"+ 	c #575D64",
+"@ 	c #87898A",
+"# 	c #91918F",
+"$ 	c #AEAEAC",
+"% 	c #A9A8A5",
+"& 	c #909293",
+"* 	c #5A6066",
+"= 	c #3A3936",
+"- 	c #A1A2A2",
+"; 	c #75797D",
+"> 	c #797C7F",
+", 	c #A2A3A3",
+"' 	c #BABAB9",
+") 	c #C5C5C3",
+"! 	c #C2C2C0",
+"~ 	c #9C9C9A",
+"{ 	c #AEADAB",
+"] 	c #D9D8D6",
+"^ 	c #A7A6A4",
+"/ 	c #676664",
+"( 	c #ABAAAA",
+"_ 	c #555C64",
+": 	c #C7C7C6",
+"< 	c #CECECB",
+"[ 	c #D3D3D1",
+"} 	c #D5D5D3",
+"| 	c #C6C6C4",
+"1 	c #C0C0BE",
+"2 	c #B8B8B6",
+"3 	c #9A9A98",
+"4 	c #9F9F9D",
+"5 	c #CBCAC8",
+"6 	c #BBBAB8",
+"7 	c #B0AFAD",
+"8 	c #959492",
+"9 	c #7F7D7B",
+"0 	c #75787C",
+"a 	c #6F7376",
+"b 	c #B6B6B4",
+"c 	c #D0D0CE",
+"d 	c #C3C3C1",
+"e 	c #C1C1BF",
+"f 	c #A6A6A4",
+"g 	c #7C7C7A",
+"h 	c #9A9997",
+"i 	c #A8A7A5",
+"j 	c #B6B5B3",
+"k 	c #B9B8B6",
+"l 	c #9E9D9B",
+"m 	c #8F8E8C",
+"n 	c #555C62",
+"o 	c #2E3339",
+"p 	c #21252A",
+"q 	c #212529",
+"r 	c #292D32",
+"s 	c #32383F",
+"t 	c #282D31",
+"u 	c #24282C",
+"v 	c #141412",
+"w 	c #161614",
+"x 	c #323231",
+"y 	c #626261",
+"z 	c #979796",
+"A 	c #989896",
+"B 	c #90918F",
+"C 	c #8F8D8B",
+"D 	c #9F9E9C",
+"E 	c #8C8B89",
+"F 	c #9D9C9A",
+"G 	c #868583",
+"H 	c #5F656B",
+"I 	c #171A1D",
+"J 	c #010101",
+"K 	c #000000",
+"L 	c #010100",
+"M 	c #3F3F3D",
+"N 	c #858583",
+"O 	c #999997",
+"P 	c #ADADAB",
+"Q 	c #BFBFBD",
+"R 	c #A4A3A1",
+"S 	c #B7B6B4",
+"T 	c #979694",
+"U 	c #9C9C9D",
+"V 	c #72777C",
+"W 	c #949698",
+"X 	c #2A2F34",
+"Y 	c #0E1012",
+"Z 	c #030303",
+"` 	c #040404",
+" .	c #020202",
+"..	c #0B0B0A",
+"+.	c #525250",
+"@.	c #929390",
+"#.	c #ACABA9",
+"$.	c #BAB9B7",
+"%.	c #8D8C8A",
+"&.	c #969593",
+"*.	c #A3A19F",
+"=.	c #999A9A",
+"-.	c #535A62",
+";.	c #787C81",
+">.	c #C7C7C7",
+",.	c #DFDFDF",
+"'.	c #C1C1C1",
+").	c #3E4853",
+"!.	c #111316",
+"~.	c #050505",
+"{.	c #080808",
+"].	c #070707",
+"^.	c #030302",
+"/.	c #020201",
+"(.	c #020200",
+"_.	c #30302D",
+":.	c #81807E",
+"<.	c #A09F9D",
+"[.	c #82817F",
+"}.	c #8A8987",
+"|.	c #999896",
+"1.	c #A9A8A6",
+"2.	c #C7C6C3",
+"3.	c #535A61",
+"4.	c #6F747A",
+"5.	c #818487",
+"6.	c #B3B3B2",
+"7.	c #E0E0E0",
+"8.	c #E8E8E8",
+"9.	c #BCBCBC",
+"0.	c #383838",
+"a.	c #040403",
+"b.	c #252523",
+"c.	c #767573",
+"d.	c #838280",
+"e.	c #92918F",
+"f.	c #8C8E90",
+"g.	c #DEDEDE",
+"h.	c #B4B4B3",
+"i.	c #9E9E9E",
+"j.	c #989898",
+"k.	c #B1B1B1",
+"l.	c #CCCCCC",
+"m.	c #4A4A4A",
+"n.	c #0C0C0C",
+"o.	c #070705",
+"p.	c #373533",
+"q.	c #807F7D",
+"r.	c #9C9B99",
+"s.	c #7C7B79",
+"t.	c #939291",
+"u.	c #ADACAB",
+"v.	c #BDBCBA",
+"w.	c #60666C",
+"x.	c #949393",
+"y.	c #737272",
+"z.	c #D9D9D9",
+"A.	c #9B9B9B",
+"B.	c #828282",
+"C.	c #868686",
+"D.	c #AAAAAA",
+"E.	c #737373",
+"F.	c #333333",
+"G.	c #808080",
+"H.	c #B4B4B4",
+"I.	c #B5B5B4",
+"J.	c #303030",
+"K.	c #000001",
+"L.	c #514F4F",
+"M.	c #A4A2A0",
+"N.	c #A6A5A1",
+"O.	c #BAB9B5",
+"P.	c #B1B0AC",
+"Q.	c #AEADA8",
+"R.	c #A4A2A4",
+"S.	c #9C9DA0",
+"T.	c #575F65",
+"U.	c #747676",
+"V.	c #C0BFBF",
+"W.	c #B3B3B3",
+"X.	c #8B8B8B",
+"Y.	c #2A2A2A",
+"Z.	c #5A5A5A",
+"`.	c #D5D5D5",
+" +	c #FCFCFC",
+".+	c #FFFFFF",
+"++	c #CECECE",
+"@+	c #4E4E4E",
+"#+	c #060407",
+"$+	c #201E20",
+"%+	c #949391",
+"&+	c #BCBBB6",
+"*+	c #C7C6C1",
+"=+	c #A4A39E",
+"-+	c #D8D8D3",
+";+	c #F1F1F1",
+">+	c #C5C3C7",
+",+	c #909196",
+"'+	c #525A63",
+")+	c #6C6E70",
+"!+	c #B8B7B7",
+"~+	c #DCDCDC",
+"{+	c #C5C5C5",
+"]+	c #CDCDCD",
+"^+	c #7F7F7F",
+"/+	c #323232",
+"(+	c #D3D3D3",
+"_+	c #FBFBFB",
+":+	c #FEFEFE",
+"<+	c #222222",
+"[+	c #080609",
+"}+	c #110F10",
+"|+	c #5E5D5A",
+"1+	c #B0B0AB",
+"2+	c #C6C5C0",
+"3+	c #B7B6B1",
+"4+	c #CCCCC7",
+"5+	c #D3D1D4",
+"6+	c #AEACAE",
+"7+	c #909290",
+"8+	c #565A5E",
+"9+	c #A1A1A0",
+"0+	c #D6D6D6",
+"a+	c #D7D7D7",
+"b+	c #515151",
+"c+	c #7E7E7E",
+"d+	c #FAFAFA",
+"e+	c #F8F8F8",
+"f+	c #F7F7F7",
+"g+	c #6A6A6A",
+"h+	c #020102",
+"i+	c #060507",
+"j+	c #151415",
+"k+	c #545350",
+"l+	c #B3B2AD",
+"m+	c #C1C0BB",
+"n+	c #BAB9B4",
+"o+	c #BBBAB6",
+"p+	c #CAC9C8",
+"q+	c #CFCDCF",
+"r+	c #B1AFB2",
+"s+	c #A1A3A0",
+"t+	c #75787B",
+"u+	c #898A8A",
+"v+	c #E1E1E1",
+"w+	c #B6B6B6",
+"x+	c #2C2C2C",
+"y+	c #0D0D0D",
+"z+	c #A1A1A1",
+"A+	c #FDFDFD",
+"B+	c #C9C9C9",
+"C+	c #C4C4C4",
+"D+	c #1D1B1D",
+"E+	c #787674",
+"F+	c #B4B3AF",
+"G+	c #C2C1BC",
+"H+	c #C5C4BE",
+"I+	c #B5B4B3",
+"J+	c #CBC9CB",
+"K+	c #C1BFC1",
+"L+	c #A2A29D",
+"M+	c #848888",
+"N+	c #808285",
+"O+	c #5D5F62",
+"P+	c #A2A2A2",
+"Q+	c #2D2D2D",
+"R+	c #060606",
+"S+	c #999999",
+"T+	c #DADADA",
+"U+	c #8C8C8C",
+"V+	c #080809",
+"W+	c #464445",
+"X+	c #5D5B59",
+"Y+	c #95948F",
+"Z+	c #C8C7C2",
+"`+	c #BCBBB9",
+" @	c #BDBBBE",
+".@	c #B6B5B8",
+"+@	c #9B9C96",
+"@@	c #999C9A",
+"#@	c #6E6F70",
+"$@	c #141414",
+"%@	c #595959",
+"&@	c #F5F5F5",
+"*@	c #454545",
+"=@	c #030304",
+"-@	c #6F6D70",
+";@	c #787677",
+">@	c #242321",
+",@	c #84837F",
+"'@	c #BEBDB8",
+")@	c #C1C0BA",
+"!@	c #BBBAB9",
+"~@	c #BBB9BC",
+"{@	c #9F9EA0",
+"]@	c #A9AAA4",
+"^@	c #A5A6A0",
+"/@	c #8C8E8D",
+"(@	c #343639",
+"_@	c #757573",
+":@	c #CFCFCF",
+"<@	c #919191",
+"[@	c #161616",
+"}@	c #0E0E0E",
+"|@	c #8E8E8E",
+"1@	c #F4F4F4",
+"2@	c #F3F3F3",
+"3@	c #858585",
+"4@	c #090A09",
+"5@	c #363637",
+"6@	c #8F8D90",
+"7@	c #646263",
+"8@	c #181716",
+"9@	c #85847F",
+"0@	c #C4C3BE",
+"a@	c #BFBEB9",
+"b@	c #C0BFBB",
+"c@	c #C0BFBE",
+"d@	c #B8B6B9",
+"e@	c #B7B5B8",
+"f@	c #BDBEB8",
+"g@	c #B0B1AB",
+"h@	c #A6A8A5",
+"i@	c #2F343A",
+"j@	c #BABABA",
+"k@	c #373737",
+"l@	c #202020",
+"m@	c #767676",
+"n@	c #E9E9E9",
+"o@	c #E4E4E4",
+"p@	c #BFBFBF",
+"q@	c #6E6E6E",
+"r@	c #111111",
+"s@	c #232423",
+"t@	c #646364",
+"u@	c #424043",
+"v@	c #363435",
+"w@	c #292825",
+"x@	c #807F7A",
+"y@	c #CECDC8",
+"z@	c #AFAEAC",
+"A@	c #A6A4A7",
+"B@	c #C2C0C2",
+"C@	c #C9CAC4",
+"D@	c #C3C4BF",
+"E@	c #AFB0AA",
+"F@	c #818586",
+"G@	c #808181",
+"H@	c #A0A0A0",
+"I@	c #434343",
+"J@	c #262626",
+"K@	c #353535",
+"L@	c #3A3A3A",
+"M@	c #282828",
+"N@	c #555555",
+"O@	c #5F5E5F",
+"P@	c #19171A",
+"Q@	c #363436",
+"R@	c #242320",
+"S@	c #9A9995",
+"T@	c #C5C4BF",
+"U@	c #B0AFAA",
+"V@	c #ADACA8",
+"W@	c #ABA9AC",
+"X@	c #B0AEB1",
+"Y@	c #C7C8C2",
+"Z@	c #C8C9C4",
+"`@	c #B2B3AE",
+" #	c #A2A4A2",
+".#	c #8B8B8D",
+"+#	c #848383",
+"@#	c #A6A5A5",
+"##	c #565656",
+"$#	c #464646",
+"%#	c #565657",
+"&#	c #1F1E20",
+"*#	c #3B393A",
+"=#	c #31302D",
+"-#	c #A7A6A2",
+";#	c #AFAEA9",
+">#	c #D4D3CF",
+",#	c #E1DFE2",
+"'#	c #A5A3A5",
+")#	c #CACAC5",
+"!#	c #DEE0DA",
+"~#	c #C6C7C2",
+"{#	c #ACACA8",
+"]#	c #878A8B",
+"^#	c #656768",
+"/#	c #A4A4A3",
+"(#	c #696969",
+"_#	c #5E5E5E",
+":#	c #343434",
+"<#	c #363437",
+"[#	c #1F1D1E",
+"}#	c #4C4B48",
+"|#	c #B8B7B2",
+"1#	c #D2D1CD",
+"2#	c #E7E6E4",
+"3#	c #BAB8BB",
+"4#	c #828082",
+"5#	c #B0B1AC",
+"6#	c #D9DBD5",
+"7#	c #C2C3BE",
+"8#	c #B3B3AF",
+"9#	c #B9B9B7",
+"0#	c #54585C",
+"a#	c #949494",
+"b#	c #848484",
+"c#	c #636363",
+"d#	c #101010",
+"e#	c #3B3B3C",
+"f#	c #2D2C2D",
+"g#	c #3C3A3D",
+"h#	c #141214",
+"i#	c #7E7C7A",
+"j#	c #BFBEBA",
+"k#	c #BDBCB7",
+"l#	c #AFAEAA",
+"m#	c #828083",
+"n#	c #8E8C8E",
+"o#	c #AEAFA9",
+"p#	c #B5B5B0",
+"q#	c #BBBCB7",
+"r#	c #C2C2BE",
+"s#	c #6F7479",
+"t#	c #88898A",
+"u#	c #7A7A7A",
+"v#	c #787878",
+"w#	c #5F5F5F",
+"x#	c #0A0A0A",
+"y#	c #494849",
+"z#	c #171519",
+"A#	c #353235",
+"B#	c #B9B8B3",
+"C#	c #A3A2A0",
+"D#	c #AEACAF",
+"E#	c #BCB9BD",
+"F#	c #C0C1BB",
+"G#	c #BCBDB6",
+"H#	c #B8B9B4",
+"I#	c #AFAFAB",
+"J#	c #9E9E9C",
+"K#	c #555C63",
+"L#	c #5E5F5F",
+"M#	c #A8A8A7",
+"N#	c #878787",
+"O#	c #ADADAD",
+"P#	c #535353",
+"Q#	c #474847",
+"R#	c #191917",
+"S#	c #757471",
+"T#	c #A7A7A2",
+"U#	c #C1C1BC",
+"V#	c #C2C2BD",
+"W#	c #BEBEB9",
+"X#	c #C1C1BD",
+"Y#	c #C4C4C2",
+"Z#	c #B3B4B1",
+"`#	c #A4A4A2",
+" $	c #91928F",
+".$	c #747472",
+"+$	c #6A6A69",
+"@$	c #535351",
+"#$	c #605F5E",
+"$$	c #9A9999",
+"%$	c #E2E2E2",
+"&$	c #4D4D4D",
+"*$	c #191919",
+"=$	c #060705",
+"-$	c #5F6059",
+";$	c #AFB0A9",
+">$	c #B6B8B1",
+",$	c #B8B9B3",
+"'$	c #BEBFB9",
+")$	c #C1C2BC",
+"!$	c #ACAEA7",
+"~$	c #979892",
+"{$	c #686869",
+"]$	c #636364",
+"^$	c #5C5C5D",
+"/$	c #666665",
+"($	c #565758",
+"_$	c #686C71",
+":$	c #787777",
+"<$	c #A3A3A3",
+"[$	c #979797",
+"}$	c #797979",
+"|$	c #0B0B0B",
+"1$	c #545454",
+"2$	c #272727",
+"3$	c #070708",
+"4$	c #565655",
+"5$	c #A6A7A2",
+"6$	c #9A9B95",
+"7$	c #A5A6A1",
+"8$	c #BDBEB9",
+"9$	c #B9BAB5",
+"0$	c #9FA09B",
+"a$	c #81827D",
+"b$	c #757671",
+"c$	c #62625E",
+"d$	c #616161",
+"e$	c #69696A",
+"f$	c #646464",
+"g$	c #595858",
+"h$	c #3C3C3D",
+"i$	c #4F5760",
+"j$	c #5E5F60",
+"k$	c #DEDEDF",
+"l$	c #D4D4D4",
+"m$	c #2E2E2E",
+"n$	c #151515",
+"o$	c #404040",
+"p$	c #131313",
+"q$	c #A3A4A2",
+"r$	c #C9CAC5",
+"s$	c #AFB0AB",
+"t$	c #898A85",
+"u$	c #8D8E89",
+"v$	c #747570",
+"w$	c #676863",
+"x$	c #5F605B",
+"y$	c #61625D",
+"z$	c #666662",
+"A$	c #5C5C5C",
+"B$	c #4C4C4C",
+"C$	c #393939",
+"D$	c #323538",
+"E$	c #555E67",
+"F$	c #CBCBCB",
+"G$	c #6F6F6F",
+"H$	c #575757",
+"I$	c #3E3E3E",
+"J$	c #3F3F3F",
+"K$	c #505050",
+"L$	c #1E1E1E",
+"M$	c #A6A6A6",
+"N$	c #C4C4C3",
+"O$	c #959691",
+"P$	c #767772",
+"Q$	c #6F706B",
+"R$	c #686964",
+"S$	c #6A6B66",
+"T$	c #5B5C56",
+"U$	c #595B55",
+"V$	c #474747",
+"W$	c #202224",
+"X$	c #75797E",
+"Y$	c #4C5155",
+"Z$	c #6C6C6B",
+"`$	c #DBDBDB",
+" %	c #B0B0B0",
+".%	c #D0D0D0",
+"+%	c #AEAEAE",
+"@%	c #3C3C3C",
+"#%	c #313131",
+"$%	c #2F2F2F",
+"%%	c #292929",
+"&%	c #1B1B1B",
+"*%	c #424242",
+"=%	c #818181",
+"-%	c #A9A9A9",
+";%	c #A4A4A4",
+">%	c #8D8D8C",
+",%	c #737470",
+"'%	c #646561",
+")%	c #62635E",
+"!%	c #656662",
+"~%	c #585954",
+"{%	c #494A45",
+"]%	c #34342F",
+"^%	c #252621",
+"/%	c #1F1F1E",
+"(%	c #2F343B",
+"_%	c #717171",
+":%	c #606060",
+"<%	c #8A8A8A",
+"[%	c #898989",
+"}%	c #5D5D5D",
+"|%	c #1C1C1C",
+"1%	c #585858",
+"2%	c #747474",
+"3%	c #6D6D6D",
+"4%	c #5E5E5D",
+"5%	c #5C5C5A",
+"6%	c #686866",
+"7%	c #5E5D5B",
+"8%	c #4C4C4A",
+"9%	c #424240",
+"0%	c #2C2C2A",
+"a%	c #262624",
+"b%	c #333536",
+"c%	c #242629",
+"d%	c #141618",
+"e%	c #010000",
+"f%	c #858483",
+"g%	c #B9B9B9",
+"h%	c #7D7D7D",
+"i%	c #C6C6C6",
+"j%	c #777777",
+"k%	c #757575",
+"l%	c #959595",
+"m%	c #727272",
+"n%	c #656565",
+"o%	c #626262",
+"p%	c #676765",
+"q%	c #595957",
+"r%	c #3E3E3B",
+"s%	c #2D2D2B",
+"t%	c #2F302F",
+"u%	c #2E2E2D",
+"v%	c #252A2E",
+"w%	c #31363D",
+"x%	c #535D68",
+"y%	c #21272C",
+"z%	c #1E2329",
+"A%	c #676868",
+"B%	c #C2C2C2",
+"C%	c #D1D1D1",
+"D%	c #A7A7A7",
+"E%	c #D2D2D2",
+"F%	c #ACACAC",
+"G%	c #676767",
+"H%	c #4F4F4F",
+"I%	c #373633",
+"J%	c #222220",
+"K%	c #3B3D3D",
+"L%	c #5F6162",
+"M%	c #575859",
+"N%	c #A3A2A2",
+"O%	c #C0C0C0",
+"P%	c #BBBBBB",
+"Q%	c #666666",
+"R%	c #2A2928",
+"S%	c #20201F",
+"T%	c #313235",
+"U%	c #8D8C8C",
+"V%	c #CACACA",
+"W%	c #9C9C9C",
+"X%	c #B2B2B2",
+"Y%	c #B7B7B7",
+"Z%	c #9D9D9D",
+"`%	c #444343",
+" &	c #2C2E2E",
+".&	c #2B2D2E",
+"+&	c #383C3F",
+"@&	c #6C6C6C",
+"#&	c #939393",
+"$&	c #A5A5A5",
+"%&	c #909090",
+"&&	c #4F4E4E",
+"*&	c #30302F",
+"=&	c #323131",
+"-&	c #242425",
+";&	c #373B3F",
+">&	c #808081",
+",&	c #9A9A9A",
+"'&	c #464545",
+")&	c #272829",
+"!&	c #545B63",
+"~&	c #686868",
+"{&	c #292B2D",
+"]&	c #7B7C7D",
+"^&	c #565757",
+"/&	c #373635",
+"(&	c #272626",
+"_&	c #2D2E2F",
+":&	c #35383B",
+"<&	c #565555",
+"[&	c #212121",
+"}&	c #323336",
+"|&	c #373A3F",
+"1&	c #343436",
+"2&	c #2C2A2A",
+"3&	c #121212",
+"4&	c #141517",
+"5&	c #6A7077",
+"6&	c #8B8C8D",
+"7&	c #1B1C1D",
+"8&	c #24272B",
+"9&	c #232629",
+"0&	c #0E0E0F",
+"a&	c #393D3F",
+"b&	c #21201E",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                        .     +   @                             ",
+"                                                        # $ % & *   = -                         ",
+"                                                ; > , ' ) ! ~ { ] ^ / ( _                       ",
+"                                          > : < [ } | 1 2 3 4 5 6 7 8 9 >                       ",
+"                                        0 a b ) c [ d e f g h i j k l m n _                     ",
+"                            o p q r s t u v w x y z e 2 A B { C ^ D E F G H                     ",
+"                            I J K K K K K K K K K L M N O P Q R S m F T T U                     ",
+"                  V W   X Y Z ` J J  . .`  .L L L L K ..+. at .#.^ $.F F %.&.*.=.                  ",
+"          -.;.>.,.'.).Y !.~.{.].J J  .K  . .K Z ^.J /.K (._.:.m <.R [.}.|.1.2.3.                ",
+"    0 4.5.6.7.8.9.0.K K K ` ` J J K J K  .a.K a.^.^.Z K (./.b.c.8 F d.G e.$.5 f.                ",
+"    g.h.i.j.k.l.m.K J ` J Z K  .` K K n...K K L K /.o.L K K K p.q.r.s.t.u.v.{ k w.              ",
+"x.y.z.A.B.C.D.E.~.K J  .K J K Z K F.G.H.I.G.J.K  .K.J L K L K Z L.M.N.O.P.Q.%.R.S.              ",
+"T.U.V.W.X.j.i.Y.K Z K J J K K J Z.`. +.+.+ +++ at +K Z K K K K K #+$+%+&+*+=+-+;+>+,+w.            ",
+"'+)+!+~+{+]+^+` K  .K  . .K K /+(+.+.+_+:+.+.+>.<+K K K K K K [+}+|+1+2+3+4+:+5+6+7+            ",
+"'+8+9+0+g.a+b+]. . . .J K K K c+.+_+d+e+f+d+ +:+g+K K K K K h+i+j+k+l+m+n+o+p+q+r+s+            ",
+"  t+u+l.v+w+x+y+J ` Z J K J K z+.+A+:+B+C+.+:+.+  K K K K K J K D+E+F+G+H+O.I+J+K+L+M+          ",
+"N+  O+9.v+P+Q+y+J R+J J K J K S+.+:+ +T+T+.+A+.+U+J K K K K K V+W+X+Y+Z+&+&+`+ @. at +@@@          ",
+"    #@z+,.  x+$@K Z J J J K K %@e+.+.+:+.+A+.+&@*@K K K K K =@-@;@>@, at Z+'@)@!@~@{@]@^@/@        ",
+"    (@_@:@<@J.[@K ~.Z K K K K }@|@1 at .+ +:+.+2 at 3@].K J Z K 4 at 5@6 at 7@8 at 9@0 at a@b at c@d at e@f at g@h@        ",
+"    i at g+j@j.k at l@Z J J  .J K K K $@m@>.n at o@p at q@r at K Z J ` R+s at t@u at v@w at x@y at 2+O.z@A at B@C at D@E at F@      ",
+"      G at H@H at I@J.`  .K Z  .K K R+K ~.J at K@L at M@~.K J J ].J N at w+O@P at Q@R at S@T at U@V at S W at X@Y at Z@`@ #      ",
+"      .#+#@###$#y+ .J K J K K J K K K J  .K K J K K K ~.z+:+%#&#*#=#-#0@;#>#.+,#'#)#!#~#{#]#    ",
+"        ^#/#(#_#Q+K K K K K K  .J K J J ` R+J  . . .J R+C.9.:#<#[#}#&+H+|#1#2#3#4#5#6#7#8#9#    ",
+"        0#a#b#q at c#d#K J K K K  . . .Z Z  .J J ~.Z K Z  .M at e#f#g#h#i#T at j#k#l#m m#n#o#p#q#r#! s#  ",
+"        t#u#H at v#H at w#~.K K K K  .J J  .J K `  .K  .J Z Z K x#y#z#A#^ G+m+0 at B#C#D#E#F#G#H#I#J#K#  ",
+"          L#M#N#O#]+P#~.K  . .Z J K  . .K J J K Z Z R+K d#Q#J at R#S#T#U#V#W#W#X#| Y#Z#`# $.$+$@$#$",
+"            $$k.<@%$++&$` K J K  .Z K K  . . .K K Z K *$m.Q+=$-$;$>$,$F#'$)$'$!$~$G.{$]$^$/$($_$",
+"            :$]+<$[$8.~+}$M@`  .K K K Z Z K K  .R+|$x+1$2$3$4$5$5#6$7$8$9$0$a$b$c$d$e$c#f$g$h$i$",
+"            j$( k$z+a#l$k.v#@+m$*${.` ` {.{.].n$0. at +o$p$].P#q$r$s$t$t$u$v$w$x$y$z$d$A$B$C$2$D$E$",
+"              S+T+F$D.~+B+B.G$w#H$$#o$I$0.J$K$&$0.L$Z [@w#M$N$H#O$P$Q$R$w$S$S$T$U$V$/+m$p$W$  X$",
+"            Y$Z$: `$ %.%+%_###@%#%m$$%%%J@&%].K R+[@*%=%-%;%>%,%'%)%S$!%y$~%{%]%^%/%n.K K (%    ",
+"              g+H.~+i._%:%<%[%}%*@$%<+[@}@}@|%k at 1%2%[$S+c+3%4%5%6%6%7%8%9%0%a%b%c%d%K e%p$      ",
+"                f%z.g%h%^+i%i%w+H at C.j%m at k%C.<@l%|@B.m%n%f$f$o%p%q%r%s%t%u%v%w%; x%  y%z%.       ",
+"                A%B%C%<$D%>.{+E%:@F$'.'.p at F%N#u#G%o%(#n%c#Z.H%I%J%K%L%                          ",
+"                M%N%C+0+1@%$w+O%F$P%-%S+3 at G%n%Q%n%g+w#m.J$R%S%T%                                ",
+"                  U%H.V%V%W%X%Y%Z%=%G$d$:%f$Q%w#g$`%I$ &.&+&                                    ",
+"                  @&D.|@#&$&%&q at f$:%G%g+w#A$&&*&=&-&;&                                          ",
+"                  >&W%,&N#q@:%o%Q%(#n%b+'&K@<+)&  !&                                            ",
+"                    w#g+f$d$g+~&A$$#k@$%{&u   ;                                                 ",
+"                  ]&^&3%~&c#P#/&(&_&:&                                                          ",
+"                      <&m.K@[&}&|&  N+                                                          ",
+"                    1&2&3&x#4&  5&                                                              ",
+"                  6&7&].` K 8&                                                                  ",
+"                    9&K K 0&                                                                    ",
+"                    N+a&b&  X$                                                                  "};
diff --git a/images/MusicalInstruments/vibraphone_vibes.xpm b/images/MusicalInstruments/vibraphone_vibes.xpm
new file mode 100644
index 0000000..f342702
--- /dev/null
+++ b/images/MusicalInstruments/vibraphone_vibes.xpm
@@ -0,0 +1,765 @@
+/* XPM */
+static char * vibraphone_vibes_xpm[] = {
+"48 48 714 2",
+"  	c #969696",
+". 	c #444E59",
+"+ 	c #686D73",
+"@ 	c #555D67",
+"# 	c #707781",
+"$ 	c #91959D",
+"% 	c #92969E",
+"& 	c #676D77",
+"* 	c #4F565F",
+"= 	c #4B535D",
+"- 	c #626972",
+"; 	c #6E757E",
+"> 	c #858A94",
+", 	c #8E9199",
+"' 	c #A1A3AA",
+") 	c #A2A4AB",
+"! 	c #A9AAB1",
+"~ 	c #A8A9B0",
+"{ 	c #A8A9B1",
+"] 	c #9E9FA6",
+"^ 	c #71767D",
+"/ 	c #6D7277",
+"( 	c #4C5660",
+"_ 	c #5E656F",
+": 	c #757B86",
+"< 	c #A8A3A2",
+"[ 	c #A4A6AC",
+"} 	c #B0AEB1",
+"| 	c #BFB6B0",
+"1 	c #AFA9A2",
+"2 	c #A0A3AB",
+"3 	c #9FA0A6",
+"4 	c #A3A4AB",
+"5 	c #9FA1A8",
+"6 	c #A6A7AE",
+"7 	c #A0A2A9",
+"8 	c #ACADB6",
+"9 	c #858991",
+"0 	c #525A65",
+"a 	c #676D76",
+"b 	c #7B8088",
+"c 	c #8D9099",
+"d 	c #92949B",
+"e 	c #9EA0A6",
+"f 	c #A3A5AF",
+"g 	c #B7A99B",
+"h 	c #BEB09D",
+"i 	c #B0A497",
+"j 	c #A9A29C",
+"k 	c #A5A5AA",
+"l 	c #A9ABB1",
+"m 	c #AAACB2",
+"n 	c #A7A9AF",
+"o 	c #AAABB1",
+"p 	c #ADAEB6",
+"q 	c #A8A9AF",
+"r 	c #B5B6BD",
+"s 	c #8B8C91",
+"t 	c #4B5159",
+"u 	c #6C7177",
+"v 	c #464F5A",
+"w 	c #58606A",
+"x 	c #6D737D",
+"y 	c #82868F",
+"z 	c #94969D",
+"A 	c #9A9BA2",
+"B 	c #9A9CA3",
+"C 	c #97989E",
+"D 	c #9799A0",
+"E 	c #95989F",
+"F 	c #9FA198",
+"G 	c #CBB38E",
+"H 	c #9E948B",
+"I 	c #A9A8AE",
+"J 	c #B0B2B9",
+"K 	c #A6A8AD",
+"L 	c #B4B5BB",
+"M 	c #9EA0A5",
+"N 	c #A7A8AD",
+"O 	c #B8B9C0",
+"P 	c #A9AAB0",
+"Q 	c #AEB0B7",
+"R 	c #A0A1A8",
+"S 	c #4F5153",
+"T 	c #454A50",
+"U 	c #444E58",
+"V 	c #49525D",
+"W 	c #5A626C",
+"X 	c #606670",
+"Y 	c #747881",
+"Z 	c #81848D",
+"` 	c #91939A",
+" .	c #A0A1A9",
+"..	c #96979E",
+"+.	c #95979E",
+"@.	c #909298",
+"#.	c #93959B",
+"$.	c #989AA0",
+"%.	c #8A8D81",
+"&.	c #B0AC94",
+"*.	c #BBBBBD",
+"=.	c #8C8D93",
+"-.	c #929398",
+";.	c #B2B3B9",
+">.	c #A8AAAF",
+",.	c #B4B6BD",
+"'.	c #818387",
+").	c #343537",
+"!.	c #6A6B70",
+"~.	c #BABCC2",
+"{.	c #A6A7AC",
+"].	c #ACADB4",
+"^.	c #AAACB3",
+"/.	c #A5A6AC",
+"(.	c #6F7074",
+"_.	c #3D4043",
+":.	c #484F59",
+"<.	c #4F5862",
+"[.	c #5A616B",
+"}.	c #6E737B",
+"|.	c #888A91",
+"1.	c #8E8F95",
+"2.	c #8C8D94",
+"3.	c #8A8C93",
+"4.	c #878990",
+"5.	c #90929A",
+"6.	c #88898F",
+"7.	c #96989E",
+"8.	c #8B8D93",
+"9.	c #A3A5AC",
+"0.	c #8F9197",
+"a.	c #9FA1A7",
+"b.	c #A5A7AE",
+"c.	c #898B8E",
+"d.	c #8B927C",
+"e.	c #A8AAB1",
+"f.	c #8D8E95",
+"g.	c #393A3B",
+"h.	c #626468",
+"i.	c #96989D",
+"j.	c #BABBC1",
+"k.	c #525355",
+"l.	c #0A0C0C",
+"m.	c #535458",
+"n.	c #B9BBC2",
+"o.	c #9B9CA1",
+"p.	c #B4B6BC",
+"q.	c #A7A8AE",
+"r.	c #BABBC3",
+"s.	c #808284",
+"t.	c #404244",
+"u.	c #464D55",
+"v.	c #555C65",
+"w.	c #6A6E76",
+"x.	c #75787F",
+"y.	c #7C7E85",
+"z.	c #83848B",
+"A.	c #83858B",
+"B.	c #81838A",
+"C.	c #898B92",
+"D.	c #8B8C92",
+"E.	c #888990",
+"F.	c #8D8F96",
+"G.	c #92949A",
+"H.	c #999AA2",
+"I.	c #9C9DA4",
+"J.	c #A5A6AF",
+"K.	c #909197",
+"L.	c #4C4D4F",
+"M.	c #7D7F84",
+"N.	c #9D9EA5",
+"O.	c #8A8B91",
+"P.	c #919299",
+"Q.	c #6D6F72",
+"R.	c #151718",
+"S.	c #4F5154",
+"T.	c #B3B4BB",
+"U.	c #929499",
+"V.	c #B9BABF",
+"W.	c #3A3B3D",
+"X.	c #696A6E",
+"Y.	c #B8BAC0",
+"Z.	c #ABACB1",
+"`.	c #B2B4BA",
+" +	c #B5B6BC",
+".+	c #B9BAC1",
+"++	c #A1A2A6",
+"@+	c #515152",
+"#+	c #4D5257",
+"$+	c #454E59",
+"%+	c #454D56",
+"&+	c #53575C",
+"*+	c #808086",
+"=+	c #717277",
+"-+	c #787A7F",
+";+	c #7E8085",
+">+	c #7B7D82",
+",+	c #7A7B81",
+"'+	c #8E9097",
+")+	c #8F9096",
+"!+	c #8E8F97",
+"~+	c #909299",
+"{+	c #919499",
+"]+	c #4B4C4C",
+"^+	c #47494B",
+"/+	c #ABADB5",
+"(+	c #888A90",
+"_+	c #A6A7AF",
+":+	c #4A4C4E",
+"<+	c #16181A",
+"[+	c #7E8087",
+"}+	c #9B9CA4",
+"|+	c #989AA1",
+"1+	c #96989F",
+"2+	c #ACADB5",
+"3+	c #8E8F96",
+"4+	c #76777A",
+"5+	c #CACCD1",
+"6+	c #999A9E",
+"7+	c #CFD0D6",
+"8+	c #ADAEB2",
+"9+	c #5D5D5F",
+"0+	c #555658",
+"a+	c #BEBFC4",
+"b+	c #BBBCC0",
+"c+	c #AEAFB3",
+"d+	c #B5B5BA",
+"e+	c #8E8F92",
+"f+	c #282726",
+"g+	c #373A3E",
+"h+	c #3E4348",
+"i+	c #3F4040",
+"j+	c #6A6C70",
+"k+	c #76777C",
+"l+	c #75767A",
+"m+	c #7F8085",
+"n+	c #818389",
+"o+	c #8F9198",
+"p+	c #565658",
+"q+	c #55575A",
+"r+	c #8F9199",
+"s+	c #82848B",
+"t+	c #8C8E95",
+"u+	c #4C4E51",
+"v+	c #292B2C",
+"w+	c #64666B",
+"x+	c #9EA0A7",
+"y+	c #65666A",
+"z+	c #505252",
+"A+	c #A6A8AF",
+"B+	c #9B9CA3",
+"C+	c #A7A8B0",
+"D+	c #BDBFC6",
+"E+	c #95979A",
+"F+	c #404143",
+"G+	c #858689",
+"H+	c #AEAFB4",
+"I+	c #828386",
+"J+	c #ABABAF",
+"K+	c #373738",
+"L+	c #5C5C5E",
+"M+	c #6F7072",
+"N+	c #474749",
+"O+	c #4C4C4D",
+"P+	c #3B3B3B",
+"Q+	c #383839",
+"R+	c #111112",
+"S+	c #1B1E22",
+"T+	c #363C41",
+"U+	c #353434",
+"V+	c #282929",
+"W+	c #414244",
+"X+	c #333435",
+"Y+	c #696B71",
+"Z+	c #727479",
+"`+	c #8F919A",
+" @	c #585A5D",
+".@	c #141617",
+"+@	c #7E7F87",
+"@@	c #94959C",
+"#@	c #7C7D83",
+"$@	c #454547",
+"%@	c #ABACB4",
+"&@	c #AEAFB5",
+"*@	c #5C5C5D",
+"=@	c #4A4B4C",
+"-@	c #9E9FA5",
+";@	c #79797C",
+">@	c #5B5C5E",
+",@	c #4D4E50",
+"'@	c #313131",
+")@	c #333333",
+"!@	c #454445",
+"~@	c #373838",
+"{@	c #323233",
+"]@	c #343434",
+"^@	c #2B2B2B",
+"/@	c #242424",
+"(@	c #242423",
+"_@	c #252526",
+":@	c #303030",
+"<@	c #333434",
+"[@	c #141516",
+"}@	c #212528",
+"|@	c #3A4047",
+"1@	c #2C2D2D",
+"2@	c #212222",
+"3@	c #222424",
+"4@	c #2B2D2E",
+"5@	c #292B2E",
+"6@	c #424548",
+"7@	c #989AA3",
+"8@	c #5A5B5E",
+"9@	c #9FA0A7",
+"0@	c #8C8C93",
+"a@	c #909196",
+"b@	c #737479",
+"c@	c #3F4144",
+"d@	c #424547",
+"e@	c #65686B",
+"f@	c #484B4E",
+"g@	c #444749",
+"h@	c #282A2C",
+"i@	c #1F2223",
+"j@	c #2C2E30",
+"k@	c #252627",
+"l@	c #232425",
+"m@	c #272727",
+"n@	c #2B2C2C",
+"o@	c #272828",
+"p@	c #303130",
+"q@	c #3B3B3C",
+"r@	c #424242",
+"s@	c #4C4D4E",
+"t@	c #666A6F",
+"u@	c #676C71",
+"v@	c #3A3F45",
+"w@	c #3C444D",
+"x@	c #3A414A",
+"y@	c #464D56",
+"z@	c #3B3C3D",
+"A@	c #3E3F40",
+"B@	c #686867",
+"C@	c #606163",
+"D@	c #646568",
+"E@	c #828388",
+"F@	c #6E6F73",
+"G@	c #75767C",
+"H@	c #3C3D3F",
+"I@	c #222425",
+"J@	c #414346",
+"K@	c #2D3033",
+"L@	c #282B2D",
+"M@	c #1E2223",
+"N@	c #171B1C",
+"O@	c #13191B",
+"P@	c #121618",
+"Q@	c #0D1314",
+"R@	c #0D1415",
+"S@	c #101617",
+"T@	c #181D1E",
+"U@	c #1A1D1E",
+"V@	c #1B1D1F",
+"W@	c #212223",
+"X@	c #242626",
+"Y@	c #262829",
+"Z@	c #2F3031",
+"`@	c #3F4142",
+" #	c #56575A",
+".#	c #626366",
+"+#	c #7E7F85",
+"@#	c #86878C",
+"##	c #666C76",
+"$#	c #3E4853",
+"%#	c #4A535D",
+"&#	c #383F47",
+"*#	c #434649",
+"=#	c #363839",
+"-#	c #181A1B",
+";#	c #1A1C1E",
+">#	c #1F2122",
+",#	c #141618",
+"'#	c #0B0D0E",
+")#	c #07090B",
+"!#	c #0E1113",
+"~#	c #0E1214",
+"{#	c #111517",
+"]#	c #101517",
+"^#	c #0F1315",
+"/#	c #121718",
+"(#	c #171E1F",
+"_#	c #2D2E30",
+":#	c #393B3D",
+"<#	c #434446",
+"[#	c #595A5D",
+"}#	c #616265",
+"|#	c #6C6C70",
+"1#	c #888A8E",
+"2#	c #84858A",
+"3#	c #9B9CA2",
+"4#	c #909297",
+"5#	c #A5A6AE",
+"6#	c #87898F",
+"7#	c #9A9BA1",
+"8#	c #646B75",
+"9#	c #5E656E",
+"0#	c #373E47",
+"a#	c #272A2E",
+"b#	c #0C0E11",
+"c#	c #080A0B",
+"d#	c #07090A",
+"e#	c #0A0C0D",
+"f#	c #0A0D0E",
+"g#	c #0A0C0E",
+"h#	c #090B0C",
+"i#	c #141719",
+"j#	c #181B1D",
+"k#	c #1A1E20",
+"l#	c #292C2D",
+"m#	c #434548",
+"n#	c #505254",
+"o#	c #686A6E",
+"p#	c #737579",
+"q#	c #83848A",
+"r#	c #929399",
+"s#	c #929498",
+"t#	c #95969B",
+"u#	c #AAABB2",
+"v#	c #8D8F95",
+"w#	c #7E8289",
+"x#	c #A1A2AA",
+"y#	c #A7A8AF",
+"z#	c #8A8B90",
+"A#	c #A0A1AA",
+"B#	c #95969D",
+"C#	c #94959A",
+"D#	c #5F6670",
+"E#	c #666C72",
+"F#	c #323A43",
+"G#	c #282C30",
+"H#	c #090C0D",
+"I#	c #090B0B",
+"J#	c #0D0F0F",
+"K#	c #111314",
+"L#	c #1B1D1E",
+"M#	c #222426",
+"N#	c #313436",
+"O#	c #3E4042",
+"P#	c #414447",
+"Q#	c #63666B",
+"R#	c #6E6F74",
+"S#	c #6E7075",
+"T#	c #7F8188",
+"U#	c #909199",
+"V#	c #9899A0",
+"W#	c #9F9FA6",
+"X#	c #97979D",
+"Y#	c #93949A",
+"Z#	c #9C9EA5",
+"`#	c #95969C",
+" $	c #757982",
+".$	c #74767E",
+"+$	c #5D636B",
+"@$	c #8A8E97",
+"#$	c #82858D",
+"$$	c #8B8F98",
+"%$	c #A0A2AA",
+"&$	c #A2A3AB",
+"*$	c #93949B",
+"=$	c #5B636E",
+"-$	c #666B70",
+";$	c #353E48",
+">$	c #696E72",
+",$	c #222528",
+"'$	c #191C1D",
+")$	c #3B3D40",
+"!$	c #44494E",
+"~$	c #464C54",
+"{$	c #525961",
+"]$	c #525962",
+"^$	c #575F68",
+"/$	c #505862",
+"($	c #4F5761",
+"_$	c #4E5863",
+":$	c #54585E",
+"<$	c #4D555F",
+"[$	c #49535D",
+"}$	c #4B545F",
+"|$	c #4C5560",
+"1$	c #4E5761",
+"2$	c #727881",
+"3$	c #7A7F87",
+"4$	c #84878F",
+"5$	c #A6A8B0",
+"6$	c #91939B",
+"7$	c #878991",
+"8$	c #666B74",
+"9$	c #747880",
+"0$	c #696E77",
+"a$	c #717681",
+"b$	c #757880",
+"c$	c #6E737D",
+"d$	c #A3A3A9",
+"e$	c #ABACB3",
+"f$	c #97989D",
+"g$	c #616468",
+"h$	c #37404B",
+"i$	c #3A434C",
+"j$	c #1C1F22",
+"k$	c #3B4249",
+"l$	c #4D5661",
+"m$	c #6B6E72",
+"n$	c #3C4047",
+"o$	c #38434E",
+"p$	c #424C57",
+"q$	c #444D58",
+"r$	c #46505B",
+"s$	c #565E69",
+"t$	c #5D646E",
+"u$	c #6B717A",
+"v$	c #6E747D",
+"w$	c #7B7F87",
+"x$	c #6A7078",
+"y$	c #6C727A",
+"z$	c #A6A6AB",
+"A$	c #B2B3BB",
+"B$	c #666C75",
+"C$	c #48515C",
+"D$	c #565A5E",
+"E$	c #2B2E2F",
+"F$	c #4A4E53",
+"G$	c #6D7176",
+"H$	c #49515B",
+"I$	c #434E58",
+"J$	c #6C727B",
+"K$	c #686F78",
+"L$	c #8C8F97",
+"M$	c #5D636C",
+"N$	c #B1B3BA",
+"O$	c #A6A7AD",
+"P$	c #B8B9BF",
+"Q$	c #656B74",
+"R$	c #4A4E52",
+"S$	c #2C2D30",
+"T$	c #343B42",
+"U$	c #353A3F",
+"V$	c #45494E",
+"W$	c #464F58",
+"X$	c #454F5A",
+"Y$	c #4D5560",
+"Z$	c #777D86",
+"`$	c #606770",
+" %	c #C8CAD0",
+".%	c #AFB0B5",
+"+%	c #BDBEC3",
+"@%	c #636A73",
+"#%	c #2E2F30",
+"$%	c #3D444C",
+"%%	c #363B40",
+"&%	c #464D54",
+"*%	c #6D7276",
+"=%	c #4A4D52",
+"-%	c #B9B9BE",
+";%	c #BBBCC2",
+">%	c #C7C7CD",
+",%	c #6D7073",
+"'%	c #444C56",
+")%	c #303133",
+"!%	c #3A4046",
+"~%	c #444B52",
+"{%	c #5C5E63",
+"]%	c #202325",
+"^%	c #7A7B7F",
+"/%	c #46505A",
+"(%	c #4D5660",
+"_%	c #353637",
+":%	c #353B40",
+"<%	c #42454A",
+"[%	c #4A5158",
+"}%	c #797B80",
+"|%	c #5C5C5F",
+"1%	c #111415",
+"2%	c #5C5F63",
+"3%	c #5A626B",
+"4%	c #37383A",
+"5%	c #35393F",
+"6%	c #6B6F72",
+"7%	c #4C525A",
+"8%	c #555A60",
+"9%	c #696B6F",
+"0%	c #232628",
+"a%	c #0F1112",
+"b%	c #666C73",
+"c%	c #5F666E",
+"d%	c #39424C",
+"e%	c #37393C",
+"f%	c #35393D",
+"g%	c #40444A",
+"h%	c #6D7074",
+"i%	c #3F454A",
+"j%	c #383C41",
+"k%	c #24282C",
+"l%	c #161819",
+"m%	c #5C646C",
+"n%	c #646B73",
+"o%	c #333C47",
+"p%	c #363A3D",
+"q%	c #393B3E",
+"r%	c #40454C",
+"s%	c #40464C",
+"t%	c #41464D",
+"u%	c #474F59",
+"v%	c #40454B",
+"w%	c #383C40",
+"x%	c #444C55",
+"y%	c #444E5A",
+"z%	c #262C31",
+"A%	c #2D2E2F",
+"B%	c #5A5C60",
+"C%	c #373B3E",
+"D%	c #333537",
+"E%	c #454E58",
+"F%	c #484E56",
+"G%	c #484D52",
+"H%	c #45484B",
+"I%	c #4E535B",
+"J%	c #42474D",
+"K%	c #40464B",
+"L%	c #3F464D",
+"M%	c #212629",
+"N%	c #464E58",
+"O%	c #3A3E43",
+"P%	c #303234",
+"Q%	c #6C6F72",
+"R%	c #4D5258",
+"S%	c #4E5052",
+"T%	c #595A5B",
+"U%	c #666666",
+"V%	c #66686B",
+"W%	c #4F5760",
+"X%	c #454D57",
+"Y%	c #474D53",
+"Z%	c #474A4D",
+"`%	c #3F4246",
+" &	c #212527",
+".&	c #6D7177",
+"+&	c #3B4146",
+"@&	c #313233",
+"#&	c #404448",
+"$&	c #4D5156",
+"%&	c #646465",
+"&&	c #505152",
+"*&	c #454747",
+"=&	c #484C51",
+"-&	c #454D55",
+";&	c #242729",
+">&	c #363D44",
+",&	c #2A2D2E",
+"'&	c #6C6E72",
+")&	c #444C54",
+"!&	c #495056",
+"~&	c #4C4F54",
+"{&	c #494E53",
+"]&	c #3C4045",
+"^&	c #454B51",
+"/&	c #2F3539",
+"(&	c #444D56",
+"_&	c #40454A",
+":&	c #454B52",
+"<&	c #474C53",
+"[&	c #464C55",
+"}&	c #49525B",
+"|&	c #555B63",
+"1&	c #393F44",
+"2&	c #1F2121",
+"3&	c #414851",
+"4&	c #40464D",
+"5&	c #3F454C",
+"6&	c #474E55",
+"7&	c #4B4E53",
+"8&	c #474A4E",
+"9&	c #45494F",
+"0&	c #474E58",
+"a&	c #4B545E",
+"b&	c #525B65",
+"c&	c #767B83",
+"d&	c #4E545C",
+"e&	c #2D2F30",
+"f&	c #2F3133",
+"g&	c #3B3D3E",
+"h&	c #43474D",
+"i&	c #636A74",
+"j&	c #4B525B",
+"k&	c #48494A",
+"l&	c #2A2B2B",
+"m&	c #393E42",
+"n&	c #3E4347",
+"o&	c #36383B",
+"p&	c #3B444C",
+"q&	c #272B2D",
+"r&	c #282B2F",
+"s&	c #3C444C",
+"t&	c #414549",
+"u&	c #3A4048",
+"v&	c #545A60",
+"w&	c #5F6166",
+"x&	c #444D57",
+"y&	c #49525C",
+"z&	c #525860",
+"A&	c #505761",
+"B&	c #98999F",
+"C&	c #60666E",
+"D&	c #575D64",
+"E&	c #76787F",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                  .                             ",
+"                                                    + + +   @ # $ % & *                         ",
+"                                              +   = - ; > , ' ) ! ~ { ] ^                       ",
+"                                      +   / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 =                   ",
+"                                    0 a b c d e f g h i j k l 6 m n o p q r s t u               ",
+"                            v w x y z A B C D E F G H I 4 J K L M N O P Q { R S T U             ",
+"                    V W X Y Z `  ...+.` @.#.$.+.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.          ",
+"              <.[.}.|.1.2.3.4.5.6.7.D 8.9.0.a.b.c.d.e.f.g.h.O i.j.k.l.m.n.o.p.q.r.s.t.u.        ",
+"        v.w.x.y.z.A.B.C.D.E.F.` G.D.H.I.J.K.L.M.N.O.P.e Q.R.S.T.U.V.(.W.X.Y.Z.`. +.+++ at +#+$+    ",
+"    %+  &+*+=+-+;+>+f.,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+m.4+5+6+7+8+9+0+a+b+c+d+q e+f+g+    ",
+"    h+i+i+j+k+l+m+n+o+p+q+r+s+t+5 u+v+w+x+` 7 y+z+A+B+C+e D+E+F+G+H+I+J+p+K+L+M+N+O+P+Q+R+S+    ",
+"    T+U+V+W+^+X+Y+Z+`+ @. at +@2.d @@C+#@$@P./+%@&@*@=@- at M+;@>@,@'@)@!@~@{@'@]@^@/@(@_@:@<@[@}@    ",
+"    |@1 at 2@3 at 4@5 at 6@4.4.7 at l+8@9 at 0@a at C b at c@d at e@f at g@h at i@j at k@l at m@V+n at o@^@p@)@q at r@s at S.t@u at v@  w at x@    ",
+"    y at z@A at B@C at D@W+E at F@G at H@I at J@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@Y at Z@`@ #.#+#b at A @#] ##$#%#&#          ",
+"      *#=#X+-#;#.@>#,#'#)#!#~#{#{#]#^#S@/#(#i at _#:#<#[#}#|#1#2#3#B+4#5#6#b.)+7#8#$#9#0#          ",
+"        a#b#c#d#e#f#g#h#f#!#i#j#k#l#m#n#o#p#q#r#3+s#I.U.t#u#v#w#x#a at y#z#A#B#C#D#$#E#F#          ",
+"        G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#3.V#..A W#X#Y#Z#7#`# $.$+$@$#$$$D.%$&$*$=$$#-$;$          ",
+"      >$,$'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$[.& 2$3$4$5$6$7$8$9$0$a$b$c$o+d$e$f$0 $#g$h$          ",
+"      i$j$k$l$/             m$n$          o$p$q$  r$s$t$u$v$w$x$v$w#y$a.z$A$B$C$$#D$            ",
+"        E$                  F$G$            H$$+          I$w J$K$L$M$N$O$P$Q$$#$#R$            ",
+"        S$x@              T$U$              V$W$              X$Y$Z$`$ %.%+%@%$#$#!$            ",
+"      G$#%$%              %%                &%*%                    =%-%;%>%_ $#U ,%            ",
+"      '%)%!%                                ~%                      {%]%^%/%l$$#(%              ",
+"        _%:%            <%                  [%                      }%|%1%2%$#$#3%              ",
+"        4%5%          6%                    7%                      8%9%0%a%b%$#c%d%            ",
+"        e%f%          g%                    h%                      k$i%j%k%l%m%n%o%            ",
+"        p%q%        r%s%                    t%u%                v%w%v at x%  y%z%A%B%              ",
+"        C%D%        Q.                E%F%G%H%I%      h%J%Q.K%L%              M%i at N%            ",
+"        O%P%        Q%            G$R%S%T%U%V%W%X%Y%Z%`%F%                       &p%.&          ",
+"        +&@&      #&                h%u%$&%&&&*&=&-&                              ;&s%          ",
+"        >&,&G$  '&Q%              )&!&~&{&]&V+A at h%                                Q.^&          ",
+"        /&l@(&  _&        '%:&{&{&<&[&      J%                                    }&|&H$        ",
+"        1&2&3&4&5&    6&7&8&9&0&                                                  a&b&c&        ",
+"        d&e&f&g&g%V$h&,%                                                          /$@ i&        ",
+"        j&k&l&m&                                                                    /$r$        ",
+"        / n&o&q$                                                                                ",
+"          p&q&                                                                                  ",
+"            r&s&                                                                                ",
+"            t&u&                                                                                ",
+"            v&w&x&                                                                              ",
+"            y&z&w+a&                                                                            ",
+"            / A&B&C&                                                                            ",
+"              D&E&H$                                                                            ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/MusicalInstruments/vocal_vox.xpm b/images/MusicalInstruments/vocal_vox.xpm
new file mode 100644
index 0000000..3d547ab
--- /dev/null
+++ b/images/MusicalInstruments/vocal_vox.xpm
@@ -0,0 +1,750 @@
+/* XPM */
+static char * vocal_vox_xpm[] = {
+"48 48 699 2",
+"  	c #969696",
+". 	c #55575C",
+"+ 	c #535559",
+"@ 	c #4E5055",
+"# 	c #3B4045",
+"$ 	c #3B424B",
+"% 	c #4D5259",
+"& 	c #64646B",
+"* 	c #7A7B82",
+"= 	c #5F6167",
+"- 	c #777A7F",
+"; 	c #61656B",
+"> 	c #73777B",
+", 	c #7C8087",
+"' 	c #656771",
+") 	c #3A4147",
+"! 	c #39414A",
+"~ 	c #555A60",
+"{ 	c #6B6D74",
+"] 	c #74767D",
+"^ 	c #797C83",
+"/ 	c #65696E",
+"( 	c #777B7F",
+"_ 	c #505358",
+": 	c #5E6368",
+"< 	c #676C70",
+"[ 	c #63686E",
+"} 	c #8A9098",
+"| 	c #969CA3",
+"1 	c #7F8487",
+"2 	c #4A4E55",
+"3 	c #374049",
+"4 	c #484D54",
+"5 	c #6C6C73",
+"6 	c #7C7F86",
+"7 	c #686C72",
+"8 	c #65696D",
+"9 	c #626467",
+"0 	c #54575A",
+"a 	c #4C4E53",
+"b 	c #575A60",
+"c 	c #515559",
+"d 	c #757A80",
+"e 	c #60676C",
+"f 	c #7E858C",
+"g 	c #8A929B",
+"h 	c #7C848E",
+"i 	c #555760",
+"j 	c #313841",
+"k 	c #66686D",
+"l 	c #86888F",
+"m 	c #53575C",
+"n 	c #777B7E",
+"o 	c #4A4C50",
+"p 	c #595B5E",
+"q 	c #3C3F42",
+"r 	c #46494D",
+"s 	c #323539",
+"t 	c #505459",
+"u 	c #4C5156",
+"v 	c #63676B",
+"w 	c #64696E",
+"x 	c #60676E",
+"y 	c #606872",
+"z 	c #7C818C",
+"A 	c #45464E",
+"B 	c #2E353D",
+"C 	c #5D5E64",
+"D 	c #797A82",
+"E 	c #53555B",
+"F 	c #74777B",
+"G 	c #3F4043",
+"H 	c #58595B",
+"I 	c #323232",
+"J 	c #686A6D",
+"K 	c #272728",
+"L 	c #42464B",
+"M 	c #2C3135",
+"N 	c #2F353B",
+"O 	c #545B62",
+"P 	c #43484D",
+"Q 	c #444C51",
+"R 	c #4E575C",
+"S 	c #515863",
+"T 	c #626472",
+"U 	c #14181B",
+"V 	c #363E48",
+"W 	c #40454B",
+"X 	c #6F7175",
+"Y 	c #6C7075",
+"Z 	c #484B50",
+"` 	c #4A4C4F",
+" .	c #46464A",
+"..	c #2E2E31",
+"+.	c #2F3135",
+"@.	c #212121",
+"#.	c #2A2D30",
+"$.	c #22272B",
+"%.	c #34383E",
+"&.	c #464B50",
+"*.	c #4A5056",
+"=.	c #42474E",
+"-.	c #3C4248",
+";.	c #4F5761",
+">.	c #595C67",
+",.	c #121317",
+"'.	c #38414B",
+").	c #515358",
+"!.	c #65686C",
+"~.	c #4D5054",
+"{.	c #646569",
+"].	c #454648",
+"^.	c #2D2D32",
+"/.	c #232426",
+"(.	c #202125",
+"_.	c #181818",
+":.	c #1A1C1D",
+"<.	c #2D3236",
+"[.	c #1E2328",
+"}.	c #2C3137",
+"|.	c #393F44",
+"1.	c #2D3339",
+"2.	c #3D4349",
+"3.	c #3C4048",
+"4.	c #3F4651",
+"5.	c #363941",
+"6.	c #313134",
+"7.	c #22272D",
+"8.	c #343C45",
+"9.	c #464950",
+"0.	c #606167",
+"a.	c #4D4E52",
+"b.	c #36383C",
+"c.	c #3B3B3E",
+"d.	c #212124",
+"e.	c #202225",
+"f.	c #151515",
+"g.	c #101010",
+"h.	c #1B1E23",
+"i.	c #14181D",
+"j.	c #303438",
+"k.	c #41444B",
+"l.	c #3A4046",
+"m.	c #2E353B",
+"n.	c #1F252C",
+"o.	c #33373F",
+"p.	c #3F444F",
+"q.	c #4E5156",
+"r.	c #46464B",
+"s.	c #292C33",
+"t.	c #2E363E",
+"u.	c #4C535B",
+"v.	c #585A61",
+"w.	c #46484D",
+"x.	c #4E5255",
+"y.	c #303236",
+"z.	c #4B4D51",
+"A.	c #1F1F1F",
+"B.	c #1E2025",
+"C.	c #131313",
+"D.	c #121417",
+"E.	c #0A0A0A",
+"F.	c #111518",
+"G.	c #292E33",
+"H.	c #12161B",
+"I.	c #282D32",
+"J.	c #282E35",
+"K.	c #30373D",
+"L.	c #444A51",
+"M.	c #2B2F37",
+"N.	c #3E424D",
+"O.	c #A1A2A5",
+"P.	c #7F7F84",
+"Q.	c #50545F",
+"R.	c #21262C",
+"S.	c #353E47",
+"T.	c #43454B",
+"U.	c #3A3D41",
+"V.	c #404146",
+"W.	c #1D1E23",
+"X.	c #171717",
+"Y.	c #111111",
+"Z.	c #0D0D0D",
+"`.	c #090B0F",
+" +	c #060606",
+".+	c #373A3D",
+"++	c #292E34",
+"@+	c #1B1F24",
+"#+	c #20252A",
+"$+	c #242A30",
+"%+	c #575D63",
+"&+	c #191F27",
+"*+	c #424A51",
+"=+	c #565E66",
+"-+	c #CECFD2",
+";+	c #AEACB1",
+">+	c #40444F",
+",+	c #22262D",
+"'+	c #313941",
+")+	c #717579",
+"!+	c #393B42",
+"~+	c #2D2E34",
+"{+	c #323339",
+"]+	c #1B1C21",
+"^+	c #2F3236",
+"/+	c #1F2225",
+"(+	c #121418",
+"_+	c #17181B",
+":+	c #06080C",
+"<+	c #1C1D20",
+"[+	c #0B0E13",
+"}+	c #20252B",
+"|+	c #3C4045",
+"1+	c #40454A",
+"2+	c #42484D",
+"3+	c #32383F",
+"4+	c #3F464F",
+"5+	c #7B8088",
+"6+	c #E5E5E7",
+"7+	c #A2A4A9",
+"8+	c #545763",
+"9+	c #383D43",
+"0+	c #2C333B",
+"a+	c #37404A",
+"b+	c #20222A",
+"c+	c #27292F",
+"d+	c #1C1E24",
+"e+	c #1C1F24",
+"f+	c #24252B",
+"g+	c #202328",
+"h+	c #0A0D12",
+"i+	c #06090D",
+"j+	c #16191E",
+"k+	c #0A0F12",
+"l+	c #1A1F24",
+"m+	c #474B52",
+"n+	c #2F353A",
+"o+	c #535A5E",
+"p+	c #373D43",
+"q+	c #4A5057",
+"r+	c #424951",
+"s+	c #4A515A",
+"t+	c #C2C6CA",
+"u+	c #ECECEC",
+"v+	c #676A72",
+"w+	c #4F5258",
+"x+	c #343D46",
+"y+	c #2A2C32",
+"z+	c #121319",
+"A+	c #1A1B20",
+"B+	c #101118",
+"C+	c #13151B",
+"D+	c #080B11",
+"E+	c #0F1417",
+"F+	c #04090E",
+"G+	c #161A1F",
+"H+	c #2C3035",
+"I+	c #454A4F",
+"J+	c #252A2F",
+"K+	c #454B52",
+"L+	c #60686E",
+"M+	c #5D6368",
+"N+	c #474D53",
+"O+	c #353A42",
+"P+	c #62656D",
+"Q+	c #E7E7E9",
+"R+	c #C3C3C8",
+"S+	c #494B55",
+"T+	c #636872",
+"U+	c #84878D",
+"V+	c #303235",
+"W+	c #24292F",
+"X+	c #040408",
+"Y+	c #0B0B12",
+"Z+	c #16161C",
+"`+	c #000000",
+" @	c #1C1D22",
+".@	c #0C1114",
+"+@	c #22252A",
+"@@	c #0E1116",
+"#@	c #383C3F",
+"$@	c #2C2F34",
+"%@	c #3F4449",
+"&@	c #4C5157",
+"*@	c #575B62",
+"=@	c #4A4F55",
+"-@	c #3A3F46",
+";@	c #3A3D44",
+">@	c #777780",
+",@	c #AFAFB5",
+"'@	c #6B6C74",
+")@	c #363742",
+"!@	c #7B7E88",
+"~@	c #919499",
+"{@	c #17181C",
+"]@	c #2D343B",
+"^@	c #323A43",
+"/@	c #0D1012",
+"(@	c #0A0A11",
+"_@	c #0C0C12",
+":@	c #26262C",
+"<@	c #121419",
+"[@	c #16171B",
+"}@	c #14161B",
+"|@	c #16191C",
+"1@	c #121619",
+"2@	c #24262B",
+"3@	c #44494E",
+"4@	c #41464C",
+"5@	c #2A2E37",
+"6@	c #3C424A",
+"7@	c #5A5F67",
+"8@	c #A4A5AD",
+"9@	c #7A7D84",
+"0@	c #5C5F67",
+"a@	c #686B74",
+"b@	c #AEB1BA",
+"c@	c #6F7176",
+"d@	c #3E4241",
+"e@	c #383E41",
+"f@	c #343C44",
+"g@	c #050509",
+"h@	c #06060C",
+"i@	c #111116",
+"j@	c #15151B",
+"k@	c #191B21",
+"l@	c #090A10",
+"m@	c #28292E",
+"n@	c #383B40",
+"o@	c #3C3E45",
+"p@	c #33373C",
+"q@	c #292E37",
+"r@	c #4D535B",
+"s@	c #494E57",
+"t@	c #9A9EA7",
+"u@	c #9C9EA7",
+"v@	c #63686F",
+"w@	c #61656C",
+"x@	c #757A81",
+"y@	c #AAADB5",
+"z@	c #393B3F",
+"A@	c #8C938E",
+"B@	c #88908E",
+"C@	c #3C4346",
+"D@	c #363F49",
+"E@	c #303841",
+"F@	c #1C1E23",
+"G@	c #15131B",
+"H@	c #0C0C11",
+"I@	c #000004",
+"J@	c #0B0B11",
+"K@	c #25282E",
+"L@	c #2E333A",
+"M@	c #262A32",
+"N@	c #464B52",
+"O@	c #494D54",
+"P@	c #9F9FA9",
+"Q@	c #B5B6BF",
+"R@	c #5C6069",
+"S@	c #636871",
+"T@	c #575C63",
+"U@	c #73767E",
+"V@	c #9C9DA5",
+"W@	c #3B3E42",
+"X@	c #AEB5B1",
+"Y@	c #C3CCC7",
+"Z@	c #868D8C",
+"`@	c #3D4447",
+" #	c #44444A",
+".#	c #1C1B23",
+"+#	c #07070B",
+"@#	c #07070D",
+"##	c #13161A",
+"$#	c #292C32",
+"%#	c #2F323A",
+"&#	c #2D2F37",
+"*#	c #686B72",
+"=#	c #9A9DA3",
+"-#	c #A2A2AB",
+";#	c #5D5D66",
+">#	c #3D4048",
+",#	c #414650",
+"'#	c #565B64",
+")#	c #71737B",
+"!#	c #56565D",
+"~#	c #666A64",
+"{#	c #A5ACA5",
+"]#	c #ABB3AE",
+"^#	c #C4CDC7",
+"/#	c #89908F",
+"(#	c #1E2126",
+"_#	c #3F3F48",
+":#	c #1F1F27",
+"<#	c #0E0E15",
+"[#	c #0D0D12",
+"}#	c #04060B",
+"|#	c #13141A",
+"1#	c #2B2E33",
+"2#	c #6D7075",
+"3#	c #989BA1",
+"4#	c #83878D",
+"5#	c #53565D",
+"6#	c #3C3D44",
+"7#	c #45474F",
+"8#	c #4A4F57",
+"9#	c #555862",
+"0#	c #83858D",
+"a#	c #424342",
+"b#	c #888C84",
+"c#	c #91978E",
+"d#	c #A4ABA4",
+"e#	c #ABB2AE",
+"f#	c #C1CAC5",
+"g#	c #8A918F",
+"h#	c #3A4145",
+"i#	c #2C333A",
+"j#	c #1B1C20",
+"k#	c #4A4A4F",
+"l#	c #1A1A1E",
+"m#	c #030308",
+"n#	c #010106",
+"o#	c #2D2D33",
+"p#	c #5C5C63",
+"q#	c #7F7F86",
+"r#	c #86868C",
+"s#	c #3D3E44",
+"t#	c #292931",
+"u#	c #464851",
+"v#	c #3C3E47",
+"w#	c #2E2E37",
+"x#	c #8A8B92",
+"y#	c #454647",
+"z#	c #6B6F68",
+"A#	c #7F837B",
+"B#	c #868A82",
+"C#	c #90968D",
+"D#	c #A3AAA3",
+"E#	c #ABB2AD",
+"F#	c #3B4146",
+"G#	c #333B44",
+"H#	c #222529",
+"I#	c #434445",
+"J#	c #5B5B60",
+"K#	c #6A6A72",
+"L#	c #7B7B82",
+"M#	c #707078",
+"N#	c #4E4E56",
+"O#	c #323239",
+"P#	c #191921",
+"Q#	c #3C3C44",
+"R#	c #303039",
+"S#	c #424249",
+"T#	c #474751",
+"U#	c #706E75",
+"V#	c #525354",
+"W#	c #5D605C",
+"X#	c #737770",
+"Y#	c #787C76",
+"Z#	c #7E837B",
+"`#	c #858981",
+" $	c #8F958D",
+".$	c #C0C9C4",
+"+$	c #89908E",
+"@$	c #3A4246",
+"#$	c #4B535B",
+"$$	c #272D34",
+"%$	c #1E2329",
+"&$	c #1B1E22",
+"*$	c #1D2023",
+"=$	c #18191E",
+"-$	c #33333B",
+";$	c #34343C",
+">$	c #3B3B43",
+",$	c #3F3F49",
+"'$	c #4B4B52",
+")$	c #414148",
+"!$	c #302E32",
+"~$	c #494A4A",
+"{$	c #5D605D",
+"]$	c #6C716C",
+"^$	c #747972",
+"/$	c #71766F",
+"($	c #787C75",
+"_$	c #7D827A",
+":$	c #858880",
+"<$	c #90958C",
+"[$	c #A2A9A2",
+"}$	c #3A4146",
+"|$	c #2B3239",
+"1$	c #1F242A",
+"2$	c #1B2024",
+"3$	c #181C20",
+"4$	c #17191D",
+"5$	c #111417",
+"6$	c #1C1E21",
+"7$	c #1E1E21",
+"8$	c #484749",
+"9$	c #3A393C",
+"0$	c #454745",
+"a$	c #747875",
+"b$	c #6D706E",
+"c$	c #626563",
+"d$	c #686D68",
+"e$	c #757A74",
+"f$	c #767A73",
+"g$	c #7C8178",
+"h$	c #83877F",
+"i$	c #90968C",
+"j$	c #A1A9A1",
+"k$	c #C0C8C3",
+"l$	c #313942",
+"m$	c #2D343C",
+"n$	c #282F36",
+"o$	c #1D2126",
+"p$	c #171B20",
+"q$	c #171B1F",
+"r$	c #25292C",
+"s$	c #5B5E5D",
+"t$	c #727673",
+"u$	c #707471",
+"v$	c #646765",
+"w$	c #666A66",
+"x$	c #747973",
+"y$	c #737871",
+"z$	c #757972",
+"A$	c #7B8078",
+"B$	c #83867E",
+"C$	c #8F948A",
+"D$	c #A1A8A0",
+"E$	c #AAB1AC",
+"F$	c #C1CAC4",
+"G$	c #848B8A",
+"H$	c #3B4248",
+"I$	c #353D47",
+"J$	c #323A42",
+"K$	c #2F363F",
+"L$	c #2C343C",
+"M$	c #252B32",
+"N$	c #22282E",
+"O$	c #202529",
+"P$	c #464A4A",
+"Q$	c #737674",
+"R$	c #686B69",
+"S$	c #636864",
+"T$	c #717670",
+"U$	c #777B75",
+"V$	c #747871",
+"W$	c #7A7E77",
+"X$	c #82857D",
+"Y$	c #8F948B",
+"Z$	c #A0A79F",
+"`$	c #828A88",
+" %	c #394046",
+".%	c #293037",
+"+%	c #23282F",
+"@%	c #33383A",
+"#%	c #696D6B",
+"$%	c #757876",
+"%%	c #616662",
+"&%	c #6E726D",
+"*%	c #767B75",
+"=%	c #797E77",
+"-%	c #81847D",
+";%	c #9FA59C",
+">%	c #C1C9C4",
+",%	c #838A88",
+"'%	c #2F363E",
+")%	c #262D33",
+"!%	c #272C30",
+"~%	c #575B5A",
+"{%	c #747775",
+"]%	c #707370",
+"^%	c #626763",
+"/%	c #696E6A",
+"(%	c #767B74",
+"_%	c #7F837A",
+":%	c #9EA59C",
+"<%	c #BCC5BF",
+"[%	c #828987",
+"}%	c #384047",
+"|%	c #2A3038",
+"1%	c #24292E",
+"2%	c #434748",
+"3%	c #737774",
+"4%	c #666967",
+"5%	c #656A66",
+"6%	c #797D77",
+"7%	c #767C74",
+"8%	c #7D8379",
+"9%	c #8E938B",
+"0%	c #9CA39A",
+"a%	c #A9B0AB",
+"b%	c #BEC7C2",
+"c%	c #808886",
+"d%	c #373F46",
+"e%	c #2F3336",
+"f%	c #6B6E6C",
+"g%	c #757976",
+"h%	c #6A6D6B",
+"i%	c #636865",
+"j%	c #707570",
+"k%	c #777B74",
+"l%	c #8E9189",
+"m%	c #9CA199",
+"n%	c #A7AEAA",
+"o%	c #BBC4BF",
+"p%	c #7F8584",
+"q%	c #363E46",
+"r%	c #303740",
+"s%	c #555859",
+"t%	c #6F7270",
+"u%	c #626762",
+"v%	c #6C706D",
+"w%	c #777C75",
+"x%	c #787D76",
+"y%	c #7B8077",
+"z%	c #8D9088",
+"A%	c #999F96",
+"B%	c #A6ADA7",
+"C%	c #B9C1BC",
+"D%	c #7A7F7E",
+"E%	c #373E46",
+"F%	c #2A3138",
+"G%	c #21272D",
+"H%	c #404446",
+"I%	c #6F7271",
+"J%	c #686E69",
+"K%	c #767A75",
+"L%	c #7C817A",
+"M%	c #7A7E76",
+"N%	c #8C9087",
+"O%	c #969B93",
+"P%	c #A3AAA4",
+"Q%	c #B3BCB7",
+"R%	c #777D7B",
+"S%	c #363F47",
+"T%	c #2D353D",
+"U%	c #252B31",
+"V%	c #303538",
+"W%	c #656867",
+"X%	c #676A68",
+"Y%	c #737872",
+"Z%	c #797D76",
+"`%	c #878B82",
+" &	c #949A90",
+".&	c #9FA6A0",
+"+&	c #B4BDB8",
+"@&	c #757A7A",
+"#&	c #353E46",
+"$&	c #303840",
+"%&	c #23282D",
+"&&	c #515555",
+"*&	c #767976",
+"=&	c #7B7F78",
+"-&	c #868A80",
+";&	c #8F958C",
+">&	c #9BA29C",
+",&	c #AEB6B1",
+"'&	c #6A706F",
+")&	c #3D4143",
+"!&	c #616562",
+"~&	c #6A6F6A",
+"{&	c #747872",
+"]&	c #80847B",
+"^&	c #888D84",
+"/&	c #8C928D",
+"(&	c #939A96",
+"_&	c #2E353E",
+":&	c #676A69",
+"<&	c #71756F",
+"[&	c #757872",
+"}&	c #7F847B",
+"|&	c #555A59",
+"1&	c #262C32",
+"2&	c #4D5051",
+"3&	c #727573",
+"4&	c #616561",
+"5&	c #6D726C",
+"6&	c #545853",
+"7&	c #1B1F23",
+"8&	c #333C45",
+"9&	c #2B323A",
+"0&	c #23282E",
+"a&	c #363A3C",
+"b&	c #5D615D",
+"c&	c #4F5350",
+"d&	c #171A1E",
+"e&	c #1D2227",
+"f&	c #292F36",
+"g&	c #343C46",
+"h&	c #353E48",
+"i&	c #24282D",
+"j&	c #595D5C",
+"k&	c #424546",
+"l&	c #1B2025",
+"m&	c #292F37",
+"n&	c #1F2429",
+"o&	c #262C33",
+"p&	c #2F373F",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                ",
+"                        . + @ # $                                                               ",
+"                  % & * = - ; > , ' ) !                                                         ",
+"              ~ { ] ^ / ( _ : < [ } | 1 2 3                                                     ",
+"            4 5 6 7 8 9 0 a b c d e f g h i j                                                   ",
+"            k l m n o p q r s t u v w x y z A B                                                 ",
+"          C D E F G H I J K L M N O P Q R S T U V                                               ",
+"        W X Y Z `  ...+. at .#.$.%.&.*.W =.-.;.>.,.B '.                                            ",
+"        ).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.                                            ",
+"      9.0.).a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.                                          ",
+"      v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.                                          ",
+"      . T.U.V.W.X.Y.Z.`. +.+++ at +#+$+%+&+*+=+-+;+>+,+'+)+                                        ",
+"      !+~+{+]+^+/+(+_+:+<+[+}+|+1+2+-.3+4+5+6+7+8+9+0+a+                                        ",
+"      b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+8+w+7.x+                                        ",
+"      y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+j )+                                      ",
+"      W+X+Y+Z+`+ @. at +@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@a+                                      ",
+"      ^@/@(@_@:@<@[@}@|@1 at 2@3 at 3@4 at 5@6 at 7@8 at 9@0 at a@b at c@d at e@f@                                      ",
+"      V R.g at h@i at j@k at l@m at j+n@o at p@q at r@s at t@u at v@w at x@y at z@A at B@C at D@                                    ",
+"      )+E at F@G at H@I at J@J at Z+k@K at L@M at N@O at P@Q at R@S at T@U at V@W at X@Y at Z@`@'.                                  ",
+"        V R. #.#J at +#@#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#C@'.                                ",
+"        )+E@(#_#:#<#j@[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#'.                              ",
+"          D at i#j#k#l#m#n#o#p#q#r#@ s#t#u#v#w#x#y#z#A#B#C#D#E#f#Z at F#'.                            ",
+"            G#J.H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $D#E#.$+$@$#$                          ",
+"            #$j $$%$&$*$=$-$t#;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$E#.$+$}$u.                        ",
+"              '.^@|$$+1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$/$f$g$h$i$j$E#k$Z@) u.                      ",
+"                )+V l$m$n$$+R.%$o$@+p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$H$u.                    ",
+"                      a+I$J$K$L$|$n$M$N$}+O$P$Q$Q$R$S$T$U$V$W$X$Y$Z$E$Y@`$ %)+                  ",
+"                            u.a+D at I$G#E at B .%+%@%#%$%b$%%&%*%^$=%-%Y$;%E$>%,% %)+                ",
+"                                      )+'.I$'%)%!%~%{%]%^%/%e$(%U$_%<$:%E$<%[%}%)+              ",
+"                                            '.^@|%1%2%{%3%4%5%x$6%7%8%9%0%a%b%c%d%)+            ",
+"                                              )+x+m$$+e%f%g%h%i%j%6%k%g$l%m%n%o%p%q%            ",
+"                                                  D at r%$$1%s%g%t%u%v%w%x%y%z%A%B%C%D%E%          ",
+"                                                    #$^@F%G%H%I%t$S$J%K%L%M%N%O%P%Q%R%S%        ",
+"                                                      )+I$T%U%V%W%a$X%5%Y%=%Z%`% &.&+&@&#&      ",
+"                                                          a+$&J.%&&&*&v%%%T$w%=&-&;&>&,&'&I$    ",
+"                                                            u.G#|$N$)&3%]%!&~&{&W$]&^&/&(&) D@  ",
+"                                                                S._&M$!%:&t$c$w$<&k%[&}&|&1&^@  ",
+"                                                                  a+j n$7.2&3&5%4&5&^$6&7&$+l$  ",
+"                                                                    u.8&9&0&a&u$h%b&c&d&e&f&g&  ",
+"                                                                        h&t.1&i&j&k&q$l&1&E at u.  ",
+"                                                                          '.l$m&R.e&n&o&p&a+    ",
+"                                                                            )+8.B F%9&'+a+      ",
+"                                                                                '.V D at u.        ",
+"                                                                                                ",
+"                                                                                                "};
diff --git a/images/SliderThumb_Vertical.xpm b/images/SliderThumb_Vertical.xpm
new file mode 100644
index 0000000..bfe13ca
--- /dev/null
+++ b/images/SliderThumb_Vertical.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * SliderThumb_Vertical[] = {
+"14 11 7 1",
+" 	c None",
+".	c #DEDEDE",
+"+	c #000000",
+"@	c #FFFFFF",
+"#	c #C0C0D8",
+"$	c #F2F2F2",
+"%	c #8D8DB2",
+"..+++++++.....",
+".+@@@@@@@+....",
+"+@#######@+...",
+"+@########$+..",
+"+@##@%#@%##$+.",
+"+@##@%#@%###$+",
+"+@##@%#@%##%+.",
+"+@########%+..",
+"+@#######%+...",
+".+%%%%%%%+....",
+"..+++++++....."};
diff --git a/lib-src/ffmpeg/libavutil/pixfmt.h b/lib-src/ffmpeg/libavutil/pixfmt.h
new file mode 100644
index 0000000..4995a4d
--- /dev/null
+++ b/lib-src/ffmpeg/libavutil/pixfmt.h
@@ -0,0 +1,151 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file libavutil/pixfmt.h
+ * pixel format definitions
+ *
+ * @warning This file has to be considered an internal but installed
+ * header, so it should not be directly included in your projects.
+ */
+
+/**
+ * Pixel format. Notes:
+ *
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ *  (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * Note, make sure that all newly added big endian formats have pix_fmt&1==1
+ *       and that all newly added little endian formats have pix_fmt&1==0
+ *       this allows simpler detection of big vs little endian.
+ */
+enum PixelFormat {
+    PIX_FMT_NONE= -1,
+    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black
+    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white
+    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
+    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
+    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
+    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    PIX_FMT_XVMC_MPEG2_IDCT,
+    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    PIX_FMT_BGR4,      ///< packed RGB 1:2:1,  4bpp, (msb)1B 2G 1R(lsb)
+    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    PIX_FMT_RGB4,      ///< packed RGB 1:2:1,  4bpp, (msb)1R 2G 1B(lsb)
+    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
+    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG)
+    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian
+    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian
+
+    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    PIX_FMT_YUV420PLE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420PBE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV422PLE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV422PBE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV444PLE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444PBE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+};
+
+#ifdef WORDS_BIGENDIAN
+#   define PIX_FMT_NE(be, le) PIX_FMT_##be
+#else
+#   define PIX_FMT_NE(be, le) PIX_FMT_##le
+#endif
+
+#define PIX_FMT_RGB32   PIX_FMT_NE(ARGB, BGRA)
+#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
+#define PIX_FMT_BGR32   PIX_FMT_NE(ABGR, RGBA)
+#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
+
+#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define PIX_FMT_RGB48  PIX_FMT_NE(RGB48BE,  RGB48LE)
+#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
+#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
+#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
+#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
+
+#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420PBE, YUV420PLE)
+#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422PBE, YUV422PLE)
+#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444PBE, YUV444PLE)
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/lib-src/libnyquist/Makefile.am b/lib-src/libnyquist/Makefile.am
new file mode 100644
index 0000000..0b379a0
--- /dev/null
+++ b/lib-src/libnyquist/Makefile.am
@@ -0,0 +1,243 @@
+## Process this file with automake to produce Makefile.in
+# Makefile(.in) for portSMF using Autotools (but not libtool).
+# Written by Richard Ash following Gary Vaughan's Autobook
+
+NYQUIST = nyquist
+PORTAUDIO_CFLAGS = -I../portaudio-v19/include
+SNDFILE_CFLAGS = -I../libsndfile/src
+
+# tell aclocal that extra macros can be found in autotools/m4/
+ACLOCAL_AMFLAGS = -I autotools/m4
+
+INC = \
+   -I. \
+   -I$(NYQUIST)/nyqsrc \
+   -I$(NYQUIST)/tran \
+   -I$(NYQUIST)/xlisp \
+   -I$(NYQUIST)/sys/unix \
+   -I$(NYQUIST)/cmt \
+   -I$(NYQUIST)/ffts/src \
+   -I$(NYQUIST)/nyqstk/include \
+   -I$(NYQUIST)/nyqstk
+
+AM_CFLAGS = $(INC) $(PORTAUDIO_CFLAGS) $(SNDFILE_CFLAGS) \
+   -DCMTSTUFF -DEXT
+
+AM_CXXFLAGS = $(INC) $(PORTAUDIO_CFLAGS) $(SNDFILE_CFLAGS) \
+   -DCMTSTUFF -DEXT
+
+# define the output library (link with -lportSMF)
+lib_LIBRARIES = libnyquist.a
+
+# define the source files to use
+libnyquist_a_SOURCES = \
+   $(NYQUIST)/xlisp/extern.c \
+   $(NYQUIST)/xlisp/xldmem.c \
+   $(NYQUIST)/xlisp/xlbfun.c \
+   $(NYQUIST)/xlisp/xlcont.c \
+   $(NYQUIST)/xlisp/xldbug.c \
+   $(NYQUIST)/xlisp/xleval.c \
+   $(NYQUIST)/xlisp/xlfio.c \
+   $(NYQUIST)/xlisp/xlftab.c \
+   $(NYQUIST)/xlisp/xlglob.c \
+   $(NYQUIST)/xlisp/xlimage.c \
+   $(NYQUIST)/xlisp/xlinit.c \
+   $(NYQUIST)/xlisp/xlio.c \
+   $(NYQUIST)/xlisp/xlisp.c \
+   $(NYQUIST)/xlisp/xljump.c \
+   $(NYQUIST)/xlisp/xllist.c \
+   $(NYQUIST)/xlisp/xlmath.c \
+   $(NYQUIST)/xlisp/xlobj.c \
+   $(NYQUIST)/xlisp/xlpp.c \
+   $(NYQUIST)/xlisp/xlprin.c \
+   $(NYQUIST)/xlisp/xlread.c \
+   $(NYQUIST)/xlisp/xlstr.c \
+   $(NYQUIST)/xlisp/xlsubr.c \
+   $(NYQUIST)/xlisp/xlsym.c \
+   $(NYQUIST)/xlisp/xlsys.c \
+   $(NYQUIST)/xlisp/path.c \
+   $(NYQUIST)/tran/abs.c \
+   $(NYQUIST)/tran/allpoles.c \
+   $(NYQUIST)/tran/alpass.c \
+   $(NYQUIST)/tran/alpasscv.c \
+   $(NYQUIST)/tran/alpassvv.c \
+   $(NYQUIST)/tran/amosc.c \
+   $(NYQUIST)/tran/areson.c \
+   $(NYQUIST)/tran/aresonvc.c \
+   $(NYQUIST)/tran/aresoncv.c \
+   $(NYQUIST)/tran/aresonvv.c \
+   $(NYQUIST)/tran/atone.c \
+   $(NYQUIST)/tran/atonev.c \
+   $(NYQUIST)/tran/biquadfilt.c \
+   $(NYQUIST)/tran/buzz.c \
+   $(NYQUIST)/tran/chase.c \
+   $(NYQUIST)/tran/clip.c \
+   $(NYQUIST)/tran/congen.c \
+   $(NYQUIST)/tran/const.c \
+   $(NYQUIST)/tran/coterm.c \
+   $(NYQUIST)/tran/delaycc.c \
+   $(NYQUIST)/tran/delaycv.c \
+   $(NYQUIST)/tran/eqbandvvv.c \
+   $(NYQUIST)/tran/exp.c \
+   $(NYQUIST)/tran/follow.c \
+   $(NYQUIST)/tran/fmosc.c \
+   $(NYQUIST)/tran/fromobject.c \
+   $(NYQUIST)/tran/fromarraystream.c \
+   $(NYQUIST)/tran/gate.c \
+   $(NYQUIST)/tran/ifft.c \
+   $(NYQUIST)/tran/instrclar.c \
+   $(NYQUIST)/tran/instrclarall.c \
+   $(NYQUIST)/tran/instrclarfreq.c \
+   $(NYQUIST)/tran/instrsax.c \
+   $(NYQUIST)/tran/instrsaxall.c \
+   $(NYQUIST)/tran/instrsaxfreq.c \
+   $(NYQUIST)/tran/integrate.c \
+   $(NYQUIST)/tran/log.c \
+   $(NYQUIST)/tran/lpreson.c \
+   $(NYQUIST)/tran/maxv.c \
+   $(NYQUIST)/tran/offset.c \
+   $(NYQUIST)/tran/oneshot.c \
+   $(NYQUIST)/tran/osc.c \
+   $(NYQUIST)/tran/partial.c \
+   $(NYQUIST)/tran/pluck.c \
+   $(NYQUIST)/tran/prod.c \
+   $(NYQUIST)/tran/pwl.c \
+   $(NYQUIST)/tran/quantize.c \
+   $(NYQUIST)/tran/recip.c \
+   $(NYQUIST)/tran/reson.c \
+   $(NYQUIST)/tran/resonvc.c \
+   $(NYQUIST)/tran/resoncv.c \
+   $(NYQUIST)/tran/resonvv.c \
+   $(NYQUIST)/tran/sampler.c \
+   $(NYQUIST)/tran/scale.c \
+   $(NYQUIST)/tran/shape.c \
+   $(NYQUIST)/tran/sine.c \
+   $(NYQUIST)/tran/siosc.c \
+   $(NYQUIST)/tran/slope.c \
+   $(NYQUIST)/tran/sqrt.c \
+   $(NYQUIST)/tran/tapf.c \
+   $(NYQUIST)/tran/tapv.c \
+   $(NYQUIST)/tran/tone.c \
+   $(NYQUIST)/tran/tonev.c \
+   $(NYQUIST)/tran/upsample.c \
+   $(NYQUIST)/tran/white.c \
+   $(NYQUIST)/tran/stkrev.c \
+   $(NYQUIST)/tran/stkpitshift.c \
+   $(NYQUIST)/tran/stkchorus.c \
+   $(NYQUIST)/tran/instrbow.c \
+   $(NYQUIST)/tran/instrbowedfreq.c \
+   $(NYQUIST)/tran/instrbanded.c \
+   $(NYQUIST)/tran/instrmandolin.c \
+   $(NYQUIST)/tran/instrsitar.c \
+   $(NYQUIST)/tran/instrmodalbar.c \
+   $(NYQUIST)/tran/instrflute.c \
+   $(NYQUIST)/tran/instrflutefreq.c \
+   $(NYQUIST)/tran/instrfluteall.c \
+   $(NYQUIST)/tran/fmfb.c \
+   $(NYQUIST)/tran/fmfbv.c \
+   $(NYQUIST)/cmt/cext.c \
+   $(NYQUIST)/cmt/cleanup.c \
+   $(NYQUIST)/cmt/cmdline.c \
+   $(NYQUIST)/cmt/cmtcmd.c \
+   $(NYQUIST)/cmt/moxc.c \
+   $(NYQUIST)/cmt/mem.c \
+   $(NYQUIST)/cmt/midifile.c \
+   $(NYQUIST)/cmt/midifns.c \
+   $(NYQUIST)/cmt/record.c \
+   $(NYQUIST)/cmt/seq.c \
+   $(NYQUIST)/cmt/seqmread.c \
+   $(NYQUIST)/cmt/seqmwrite.c \
+   $(NYQUIST)/cmt/seqread.c \
+   $(NYQUIST)/cmt/seqwrite.c \
+   $(NYQUIST)/cmt/tempomap.c \
+   $(NYQUIST)/cmt/timebase.c \
+   $(NYQUIST)/cmt/userio.c \
+   $(NYQUIST)/nyqsrc/debug.c \
+   $(NYQUIST)/nyqsrc/falloc.c \
+   $(NYQUIST)/nyqsrc/local.c \
+   $(NYQUIST)/nyqsrc/handlers.c \
+   $(NYQUIST)/nyqsrc/multiread.c \
+   $(NYQUIST)/nyqsrc/seqext.c \
+   $(NYQUIST)/nyqsrc/seqinterf.c \
+   $(NYQUIST)/nyqsrc/stats.c \
+   $(NYQUIST)/nyqsrc/ffilterkit.c \
+   $(NYQUIST)/nyqsrc/sliders.c \
+   $(NYQUIST)/nyqsrc/sound.c \
+   $(NYQUIST)/nyqsrc/add.c \
+   $(NYQUIST)/nyqsrc/avg.c \
+   $(NYQUIST)/nyqsrc/compose.c \
+   $(NYQUIST)/nyqsrc/convolve.c \
+   $(NYQUIST)/nyqsrc/downsample.c \
+   $(NYQUIST)/nyqsrc/fft.c \
+   $(NYQUIST)/nyqsrc/inverse.c \
+   $(NYQUIST)/nyqsrc/multiseq.c \
+   $(NYQUIST)/nyqsrc/resamp.c \
+   $(NYQUIST)/nyqsrc/resampv.c \
+   $(NYQUIST)/nyqsrc/samples.c \
+   $(NYQUIST)/nyqsrc/sndmax.c \
+   $(NYQUIST)/nyqsrc/sndread.c \
+   $(NYQUIST)/nyqsrc/sndseq.c \
+   $(NYQUIST)/nyqsrc/sndwritepa.c \
+   $(NYQUIST)/nyqsrc/yin.c \
+   $(NYQUIST)/nyqsrc/trigger.c \
+   $(NYQUIST)/nyqsrc/lpanal.c \
+   $(NYQUIST)/nyqstk/src/Generator.cpp \
+   $(NYQUIST)/nyqstk/src/SineWave.cpp \
+   $(NYQUIST)/nyqstk/src/Function.cpp \
+   $(NYQUIST)/nyqstk/src/FileRead.cpp \
+   $(NYQUIST)/nyqstk/src/FileWvIn.cpp \
+   $(NYQUIST)/nyqstk/src/Effect.cpp \
+   $(NYQUIST)/nyqstk/src/Clarinet.cpp \
+   $(NYQUIST)/nyqstk/src/Delay.cpp \
+   $(NYQUIST)/nyqstk/src/DelayL.cpp \
+   $(NYQUIST)/nyqstk/src/Envelope.cpp \
+   $(NYQUIST)/nyqstk/src/Filter.cpp \
+   $(NYQUIST)/nyqstk/src/Instrmnt.cpp \
+   $(NYQUIST)/nyqstk/src/Noise.cpp \
+   $(NYQUIST)/nyqstk/src/OneZero.cpp \
+   $(NYQUIST)/nyqstk/src/ReedTable.cpp \
+   $(NYQUIST)/nyqstk/src/Saxofony.cpp \
+   $(NYQUIST)/nyqstk/src/Stk.cpp \
+   $(NYQUIST)/nyqstk/src/WaveLoop.cpp \
+   $(NYQUIST)/nyqstk/src/WvIn.cpp \
+   $(NYQUIST)/nyqstk/src/NRev.cpp \
+   $(NYQUIST)/nyqstk/src/JCRev.cpp \
+   $(NYQUIST)/nyqstk/src/PRCRev.cpp \
+   $(NYQUIST)/nyqstk/src/PitShift.cpp \
+   $(NYQUIST)/nyqstk/src/Chorus.cpp \
+   $(NYQUIST)/nyqstk/src/Bowed.cpp \
+   $(NYQUIST)/nyqstk/src/BowTable.cpp \
+   $(NYQUIST)/nyqstk/src/ADSR.cpp \
+   $(NYQUIST)/nyqstk/src/OnePole.cpp \
+   $(NYQUIST)/nyqstk/src/BiQuad.cpp \
+   $(NYQUIST)/nyqstk/src/BandedWG.cpp \
+   $(NYQUIST)/nyqstk/src/DelayA.cpp \
+   $(NYQUIST)/nyqstk/src/Mandolin.cpp \
+   $(NYQUIST)/nyqstk/src/PluckTwo.cpp \
+   $(NYQUIST)/nyqstk/src/Sitar.cpp \
+   $(NYQUIST)/nyqstk/src/ModalBar.cpp \
+   $(NYQUIST)/nyqstk/src/Modal.cpp \
+   $(NYQUIST)/nyqstk/src/Flute.cpp \
+   $(NYQUIST)/nyqstk/src/JetTable.cpp \
+   $(NYQUIST)/nyqstk/src/PoleZero.cpp \
+   $(NYQUIST)/nyqstk/stkinit.cpp \
+   $(NYQUIST)/nyqstk/instr.cpp \
+   $(NYQUIST)/nyqstk/stkint.cpp \
+   $(NYQUIST)/ffts/src/fftext.c \
+   $(NYQUIST)/ffts/src/fftlib.c \
+   $(NYQUIST)/ffts/src/matlib.c \
+   $(NYQUIST)/nyqsrc/sndfnint.c \
+   $(NYQUIST)/nyqsrc/seqfnint.c \
+   nyx.c
+
+# files that only really viscous cleans remove
+MAINTAINERCLEANFILES = Makefile.in
+
+# other distributed files in case users don't have a complete set of auto*
+AUX_DIST = $(ac_aux_dir)/config.guess \
+   $(ac_aux_dir)/config.sub \
+   $(ac_aux_dir)/install-sh \
+   $(ac_aux_dir)/mdate-sh \
+   $(ac_aux_dir)/missing \
+   $(ac_aux_dir)/mkinstalldirs \
+   $(MAINTAINERCLEANFILES)
diff --git a/lib-src/portsmf/autotools/depcomp b/lib-src/libnyquist/autotools/depcomp
old mode 100644
new mode 100755
similarity index 100%
copy from lib-src/portsmf/autotools/depcomp
copy to lib-src/libnyquist/autotools/depcomp
diff --git a/lib-src/portsmf/autotools/install-sh b/lib-src/libnyquist/autotools/install-sh
old mode 100644
new mode 100755
similarity index 100%
copy from lib-src/portsmf/autotools/install-sh
copy to lib-src/libnyquist/autotools/install-sh
diff --git a/lib-src/lib-widget-extra/m4/ax_cflags_strict_prototypes.m4 b/lib-src/libnyquist/autotools/m4/ax_cflags_strict_prototypes.m4
similarity index 100%
copy from lib-src/lib-widget-extra/m4/ax_cflags_strict_prototypes.m4
copy to lib-src/libnyquist/autotools/m4/ax_cflags_strict_prototypes.m4
diff --git a/lib-src/lib-widget-extra/m4/ax_cflags_warn_all.m4 b/lib-src/libnyquist/autotools/m4/ax_cflags_warn_all.m4
similarity index 100%
copy from lib-src/lib-widget-extra/m4/ax_cflags_warn_all.m4
copy to lib-src/libnyquist/autotools/m4/ax_cflags_warn_all.m4
diff --git a/lib-src/lib-widget-extra/m4/ax_cxx_check_flag.m4 b/lib-src/libnyquist/autotools/m4/ax_cxx_check_flag.m4
similarity index 100%
copy from lib-src/lib-widget-extra/m4/ax_cxx_check_flag.m4
copy to lib-src/libnyquist/autotools/m4/ax_cxx_check_flag.m4
diff --git a/lib-src/lib-widget-extra/m4/ax_cxxcpp_check_flag.m4 b/lib-src/libnyquist/autotools/m4/ax_cxxcpp_check_flag.m4
similarity index 100%
copy from lib-src/lib-widget-extra/m4/ax_cxxcpp_check_flag.m4
copy to lib-src/libnyquist/autotools/m4/ax_cxxcpp_check_flag.m4
diff --git a/lib-src/portsmf/autotools/missing b/lib-src/libnyquist/autotools/missing
old mode 100644
new mode 100755
similarity index 100%
copy from lib-src/portsmf/autotools/missing
copy to lib-src/libnyquist/autotools/missing
diff --git a/lib-src/libnyquist/configure b/lib-src/libnyquist/configure
new file mode 100755
index 0000000..a57d2c6
--- /dev/null
+++ b/lib-src/libnyquist/configure
@@ -0,0 +1,7734 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for libnyquist 0.1.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='libnyquist'
+PACKAGE_TARNAME='libnyquist'
+PACKAGE_VERSION='0.1'
+PACKAGE_STRING='libnyquist 0.1'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="nyquist/xlisp/xlisp.h"
+ac_default_prefix=/usr/local
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+SED
+RANLIB
+CXXCPP
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_debug
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CXXCPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 | -n)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 <<_ACEOF
+\`configure' configures libnyquist 0.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/libnyquist]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --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
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of libnyquist 0.1:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-debug          enable debug support [default=no]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+libnyquist configure 0.1
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by libnyquist $as_me 0.1, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/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`
+/usr/bin/hostinfo      = `(/usr/bin/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`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# 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.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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_cache_corrupted=false
+for ac_var in $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+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
+
+
+
+ac_aux_dir=
+for ac_dir in autotools "$srcdir"/autotools; 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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autotools \"$srcdir\"/autotools" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in autotools \"$srcdir\"/autotools" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# which also contains a subdir containing macros
+
+am__api_version='1.10'
+
+# 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
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# 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"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /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
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&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}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libnyquist'
+ VERSION='0.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+cflags_save="$CFLAGS"
+cppflags_save="$CPPFLAGS"
+cxxflags_save="$CXXFLAGS"
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+CFLAGS="$cflags_save"
+CPPFLAGS="$cppflags_save"
+CXXFLAGS="$cxxflags_save"
+
+# 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
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# 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"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /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
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&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}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+if [ $prefix = "NONE" ] ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define INSTALL_PREFIX "/usr/local"
+_ACEOF
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define INSTALL_PREFIX "$prefix"
+_ACEOF
+
+fi
+
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug; debug_preference="$enableval"
+else
+  debug_preference="no"
+fi
+
+
+
+if test x"$debug_preference" = "xyes" ; then
+      { $as_echo "$as_me:$LINENO: Adding -g for debugging to CFLAGS and CXXFLAGS ..." >&5
+$as_echo "$as_me: Adding -g for debugging to CFLAGS and CXXFLAGS ..." >&6;}
+   CFLAGS="${CFLAGS} -g "
+   CXXFLAGS="${CXXFLAGS} -g "
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: checking CFLAGS for strict prototypes" >&5
+$as_echo_n "checking CFLAGS for strict prototypes... " >&6; }
+if test "${ac_cv_cflags_strict_prototypes+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_cflags_strict_prototypes="no, unknown"
+
+ 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
+
+ ac_save_CFLAGS="$CFLAGS"
+for ac_arg in "-pedantic % -fstrict-prototypes -Wstrict-prototypes"    "-pedantic % -Wstrict-prototypes"    "-pedantic % -Wmissing-prototypes"    "-pedantic % -Werror-implicit-function-declaration"    "-pedantic % -Wimplicit-function-declaration"    #
+do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_cflags_strict_prototypes=`echo $ac_arg | sed -e 's,.*% *,,'` ; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case ".$ac_cv_cflags_strict_prototypes" in
+   .|.no|.no,*) ;;
+   *) # sanity check with signal() from sys/signal.h
+    cp config.log config.tmp
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <signal.h>
+int
+main ()
+{
+
+    if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
+    if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+      if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
+then ac_cv_cflags_strict_prototypes="no, suppressed, signal.h," ; fi ; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_cflags_strict_prototypes="no, suppressed, signal.h"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    rm config.tmp
+  ;;
+esac
+ CFLAGS="$ac_save_CFLAGS"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cflags_strict_prototypes" >&5
+$as_echo "$ac_cv_cflags_strict_prototypes" >&6; }
+case ".$ac_cv_cflags_strict_prototypes" in
+     .ok|.ok,*)  ;;
+   .|.no|.no,*)
+ ;;
+   *)
+   if echo " $CFLAGS " | grep " $ac_cv_cflags_strict_prototypes " 2>&1 >/dev/null
+   then { ($as_echo "$as_me:$LINENO: : CFLAGS does contain \$ac_cv_cflags_strict_prototypes") >&5
+  (: CFLAGS does contain $ac_cv_cflags_strict_prototypes) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+   else { ($as_echo "$as_me:$LINENO: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_strict_prototypes\"") >&5
+  (: CFLAGS="$CFLAGS $ac_cv_cflags_strict_prototypes") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+                      CFLAGS="$CFLAGS $ac_cv_cflags_strict_prototypes"
+   fi
+ ;;
+esac
+
+
+{ $as_echo "$as_me:$LINENO: checking wall_flags for maximum warnings" >&5
+$as_echo_n "checking wall_flags for maximum warnings... " >&6; }
+if test "${ac_cv_cflags_warn_all+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_cflags_warn_all="no, unknown"
+
+ 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
+
+ ac_save_CFLAGS="$CFLAGS"
+for ac_arg in "-pedantic  % -Wall"          "-xstrconst % -v"             "-std1      % -verbose -w0 -warnprotos"    "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"    "-ansi -ansiE % -fullwarn"    "+ESlit     % +w1"            "-Xc        % -pvctl,fullmsg"    "-h conform % -h msglevel 2"    #
+do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+ CFLAGS="$ac_save_CFLAGS"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cflags_warn_all" >&5
+$as_echo "$ac_cv_cflags_warn_all" >&6; }
+case ".$ac_cv_cflags_warn_all" in
+     .ok|.ok,*)  ;;
+   .|.no|.no,*)
+ ;;
+   *)
+   if echo " $wall_flags " | grep " $ac_cv_cflags_warn_all " 2>&1 >/dev/null
+   then { ($as_echo "$as_me:$LINENO: : wall_flags does contain \$ac_cv_cflags_warn_all") >&5
+  (: wall_flags does contain $ac_cv_cflags_warn_all) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+   else { ($as_echo "$as_me:$LINENO: : wall_flags=\"\$wall_flags \$ac_cv_cflags_warn_all\"") >&5
+  (: wall_flags="$wall_flags $ac_cv_cflags_warn_all") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+                      wall_flags="$wall_flags $ac_cv_cflags_warn_all"
+   fi
+ ;;
+esac
+
+CFLAGS="${CFLAGS} $wall_flags"
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+
+
+  flag=`echo "$wall_flags" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+  { $as_echo "$as_me:$LINENO: checking whether the C++ compiler accepts the $wall_flags flag" >&5
+$as_echo_n "checking whether the C++ compiler accepts the $wall_flags flag... " >&6; }
+if { as_var=ax_cv_cxx_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+    save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS $wall_flags"
+    cat >conftest.$ac_ext <<_ACEOF
+
+      /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+int foo;
+int
+main ()
+{
+foo = 1;
+  ;
+  return 0;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+      eval "ax_cv_cxx_check_flag_$flag=yes"
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+      eval "ax_cv_cxx_check_flag_$flag=no"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    CXXFLAGS="$save_CXXFLAGS"
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+fi
+ac_res=`eval 'as_val=${'ax_cv_cxx_check_flag_$flag'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+  if eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"; then
+
+    :
+    cxx_does_wall="yes"
+
+else
+
+    :
+    cxx_does_wall="no"
+
+fi
+
+
+if test "x$cxx_does_wall" = "xyes" ; then
+      CXXFLAGS="${CXXFLAGS} $wall_flags"
+fi
+
+
+
+
+
+
+  flag=`echo "$wall_flags" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+  { $as_echo "$as_me:$LINENO: checking whether the C++ preprocessor accepts the $wall_flags flag" >&5
+$as_echo_n "checking whether the C++ preprocessor accepts the $wall_flags flag... " >&6; }
+if { as_var=ax_cv_cxxcpp_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+    save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS $wall_flags"
+    cat >conftest.$ac_ext <<_ACEOF
+
+      /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+int foo;
+int
+main ()
+{
+foo = 1;
+  ;
+  return 0;
+}
+
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+
+      eval "ax_cv_cxxcpp_check_flag_$flag=yes"
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+      eval "ax_cv_cxxcpp_check_flag_$flag=no"
+
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+    CXXFLAGS="$save_CXXFLAGS"
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+fi
+ac_res=`eval 'as_val=${'ax_cv_cxxcpp_check_flag_$flag'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+  if eval "test \"`echo '$ax_cv_cxxcpp_check_flag_'$flag`\" = yes"; then
+
+    :
+    cpp_does_wall="yes"
+
+else
+
+    :
+    cpp_does_wall="no"
+
+fi
+
+
+if test "x$cpp_does_wall" = "xyes" ; then
+      CPPFLAGS="${CPPFLAGS} $wall_flags"
+fi
+
+
+
+for ac_func in strchr memmove
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_malloc_0_nonnull=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_malloc_0_nonnull=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 1
+_ACEOF
+
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 0
+_ACEOF
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define malloc rpl_malloc
+_ACEOF
+
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if test "${ac_cv_header_stdbool_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+	struct s { _Bool s: 1; _Bool t; } s;
+
+	char a[true == 1 ? 1 : -1];
+	char b[false == 0 ? 1 : -1];
+	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+	char d[(bool) 0.5 == true ? 1 : -1];
+	bool e = &s;
+	char f[(_Bool) 0.0 == false ? 1 : -1];
+	char g[true];
+	char h[sizeof (_Bool)];
+	char i[sizeof s.t];
+	enum { j = false, k = true, l = false * true, m = true * 256 };
+	/* The following fails for
+	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+	_Bool n[m];
+	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+#	if defined __xlc__ || defined __GNUC__
+	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+	    reported by James Lemley on 2005-10-05; see
+	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+	    This test is not quite right, since xlc is allowed to
+	    reject this program, as the initializer for xlcbug is
+	    not one of the forms that C requires support for.
+	    However, doing the test right would require a runtime
+	    test, and that would make cross-compilation harder.
+	    Let us hope that IBM fixes the xlc bug, and also adds
+	    support for this kind of constant expression.  In the
+	    meantime, this test will reject xlc, which is OK, since
+	    our stdbool.h substitute should suffice.  We also test
+	    this with GCC, where it should work, to detect more
+	    quickly whether someone messes up the test in the
+	    future.  */
+	 char digs[] = "0123456789";
+	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+#	endif
+	/* Catch a bug in an HP-UX C compiler.  See
+	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+	 */
+	_Bool q = true;
+	_Bool *pq = &q;
+
+int
+main ()
+{
+
+	*pq |= q;
+	*pq |= ! q;
+	/* Refer to every declared value, to avoid compiler optimizations.  */
+	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+		+ !m + !n + !o + !p + !q + !pq);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdbool_h=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdbool_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _Bool" >&5
+$as_echo_n "checking for _Bool... " >&6; }
+if test "${ac_cv_type__Bool+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type__Bool=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (_Bool))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((_Bool)))
+	  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type__Bool=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+$as_echo "$ac_cv_type__Bool" >&6; }
+if test "x$ac_cv_type__Bool" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STDBOOL_H 1
+_ACEOF
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+
+for ac_header in stdlib.h string.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset cs;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_const=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const /**/
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (size_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((size_t)))
+	  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_size_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+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 overridden 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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+# 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 branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+	g
+	s/^\n//
+	s/\n/ /g
+	p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# 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
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by libnyquist $as_me 0.1, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -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
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+libnyquist config.status 0.1
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h |  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# 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
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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 by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+echo ""
+echo "Run 'configure --help' for an explanation of the possible options,"
+echo "otherwise run 'make' to build libnyquist."
+
+# Local Variables:
+# c-basic-offset: 3
+# indent-tabs-mode: nil
+# End:
+#
+# vim: et sts=3 sw=3
diff --git a/lib-src/libnyquist/configure.ac b/lib-src/libnyquist/configure.ac
new file mode 100644
index 0000000..1e88585
--- /dev/null
+++ b/lib-src/libnyquist/configure.ac
@@ -0,0 +1,136 @@
+dnl
+dnl portSMF configure.in script - version not using libtool
+dnl
+dnl Joshua Haberman
+dnl Dominic Mazzoni
+dnl Richard Ash
+dnl
+
+dnl
+dnl Instructions: to create "configure" from "configure.in", run:
+dnl aclocal
+dnl autoconf
+
+dnl Process this file with autoconf to produce a configure script.
+
+dnl Require autoconf >= 2.61
+AC_PREREQ(2.61)
+
+dnl Init autoconf and automake
+AC_INIT([libnyquist],[0.1])
+dnl check that we have some source code
+AC_CONFIG_SRCDIR([nyquist/xlisp/xlisp.h])
+dnl keep autools files in a subdirectory
+AC_CONFIG_AUX_DIR(autotools)
+# which also contains a subdir containing macros
+AC_CONFIG_MACRO_DIR([autotools/m4])
+dnl set up automake
+AM_INIT_AUTOMAKE([-Wall foreign])
+dnl Audacity policy: don't enable automatic rebuild of configure et al if 
+dnl sources change
+AM_MAINTAINER_MODE([enabled])
+
+dnl -------------------------------------------------------
+dnl Checks for programs.
+dnl -------------------------------------------------------
+dnl save $CFLAGS etc. since AC_PROG_CC likes to insert "-g -O2"
+dnl if $CFLAGS is blank and it finds GCC
+cflags_save="$CFLAGS"
+cppflags_save="$CPPFLAGS"
+cxxflags_save="$CXXFLAGS"
+AC_PROG_CC
+AC_LANG([C++])
+AC_PROG_CXX
+AC_PROG_CXXCPP
+CFLAGS="$cflags_save"
+CPPFLAGS="$cppflags_save"
+CXXFLAGS="$cxxflags_save"
+
+dnl we will need an "install" program to be available
+AC_PROG_INSTALL
+dnl and ranlib for static libraries
+AC_PROG_RANLIB
+
+dnl Make the install prefix available to the program so that the pkg-config file
+dnl can be created correctly
+AC_PREFIX_DEFAULT(/usr/local)
+if [[ $prefix = "NONE" ]] ; then
+  AC_DEFINE(INSTALL_PREFIX, "/usr/local",
+      [define as prefix where Audacity is installed])
+else
+  AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix")
+fi
+
+dnl Build Options
+
+AC_ARG_ENABLE(debug,
+            [AS_HELP_STRING([--enable-debug],
+                            [enable debug support [default=no]])],
+            debug_preference="$enableval",
+            debug_preference="no")
+
+dnl ----------------------------------------------------
+dnl If user asked for debug, put debug in compiler flags
+dnl ----------------------------------------------------
+
+if test x"$debug_preference" = "xyes" ; then
+   dnl we want debuging on
+   AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
+   CFLAGS="${CFLAGS} -g "
+   CXXFLAGS="${CXXFLAGS} -g "
+fi
+
+dnl --------------------------------------------------------------------------
+dnl We would like warnings enabled on the builds, but different compilers need
+dnl different options for these. This bit tries to work out what flags we 
+dnl should add to the compiler we are using.
+dnl --------------------------------------------------------------------------
+
+dnl Strict prototypes flags for C (only C because doesn't work for C++)
+AX_CFLAGS_STRICT_PROTOTYPES(CFLAGS)
+
+dnl Sensible warnings for C
+AX_CFLAGS_WARN_ALL(wall_flags)
+CFLAGS="${CFLAGS} $wall_flags"
+dnl try and use it on C++ as well
+AX_CXX_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cxx_does_wall="yes", cxx_does_wall="no")
+if test "x$cxx_does_wall" = "xyes" ; then
+   dnl can use all warnings flag on the C++ compiler
+   CXXFLAGS="${CXXFLAGS} $wall_flags"
+fi
+AX_CXXCPP_CHECK_FLAG([$wall_flags], [[int foo;]], [[foo = 1;]], cpp_does_wall="yes", cpp_does_wall="no")
+if test "x$cpp_does_wall" = "xyes" ; then
+   dnl can use all warnings flag on the C++ pre-processor
+   CPPFLAGS="${CPPFLAGS} $wall_flags"
+fi
+
+dnl --- check for required libraries ---
+dnl system libraries
+AC_CHECK_FUNCS([strchr memmove])
+AC_FUNC_MALLOC
+AC_HEADER_STDBOOL
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h string.h])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+
+echo ""
+echo "Run 'configure --help' for an explanation of the possible options,"
+echo "otherwise run 'make' to build libnyquist."
+
+dnl Indentation settings for Vim and Emacs and unique identifier for Arch, a
+dnl version control system. Please do not modify past this point.
+# Local Variables:
+# c-basic-offset: 3
+# indent-tabs-mode: nil
+# End:
+#
+# vim: et sts=3 sw=3
diff --git a/lib-src/libnyquist/nyquist.patch b/lib-src/libnyquist/nyquist.patch
new file mode 100644
index 0000000..56d64a6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist.patch
@@ -0,0 +1,97 @@
+Index: nyquist/nyqsrc/sound.c
+===================================================================
+RCS file: /cvsroot/audacity/lib-src/libnyquist/nyquist/nyqsrc/sound.c,v
+retrieving revision 1.4
+diff -u -r1.4 sound.c
+--- nyquist/nyqsrc/sound.c	5 Mar 2009 16:34:00 -0000	1.4
++++ nyquist/nyqsrc/sound.c	5 Mar 2009 16:55:56 -0000
+@@ -506,33 +506,39 @@
+ void snd_list_unref(snd_list_type list)
+ {
+     void (*freefunc)();
++    snd_list_type next;
+ 
+-    if (list == NULL || list == zero_snd_list) {
+-        if (list == NULL)
++    while (list != zero_snd_list) {
++        if (list == NULL) {
+            nyquist_printf("why did snd_list_unref get %p?\n", list);
+-        return;
+-    }
+-    list->refcnt--;
+-/*    nyquist_printf("snd_list_unref "); print_snd_list_type(list); stdputstr("\n"); */
+-    if (list->refcnt == 0) {
+-        if (list->block && list->block != zero_block) {
+-            /* there is a next snd_list */
+-/*          stdputstr("["); */
+-            sample_block_unref(list->block);
+-/*          stdputstr("]"); */
+-            snd_list_unref(list->u.next);
++           return;
+         }
+-        else if (list->block == NULL) { /* the next thing is the susp */
+-            /* free suspension structure */
+-            /* nyquist_printf("freeing susp@%p\n", list->u.susp); */
+-            freefunc = list->u.susp->free;
+-            (*freefunc)(list->u.susp);
++        next = zero_snd_list;
++
++        list->refcnt--;
++/*      nyquist_printf("snd_list_unref "); print_snd_list_type(list); stdputstr("\n"); */
++        if (list->refcnt == 0) {
++            if (list->block && list->block != zero_block) {
++                /* there is a next snd_list */
++/*              stdputstr("["); */
++                sample_block_unref(list->block);
++/*              stdputstr("]"); */
++                next = list->u.next;
++            }
++            else if (list->block == NULL) { /* the next thing is the susp */
++                /* free suspension structure */
++                /* nyquist_printf("freeing susp@%p\n", list->u.susp); */
++                freefunc = list->u.susp->free;
++                (*freefunc)(list->u.susp);
++            }
++            /* nyquist_printf("freeing snd_list@%p\n", list); */
++            //DBY
++            if (list == list_watch) printf("freeing watched snd_list %p\n", list);
++            //DBY
++            ffree_snd_list(list, "snd_list_unref");
+         }
+-        /* nyquist_printf("freeing snd_list@%p\n", list); */
+-        //DBY
+-        if (list == list_watch) printf("freeing watched snd_list %p\n", list);
+-        //DBY
+-        ffree_snd_list(list, "snd_list_unref");
++
++        list = next;
+     }
+ }
+ 
+Index: nyquist/xlisp/xldmem.c
+===================================================================
+RCS file: /cvsroot/audacity/lib-src/libnyquist/nyquist/xlisp/xldmem.c,v
+retrieving revision 1.3
+diff -u -r1.3 xldmem.c
+--- nyquist/xlisp/xldmem.c	5 Mar 2009 16:34:00 -0000	1.3
++++ nyquist/xlisp/xldmem.c	5 Mar 2009 16:56:12 -0000
+@@ -299,8 +299,6 @@
+ LOCAL void findmem(void)
+ {
+     gc();
+-    if (nfree < (long)anodes)
+-        addseg();
+ }
+ 
+ /* gc - garbage collect (only called here and in xlimage.c) */
+@@ -346,6 +344,10 @@
+     /* count the gc call */
+     ++gccalls;
+ 
++    /* add a new segment if still no free nodes */
++    if (nfree < (long)anodes)
++        addseg();
++
+     /* call the *gc-hook* if necessary */
+     if (s_gchook && (fun = getvalue(s_gchook))) {
+         newfp = xlsp;
diff --git a/lib-src/libnyquist/nyquist/Readme.txt b/lib-src/libnyquist/nyquist/Readme.txt
new file mode 100644
index 0000000..93a7284
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/Readme.txt
@@ -0,0 +1,234 @@
+README file for Nyquist Version 3.03
+24 Feb 2009
+Roger B. Dannenberg
+
+LICENSE: see license.txt
+WEB SITE: http://www.cs.cmu.edu/~rbd/nyquist.html
+
+INSTALLING NYQUIST
+====================
+Please see Section 1.1, Page 1, of the Nyquist Manual
+
+If you use Windows 95 or Windows NT, this release was
+compiled with Visual C++ 6.0.
+
+For Mac OS X command line users, there is an executable
+Nyquist program: NyquistIDE.app/Contents/Resources/Java/ny
+
+IMPLEMENTATION STATUS
+=====================
+Version 3.03 provides:
+    Bug fix to Markov pattern generator (see make-markov).
+    Update to current (24-feb-09) liblo library.
+    Slight change to license.txt to comply wiht two LGPL
+      library licenses: libsndfile and liblo.
+    score-sort can sort very big scores now using iterative
+      merge sort
+Version 3.02 provides:
+    Uses libsndfile and recent version of portaudio.
+    Many bug fixes.
+    Support & compatibility for Algorithmic Composition (to appear)
+Version 3.01 provides:
+    Feedback FM: see fmfb, snd-fmfb and snd-fmfbv
+    fixed help functions and internal browser window
+    Documentation mostly using SAL syntax now
+Version 3.00 provides:
+    First release supporting SAL syntax
+    Major revision to documentation (but more to come)
+    Bug fixes for sustain transformation
+    Many new STK instruments ported by Pedro Morales
+    Pedro's sdl music input language
+Version 2.38 provides:
+    improved PWL editor
+    improved preferences dialog
+    bug fixes in Equalizer editor
+    additional documentation for demos/plight/drums.lsp
+    option click or right click on completion list to get help
+    manual can be displayed in an internal window in jNyqIDE
+Version 2.37 provides:
+    fix for byte order on Mac PPC that prevented pianosyn.lsp from loading
+Version 2.36 provides:
+    cross-platform browser launching in jNyqIDE
+    fix search path set by jNyqIDE (OS X-related bug introduced in 2.35)
+    fix bug in slider update code on OS X
+Version 2.35 provides:
+    fix for Open Sound Control under Windows/jNyqIDE
+    other minor jNyqIDE fixes    
+Version 2.34 provides:
+    fix to ^U (send selection to Nyquist) in jNyqIDE
+    default sound file path for Mac OS X is /tmp
+    Nyquist exits when EOF detected -- try to make orphans abort
+Version 2.33 provides:
+    additional documentation for Open Sound Control
+        interface and utility programs
+Version 2.32 provides:
+    envelope editor in jNyqIDE
+    EQ editor in jNyqIDE
+    score editor in jNyqIDE
+    slider support in Nyquist
+    OSC (Open Sound Control) interface
+    OSC test program and serial-to-OSC program
+    drum machine (as separate download)
+    jNyqIDE has pop-up menus and per-file menu bars
+Version 2.31 provides:
+    new compositional algorithm support in xm.lsp
+    many bug fixes
+    MiniMoog emulator
+    spatialization libraries
+    sound reversal functions
+    Dolby Surround encode/decode
+Version 2.30 provides:
+    many many changes, bug fixes, enhancements
+    new Java-based IDE: jnyqide
+    LPC analysis/synthesis
+    uses PortAudio for audio I/O
+    changes for Debian Linux compatibility
+    new examples in demos
+    new documentation and html files
+Version 2.29 provides:
+    new functions: snd-alpassvc, sndalpassvv, snd-eqbandvvv
+    corresponding high-level functions in Nyquist
+    new licenses for both Nyquist and XLISP
+    new NyqIDE implementation
+    fixed BUZZ function
+    various bug and documentation fixes
+Version 2.28 provides:
+    include indx.html in doc folder (in files.txt)
+    fixed compute-default-sound-file in nyquist.lsp to
+    compute appropriate extension (.wav, .aif)
+    more code to automate win32 releases
+Version 2.27 provides:
+    makefile.lsp now generates sndfn.wcl & sndfn.cl
+    fix to include snd-pluck and some others omittted from 2.26
+Version 2.26 provides:
+    bug fix in sampler, negative frequency handling
+    guard against out-of-order events in TIMED-SEQ
+    added FMLFO, an lfo with frequency modulation
+    added SND-SQRT, S-SQRT, SND-ABS, S-ABS functions
+    new NyqIDE version with S-PLOT function (!)
+    NyqIDE has better parsing for paren balancing
+    NyqIDE upgrade to WindowsXP and Delphi 6
+    NyqIDE increases input string length maximum
+    NyqIDE prompts on save conflict
+    added voice-synthesis demo from Eduardo Miranda
+    corrected absolute path in demos/pmorales/e2.lsp
+    minor documentation and indexing improvements
+    pointer to demo docs goes on start menu now
+Version 2.25 provides:
+    new way to provide search path: set *SEARCH-PATH* to a string,
+    e.g. (SETF *SEARCH-PATH* 
+    "C:/program files/nyquist/runtime,c:/program files/nyquist/lib")
+    allowing Nyquist to be run without setting registry.
+Version 2.24 provides:
+    text editing for command lines in Linux version
+Version 2.23 provides:
+    bug fix in (current-path) for Mac
+    fixes to some Mac sources corrupted in 2.22
+Version 2.22 provides:
+    documentation (HTML) included in release now
+    bug fix for Mac console output exceeding 32K limit
+    protection from playing very high sample rates in Win32
+        (crashes in Windows MME library!)
+    change s-save to take :endian rather than :swap parameter
+    pianosyn.lsp runs on the Mac now
+    demos/examples.lsp generates audio with "normal" sample rates
+Version 2.21 provides:
+    s-plot uses gnu-plot in Linux
+    separation from CVS -- I just couldn't keep beating my head
+               against the wall
+Version 2.20 provides:
+    improved Macintosh support
+Version 2.19 provides:
+    integration of Macintosh code (from v2.12)
+    addition of PLUCK and BUZZ synthesis functions
+Version 2.18 provides:
+    bug fix in midifile read routine under Linux
+Version 2.17 provides:
+    bug fix for long line input under linux and windows
+    biquad filters
+    hzosc osc-tri osc-saw osc-pulse -- new oscillator variants
+    bug fix for reading in non-AIFF files with 'FORM' headings
+    extension to s-read to support explicit byte-swap parameter
+Version 2.16 provides:
+    bug fix in tables (lookup oscillators and other functions)
+    Windows GUI version of Nyquist
+Version 2.15 provides:
+    port to Linux
+Version 2.5 provides:
+    more signal processing functions
+Version 2.2 provides:
+        ports to more systems including Win32 (Win95 and NT)
+        bug fixes
+        more signal processing functions
+        improved sound I/O subsystem
+Version 2.1 provides:
+        bug fixes
+        documentation and code for user extensions
+Version 2.0 provides:
+        continuous time warps
+        many more functions
+        bug fixes
+
+The distribution may contain sources for Nyquist. If not,
+you got the runtime distribution, and there is a source version
+available.
+ 
+A number of "source" files are machine generated, including:
+-  many .c and .h files that implement signal processing functions.
+        These are generated by translation system that converts
+        .alg files to .c and .h files.  .alg files give high-level
+        descriptions of DSP algorithms.  
+- Makefile.* is generated by "makefile.lsp".
+
+The status is:
+
+System                  Status
+
+RS6K = RS6000, AIX      untested, but used to work
+NEXT = NeXT 3.0 (Cube)  untested, but worked fine on a previous version
+SGI = ???               untested, but used to work
+PMAX = Mach 2.5 on Dec workstation
+            untested, but worked in previous version
+SPARC = Sun Sparc ???   untested - previous version of Nyquist DID work
+LINUX = Linux		tested
+Win32			tested
+Mac			tested
+
+If you have problems running Nyquist on a Unix machine, I'd be happy to 
+help. I can give you advice or if you give me an account, I can log in
+remotely and install Nyquist for you. If you make corrections yourself,
+please let me have them so I can put them in the next release.
+
+DIRECTORY STRUCTURE
+===================
+cmt - CMU MIDI Toolkit files, used by Nyquist for MIDI File I/O
+demos - Nyquist demos go here
+fft - some fft functions
+lib - .lsp files offering extensions to Nyquist
+misc - various files and programs used to implement Nyquist
+nyqsrc - general Nyquist source code (mostly in C)
+runtime - the Nyquist and XLisp runtime code (mostly in XLisp)
+sys - system specific files
+snd - the sound file, sound input, and sound output package
+test - test code (this is not maintained and may not be in the release)
+todo - list of things to do (this may not be in the release)
+tran - descriptor (.alg) files for machine-translated Nyquist code
+xlisp - sources for Xlisp (these are linked into Nyquist)
+
+THE RUNTIME ONLY RELEASE
+========================
+The runtime-only release contains everything related to running
+Nyquist, but no source code. The files in this release are:
+    Readme.txt (this file)
+    nyquist.exe (located in the runtime directory)
+    runtime (directory)
+    lib (directory)
+    demos (directory)
+    test (directory)
+
+BUILDING UNDER LINUX
+====================
+in the nyquist directory:
+> ln -s sys/unix/linux/Makefile
+> make
+
diff --git a/lib-src/libnyquist/nyquist/cmt/cext.c b/lib-src/libnyquist/nyquist/cmt/cext.c
new file mode 100644
index 0000000..452e18f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cext.c
@@ -0,0 +1,107 @@
+/****************************************************************************
+                cext.c
+ Copyright 1989 Carnegie Mellon University
+
+ August 3, 1987
+ Author: Frits Habermann
+----------------------------------------------------------------------------
+ 02-May-1988 | JCD : portable & AMIGA version.
+ 17-Oct-1988 | JCD : more portability (FREE).
+ 28-Apr-2003 | DM  : changed includes for portability
+****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cext.h"
+#include "userio.h"
+
+#define calc_middle(top, bot)    (((top - bot) / 2 ) + bottom )
+
+#define kbyte 1000
+#define outof_mem(blocksize)     (blocksize == 0 )
+#define done_search(top, bot, middle)    ( (( (top - bot) < kbyte ) && \
+( !toomuch_mem(middle)) ) || \
+                      ( outof_mem( middle ))    )
+
+private boolean toomuch_mem(ushort maximum) 
+{
+    char *test;
+    boolean istoo_much;
+    istoo_much = ( (test = (char *) MALLOC(maximum)) == NULL );
+    if (test) FREE(test);
+    return( istoo_much );
+}
+
+private boolean toolittle_mem(maximum) 
+ushort maximum;
+{
+    char *test;
+    boolean istoo_little;
+    istoo_little = !( (test = (char *) MALLOC(maximum)) == NULL );
+    if (test) FREE( test );
+    return(istoo_little);
+}
+
+private ushort get_biggest_block( maximum )
+ushort maximum;
+{
+    ushort maxblock;
+    ushort top = maximum;
+    ushort bottom = 0;
+    if (!toomuch_mem(maximum)) return(maximum); /* If there's enough memory */
+    else {
+        gprintf(ERROR, "Running out of memory...\n");
+        maxblock = calc_middle( top, bottom );
+        while( !done_search(top, bottom, maxblock) ) {
+            if( toomuch_mem(maxblock) ) {
+                top = maxblock;
+                maxblock = calc_middle(top,bottom);
+            }
+            else if (toolittle_mem(maxblock)) {
+                bottom = maxblock;
+                maxblock = calc_middle(top,bottom);
+            }
+        }
+    }
+    return( maxblock );
+}
+
+public ulong MyMaxMem(ushort *growbytes) 
+{
+    ulong x;
+    if( growbytes != NULL ) *growbytes = 0;
+    x=( (ulong)get_biggest_block((ushort)BIGGEST_BLOCK));
+/*  gprintf(TRANS,"cext: MyMaxMem %ld\n",x); */
+    return x;
+}
+
+/* note: EXIT is defined to be cmt_exit */
+
+void cmt_exit(n)
+  int n;
+{
+    cu_cleanup();
+/* For protection, exit is #defined to hide it.  Expose it and call it. */
+#undef exit
+    exit(n);
+}
+
+
+#ifdef AMIGA
+#ifdef LATTICE
+/* for some reason, these don't seem to be defined 
+   anywhere in the standard libraries
+ */
+#include "signal.h"
+
+int _FPERR;
+int (*_SIGFPE)(int) = SIG_DFL;
+
+int _oserr;
+
+#endif
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/cmt/cext.h b/lib-src/libnyquist/nyquist/cmt/cext.h
new file mode 100644
index 0000000..665c13d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cext.h
@@ -0,0 +1,194 @@
+/******************************************************************
+*               modified JCD 27 Apr-88 for AMIGA
+*      cext.h -- extensions to c to make it more portable
+* Copyright 1989 Carnegie Mellon University
+*
+*******************************************************************
+
+cext must provide the following definitions:
+
+true     -- a  constant
+false     -- a boolean constant
+private -- defined as static, used to declare local functions
+public     -- defined as empty string, used to declare exported functions
+boolean -- a new type
+byte     -- unsigned 8-bit quantity
+ushort     -- unsigned 16-bit quantity
+ulong     -- unsigned 32-bit quantity
+Pointer -- pointer to char, a generic pointer
+ABS()     -- absolute value of any type of number
+MAX()     -- maximum of two numbers
+MIN()     -- minimum of two numbers
+ROUND()	  -- round a double to long		     
+
+NULL     -- pointer to nothing, a constant
+EOS      -- end of string, a constant '\0'
+MALLOC(x)     -- allocates x bytes
+FREE(x)     -- frees something from MALLOC
+AVAILMEM     -- tells how much memory is available.
+                   (N.B.: no parens, no args.)
+EXIT(n)  -- calls exit(n) after shutting down/deallocating resources
+
+*****************************************************************************/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  many changes for new conditional compilation switches
+ * 28Apr03  rbd removed macro redefinitions: min, max
+ */
+
+#ifndef CEXT_H
+#ifndef SWITCHES
+#include "switches.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#if HAS_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAS_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#if HAS_MALLOC_H
+#include <malloc.h>
+#endif
+
+#if NEED_ULONG
+typedef unsigned long ulong;
+#endif
+
+#if NEED_USHORT
+typedef unsigned long ushort;
+#endif
+
+#if NEED_BYTE
+typedef unsigned char byte;
+#endif
+
+/* There's a name conflict between true/false as an enum type in
+ * Apple #includes:Types.h on the Mac, and true/false as #defined below
+ */
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define private static
+#define public
+
+#if NEED_DEFINE_MALLOC
+public void *malloc();
+#endif
+
+typedef char *Pointer;
+
+#ifdef UNIX_MACH
+typedef int boolean;
+#else
+/* hopefully, unsigned short will save sign extension instructions */
+typedef unsigned char boolean;
+#endif
+
+#ifndef ABS
+#define ABS(a) (((a) > 0) ? (a) : -(a))
+#endif
+#ifndef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#define MAXULONG 0xffffffff
+
+#ifndef NULL
+#define NULL 0L
+#endif
+
+#ifndef EOS
+#define EOS '\0'
+#endif
+
+#define SAFETYBUF    10    /* Safety buffer when allocating memory */
+#define BIGGEST_BLOCK    32765    /* Should find a happy medium for this  */
+
+#ifdef MACINTOSH /*DMH: gets AVAILMEM in record.c*/
+#include <stddef.h>
+#define MALLOC(x)       malloc((size_t)(x))  /*DMH: size_t is ulong, for MAC*/
+#define FREE(x)    free((char *)(x))
+#define AVAILMEM    MyMaxMem(NULL)/*???*/
+#endif
+
+#ifdef LATTICE322
+#define MALLOC  malloc
+#define FREE    free
+#define AVAILMEM    MyMaxMem(NULL)
+
+#else
+
+#ifdef DOS /* was MICROSOFT */
+#define MALLOC  malloc
+#define FREE    free
+#define AVAILMEM MyMaxMem(NULL)
+#endif
+#endif
+
+#ifdef UNIX
+#define MALLOC  malloc
+#define FREE     free
+#define AVAILMEM     10000000 /* since we have virtual memory, assume 10Mb */
+#endif
+
+#ifdef AMIGA
+#define MALLOC  malloc
+#define FREE    free
+#define AVAILMEM     128000
+#endif
+
+public ulong MyMaxMem(ushort *);
+
+#ifndef MEM
+#include "mem.h"
+#endif
+
+#ifndef CLEANUP
+#include "cleanup.h"
+#endif
+
+#ifdef CMTSTUFF
+#define EXIT cmt_exit
+public void EXIT(int);
+/* don't allow anyone to call exit directly */
+#define exit(n) PLEASE_CALL_EXIT_NOT_exit
+#else
+#define EXIT(n) exit(n)
+#endif
+
+#define _cext
+
+#ifndef MALLOC
+MALLOC is not defined!
+#endif
+
+#define ROUND(x) ((long) ((x) + 0.5))
+
+/* for compatibility */
+#ifdef NEED_ROUND
+#define round ROUND
+#endif
+
+#ifndef min
+#define min MIN
+#define max MAX
+#endif
+
+#define CEXT_H
+#endif
diff --git a/lib-src/libnyquist/nyquist/cmt/cleanup.c b/lib-src/libnyquist/nyquist/cmt/cleanup.c
new file mode 100644
index 0000000..a0797d9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cleanup.c
@@ -0,0 +1,62 @@
+/* cleanup.c -- registers work to do upon exit */
+
+#include "stdio.h"
+#include "cext.h"
+
+typedef struct cleanup_struct {
+    struct cleanup_struct *next;
+    cu_fn_type fn;
+    cu_parm_type obj;
+} cleanup_node, *cleanup_type;
+
+cleanup_type cleanup_list = NULL;
+
+/* cu_register -- remember function and arg to call in order to clean up */
+/**/
+void cu_register(cu_fn_type fn, cu_parm_type obj)
+{
+    cleanup_type cu = (cleanup_type) memget(sizeof(cleanup_node));
+    cu->fn = fn;
+    cu->obj = obj;
+    cu->next = cleanup_list;
+    cleanup_list = cu;
+}
+
+
+/* cu_unregister -- erase memory of obj (should be unique in cleanup list) */
+/**/
+void cu_unregister(obj)
+  void *obj;
+{
+    cleanup_type *cu = &cleanup_list;
+    while (*cu) {
+        if ((*cu)->obj == obj) {
+            cleanup_type found = *cu;
+            *cu = (*cu)->next;	/* splice out found */
+            memfree((char *) found, sizeof(cleanup_node));
+            return;
+        }
+        cu = &((*cu)->next);
+    }
+}
+
+
+/* cu_cleanup -- call the registered functions */
+/**/
+void cu_cleanup()
+{
+    while (cleanup_list) {
+        cleanup_type cu = cleanup_list;
+#ifdef CU_TRACE
+        gprintf(GTRANS, "cu_cleanup: node %lx fn %lx obj %lx\n",
+                cu, cu->fn, cu->obj);
+#endif
+        cu->fn(cu->obj);
+        cleanup_list = cu->next;
+        memfree((char *) cu, sizeof(cleanup_node));
+    }
+#ifdef CU_TRACE
+    gprintf(GTRANS, "cu_cleanup done.\n");
+    fflush(stdout);
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/cleanup.h b/lib-src/libnyquist/nyquist/cmt/cleanup.h
new file mode 100644
index 0000000..62aaf6f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cleanup.h
@@ -0,0 +1,9 @@
+/* cleanup.c -- registers work to do upon exit */
+
+typedef void *cu_parm_type;
+typedef void (*cu_fn_type)(cu_parm_type);
+void cu_register(cu_fn_type fn, cu_parm_type obj);
+void cu_unregister(void *obj);
+void cu_cleanup(void);
+
+#define CLEANUP
diff --git a/lib-src/libnyquist/nyquist/cmt/cmdline.c b/lib-src/libnyquist/nyquist/cmt/cmdline.c
new file mode 100644
index 0000000..4440f35
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmdline.c
@@ -0,0 +1,478 @@
+/* cmdline.c -- command line parsing routines */
+/* Copyright 1989 Carnegie Mellon University */
+/*
+ * This module is designed to allow various modules to scan (and rescan)
+ * the command line for applicable arguments.  The goal is to hide as
+ * much information about switches and their names as possible so that
+ * switches become more consistent across applications and so that the
+ * author of an application need not do a lot of work to provide numerous
+ * options.  Instead, each module scans the command line for its own
+ * arguments.
+ *
+ * Command lines are of the following form:
+ *    command -s1 -s2 opt2 -s3 arg1 arg2 -s4 opt4 arg3
+ * Note that there are three kinds of command line parameters:
+ * (1) A Switch is a "-" followed by a name, e.g. "-s1"
+ * (2) An Option is a Switch followed by a space and name, e.g. "-s2 opt2"
+ * (3) An Argument is a name by itself, e.g. "arg1"
+ * Note also that a switch followed by an argument looks just like an
+ * option, so a list of valid option names is necessary to disambiguate.
+ *
+ * Long names are good for readability, but single character abbreviations
+ * are nice for experienced users.  cmdline.c allows single character
+ * abbreviations provided that they are unambiguous.  These are
+ * recognized with no extra work by the programmer.  If an
+ * isolated '?' is encountered in the command line, then all of
+ * the options and switches are printed as help and for debugging.
+ *
+ * Given that we must tell this module about option names and switch
+ * names, how should we do it?  We can't wait until modules are
+ * initialized, since often modules want to read the command line
+ * at initialization time.  In the original implementation, the
+ * main program was supposed to provide names for the whole program,
+ * but this violates modularity: when an option is added to a module,
+ * the main program has to be modified too.  This is a real pain when
+ * different machines support different options and you want to have
+ * a single machine-independent main program.  The solution is to 
+ * have the main program import strings describing the options and
+ * switches used by each module.  These are passed into cmdline.c
+ * before initialization of other modules is begun.
+ *
+ * A main program that uses cmdline.c should do the following:
+ *   call cl_syntax(s) for each module's option/switch string.
+ * The string s should have the following format:
+ *  "opt1<o>description;opt2<o>description;...;switch1<s>description;..."
+ * where opt1 and opt2 are option names (without the preceding "-"), and
+ * switch1 is a switch name.  The <o> and <s> indicate whether the
+ * name is an option or a switch.  The descriptions are arbitrary strings
+ * (without semicolons) that are printed out for the user when "?"
+ * is typed on the command line.
+ *
+ * After calling cl_syntax, main() should call
+ *   cl_init(argv, argc)
+ * cl_init will report an error (to STDERR) if it finds any illegal
+ * switch or option names in argv, and help will be printed if "?"
+ * is found in argv.  If cl_init returns false, then the user has been
+ * given an error message or help, and main should probably exit.
+ *
+ * Afterward, switches, options, and arguments can be accessed by
+ * calling cl_switch, cl_option, and cl_arg.  If cl_switch or cl_option
+ * is called with a switch name that was not mentioned in the call to 
+ * cl_init, an error will result.  This indicates that the application
+ * author omitted a valid switch or option name when calling cl_init.
+ * This is an error because the full set of names is needed for error
+ * checking and to distinguish arguments from options.
+ *
+ */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+* 13-Jun-86 | Created Change Log
+*  6-Aug-86 | Modified for Lattice 3.0 -- use "void" to type some routines
+* 20-Sep-89 | Redesigned the interface, adding cl_syntax call.
+*  2-Apr-91 | JDW : further changes
+* 27-Dec-93 | "@file" as first arg reads command line args from file
+* 11-Mar-94 | PLu: Add private to cl_search() definition.
+* 28-Apr-03 | DM: true->TRUE, false->FALSE
+*****************************************************************************/
+
+/* stdlib.h not on PMAX */
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "cmdline.h"
+#include "ctype.h"
+#include "string.h"
+
+#define syntax_max 10           /* allow for 10 syntax strings */
+private char *syntax[syntax_max];
+private int n_syntax = 0;       /* number of strings so far */
+private char **argv;            /* command line argument vector */
+private int argc;               /* length of argv */
+
+private boolean cl_rdy = FALSE;    /* set to TRUE when initialized */
+
+#define cl_OPT 1
+#define cl_SW 2
+#define cl_INIT 3
+#define cl_ARG 4
+
+/*****************************************************************************
+*    Routines local to this module
+*****************************************************************************/
+private char *cl_search();
+private int find_string();
+private void indirect_command(char *filename, char *oldarg0);
+private void ready_check();
+
+/****************************************************************
+*           cl_arg
+* Inputs:
+*    n: the index of the arg needed
+* Results:
+*    pointer to the nth arg, or NULL if none exists
+*    arg 0 is the command name
+*****************************************************************/
+
+char *cl_arg(n)
+  int n;
+{
+    return (n <= 0 ? argv[0] :
+                     cl_search((char *)NULL, cl_ARG, n));
+}
+
+/* cl_help -- print help from syntax strings */
+/**/
+void cl_help()
+{
+    register int i, j;
+    int count = 0;	/* see if there are any switches or flags */
+
+    for (i = 0; i < n_syntax; i++) {
+        register char *ptr = syntax[i];
+        register char c = *ptr++;
+        while (c != EOS) {
+            while (c != EOS && !(isalnum(c))) c = *ptr++;
+            if (c != EOS) {
+                count++;
+                gprintf(TRANS, "-");
+                j = 1;
+                while (c != EOS && c != '<') {
+                    gprintf(TRANS, "%c", c);
+                    c = *ptr++;
+                    j++;
+                }
+                if (c != EOS) {
+                    c = *ptr++;
+                    if (c == 'o') {
+                        gprintf(TRANS, " xxx");
+                        j += 4;
+                    }
+                }
+                /* attempt to tab */
+                do {
+                    gprintf(TRANS, " ");
+                } while (j++ < 16);
+                while (c != EOS && c != '>') c = *ptr++;
+                if (c != EOS) c = *ptr++;
+                while (c != EOS && c != ';') {
+                    gprintf(TRANS, "%c", c);
+                    c = *ptr++;
+                }
+                gprintf(TRANS, "\n");
+            }
+        }
+    }
+    if (!count) gprintf(TRANS, "No switches or options exist.\n");
+}
+
+/*****************************************************************************
+*           cl_init
+* Inputs:
+*    char *switches[]:    array of switch names
+*    int nsw:   number of switch names
+*    char *options[]:    array of option names
+*    int nopt:  number of option names
+*    char *av:  array of command line fields (argv)
+*    int ac:        number of command line fields (argc)
+* Effect:
+*    Checks that all command line entries are valid.
+*    Saves info for use by other routines.
+* Returns:
+*    TRUE if syntax checks OK, otherwise false
+*****************************************************************************/
+
+boolean cl_init(av, ac)
+  char *av[];
+  int ac;
+{
+    argv = av;      
+    argc = ac;
+
+    /* check for help request */
+    if (argc == 2 && strcmp(argv[1], "?") == 0) {
+        cl_help();
+        return FALSE; /* avoid cl_search which would complain about "?" */
+    }
+    /* check for indirection */
+    if (argc == 2 && *(argv[1]) == '@') {
+        /* read new args from file */
+        indirect_command(av[1] + 1, av[0]);
+    }
+    /* check command line syntax: */
+    cl_rdy = TRUE;
+    return (cl_rdy = (cl_search("true", cl_INIT, 0) != NULL));
+}
+
+
+/****************************************************************
+*           cl_int_option
+* Inputs:
+*    char *name:    name of option
+*    long default:  default value for option
+* Result:
+*    returns long encoding of the option, deflt if none
+* Implementation:
+*    call cl_option and sscanf result
+*****************************************************************/
+
+long cl_int_option(name, deflt)
+  char *name;
+  long deflt;
+{
+    char *opt = cl_option(name);
+    if (opt) {
+        if (sscanf(opt, "%ld", &deflt) != 1) {
+            gprintf(TRANS, "Warning: option %s %s not an integer, ignored\n",
+                        name, opt);
+        }
+    }
+    return deflt;
+}
+
+
+/****************************************************************
+*           cl_search
+* Inputs:
+*    char *name:    name of field, must be non-null if opt_sw == cl_INIT
+*    int opt_sw:    option, switch, init, or arg
+*    int n:         argument number (if opt_sw is cl_ARG)
+* Result:
+*    returns pointer to option value/switch if one exists, otherwise null
+* Implementation:
+*    parse the command line until name or arg is found
+*    see if the option is followed by a string that does
+*    not start with "-"
+*****************************************************************/
+
+private char *cl_search(name, opt_sw, n)
+  char *name;
+  int opt_sw;
+  int n;        /* if opt_sw is cl_ARG, n > 0 tells which one */
+{
+    register int i = 1;    /* index into command line */
+    boolean abbr;
+    boolean result = TRUE;
+
+    ready_check();
+
+    /* parse command line: */
+    while (i < argc) {
+        register char *arg = argv[i];
+        /* arguments that start with '-' should be quoted and quotes must
+           be removed by the application
+         */
+        if (*arg == '-') {
+            int arg_type = find_string(arg + 1, &abbr);
+            if (arg_type == cl_OPT) {
+                i += 1; /* skip name and option */
+                /* don't look for '-' because the option might be a
+                 * negative number
+                 */
+                if (i >= argc /* || *arg == '-' */) {
+                    if (opt_sw == cl_INIT) {
+                        gprintf(ERROR, "missing argument after %s\n", arg);
+                        result = FALSE;
+                    }
+                } else if (opt_sw == cl_OPT &&
+                    (strcmp(arg + 1, name) == 0 ||
+                     (abbr && *(arg + 1) == name[0]))) {
+                    return argv[i];
+                }
+            } else if (arg_type == cl_SW) {
+                if (opt_sw == cl_SW &&
+                    (strcmp(arg + 1, name) == 0 ||
+                     (abbr && *(arg + 1) == name[0])))
+                    return arg;
+            } else if (opt_sw == cl_INIT)  {
+                gprintf(ERROR, "invalid switch: %s\n", arg);
+                result = FALSE;
+            }
+        } else if (opt_sw == cl_ARG) {
+            if (n == 1) return arg;
+            n--;
+        }
+        i++; /* skip to next field */
+    }
+    if (opt_sw == cl_INIT) {
+        /* return name or NULL to represent TRUE or FALSE */
+        return (result ? name : NULL);
+    }
+    return NULL;
+}
+
+/****************************************************************
+*           cl_option
+* Inputs:
+*    char *name:    option name
+* Outputs:
+*    returns char *: the option string if found, otherwise null
+****************************************************************/
+
+char *cl_option(name)
+char *name;
+{
+    return cl_search(name, cl_OPT, 0);
+}
+
+/****************************************************************
+*           cl_switch
+* Inputs:
+*    char *name:    switch name
+* Outputs:
+*    boolean:    TRUE if switch found
+****************************************************************/
+
+boolean cl_switch(name)
+char *name;
+{
+    return (boolean)(cl_search(name, cl_SW, 0) != NULL);
+}
+
+/* cl_syntax -- install a string specifying options and switches */
+/**/
+boolean cl_syntax(char *s)
+{
+    if (n_syntax < syntax_max) {
+        syntax[n_syntax++] = s;
+        return TRUE;
+    } else {
+        gprintf(ERROR, "cl_syntax: out of room\n");
+        return FALSE;
+    }
+}
+
+/****************************************************************
+*           find_string
+* Inputs:
+*    char *s:    string to find, terminated by any non-alphanumeric
+*    boolean *abbr: set TRUE if s is an abbreviation, otherwise false
+* Effect:
+*    Looks for s in syntax strings
+* Returns:
+*    0 = FALSE = not found, 1 = cl_OPT = option, 2 = cl_SW = switch
+*****************************************************************/
+
+private int find_string(s, abbr)
+  char *s;
+  boolean *abbr;
+{
+    int found_it = FALSE;
+    int i;
+    *abbr = FALSE;
+    for (i = 0; i < n_syntax; i++) {    /* loop through strings */
+        register char *syntax_ptr = syntax[i];
+        while (*syntax_ptr != EOS) {
+            register char *s_ptr = s;
+            while (*syntax_ptr != EOS &&
+                   !(isalnum(*syntax_ptr))) syntax_ptr++;
+            while (*s_ptr != EOS && (*s_ptr++ == *syntax_ptr))
+                syntax_ptr++; /* only increment if there's a match */
+            if (!(isalnum(*s_ptr)) && *syntax_ptr == '<') {
+                syntax_ptr++; /* advance to the type field */
+                if (*syntax_ptr == 's') return cl_SW;
+                if (*syntax_ptr != 'o') 
+                    gprintf(ERROR,
+                            "(internal error) bad cl_syntax string: %s\n",
+                            syntax[i]);
+                return cl_OPT;
+            }
+            /* no match, so go to next */
+            while (*syntax_ptr != ';' && *syntax_ptr != EOS) syntax_ptr++;
+            if (*syntax_ptr == ';') syntax_ptr++;
+        }
+    }
+
+    /* no match, maybe there is a single character match */
+    if (s[0] == EOS || s[1] != EOS) return FALSE;
+
+    for (i = 0; i < n_syntax; i++) {    /* loop through strings */
+        char *syntax_ptr = syntax[i];
+        while (*syntax_ptr != EOS) {
+            while (*syntax_ptr != EOS &&
+                   !(isalnum(*syntax_ptr))) syntax_ptr++;
+            if (s[0] == *syntax_ptr) {
+                if (found_it) return FALSE;     /* ambiguous */
+                /* else, find the type */
+                while (*syntax_ptr != '<' && *syntax_ptr != EOS)
+                    syntax_ptr++;
+                syntax_ptr++;
+                if (*syntax_ptr == 's') found_it = cl_SW;
+                else if (*syntax_ptr == 'o') found_it = cl_OPT;
+                else return FALSE;      /* error in string syntax */
+            }
+            /* no match, so go to next */
+            while (*syntax_ptr != ';' && *syntax_ptr != EOS) syntax_ptr++;
+            if (*syntax_ptr == ';') syntax_ptr++;
+        }
+    }
+    if (found_it) *abbr = TRUE;
+    return found_it;
+}
+
+
+/* get_arg -- get an argument from a file */
+/**/
+boolean get_arg(file, arg)
+  FILE *file;
+  char *arg;
+{
+    int c;
+    while ((c = getc(file)) != EOF && isspace(c)) ;
+    if (c == EOF) return FALSE;
+    ungetc(c, file);
+    while ((c = getc(file)) != EOF && !isspace(c)) {
+            *arg++ = c;
+    }
+    *arg = 0;
+    return TRUE;
+}
+
+
+/* indirect_command -- get argv, argc from a file */
+/**/
+private void indirect_command(filename, oldarg0)
+  char *filename;
+  char *oldarg0;
+{
+    FILE *argfile = fopen(filename, "r");
+    if (!argfile) {
+            argv = (char **) malloc(sizeof(char *));
+        argv[0] = oldarg0;
+        argc = 1;
+    } else {
+            int i = 1;
+        char arg[100];
+        while (get_arg(argfile, arg)) i++;
+        fclose(argfile);
+        argfile = fopen(filename, "r");
+        argv = (char **) malloc(sizeof(char *) * i);
+        argv[0] = oldarg0;
+        argc = i;
+        i = 1;
+        while (get_arg(argfile, arg)) {
+            argv[i] = (char *) malloc(strlen(arg) + 1);
+            strcpy(argv[i], arg);
+            i++;
+        }
+    }
+}
+
+/****************************************************************
+*           ready_check
+* Effect:
+*    Halt program if cl_rdy is not true.
+*****************************************************************/
+private void ready_check()
+{
+    if (!cl_rdy) {
+        gprintf(ERROR,
+        "Internal error: cl_init was not called, see cmdline.c\n");
+        EXIT(1);
+    }
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/cmdline.h b/lib-src/libnyquist/nyquist/cmt/cmdline.h
new file mode 100644
index 0000000..06ff4c3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmdline.h
@@ -0,0 +1,8 @@
+/* Copyright 1989 Carnegie Mellon University */
+
+char *cl_arg(int n);
+boolean cl_init(char *av[], int ac);
+long cl_int_option(char *name, long deflt);
+char *cl_option(char *name);
+boolean cl_switch(char *name);
+boolean cl_syntax(char *name);
diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.c b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c
new file mode 100644
index 0000000..2881467
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c
@@ -0,0 +1,53 @@
+/* cmtcmd.c -- routines for the moxc side of the command interface */
+
+#include "switches.h"
+#include "stdio.h"
+#ifdef  AMIGA
+#include "exec/types.h"
+#include "exec/exec.h"
+#endif
+#include "cmtcmd.h"
+#include "cext.h"
+#include "userio.h"
+#include "string.h"
+
+#define HASHELEM(p) ((p).symbol_name)
+#define HASHVAL 50
+#define HASHENTRIES 50
+#define HASHENTER lookup
+#define HASHNOCOPY
+
+#include "hashrout.h"
+
+void defvar(name, addr)
+  char *name;
+  int *addr;
+{
+    int i = lookup(name);
+    HASHENTRY(i).symb_type = var_symb_type;
+    HASHENTRY(i).ptr.intptr = addr;
+}
+
+
+void defun(name, addr)
+  char *name;
+  int (*addr)();
+{
+    int i = lookup(name);
+    HASHENTRY(i).symb_type = fn_symb_type;
+    HASHENTRY(i).ptr.routine = addr;
+}
+
+
+void defvec(name, addr, size)
+  char *name;
+  int *addr;
+  int size;
+{
+    int i = lookup(name);
+    HASHENTRY(i).symb_type = vec_symb_type;
+    HASHENTRY(i).size = size;
+    HASHENTRY(i).ptr.intptr = addr;
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.h b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h
new file mode 100644
index 0000000..9ad1cac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h
@@ -0,0 +1,35 @@
+/* cmtcmd.h -- header for remote action and variable setting interface */
+
+#define var_symb_type 333
+#define fn_symb_type 555
+#define vec_symb_type 777
+
+#ifdef AMIGA
+struct cmd_msg {
+    struct Message msg;
+    long symb_type;     /* one of var_, fn_, or vec_symb_type */
+    char *symbol_name;
+    long the_args[8];   /* args for function call.  If var_symb_type,
+               the_args[0] is the new value.  If vec_symb_type,
+               the_args[0] is index, the_args[1] is new value. */
+};
+#endif
+
+typedef struct symb_descr {
+    char *symbol_name;
+    int symb_type;
+    int size;     /* for array bounds checking */
+    union {
+    int *intptr;
+    int (*routine)();
+    } ptr;
+} symb_descr_node;
+
+int lookup(char *s);
+void defvar(char *name, int *addr);
+void defvec(char *name, int *addr, int size);
+typedef int (*defun_type)();
+void defun(char *name, defun_type addr);
+
+#define HASHTYPE symb_descr_node
+#include "hash.h"
diff --git a/lib-src/libnyquist/nyquist/cmt/cmtio.c b/lib-src/libnyquist/nyquist/cmt/cmtio.c
new file mode 100644
index 0000000..e6f1ebc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmtio.c
@@ -0,0 +1,161 @@
+/*
+ **********************************************************************
+ *              File io.c
+ **********************************************************************
+ *
+ * Non blocking input routine
+ * Works by puttng the terminal in CBREAK mode and using the FIONREAD
+ * ioctl call to determine the number of characters in the input queue
+ */
+
+#include "stdio.h"
+#include "io.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <sgtty.h>
+#include "cext.h"
+
+int     IOinputfd;      /* input file descriptor (usually 0) */
+
+int     IOnochar;       /* Value to be returned by IOgetchar()
+                   where there is no input to be had */
+
+static  struct sgttyb IOoldmodes, IOcurrentmodes;
+                /* Initial and current tty modes */
+
+/*
+ * IOsetup(inputfd)
+ *   Args:
+ *      inputfd - input file descriptor (should be zero for standard input)
+ *   Returns:
+ *      0 - if all goes well
+ *      -1 - if an ioctl fails (also calls perror)
+ *   Side Effects:
+ *      Puts the terminal in CBREAK mode - before process termination
+ *      IOcleanup() should be called to restore old terminal modes
+ *      Catch's interrupts (if they are not already being caught) and
+ *      calls IOcleanup before exiting
+ *
+ */
+
+#define ERROR(s)        return (perror(s), -1)
+
+IOsetup(inputfd)
+{
+    static IOdiegracefully();
+    int (*interrupt_handler)();
+
+    IOinputfd = inputfd;
+    IOnochar = NOCHAR;
+    if(ioctl(IOinputfd, TIOCGETP,  &IOoldmodes) < 0)
+        ERROR("IOsetup");
+
+    IOcurrentmodes = IOoldmodes;
+    IOcurrentmodes.sg_flags |= CBREAK;
+    IOcurrentmodes.sg_flags &= ~ECHO;
+    if(ioctl(IOinputfd, TIOCSETP,  &IOcurrentmodes))
+        ERROR("IOsetup-2");
+
+    if( (interrupt_handler = signal(SIGINT, IOdiegracefully)) != 0)
+        signal(SIGINT, interrupt_handler);
+    return 0;
+}
+
+static
+IOdiegracefully()
+{
+    write(2, "\nBye\n", 5);
+    IOcleanup();
+    EXIT(2);
+}
+
+/*
+ * IOcleanup()
+ *   Returns:
+ *      0 - if all goes well
+ *      -1 - if an ioctl fails (also calls perror)
+ *   Side Effects:
+ *      Restores initial terminal modes
+ */
+
+IOcleanup()
+{
+    if(ioctl(IOinputfd, TIOCSETP,  &IOoldmodes) < 0)
+        ERROR("IOclean");
+    return 0;
+}
+
+
+/*
+ * IOgetchar()
+ *    Returns:
+ *      A character off the input queue if there is one,
+ *      IOnochar if there is no character waiting to be read,
+ *      -1 if an ioctl fails (shouldn't happen if IOsetup went OK)
+ */
+
+#ifndef UNIX_MACH
+
+IOgetchar()
+{
+    int n;
+    char c;
+
+    if(ioctl(IOinputfd, FIONREAD, &n) < 0)
+        ERROR("IOgetchar");
+    if(n <= 0)
+        return IOnochar;
+    switch(read(IOinputfd, &c, 1)) {
+    case 1:
+        return c;
+    case 0:
+        return EOF;
+    default:
+        ERROR("IOgetchar-read");
+    }
+}
+
+#ifdef IOGETCHAR2
+IOgetchar2()
+{
+    int nfds, readfds = 1 << IOinputfd;
+    char c;
+    static struct timeval zero;
+
+    if(IOinputfd < 0 || IOinputfd >= 32) {
+        printf("IOgetchar2: bad IOinputfd (%d)%s\n", IOinputfd,
+            IOinputfd == -1 ? "Did you call IOsetup(fd)?" : "");
+    }
+    nfds = select(32, &readfds, 0, 0, &zero);
+    if(nfds > 0) {
+        switch(read(IOinputfd, &c, 1)) {
+        case 0:
+            return EOF;
+        case 1:
+            return c;
+        default:
+            printf("IOgetchar2: read failed!\n");
+            return NOCHAR;
+        }
+    }
+    else if(nfds < 0)
+        printf("IOgetchar2: select failed!\n");
+    return NOCHAR;
+}
+#endif
+
+/*
+ * IOwaitchar()
+ *   Returns:
+ *      A character off the input queue.  Waits if necessary.
+ */
+
+int IOwaitchar()
+{
+    char c;
+    if (read(IOinputfd, &c, 1) == 1) return c;
+    else return EOF;
+}
+
+#endif /* not UNIX_MACH */
diff --git a/lib-src/libnyquist/nyquist/cmt/cmtio.h b/lib-src/libnyquist/nyquist/cmt/cmtio.h
new file mode 100644
index 0000000..3e50ad9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/cmtio.h
@@ -0,0 +1,9 @@
+#define NOCHAR -2
+
+int IOinputfd;
+int IOnochar;
+
+int IOsetup(int inputfd);
+int IOcleanup(void);
+int IOgetchar(void);
+int IOwaitchar(void);
diff --git a/lib-src/libnyquist/nyquist/cmt/hash.h b/lib-src/libnyquist/nyquist/cmt/hash.h
new file mode 100644
index 0000000..0257cfe
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/hash.h
@@ -0,0 +1,23 @@
+/*
+ * This file should be included in all files that use
+ * the HASHENTRY macro; see hashrout.h for details
+ */
+/* Copyright 1989 Carnegie Mellon University */
+
+#ifndef    HASHTYPE
+#    include    "-- HASHTYPE undefined"
+#endif
+
+/*
+ * An element really is a HASHTYPE along with a h_next entry,
+ * which chains together entries of the same hash value.
+ */
+
+typedef struct hashelem {
+    HASHTYPE    h_elem;
+    struct hashelem     *h_next;
+} hashelem;
+
+extern hashelem    hashfirstchunk[];
+
+#define HASHENTRY(i)    (hashfirstchunk[i].h_elem)
diff --git a/lib-src/libnyquist/nyquist/cmt/hashrout.h b/lib-src/libnyquist/nyquist/cmt/hashrout.h
new file mode 100644
index 0000000..a566b9f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/hashrout.h
@@ -0,0 +1,220 @@
+/* hashrout.h -- Rubine's hash table package */
+/* Copyright 1989 Carnegie Mellon University */
+
+/* ChangeLog:
+ *    2-jan-85 rbd    Added option to count entries: define COUNTER and
+ *          HASHENTER routine will increment it on new entries
+ *   28-Apr-03 DM     Explicit declaration of int type for HASHENTER() 
+ */
+
+/*
+ * Generic symbol table functions
+ *
+ * After writing this code over for a bunch of interpreters
+ * I think I know how to do it once and for all, generally
+ * enough for most application.
+ * There are enough settable parameters to suit anyone, and
+ * the defaults usually do something sane.
+ *
+ * The basic idea is that you have a bunch of symbol table entries
+ * that need to be entered or looked up given a character string.
+ * Symbol table entries are usually structures, and one element
+ * of the structure must be the character string of the key.
+ * The structure should be given a type name, and these routines
+ * are informed of the type name via
+ *    #define    HASHTYPE    type-name-of-symbol-table-entry
+ * You must inform the routines how to access the character string
+ * given the symbol table entry; for example
+ *    #define HASHELEM(p)    ((p).name)
+ * There are two size parameters - the number of different hash
+ * values and the number of symbol table entries to allocate at one
+ * time.  Both default to 256.
+ *    #define    HASHVAL        128
+ *    #define    HASHENTRIES    512
+ * The name of the function that performs both entry and lookup is
+ * enter(name) - it takes one argument, a character string.  The name
+ * of the function may be changed via
+ *    #define HASHENTER    new-name-for-enter-routine
+ * Note that if there is no entry in the table for name, name is entered
+ * automatically.  The returned structure will have only the name
+ * field filled in; the rest of the fields are guarenteed to be zero
+ * so an application can check if this is the first time name was entered.
+ * If HASHPOINT is defined, the enter routine returns a pointer to a hash
+ * table entry.  In the default case, i.e. HASHPOINT undefined, the
+ * enter routine returns an integer between zero and HASHENTRIES.
+ * The macro HASHENTRY(i) will, given that integer, return the
+ * table element (not a pointer to it), so for example,
+ *    HASHENTRY(enter(x)).name == x.
+ * Any file that wishes to use HASHENTRY should have at the top
+ *    #define    HASHTYPE    type-name-of-symbol-table-entry
+ *    #include "hash.h" 
+ * Note in this case at most HASHENTRIES entries will be allocated
+ * before hash table overflow.  If HASHPOINT is defined, allocations
+ * will take place until memory runs out.
+ * By default, hash strings are copied into space obtained from malloc
+ * before being placed in new entry.  This copying can be supressed
+ * by defining HASHNOCOPY.
+ * The following is an example of using the hash table stuff.
+
+typedef struct {
+    char    *n_name;
+    int    n_value;
+} symbolentry;
+
+#define    HASHTYPE    symbolentry
+#define HASHELEM(p)    ((p).n_name)
+#define HASHENTRIES    1024
+
+#include "hashrout.h"
+
+*/
+
+
+/*
+ * OK, now the meat.
+ */
+
+#ifndef    HASHTYPE
+#    include    "-- HASHTYPE undefined"
+#endif
+
+#ifndef    HASHELEM
+#    include    "-- HASHELEM undefined"
+#endif
+
+#ifndef    HASHVAL
+#    define    HASHVAL    256
+#endif
+
+#ifndef    HASHENTRIES
+#    define    HASHENTRIES    256
+#endif
+
+#ifndef    HASHENTER
+#    define    HASHENTER    enter
+#endif
+
+/*
+ * HASHNOCOPY, HASHPOINT are undefined by default
+ */
+
+/*
+ * get definition of hash elem structure
+ */
+
+#ifndef HASHENTRY
+#    include    "hash.h"
+#endif
+
+/*
+ * Table of pointers, indexed by hash values
+ */
+
+hashelem    *hashtab[HASHVAL];
+
+/*
+ * First chunk of elements, pointer to the start,
+ * and index for allocation
+ */
+
+hashelem    hashfirstchunk[HASHENTRIES];
+hashelem    *hashchunk = hashfirstchunk;
+int     hashindex = 0;
+
+/*
+ * stdio.h if we don't have it yet
+ */
+
+#ifndef _NFILE
+#    include <stdio.h>
+#endif
+
+/*
+ * Declare counter if necessary
+ */
+
+#ifdef COUNTER
+extern COUNTER;
+#endif
+
+/*
+ * The enter routine
+ */
+
+#ifdef HASHPOINT
+HASHTYPE *
+#else
+int
+#endif
+HASHENTER (s)
+char *s;
+{
+    register int i, hash;
+    register hashelem *elem;
+
+    /*
+     * Compute s's hash value
+     * I really should look up some good hash functions, but
+     * I haven't bothered.
+     */
+
+for(i = 0, hash = 0; s[i] != '\0' && i < 15; i++)
+    hash += (i + 1) * s[i];
+hash %= HASHVAL;
+
+/*
+      * search for s in the table
+     */
+
+for(elem = hashtab[hash]; elem != NULL; elem = elem->h_next)
+    if(strcmp(s, HASHELEM((elem->h_elem))) == 0) {    /* found it */
+#ifdef HASHPOINT
+        return(&elem->h_elem);
+#else
+        return(elem - hashfirstchunk);
+#endif
+    }
+
+if(hashindex >= HASHENTRIES) {
+#ifdef HASHPOINT
+    char *calloc();
+
+    hashindex = 0;
+    hashchunk = (hashelem *) calloc(HASHENTRIES, sizeof(hashelem));
+    if(hashchunk == NULL) {
+        gprintf(FATAL, "No mem for hash symbol table\n");
+        EXIT(1);
+#ifdef COUNTER
+        COUNTER++; /* optional symbol counter */
+#endif
+    }
+#else
+    gprintf(FATAL, "No hash table space, increase HASHENTRIES\n");
+    EXIT(1);
+#endif
+}
+
+/*
+      * Splice a new entry into the list and fill in the string field
+     */
+
+elem = &hashchunk[hashindex++];
+elem->h_next = hashtab[hash];
+hashtab[hash] = elem;
+
+#ifdef HASHNOCOPY
+HASHELEM((elem->h_elem)) = s;
+#else
+{
+    char *strcpy();
+    HASHELEM((elem->h_elem)) = memget((strlen(s) + 1));
+    strcpy(HASHELEM((elem->h_elem)), s);
+}
+#endif
+
+#ifdef HASHPOINT
+return(&elem->h_elem);
+#else
+return(elem - hashfirstchunk);
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/mem.c b/lib-src/libnyquist/nyquist/cmt/mem.c
new file mode 100644
index 0000000..7256188
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/mem.c
@@ -0,0 +1,91 @@
+/* mem.c -- fast memory allocation/deallocation module */
+
+/* Allocate large chunks of memory using malloc.  From the chunks,
+   allocate memory as needed on long-word boundaries.  Memory is
+   freed by linking memory onto a freelist.  An array of freelists,
+   one for each size, is maintained and checked before going to the
+   chunck for more memory.  The freelist array only holds lists of
+   nodes up to a certain size.  After that, malloc is used directly.
+ */
+/* CHANGE LOG
+ ----------------------------------------------------------------------
+   28-Apr-03 | DM  : fix #includes for portability
+ ----------------------------------------------------------------------
+ */
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cext.h"
+#include "userio.h"
+
+/* how many bytes in the largest node managed in mem_free_list array */
+#define MAX_SIZE_FOR_FREELIST 256
+
+long *mem_free_list[MAX_SIZE_FOR_FREELIST/4];
+
+#define MEM_CHUNK_SIZE 4096
+char *mem_chunk;
+long mem_chunk_remaining = 0;
+
+void meminit()
+{
+    int i;
+    for (i = 0; i < MAX_SIZE_FOR_FREELIST/4; i++) {
+        mem_free_list[i] = NULL;
+    }
+}
+
+
+void *memget(register size_t size)
+{
+    if (size > MAX_SIZE_FOR_FREELIST) {
+/*		gprintf(TRANS, "memget calling MALLOC\n"); */
+        return MALLOC(size);
+    } else {
+        long **p = mem_free_list + ((size - 1) >> 2);
+        if (*p) {
+            register long *result = *p;
+            *p = (long *) *result;
+/*			gprintf(TRANS, "memget->%lx\n", result); */
+            return (char *) result;
+        } else if ((size_t) mem_chunk_remaining >= size) {
+            register char *result = mem_chunk;
+            size = (size + 3) & ~3; /* round up to multiple of 4 */
+            mem_chunk += size;
+            mem_chunk_remaining -= size;
+/*			gprintf(TRANS, "memget->%lx\n", result); */
+            return result;
+        /* note that we throw away remaining chunk when there isn't enough */
+        } else if ((mem_chunk = (char *) MALLOC(MEM_CHUNK_SIZE))) {
+            register char *result = mem_chunk;
+/*			gprintf(TRANS, "mem_chunk at %lx\n", mem_chunk); */
+            size = (size + 3) & ~3; /* round up to multiple of 4 */
+            mem_chunk += size;
+            mem_chunk_remaining = MEM_CHUNK_SIZE - size;
+/*			gprintf(TRANS, "memget->%lx\n", result); */
+            return result;
+        } else {
+            return NULL;
+        }
+    }
+}
+
+
+void memfree(register void *ptr, register size_t size)
+{
+    register long **p = (long **) ptr;
+    if (size > MAX_SIZE_FOR_FREELIST) {
+        FREE(ptr);
+    } else {
+        register long **head_ptr = mem_free_list + ((size - 1) >> 2);
+        *p = *head_ptr;
+        *head_ptr = (long *) p;
+    }
+}
+
+
+
+            
diff --git a/lib-src/libnyquist/nyquist/cmt/mem.h b/lib-src/libnyquist/nyquist/cmt/mem.h
new file mode 100644
index 0000000..ea33ba9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/mem.h
@@ -0,0 +1,12 @@
+#ifdef AMIGA
+#include "stddef.h" 
+#endif
+
+extern long *mem_free_list[];
+
+void *memget(register size_t size);
+void memfree(register void *ptr, register size_t size);
+
+void meminit(void);
+
+#define MEM
diff --git a/lib-src/libnyquist/nyquist/cmt/mfmidi.h b/lib-src/libnyquist/nyquist/cmt/mfmidi.h
new file mode 100644
index 0000000..9621c67
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/mfmidi.h
@@ -0,0 +1,19 @@
+#define NOTEOFF 0x80
+#define NOTEON 0x90
+#define PRESSURE 0xa0
+#define CONTROLLER 0xb0
+#define PITCHBEND 0xe0
+#define PROGRAM 0xc0
+#define CHANPRESSURE 0xd0
+
+/* These are the strings used in keynote to identify Standard MIDI File */
+/* meta text messages. */
+
+#define METATEXT                "Text Event"
+#define METACOPYRIGHT           "Copyright Notice"
+#define METASEQUENCE            "Sequence/Track Name"
+#define METAINSTRUMENT          "Instrument Name"
+#define METALYRIC               "Lyric"
+#define METAMARKER              "Marker"
+#define METACUE                 "Cue Point"
+#define METAUNRECOGNIZED        "Unrecognized"
diff --git a/lib-src/libnyquist/nyquist/cmt/midibuff.h b/lib-src/libnyquist/nyquist/cmt/midibuff.h
new file mode 100644
index 0000000..f8dc1c1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midibuff.h
@@ -0,0 +1,23 @@
+/* midibuff.h -- defines the size of the midi input buffer */
+
+/* midi input buffer */
+/* WARNING: BUFF_SIZE must be a power of 2 so we can use masking to wrap */
+#define EVENT_COUNT 128
+#define EVENT_SIZE 4
+#define BUFF_SIZE (EVENT_COUNT * EVENT_SIZE)
+#define BUFF_MASK (BUFF_SIZE - 1)
+
+#ifdef WINDOWS
+#define huge 
+#endif
+
+extern byte huge *xbuff;	/* application-supplied sysex buffer */
+extern long xbufmask;	    /* mask for circular buffer */
+extern long xbufhead;       /* buffer head and tail offsets */
+extern long xbuftail;
+extern int midi_error;
+/* midi input buffer */
+/* data buffer, declared long to get 32-bit alignment: */
+extern long buff[BUFF_SIZE/4];
+extern int buffhead;     /* buffer head and tail pointers */
+extern int bufftail;
diff --git a/lib-src/libnyquist/nyquist/cmt/midicode.h b/lib-src/libnyquist/nyquist/cmt/midicode.h
new file mode 100644
index 0000000..26361d3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midicode.h
@@ -0,0 +1,62 @@
+/************************************************************************
+*
+* Midi codes
+* Copyright 1989 Carnegie Mellon University
+*
+*************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+------------------------------------------------------------
+* 11-Mar-94 | PLu : Port to IRI
+************************************************************************/
+
+#define MIDI_DATA(d) (0x7f & (d))
+#define MIDI_CHANNEL(c) (0x0f & ((c) - 1))
+#define MIDI_PORT(c) (((c) - 1) >> 4)
+#define MIDI_PROGRAM(p) MIDI_DATA((p) - 1)
+
+#define MIDI_STATUS_BIT 0x80
+#define MIDI_COMMON	0x70
+#define MIDI_CODE_MASK  0xf0
+#define MIDI_CHN_MASK   0x0f
+#define MIDI_REALTIME   0xf8
+#define MIDI_CHAN_MODE  0xfa
+
+#define MIDI_OFF_NOTE   0x80
+#define MIDI_ON_NOTE    0x90
+#define MIDI_POLY_TOUCH 0xa0
+#define MIDI_CTRL       0xb0
+#define MIDI_CH_PROGRAM 0xc0
+#define MIDI_TOUCH      0xd0
+#define MIDI_BEND       0xe0
+
+#ifdef UNIX_IRIX_MIDIFNS
+#define CMT_MIDI_SYSEX  0xf0
+#define CMT_MIDI_EOX    0xf7
+#else
+#define MIDI_SYSEX      0xf0
+#define MIDI_EOX        0xf7
+#endif
+#define MIDI_Q_FRAME	0xf1
+#define MIDI_SONG_POINTER 0xf2
+#define MIDI_SONG_SELECT 0xf3
+#define MIDI_F4		0xf4
+#define MIDI_F5		0xf5
+#define MIDI_TUNE_REQ	0xf6
+#define MIDI_TIME_CLOCK 0xf8
+#define MIDI_F9		0xf9
+#define MIDI_START      0xfa
+#define MIDI_CONTINUE	0xfb
+#define MIDI_STOP       0xfc
+#define MIDI_FD		0xfd
+#define MIDI_ACTIVE_SENSING 0xfe
+#define MIDI_SYS_RESET  0xff
+
+#define MIDI_LOCAL	0x7a
+#define MIDI_LOCAL_OFF	0x00
+#define MIDI_LOCAL_ON	0x7f
+#define MIDI_ALL_OFF	0x7b
+#define MIDI_OMNI_OFF	0x7c
+#define MIDI_OMNI_ON	0x7d
+#define MIDI_MONO_ON	0x7e
+#define MIDI_POLY_ON	0x7f
diff --git a/lib-src/libnyquist/nyquist/cmt/midierr.h b/lib-src/libnyquist/nyquist/cmt/midierr.h
new file mode 100644
index 0000000..d00ce4c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midierr.h
@@ -0,0 +1,17 @@
+/* midierr.h -- error codes */
+
+#define NESTERR 1 	/* nested interrupts */
+#define BUFFOVFL 2	/* input buffer overflow */
+#define CMDERR 3	/* unknown command from mpu-401 */
+#define TIMEOUTERR 4	/* interface timeout */
+#define MSGERR 5	/* invalid message */
+#define SYSEXOVFL 6	/* sysex buffer overflow */
+#define MEMERR 7	/* internal out of memory */
+#define RECVERR 8	/* receive error or device buffer overflow */
+#define MIDIMGRERR 9	/* error reported by midi manager (Macintosh) */
+
+#define SYSEX_ERR ((1<<RECVERR) | (1<<MEMERR) | (1<<SYSEXOVFL))
+extern short midi_error_flags;
+
+void midi_show_errors(void);
+
diff --git a/lib-src/libnyquist/nyquist/cmt/midifile.c b/lib-src/libnyquist/nyquist/cmt/midifile.c
new file mode 100644
index 0000000..0ec1137
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midifile.c
@@ -0,0 +1,618 @@
+/*
+ * Read a Standard MIDI File.  Externally-assigned function pointers are
+ * called upon recognizing things in the file.  See midifile(3).
+ */
+
+/*****************************************************************************
+* Change Log
+*   Date    | who : Change
+*-----------+-----------------------------------------------------------------
+*  2-Mar-92 | GWL : created changelog; MIDIFILE_ERROR to satisfy compiler
+* 28-Apr-03 | DM  : changed #includes and give return types for portability
+*****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "mfmidi.h"
+#include "midifile.h"
+#include "cext.h"
+#include "userio.h"
+#include "string.h"
+
+#define MIDIFILE_ERROR -1
+
+#ifdef PROTOTYPES
+#define NOARGS void
+#else
+#define NOARGS
+#endif
+
+/* public stuff */
+extern int abort_flag;
+
+/* Functions to be called while processing the MIDI file. */
+void (*Mf_starttrack)(NOARGS) = 0;
+void (*Mf_endtrack)(NOARGS) = 0;
+int (*Mf_getc)(NOARGS) = 0;
+void (*Mf_eot)(NOARGS) = 0;
+#ifdef PROTOTYPES
+void (*Mf_error)(char *) = 0;
+void (*Mf_header)(int,int,int) = 0;
+void (*Mf_on)(int,int,int) = 0;
+void (*Mf_off)(int,int,int) = 0;
+void (*Mf_pressure)(int,int,int) = 0;
+void (*Mf_controller)(int,int,int) = 0;
+void (*Mf_pitchbend)(int,int,int) = 0;
+void (*Mf_program)(int,int) = 0;
+void (*Mf_chanpressure)(int,int) = 0;
+void (*Mf_sysex)(int,char*) = 0;
+void (*Mf_arbitrary)(int,char*) = 0;
+void (*Mf_metamisc)(int,int,char*) = 0;
+void (*Mf_seqnum)(int) = 0;
+void (*Mf_smpte)(int,int,int,int,int) = 0;
+void (*Mf_timesig)(int,int,int,int) = 0;
+void (*Mf_tempo)(int) = 0;
+void (*Mf_keysig)(int,int) = 0;
+void (*Mf_sqspecific)(int,char*) = 0;
+void (*Mf_text)(int,int,char*) = 0;
+#else
+void (*Mf_error)() = 0;
+void (*Mf_header)() = 0;
+void (*Mf_on)() = 0;
+void (*Mf_off)() = 0;
+void (*Mf_pressure)() = 0;
+void (*Mf_controller)() = 0;
+void (*Mf_pitchbend)() = 0;
+void (*Mf_program)() = 0;
+void (*Mf_chanpressure)() = 0;
+void (*Mf_sysex)() = 0;
+void (*Mf_arbitrary)() = 0;
+void (*Mf_metamisc)() = 0;
+void (*Mf_seqnum)() = 0;
+void (*Mf_smpte)() = 0;
+void (*Mf_tempo)() = 0;
+void (*Mf_timesig)() = 0;
+void (*Mf_keysig)() = 0;
+void (*Mf_sqspecific)() = 0;
+void (*Mf_text)() = 0;
+#endif
+
+int Mf_nomerge = 0;             /* 1 => continue'ed system exclusives are */
+                                /* not collapsed. */
+long Mf_currtime = 0L;          /* current time in delta-time units */
+int Mf_skipinit = 0;            /* 1 if initial garbage should be skipped */
+
+/* private stuff */
+
+static long Mf_toberead = 0L;
+
+static long readvarinum(NOARGS);
+static long read32bit(NOARGS);
+static int read16bit(NOARGS);
+static void msgenlarge(NOARGS);
+static char *msg(NOARGS);
+static int readheader(NOARGS);
+static void readtrack(NOARGS);
+static void sysex(NOARGS), msginit(NOARGS);
+static int egetc(NOARGS);
+static int msgleng(NOARGS);
+
+#ifdef PROTOTYPES
+static int readmt(char*,int);
+static long to32bit(int,int,int,int);
+static int to16bit(int,int);
+static void mferror(char *);
+static void badbyte(int);
+static void metaevent(int);
+static void msgadd(int);
+static void chanmessage(int,int,int);
+#else
+static long to32bit();
+static int to16bit();
+static void mferror();
+static void badbyte();
+static void metaevent();
+static void msgadd();
+static void chanmessage();
+#endif
+
+static int midifile_error;
+
+void
+midifile()              /* The only non-static function in this file. */
+{
+        int ntrks;
+        midifile_error = 0;
+
+        if ( Mf_getc == 0 ) {
+                mferror("mf.h() called without setting Mf_getc"); 
+                return;
+        }
+        ntrks = readheader();
+        if (midifile_error) return;
+        if ( ntrks <= 0 ) {
+                mferror("No tracks!");
+                /* no need to return since midifile_error is set */
+        }
+        while ( ntrks-- > 0 && !midifile_error && !check_aborted())
+                readtrack();
+        if (check_aborted()) {
+                mferror("Midifile read aborted\n\
+\tthe rest of your file will be ignored.\n");
+            if (abort_flag == BREAK_LEVEL) abort_flag = 0;
+        }
+}
+
+static int
+readmt(s,skip)          /* read through the "MThd" or "MTrk" header string */
+char *s;
+int skip;               /* if 1, we attempt to skip initial garbage. */
+{
+        int nread = 0;
+        char b[4];
+        char buff[32];
+        int c;
+        char *errmsg = "expecting ";
+
+    retry:
+        while ( nread<4 ) {
+                c = (*Mf_getc)();
+                if ( c == EOF ) {
+                        errmsg = "EOF while expecting ";
+                        goto err;
+                }
+                b[nread++] = c;
+        }
+        /* See if we found the 4 characters we're looking for */
+        if ( s[0]==b[0] && s[1]==b[1] && s[2]==b[2] && s[3]==b[3] )
+                return(0);
+        if ( skip ) {
+                /* If we are supposed to skip initial garbage, */
+                /* try again with the next character. */
+                b[0]=b[1];
+                b[1]=b[2];
+                b[2]=b[3];
+                nread = 3;
+                goto retry;
+        }
+    err:
+        (void) strcpy(buff,errmsg);
+        (void) strcat(buff,s);
+        mferror(buff);
+        return(0);
+}
+
+static int
+egetc()                 /* read a single character and abort on EOF */
+{
+        int c = (*Mf_getc)();
+
+        if ( c == EOF ) {
+                mferror("premature EOF");
+                return EOF;
+        }
+        Mf_toberead--;
+        return(c);
+}
+
+static int
+readheader()            /* read a header chunk */
+{
+        int format, ntrks, division;
+
+        if ( readmt("MThd",Mf_skipinit) == EOF )
+                return(0);
+
+        Mf_toberead = read32bit();
+        if (midifile_error) return MIDIFILE_ERROR;
+        format = read16bit();
+        if (midifile_error) return MIDIFILE_ERROR;
+        ntrks = read16bit();
+        if (midifile_error) return MIDIFILE_ERROR;
+        division = read16bit();
+        if (midifile_error) return MIDIFILE_ERROR;
+
+        if ( Mf_header )
+                (*Mf_header)(format,ntrks,division);
+
+        /* flush any extra stuff, in case the length of header is not 6 */
+        while ( Mf_toberead > 0 && !midifile_error)
+                (void) egetc();
+        return(ntrks);
+}
+
+static void
+readtrack()              /* read a track chunk */
+{
+        /* This array is indexed by the high half of a status byte.  It's */
+        /* value is either the number of bytes needed (1 or 2) for a channel */
+        /* message, or 0 (meaning it's not  a channel message). */
+        static int chantype[] = {
+                0, 0, 0, 0, 0, 0, 0, 0,         /* 0x00 through 0x70 */
+                2, 2, 2, 2, 1, 1, 2, 0          /* 0x80 through 0xf0 */
+        };
+        long lookfor, lng;
+        int c, c1, type;
+        int sysexcontinue = 0;  /* 1 if last message was an unfinished sysex */
+        int running = 0;        /* 1 when running status used */
+        int status = 0;         /* (possibly running) status byte */
+        int needed;
+
+        if ( readmt("MTrk",0) == EOF )
+                return;
+
+        Mf_toberead = read32bit();
+
+        if (midifile_error) return;
+
+        Mf_currtime = 0L;
+
+        if ( Mf_starttrack ){
+
+                (*Mf_starttrack)();
+        }
+        while ( Mf_toberead > 0 ) {
+
+                Mf_currtime += readvarinum();   /* delta time */
+                if (midifile_error) return;
+
+                c = egetc(); if (midifile_error) return;
+
+                if ( sysexcontinue && c != 0xf7 ) {
+                        mferror("didn't find expected continuation of a sysex");
+                        return;
+                }
+                if ( (c & 0x80) == 0 ) {         /* running status? */
+                        if ( status == 0 ) {
+                                mferror("unexpected running status");
+                                return;
+                        }
+                        running = 1;
+                }
+                else {
+                        status = c;
+                        running = 0;
+                }
+
+                needed = chantype[ (status>>4) & 0xf ];
+
+                if ( needed ) {         /* ie. is it a channel message? */
+
+                        if ( running )
+                                c1 = c;
+                        else {
+                                c1 = egetc();
+                                if (midifile_error) return;
+                        }
+                        chanmessage( status, c1, (needed>1) ? egetc() : 0 );
+                        if (midifile_error) return;
+                        continue;;
+                }
+
+                switch ( c ) {
+
+                case 0xff:                      /* meta event */
+
+                        type = egetc();
+                        if (midifile_error) return;
+                        /* watch out - Don't combine the next 2 statements */
+                        lng = readvarinum();
+                        if (midifile_error) return;
+                        lookfor = Mf_toberead - lng;
+                        msginit();
+
+                        while ( Mf_toberead > lookfor ) {
+                                char c = egetc();
+                                if (midifile_error) return;
+                                msgadd(c);
+                        }
+                        metaevent(type);
+                        break;
+
+                case 0xf0:              /* start of system exclusive */
+
+                        /* watch out - Don't combine the next 2 statements */
+                        lng = readvarinum();
+                        if (midifile_error) return;
+                        lookfor = Mf_toberead - lng;
+                        msginit();
+                        msgadd(0xf0);
+
+                        while ( Mf_toberead > lookfor ) {
+                                c = egetc();
+                                if (midifile_error) return;
+                                msgadd(c);
+                        }
+                        if ( c==0xf7 || Mf_nomerge==0 )
+                                sysex();
+                        else
+                                sysexcontinue = 1;  /* merge into next msg */
+                        break;
+
+                case 0xf7:      /* sysex continuation or arbitrary stuff */
+
+                        /* watch out - Don't combine the next 2 statements */
+                        lng = readvarinum();
+                        if (midifile_error) return;
+                        lookfor = Mf_toberead - lng;
+
+                        if ( ! sysexcontinue )
+                                msginit();
+
+                        while ( Mf_toberead > lookfor ) {
+                                c = egetc();
+                                if (midifile_error) return;
+                                msgadd(c);
+                        }
+                        if ( ! sysexcontinue ) {
+                                if ( Mf_arbitrary )
+                                        (*Mf_arbitrary)(msgleng(),msg());
+                        }
+                        else if ( c == 0xf7 ) {
+                                sysex();
+                                sysexcontinue = 0;
+                        }
+                        break;
+                default:
+
+                        badbyte(c);
+
+                        break;
+                }
+        }
+        if ( Mf_endtrack )
+                (*Mf_endtrack)();
+        return;
+}
+
+static void
+badbyte(c)
+int c;
+{
+        char buff[32];
+
+        (void) sprintf(buff,"unexpected byte: 0x%02x",c);
+        mferror(buff);
+}
+
+static void
+metaevent(type)
+{
+        int leng = msgleng();
+        char *m = msg();
+
+        switch  ( type ) {
+        case 0x00:
+                if ( Mf_seqnum )
+                        (*Mf_seqnum)(to16bit(m[0],m[1]));
+                break;
+        case 0x01:      /* Text event */
+        case 0x02:      /* Copyright notice */
+        case 0x03:      /* Sequence/Track name */
+        case 0x04:      /* Instrument name */
+        case 0x05:      /* Lyric */
+        case 0x06:      /* Marker */
+        case 0x07:      /* Cue point */
+        case 0x08:
+        case 0x09:
+        case 0x0a:
+        case 0x0b:
+        case 0x0c:
+        case 0x0d:
+        case 0x0e:
+        case 0x0f:
+                /* These are all text events */
+                if ( Mf_text )
+                        (*Mf_text)(type,leng,m);
+                break;
+        case 0x2f:      /* End of Track */
+                if ( Mf_eot )
+                        (*Mf_eot)();
+                break;
+        case 0x51:      /* Set tempo */
+                if ( Mf_tempo )
+                        (*Mf_tempo)(to32bit(0,m[0],m[1],m[2]));
+                break;
+        case 0x54:
+                if ( Mf_smpte )
+                        (*Mf_smpte)(m[0],m[1],m[2],m[3],m[4]);
+                break;
+        case 0x58:
+                if ( Mf_timesig )
+                        (*Mf_timesig)(m[0],m[1],m[2],m[3]);
+                break;
+        case 0x59:
+                if ( Mf_keysig )
+                        (*Mf_keysig)(m[0],m[1]);
+                break;
+        case 0x7f:
+                if ( Mf_sqspecific )
+                        (*Mf_sqspecific)(leng,m);
+                break;
+        default:
+                if ( Mf_metamisc )
+                        (*Mf_metamisc)(type,leng,m);
+        }
+}
+
+static void
+sysex()
+{
+        if ( Mf_sysex )
+                (*Mf_sysex)(msgleng(),msg());
+}
+
+static void
+chanmessage(status,c1,c2)
+int status;
+int c1, c2;
+{
+        int chan = status & 0xf;
+
+        switch ( status & 0xf0 ) {
+        case NOTEOFF:
+                if ( Mf_off )
+                        (*Mf_off)(chan,c1,c2);
+                break;
+        case NOTEON:
+                if ( Mf_on )
+                        (*Mf_on)(chan,c1,c2);
+                break;
+        case PRESSURE:
+                if ( Mf_pressure )
+                        (*Mf_pressure)(chan,c1,c2);
+                break;
+        case CONTROLLER:
+                if ( Mf_controller )
+                        (*Mf_controller)(chan,c1,c2);
+                break;
+        case PITCHBEND:
+                if ( Mf_pitchbend )
+                        (*Mf_pitchbend)(chan,c1,c2);
+                break;
+        case PROGRAM:
+                if ( Mf_program )
+                        (*Mf_program)(chan,c1);
+                break;
+        case CHANPRESSURE:
+                if ( Mf_chanpressure )
+                        (*Mf_chanpressure)(chan,c1);
+                break;
+        }
+}
+
+/* readvarinum - read a varying-length number, and return the */
+/* number of characters it took. */
+
+static long
+readvarinum()
+{
+        long value;
+        int c;
+
+        c = egetc();
+        if (midifile_error) return 0;
+
+        value = (long) c;
+        if ( c & 0x80 ) {
+                value &= 0x7f;
+                do {
+                        c = egetc();
+                        if (midifile_error) return 0;
+                        value = (value << 7) + (c & 0x7f);
+                } while (c & 0x80);
+        }
+        return (value);
+}
+
+static long
+to32bit(c1,c2,c3,c4)
+{
+        long value = 0L;
+
+        value = (c1 & 0xff);
+        value = (value<<8) + (c2 & 0xff);
+        value = (value<<8) + (c3 & 0xff);
+        value = (value<<8) + (c4 & 0xff);
+        return (value);
+}
+
+static int
+to16bit(c1,c2)
+int c1, c2;
+{
+        return ((c1 & 0xff ) << 8) + (c2 & 0xff);
+}
+
+static long
+read32bit()
+{
+        int c1, c2, c3, c4;
+
+        c1 = egetc(); if (midifile_error) return 0;
+        c2 = egetc(); if (midifile_error) return 0;
+        c3 = egetc(); if (midifile_error) return 0;
+        c4 = egetc(); if (midifile_error) return 0;
+        return to32bit(c1,c2,c3,c4);
+}
+
+static int
+read16bit()
+{
+        int c1, c2;
+        c1 = egetc(); if (midifile_error) return 0;
+        c2 = egetc(); if (midifile_error) return 0;
+        return to16bit(c1,c2);
+}
+
+static void
+mferror(s)
+char *s;
+{
+        if ( Mf_error )
+                (*Mf_error)(s);
+        midifile_error = 1;
+}
+
+/* The code below allows collection of a system exclusive message of */
+/* arbitrary length.  The Msgbuff is expanded as necessary.  The only */
+/* visible data/routines are msginit(), msgadd(), msg(), msgleng(). */
+
+#define MSGINCREMENT 128
+static char *Msgbuff = 0;       /* message buffer */
+static int Msgsize = 0;         /* Size of currently allocated Msg */
+static int Msgindex = 0;        /* index of next available location in Msg */
+
+static void
+msginit()
+{
+        Msgindex = 0;
+}
+
+static char *
+msg()
+{
+        return(Msgbuff);
+}
+
+static int
+msgleng()
+{
+        return(Msgindex);
+}
+
+static void
+msgadd(c)
+int c;
+{
+        /* If necessary, allocate larger message buffer. */
+        if ( Msgindex >= Msgsize )
+                msgenlarge();
+        Msgbuff[Msgindex++] = c;
+}
+
+static void
+msgenlarge()
+{
+        char *newmess;
+        char *oldmess = Msgbuff;
+        int oldleng = Msgsize;
+
+        Msgsize += MSGINCREMENT;
+        newmess = MALLOC((sizeof(char)*Msgsize) );
+
+        /* copy old message into larger new one */
+        if ( oldmess != 0 ) {
+                register char *p = newmess;
+                register char *q = oldmess;
+                register char *endq = &oldmess[oldleng];
+
+                for ( ; q!=endq ; p++,q++ )
+                        *p = *q;
+                free(oldmess);
+        }
+        Msgbuff = newmess;
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/midifile.h b/lib-src/libnyquist/nyquist/cmt/midifile.h
new file mode 100644
index 0000000..f81f1e1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midifile.h
@@ -0,0 +1,27 @@
+extern void midifile();
+extern int (*Mf_getc)();
+extern void (*Mf_header)();
+extern void (*Mf_starttrack)();
+extern void (*Mf_endtrack)();
+extern void (*Mf_on)();
+extern void (*Mf_off)();
+extern void (*Mf_pressure)();
+extern void (*Mf_controller)();
+extern void (*Mf_pitchbend)();
+extern void (*Mf_program)();
+extern void (*Mf_chanpressure)();
+extern void (*Mf_sysex)();
+extern void (*Mf_metamisc)();
+extern void (*Mf_sqspecific)();
+extern void (*Mf_seqnum)();
+extern void (*Mf_text)();
+extern void (*Mf_eot)();
+extern void (*Mf_timesig)();
+extern void (*Mf_smpte)();
+extern void (*Mf_tempo)();
+extern void (*Mf_keysig)();
+extern void (*Mf_arbitrary)();
+extern void (*Mf_error)();
+extern long Mf_currtime;
+extern int Mf_nomerge;
+extern int Mf_skipinit;
diff --git a/lib-src/libnyquist/nyquist/cmt/midifns.c b/lib-src/libnyquist/nyquist/cmt/midifns.c
new file mode 100644
index 0000000..f1dba20
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midifns.c
@@ -0,0 +1,1879 @@
+/*****************************************************************************
+*                            midifns.c
+* Copyright 1989 Carnegie Mellon University
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+* 29-Mar-88 | Created from IBM PC version of mpu.c
+*           | Added settime()
+* 02-May-88 | AMIGA  2000 version. portable version.
+* 12-Oct-88 | JCD : Exclusive AMIGA Version.
+* 13-Apr-89 | JCD : New portable version.
+* 19-Apr-89 | JCD : Amiga CAMD Version added.
+*  5-Apr-91 | JDW : Further modification
+* 17-Feb-92 | GWL : incorporate JMN's new mpu.c
+*  8-Jun-92 | JDZ : add support for ITC midi interface
+* 16-Dec-92 | RBD : replace JMN's mpu.c with LMS's mpu.c
+* 11-Mar-94 | PLu : port to  IRIX
+* 25-Apr-97 | RBD : it looks like SGI changed their interface.  I
+*	        |       made it compile again, but MIDI does not work, so
+*	        |       took out calls to actually send/recv MIDI data
+* 28-Apr-03 | DM  : Renamed random -> cmtrand, true->TRUE, false->FALSE
+*           |       Use features rather than system names in #ifdef's
+*****************************************************************************/
+
+#include "switches.h"
+
+#ifdef UNIX
+#include <sys/param.h>
+#ifndef OPEN_MAX
+/* this is here for compiling the UNIX version under AIX. This is a BSDism */
+#define OPEN_MAX 2000
+#endif /* OPEN_MAX */
+#endif /* UNIX */
+
+#ifdef UNIX_MACH
+#include "machmidi.h"
+#endif
+
+
+#ifdef AMIGA
+#ifdef AZTEC
+#include "functions.h"
+#endif /* AZTEC */
+#include "midi/camd.h"
+#include "clib/camd_protos.h"
+/* note: azt_camd_pragmas.h was produced by running MAPFD on the
+ * lib/camd_lib.fd file included in the CAMD disk from Commodore.
+ * The "CamdClient" calls are manually removed from 
+ */
+#ifdef AZTEC
+#include "pragmas/azt_camd_pragmas.h"
+#else /* !AZTEC */
+#include "pragmas/lat_camd_pragmas.h"
+#endif /* AZTEC */
+#include "camdmidi.h"
+#include "ctype.h"
+#endif /* AMIGA */
+
+#ifdef UNIX_IRIX
+/* #define UNIX_IRIX_MIDIFNS -- this would enable actual midi I/O
+ * if the actual midi I/O code worked
+ */
+/* IRIX changed the MIDI interface,
+ * retain this for older systems:
+ */
+#ifdef UNIX_IRIX_MIDIFNS
+#include <dmedia/midi.h>
+#endif
+#endif
+
+#include "stdio.h"
+#include "cext.h"
+#include "midicode.h"
+#include "cmdline.h"
+#include "pitch.h"
+#include "midifns.h"
+#include "userio.h"
+#include "string.h"
+#ifdef MACINTOSH_OR_DOS
+#ifndef WINDOWS
+#include "midibuff.h"
+#endif
+#endif
+
+#ifdef UNIX_ITC /* was ITC */
+#include "sys/param.h"
+/* since boolean is defined, block its definition in midistruct.h.
+ * CMT defines boolean as ushort, but midistruct.h uses int.  
+ * This is not a problem on RS/6000s, but beware!
+ */
+/* the following would be included if we had the BSD switch set.  I think
+   we should try to avoid BSDisms; when fixed, the following should be
+   removed
+ */
+#define NBBY 8
+#include "sys/select.h" /* defines fd_set */
+#define MIDI_HAS_BOOLEAN
+#include "midistruct.h"
+#include "cmtio.h"
+#endif /* UNIX_ITC */
+
+#ifdef  DOS
+#ifndef WINDOWS
+#include "timer.h"
+#include "mpu.h"
+#endif /* ifndef WINDOWS */
+#endif /* ifdef DOS */
+
+#ifndef BREAKTEST
+#define BREAKTEST
+#endif
+
+#ifdef __APPLE__
+#include <sys/types.h>
+#include <sys/time.h>
+#include <errno.h>
+#else
+#ifdef UNIX
+#ifndef UNIX_IRIX
+#include "sys/time.h"
+#include "sys/timeb.h"
+#include "cmtio.h"
+#else
+#include <sys/types.h>
+#include <sys/time.h>
+#include <errno.h>
+
+#ifdef UNIX_IRIX_MIDIFNS
+#include <midi.h>
+#include <midiio.h>
+#endif /* UNIX_IRIX_MIDIFNS */
+#endif  /* UNIX_IRIX */
+#endif /* UNIX */
+#endif /* __APPLE__ */
+
+#ifdef ITC
+static int ignore_realtime = 0;
+#endif /* ITC */
+
+#ifdef MACINTOSH
+
+/* added for ThinkC 7: */
+#include <OSUtils.h>
+
+/* port numbers are in the range 0..MAX_PORTS-1 */
+#define CHANNELS_PER_PORT 16
+#define MAX_PORTS ((MAX_CHANNELS + CHANNELS_PER_PORT - 1) / CHANNELS_PER_PORT)
+
+/* here are some MIDIMGR specific definitions */
+#ifdef MIDIMGR
+#include "MIDI.h"
+#include "midimgr.h"
+
+#define TICKS_TO_MS(t) t
+#define MS_TO_TICKS(t) t
+
+#else
+/* here are some non-MIDIMGR definitions for the Mac */
+/****************************************************************************
+*
+*       DMH: constants from macmidi.c
+*
+****************************************************************************/
+
+/* the modem port, also called port A */
+#define portA 0
+
+/* the printer port, also called port B */
+#define portB 1
+
+/* a tick is 1/60 of a second
+ *
+ * the following tables and routines are used to convert
+ * between ticks and milliseconds
+ */
+#define TICKS_TO_MS(t)  (((t) * 50) / 3)
+#define MS_TO_TICKS(t)  (((t) * 3) / 50)
+#endif  /* def MIDIMGR */
+#endif  /* def MACINTOSH */
+
+#ifdef WINDOWS
+#define huge
+#endif
+
+/****************************************************************************
+*
+* exported flags
+*
+****************************************************************************/
+
+boolean miditrace = FALSE;      /* enables printed trace of MIDI output */
+boolean musictrace = FALSE;     /* enables printed trace of commands */
+#ifdef MACINTOSH_OR_DOS
+boolean ctrlFilter = TRUE;    /* suppress continuous controller data */
+boolean exclFilter = TRUE;    /* suppress exclusive messages */
+boolean realFilter = TRUE;    /* suppress realtime messages */
+#endif
+
+/****************************************************************************
+*
+* exported variables
+*
+****************************************************************************/
+
+public int keyloud;    /* set to velocity of last getkey event */
+/* public long error; */
+public short midi_error_flags = 0;
+
+/* The following midifns_syntax lists command line switches and options.
+   Since these are machine dependent, use conditional compilation.
+   Conditional compilation within a string is a bit tricky: you want to
+   write "\" for line continuation within the string, but "\" gets eaten
+   by the macro preprocessor.
+   That's why we define macros like AMIGAINPORT.
+   Regretably it doesn't work for all compilers.
+ */
+ 
+
+/* Lattice and RT/Unix aren't happy expanding the embedded macros below, so
+   I made a separate declaration of midifns_syntax for Unix
+ */
+#ifdef UNIX
+public char *midifns_syntax = "block<s>Turn off midi THRU;\
+    miditrace<s>Trace low-level midi functions;\
+    noalloff<s>Do not send alloff message when done;\
+    trace<s>Trace music operations;\
+    tune<o>Load a tuning file";
+#else
+#ifdef MACINTOSH
+#ifdef MIDIMGR
+public char *midifns_syntax = "miditrace<s>Trace low-level midi functions;\
+    noalloff<s>Do not send alloff message when done;\
+    patch<s>Remember/reuse Midi Mgr patches;\
+    trace<s>Trace music operations;\
+    keep<s>Keep other processes running;\
+    tune<o>Load a tuning file";
+#else /* no MIDIMGR */
+public char *midifns_syntax = "miditrace<s>Trace low-level midi functions;\
+    noalloff<s>Do not send alloff message when done;\
+    patch<s>Remember/reuse Midi Mgr patches;\
+    trace<s>Trace music operations;\
+    tune<o>Load a tuning file";		
+#endif /* MIDIMGR */
+#else 
+#ifdef AMIGA
+public char *midifns_syntax = "block<s>Turn off midi THRU;\
+    inport<o>Inpur port number;\
+    miditrace<s>Trace low-level midi functions;\
+    noalloff<s>Do not send alloff message when done;\
+    outport<o>Output port number;\
+    trace<s>Trace music operations;\
+    tune<o>Load a tuning file";
+#else /* not UNIX or MACINTOSH or MIDIMGR or AMIGA */
+#ifdef DOS
+public char *midifns_syntax = "miditrace<s>Trace low-level midi functions;\
+    noalloff<s>Do not send alloff message when done;\
+    trace<s>Trace music operations;\
+    tune<o>Load a tuning file";
+#endif /* DOS */
+#endif /* AMIGA */
+#endif /* MACINTOSH */
+#endif /* UNIX */
+
+#ifdef MACINTOSH
+boolean do_midi_thru = FALSE; /* exported: copy midi in to midi out */
+#endif
+
+
+/****************************************************************************
+*
+* local module variables
+*
+****************************************************************************/
+
+private int initialized = FALSE;   /* set by musicinit, cleared by musicterm */
+private boolean tune_flag = FALSE; /* set by musicinit, never cleared */
+#ifdef DOS
+private boolean metroflag = FALSE; /* flag to turn on metronome */
+#endif
+private int user_scale = FALSE;    /* TRUE if user-defined scale */
+private int bend[MAX_CHANNELS];    /* current pitch bend on channel */
+short cur_midi_prgm[MAX_CHANNELS];
+private pitch_table pit_tab[128];  /* scale definition */
+
+#ifdef DOS
+private ulong timeoffset = 0;
+public boolean exclerr = FALSE;
+public byte xcodemask; /* mask (00 or FF) */
+public byte xcode; /* mfr code */
+#endif
+
+#ifdef MACINTOSH_OR_DOS
+boolean sysex_pending = FALSE;
+#endif
+
+#ifdef AMIGA
+
+#define CONTCONT ((CMF_Ctrl & ~CMF_CtrlSwitch) | CMF_PitchBend | \
+        CMF_ChanPress)
+#endif  /* def AMIGA */
+
+#ifdef UNIX
+private ulong timeoffset = 0;
+#endif
+
+#ifdef UNIX_IRIX_MIDIFNS
+static MIport *miport;
+static int ignore_realtime = 0;
+
+private byte *sysex_p;
+private int sysex_n;
+#endif 
+
+#ifdef ITC
+mi_id midiconn;
+#endif
+
+#ifdef MACINTOSH
+private ulong ticksAtStart = 0L;
+    /* clock ticks at time of last musicinit or timereset
+     * ASSUME: tick clock never wraps.  this is a good assumption, since
+     * the tick clock is set to zero when the power is turned on and the
+     * tick counter is 32 bits.  the Macintosh would need to be on for
+     * 828.5 days for the tick counter to wrap around! */
+
+#endif  /* def MACINTOSH */
+
+/****************************************************************************
+*
+* functions declared in this module
+*
+****************************************************************************/
+
+private void fixup();
+private void midi_init();
+extern boolean check_ascii(); /*userio.c*/
+private void musicterm();
+
+
+/****************************************************************************
+*                alloff
+* Inputs:
+*    none
+* Effect: 
+*    Sends MIDI all notes off command on every channel.
+****************************************************************************/
+
+#define ALL_NOTES_OFF 0x7B /*DMH: from macmidi.c*/
+
+void alloff()
+{
+    int c;
+
+    if (!initialized) fixup();
+    if (musictrace)
+    gprintf(TRANS,"alloff()\n");
+    for (c = 1; c <= MAX_CHANNELS; c++) {
+    midi_write(3, MIDI_PORT(c), (byte) (0xb0 | MIDI_CHANNEL(c)), ALL_NOTES_OFF, 0);
+    }
+}
+
+
+
+/***************************************************************
+*                           eventwait
+*
+* Input : wakeup time, -1 means forever
+* Output : none
+* Return: none
+* Effect: waits until ascii or midi input or timeout
+***************************************************************/
+
+#ifdef UNIX_ITC
+void eventwait(timeout)
+  long timeout;
+{
+    struct timeval unix_timeout;
+    struct timeval *waitspec = NULL;
+    fd_set readfds;
+
+    FD_ZERO(&readfds);
+    FD_SET(MI_CONNECTION(midiconn), &readfds);
+    FD_SET(fileno(stdin), &readfds);
+    if (timeout >= 0) {
+    timeout -= gettime();   /* convert to millisecond delay */
+    unix_timeout.tv_sec = timeout / 1000;
+    /* remainder become microsecs: */
+    unix_timeout.tv_usec = (timeout - (unix_timeout.tv_sec * 1000)) * 1000;
+    waitspec = &unix_timeout;
+    }
+    select(NOFILE+1, &readfds, 0, 0, waitspec);
+    return;
+}
+#else /* !UNIX_ITC */
+#ifdef UNIX
+/* see machmidi.c for UNIX_MACH implementation */
+#ifndef UNIX_MACH
+#ifdef UNIX_IRIX_MIDIFNS
+void eventwait(timeout)
+  long timeout;
+{
+    struct timeval unix_timeout;
+    struct timeval *waitspec = NULL;
+    fd_set readfds;
+
+    FD_ZERO(&readfds);
+    FD_SET(mdGetFd(miport), &readfds);
+    FD_SET(fileno(stdin), &readfds);
+    if (timeout >= 0) {
+      
+        timeout -= gettime();   /* convert to millisecond delay */
+        unix_timeout.tv_sec = timeout / 1000;
+        /* remainder become microsecs: */
+        unix_timeout.tv_usec = (timeout - (unix_timeout.tv_sec * 1000)) * 1000;
+        waitspec = &unix_timeout;
+    }
+     select(FD_SETSIZE, &readfds, 0, 0, waitspec);
+
+    return;
+}
+#else
+#ifdef BUFFERED_SYNCHRONOUS_INPUT
+void eventwait(timeout)
+  long timeout;
+{
+    struct timeval unix_timeout;
+    struct timeval *waitspec = NULL;
+
+    if (timeout >= 0) {
+    timeout -= gettime();   /* convert to millisecond delay */
+    unix_timeout.tv_sec = timeout / 1000;
+    /* remainder become microsecs: */
+    unix_timeout.tv_usec = (timeout - (unix_timeout.tv_sec * 1000)) * 1000;
+    waitspec = &unix_timeout;
+    select(NOFILE+1, 0, 0, 0, waitspec);
+    } else {
+    int c = getc(stdin);
+    ungetc(c, stdin);
+    }
+    return;
+}
+#else
+void eventwait(timeout)
+  long timeout;
+{
+    struct timeval unix_timeout;
+    struct timeval *waitspec = NULL;
+    int readfds = 1 << IOinputfd;
+
+    if (timeout >= 0) {
+    timeout -= gettime();   /* convert to millisecond delay */
+    unix_timeout.tv_sec = timeout / 1000;
+    /* remainder become microsecs: */
+    unix_timeout.tv_usec = (timeout - (unix_timeout.tv_sec * 1000)) * 1000;
+    waitspec = &unix_timeout;
+    }
+    select(NOFILE+1, &readfds, 0, 0, waitspec);
+    return;
+}
+#endif /* BUFFERED_SYNCHRONOUS_INPUT */
+#endif /* UNIX_IRIX */
+#endif /* UNIX_MACH */
+#endif /* UNIX */ /* I wanted to put an else here, but this confused a Unix C compiler */
+#endif /* UNIX_ITC */
+#ifdef AMIGA
+/* see camdmidi.c for Amiga implementation */
+#else
+#ifndef UNIX /* since I couldn't use an else above, have to check UNIX here */
+#ifdef WINDOWS
+void eventwait(timeout)
+  long timeout;
+{
+    if (timeout >= 0) {
+    gprintf(TRANS, "eventwait: not implemented\n");
+    return;
+    } else {
+    int c = getc(stdin);
+    ungetc(c, stdin);
+    }
+    return;
+}
+#else
+void eventwait(timeout)
+  long timeout;
+{
+    while (timeout > gettime() || timeout == -1) {
+        if (check_ascii() || check_midi()) return;
+    }
+}
+#endif /* WINDOWS */
+#endif /* UNIX */
+#endif /* AMIGA */
+
+
+/****************************************************************************
+*                exclusive
+* Inputs:
+*    boolean onflag -- set to TRUE to receive midi exclusive data
+* Effect: 
+*    Tells module to read exclusive messages into buffer
+****************************************************************************/
+
+void exclusive(boolean onflag)
+{
+    if  (!initialized) fixup();
+    if (musictrace) gprintf(TRANS, "exclusive: %d\n", onflag);
+#ifdef AMIGA
+    if (onflag) SetMidiFilters(cmt_mi, 
+    cmt_mi->PortFilter, cmt_mi->TypeFilter | CMF_SysEx, cmt_mi->ChanFilter);
+    else SetMidiFilters(cmt_mi, 
+    cmt_mi->PortFilter, cmt_mi->TypeFilter & ~CMF_SysEx, cmt_mi->ChanFilter);
+#endif
+#ifdef  MACINTOSH_OR_DOS
+    exclFilter = !onflag;
+#endif
+}
+
+
+/****************************************************************************
+*                    fixup
+* Effect: 
+*    Print error message and call musicinit
+****************************************************************************/
+
+private void fixup()
+{
+    gprintf(ERROR, "You forgot to call musicinit.  I'll do it for you.\n");
+    musicinit();
+}
+
+#ifdef UNIX_IRIX_MIDIFNS
+private void flush_sysex(void);
+#endif
+
+long get_excl(byte *buffer, long len)
+{
+    long ret = 0;
+#ifdef UNIX_IRIX_MIDIFNS
+    byte *sxp = sysex_p;
+    long l = len;
+#endif
+#ifdef UNIX_ITC  /* was ITC */
+    ret = mi_getx(midiconn, FALSE, len, (char *) buffer);
+#endif
+#ifdef UNIX_MACH
+    ret = mi_getx(midiconn, FALSE, len, (unsigned char *)buffer);
+#endif
+#ifdef UNIX_IRIX_MIDIFNS
+    if (!sysex_p) return 0;
+    if (len > sysex_n) len = sysex_n;
+    while (l--)
+      {
+        *buffer = *(sxp++);
+        if (*(buffer++) == CMT_MIDI_EOX)
+          {
+        flush_sysex();
+        break;
+          }
+      }
+    ret = len - l - 1;
+#endif
+#ifdef AMIGA
+    ret = GetSysEx(cmt_mi, (UBYTE *) buffer, len);
+    AMIGA_ERROR_CHECK;
+#endif
+#ifdef MACINTOSH_OR_DOS
+#ifndef WINDOWS
+    /* I'm not sure the following line is a good thing: it forces the
+     * caller to wait until a full sysex message is received and the
+     * 1st 4 bytes are fetched via getbuf() before a sysex message can
+     * be read via get_excl().  Without this, both mm.c and exget.c
+     * were fetching ahead and getting out of sync with getbuf().  I
+     * fixed mm.c and exget.c to work (by checking for EOX), but I added
+     * this line (which should never have any effect) just to make the
+     * DOS interface behave more like the Amiga and Mac interfaces.  The
+     * drawback is that you can't fetch bytes until the EOX is seen,
+     * because nothing goes into the getbuf() buffer until then.
+     */
+    if (!sysex_pending) return 0;
+    while (len-- && (xbufhead != xbuftail)) {
+    *buffer = xbuff[xbufhead++];
+    ret++;
+    if (*buffer == MIDI_EOX) {
+        sysex_pending = FALSE;
+        break;
+    }
+    buffer++;
+    xbufhead &= xbufmask;
+    }
+#endif
+#endif
+    return ret;
+}
+
+/****************************************************************************
+*                   getbuf
+* Inputs:
+*    boolean waitflag: TRUE if routine should wait for data
+*    byte * p: Pointer to data destination
+* Result: boolean
+*    TRUE if data was written to *p
+*    FALSE if data not written to *p
+* Effect: 
+*    copies data from buffer to *p
+*    will wait for buffer to become nonempty if waitflag is TRUE
+*
+* Modified 24 May 1988 for AMIGA (JCD)
+****************************************************************************/
+
+#ifdef UNIX_IRIX_MIDIFNS
+    private void setup_sysex(MDevent *event, u_char *buffer);
+#endif /* UNIX_IRIX */
+boolean getbuf(boolean waitflag, unsigned char * p)
+{
+#ifdef UNIX_IRIX_MIDIFNS
+    MDevent event;
+    int ret;
+#endif /* UNIX_IRIX */
+
+    if (!initialized) fixup();
+#ifdef UNIX
+#ifdef UNIX_IRIX_MIDIFNS
+/* current IRIX version ignores the waitflag (it never waits) */
+
+  if (sysex_p) flush_sysex();
+  if (ignore_realtime == 0) {
+      ret = mdReceive(miport, &event, 1);
+      if (ret) {
+      if (event.msg[0] != 0xF0) {
+          *((u_long*) p) = *((u_long*) event.msg);
+      } else {
+          setup_sysex(&event, p);
+      }
+      }
+      return ret;
+  } else {
+      do /* skip realtime messages */
+    {
+       ret = mdReceive(miport, &event, 1);
+       if (ret == -1) return ret;
+     } while (event.msg[0] == 0xf8);
+      if (event.msg[0] != 0xF0) {
+      *((u_long*) p) = *((u_long*) event.msg);
+      } else {
+      setup_sysex(&event, p);
+      }
+      return ret;
+  }
+#endif /* UNIX_IRIX */
+#ifdef UNIX_ITC
+    if (ignore_realtime == 0) {
+        return(mi_get(midiconn, waitflag, (char *) p));
+    }
+    else {
+        boolean ret=false;
+        /* filter out realtime msgs */
+        do {
+            ret = mi_get(midiconn, waitflag, (char *) p);
+            if (ret == FALSE)
+                return(ret);
+        } while(p[0] == 0xf8);
+        return(ret);
+    }
+#else /* UNIX_ITC */
+#ifndef UNIX_IRIX
+    if (waitflag) {
+    gprintf(ERROR, "getbuf called with waitflag!");
+    EXIT(1);
+    }
+    return FALSE;
+#endif /* UNIX_IRIX */
+#endif /* UNIX_ITC */
+#endif /* UNIX */
+
+#ifdef MACINTOSH_OR_DOS
+#ifndef WINDOWS
+    if (sysex_pending) { /* flush sysex to keep buffers in sync */
+        while (xbuff[xbufhead++] != MIDI_EOX) {
+        xbufhead &= xbufmask;
+        if (xbufhead == xbuftail) break;
+        }
+        sysex_pending = FALSE;
+    }
+    if (waitflag) while (buffhead == bufftail) /* wait */ ;
+    else if (buffhead == bufftail) return(false);
+    *(long *)p = *(long *)(((char *)buff)+buffhead);
+    buffhead = (buffhead + 4) & BUFF_MASK;
+    if (*p == MIDI_SYSEX) { /* if sys-ex, remember to fetch from xbuff */
+        sysex_pending = TRUE;
+    }
+    return(true);
+#else
+    return FALSE;
+#endif /* WINDOWS */
+#endif /* MACINTOSH_OR_DOS */
+
+#ifdef AMIGA
+    if (waitflag) {
+        do {
+        WaitMidi(cmt_mi, &cmt_msg);
+        AMIGA_ERROR_CHECK;
+        } while (amigaerrflags);
+    } else {
+        AMIGA_ERROR_CHECK;
+        if (!GetMidi(cmt_mi, &cmt_msg)) return(false);
+    }    
+    *(long *)p = *(long *)&cmt_msg;
+    clearmsg(cmt_msg);
+    return(true);
+#endif /* AMIGA */
+}
+
+#ifdef UNIX_IRIX_MIDIFNS
+
+private void setup_sysex(MDevent *event, u_char *buffer)
+/* N.B. do not leak memory remember to call free(sysex_p) */
+{
+   u_char *sxp = (u_char *) event->sysexmsg;
+   int i;
+
+   for (i=0;i<4;i++)
+     *(buffer++) = *(sxp++);
+   sysex_p = event->sysexmsg;
+   sysex_n = event->msglen;
+}
+
+private void flush_sysex()
+{
+  mdFree(sysex_p);
+  sysex_p = 0;
+  sysex_n = 0;
+}
+#endif
+
+#ifdef MACINTOSH_OR_DOS
+#ifndef WINDOWS
+public boolean check_midi()
+{
+    if (buffhead == bufftail) return FALSE;
+    else return TRUE;
+}
+#endif
+#endif
+
+
+/****************************************************************************
+*                   getkey
+* Inputs:
+*    boolean waitflag: TRUE if wait until key depression, FALSE if
+*             return immediately
+* Result: int
+*    key number of key which has been depressed
+*    It returns -1 if waitflag is FALSE and no key has been pressed
+*    If waitflag is TRUE this routine will block until a key is pressed
+* Effect: 
+*    reads a key
+****************************************************************************/
+
+/*DMH: in previous version, macmidi.c subtracted 12 from msg to get key at each occurence...*/
+
+short getkey(boolean waitflag)
+{
+    byte msg[4];
+    short k;
+
+    if (!initialized) fixup();
+
+    while (TRUE) {    /* process data until you find a note */
+    /* look for data and exit if none found */
+    /* NOTE: waitflag will force waiting until data arrives */
+    if (!getbuf(waitflag, msg)) { /* nothing there */
+        k = -1;
+        break;
+    } else if ((msg[0] & MIDI_CODE_MASK) == MIDI_ON_NOTE) {
+        if (msg[2] == 0) { /* velocity 0 -> note off */
+        keyloud = 0;
+        k = msg[1] + 128;
+        } else {
+        keyloud = msg[2];
+        k = msg[1];
+        }
+        break;
+    } else if ((msg[0] & MIDI_CODE_MASK) == MIDI_OFF_NOTE) {
+        keyloud = 0;
+        k = msg[1] + 128;
+        break;
+    }
+    }
+    if (musictrace) {
+    if (k != -1) gprintf(TRANS,"getkey got %d\n", k);
+    }
+    return k;
+}
+
+
+/****************************************************************************
+*                   gettime
+* Result: ulong
+*    current timestamp since the last call to
+*    musicinit or timereset
+* Effect: 
+*    fakes it
+****************************************************************************/
+
+ulong gettime()         /*DMH: ulong is from mpu->midifns conversion, for Mac*/
+{
+#if HAS_GETTIMEOFDAY
+    struct timeval timeval;
+#endif
+#if HAS_FTIME
+    struct timeb ftime_res;
+#endif
+    register ulong ticks = 0L;
+
+    BREAKTEST    /* abort if user typed Ctrl Break */
+    if (!initialized) fixup();
+
+#ifdef MACINTOSH
+#ifdef MIDIMGR
+    ticks = MIDIGetCurTime(OutputRefNum) - ticksAtStart;
+#else
+    ticks = TickCount() - ticksAtStart;
+#endif
+    if (initialized) abort_check();     /* give user a chance to abort */
+    ticks = TICKS_TO_MS(ticks);
+#endif
+
+#ifdef AMIGA
+    ticks = (*camdtime - timeoffset) << 1;      /* return milliseconds */
+#endif
+
+#ifdef  DOS
+#ifndef WINDOWS       
+    ticks = elapsedtime(timeoffset, readtimer()); /* return milliseconds */
+    /* gprintf(TRANS, "currtime = %ld, timeoffset = %ld\n", currtime, timeoffset); */
+#endif
+#endif  /* ifdef DOS */
+
+#if HAS_GETTIMEOFDAY
+    gettimeofday(&timeval, 0);
+    ticks = timeval.tv_sec * 1000 + timeval.tv_usec / 1000 - timeoffset;
+#endif
+#if HAS_FTIME
+    ftime(&ftime_res);
+    ticks = ((ftime_res.time - timeoffset) * 1000) + ftime_res.millitm;
+#endif
+
+    /* if (miditrace) gprintf(TRANS, "."); */
+    return(ticks);
+}
+
+
+/****************************************************************************
+*                   l_rest
+* Inputs:
+*    long time: Amount of time to rest
+* Effect: 
+*    Waits until the amount of time specified has lapsed
+****************************************************************************/
+
+void l_rest(time)
+long time;
+{
+    if (!initialized) fixup();
+    l_restuntil(time + gettime());    
+}
+
+/****************************************************************************
+*                 l_restuntil
+* Inputs:
+*    long time: Event time to rest until
+* Effect: 
+*    Waits until the specified time has been reached (absolute time)
+****************************************************************************/
+
+void l_restuntil(time)
+long time;
+{
+#ifdef MACINTOSH
+    ulong now = gettime();  
+    ulong junk; /* changed from ulong for ThinkC 7, back to ulong for CW5 */
+#endif
+
+#ifdef AMIGA
+    while (time > gettime()) eventwait(time);
+#else  
+    for(; (time_type) time > gettime(););
+#endif
+
+#ifdef MACINTOSH
+    now = gettime();        
+
+    if (time > now)  Delay(MS_TO_TICKS(time - now), &junk);
+    /* else time <= now, so return immediately */
+#endif
+
+}
+
+/****************************************************************************
+*               metronome
+* Inputs:
+*    boolean onflag: TRUE or FALSE
+* Effect:
+*    enables (true) or disables (false) MPU-401 metronome function.
+*    must be called before musicinit
+****************************************************************************/
+
+void metronome(boolean onflag)
+{
+#ifdef DOS
+metroflag = onflag;
+#endif
+}
+
+
+/****************************************************************************
+*                  midi_bend
+* Inputs:
+*    int channel: midi channel on which to send data
+*    int value: pitch bend value
+* Effect: 
+*    Sends a midi pitch bend message
+****************************************************************************/
+
+void midi_bend(int channel, int value)
+{
+    if (!initialized) fixup();
+    if (musictrace)
+    gprintf(TRANS,"midi_bend: ch %d, val %d\n", channel, value - (1 << 13));
+        bend[MIDI_CHANNEL(channel)] = value;
+    
+    midi_write(3, MIDI_PORT(channel), (byte) (MIDI_BEND | MIDI_CHANNEL(channel)),
+        (byte) MIDI_DATA(value), (byte) MIDI_DATA(value >> 7));
+}
+
+
+/****************************************************************************
+*               midi_buffer
+* Inputs:
+*    byte * buffer: the buffer address
+*    int size: number of bytes in buffer
+* Returns:
+*    FALSE if size is less than 16 or buffer is NULL, otherwise TRUE
+* Effect: DOS, MAC:
+*    tells interrupt routine to store system exclusive messages in
+*    buffer.     The largest power of 2 bytes less than size will be
+*    used.  xbufhead and xbuftail will be initialized to zero,
+*    and xbuftail will be one greater than the index of the last
+*    system exclusive byte read.  Since there may already be a buffer
+*    and therefore the normal midi message buffer may have the first
+*    4 bytes of some sysex messages, clear the normal midi buffer too.
+* AMIGA:
+*    adds buffer to midi interface
+*
+****************************************************************************/
+
+boolean midi_buffer(byte huge *buffer, ulong size)
+{
+    if (!buffer) return FALSE;
+#ifdef AMIGA
+    if (!SetSysExQueue(cmt_mi, (UBYTE *) buffer, (ULONG) size)) return(false);
+    cu_register(remove_sysex_buffer, buffer);
+#endif
+
+#ifdef MACINTOSH_OR_DOS
+#ifndef WINDOWS
+    {
+    int mask = 0x000F;
+
+    if (size < 16) return(false);
+    while (mask < size && mask > 0) mask = ((mask << 1) | 1);
+    midi_flush();
+    xbuff = NULL;    /* turn off buffering */
+    xbufmask = mask >> 1;
+    xbufhead = xbuftail = 0;
+    xbuff = buffer;    /* set buffer, turn on buffering */
+    }
+#endif
+#endif
+#ifdef UNIX
+    return FALSE;
+#else
+    exclusive(TRUE);
+    return TRUE;
+#endif
+}
+
+
+/* midi_clock -- send a midi time clock message */
+/**/
+void midi_clock()
+{
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS, "+");
+    midi_write(1, 0, MIDI_TIME_CLOCK, 0, 0);
+}
+
+
+/****************************************************************************
+*               midi_cont
+* Inputs:
+*    boolean onflag: TRUE or FALSE
+* Effect:
+*    enables (true) or disables (false) continuous control
+****************************************************************************/
+
+void midi_cont(boolean onflag)
+{
+    if (!initialized) fixup();
+    if (onflag) {
+#ifdef AMIGA
+    SetMidiFilters(cmt_mi, cmt_mi->PortFilter, 
+        cmt_mi->TypeFilter | CONTCONT, cmt_mi->ChanFilter);
+#endif
+#ifdef  DOS
+#ifndef WINDOWS
+    mPutCmd(BENDERON);
+#endif
+#endif
+    } else {
+#ifdef AMIGA
+    SetMidiFilters(cmt_mi, cmt_mi->PortFilter,
+        cmt_mi->TypeFilter & ~CONTCONT, cmt_mi->ChanFilter);
+#endif
+    }
+#ifdef MACINTOSH_OR_DOS
+    ctrlFilter = !onflag;
+#endif
+    if (musictrace) gprintf(TRANS,"midi_cont: %d\n", onflag);
+}
+
+
+/****************************************************************************
+*                  midi_ctrl
+* Inputs:
+*    int channel: midi channel on which to send data
+*    int control: control number
+*    int value: control value
+* Effect: 
+*    Sends a midi control change message
+****************************************************************************/
+
+void midi_ctrl(int channel, int control, int value)
+{
+    if (!initialized) fixup();
+    if (musictrace)
+    gprintf(TRANS,"midi_ctrl: ch %d, ctrl %d, val %d\n",
+        channel, control, value);
+
+    midi_write(3, MIDI_PORT(channel), (byte) (MIDI_CTRL | MIDI_CHANNEL(channel)), 
+          (byte) MIDI_DATA(control), (byte) MIDI_DATA(value));
+}
+
+
+/****************************************************************************
+*                midi_exclusive
+* Inputs:
+*    byte *msg: pointer to a midi exclusive message, terminated by 0xF7
+* Effect: 
+*    Sends a midi exclusive message
+* Bugs:
+*   18-mar-94 PLu : This function does not know which port to send to in
+*                    case of multiple midi-ports (MAC, IRIX)
+****************************************************************************/
+
+#ifdef MACINTOSH
+#define INTERBYTE_DELAY 10
+#endif
+
+void midi_exclusive(msg)
+unsigned char *msg; /* the data to be sent */
+{
+#ifdef ITC
+    int count, done, tosend, willsend;
+    unsigned char *m;
+    mi_status ret;
+#endif
+#ifdef UNIX_IRIX_MIDIFNS
+    unsigned char *m;
+    MDevent mdevent;
+#endif
+
+#ifdef MACINTOSH
+#ifndef NYQUIST
+    int i;                      /* for DX7 delay loop */
+    int count = 0;      /* counter for formatting midi byte trace */
+    MIDIPacket TheMIDIPacket;
+    unsigned char prev = 0;
+    boolean first_packet = TRUE;
+#endif
+#endif
+
+    /*
+     *  if user mistakenly called midi_exclusive instead of exclusive,
+     *  the argument will be TRUE or FALSE, both of which are highly    
+     *  unlikely valid arguments for midi_exclusive:
+     */
+
+    if (msg == (byte *) FALSE || msg == (byte *) TRUE) {
+    gprintf(ERROR,"midi_exclusive: invalid argument %u.\n", msg);
+    EXIT(1);
+    }
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS,"midi_exclusive\n");
+
+#ifdef AMIGA
+    PutSysEx(cmt_mi, msg);
+#endif
+#ifdef MACINTOSH
+#ifndef NYQUIST /* if NYQUIST, do nothing */
+#ifdef MIDIMGR
+    while (prev != MIDI_EOX) {
+    int len = 0;
+    while (prev != MIDI_EOX && len < 249) {
+        TheMIDIPacket.data[len++] = prev = *msg++;
+    }
+    TheMIDIPacket.len = 6 + len;
+    TheMIDIPacket.tStamp = 0;
+    if (first_packet && (prev != MIDI_EOX)) {
+        TheMIDIPacket.flags = midiTimeStampCurrent + midiStartCont;
+        first_packet = FALSE;
+    } else if (first_packet) {
+        TheMIDIPacket.flags = midiTimeStampCurrent + midiNoCont;
+    } else if (prev == MIDI_EOX) {
+        TheMIDIPacket.flags = midiTimeStampCurrent + midiEndCont;
+    } else {
+        TheMIDIPacket.flags = midiTimeStampCurrent + midiMidCont;
+    }               
+    MIDIWritePacket(OutputRefNum, &TheMIDIPacket);
+    }
+#else
+    while (*msg != MIDI_EOX) {
+    Xmit(0, *msg);
+    msg++;
+    count++;
+    /* this is a delay loop, without which your DX7 will crash */
+    for (i = INTERBYTE_DELAY; i > 0; i--)
+        abort_check();
+    }
+    Xmit(0, MIDI_EOX);
+#endif /* MIDIMGR */
+#endif /* NYQUIST */
+#endif /* MACINTOSH */
+
+#ifdef DOS
+#ifndef WINDOWS
+    do {
+    mPutData(*msg);
+    } while (*msg++ != MIDI_EOX);
+#endif
+#endif
+#ifdef ITC
+    for (m = msg, tosend = 1; (*m) != MIDI_EOX; m++, tosend++);
+    for (count = 0; count < tosend; count += done) {
+    willsend = min(16384, tosend);
+    ret = mi_exclusive(midiconn, 1, msg, (short) willsend);
+    if (ret != MI_SUCCESS) {
+        gprintf(GWARN, "Got %d from mi_exclusive\n", ret);
+    }
+    done = willsend;
+    }
+#endif
+#ifdef UNIX_IRIX_MIDIFNS
+/* we don't know which device to sent SYSEX messages to so port zero is
+   assumed. */
+    for (m = msg, mdevent.msglen = 1; (*m) != CMT_MIDI_EOX; m++, mdevent.msglen++);
+    mdevent.sysexmsg = msg;
+    if (mdSend(miport, &mdevent, 1) == -1) {
+      gprintf(GWARN, "could not send SYSEX message\n");
+    }
+#endif
+
+    if (miditrace) {
+    do { gprintf(TRANS, "~%2x", *msg);
+#ifdef UNIX_IRIX_MIDIFNS
+        } while (*msg++ != CMT_MIDI_EOX);
+#else
+        } while (*msg++ != MIDI_EOX);
+#endif
+    }
+}
+
+
+/****************************************************************************
+*                  midi_note
+* Inputs:
+*    int channel: midi channel on which to send data
+*    int pitch: midi pitch code
+*    int velocity: velocity with which to sound it (0=> release)
+* Effect: 
+*    Sends a midi note-play request out
+****************************************************************************/
+
+void midi_note(int channel, int pitch, int velocity)
+{
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS,"midi_note: ch %d, key %d, vel %d\n",
+    channel, pitch, velocity);
+    if (user_scale) {
+    /* check for correct pitch bend */
+    if ((pit_tab[pitch].pbend != bend[MIDI_CHANNEL(channel)]) 
+        && (velocity != 0)) {
+        midi_bend(channel, pit_tab[pitch].pbend);
+        bend[channel] = pit_tab[pitch].pbend;
+    }
+    pitch = pit_tab[pitch].ppitch;  
+    }
+    midi_write(3, MIDI_PORT(channel), (byte) (MIDI_ON_NOTE | MIDI_CHANNEL(channel)),
+          (byte) MIDI_DATA(pitch), (byte) MIDI_DATA(velocity));
+}
+
+
+/****************************************************************************
+*                midi_program
+* Inputs:
+*    int channel: Channel on which to send midi program change request
+*    int program: Program number to send (decremented by 1 before
+*           being sent as midi data)
+* Effect: 
+*    Sends a program change request out the channel
+****************************************************************************/
+
+void midi_program(int channel, int program)
+{
+#ifdef MACINTOSH
+    int port, midi_chan;
+#endif
+
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS,"midi_program: ch %d, prog %d\n",
+                channel, program);
+    channel = MIDI_CHANNEL(channel);    
+    if (cur_midi_prgm[channel] != program) {  
+    midi_write(2, MIDI_PORT(channel), (byte) (MIDI_CH_PROGRAM | channel),
+            (byte) (MIDI_PROGRAM(program)), 0);
+    cur_midi_prgm[channel] = program;
+    }
+}
+
+
+/****************************************************************************
+*               midi_real
+* Inputs:
+*    boolean onflag: TRUE or FALSE
+* Effect:
+*    enables (true) or disables (false) midi realtime messages F8-FF
+****************************************************************************/
+
+void midi_real(boolean onflag)  
+{
+    if (!initialized) fixup();
+#ifdef UNIX_ITC
+    {
+        mi_status ret;
+
+        ret = mi_realtime(midiconn, onflag);
+        if (ret != MI_SUCCESS) {
+            gprintf(ERROR, "Warning: bad ret = %d in midi_real\n", ret);
+        }
+    }
+#endif /* UNIX_ITC */
+#ifdef ITC
+    ignore_realtime = !onflag;
+#endif /* ITC */
+#ifdef AMIGA
+    if (onflag) {
+        SetMidiFilters(cmt_mi, cmt_mi->PortFilter,
+        cmt_mi->TypeFilter | CMF_RealTime, cmt_mi->ChanFilter);
+    } else {
+        SetMidiFilters(cmt_mi, cmt_mi->PortFilter,
+        cmt_mi->TypeFilter & ~CMF_RealTime, cmt_mi->ChanFilter);
+    }
+#endif
+#ifdef MACINTOSH_OR_DOS
+    realFilter = !onflag;
+#endif
+
+    if (musictrace) gprintf(TRANS,"midi_real: %d\n", onflag);
+}
+
+
+/* midi_start -- send a midi start message */
+/**/
+void midi_start()
+{
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS, "`");
+    midi_write(1, 0, MIDI_START, 0, 0);
+}
+
+
+/* midi_stop -- send a midi stop message */
+/**/
+void midi_stop()
+{
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS, "'");
+    midi_write(1, 0 /* ignored */, MIDI_STOP, 0, 0);
+}
+
+
+/****************************************************************************
+*               midi_thru
+* Inputs:
+*    boolean onflag: TRUE or FALSE
+* Effect:
+* DOS:      enables (true) or disables (false) midi thru info from
+*      MPU-401 to host.  (Default is set; reset with cmdline -block.)
+* AMIGA:  enables (true) or disables (false) midi route from AMIGA
+*        midi input to AMIGA midi output.
+****************************************************************************/
+
+void midi_thru(boolean onflag)  /* DMH: midi thru is not supported on the MAC or DOS */
+{
+    if (!initialized) fixup();
+#ifndef MIDI_THRU
+    gprintf(ERROR, "midi_thru called but not implemented\n");
+#else
+#ifdef AMIGA
+    MidiThru(0L, (long) onflag);
+#endif
+#ifdef MACINTOSH
+    /* this currently does not do anything - Mac driver doesn't
+     * support THRU
+     */
+    do_midi_thru = onflag;
+#endif
+#endif
+
+    if (musictrace) gprintf(TRANS,"midi_thru: %d\n", onflag);
+}
+
+
+/****************************************************************************
+*                  midi_touch
+* Inputs:
+*    int channel: midi channel on which to send data
+*    int value: control value
+* Effect: 
+*    Sends a midi after touch message
+****************************************************************************/
+
+void midi_touch(int channel, int value)
+{
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS,"midi_touch: ch %d, val %d\n",channel,value);
+    midi_write(2, MIDI_PORT(channel), (byte) (MIDI_TOUCH | MIDI_CHANNEL(channel)),
+        (byte) MIDI_DATA(value), 0);
+}
+
+
+/****************************************************************************
+*                  midi_write
+* Inputs:
+*       UBYTE n: number of characters to send (1, 2 or 3);
+    int port: the port number (usually 0), on MAC, this may be 1
+*    char c1,c2,c3: Character(s) to write to MIDI data port
+* Effect: 
+*    Writes the data to the serial interface designated by port
+****************************************************************************
+* Change log
+*  Date     | Change
+*-----------+----------------------------------------------------------------
+* 15-Mar-94 | PLu : Added IRIX version
+****************************************************************************/
+  
+#ifdef UNIX
+#ifdef UNIX_IRIX_MIDIFNS
+void midi_write(int n, int port, unsigned char c1, unsigned char c2, unsigned char c3)
+{
+  MDevent event;
+  
+  if (port < 0) return;
+
+  * ((u_long *) event.msg) = 0xe0000000 | ((port & 0x1f) << 24) | (c1 << 16) | 
+           (c2 << 8) | c3;
+  if (mdSend(miport, &event, 1) == -1)
+    gprintf(ERROR, "Can not send midi message in midi_write");
+
+  midi_write_trace(n, port, c1, c2, c3);
+}
+#else
+
+#ifdef ITC
+void midi_write(int n, int port,
+        unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    unsigned char outb[3];
+    mi_channel mch;
+    mi_status ret;
+
+    if (port < 0) return;
+    outb[0] = c1;
+    outb[1] = c2;
+    outb[2] = c3;
+    mch = (16*port)+((int)MI_CHANNEL(c1));
+    ret = mi_put(midiconn, mch, outb);
+    if (ret != MI_SUCCESS)
+    gprintf(ERROR, "Warning: bad ret = %d in midi_write\n", (int)ret);
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#else
+void midi_write(int n, int port, 
+        unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    /* no output */
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#endif /* ITC */
+#endif /*  UNIX_IRIX */
+#endif /* UNIX */
+
+#ifdef DOS
+#ifndef WINDOWS
+void midi_write(int n, int port,
+        unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    if (n >= 1) mPutData(c1);
+    if (n >= 2) mPutData(c2);
+    if (n >= 3) mPutData(c3);
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#else
+void midi_write(int n, int port, 
+        unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#endif
+#endif
+
+#ifdef MACINTOSH
+#ifdef MIDIMGR
+void midi_write(int n, int port,
+        unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    MIDIPacket TheMIDIPacket;
+    
+    TheMIDIPacket.flags = midiTimeStampCurrent;
+    TheMIDIPacket.len = 6 + n;
+    TheMIDIPacket.tStamp = 0;
+    TheMIDIPacket.data[0] = c1;
+    TheMIDIPacket.data[1] = c2;
+    TheMIDIPacket.data[2] = c3;
+    MIDIWritePacket(OutputRefNum, &TheMIDIPacket);
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#else
+void midi_write(int n, int port, unsigned char c1, unsigned char c2, unsigned char c3)
+{
+#ifndef NYQUIST
+    Xmit(port, c1);
+    if (n >= 2) Xmit(port, c2);
+    if (n >= 3) Xmit(port, c3);
+#endif
+    midi_write_trace(n, port, c1, c2, c3);
+}
+#endif
+#endif
+
+void midi_write_trace(int n, int port,
+              unsigned char c1, unsigned char c2, unsigned char c3)
+{
+    if (miditrace) {
+    /* to indicate bytes going out on port 1, put message in brackets
+     * with the port number, e.g. [1:~90~3c~64]
+     */
+    if (port > 0) gprintf(TRANS, "[%d:", port);
+    if (n >= 1) gprintf(TRANS, "~%2x", c1);
+    if (n >= 2) gprintf(TRANS, "~%2x", c2);
+    if (n >= 3) gprintf(TRANS, "~%2x", c3);
+    if (port > 0) gprintf(TRANS, "]", port);
+    }
+}
+
+
+
+/*****************************************************************
+*           set_pitch_default
+*****************************************************************/
+
+private void set_pitch_default()
+{
+    int i;
+
+    for (i = 0; i < 128; i++) {
+    pit_tab[i].pbend = 8192;
+    pit_tab[i].ppitch = i;
+    }
+}
+
+/*****************************************************************
+*           read_tuning
+*****************************************************************/
+
+void read_tuning(filename)
+char *filename;
+{
+    int index, pit, lineno = 0;
+    float bend;
+    FILE *fpp;
+
+    user_scale = TRUE;
+    set_pitch_default();
+
+    fpp = fileopen(filename, "tun", "r", "Tuning definition file");
+    while ((fscanf(fpp, "%d %d %f\n", &index, &pit, &bend) > 2) &&
+    (lineno < 128)) {
+    lineno++;
+    if (index >= 0 && index <= 127) {
+        pit_tab[index].pbend = (int)(8192 * bend/100 + 8192);
+        pit_tab[index].ppitch = pit;
+    }
+    }
+}
+
+
+/****************************************************************************
+*                  musicinit
+* Effect: 
+****************************************************************************/
+
+void musicinit()
+{
+    int i;
+    char *filename;
+
+    if (!tune_flag) {    /* do this code only once */
+    miditrace = cl_switch("miditrace");
+    musictrace = cl_switch("trace");
+    }
+    
+    if (!initialized) {
+    cu_register((cu_fn_type) musicterm, NULL);
+    midi_init();
+    }
+    initialized = TRUE;
+    /* this does some random cleanup activity */
+
+#ifndef APPLICATION
+    if (!tune_flag) {    /* do this code only once */
+#ifdef DOS
+#ifndef WINDOWS
+#if 0
+    version = mPutGetCmd(GETMPUVER);
+    revision = mPutGetCmd(GETMPUREV);
+    gprintf(TRANS, "MPU version %d.%d%c\n", version >> 4, version & 0x0f,
+        revision + 'A' - 1);
+#endif
+    mPutCmd(UARTMODE);
+    mPutCmd(NOREALTIME);    /* initially prevent Real Time MIDI info */
+    mPutCmd(EXCLUSIVOFF);   /* initially prevent Sys-Ex data */
+#endif
+#endif
+    tune_flag = TRUE;
+    filename = cl_option("tune");
+    if (filename != NULL) read_tuning(filename);
+    }
+    /* now that flags are set, print the trace message */
+    if (musictrace) gprintf(TRANS, "musicinit()\n");
+
+    if (user_scale) {
+    for (i = 0; i < MAX_CHANNELS; i++) {
+        midi_bend(i, 8192);
+        bend[i] = 8192;
+    }
+    }
+#endif /* ifndef APPLICATION */
+
+    for (i = 0; i < MAX_CHANNELS; i++) {
+    /* initialize to impossible values so that the
+     * next call to midi_bend or midi_program will
+     * not match and therefore send an output:
+     */
+    bend[i] = -1;
+    cur_midi_prgm[i] = -1;
+    }
+#ifdef MIDI_THRU
+    midi_thru(!(cl_switch("block")));    /* set MIDI thru */
+#endif
+    timereset();            /* Reset clock */
+#ifdef AMIGA
+    event_mask |= (1L << ascii_signal()) | (1L << cmt_mi->AlarmSigBit) |
+          (1L << cmt_mi->RecvSigBit);
+#endif
+}
+
+
+/****************************************************************************
+*                  musicterm
+* Effect: 
+*     Miscellaneous cleanup of things done by musicinit.
+****************************************************************************/
+
+private void musicterm()
+{
+    if (musictrace) gprintf(TRANS, "musicterm()\n");
+    initialized = FALSE;
+}
+
+
+/****************************************************************************
+*                   cmtrand
+* Inputs:
+*    int lo: Lower limit of value
+*    int hi: Upper limit of value
+* Result: int
+*    random number (lo <= result <= hi)
+****************************************************************************/
+
+long randseed = 1534781L;
+
+short cmtrand(short lo, short hi)
+{
+    randseed *= 13L;
+    randseed += 1874351L;
+    return((short)(lo + (((hi + 1 - lo) * ((0x00ffff00 & randseed) >> 8)) >> 16)));
+}
+
+
+#ifdef AMIGA
+/* remove_sysex_buffer -- a cleanup procedure for the Amiga */
+/**/
+void remove_sysex_buffer(void *obj)
+{
+    ClearSysExQueue(cmt_mi);
+}
+#endif /* AMIGA */
+
+
+/****************************************************************************
+*                  settime
+* Inputs: new time
+* Effect: 
+*    Sets the current time to the new time.
+*        DMH: for MAC, sets the clock to absTime
+*                 implemented by adjusting ticksATStart
+****************************************************************************/
+
+void settime(newtime)
+  time_type newtime;
+{
+    if (musictrace) gprintf(TRANS, "settime(%lu)\n", newtime);
+#ifdef AMIGA
+    timeoffset = *camdtime - (newtime >> 1);
+#endif
+
+#ifdef MACINTOSH
+#ifdef MIDIMGR
+    ticksAtStart = MIDIGetCurTime(OutputRefNum);
+#else
+    ticksAtStart = TickCount() - MS_TO_TICKS(newtime);
+#endif
+#endif  
+}
+
+/****************************************************************************
+*                  timereset
+* Effect: 
+*    Resets the time.
+*       DMH: for MAC, implemented by setting ticksAtStart to
+*            current value of system tick counter
+*       JMN: for DOS, resets the time on the MPU-401. Ticks is reset to 0
+****************************************************************************/
+
+void timereset()
+{
+#if HAS_GETTIMEOFDAY
+    struct timeval timeval;
+#endif
+#if HAS_FTIME
+    struct timeb ftime_res;
+#endif
+
+    if (!initialized) fixup();
+    if (musictrace) gprintf(TRANS,"timereset()\n");
+
+#ifdef AMIGA
+    timeoffset = *camdtime;
+#endif
+
+#ifdef DOS
+#ifndef WINDOWS
+    timeoffset = (ulong) readtimer();
+#endif
+#endif
+
+#ifdef MACINTOSH
+#ifdef MIDIMGR
+    ticksAtStart = MIDIGetCurTime(OutputRefNum);
+#else
+    ticksAtStart = TickCount();
+#endif
+#endif
+    
+#if HAS_GETTIMEOFDAY
+    gettimeofday(&timeval, 0);
+    timeoffset = timeval.tv_sec * 1000 + timeval.tv_usec / 1000 - timeoffset;
+#endif
+#if HAS_FTIME
+    ftime(&ftime_res);
+    timeoffset = ftime_res.time;
+#endif
+}
+
+
+/****************************************************************************
+*                  trace
+* Inputs:
+*    boolean flag: TRUE for trace on
+* Effect: 
+*    turns tracing on (flag == TRUE) or off (flag == FALSE)
+****************************************************************************/
+
+void trace(boolean flag)
+{
+    musictrace = flag;
+}
+
+/****************************************************************************
+*                  tracemidi
+* Inputs:
+*    boolean flag: TRUE for trace on
+* Effect: 
+*    turns midi tracing on (flag == TRUE) or off (flag == FALSE)
+****************************************************************************/
+
+void tracemidi(boolean flag)
+{
+    miditrace = flag;
+}
+
+
+
+/***********************************************************************
+*
+* midi and timer initialization
+*
+***********************************************************************/
+
+#ifdef  DOS
+
+/* binary value of hex char */
+
+private int xval(int c)
+{
+    int i;
+    static char t[]="0123456789abcdef";
+
+    for (i=0; i<16; i++)
+        if(tolower(c)==t[i]) return(i);
+    return (-1);
+}
+
+/* binary value of hex string */
+
+private int atox(char *t)
+{
+    int             i=0;
+    int             x;
+    while(*t)
+    {
+        if ((x=xval(*t++))<0)return (0);
+        i=(i<<4)+x;
+    }
+    return (i);
+}
+#endif  /* def DOS */
+
+
+private void midi_init()
+{
+#ifdef UNIX_IRIX_MIDIFNS
+#define PBUFLEN 4
+  MIconfig *config;
+  static u_int pbuf[] = { MI_STAMPING, MINOSTAMP, MI_BLOCKING, MINONBLOCKING};
+#endif
+
+#ifdef UNIX_MACH
+    mach_midi_init();
+#else
+#ifdef ITC
+    midiconn = mi_open(NULL);
+    if (midiconn == NULL) {
+    gprintf(FATAL, "could not open a MIDI device\n");
+    EXIT(1);
+    }
+    cu_register((cu_fn_type) mi_close, (void *) midiconn);
+#endif
+#endif
+#ifdef AMIGA
+    amiga_midi_init();
+#endif /* def AMIGA */
+#ifdef DOS
+#ifndef WINDOWS
+    int err;
+    int irq=SEARCHIRQ;
+    int base=MPUBASEADDR;
+    char *t;
+
+    if (t=getenv("MPUIRQ")) {
+    if (musictrace)
+        gprintf(TRANS,"MPUIRQ %s\n",t);
+    irq=atoi(t);
+    }
+    if (t=getenv("MPUBASE")) {
+    if (musictrace)
+        gprintf(TRANS,"MPUBASE %s\n",t);
+    base=atox(t);
+    }
+    if(err = mOpen(base, irq)) {
+    mClose(err);
+    EXIT(1);
+    }
+    cu_register((cu_fn_type) mClose, 0);
+    cu_register((cu_fn_type) mPutCmd, (cu_parm_type) MPURESET);
+    initializetimer();
+    cu_register((cu_fn_type) restoretimer, NULL);
+#endif
+#endif
+
+#ifdef MACINTOSH
+#ifndef NYQUIST /* if NYQUIST, do nothing */
+#ifdef MIDIMGR
+    setup_midimgr(); /* this registers itself for cleanup */
+#else
+    init_abort_handler();
+    cu_register(cleanup_abort_handler, NULL);
+    setupMIDI(portA, 0x80);
+    cu_register(restoreMIDI, (long) portA);
+    /* only initialize portB if necessary */
+    if (MAX_CHANNELS > CHANNELS_PER_PORT) {
+    setupMIDI(portB, 0x80);
+    cu_register(restoreMIDI, (long) portB);
+    }
+#endif
+#endif /* NYQUIST */
+#ifdef MIDIMGR
+    ticksAtStart = MIDIGetCurTime(OutputRefNum);
+#else
+    ticksAtStart = TickCount(); /* reset the clock */
+#endif
+#endif /* def MACINTOSH */
+
+    if (!(cl_switch("noalloff")))
+    cu_register((cu_fn_type) alloff, NULL);
+}
+
+#ifdef  DOS
+/****************************************************************************
+*                                  set_x_mfr
+* Inputs:
+*       unsigned char mfr: Manufacturer ID for MIDI
+* Result: void
+*       
+* Effect: 
+*       Sets the xcode and xcodemask to allow only these sysex messages
+****************************************************************************/
+
+void set_x_mfr(mfr)
+unsigned char mfr;
+{
+    xcode = mfr;
+    xcodemask = 0xFF;
+}
+
+/****************************************************************************
+*                                 clear_x_mfr
+* Result: void
+*       
+* Effect: 
+*       Clears sysex manufacturer code filter; accepts all sysex messages
+****************************************************************************/
+
+void clear_x_mfr()
+{
+    xcode = 0;
+    xcodemask = 0;
+}
+#endif /* DOS */
diff --git a/lib-src/libnyquist/nyquist/cmt/midifns.h b/lib-src/libnyquist/nyquist/cmt/midifns.h
new file mode 100644
index 0000000..99042d3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midifns.h
@@ -0,0 +1,137 @@
+/* midifns.h -- definitions for users of midifns.c */
+
+/*****************************************************************************
+*           Change Log
+*  Date     | Change
+*-----------+-----------------------------------------------------------------
+*  5-Mar-92 | GWL : insert definitions and logs from JMN's mpu.h
+*                   for LATTICE322, only variable type in prototypes
+* 28-Apr-03 |  DM : random() is now named cmtrand() to avoid conflicts
+*****************************************************************************/
+
+#ifndef _MIDIFNS_H_
+#define _MIDIFNS_H_
+
+/* declaration types */
+
+typedef unsigned long time_type;
+typedef long sgnd_time_type;
+
+/* Maximum time value: */
+#define MAXTIME 0xFFFFFFFFL
+
+#define delay_type      long
+
+/* controller numbers */
+
+#define MODWHEEL        1
+#define BREATH          2
+#define FOOT            4
+#define PORTARATE       5
+#define VOLUME          7
+#define SUSTAIN         64
+#define PORTASWITCH     65
+
+#include "midierr.h"
+
+extern char *midifns_syntax;
+
+/* support for allocating sysex buffer - examples in mm.c & exget.c */
+#ifdef DOS
+#define midibuff_alloc(size) (byte huge *) halloc(size, 1)
+#endif
+#ifndef midibuff_alloc
+#define midibuff_alloc (byte *) MALLOC
+#endif
+
+/* DMH: from mpu.h -- definitions for users of mpu.c */
+
+#ifdef OLD_PROTOTYPES
+
+void    eventwait();
+void    exclusive(boolean);
+boolean getbuf(boolean, unsigned char * );
+long	get_excl();
+boolean getxbuf();
+boolean testxbuf();
+short   getkey(boolean);
+ulong   gettime(void);          /*DMH: note- now unsigned*/
+void    l_rest(long);
+void    l_restuntil(long);
+void    metronome(boolean);
+void    midi_bend(short,short);
+boolean midi_buffer(byte * , ulong);
+void    midi_cont(boolean);
+void    midi_clock();
+void    midi_ctrl(short, short, short);
+void    midi_exclusive(unsigned char * );
+void    midi_note(short, short, short);
+void    midi_program(short, short);
+void    midi_real();
+void    midi_start();
+void    midi_stop();
+#ifdef AMIGA
+/* MIDI_THRU defined means that it is really implemented. */
+#define MIDI_THRU
+#endif
+void    midi_thru();/*boolean onflag*/
+void    midi_touch(short, short);
+void    midi_write();
+void    musicinit();
+short	  cmtrand(short, short);
+void    read_tuning();/*char *filename*/
+void    settime();
+void    synth_init();/*void*/
+void    timereset();
+void    trace();
+void    tracemidi();
+boolean is_exclusive(void);
+unsigned char get_exclusive(void);
+
+#else
+
+void alloff(void);
+void eventwait(long timeout);
+void exclusive(boolean onflag);
+long get_excl(byte *buffer, long len);
+boolean getbuf(boolean waitflag, unsigned char * p);
+short getkey(boolean waitflag);
+ulong gettime(void);
+void l_rest(long time);
+void l_restuntil(long time);
+void metronome(boolean onflag);
+void midi_bend(int channel, int value);
+boolean midi_buffer(byte *buffer, ulong size);
+void midi_clock(void);
+void midi_cont(boolean onflag);
+void midi_ctrl(int channel, int control, int value);
+void midi_exclusive(unsigned char *msg);
+void midi_flush();
+void midi_note(int channel, int pitch, int velocity);
+void midi_program(int channel, int program);
+void midi_real(boolean onflag);
+void midi_start(void);
+void midi_stop(void);
+void midi_thru(boolean onflag);
+void midi_touch(int channel, int value);
+void read_tuning(char *filename);
+void midi_write(int n, int port, unsigned char c1, unsigned char c2, unsigned char c3);
+void midi_write_trace(int n, int port,
+              unsigned char c1, unsigned char c2, unsigned char c3);
+void musicinit(void);
+void settime(time_type newtime);
+void timereset(void);
+void trace(boolean flag);
+void tracemidi(boolean flag);
+
+
+boolean check_midi(void);
+#endif  /* ifdef OLD_PROTOTYPES */
+
+
+#ifdef AMIGA
+byte    *head_of_excl();
+byte    *tail_of_excl();
+#endif
+
+#endif /* _MIDIFNS_H_ */
diff --git a/lib-src/libnyquist/nyquist/cmt/midimgr.c b/lib-src/libnyquist/nyquist/cmt/midimgr.c
new file mode 100644
index 0000000..e7db136
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midimgr.c
@@ -0,0 +1,784 @@
+/* midimgr.c -- this file contains interface code to support use of Apple Midi Manager */
+/*
+ * This code is based on code supplied with the Apple Midi Manager.
+ * Copyright 1991, Carnegie Mellon University
+ */
+ 
+/* BUGS: 
+ *     If exclusive() is called to turn exclusive messages on or off DURING the
+ * receipt of an exclusive message, incoming data will be garbled.  The correct
+ * handling would be to record when receipt of an exclusive message is in
+ * progress, then properly remove any partial message when exclusive is turned
+ * off, and ignore any remaining message part when exclusive is turned on.
+ * The present code does neither.
+ */
+ 
+#include "cext.h"
+#undef round
+#ifdef THINK_C
+#include <pascal.h> /* for ThinkC 7 */
+#endif
+
+#include "stdio.h"
+#include "userio.h"
+#include "MIDI.h"
+#include "midifns.h"
+#include "midibuff.h"
+#include "midierr.h"
+#include "midimgr.h"
+#include "midicode.h"
+#include "cmdline.h"
+
+/* Needed for KillEverybody */
+#include <toolutils.h>
+#include <AppleEvents.h>
+#include <EPPC.h>
+#include <Gestalt.h>
+#include <PPCToolbox.h> 
+#include <Processes.h>
+#include <Sound.h>
+
+
+#define CMTclientID             'CMT '
+/* note the following are in alphabetical order for Patcher display */
+#define timePortID              'Atim'
+#define inputPortID             'Bin '
+#define outputPortID    'Cout'
+#define noClient                '    '
+
+#define noTimeBaseRefNum        0
+#define noReadHook                      0L
+#define zeroTime                        0L
+#define timePortBuffSize        0L
+#define inputPortBuffSize       2048
+#define outputPortBuffSize      0L
+#define refCon0 0L
+
+pascal short CMTreader(MIDIPacket *ThePacketPtr, long TheRefCon);
+
+/* "patch" switch from command line.  This switch is cached in patch_flag and tells
+   whether to look in the resource fork for a patch, or just hook up to midi in and
+   out.  If the resource fork is used, the patch will be saved upon exit. */
+private boolean patch_flag; 
+extern boolean ctrlFilter;
+extern boolean exclFilter;
+extern boolean realFilter;
+
+private midi_read_lock = false;	/* used to stop input during data structure manipulation */
+
+private void set_error(int bit);
+#ifndef NYQUIST
+void PatchPorts(void);
+void SavePatch(OSType PortID, short PortInfoResID, char *PortInfoResName);
+#endif
+
+/* exported:  */
+public short InputRefNum;                       /* Input port reference number. */
+public short OutputRefNum;                      /* Output port reference number. */
+public short TimeRefNum;                        /* Time base port reference number. */
+
+Boolean         GManualPatch;   /* True if not launched by a PatchBay Config. File. */
+
+/****************************************************************************
+*
+*       variables shared with other modules
+*
+****************************************************************************/
+
+/* midi input buffer */
+long buff[BUFF_SIZE/4]; /* data buffer, declared long to get 32-bit alignment */
+int buffhead = 0;               /* buffer head and tail pointers */
+int bufftail = 0;
+
+/* user supplied system exclusive buffer */
+byte *xbuff = NULL;     /* address of the user-supplied buffer */
+public long xbufmask;    /* mask for circular buffer address calculation */
+long xbufhead = 0;       /* buffer head and tail pointers */
+long xbuftail = 0;
+boolean xbuf_flush = true;	/* says to flush remainder of sysex message */
+
+#ifdef SYSEXDEBUG
+int sysexcount = 0;	/* for debugging */
+int sysexdone = 0;
+int sysexheadcount = 0;
+byte sysexfirst = 0;
+int sysexsysex = 0;
+#endif
+
+/* midi_flush -- empty out buffers */
+/**/
+void midi_flush()
+{
+    midi_read_lock = true;
+    buffhead = 0;
+    bufftail = 0;
+    xbufhead = 0;
+    xbuftail = 0;
+    xbuf_flush = true;	/* in case sysex continuation messages are still coming */
+    midi_read_lock = false;
+}
+
+
+/* Nyquist only uses CMT for Midi and Adagio file IO */
+#ifndef NYQUIST
+/* Get String representation of MIDI Mgr Version Num.*/
+/* See Mac Tech Note #189 for details. */
+char *StdMacVerNumToStr(long VerNum, char *VerStr)
+{
+        char    *RetVal;
+        char    MajVer, MinVer, VerStage, VerRev, BugFixVer = 0;
+        
+        if (VerNum == 0)
+        {
+                RetVal = NULL;
+        }
+        else
+        {
+                MajVer          = (VerNum & 0xFF000000) >> 24;
+                MinVer          = (VerNum & 0x00FF0000) >> 16;
+                VerStage        = (VerNum & 0x0000FF00) >> 8;
+                VerRev          = (VerNum & 0x000000FF) >> 0;
+                BugFixVer       =  MinVer & 0x0F;
+                
+                switch (VerStage)
+                {
+                        case 0x20:
+                                    VerStage = 'd';
+                                    break;
+                        case 0x40:
+                                    VerStage = 'a';
+                                    break;
+                        case 0x60:
+                                    VerStage = 'b';
+                                    break;
+                        case 0x80:
+                                    VerStage = ' ';
+                                    break;
+                        default:
+                                    VerStage = '?';
+                                    break;
+                }
+                
+                if (BugFixVer == 0)
+                {
+                        sprintf(VerStr,"%X.%X%c%X", 
+                                    MajVer, MinVer>>4, VerStage, VerRev);
+                }
+                else
+                {
+                        sprintf(VerStr,"%X.%X.%X%c%X", 
+                                    MajVer, MinVer >> 4, MinVer & 0x0F, VerStage, VerRev);
+                }
+                
+                RetVal = VerStr;
+        }
+                
+        return(RetVal);
+}
+
+
+/* C2PStrCpy -- Convert a C String (from Cstr) into a Pascal string */
+/*
+ * NOTE: this is not the same code as shipped with midi manager example
+ */
+char *C2PStrCpy(char *Cstr, Str255 Pstr)
+{
+        char *c = Cstr;
+        char *p = ((char *) Pstr) + 1;
+        
+        while (*c) *p++ = *c++;
+        *Pstr = c - Cstr;
+        return( (char *) Pstr );
+}
+
+/* This checks to see if THINK C is running under System 7,
+   and ONLY WORKS UNDER SYSTEM 7!  Don't use unless you check! */
+boolean ThinkCRunning(void)
+{
+     ProcessSerialNumber processSN;
+    OSErr myErr;
+    ProcessInfoRec infoRec;
+    
+    processSN.lowLongOfPSN = kNoProcess;
+    processSN.highLongOfPSN = kNoProcess;
+    do {
+        myErr = GetNextProcess(&processSN);
+        
+        infoRec.processInfoLength = sizeof(ProcessInfoRec);
+        infoRec.processName = 0L;
+        infoRec.processAppSpec = 0L;
+        myErr = GetProcessInformation(&processSN, &infoRec);
+        if (!myErr) {
+                if (infoRec.processSignature == 'KAHL') {
+                    return(true);
+                }
+        }
+    } while (myErr == noErr);
+    return(false);
+}
+
+/* This kills off all the other running processes... 
+   ONLY WORKS UNDER SYSTEM 7!  Don't use unless you check! */
+void KillEverybody(void)
+{
+    ProcessSerialNumber myProc, processSN;
+    ProcessSerialNumber finderPSN;
+    ProcessInfoRec infoRec;
+    Str31 processName;
+    FSSpec procSpec;
+    
+    OSErr myErr = noErr;
+    OSErr otherError;
+    AppleEvent theEvent;
+    AEDesc theAddress;
+    Boolean ourFlag, notFinder;
+    Boolean finderFound = false;
+    
+    GetCurrentProcess(&myProc);
+    /* Preset the PSN to no PSN, see IM VI, the Process Manager */
+    processSN.lowLongOfPSN = kNoProcess;
+    processSN.highLongOfPSN = kNoProcess;
+    finderPSN.lowLongOfPSN = 0UL; /* brk: was nil */
+    finderPSN.highLongOfPSN = 0UL; /* brk: was nil */
+    
+    do {
+        myErr = GetNextProcess(&processSN);
+        /* See if it's us first */
+        notFinder = true;
+        SameProcess(&myProc, &processSN, &ourFlag);
+
+            infoRec.processInfoLength = sizeof(ProcessInfoRec);
+            infoRec.processName = (StringPtr) &processName;
+            infoRec.processAppSpec = &procSpec;
+            GetProcessInformation(&processSN, &infoRec);
+        if (!ourFlag && !finderFound) {
+            /* see if it's the Finder, we have to kill the finder LAST */
+            /* or else non-sys 7 apps won't get killed */
+            /* since the Finder must be there to convert the AppleEvent to Puppet Strings */
+            /* if the app is not APpleEvent aware */
+            /* Also, FileShare HAS to be killed before the Finder */
+            /* or your life will be unpleasant */
+
+            if (infoRec.processSignature == 'MACS' && infoRec.processType == 'FNDR') {
+                /* save this number for later  */
+                finderPSN = processSN;
+                notFinder = false;
+                finderFound = true;
+            
+            } else {
+                notFinder = true;
+            }
+        }
+        if (!myErr && !ourFlag && notFinder) {
+            otherError = AECreateDesc(typeProcessSerialNumber, (Ptr)&processSN, sizeof(processSN), &theAddress);
+            if (!otherError)
+                otherError = AECreateAppleEvent(kCoreEventClass, kAEQuitApplication, &theAddress, kAutoGenerateReturnID,
+                                                                    kAnyTransactionID, &theEvent);
+            if (!otherError)
+                AEDisposeDesc(&theAddress);
+            /* Again, the Finder will convert the AppleEvent to puppetstrings if */
+            /* the application is a System 6 or non-AE aware app.  This ONLY  */
+            /* happens for the 4 required (oapp,odoc,pdoc, and quit) AppleEvents  */
+            /* and ONLY if you use the PSN for the address */
+            if (!otherError)
+                AESend(&theEvent, 0L, kAENoReply + kAEAlwaysInteract + kAECanSwitchLayer, kAENormalPriority, kAEDefaultTimeout,
+                       0L, 0L);
+            AEDisposeDesc(&theEvent);
+        }
+    } while (!myErr);
+    
+    /* Now, if the finder was running, it's safe to kill it */
+    if (finderPSN.lowLongOfPSN || finderPSN.highLongOfPSN) {
+        otherError = AECreateDesc(typeProcessSerialNumber, (Ptr)&finderPSN, sizeof(processSN), &theAddress);
+        if (!otherError)
+            otherError = AECreateAppleEvent(kCoreEventClass, kAEQuitApplication, &theAddress, kAutoGenerateReturnID,
+                                                            kAnyTransactionID, &theEvent);
+        if (!otherError)
+            AEDisposeDesc(&theAddress);
+        if (!otherError)
+            AESend(&theEvent, 0L, kAENoReply + kAEAlwaysInteract + kAECanSwitchLayer, kAENormalPriority, kAEDefaultTimeout, 0L,
+                   0L);
+        AEDisposeDesc(&theEvent);
+    }
+}
+
+/* Sign into the MIDI Manager. */
+/* Set up time, input, and output ports. */
+/* Start our time base clock. */
+void setup_midimgr(void)
+{
+    MIDIPortParams  Init;   /* MIDI Mgr Init data structure */ 
+    Handle                  TheIconHndl;
+    OSErr                   TheErr;
+    long                    MIDIMgrVerNum;  /* MIDI Manager Ver (Std Mac Ver #) */
+    Str255 name = "\pCMU MIDI Toolkit";
+    char MIDIMgrVerStr[256]; /* MIDI Manager Ver (Std Mac Ver # String) */
+    long vers;
+    EventRecord theEvent;
+    
+    Gestalt(gestaltSystemVersion, &vers);
+    vers = (vers >> 8) & 0xf;                               /* shift result over and mask out major version number */
+    if ((vers >= 7) && (!cl_switch("keep"))  && (!ThinkCRunning()))  {
+        gprintf(TRANS,"Killing other processes...\n");
+        KillEverybody();
+        for (vers=0; vers<100; ++vers) {
+            while (WaitNextEvent(everyEvent, &theEvent, 0L, 0L)) ;
+        }
+    }
+        
+    /* Make sure MIDIMgr is installed and save version num. */
+    MIDIMgrVerNum = SndDispVersion(midiToolNum);
+    if (MIDIMgrVerNum == 0) {
+        gprintf(ERROR, "The MIDI Manager is not installed! Exiting...\n");
+        EXIT(1);
+    } else {        
+        StdMacVerNumToStr(MIDIMgrVerNum, MIDIMgrVerStr);
+        gprintf(TRANS,"MIDI Manager Version %s\n", MIDIMgrVerStr);
+    }
+
+        
+    /* Sign in to the MIDI Manager. */
+    TheIconHndl = GetResource('ICN#', 1);
+    TheErr = MIDISignIn(CMTclientID,
+                        0L, 
+                        TheIconHndl,
+                        name);
+    if (TheErr) {
+            gprintf(ERROR, "Trouble signing into MIDI Manager!  Aborting...");
+            EXIT(1);
+    }
+
+    /* Assume not a Patchbay configuration. */
+    GManualPatch = true;    
+
+    /* Add time port. */
+    Init.portID = timePortID;
+    Init.portType = midiPortTypeTime;
+    Init.timeBase = noTimeBaseRefNum;
+    Init.readHook = noReadHook;
+    Init.initClock.syncType = midiInternalSync;
+    Init.initClock.curTime = zeroTime;
+    Init.initClock.format = midiFormatMSec;
+    Init.refCon = SetCurrentA5();
+    C2PStrCpy("TimeBase", Init.name);
+    TheErr = MIDIAddPort(CMTclientID, timePortBuffSize, &TimeRefNum, &Init);
+    /* Has a PatchBay connection been resolved? */
+    if (TheErr == midiVConnectMade) {
+        GManualPatch = false;
+    } else if (TheErr == memFullErr) {
+        gprintf(ERROR, "Not enough room in heap zone to add time port!  Aborting...");
+        MIDISignOut(CMTclientID);       
+        EXIT(1);
+    }
+        
+    /* Add an input port. */
+    Init.portID = inputPortID;
+    Init.portType = midiPortTypeInput;
+    Init.timeBase = TimeRefNum;
+    Init.offsetTime = midiGetCurrent;
+    Init.readHook = NewMIDIReadHookProc(CMTreader);
+    Init.refCon = SetCurrentA5();
+    C2PStrCpy("InputPort", Init.name);
+    TheErr = MIDIAddPort(CMTclientID, inputPortBuffSize, &InputRefNum, &Init);
+    /* Has a PatchBay connection been resolved? */
+    if (TheErr == midiVConnectMade) {
+        GManualPatch = false;
+    } else if (TheErr == memFullErr) {
+        gprintf(ERROR, "Not enough room in heap zone to add input port!  Aborting...");
+        MIDISignOut(CMTclientID);       
+        EXIT(1);
+    }
+        
+    /* Add an output port. */
+    Init.portID = outputPortID;
+    Init.portType = midiPortTypeOutput;
+    Init.timeBase = TimeRefNum;
+    Init.offsetTime = midiGetCurrent;
+    Init.readHook = NULL;
+    Init.refCon = refCon0;
+    C2PStrCpy("OutputPort", Init.name);
+    TheErr = MIDIAddPort(CMTclientID, outputPortBuffSize, &OutputRefNum, &Init);
+    /* Has a PatchBay connection been resolved? */
+    if (TheErr == midiVConnectMade) {
+        GManualPatch = false;
+    } else if (TheErr == memFullErr) {
+        printf("Not enough room in heap zone to add output port!  Aborting...");
+        MIDISignOut(CMTclientID);       
+        EXIT(1);
+    }
+        
+    if (GManualPatch) {
+        PatchPorts(); /* connect ports as they were */
+    }
+    /* to clean this up (later) call finish_midimgr() */
+    cu_register((cu_fn_type) finish_midimgr, (cu_parm_type) finish_midimgr);
+        
+    /* Start our Clock. */
+    MIDIStartTime(TimeRefNum);              
+}
+
+
+/* The Read Hook Function. */
+
+/* 1st 4 bytes of sysex message get saved here and enqueued later */
+char save_sysex_head[4];
+int save_sysex_head_x = 0;
+
+void sysex_insert(unsigned char data) {
+    if (save_sysex_head_x < 4) {
+        save_sysex_head[save_sysex_head_x++] = data;
+    }
+    xbuff[xbuftail++] = data;
+    xbuftail &= xbufmask;
+    if (xbuftail == xbufhead) {
+        set_error(SYSEXOVFL);
+    }
+    if (data == MIDI_EOX) { /* we're done with the message */
+        *((long *) (((byte *) buff) + bufftail)) = *((long *)save_sysex_head);
+        bufftail = (bufftail + 4) & BUFF_MASK;
+        if (bufftail == buffhead) {
+            set_error(BUFFOVFL);
+        }
+    }
+}
+
+/* Read all incomming MIDI data. */
+
+pascal short CMTreader(MIDIPacket *ThePacketPtr, long TheRefCon)
+{
+    /* Set up our A5 world. */
+    long    SysA5 = SetA5(TheRefCon);
+    short   RetVal = midiMorePacket, i, j;
+    unsigned char *mm_data = ThePacketPtr->data;
+    register byte data1 = mm_data[1];
+        
+    if (midi_read_lock) {
+        /* Don't want to read packet now, get it later */
+        /* DOES THIS REALLY WORK?  WHAT WILL CAUSE AN INTERRUPT
+         * TO OCCUR LATER?  THIS IS ONLY USED BY midi_flush, IS
+         * BASED ON THE MidiArp CODE FROM APPLE, AND IS UNTESTED - RBD
+         */
+        RetVal = midiKeepPacket;
+        goto alldone;	
+    }
+
+    /* see if Packet is an error message */
+    if (((ThePacketPtr->flags & midiTypeMask) == midiMgrType) && 
+        *((short *) (&(ThePacketPtr->data))) < midiMaxErr) {
+        set_error(MIDIMGRERR);
+        goto alldone;
+    }
+        
+    /* filter out control changes */
+    if (ctrlFilter) {
+        register int hibits = *mm_data & 0xF0;
+        if (hibits == 0xD0 ||   /* Chan Pressure */
+            hibits == 0xE0 ||       /* Pitch Bend */
+            hibits == 0xA0 ||       /* Poly Pressure */
+            ((hibits == 0xB0) &&    /* Control change (don't count switches) */
+             ((data1 < 64) || (data1 > 121)))) {
+            /* CONTROL MESSAGE HAS BEEN FILTERED */
+            goto alldone;
+        }
+    } else if (realFilter) {
+        register int hibits = *mm_data & 0xF0;
+        if (hibits >= 0xF8) goto alldone;
+    }
+
+        
+    /* if not a continuation, copy the data into cmt_data */
+    /* The logic to detect a non-continued
+     * packet or a first packet is: "flags bit 1 is clear".
+     */
+    if ((((ThePacketPtr->flags & midiContMask) == midiNoCont)) && 
+        (*mm_data != MIDI_SYSEX)) {
+        register byte *cmt_data = ((byte *) buff) + bufftail;
+        *((long *) cmt_data) = *((long *) mm_data);
+
+        bufftail = (bufftail + 4) & BUFF_MASK;
+        if (bufftail == buffhead) {
+            /* filled buffer faster than client emptied it */
+            set_error(BUFFOVFL);
+        }
+    }
+        
+    /* see if we have a sysex message to copy to buffer */
+    if (xbuff && !exclFilter &&
+        ((ThePacketPtr->flags & midiContMask) || *mm_data == MIDI_SYSEX)) {
+        int i;
+        register byte *x_data = xbuff + xbuftail;
+
+        /* iterate over data in message */
+        /* NOTE: in the previous implementation, I thought Sysex messages were
+         * always starting at the beginning of the buffer, but that didn't work.
+         * This implementation assumes nothing -- it is slower because of additional
+         * testing and parsing inside the loop, but seems to work.
+         */
+        for (i = ThePacketPtr->len - 6; i > 0; i--) {
+            if (xbuf_flush) {	/* we're searching for beginning of message */
+                if (*mm_data == MIDI_SYSEX) {
+                    xbuf_flush = false;
+                    sysex_insert(MIDI_SYSEX);
+                }
+            } else {	/* we're scanning to the end of the message */
+                if (*mm_data == MIDI_SYSEX) {	/* found it, insert proper EOX */
+                    sysex_insert(MIDI_EOX);
+                    sysex_insert(MIDI_SYSEX);
+                } else if (*mm_data == MIDI_EOX) {	/* found it */
+                    sysex_insert(MIDI_EOX);
+                    xbuf_flush = true;
+                } else sysex_insert(*mm_data);
+
+            }
+            mm_data++;
+        }
+    }
+alldone:
+
+    /* Restore the systems A5 world. */
+    SetA5(SysA5);
+    
+    return(RetVal);
+}
+
+
+/* Sign out from the MIDI Manager. */
+void finish_midimgr(void)
+{
+        if (GManualPatch && patch_flag) {
+                SavePatch(timePortID, timePortResInfoID, "timePortInfo");
+                SavePatch(inputPortID, inputPortResInfoID, "inputPortInfo");
+                SavePatch(outputPortID, outputPortResInfoID, "outputPortInfo");
+        }
+        MIDISignOut(CMTclientID);
+}
+
+
+
+/* Alert user to Resource Manager Error. */
+void
+ReportResError(char *Msg)
+{
+        OSErr   TheErr;
+        char    Buf[256];
+        
+        if ( (TheErr = ResError()) != noErr) {
+                gprintf(ERROR, "ResError %d: %s...Aborting.", TheErr, Msg);
+                EXIT(1);
+        } else {
+                /* gprintf(ERROR, "%s OK\n", Msg); */
+        }
+}
+
+
+/****************************************************************************
+*                                       error handling
+* Effect:
+*       various error conditions are flagged by setting bits in
+*       the global midi_error_flags.  it is up to the client to clear this 
+*       word when necessary.
+****************************************************************************/
+
+private void set_error(int bit)
+{
+        midi_error_flags |= (1 << bit);
+}
+
+
+void midi_show_errors()
+{
+    if (midi_error_flags & (1<<BUFFOVFL)) 
+        gprintf(ERROR, "Midi Buffer Overflow Error\n");
+    if (midi_error_flags & (1<<MIDIMGRERR)) 
+        gprintf(ERROR, "Midi Manager Error\n");
+    if (midi_error_flags & (1<<SYSEXOVFL)) 
+        gprintf(ERROR, "Midi Sysex Overflow Error\n");
+}
+
+
+/**************** PATCHING CODE ***************/
+
+/*
+        MIDIArp Time, Input, and Output Port 
+        Info Record Resource ID's.
+*/
+
+/* Get previously saved port connections (port info records) */
+/* from application's 'port' resource. */
+void
+PatchPorts(void)
+{
+        MIDIPortInfoHdl PortInfoH;      /* Handle to port info record. */
+        MIDIPortInfoPtr PortInfoP;      /* Pointer to port info record. */
+        short                   i, TheErr;
+        
+        patch_flag = cl_switch("patch");
+                
+                /* SET UP TIME PORT CONNECTIONS. */
+        if (patch_flag)
+                PortInfoH = (MIDIPortInfoHdl) GetResource(portResType, timePortResInfoID);
+        if (!patch_flag || PortInfoH == NULL) {
+                MIDIIDListHdl clients, ports;
+                OSErr err;
+                
+                gprintf(TRANS, "Connecting to MIDI IN and OUT\n");
+#ifdef MIDIMGR_VERBOSE
+                clients = MIDIGetClients();
+                gprintf(TRANS, "clients = %lx\n", clients);
+                HLock((Handle) clients);
+                
+                for (i = 0; i < (*clients)->numIDs; i++) {
+                        OSType id = (*clients)->list[i];
+                        gprintf(TRANS, "%d: %c%c%c%c\n", i, (char) (id>>24),
+                                    (char) ((id >> 16) & 0xFF), (char) ((id >> 8) & 0xFF),
+                                    (char) (id & 0xFF));
+                }
+                ports = MIDIGetPorts('amdr');
+                HLock((Handle) ports);
+                for (i = 0; i < (*ports)->numIDs; i++) {
+                        OSType id = (*ports)->list[i];
+                        gprintf(TRANS, "%d: %c%c%c%c\n", i, (char) (id>>24),
+                                    (char) ((id >> 16) & 0xFF), (char) ((id >> 8) & 0xFF),
+                                    (char) (id & 0xFF));
+                }
+                HUnlock((Handle) ports);
+                HUnlock((Handle) clients);
+#endif
+                /* the work starts here */
+                err = MIDIConnectData('CMT ', 'Cout', 'amdr', 'Aout');
+                /* gprintf(TRANS, "Connected CMT.Cout to amdr.Aout: %d\n", err); */
+                err = MIDIConnectData('amdr', 'Ain ', 'CMT ', 'Bin ');
+                /* gprintf(TRANS, "Connected amdr.Ain to CMT.Bin: %d\n", err); */
+
+                return;
+        }
+        HLock((Handle) PortInfoH);
+        PortInfoP = *PortInfoH;
+        if (GetHandleSize((Handle) PortInfoH) != 0)
+        {
+                        /* Were we supposed to be sync'd to another client? */
+                if (PortInfoP->timeBase.clientID != noClient)
+                {               
+                                    /* Yes, so make that client our time base. */
+                        TheErr = MIDIConnectTime(
+                                                                    PortInfoP->timeBase.clientID, 
+                                                                    PortInfoP->timeBase.portID,
+                                                                    CMTclientID, 
+                                                                    timePortID 
+                                                                    );
+#ifdef IGNORE
+                                    /* Is the client still signed in? */
+                        if (TheErr != midiVConnectErr) 
+                        {       
+                                                    /* Yes, so set our sync mode to external. */
+                                    MIDISetSync(ArpGlobals.TimeRefNum, midiExternalSync);
+                        }
+#endif
+                        
+                }
+                        /* Were we somebody else's time base? */
+                for (i=0; i<PortInfoP->numConnects; i++)
+                {
+                        MIDIConnectTime(CMTclientID, 
+                                                                    timePortID, 
+                                                                    PortInfoP->cList[i].clientID, 
+                                                                    PortInfoP->cList[i].portID);
+                }
+        }
+        HUnlock((Handle) PortInfoH);
+        ReleaseResource((Handle) PortInfoH);
+        ReportResError("PatchPorts/ReleaseResource()");
+        
+                /* SET UP INPUT PORT CONNECTIONS. */
+        PortInfoH = (MIDIPortInfoHdl) GetResource(portResType, inputPortResInfoID);
+        if (PortInfoH == NULL)
+        {
+                ReportResError("PatchPorts/GetResource()");
+        }
+        HLock((Handle) PortInfoH);
+        PortInfoP = *PortInfoH;
+        if (GetHandleSize((Handle) PortInfoH) != 0)
+        {
+                        /* Were we connected to anyone? */
+                for (i=0; i<PortInfoP->numConnects; i++)
+                {
+                        MIDIConnectData(CMTclientID, 
+                                                                    inputPortID, 
+                                                                    PortInfoP->cList[i].clientID, 
+                                                                    PortInfoP->cList[i].portID);
+                }
+        }
+        HUnlock((Handle) PortInfoH);
+        ReleaseResource((Handle) PortInfoH);
+        ReportResError("PatchPorts/GetResource()");
+        
+                /* SET UP OUTPUT PORT CONNECTIONS. */
+        PortInfoH = (MIDIPortInfoHdl) GetResource(portResType, outputPortResInfoID);
+        if (PortInfoH == NULL)
+        {       
+                ReportResError("PatchPorts/GetResource()");
+        }
+        HLock((Handle) PortInfoH);
+        PortInfoP = *PortInfoH;
+        if (GetHandleSize((Handle) PortInfoH) != 0) {
+                        /* Were we connected to anyone? */
+                for (i=0; i<PortInfoP->numConnects; i++)
+                {
+                        MIDIConnectData(CMTclientID, 
+                                                                    outputPortID, 
+                                                                    PortInfoP->cList[i].clientID, 
+                                                                    PortInfoP->cList[i].portID);
+                }
+        }
+        HUnlock((Handle) PortInfoH);
+        ReleaseResource((Handle) PortInfoH);
+        ReportResError("PatchPorts/ReleaseResource()");
+        
+}
+
+/* Save current port connections (port info records) */
+/* to application's 'port' resource. */
+void
+SavePatch(OSType PortID, short PortInfoResID, char *PortInfoResName)
+{
+        Handle                  PortResH;       /* Handle to ptch resource. */
+        CursHandle              WatchCurs;      
+        
+        WatchCurs = GetCursor(watchCursor);
+        HLock((Handle) WatchCurs);
+        SetCursor(*WatchCurs);
+        HUnlock((Handle) WatchCurs);
+
+        
+                /* Remove existing port info resource. */
+        PortResH = GetResource(portResType, PortInfoResID);
+        /* gprintf(TRANS, "PortResH: %lx, *PortResH: %lx\n", PortResH, *PortResH); */
+        if (PortResH) {
+                ReportResError("SavePatch/GetResource()");
+                RmveResource(PortResH);
+                ReportResError("SavePatch/RmveResource()");
+                DisposHandle(PortResH);
+                UpdateResFile(CurResFile());
+                ReportResError("SavePatch/UpdateResFile()");
+        }
+        
+                /*      Get new configurateion. */
+        PortResH = (Handle) MIDIGetPortInfo(CMTclientID, PortID);
+        
+                /*      Save new configurateion. */
+        CtoPstr(PortInfoResName);
+        AddResource(PortResH, portResType, PortInfoResID,
+            (ConstStr255Param) PortInfoResName);
+        PtoCstr((unsigned char *) PortInfoResName);
+        
+        ReportResError("SavePatch/AddResource()");
+        WriteResource(PortResH);
+        ReportResError("SavePatch/WriteResource()");
+        UpdateResFile(CurResFile());
+        ReportResError("SavePatch/UpdateResFile()");
+        ReleaseResource(PortResH);
+        ReportResError("SavePatch/ReleaseResource()");
+        
+        InitCursor();
+}
+#endif /* NYQUIST */
diff --git a/lib-src/libnyquist/nyquist/cmt/midimgr.h b/lib-src/libnyquist/nyquist/cmt/midimgr.h
new file mode 100644
index 0000000..790fc06
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/midimgr.h
@@ -0,0 +1,14 @@
+#define portResType                             'port'
+#define timePortResInfoID               128             
+#define inputPortResInfoID              129     
+#define outputPortResInfoID             130     
+
+
+
+extern short InputRefNum;   /* Input port reference number. */
+extern short OutputRefNum;  /* Output port reference number. */
+extern short TimeRefNum;    /* Time base port reference number. */
+
+void setup_midimgr(void);
+void finish_midimgr(void);
+void midi_show_errors();
diff --git a/lib-src/libnyquist/nyquist/cmt/moxc.c b/lib-src/libnyquist/nyquist/cmt/moxc.c
new file mode 100644
index 0000000..f62d65d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/moxc.c
@@ -0,0 +1,669 @@
+/* MOXC -- a C version of Collinge's MOXIE language */
+/* Copyright 1989 Carnegie Mellon University */
+
+/*****************************************************************************
+*       Change Log
+*  Date     | Change
+*-----------+-----------------------------------------------------------------
+* 31-Dec-85 | Modified for use with midi
+*  5-Feb-86 | Added m_rest and m_restuntil allowing rests at top level
+* 28-May-86 | Added command line parsing
+*  4-Jun-86 | changed keyevent to separate calls for each event type
+* 10-Jul-86 | put loop in mainscore with prompt to play and replay
+* 03-Jun-88 | modified for portability (AMIGA) -JCD
+* 07-Jul-89 | time bases -RBD
+* 31-Jan-90 | GWL : cleaned up for LATTICE
+* 30-Jun-90 | RBD : further changes
+*  2-Apr-91 | JDW : further changes
+*  4-Mar-91 | GWL : DOS allows odd inst addrs
+* 10-Oct-94 | nix : posicionador tridimensionale interface
+* 28-Apr-03 |  DM : true->TRUE, false->FALSE
+*****************************************************************************/
+
+#include "switches.h"
+
+#ifdef AMIGA
+#ifdef AZTEC
+#include "functions.h"
+#else
+#include "amiga.h"
+#endif
+#include "exec/exec.h"
+#include "cmtcmd.h"
+
+extern long event_mask; /* imported from midifns.c */
+#endif
+extern int abort_flag;  /*DMH: taken out of ifdef AMIGA for moxcrun*/
+
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "midifns.h"
+
+#include "cmdline.h"
+#include "midicode.h"
+#include "timebase.h"
+#include "moxc.h"
+
+#ifdef AMIGA /*DMH: only AMIGA cares about AMIGA's "proportional controllers"*/
+#include "prop1.h"
+#endif
+#ifdef POSICIONADOR_3D
+#include "pos3d.h"
+#include "pos3dbuf.h"
+#endif /* POSICIONADOR_3D */
+
+extern char *app_syntax;
+
+/***************************************************************************
+*
+*  IMPORTS:
+*       asciievent(k)           user-defined action for terminal input
+*       bendchange(ch, val)     user-defined pitch bend handler
+*       ctrlchange(ch, c, val)  user-defined control change handler
+*       keydown(ch, p, v)       user-defined MIDI note on handler
+*       keyup(ch, p)            user-defined MIDI note off handler
+*       mainscore()             user-defined first action(s)
+*       musicfns                lots of time and io functions
+*       peddown(ch)             user-defined pedal down handler
+*       pedup(ch)               user-defined pedal up handler
+*       touchchange(ch, val)    user-defined aftertouch handler
+*       app_syntax              string defining extra command line options
+*
+*  EXPORTS:
+*       
+*       cause(delay, routine, p1, p2, ..., p8)
+*       moxcdone -- set to TRUE to quit
+*       eventtime -- ideallized current time
+*
+*****************************************************************************/
+
+#define SAFEMOXC TRUE
+#define BREAKKEY 0x03
+
+int moxcdone;   /* flag to halt execution */
+time_type eventtime;    /* time of current call -- used to avoid        */
+                        /* timing errors due to finite execution speed  */
+time_type virttime;     /* virtual time of current call */
+timebase_type timebase; /* time base of current call */
+int mididecode = TRUE;  /* whether to decode messages or just call midievent */
+
+int debug = FALSE;
+int moxcdebug = FALSE;
+time_type next_wakeup;
+timebase_type default_base;
+
+#ifdef AMIGA
+int pub_port_signal;
+struct MsgPort pub_port;
+#endif
+
+/*****************************************************************************
+*       Routines local to this module
+*****************************************************************************/
+
+private void callrun();
+private void decode();
+private void moxcterm();
+
+/****************************************************************************
+*                           callallcancel
+* Inputs:
+*       timebase_queue
+* Effect: 
+*       return all calls to free list
+* Implementation:
+*             If timebase_queue is not empty, there's a pending call.  Remove the call
+*             (not necessarily the timebase) and repeat.
+****************************************************************************/
+
+void callallcancel()
+{
+    if (moxcdebug) gprintf(GDEBUG, "cancel all calls\n");
+    while (timebase_queue) {
+        timebase = timebase_queue;
+        timebase_queue = timebase->next;
+        while (timebase->heap_size > 0) {
+            call_free(remove_call(timebase));
+        }
+        insert_base(timebase);
+    }
+}
+
+/* catchup -- bring current timebase up to date by running its calls */
+/**/
+void catchup()
+{
+    register call_type call;
+    /* Remember where we're going in virtual time because setting the
+     * rate will also modify timebase->virt_base.  We don't want catchup
+     * to stop short:
+     */
+    time_type target_time = timebase->virt_base;
+    /* remember timebase here because it's possible that a call will do
+     * a timebase_use() and change it:
+     */
+    register timebase_type my_base = timebase;
+
+    while (my_base->heap_size != 0 &&
+           (my_base->heap[1]->u.e.time < target_time)) {
+        /* eventtime is the real time at which something was scheduled */
+        eventtime = (my_base->next_time) >> 8;
+        call = remove_call(my_base);
+        virttime = call->u.e.time;
+        (*(call->u.e.routine))(CALLARGS(call));
+        call_free(call);
+    }
+    /* now that we've possibly pulled events out of the timebase, adjust
+     * the position in the timebase queue (and possibly remove it).
+     */
+    remove_base(my_base);
+    insert_base(my_base);
+}
+
+
+
+/****************************************************************************
+*                               cause
+* Inputs:
+*       delay_type (long) delay: time before this call should occur
+*       int (*routine)(): routine that implements the call
+*       int p1 through p8: parameters to pass to routine
+* Effect: 
+*       builds a call and puts it in pending queue for later scheduling
+****************************************************************************/
+
+#ifndef DOTS_FOR_ARGS
+void cause(delay, routine, p)
+    delay_type  delay;
+    int (*routine)();
+    call_args_node p;
+#else
+#include <stdarg.h>
+
+void cause(delay_type delay, ...)
+/* note: the routine parameter is not checked because any routine type can
+   be passed as a parameter, but in the call struct it's an int (*)()
+ */
+#endif
+{
+    register call_type call = call_alloc();
+#ifdef DOTS_FOR_ARGS
+    va_list xp;
+#endif
+
+    if (!call) {
+        gprintf(ERROR, "cause: out of memory\n");
+        EXIT(1);
+    }
+
+#ifdef DOTS_FOR_ARGS
+    call->u.e.time = virttime + delay;
+    call->u.e.priority = 128; /* default priority */
+    va_start(xp, delay);
+    call->u.e.routine = (int (*)()) va_arg(xp, long *);
+    call->u.e.p = va_arg(xp, call_args_node);
+    va_end(xp);
+#else
+    call->u.e.time = virttime + delay;
+    call->u.e.priority = 128; /* default priority */
+    call->u.e.routine = routine;
+    call->u.e.p = p;
+#endif
+#ifdef SAFEMOXC
+    if (call->u.e.routine == 0) {
+        gprintf(ERROR,"cause called with NULL routine\n");
+        EXIT(1);
+#ifndef DOS     /* IBM allows odd addresses */
+#if (__APPLE__ != 1 || __i386__ != 1) /* Intel Mac allows odd addresses */
+    } else if (((long) call->u.e.routine) & 1) {
+        gprintf(ERROR, "cause called with bad routine address: 0x%lx\n",
+                call->u.e.routine);
+#ifndef GCC_MODEL_CPU
+#define GCC_MODEL_CPU "GCC_MODEL_CPU is undefined for this compilation"
+#endif
+		gprintf(ERROR, GCC_MODEL_CPU);
+        EXIT(1);
+#endif
+#endif
+    }
+#endif
+    /* put call in default queue */
+    callinsert(timebase, call);
+    if (moxcdebug) {
+        gprintf(GDEBUG,"(cause) call is pending on timebase 0x%x:\n", timebase);
+        callshow(call);
+    }
+}
+
+/****************************************************************************
+*                               causepri
+* Inputs:
+*       int delay: time before this call should occur
+*       int pri: priority, lowest priority goes first
+*       int (*routine)(): routine that implements the call
+*       int p1 through p8: parameters to pass to routine
+* Effect: 
+*       builds a call and puts it in pending queue for later scheduling
+****************************************************************************/
+
+#ifndef DOTS_FOR_ARGS
+void causepri(delay, pri, routine, p)
+    delay_type  delay;
+    int pri;
+    int (*routine)();
+    call_args_node p;
+#else
+/* already included stdarg.h */
+
+void causepri(delay_type delay, int pri, ...)
+#endif
+{
+    register call_type call = call_alloc();
+#ifdef DOTS_FOR_ARGS
+    va_list xp;
+#endif
+
+    if (!call) {
+        gprintf(ERROR, "cause: out of memory\n");
+        EXIT(1);
+    }
+
+#ifdef DOTS_FOR_ARGS
+    call->u.e.time = virttime + delay;
+    call->u.e.priority = pri; /* default priority */
+    va_start(xp, pri);
+    call->u.e.routine = (int (*)()) va_arg(xp, long *);
+    call->u.e.p = va_arg(xp, call_args_node);
+    va_end(xp);
+#else
+    call->u.e.time = virttime + delay;
+    call->u.e.priority = pri; /* default priority */
+    call->u.e.routine = routine;
+    call->u.e.p = p;
+#endif
+#ifdef SAFEMOXC
+    if (call->u.e.routine == 0) {
+        gprintf(ERROR,"cause called with NULL routine\n");
+        EXIT(1);
+#ifndef DOS     /* IBM allows odd addresses */
+#if (__APPLE__ != 1 || __i386__ != 1) /* Intel Mac allows odd addresses */
+    } else if (((long) call->u.e.routine) & 1) {
+        gprintf(ERROR, "causepri called with bad routine address: 0x%lx\n",
+                call->u.e.routine);
+        EXIT(1);
+#endif
+#endif
+    }
+#endif
+    /* put call in default queue */
+    callinsert(timebase, call);
+    if (moxcdebug) {
+        gprintf(GDEBUG,"(cause) call is pending:");
+        callshow(call);
+    }
+}
+
+/****************************************************************************
+*                               callrun
+* Inputs:
+*       call_type call: the call to execute
+* Effect: 
+*       executes the previously scheduled call call and deallocates it
+****************************************************************************/
+
+private void callrun()
+{
+    call_type call;
+    if (moxcdebug) {
+        gprintf(GDEBUG,"(callrun) running a call: \n");
+    }
+    /* remove from head of queue */
+    while (!timebase_queue) gprintf(TRANS, "callrun fatal error\n");
+    timebase = timebase_queue;
+    timebase_queue = timebase->next;
+
+    if (debug) gprintf(TRANS, "callrun time %ld\n", timebase->next_time);
+    eventtime = (timebase->next_time) >> 8; /* real time of the call */
+
+    /* remove first call from timebase */
+    call = remove_call(timebase);
+    if (debug) gprintf(TRANS, "callrun call %lx\n", (ulong)call);
+    insert_base(timebase);
+    virttime = call->u.e.time;          /* virtual time of the call */
+    if (moxcdebug) callshow(call);
+    (*(call->u.e.routine))(CALLARGS(call));
+    call_free(call);
+}
+
+/****************************************************************************
+*                                 m_restuntil
+* Inputs:
+*       int time: call time to rest until
+* Effect: 
+*       Waits until the specified time has been reached (absolute time).
+*       Other "caused" calls will take place during the rest provided
+*       this routine is called from "mainscore" (see m_rest description).
+****************************************************************************/
+void m_restuntil(time)
+  time_type time;
+{
+    time = virt_to_real(timebase, time);
+    while(time > gettime()) {
+        moxcwait(time);
+    }
+}
+
+
+/****************************************************************************
+*                                   m_rest
+* Inputs:
+*       int time: Amount of time to rest
+* Effect: 
+*       Waits until the amount of time specified has lapsed
+* Assumes:
+*       Must not be called from a "caused" routine.  Must only be called
+*       from "mainscore" or a routine called directly or indirectly from
+*       "mainscore" without using "cause".
+****************************************************************************/
+
+void m_rest(time)
+  time_type time;
+{
+    m_restuntil(time + real_to_virt(timebase, gettime()));      
+}
+
+/****************************************************************************
+*                               moxcinit
+* Inputs:
+*       int argc: number of command line arguments
+*       char * argv: command line argument array
+* Effect: initializes moxc system
+****************************************************************************/
+
+boolean moxcinit(argc, argv)
+    int argc;
+    char * argv[];
+{
+    meminit();
+    io_init();
+#ifdef AMIGA
+    pub_port_signal = AllocSignal(-1L);
+    pub_port.mp_Node.ln_Type = NT_MSGPORT;
+    pub_port.mp_SigBit = pub_port_signal;
+    pub_port.mp_SigTask = FindTask(0L);
+    pub_port.mp_Flags = PA_SIGNAL;
+    pub_port.mp_Node.ln_Name = "CMTcmdport";
+    pub_port.mp_MsgList.lh_Head =
+        (struct Node *)&pub_port.mp_MsgList.lh_Tail;
+    pub_port.mp_MsgList.lh_TailPred =
+        (struct Node *)&pub_port.mp_MsgList.lh_Head;
+    event_mask |= (1L << pub_port_signal);
+    AddPort(&pub_port);
+#endif
+    cu_register((cu_fn_type) moxcterm, NULL);
+    cl_syntax(midifns_syntax);
+    cl_syntax("debug<s>Enable verbose debugging;\
+        moxc<s>Enable moxc debug mode;");
+    cl_syntax(app_syntax);
+
+    if (!cl_init(argv, argc)) {
+        /* make sure user gets to read the error message(s): */
+        gprintf(TRANS, "Type anything to exit...");
+#ifdef  DOS
+        wait_ascii();
+#else
+        ggetchar();
+#endif
+        return FALSE;
+    }
+    debug = cl_switch("debug");
+    moxcdebug = cl_switch("moxc");
+    timebase = default_base = timebase_create(100);
+    default_base->rate = 2560L;
+
+    eventtime = 0L;
+    next_wakeup = MAXTIME;
+    musicinit();
+#ifdef POSICIONADOR_3D
+    ptInit();
+#endif
+    moxcdone = 0;
+    return TRUE;
+}
+
+
+/****************************************************************************
+*                               moxcwait
+* Input:
+*       -1 => wait for next keyboard or midi event or queued event
+*       0 => don't wait
+*       T => wait up to T for next keyboard or midi event or queued event
+*               (this is used by m_restuntil)
+* Assume: there is work to do (npending > 0 || evqueue) ??
+* Effect: dispatch on user inputs, cause calls
+****************************************************************************/
+
+void moxcwait(dateoftimeout)
+  time_type dateoftimeout;
+{
+    time_type maxtime = dateoftimeout;
+
+    if (timebase_queue) {
+        if ((timebase_queue->next_time >> 8) < maxtime) 
+            maxtime = (timebase_queue->next_time) >> 8;
+    }
+    eventwait(maxtime);
+    decode();
+}
+   
+
+/****************************************************************************
+*                               decode
+* Effect: dispatch on user inputs, cause calls
+****************************************************************************/
+
+private void decode()
+{
+    /* It is important that midi_data is on a word boundary because we
+        copy to it by doing a word transfer.
+     */
+    byte midi_data[4];
+    time_type now;
+    byte code;
+    char k;
+#ifdef AMIGA
+    struct cmd_msg *cmd;
+#endif
+
+    now = gettime();
+    timebase = default_base;
+    eventtime = now;
+    virttime = 0L;
+
+/*   gprintf(GDEBUG, "decode at time %ld\n", now); */
+
+/**********************************************
+* poll for and decode midi keyboard input 
+***********************************************/
+
+    while (getbuf(FALSE, midi_data)) {
+        /* only divide if necessary, divides take 100us on 8MHz 68000: */
+        if (virttime == 0)
+            virttime = real_to_virt(default_base, now);
+
+        /* short-circuit midi decoding */
+        if (!mididecode) {
+            midievent(midi_data);
+            continue;
+        }
+
+        code = midi_data[0] & MIDI_CODE_MASK;
+        if (code == MIDI_ON_NOTE) {
+            if (midi_data[2] == 0) {    /* velocity 0 -> note off */
+                 keyup(1+(midi_data[0] & MIDI_CHN_MASK), midi_data[1]);
+            } else {
+                keydown((midi_data[0] & MIDI_CHN_MASK)+1,
+                        midi_data[1], midi_data[2]);
+            }
+        } else if (code == MIDI_OFF_NOTE) {
+            keyup((midi_data[0] & MIDI_CHN_MASK)+1, midi_data[1]);
+        } else if (code == MIDI_TOUCH) {
+            touchchange((midi_data[0] & MIDI_CHN_MASK)+1,midi_data[1]);
+        } else if (code == MIDI_BEND) {
+            bendchange((midi_data[0] & MIDI_CHN_MASK)+1,
+                        midi_data[1] + (midi_data[2] << 7));
+        } else if (code == MIDI_CTRL && midi_data[1] == SUSTAIN) {
+            if (midi_data[2] == 0) pedup((midi_data[0] & MIDI_CHN_MASK) + 1);
+            else peddown((midi_data[0] & MIDI_CHN_MASK) + 1);
+        } else if (code == MIDI_CTRL) {
+            ctrlchange((midi_data[0] & MIDI_CHN_MASK) + 1,
+                        midi_data[1], midi_data[2]);
+        } else if (code == MIDI_CH_PROGRAM) {
+            prgmchange((midi_data[0] & MIDI_CHN_MASK) + 1, midi_data[1] + 1);
+/* think C midi driver doesn't handle sysex the way the Amiga drivers do (yet) */
+#ifndef MACINTOSH
+        } else if (code == MIDI_SYSEX) {
+            sysex();
+#endif
+        }
+    }
+
+/**********************************************
+* poll for ASCII keyboard input 
+***********************************************/
+    while (get_ascii(&k)) {
+        virttime = real_to_virt(default_base, now);
+        asciievent(k);
+        /* if user doesn't handle abort char in asciievent,
+           we should exit now to avoid an infinite loop */
+        if (abort_flag) EXIT(1);
+    }
+
+#ifdef POSICIONADOR_3D
+/**********************************************
+* poll for posicionador tridimensionale input
+**********************************************/
+    {
+         pt_value pt_data;
+         while (ptGetValue(&pt_data)) {
+             /* only divide if necessary, divides take 100us on 8MHz 68000: */
+             if (virttime == 0)
+                 virttime = real_to_virt(default_base, now);
+             ptevent(&pt_data);
+        }
+    }
+#endif /* POSICIONADOR_3D */
+
+#ifdef AMIGA
+/**********************************************
+* poll for proportional controller port 
+**********************************************/
+    if (prop_1_events) {
+        int events;
+
+        Disable();
+            events = prop_1_events;
+            prop_1_events = 0;
+        Enable();
+        
+        if (events & BUTTON_1_RIGHT_CHANGE)
+            buttonchange(3, prop_1_right_button);
+        if (events & BUTTON_1_LEFT_CHANGE)
+            buttonchange(2, prop_1_left_button);
+        if (events & PROP_1_LEFT_CHANGE)
+            propchange(2, prop_1_left_data);
+        if (events & PROP_1_RIGHT_CHANGE)
+            propchange(3, prop_1_right_data);
+    }
+
+/**********************************************
+* poll for input from public command port
+***********************************************/
+
+    while (cmd = (struct cmd_msg *) GetMsg(&pub_port)) {
+        struct symb_descr *desc = &HASHENTRY(lookup(cmd->symbol_name));
+/*      gprintf(TRANS, "got %lx (%s) from pub_port\n", cmd, cmd->symbol_name); */
+        virttime = real_to_virt(default_base, now);
+        if (!desc) {
+            gprintf(TRANS, "Error, symbol %s undefined.\n", cmd->symbol_name);
+        } else if (desc->symb_type != cmd->symb_type) {
+             gprintf(TRANS, "Error, wrong type for symbol %s\n",
+                cmd->symbol_name); 
+        } else if (cmd->symb_type == fn_symb_type) {
+/*          gprintf(TRANS, "Calling routine\n"); */
+            (*(desc->ptr.routine))(
+             (int) cmd->the_args[0], (int) cmd->the_args[1],
+             (int) cmd->the_args[2], (int) cmd->the_args[3],
+             (int) cmd->the_args[4], (int) cmd->the_args[5],
+             (int) cmd->the_args[6], (int) cmd->the_args[7]
+            );
+        } else if (cmd->symb_type == var_symb_type) {
+            *(desc->ptr.intptr) = (int) cmd->the_args[0];
+        } else if (cmd->symb_type == vec_symb_type) {
+            if (cmd->the_args[0] >= desc->size) {
+                gprintf(TRANS, "Error: Vector %s is of size %d\n",
+                        cmd->symbol_name, desc->size);
+            } else {
+                (desc->ptr.intptr)[cmd->the_args[0]] = cmd->the_args[1];
+/*              gprintf(TRANS, "vec: setting %lx\n",
+                        &(desc->ptr.intptr)[cmd->the_args[0]]); */
+            }
+        } else gprintf(TRANS, "Symbol Type Error\n");
+        ReplyMsg(&(cmd->msg));
+    }
+#endif
+/**********************************************
+* poll for next call in queue
+***********************************************/
+    now = (now + 1) << 8;  /* shift because next_time is also scaled,
+                            * add 256 because next_time has added priority */
+    if (debug)
+        gprintf(TRANS, "now %ld next_time %ld\n",
+                now, (timebase_queue ? timebase_queue->next_time : 1234));
+    /* give pending events priority, but every 100 events, loop to allow
+        input processing (user may want to give a "quit" command) */
+    for (k = 0; 
+          k < 100 && timebase_queue && (now > timebase_queue->next_time);
+          k++) {
+        callrun();
+    }
+/*******************
+* flush text output 
+********************/
+#ifdef MACINTOSH_OR_UNIX
+    gflush();
+#endif
+}
+
+
+/****************************************************************************
+*                               quit
+* Effect: tells moxc to shut down
+****************************************************************************/
+
+void quit()
+{
+    moxcdone = TRUE;
+}
+
+/* moxcrun -- schedule events until done */
+/**/
+void moxcrun()
+{
+    moxcdone = FALSE;
+    while (!moxcdone && !abort_flag) {          /* test for finish */
+        if (!timebase_queue) moxcdone = TRUE;
+        else moxcwait(MAXTIME);         /* do work */
+    }
+}
+
+/* moxcterm -- clean up after moxcinit */
+/**/
+private void moxcterm()
+{
+#ifdef AMIGA
+    FreeSignal((long) pub_port_signal);
+    RemPort(&pub_port);
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/moxc.h b/lib-src/libnyquist/nyquist/cmt/moxc.h
new file mode 100644
index 0000000..975ebb9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/moxc.h
@@ -0,0 +1,44 @@
+/* moxc.h -- functions exported by moxie.c */
+/* Copyright 1989 Carnegie Mellon University */
+
+#define maxparms 8
+
+extern timebase_type timebase;
+extern time_type eventtime, virttime;
+extern int debug;
+extern int mididecode;
+extern int moxcdone;
+
+void    catchup(void);
+void    callallcancel(void);
+#ifdef DOTS_FOR_ARGS
+void    cause(delay_type delay, ...);
+void    causepri(delay_type delay, int pri, ...);
+#else
+void    cause();
+void	causepri();
+#endif
+void    m_rest(time_type time);
+void    m_restuntil(time_type time);
+void    quit(void);
+boolean moxcinit(int argc, char * argv[]);
+void    moxcrun(void);
+void    moxcwait(time_type dateoftimeout);
+
+void asciievent(char k);
+void bendchange(int chan, int value);
+void coda(void);
+void ctrlchange(int chan, int ctrl, int value);
+void keydown(int chan, int key, int vel);
+void keyup(int chan, int key);
+void mainscore(void);
+void midievent(byte midi_data[4]);
+void peddown(int chan);
+void pedup(int chan);
+void prgmchange(int chan, int prgm);
+void touchchange(int chan, int value);
+#ifdef AMIGA
+void buttonchange(int number, int value);
+void propchange(int number, int value);
+#endif
+void sysex(void);
diff --git a/lib-src/libnyquist/nyquist/cmt/musiprog.h b/lib-src/libnyquist/nyquist/cmt/musiprog.h
new file mode 100644
index 0000000..ddd9f95
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/musiprog.h
@@ -0,0 +1,31 @@
+/* musiprog.h -- include file for cmt application programs */
+
+#include "stdio.h"
+#include "cext.h"
+#include "midifns.h"
+#include "userio.h"
+#include "timebase.h"
+#include "moxc.h"
+
+/*
+ * override the definition of l_rest - l_rest is not recommended because
+ * it stops polling for input.  If you really want to use it, use #undef
+ * to make it visible.
+ */
+#define l_rest(d) m_rest(d)
+#define l_restuntil(t) m_restuntil(t)
+
+/*
+ * The default implementation of rest() and restuntil() poll for
+ * input during the rest.  You might call rest() or restuntil() from
+ * mainscore(), but it is generally a bad idea to rest at all. If
+ * you are in a rest(), you get an event, e.g. keydown(), and you 
+ * make a nested call to rest(), the original rest will be locked out
+ * until the nested one returns.  It's better to use cause().
+ */
+#define rest(x) l_rest( (long) x )
+#define restuntil(x) l_restuntil( (long) x)
+
+#define repeat(var, count) {int var; for (var=1; var <= count; var++) {
+#define endrep ;}}
+
diff --git a/lib-src/libnyquist/nyquist/cmt/pitch.h b/lib-src/libnyquist/nyquist/cmt/pitch.h
new file mode 100644
index 0000000..ab6dd9c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/pitch.h
@@ -0,0 +1,9 @@
+/* mbc code */
+/* Copyright 1989 Carnegie Mellon University */
+
+typedef struct pitch_struct {
+    int ppitch;
+    int pbend;
+} 
+pitch_table;
+/* end */
diff --git a/lib-src/libnyquist/nyquist/cmt/record.c b/lib-src/libnyquist/nyquist/cmt/record.c
new file mode 100644
index 0000000..44f2373
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/record.c
@@ -0,0 +1,638 @@
+/* record.c -- keyboard to adagio recorder
+ * Copyright 1989 Carnegie Mellon University
+ *
+ * the interface consists of three routines:
+ *      rec_init()      -- initialization
+ *      rec_event(byte *data)   -- called to insert (record) midi data, 
+ *                              -- returns FALSE if no more space
+ *      rec_final()     -- called to finish up
+ */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+* 27-Feb-86 | Created changelog
+*           | Use pedal information when computing durations (code taken
+*           |  from transcribe.c)
+* 23-Mar-86 | Determine size of transcription when rec_init is called.
+* 21-May-86 | Major rewrite to use continuous controls (code taken 
+*           |  from transcribe.c)
+*  1-Aug-87 | F.H. Changed rec_init() to new memory handling.
+* 17-Oct-88 | JCD : portable version.
+* 31-Jan-90 | GWL : cleaned up for LATTICE
+* 30-Jun-90 | RBD : further changes
+*  2-Apr-91 | JDW : further changes
+* 28-Apr-03 | DM  : changed for portability; true->TRUE, false->FALSE
+*****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cext.h"
+#include "midifns.h"
+#include "userio.h"
+#include "midicode.h"
+#include "record.h"
+#include "cmdline.h"
+
+extern long space;    /* how much space is left? */
+
+int debug_rec = FALSE;    /* verbose debug flag for this module */
+
+long max_notes = -1L;    /* -1 is flag that space must be allocated */
+
+time_type previous_time;
+
+/****************************************************************
+* data structure notes: the midi stream is stored as an array 
+* of 4-byte records, each of which is either a time or midi
+* data.     Midi data always begins with a control byte (high
+* order bit set), and it is assumed times are positive (high
+* order bit clear), so the two are easy to distinguish
+* IF THE COMPILER PUTS THESE BITS IN THE SAME PLACE.  It looks
+* like the high order byte of the time lines up with the last
+* byte of a 4 byte array, so we will always set the high order
+* bit of the last array byte when the first 3 bytes are filled
+* with MIDI data.  This is refered to as the "tag" bit.
+* WARNING: Lattice C longs are UNSIGNED, therefore always
+* positive.  Test the high order bit with a mask.
+****************************************************************/
+
+#define MIDI_CMD_BIT    0x80
+#define HIGH_BIT        0x80000000
+#define istime(note) (!(((note)->when) & HIGH_BIT))
+
+typedef union note_struct {
+    byte n[4];
+    long when;
+} 
+*note_type, note_node;
+
+private note_type event_buff;    /* pointer to allocated buffer */
+private note_type next;    /* pointer to next entry in buffer */
+private note_type last;    /* pointer to last entry in buffer */
+private int pile_ups;    /* inner loop iteration count */
+private int max_pile_up;    /* maximum of pile_ups */
+private boolean fixed_octave;	/* used to avoid many error messages */
+
+/****************************************************************************
+*    Routines local to this module
+****************************************************************************/
+private void    bend_filter();
+private void    byteorder();
+private void    ctrl_filter();
+private int    event_bend();
+private void    filter();
+private long    getdur();
+private long    getnext();
+private char    map_ctrl();
+private void    output();
+
+/****************************************************************************
+*               bend_filter
+* Inputs:
+*    note_type note: the current note
+*    note_type last: the last recorded event
+*    long now: the current time
+* Effect:
+*    remove pitch bend events in same 0.01 sec time slot
+* Implementation:
+*    If the current event is a pitch bend that bends again
+*    in the same time slot, make it a no-op by replacing it with
+*    the time.
+****************************************************************************/
+
+private void bend_filter(note, last, now)
+note_type note;    /* current note */
+note_type last;    /* the last recorded event */
+long now;       /* the current time */
+{
+    /* first see if there is another bend in this time
+         * slot.
+         */
+    note_type note2 = note + 1;
+    while (note2 < last) {
+        if (istime(note2) && (note2->when > now)) {
+            break; /* new time slot */
+        } 
+        else if (note->n[0] == note2->n[0]) {
+            note->when = now;
+            return; /* found another bend */
+        }
+        note2++;
+    }
+}
+
+/****************************************************************************
+*               byteorder
+* Effect: 
+*    check out assumptions about byte order and placement
+****************************************************************************/
+
+private void byteorder()
+{
+    note_node test_event;
+    if ((sizeof(test_event) != 4) ||
+        (sizeof(test_event.when) != 4) ||
+        (sizeof(test_event.n[0]) != 1)) {
+        gprintf(ERROR, "implementation error: size problem\n");
+        EXIT(1);
+    }
+    test_event.n[0] = 0x12;
+    test_event.n[1] = 0x34;
+    test_event.n[2] = 0x56;
+    test_event.n[3] = 0x78;
+    if ((test_event.when != 0x78563412) &&
+        (test_event.when != 0x12345678)) {
+        gprintf(ERROR, "implementation error: layout problem\n");
+        EXIT(1);
+    }
+}
+
+/****************************************************************************
+*               ctrl_filter
+* Inputs:
+*    note_type note: the current note
+*    note_type last: the last recorded event
+*    long now: the current time
+* Effect:
+*    remove ctrl change events in same 0.01 sec time slot
+* Implementation:
+*    If the current event is a control change that changes again
+*    in the same time slot, make it a no-op by replacing it with
+*    the time.
+****************************************************************************/
+
+private void ctrl_filter(note, last, now)
+note_type note;    /* the current note */
+note_type last;    /* the last recorded event */
+long now;       /* the current time */
+{
+    /* see if there is another control change in this time
+         * slot.
+         */
+    note_type note2 = note+1;
+    while (note2 < last) {
+        if (istime(note2) && (note2->when > now)) {
+            break;    /* new time slot */
+        } 
+        else if ((note->n[0] == note2->n[0]) &&
+            (note->n[1] == note2->n[1])) {
+            note->when = now;
+            return; /* found another change */
+        }
+        note2++;
+    }
+}
+
+/****************************************************************************
+*               event_bend
+* Inputs:
+*    note_type note: pointer to a pitch bend event
+* Outputs:
+*    returns int: an 8 bit pitch bend number
+****************************************************************************/
+
+private int event_bend(note)
+note_type note;
+{
+    return((int) (((note->n[1]) >> 6) + ((note->n[2]) << 1)));
+}
+
+/****************************************************************************
+*               filter
+* Inputs:
+*    note_type last: the last note recorded
+* Effect: allow only one control change per time slot (0.01 sec)
+* Implementation:
+*    call ctrl_filter and bend_filter to overwrite control changes with
+*    noop data (the current time is used as a noop)
+****************************************************************************/
+
+private void filter(last)
+note_type last;
+{
+    note_type note;    /* loop control variable */
+    long now=0;   /* last time seen */
+    int command;    /* command pointed to by note */
+
+    for (note = event_buff; note <= last; note++) {
+        if (istime(note)) {
+            now = note->when;
+        } 
+        else {
+            command = note->n[0] & MIDI_CODE_MASK;
+
+            if (command == MIDI_CTRL &&
+                note->n[1] == SUSTAIN) {
+                /* do nothing */;
+            } 
+            else if (command == MIDI_CTRL) {
+                ctrl_filter(note, last, now);
+            } 
+            else if (command == MIDI_TOUCH) {
+                bend_filter(note, last, now);    /* bend and touch use the */
+            } 
+            else if (command == MIDI_BEND) {    /*  same filter routines  */
+                bend_filter(note, last, now);
+            }
+        }
+    }
+}
+
+
+/****************************************************************************
+*               getdur
+* Inputs:
+*    int i: index of the note
+*    note_type last: pointer to the last event recorded
+*    int ped: TRUE if pedal is down at event i
+*    long now: the time at event i
+* Outputs:
+*    returns long: the duration of note i
+* Assumes:
+*    assumes i is a note
+* Implementation:
+*    This is tricky because of pedal messages.  The note is kept on by
+*    either the key or the pedal.  Keep 2 flags, key and ped.  Key is
+*    turned off when a key is released, ped goes off and on with pedal.
+*    Note ends when (1) both key and ped are FALSE, (2) key is
+*    pressed (this event will also start another note).
+****************************************************************************/
+
+private long getdur(i, last, ped, now)
+int i;
+note_type last;
+int ped;
+long now;
+{
+    int key = TRUE;    /* flag that says if note is on */
+    long start = now;
+    int chan = event_buff[i].n[0] & MIDI_CHN_MASK;
+    int pitch = event_buff[i].n[1];
+    note_type note = &(event_buff[i+1]);
+    int noteon; /* TRUE if a noteon message received on chan */
+    int keyon;    /* TRUE if noteon message had non-zero velocity */
+
+    /* search from the next event (i+1) to the end of the buffer:
+         */
+    for (; note < last; note++) {
+        if (istime(note)) {
+            now = note->when;
+        } 
+        else {
+            noteon = keyon = FALSE;
+            if ((note->n[0] & MIDI_CHN_MASK) == chan) {
+                noteon = ((note->n[0] & MIDI_CODE_MASK) == MIDI_ON_NOTE) &&
+                    (note->n[1] == pitch);
+                keyon = noteon && (note->n[2] != 0);
+                if ((noteon && (note->n[2] == 0)) ||
+                    (((note->n[0] & MIDI_CODE_MASK) == MIDI_OFF_NOTE) &&
+                    (note->n[1] == pitch))) key = FALSE;
+                if (((note->n[0] & MIDI_CODE_MASK) == MIDI_CTRL) &&
+                    note->n[1] == SUSTAIN && note->n[2] == 127) ped = TRUE;
+                if (((note->n[0] & MIDI_CODE_MASK) == MIDI_CTRL) &&
+                    note->n[1] == SUSTAIN && note->n[2] == 0) ped = FALSE;
+
+                if ((!key && !ped) || keyon)
+                    return(now - start);
+            }
+        }
+    }
+    return(last->when - start);
+}
+
+/****************************************************************************
+*               getnext
+* Inputs:
+*    int i: the index of the current note
+*    note_type last: pointer to last valid data
+*    long now: the current time
+* Outputs:
+*    returns long: the time of the next note, program, or control change
+*       (returns time of last event if nothing else is found)
+****************************************************************************/
+
+private long getnext(i, last, now)
+int i;    /* the index of the current note */
+note_type last;    /* pointer to last valid data */
+long now;    /* the current time */
+{
+    i++;    /* advance to next item */
+    for (; event_buff + i < last; i++) {
+        note_type note = &(event_buff[i]);
+        int cmd = note->n[0] & MIDI_CODE_MASK;
+
+        if (istime(note)) {
+            now = note->when;
+        } 
+        else if (((cmd == MIDI_ON_NOTE) &&
+            (note->n[2] != 0)) /* note on */ ||
+            (cmd == MIDI_CH_PROGRAM) /* program change */ ||
+            ((cmd == MIDI_CTRL) &&
+            (note->n[1] != SUSTAIN) /* control change */ ) ||
+            (cmd == MIDI_TOUCH) ||
+            (cmd == MIDI_BEND)) {
+            return(now);
+        }
+    }
+    return(last->when);
+}
+
+/****************************************************************************
+*               map_ctrl
+* Inputs:
+*    int control: a midi control number
+* Outputs:
+*    returns char: an adagio control change command letter, EOS if
+*       control change is not one of PORTARATE, PORTASWITCH,
+*       MODWHEEL, FOOT
+****************************************************************************/
+
+private char map_ctrl(control)
+int control;
+{
+    switch (control) {
+/* 'J' is no longer code for PORTARATE
+      case PORTARATE:
+        return 'J'; */
+      case PORTASWITCH:
+        return 'K';
+      case MODWHEEL:
+        return 'M';
+      case VOLUME:
+        return 'X';
+      default:
+        return EOS;
+    }
+#ifdef LATTICE322
+    return EOS;    /* make Lattice C type checker happy */
+#endif
+}
+
+/****************************************************************************
+*               output
+* Inputs:
+*    FILE *fp: an opened file pointer
+*    note_type last: the last data in the buffer
+*    boolean absflag: set to TRUE if first line of the adagio score should
+*       include the absolute time
+* Effect: 
+*    write adagio file using data in event_buff
+* Implementation:
+*    NOTE: put all program changes in rests
+*    use N(ext) notation for all timing
+*    output no more than one continuous parameter change per
+*    clock tick for each continuous change parameter
+****************************************************************************/
+
+private void output(fp, last, absflag)
+FILE *fp;
+note_type last;
+boolean absflag;
+{
+    int i;                      /* loop counter */
+    int command;                /* the current command */
+    int voice;			/* the midi channel of the current event */
+    int last_velocity = -1;	/* used to filter repeated Lnn attributes */
+    int last_voice = 0; 	/* the default adagio channel (1) */
+    int ped = FALSE;            /* flag maintains state of pedal */
+    int how_many = last - event_buff;
+    long now=0;                 /* the time of the next event */
+
+    if (fp == NULL) {
+        gprintf(ERROR, "internal error: output called with NULL file.\n");
+        EXIT(1);
+    }
+
+    if (debug_rec)
+        gprintf(GDEBUG,"hint: if file is not being closed, decrease MAXSPACE\n");
+
+
+    fprintf(fp, "!MSEC\n");     /* times will be in milliseconds */
+    /* set the initial absolute time, all other times are relative */
+
+    if (absflag) {
+        now = event_buff[0].when;
+        if (now < 0) {
+            fprintf(fp, "* First event took place at Adagio time %d,\n",
+                    (int)now);
+            fprintf(fp, "*  but Adagio cannot represent negative times,\n");
+            fprintf(fp, "*  so this entire score will be %d ms late\n",
+                    (int)-now);
+            gprintf(TRANS, "First event took place at Adagio time %d!\n",
+                    (int)now);
+            gprintf(TRANS, "All events times will be %d ms late\n",
+                    (int)-now);
+            now = 0L;
+        }
+        fprintf(fp, "T%ld ", now);
+    }
+
+    for (i = 0; i < how_many; i++) {
+        if (debug_rec) {
+            gprintf(GDEBUG,"ev %d: %x %x %x (%ld)\n", i, event_buff[i].n[0],
+            event_buff[i].n[1], event_buff[i].n[2], event_buff[i].when);
+        }
+
+        if (istime(event_buff+i)) {
+            now = event_buff[i].when;
+            if (debug_rec) gprintf(GDEBUG,"i = %d, now = %ld\n", i, now);
+        } else {
+            boolean needs_voice = TRUE;
+            command = event_buff[i].n[0] & MIDI_CODE_MASK;
+            voice = event_buff[i].n[0] & MIDI_CHN_MASK;
+
+            if (command == MIDI_ON_NOTE && event_buff[i].n[2] != 0) {
+                int velocity =	event_buff[i].n[2];
+                write_pitch(fp, event_buff[i].n[1]);
+                fprintf(fp, " U%ld", getdur(i, last, ped, now));
+                if (last_velocity != velocity) {
+                    fprintf(fp, " L%d", velocity);
+                    last_velocity = velocity;
+                }
+            } else if (command == MIDI_CH_PROGRAM) {
+                fprintf(fp, "Z%d", event_buff[i].n[1] + 1);
+            } else if (command == MIDI_CTRL &&
+                event_buff[i].n[1] == SUSTAIN) {
+                ped = (event_buff[i].n[2] != 0);
+                needs_voice = FALSE;
+            } else if (command == MIDI_CTRL) {
+                char c = map_ctrl(event_buff[i].n[1]);
+                if (c != EOS) fprintf(fp, "%c%d", c, event_buff[i].n[2]);
+                else fprintf(fp, "~%d(%d)", event_buff[i].n[1], event_buff[i].n[2]);
+            } else if (command == MIDI_TOUCH) {
+                fprintf(fp, "O%d", event_buff[i].n[1]);
+            } else if (command == MIDI_BEND) {
+                fprintf(fp, "Y%d", event_bend(&event_buff[i]));
+            } else if (command == MIDI_ON_NOTE || command == MIDI_OFF_NOTE) {
+                needs_voice = FALSE; /* ignore note-offs */
+            } else {
+                gprintf(ERROR, "Command 0x%x ignored\n", command);
+                needs_voice = FALSE;
+            }
+            if (needs_voice) {
+                if (last_voice != voice) {
+                    fprintf(fp, " V%d", voice + 1);
+                    last_voice = voice;
+                }
+                fprintf(fp, " N%d", (int)(getnext(i, last, now) - now));
+                fprintf(fp, "\n");
+            }
+        }
+    }
+}
+
+
+/****************************************************************************
+*               write_pitch
+* Inputs:
+*    FILE *fp: an open file
+*    int p: a pitch number
+* Effect: write out the pitch name for a given number
+****************************************************************************/
+
+void write_pitch(FILE *fp, int p)
+{
+    static char *ptos[] = {
+        "C", "CS", "D", "EF", "E", "F", "FS", "G",
+        "GS", "A", "BF", "B"	};
+    /* avoid negative numbers: adagio can't express lowest octave: */
+    while (p < 12) {
+        if (!fixed_octave) {
+            gprintf(ERROR, "%s%s%s",
+                    "A low note was transposed up an octave\n",
+                    "(Adagio cannot express the lowest MIDI octave).\n",
+                    "This message will appear only once.\n");
+            fixed_octave = TRUE;
+        }
+        p += 12;
+    }
+    fprintf(fp, "%s%d", ptos[p % 12], (p / 12) - 1);
+}
+
+/**********************************************************************
+*           rec_final
+* Inputs:
+*    boolean absflag: output absolute time of first note if TRUE
+* Effect:
+*    Write recorded data to a file
+**********************************************************************/
+
+void rec_final(FILE *fp, boolean absflag)
+{
+    next->when = gettime();
+    last = next;
+    if (debug_rec) gprintf(GDEBUG,"max_pile_up = %d, ", max_pile_up);
+    gprintf(TRANS,"%ld times and events recorded.\n", 
+                  (long) (last - event_buff));
+    filter(last);
+    output(fp, last, absflag);
+    fclose(fp);
+    FREE(event_buff);
+    max_notes = -1;
+}
+
+/****************************************************************************
+*               rec_init
+* Inputs:
+*    char *file:  pointer to file name from command line (if any)
+*    boolean bender: TRUE if pitch bend should be enabled
+* Outputs:
+*    return TRUE if initialization succeeds
+* Effect:
+*    prepares module to record midi input
+****************************************************************************/
+
+/* ENOUGH_ROOM says if we have room for 10000 events + 10000 timestamps =
+ * 20000 note_struct's, then that's "enough room" for recording a sequence.
+ * If more ram is available, it won't be used.  If less is available, we'll
+ * use as much as we can get, minus "SPACE_FOR_PLAY", which leaves a little
+ * bit of spare ram in case Moxc or stdio need to allocate some space.
+ *      For DOS, we limit recording space to 64K.
+ */
+#ifdef DOS
+#define ENOUGH_ROOM 64000L
+#else
+#define ENOUGH_ROOM (20000L * sizeof(union note_struct))
+#endif
+
+
+boolean rec_init(boolean bender)
+{
+    size_t biggestChunk, spaceForRecord;
+
+    debug_rec = cl_switch("debug");
+    byteorder();
+    pile_ups = 0;
+    max_pile_up = 0;
+    previous_time = (unsigned) -1L; /* this will force putting in initial timestamp */
+    fixed_octave = FALSE;
+
+    if (max_notes == -1) {    /* allocate space 1st time rec_init called */
+        biggestChunk = AVAILMEM;
+        if (biggestChunk <= SPACE_FOR_PLAY) {
+            /* not enough memory; give up */
+            return(FALSE);
+        } 
+        else {
+            spaceForRecord =
+                MIN((biggestChunk - SPACE_FOR_PLAY), ENOUGH_ROOM);
+            /* leave SPACE_FOR_PLAY contiguous bytes of memory */
+        }
+        max_notes = spaceForRecord / sizeof(note_node);
+        /*    gprintf(GDEBUG,"max_notes = %d\n", max_notes);*/
+        event_buff = (note_type) MALLOC(spaceForRecord);
+        if (event_buff == NULL) {
+            /* should never happen */
+            gprintf(FATAL, "Implementation error (record.c): getting memory.");
+            return FALSE;
+        }
+    }
+    next = event_buff;
+    last = event_buff + max_notes - 2; /* it is critical that last not point
+                                        * to the very last storage loc */
+    midi_cont(bender);
+    return((boolean)(max_notes > 10));
+    /* it would be silly to record with only room enough for 10 notes! */
+}
+
+
+/****************************************************************************
+*               rec_event
+* Inputs:
+*    long time: the current time
+*    long data: midi data to record
+* Outputs:
+*    returns FALSE if there is no more memory
+* Effect: reads and stores any input
+* Implementation:
+*    time stamps and midi events share the same buffer of 4-byte events
+*    save time at most once per call to rec_poll
+*    save time only if it changes
+****************************************************************************/
+
+boolean rec_event(long *data, time_type time)
+{
+    /* can't allow negative time because sign bit distinguishes 
+     * data from time: */
+    if (time < 0) time = 0;
+
+    if (previous_time != time) {
+        next++->when = previous_time = time;
+        if (next >= last) goto overflow;
+    }
+
+    next->when = *data;
+    next++->n[3] = MIDI_CMD_BIT;        /* set tag bit */
+    if (next >= last) goto overflow;
+    return TRUE;
+
+overflow:
+    next = last; /* last doesn't really point to last storage */
+    gprintf(ERROR, "No more memory.\n");
+    return FALSE;
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/record.h b/lib-src/libnyquist/nyquist/cmt/record.h
new file mode 100644
index 0000000..de1479d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/record.h
@@ -0,0 +1,6 @@
+/* Copyright 1989 Carnegie Mellon University */
+
+boolean rec_init(boolean bender);
+boolean rec_event(long *data, time_type time);
+void rec_final(FILE *fp, boolean absflag);
+void write_pitch(FILE *fp, int p);
diff --git a/lib-src/libnyquist/nyquist/cmt/seq.c b/lib-src/libnyquist/nyquist/cmt/seq.c
new file mode 100644
index 0000000..eb7fc04
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seq.c
@@ -0,0 +1,1210 @@
+/* seq.c -- implement adagio scores as abstract data type */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+*  2-Apr-91 | JDW : further changes
+* 16-Feb-92 | GWL : use reg_timebase in seq_play()
+* 28-Apr-03 |  DM : false->FALSE, true->TRUE, portability changes
+* 19-May-03 | RBD : no longer assume seq->current remains untouched between 
+*           |       note inserts
+*****************************************************************************/
+
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "midicode.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
+#include "seq.h"
+#include "string.h"
+
+extern int moxcdebug;
+extern timebase_type default_base;
+
+boolean seq_print = FALSE;      /* debugging print switch */
+
+seq_type sequence;      /* this is a global to be accessed by routines called
+                         * from the sequence */
+
+/* clock state: */
+time_type clock_ticksize;       /* millisec per tick shifted 16 bits */
+boolean clock_running = FALSE;  /* TRUE if clock is running */
+boolean external_midi_clock = FALSE;
+boolean suppress_midi_clock = FALSE;
+
+private void insert_event();
+private void process_event();
+
+private char *chunk_alloc();
+private void clock_tick();
+private void ramp_event(seq_type seq, event_type event, unsigned int value,
+    unsigned int to_value, int increment, time_type step, int n);
+/*private*/ void send_macro();
+
+/* chunk_alloc -- allocate data for a sequence */
+/*
+ * NOTE: This assumes one chunk is already allocated.
+ * The first chunk holds shared sequence information in 
+ * the info struct, and by convention this is always in
+ * the first chunk.
+ */
+private char *chunk_alloc(seq_type seq, int size)
+{
+    chunk_type chunk = seq->chunklist->u.info.last_chunk;
+    /* gprintf(TRANS, "chunk_alloc: seq %lx size %d\n", seq, size); */
+    if (size & 1) size++;	/* make it even */
+    if (chunk->free + size >= CHUNK_SIZE) {
+        chunk_type new_chunk = chunk_create(FALSE);
+        if (!chunk) {
+            gprintf(FATAL, "Out of memory while reading seq\n");
+            return NULL;
+        }
+        /* add new_chunk to chunk chain */
+        seq->chunklist->u.info.last_chunk = new_chunk;
+        chunk->next = new_chunk;
+        chunk = new_chunk;
+    }
+    chunk->free += size;
+    return &(chunk->u.data[chunk->free - size]);
+}
+
+
+/* chunk_create -- create a new chunk for seq data */
+/*
+ * If this is the first chunk, set first_flag to reserve
+ * space for the info structure.
+ */
+chunk_type chunk_create(boolean first_flag)
+{
+    chunk_type result = (chunk_type) memget(sizeof(chunk_node));
+    if (result) {
+        result->next = NULL;
+        result->u.info.refcount = 1;  /* pre-initialize for caller */
+        result->free = 0;
+        if (first_flag) {
+            result->free = sizeof(struct info_struct);
+            result->u.info.last_chunk = result;
+            result->u.info.dictionary = NULL;
+            result->u.info.eventlist = NULL; 
+            result->u.info.ctrlcount = 0;
+            result->u.info.notecount = 0;
+            result->u.info.duration = 0;
+            result->u.info.used_mask = 0;
+        }
+    }
+    /* gprintf(TRANS, "chunk_create: got %lx (size %d)\n", */
+                   /* result, sizeof(chunk_node)); */
+    return result;
+}
+
+/* clock_tick -- advance the clock and send a tick */
+/**/
+private void clock_tick(seq, fraction)
+  seq_type seq;
+  time_type fraction;
+{
+    int delay;
+    fraction += clock_ticksize;
+    delay = fraction >> 16;
+    fraction &= 0xFFFF;
+    if (seq->runflag && clock_ticksize && seq->note_enable) {
+        midi_clock();
+        cause((delay_type)delay, clock_tick, seq, fraction);
+    } else {
+        clock_running = FALSE;
+        midi_stop();
+        midi_clock(); /* stop takes effect on next clock, so provide one */
+    }
+}
+
+private void cycle(seq)
+  seq_type seq;
+{
+    seq_reset(seq);
+    seq_play(seq);
+}
+
+
+
+/****************************************************************************
+*               event_create
+* Inputs:
+*    seq_type seq: the seq to hold the event
+*    int size: the size of the event in bytes
+*    time_type etime: the time of the event
+*    int eline: the line number of the event
+* Returns:
+*    event_type: a new event structure or
+*               NULL if there is not enough memory left
+* Effect:
+*    allocates memory from the chunk, then heap as needed
+* Implementation:
+*    to reduce the per block storage overhead, we allocate memory in
+*    large chunks and do our own allocation.  Allocate from first
+*    chunk first.  If full, allocate a new chunk.
+* WARNING: this implementation assumes that individual events are never freed!!
+****************************************************************************/
+
+private event_type event_create(seq, size, etime, eline)
+  seq_type seq;
+  int size;
+  time_type etime;
+  int eline;
+{
+    event_type result = (event_type) chunk_alloc(seq, size);
+    if (result) {
+        result->ntime = etime;
+        result->nline = eline;
+        /* since we know the time, we can insert now: */
+        insert_event(seq, result);
+        seq_duration(seq) = MAX(seq_duration(seq), etime);
+    }
+    return result;
+}
+
+
+/* insert_call -- add a call event to the seq */
+/**/
+event_type insert_call(seq, ctime, cline, voice, addr, value, n)
+  seq_type seq;
+  time_type ctime;
+  int cline;
+  int voice;
+  int (*addr)();
+  long value[SEQ_MAX_PARMS];
+  int n;
+{
+    int i;
+    register event_type event = event_create(seq, callsize, ctime, cline);
+    if (seq_print) {
+        gprintf(TRANS, 
+            "call(%lx): time %ld, line %d, voice %d, fn %lx,\n\tvalues:",
+            event, ctime, cline, voice, addr);
+        for (i = 0; i < n; i++) gprintf(TRANS, " %ld", value[i]);
+        gprintf(TRANS, "\n");
+    }
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = CALL_VALUE;
+        event->u.call.routine = addr;
+        /* save the arguments */
+        for (i = 0; i < n; i++) event->u.call.args.a[i] = value[i];
+        seq_ctrlcount(seq)++;
+    }
+    return event;       
+}
+
+  
+/* insert_clock -- add a clock cmd to the seq */
+/**/
+event_type insert_clock(seq, ctime, cline, ticksize)
+  seq_type seq;
+  time_type ctime;
+  int cline;
+  time_type ticksize;
+{
+    register event_type event = event_create(seq, clocksize, ctime, cline);
+
+    if (seq_print) {
+        gprintf(TRANS, "clock(%lx): time %ld, line %d\n", event, ctime, cline);
+    }
+    if (event) {
+        event->nvoice = ctrl_voice(ESC_CTRL, 1);
+        event->value = CLOCK_VALUE;
+        event->u.clock.ticksize = ticksize;
+        seq_ctrlcount(seq)++;
+    }
+    return event;
+}
+
+
+/* insert_ctrl -- add a control to the seq */
+/**/
+event_type insert_ctrl(seq, ctime, cline, ctrl, voice, value)
+  seq_type seq;
+  time_type ctime;
+  int cline;
+  int ctrl;
+  int voice;
+  int value;
+{
+    register event_type event = event_create(seq, ctrlsize, ctime, cline);
+    if (seq_print) {
+        gprintf(TRANS,
+            "ctrl(%lx): time %ld, line %d, ctrl %d, voice %d, value %d\n",
+            event, ctime, cline, ctrl, voice, value);
+    }
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ctrl, voice);
+        event->value = value;
+        seq_ctrlcount(seq)++;
+    }
+    return event;
+}
+
+
+/* insert_ctrlramp -- add a control ramp event to the seq */
+/**/
+event_type insert_ctrlramp(seq, rtime, rline, voice, step, dur, ctrl, v1, v2)
+  seq_type seq;
+  time_type rtime;
+  int rline;
+  int voice;
+  time_type step;
+  time_type dur;
+  int ctrl;
+  int v1, v2;
+{
+    register event_type event = event_create(seq, ctrlrampsize, rtime, rline);
+    if (seq_print) {
+        gprintf(TRANS, 
+            "ctrlramp(%lx): time %ld, line %d, step %ld, dur %ld, ctrl %d, voice %d\n",
+            event, rtime, rline, step, dur, ctrl, voice);
+        gprintf(TRANS, "\tfrom %d to %d\n", v1, v2);
+    }
+
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = CTRLRAMP_VALUE;
+        if (dur <= 0) dur = 1L; /* don't allow zero duration */
+        event->u.ramp.dur = dur;
+        event->u.ramp.ctrl = ctrl;
+        if (step <= 0) step = 1; /* don't allow zero step size */
+        event->u.ramp.step = (short) step;
+        event->u.ramp.u.ctrl.from_value = v1;
+        event->u.ramp.u.ctrl.to_value = v2;
+        seq_ctrlcount(seq)++;
+        seq_duration(seq) = MAX(seq_duration(seq), rtime + dur);
+    }
+    return event;
+}
+
+
+/* insert_def -- add a definition to the dictionary */
+/**/
+def_type insert_def(seq, symbol, definition, deflen)
+  seq_type seq;
+  char *symbol;
+  unsigned char *definition;
+  int deflen;
+{
+    int i;
+    def_type defn = (def_type) chunk_alloc(seq, sizeof(def_node));
+    defn->symbol = chunk_alloc(seq, strlen(symbol) + 1);
+    defn->definition = (unsigned char *) chunk_alloc(seq, deflen);
+    strcpy(defn->symbol, symbol);
+    for (i = 0; i < deflen; i++) {
+        defn->definition[i] = definition[i];
+    }
+    defn->next = seq_dictionary(seq);
+    seq_dictionary(seq) = defn;
+    if (seq_print) {
+        gprintf(TRANS, "def(%ld): symbol %s defn \n", defn, symbol);
+        for (i = 0; i < deflen; i++) gprintf(TRANS, "%x", definition[i]);
+        gprintf(TRANS, "\n");
+    }
+    return defn;
+}
+
+
+/* insert_deframp -- add a def ramp event to the seq */
+/**/
+event_type insert_deframp(seq, rtime, rline, voice, step, dur,
+                          def, nparms, parms, parm_num, to_value)
+  seq_type seq;
+  time_type rtime;
+  int rline;
+  int voice;
+  time_type step;
+  time_type dur;
+  def_type def;
+  int nparms;           /* number of parameters for macro */
+  short parms[];        /* actual parameter vector */
+  int parm_num;         /* which of the actual parameters to ramp */
+  int to_value;         /* final destination of ramp */
+{
+    register event_type event = event_create(seq, deframpsize, rtime, rline);
+    if (seq_print) {
+        int i;
+        gprintf(TRANS, 
+            "deframp(%ld): time %ld, line %d, voice %d, step %ld, dur %ld\n",
+            event, rtime, rline, voice, step, dur);
+        gprintf(TRANS, "def %ld, parms");
+        for (i = 0; i < nparms; i++) gprintf(TRANS, " %d", parms[i]);
+        gprintf(TRANS, "parm_num %d to %d\n", parm_num, to_value);
+    }
+    if (event) {
+        int i;
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = DEFRAMP_VALUE;
+        if (dur <= 0) dur = 1L; /* don't allow zero duration */
+        event->u.ramp.dur = dur;
+        event->u.ramp.ctrl = 0;
+        if (step <= 0) step = 1; /* don't allow zero step size */
+        event->u.ramp.step = (short) step;
+        event->u.ramp.u.def.definition = def->definition;
+         for (i = 0; i < nmacroparms; i++) {
+            event->u.ramp.u.def.parameter[i] = (i < nparms ? parms[i] : 0);
+        }
+        event->u.ramp.u.def.parm_num = parm_num;
+        event->u.ramp.u.def.to_value = to_value;
+        seq_ctrlcount(seq)++;
+        seq_duration(seq) = MAX(seq_duration(seq), rtime + dur);
+    }
+    return event;
+}
+
+
+/****************************************************************************
+*               insert_event
+* Inputs:
+*    seq_type seq: where to put the event
+*    event_type event: the event to insert
+* Effect:
+*    inserts event into the event list
+*    NOTE: it is inserted *after* previously inserted events with the same time
+* Implementation:
+*    adagio files often contain many independent voices.  Although each voice
+*    consists of events in sequence, the voices need not be inter-twined in
+*    the input file.  Rather, all the events of voice 1 appear followed by all
+*    the events of voice 2, and so forth.  As phase one merges these event
+*    sequences, it must make many passes over an increasingly long list of
+*    events: expensive if we always start from the beginning of the list!
+*    we can exploit the fact that each voice is sequential by starting the
+*    search for the proper point of insertion at the last event inserted.
+*    the variable "last_event" is used to remember this hint.  We could
+*    also snapshot "last_event" in "ref_event" when a !tempo or !rate
+*    command occurs as another hint, but we don't.
+****************************************************************************/
+
+private void insert_event(seq, event)
+  seq_type seq;
+  register event_type event;
+{
+    event_type *evlptr = &(seq_eventlist(seq));
+    if ((*evlptr == NULL) ||
+        (event->ntime < (*evlptr)->ntime)) {
+        /* insert at the head of the list */
+        event->next = *evlptr;
+        *evlptr = event;
+        seq->current = event;
+    } else {
+        /* insert somewhere after the head of the list
+         * do not assume: current is not NULL.  Although we always leave
+		 * it set, the client may access the sequence before the next
+		 * insert.
+         */
+        register event_type previous;
+        register event_type insert_before;
+
+		if (!seq->current) {
+			seq->current = seq_eventlist(seq);
+		}
+        if (event->ntime >= seq->current->ntime) {
+            /* insertion point is after current */
+            previous = seq->current;
+            insert_before = previous->next;
+        } else {
+            /* insertion point is before current; start at beginning */
+            /* assume: not inserting at very head of list; that would
+             * have been taken care of above */
+            previous = seq_events(seq);
+            insert_before = previous->next;
+        }
+
+        while ((insert_before != NULL) &&
+            (event->ntime >= insert_before->ntime)) {
+            previous = insert_before;
+            insert_before = insert_before->next;
+        }
+        previous->next = event;
+        event->next = insert_before;
+        seq->current = event;
+    }
+}
+
+
+/* insert_macctrl -- add a control to the seq */
+/**/
+event_type insert_macctrl(seq, ctime, cline, ctrl, voice, value)
+  seq_type seq;
+  time_type ctime;
+  int cline;
+  int ctrl;
+  int voice;
+  int value;
+{
+    register event_type event = event_create(seq, macctrlsize, ctime, cline);
+    if (seq_print) {
+        gprintf(TRANS, 
+            "macctrl(%lx): time %ld, line %d, ctrl %d, voice %d, value %d\n",
+            event, ctime, cline, ctrl, voice, value);
+    }
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = MACCTRL_VALUE;
+        event->u.macctrl.ctrl_number = ctrl;
+        event->u.macctrl.value = value;
+        seq_ctrlcount(seq)++;
+    }
+    return event;
+}
+
+
+/* insert_macro -- insert a macro call seq */
+/**/
+event_type insert_macro(seq, ctime, cline, def, voice, nparms, parms)
+  seq_type seq;
+  time_type ctime;
+  int cline;
+  def_type def;
+  int voice;
+  int nparms;
+  short *parms;
+{
+    register event_type event = event_create(seq, macrosize, ctime, cline);
+    if (seq_print) {
+        int i;
+        gprintf(TRANS, 
+            "macro(%lx): time %ld, line %d, def %ld, voice %d, parms",
+            event, ctime, cline, def, voice);
+        for (i = 0; i < nparms; i++) gprintf(TRANS, " %d", parms[i]);
+        gprintf(TRANS, "\n");
+    }
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = MACRO_VALUE;
+        event->u.macro.definition = def->definition;
+        while (nparms-- > 0) {
+            event->u.macro.parameter[nparms] = parms[nparms];
+        }
+        seq_ctrlcount(seq)++;
+    }
+    return event;
+}
+
+
+/* insert_note -- add a note to the seq */
+/**/
+event_type insert_note(seq, ntime, nline, voice, pitch, dur, loud)
+  seq_type seq;
+  time_type ntime;
+  int nline;
+  int voice;
+  int pitch;
+  time_type dur;
+  int loud;
+{
+    register event_type event = event_create(seq, notesize, ntime, nline);
+
+    if (seq_print) {
+        gprintf(TRANS,
+  "note(%lx): time %ld, line %d, dur %ld, pitch %d, voice %d, loudness %d\n",
+                event, ntime, nline, dur, pitch, voice, loud);
+    }
+    
+    if (event) {
+        seq_used_mask(seq) |= 1 << (voice - 1);
+        event->nvoice = voice - 1;
+        event->value = pitch;
+        event->u.note.ndur = (dur << 8) + loud;
+        seq_notecount(seq)++;
+        seq_duration(seq) = MAX(seq_duration(seq), ntime + dur);
+    }
+    return event;
+}
+
+
+/* insert_seti -- add a seti event to the seq */
+/**/
+event_type insert_seti(seq, stime, sline, voice, addr, value)
+  seq_type seq;
+  time_type stime;
+  int sline;
+  int voice;
+  int *addr;
+  int value;
+{
+    register event_type event = event_create(seq, setisize, stime, sline);
+    if (seq_print) {
+        gprintf(TRANS, 
+            "seti(%ld): time %ld, line %d, voice %d, addr %ld, value %d\n",
+            event, stime, sline, voice, addr, value);
+    }
+    if (event) {
+        event->nvoice = ctrl_voice(ESC_CTRL, voice);
+        event->value = SETI_VALUE;
+        event->u.seti.int_to_set = addr;
+        event->u.seti.value = value;
+        seq_ctrlcount(seq)++;
+    }
+    return event;       
+}
+
+
+/* noop -- just returns, the default stopfunc for sequences */
+/**/
+void noop(seq_type seq) {}
+
+
+private void process_event(seq)
+  seq_type seq;
+{
+    register event_type event;
+    if (!seq->runflag) return;
+    while ((event = seq->current) && (event->ntime <= virttime)) {
+        int voice;
+        /* process all current (and earlier) events */
+        if (is_note(event)) {   /*** play a note or rest ***/
+            /* if this note is not a rest, play it and schedule an off event */
+            if (event->value != NO_PITCH &&
+                  (seq_channel_mask(seq) &
+                   (1 << ((voice = vc_voice(event->nvoice)) - 1)))) {
+                seq_noteon(seq, voice, event->value,
+                         (int) event->u.note.ndur & 0xFF);
+                if (debug) {
+                    gprintf(TRANS, "play pitch %d at %ld\n",
+                                event->value, event->ntime);
+                }
+                seq_cause_noteoff(seq, (event->u.note.ndur) >> 8,
+                    voice, event->value);
+
+            }
+        } else {                    /*** send a control command ***/
+            int n;
+            time_type step;
+            int delta;
+            long increment;
+            int voice = vc_voice(event->nvoice);
+            ulong enabled = seq_channel_mask(seq) & (1 << (voice - 1));
+
+            switch (vc_ctrl(event->nvoice)) {
+              case PSWITCH_CTRL:
+                if (!enabled) break;
+                seq_midi_ctrl(seq, voice, PORTASWITCH, event->value);
+                break;
+              case MODWHEEL_CTRL:
+                if (!enabled) break;
+                seq_midi_ctrl(seq, voice, MODWHEEL, event->value);
+                break;
+              case TOUCH_CTRL:
+                if (!enabled) break;
+                seq_midi_touch(seq, voice, event->value);
+                break;
+              case VOLUME_CTRL:
+                if (!enabled) break;
+                seq_midi_ctrl(seq, voice, VOLUME, event->value);
+                break;
+              case BEND_CTRL:
+                if (!enabled) break;
+                seq_midi_bend(seq, voice, (event->value << 6));
+                break;
+              case PROGRAM_CTRL:
+                if (!enabled) break;
+                seq_midi_program(seq, voice, event->value + 1);
+                break;
+              case ESC_CTRL:
+                switch (event->value) {
+                  case CALL_VALUE:
+                    sequence = seq;
+                    (*(event->u.call.routine))(event->u.call.args);
+                    break;
+                  case CLOCK_VALUE:
+                    clock_ticksize = event->u.clock.ticksize;
+                    if (!clock_running && !suppress_midi_clock && 
+                        !external_midi_clock) {
+                        clock_running = TRUE;
+                        midi_start();
+                        clock_tick(seq, 0L);
+                    }
+                    break;
+                  case MACCTRL_VALUE:
+                    if (!enabled) break;
+                    seq_midi_ctrl(seq, voice, event->u.macctrl.ctrl_number,
+                                              event->u.macctrl.value);
+                    break;
+                  case MACRO_VALUE: {
+                    if (!enabled) break;
+                    send_macro(event->u.macro.definition, voice,
+                               event->u.macro.parameter, -1, 0,
+                               event->nline);
+                    break;
+                  }
+                  case CTRLRAMP_VALUE:
+                  case DEFRAMP_VALUE: {
+                    int from, to;
+                    if (!enabled) break;
+
+                    step = event->u.ramp.step;
+                    if (event->value == CTRLRAMP_VALUE) {
+                        from = event->u.ramp.u.ctrl.from_value;
+                        to = event->u.ramp.u.ctrl.to_value;
+                    } else {
+                        from = event->u.ramp.u.def.parameter[
+                                    event->u.ramp.u.def.parm_num];
+                        to = event->u.ramp.u.def.to_value;
+                    }
+                    delta = to - from;
+                    increment = delta;
+                    if (delta < 0) delta = -delta;
+                    /* Note: Step is always non-zero */
+                    n = event->u.ramp.dur / step;
+                    increment = (increment << 8) / n;
+                    ramp_event(seq, event, from << 8, to << 8, 
+                               (int) increment, step, n);
+                    seq->noteoff_count++;
+                    break;
+                  }
+                  case SETI_VALUE:
+                    *(event->u.seti.int_to_set) = event->u.seti.value;
+                    break;
+                  default:
+                    gprintf(TRANS, "unexpected ESC_CTRL value\n");
+                    break;
+                }
+                break;
+              default:
+                gprintf(TRANS, "unexpected seq data\n");
+                break;
+            }
+        }
+        seq->current = event->next;
+    }
+    if (seq->current) {
+        cause((delay_type)(event->ntime - virttime), process_event, seq);
+    } else if (seq->noteoff_count == 0 && seq->note_enable) {
+        /* if we're just advancing to a start point, note_enable will be
+         * FALSE and this won't get called:
+         */
+        if (seq->stopfunc) {
+            (*(seq->stopfunc))(seq);
+        }
+    }
+}
+
+
+/* ramp_event -- generate a ramp */
+/**/
+private void ramp_event(seq, event, value, to_value, increment, step, n)
+  seq_type seq;
+  register event_type event;
+  unsigned int value;
+  unsigned int to_value;
+  int increment;
+  time_type step;
+  int n;
+{
+    if (seq->runflag) {
+        int voice = vc_voice(event->nvoice);
+/*      printf("ramp_event: value %d to_value %d increment %d step %d n %d time %d\n",
+               value, to_value, increment, step, n, virttime); */
+        if (n == 0) value = to_value;
+        else {
+            causepri((delay_type)step, 5, ramp_event, seq, event, value + increment,
+                   to_value, increment, step, n - 1);
+        }
+        if (event->value == CTRLRAMP_VALUE) {
+            int ctrl = event->u.ramp.ctrl;
+            if (ctrl == -TOUCH_CTRL) midi_touch(voice, value >> 8);
+            else if (ctrl == -BEND_CTRL) midi_bend(voice, value >> 2);
+            else midi_ctrl(voice, ctrl, value >> 8);
+        } else { /* must be DEFRAMP_VALUE */
+            send_macro(event->u.ramp.u.def.definition,
+                       vc_voice(event->nvoice),
+                       event->u.ramp.u.def.parameter,
+                       event->u.ramp.u.def.parm_num, value >> 8,
+                       event->nline);
+        }
+        if (n == 0) seq_end_event(seq);
+    }
+}
+
+
+/* report_enabled_channels -- print out concise listing of channels */
+/*
+ * to fit on one line, write out ranges, e.g. 1-5 9-11 
+ */
+void report_enabled_channels(seq)
+  seq_type seq;
+{
+    ulong mask = seq_channel_mask(seq);
+    int i, range_open_at = 0;
+
+    for (i = 1; i <= MAX_CHANNELS; i++) {
+        if (!range_open_at && (mask & 1)) {
+            gprintf(TRANS, " %d", i);
+            range_open_at = i;
+        } else if (range_open_at && !(mask & 1)) {
+            if (i > (range_open_at + 1)) {
+                gprintf(TRANS, "-%d", i - 1);
+            }
+            range_open_at = 0; /* FALSE */
+        }
+        mask = mask >> 1;
+    }
+    if (range_open_at) gprintf(TRANS, "-%d", MAX_CHANNELS);
+}
+
+
+/* send_macro -- instantiate macro and send it */
+/*
+ * note: to support ramping, "value" is used in place of
+ *       parameter["parm_num"]
+ */
+/*private*/
+void send_macro(ptr, voice, parameter, parm_num, value, nline)
+  register unsigned char *ptr;
+  int voice;
+  short parameter[];
+  int parm_num;
+  int value;    
+  int nline;
+{
+    register unsigned char code, *loc;
+    while ((code = *ptr++)) {
+        loc = ptr + *ptr;
+        ptr++;
+        if (code <= nmacroparms) {
+            code--;
+            *loc = (code == parm_num ? value : parameter[code]) & 0x7f;
+        } else if (code == nmacroparms + 1) {
+            /* take old high order bits and OR in 4 voice bits */
+            *loc = (*loc & 0xF0) | ((voice - 1) & 0xF);
+        } else {
+            code -= (nmacroparms + 2);
+            *loc = ((code == parm_num ? value : parameter[code]) >> 7) & 0x7F;
+        }
+    }
+    if (ptr[1] == MIDI_SYSEX) {
+        midi_exclusive(ptr + 1);
+    } else {
+        /* make sure user didn't try to send more than 3 bytes.  This test
+         * could be done at sequence read time, but it's tricky because the
+         * first byte could be a parameter, so in general you need to 
+         * plug the actual parameters into the message and then do the test.
+         * Currently, this is the only place parameters are plugged in.
+         */
+        if (*ptr > 3) {
+            gprintf(ERROR, 
+                    "Non-sysex macro longer than 3 bytes ignored, line %d.\n",
+                     nline);
+        } else {
+            midi_write((int) *ptr, MIDI_PORT(voice), ptr[1], ptr[2], ptr[3]);
+        }
+    }
+}
+
+
+/* seq_alloc -- a utility function to allocate a seq struct */
+/**/
+seq_type seq_alloc()
+{
+    seq_type seq;
+    seq = (seq_type) memget(sizeof(seq_node));
+    return seq;
+}    
+
+
+/* seq_at_end -- set the function to be called at sequence end */
+/**/
+void seq_at_end(seq, fn)
+  seq_type seq;
+  void (*fn)(seq_type);
+{
+    if (!fn) fn = noop;
+    seq->stopfunc = fn;
+}
+
+
+/* seq_cause_noteoff_meth -- turn off a note in the future */
+/**/
+void seq_cause_noteoff_meth(seq, delay, voice, pitch)
+  seq_type seq;
+  time_type delay;
+  int voice;
+  int pitch;
+{
+    if (seq->note_enable) {
+        pitch += seq->transpose;
+        while (pitch < 0) pitch += 12;
+        while (pitch > 127) pitch -= 12;
+        seq->noteoff_count++;
+        causepri((delay_type) delay, 10, seq->noteoff_fn,
+                 seq, voice, pitch);
+    }
+}
+
+/* seq_copy -- copy a sequence, share the eventlist */
+/**/
+seq_type seq_copy(from_seq)
+  seq_type from_seq;
+{
+    register seq_type seq = seq_init(seq_alloc(), FALSE);
+    if (!seq) return NULL;
+    seq->chunklist = from_seq->chunklist;
+    seq->current = seq_events(seq);
+    seq->chunklist->u.info.refcount++;
+    seq->transpose = from_seq->transpose;
+    seq->loudness = from_seq->loudness;
+    seq->rate = from_seq->rate;
+    seq->paused = from_seq->paused;
+    seq->noteoff_count = 0;
+    return seq;
+}
+
+
+/* seq_create -- create a seq structure and an initial event chunk */
+/**/
+seq_type seq_create()
+{
+    return seq_init(seq_alloc(), TRUE);
+}
+
+
+/* seq_cycle -- set parameters for cycling a sequence */
+/**/
+void seq_cycle(seq_type seq, boolean flag, time_type dur)
+{
+    seq->cycleflag = flag;
+    seq->cycledur = dur;
+}
+
+
+/* seq_end_event -- call this when an score-generated event ends */
+/*
+ * Assumes that noteoff_count was incremented when event started.
+ */
+void seq_end_event(seq)
+  seq_type seq;
+{
+    /*gprintf(TRANS, "nd");*/
+    seq->noteoff_count--;
+    if (seq->current == NULL /* finished seq */ &&
+        seq->noteoff_count == 0 /* finished noteoff's */ &&
+        seq->runflag /* we've not been stopped */) {
+        if (seq->cycleflag) {
+            cause((delay_type) (seq->cycledur - virttime), cycle, seq);
+        } else if (seq->stopfunc) {
+            (*(seq->stopfunc))(seq);
+        }
+    }
+}
+
+
+
+/****************************************************************************
+*               seq_free_meth
+* Input: a seq_type
+* Effect:
+*    frees storage occupied by a seq
+****************************************************************************/
+
+private void seq_free_meth(seq)
+  seq_type seq;
+{
+    seq_free_chunks(seq);
+    if (seq->timebase) timebase_free(seq->timebase);
+    memfree((void *) seq, sizeof(seq_node));
+}
+
+
+/* seq_free_chunks -- free storage for note list */
+/*
+ * NOTE: in its original form, this routine was perhaps more readable,
+ * but would not compile under Microsoft C V7.00 due to a compiler bug.
+ * I rewrote the code until the bug disappeared, hopefully without
+ * changing the semantics!  If you change this code, make sure it still
+ * compiles under Microsoft C.
+ *
+ * This module frees chunks from a seq_type in preparation for freeing
+ * the seq_type itself.  Reference counts are checked and chunks are
+ * only freed when the last reference is removed.
+ */
+public void seq_free_chunks(seq)
+  seq_type seq;
+{
+    chunk_type tail;
+    chunk_type head;
+
+    head = seq->chunklist;
+    if (((head->u.info.refcount)--) != 0) return;
+
+    while (head != NULL) {
+        tail = head->next;
+        memfree((void *) head, sizeof(chunk_node));
+        head = tail;
+        seq->chunklist = head;
+    }
+}
+
+
+seq_type seq_init(seq, create_chunk)
+    seq_type seq;
+    int create_chunk;
+{
+    if (!seq || !(seq->timebase = timebase_create(50))) {
+        return NULL;
+    }
+    seq->chunklist = NULL;
+    if (create_chunk) {
+        seq->chunklist = chunk_create(TRUE);
+        if (!seq->chunklist) {
+            seq_free(seq);
+            return NULL;
+        }
+    }
+    seq->cause_noteoff_fn = seq_cause_noteoff_meth;
+    seq->midi_bend_fn     = seq_midi_bend_meth;
+    seq->midi_ctrl_fn     = seq_midi_ctrl_meth;
+    seq->midi_program_fn  = seq_midi_program_meth;
+    seq->midi_touch_fn    = seq_midi_touch_meth;
+    seq->noteoff_fn       = seq_noteoff_meth;
+    seq->noteon_fn        = seq_noteon_meth;
+    seq->free_fn          = seq_free_meth;
+    seq->reset_fn         = seq_reset_meth;
+
+    seq->current = NULL;
+    seq->transpose = 0;
+    seq->loudness = 0;
+    seq->cycleflag = FALSE;
+    seq->cycledur = 0L;
+    seq->rate = 256L;
+    seq->paused = FALSE;
+    seq->stopfunc = noop;
+    seq->channel_mask = 0xFFFFFFFFL;
+    seq->runflag = seq->note_enable = FALSE;
+    return seq;
+}
+
+
+/* seq_midi_bend_meth -- send a midi bend */
+/**/
+void seq_midi_bend_meth(seq_type seq, int voice, int value)
+{
+    midi_bend(voice, value);
+}
+
+
+/* seq_midi_ctrl_meth -- send a midi ctrl change */
+/**/
+void seq_midi_ctrl_meth(seq_type seq, int voice, int ctrl, int value)
+{
+    midi_ctrl(voice, ctrl, value);
+}
+
+
+/* seq_midi_program_meth -- send a midi program change */
+/**/
+void seq_midi_program_meth(seq_type seq, int voice, int prog)
+{
+    midi_bend(voice, prog);
+}
+
+
+/* seq_midi_touch_meth -- send a midi touch */
+/**/
+void seq_midi_touch_meth(seq_type seq, int voice, int value)
+{
+    midi_touch(voice, value);
+}
+
+
+/* seq_noteoff_meth -- turn a seq note off */
+/**/
+void seq_noteoff_meth(seq, voice, pitch)
+  seq_type seq;
+  int voice;
+  int pitch;
+{
+    midi_note(voice, pitch, 0);
+        /*gprintf(TRANS, "_e");*/
+    seq_end_event(seq);
+}
+
+
+/* seq_noteon_meth -- play a note with transformations */
+/**/
+void seq_noteon_meth(seq, chan, pitch, vel)
+  seq_type seq;
+  int chan, pitch, vel;
+{
+    if (seq->note_enable) {
+        pitch += seq->transpose;
+        while (pitch < 0) pitch += 12;
+        while (pitch > 127) pitch -= 12;
+
+        vel += seq->loudness;
+        if (vel <= 0) vel = 1;
+        else if (vel > 127) vel = 127;
+
+        midi_note(chan, pitch, vel);
+    }
+}
+
+
+/* seq_pause -- stop playing momentarily or resume playing */
+/**/
+time_type seq_pause(seq_type seq, boolean flag)
+{
+    if (!seq->paused && flag) {
+        seq->paused = TRUE;
+        seq->rate = seq->timebase->rate;
+        set_rate(seq->timebase, STOPRATE);
+    } else if (seq->paused && !flag) {
+        seq_play(seq);
+    }
+    return (time_type) seq->timebase->virt_base;
+}
+
+
+/* seq_play -- play a sequence from the current event forward */
+/**/
+void seq_play(seq)
+  seq_type seq;
+{
+    timebase_type prev_timebase = timebase;
+    register timebase_type reg_timebase = seq->timebase;
+
+    if (!seq->runflag) {
+        seq_reset(seq);
+    }
+    if (!seq->paused) return;
+    eventtime = gettime();
+
+    /* assume that virt_base is correct virtual time as the result
+        of seq_start_time or seq_reset
+     */
+    timebase = reg_timebase;
+    virttime = reg_timebase->virt_base;
+    /* note that set_rate will set reg_timebase->real_base to eventtime */
+    set_rate(reg_timebase, seq->rate);
+    seq->paused = FALSE; /* in case the score had been paused; note that
+                            seq_pause() has no effect if paused is TRUE */
+    seq->runflag = TRUE;
+    seq->note_enable = TRUE;
+
+    /* restore previous timebase */
+    timebase_use(prev_timebase);
+}
+
+
+/* seq_reset_meth -- reset a sequence to start back at the first event */
+/**/
+void seq_reset_meth(seq)
+  seq_type seq;
+{
+    timebase_type old_timebase = timebase;
+
+    if (seq->runflag) {
+        /* maybe this seq is already reset, and process_event is
+         * already scheduled.  If so, don't schedule another one.
+         */
+        if ((seq->timebase->virt_base == 0) &&
+            (seq->timebase->rate == STOPRATE)) {
+            /* in case the reader just iterated through the list without
+             * cause'ing events, reset the event list
+             */
+            seq->current = seq_events(seq);
+            return;
+        }
+        /* Otherwise, the seq is running, so stop it. */
+        seq_stop(seq);
+    }
+    
+    timebase_use(seq->timebase);
+    set_rate(seq->timebase, STOPRATE);
+    set_virttime(seq->timebase, 0L);
+    seq->current = seq_events(seq);
+    seq->noteoff_count = 0L;
+    seq->runflag = TRUE;
+    seq->paused = TRUE;
+    if (seq->current)
+        cause((delay_type)(seq->current->ntime - virttime), process_event, seq);
+    timebase_use(old_timebase);
+}
+
+
+/* seq_set_loudness -- set the loudness offset of a sequence */
+/**/
+void seq_set_loudness(seq, loud)
+  seq_type seq;
+  int loud;
+{
+    seq->loudness = loud;
+}
+
+/* seq_set_rate -- set the rate of a sequence */
+/**/
+void seq_set_rate(seq, rate)
+  seq_type seq;
+  time_type rate;
+{
+    seq->rate = rate;
+    if (!seq->paused) set_rate(seq->timebase, rate);
+}
+
+
+/* seq_set_transpose -- set the sequence transposition */
+/**/
+void seq_set_transpose(seq, trans)
+  seq_type seq;
+  int trans;
+{
+    seq->transpose = trans;
+}
+
+
+/* seq_start_time -- set the current pointer so the sequence starts here */
+/**/
+void seq_start_time(seq, start_time)
+  seq_type seq;
+  time_type start_time;
+{
+    timebase_type prev_timebase = timebase;
+    if (!seq->runflag) {
+        seq_reset(seq);
+    }
+    if (real_to_virt(seq->timebase, eventtime) > start_time) {
+        seq_reset(seq);
+    }
+    timebase_use(seq->timebase);
+    seq->note_enable = FALSE;
+    /* prime the pump */
+    set_rate(timebase, STOPRATE);
+    set_virttime(timebase, start_time);
+    catchup();
+    seq->note_enable = TRUE;
+    seq->paused = TRUE;
+    /* restore previous timebase */
+    timebase_use(prev_timebase);
+}
+
+
+/* seq_stop -- stop a sequence, clear out all pending events */
+/**/
+void seq_stop(seq)
+  seq_type seq;
+{
+    timebase_type prev_timebase = timebase;
+
+    if (seq->runflag) {
+        if (moxcdebug)
+            gprintf(TRANS, "seq_reset swap from timebase 0x%x to 0x%x\n",
+                    timebase, seq->timebase);
+        timebase = seq->timebase;
+        seq->runflag = FALSE;
+        set_rate(timebase, STOPRATE);
+        set_virttime(timebase, MAXTIME);
+        catchup();
+    }
+    timebase_use(prev_timebase);
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/seq.h b/lib-src/libnyquist/nyquist/cmt/seq.h
new file mode 100644
index 0000000..2bfac26
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seq.h
@@ -0,0 +1,295 @@
+/* seq.h -- definitions for seq, the MIDI Toolkit sequence data type */
+
+#define minpitch 0
+#define maxpitch 127
+#define NO_PITCH (maxpitch+1)
+#define minprogram 1
+#define maxprogram 128
+
+/* keep these two lines in sync */
+#define nmacroparms 4
+#define parm_expected_error "Parameter number [1-4] expected"
+
+#define seq_dflt_loud 127
+#define seq_dflt_voice 1
+#define seq_dflt_pitch 60
+
+struct clock_struct {
+    time_type ticksize;
+};
+
+
+struct ctrlramp_struct {
+    unsigned char from_value;
+    unsigned char to_value;
+};
+
+
+struct deframp_struct {
+    unsigned char *definition;
+    short parameter[nmacroparms];
+    unsigned char parm_num;
+    short to_value;
+};
+
+
+struct macctrl_struct {
+    unsigned char ctrl_number;
+    unsigned char value;
+};
+
+
+struct macro_struct {
+    unsigned char *definition;
+    short parameter[nmacroparms];
+};
+
+
+struct note_struct {
+    long ndur;  /* duration */
+    /* char nloud;  loudness (MIDI velocity) now stored as low order byte
+     * of ndur
+     */
+};
+
+
+struct ramp_struct {
+    time_type dur;
+    short ctrl;         /* encode pitch bend and after touch as negative */
+    short step;
+    union {
+        struct ctrlramp_struct ctrl;
+        struct deframp_struct def;
+    } u;
+};
+
+
+struct seti_struct {
+    int *int_to_set;
+    int value;
+};
+
+
+#define SEQ_MAX_PARMS 8
+struct cause_struct {
+    int (*routine)();
+    /* make a structure so we can copy by value */
+    struct seq_arg_struct {
+        long a[SEQ_MAX_PARMS];
+    } args;
+};
+
+
+typedef struct event_struct {
+    struct event_struct *next;
+    time_type ntime;    /* start time */
+    short nline;        /* line number from source code */
+    unsigned char nvoice;    /* adagio voice (MIDI Channel)
+                 *  if this is a control change, high order 4 bits
+                 *  contain the control number, otherwise high order
+                 *  4 bits are 0 (see is_note macro below)
+                 */
+    unsigned char value;
+                    /* this is a note pitch or a control value.  It goes
+                 * here rather than in the union to achieve word
+                 * alignment (!).  Also, value is used for extra commands
+                 * such as call, seti, setv.
+                 */
+    union {
+        struct cause_struct call;
+        struct clock_struct clock;
+        struct macctrl_struct macctrl;
+        struct macro_struct macro;
+        struct note_struct note;
+        struct ramp_struct ramp;
+        struct seti_struct seti;
+    } u;
+} event_node, *event_type;
+
+#define PSWITCH_CTRL 1
+#define MODWHEEL_CTRL 2
+#define TOUCH_CTRL 3
+#define VOLUME_CTRL 4
+#define BEND_CTRL 5
+#define PROGRAM_CTRL 6
+#define ESC_CTRL 7
+
+#define CALL_VALUE 0
+#define CLOCK_VALUE 1
+#define MACCTRL_VALUE 2
+#define MACRO_VALUE 3
+#define CTRLRAMP_VALUE 4
+#define DEFRAMP_VALUE 5
+#define SETI_VALUE 6
+
+#define commonsize (sizeof(struct event_struct) - sizeof(struct cause_struct))
+#define rampcommon (sizeof(struct ramp_struct) - sizeof(struct deframp_struct))
+#define ctrlsize commonsize
+#define callsize (commonsize + sizeof(struct cause_struct))
+#define clocksize (commonsize + sizeof(struct clock_struct))
+#define ctrlrampsize (commonsize + rampcommon + sizeof(struct ctrlramp_struct))
+#define deframpsize (commonsize + sizeof(struct ramp_struct))
+#define macctrlsize (commonsize + sizeof(struct macctrl_struct))
+#define macrosize (commonsize + sizeof(struct macro_struct))
+#define notesize (commonsize + sizeof(struct note_struct))
+#define setisize (commonsize + sizeof(struct seti_struct))
+#define ctrl_voice(c, v) (((c) << 5) + ((v) - 1))
+#define vc_ctrl(v) ((v) >> 5)
+#define vc_voice(v) (((v) & 0x1F) + 1)
+
+#define is_note(n) (((n)->nvoice & 0xE0) == 0)
+
+#define CHUNK_SIZE 2000
+
+typedef struct def_struct {
+    struct def_struct *next;
+    char *symbol;
+    unsigned char *definition;
+} def_node, *def_type;
+
+
+typedef struct chunk_struct {
+    struct chunk_struct *next;
+    short free;
+    union {
+        char data[CHUNK_SIZE];
+        struct info_struct {
+            short refcount;
+            struct chunk_struct *last_chunk; /* where to allocate memory */
+            def_type dictionary;    /* macro defns, routine addresses */
+            event_type eventlist;   /* first event in sequence */
+            ulong used_mask;        /* tells what channels are actually present */
+            long ctrlcount;
+            long notecount;
+            time_type duration;     /* time of the last event+dur in score */
+        } info;
+    } u;
+} chunk_node, *chunk_type;
+
+
+typedef struct seq_struct {
+    void (*cause_noteoff_fn)();
+    void (*midi_bend_fn)();
+    void (*midi_ctrl_fn)();
+    void (*midi_program_fn)();
+    void (*midi_touch_fn)();
+    void (*noteoff_fn)();
+    void (*noteon_fn)();
+    void (*free_fn)();
+    void (*reset_fn)();
+    void (*stopfunc)(struct seq_struct *);
+    chunk_type chunklist;
+    /* event_type eventlist;
+         seq->eventlist is now seq->eventlist->chunklist */
+    event_type current;
+    boolean runflag;            /* normally true, set to false as a flag for
+                                 * processes started by score to terminate */
+    boolean note_enable;        /* normally true, set to false as a flag to
+                                 * suppress note output, e.g. when indexing
+                                 * to a particular time point */
+    boolean cycleflag;          /* normally false, set to true to make the
+                                 * sequence cycle every cycledur */
+    int transpose;
+    int loudness;
+    time_type cycledur;
+    timebase_type timebase;
+    time_type rate;                     /* remembers rate across pauses */
+    boolean paused;             /* remembers if seq has been stopped or not */
+    short noteoff_count;        /* keeps track of pending events, such as
+                                 * note off commands.  When this count goes
+                                 * to zero, the score is finished */
+    ulong channel_mask;
+} seq_node, *seq_type;
+
+extern seq_type sequence;
+
+chunk_type chunk_create(boolean first_flag);
+
+#define seq_cause_noteoff(seq, delay, voice, pitch) \
+        (*(((seq_type) seq)->cause_noteoff_fn))(seq, delay, voice, pitch)
+#define seq_midi_bend(seq, voice, value) \
+        (*(((seq_type) seq)->midi_bend_fn))(seq, voice, value)
+#define seq_midi_ctrl(seq, voice, ctrl, value) \
+        (*(((seq_type) seq)->midi_ctrl_fn))(seq, voice, ctrl, value)
+#define seq_midi_program(seq, voice, prog) \
+        (*(((seq_type) seq)->midi_program_fn))(seq, voice, prog)
+#define seq_midi_touch(seq, voice, value) \
+        (*(((seq_type) seq)->midi_touch_fn))(seq, voice, value)
+#define seq_noteoff(seq, voice, pitch) \
+        (*(((seq_type) seq)->noteoff_fn))(seq, voice, pitch)
+#define seq_noteon(seq, voice, pitch, vel) \
+        (*(((seq_type) seq)->noteon_fn))(seq, voice, pitch, vel)
+#define seq_free(seq) (*(((seq_type) seq)->free_fn))(seq)
+#define seq_register(seq) \
+    cu_register((cu_fn_type) (((seq_type) seq)->free_fn), seq)
+#define seq_reset(seq) (*(((seq_type) seq)->reset_fn))(seq)
+ /* LISP: void (SEQ-RESET SEQ) */
+
+extern boolean seq_print;       /* debugging switch */
+
+void seq_extensions(void);      /* to be defined outside of seq -- user dependent */
+event_type insert_call(seq_type seq, time_type ctime, int cline,
+                       int voice, int (*addr)(), long value[], int n);
+event_type insert_clock(seq_type seq, time_type ctime, int cline,
+                        time_type ticksize);
+event_type insert_ctrl(seq_type seq, time_type ctime, int cline, int ctrl,
+                       int voice, int value);
+ /* LISP: (SEQ-INSERT-CTRL SEQ FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM) */
+event_type insert_ctrlramp(seq_type seq, time_type rtime, int rline, int voice,
+                      time_type step, time_type dur, int ctrl, int v1, int v2);
+ /* LISP: (SEQ-INSERT-RAMP SEQ FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM) */
+def_type insert_def(seq_type seq, char *symbol, unsigned char *definition,
+                    int deflen);
+event_type insert_deframp(seq_type seq, time_type rtime, int rline, int voice,
+                     time_type step, time_type dur, def_type def,
+                     int nparms, short parms[], int parm_num, int to_value);
+event_type insert_macctrl(seq_type seq, time_type ctime, int cline, int ctrl,
+                          int voice, int value);
+ /* LISP: (SEQ-INSERT-MACCTRL SEQ FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM) */
+event_type insert_macro(seq_type seq, time_type ctime, int cline,
+                        def_type def, int voice, int nparms, short *parms);
+event_type insert_note(seq_type seq, time_type ntime, int nline, int voice,
+                       int pitch, time_type dur, int loud);
+ /* LISP: (SEQ-INSERT-NOTE SEQ FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM FIXNUM) */
+event_type insert_seti(seq_type seq, time_type stime, int sline, int voice,
+                       int *addr, int value);
+void noop(seq_type seq);
+seq_type seq_alloc(void);
+void seq_at_end(seq_type seq, void (*fn)(seq_type));
+void seq_cause_noteoff_meth(seq_type seq, time_type delay, int voice, int pitch);
+#define seq_channel_mask(seq) ((seq)->channel_mask)
+seq_type seq_copy(seq_type from_seq); /* LISP: (SEQ-COPY SEQ) */
+seq_type seq_create(void); /* LISP: (SEQ-CREATE) */
+void seq_cycle(seq_type seq, boolean flag, time_type dur);
+#define seq_duration(seq) (((seq_type) seq)->chunklist->u.info.duration)
+void seq_end_event(seq_type seq);
+#define seq_events(seq) (((seq_type) seq)->chunklist ? \
+    (((seq_type) seq)->chunklist->u.info.eventlist) : NULL) 
+#define seq_dictionary(seq) (seq)->chunklist->u.info.dictionary
+#define seq_eventlist(seq) (seq)->chunklist->u.info.eventlist
+#define seq_ctrlcount(seq) (seq)->chunklist->u.info.ctrlcount
+#define seq_notecount(seq) (seq)->chunklist->u.info.notecount
+#define seq_used_mask(seq) (seq)->chunklist->u.info.used_mask
+void seq_free_chunks(seq_type seq);
+seq_type seq_init(seq_type seq, int create_chunk);
+#define seq_loudness(seq) (((seq_type) seq)->loudness)
+void seq_midi_bend_meth(seq_type seq, int voice, int value);
+void seq_midi_ctrl_meth(seq_type seq, int voice, int ctrl, int value);
+void seq_midi_program_meth(seq_type seq, int voice, int prog);
+void seq_midi_touch_meth(seq_type seq, int voice, int value);
+void seq_noteon_meth(seq_type seq, int voice, int pitch, int vel);
+void seq_noteoff_meth(seq_type seq, int chan, int pitch);
+time_type seq_pause(seq_type seq, boolean flag);
+void seq_play(seq_type seq);
+#define seq_rate(seq) ((seq_type) seq)->rate
+void seq_reset_meth(seq_type seq);
+#define seq_runflag(seq) ((seq_type) seq)->runflag
+#define seq_set_channel_mask(seq, cm) ((seq)->channel_mask) = (cm)
+void seq_set_loudness(seq_type seq, int offset);
+void seq_set_rate(seq_type seq, time_type rate);
+#define seq_set_timebase(seq, tb) ((seq_type) seq)->timebase = (tb)
+void seq_set_transpose(seq_type seq, int trans);
+void seq_start_time(seq_type seq, time_type start_time);
+void seq_stop(seq_type seq);
+#define seq_timebase(seq) ((seq_type) seq)->timebase
+#define seq_transpose(seq) ((seq_type) seq)->transpose
diff --git a/lib-src/libnyquist/nyquist/cmt/seqdecls.h b/lib-src/libnyquist/nyquist/cmt/seqdecls.h
new file mode 100644
index 0000000..654d12a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqdecls.h
@@ -0,0 +1,11 @@
+/* This .h file declares everything you need to include seq.h */
+/*
+ * This file gets included by an interface to seq generated by intgen
+ */
+#include "switches.h"
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
diff --git a/lib-src/libnyquist/nyquist/cmt/seqmread.c b/lib-src/libnyquist/nyquist/cmt/seqmread.c
new file mode 100644
index 0000000..52f0c57
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqmread.c
@@ -0,0 +1,448 @@
+/*
+ * seqmread.c
+ * 
+ * Convert a MIDI file to a seq.
+ */
+
+/* Copyright 1989 Carnegie Mellon University */
+
+/*****************************************************************************
+*       Change Log
+*       Date    | who : Change
+*-----------+-----------------------------------------------------------------
+* 17-Feb-92 | GWL : only one stdio.h
+*                 : fix to satisfy compiler:
+                    void returns, time_type giotime(), int filegetc()
+*****************************************************************************/
+
+#include "switches.h"
+#include "stdio.h"
+#include "cext.h"
+#include "cmdline.h"
+#include "midifns.h" /* to get time_type */
+#include "timebase.h"
+#include "moxc.h"    /* to get debug declared */
+#include "seq.h"
+#include "seqread.h" 	/* to get scale */
+#include "seqmread.h"
+#include "userio.h"
+#include "ctype.h"
+
+#include "midifile.h"
+#include "tempomap.h"
+
+int filegetc();
+void initfuncs();
+void prtime();
+void snding_free();
+
+typedef struct snding_struct {
+    struct snding_struct *next;
+    event_type event_ptr;
+    int pitch;
+    int channel;
+} snding_node, *snding_type;
+
+#define snding_alloc() (snding_type) memget(sizeof(snding_node))
+#define snding_free(s) memfree(s, sizeof(snding_node))
+
+snding_type snding_list = NULL;
+
+tempomap_type the_tempomap;
+event_type initial_clock;       /* remember the first clock event */
+long prev_ticksize;             /* remember the previous ticksize */
+int sysex_id = 0;
+
+
+void smf_noteoff();
+void smf_error();
+void smf_header();
+void smf_trackstart();
+void smf_trackend();
+void smf_noteon();
+void smf_pressure();
+void smf_parameter();
+void smf_pitchbend();
+void smf_program();
+void smf_chanpressure();
+void smf_sysex();
+void smf_metamisc();
+void smf_metaseq();
+void smf_metaeot();
+void smf_timesig();
+void smf_smpte();
+void smf_tempo();
+void smf_keysig();
+void smf_metaspecial();
+void smf_metatext();
+void smf_arbitrary();
+
+private seq_type the_score;
+
+static FILE *F;
+
+int filegetc()
+{
+/*      int temp = getc(F);
+        printf(" %x ", temp);*/
+        return(int)(getc(F));
+}
+
+void seq_read_smf(seq, fp)
+  seq_type seq;
+  FILE *fp;
+{
+    F = fp;
+    initfuncs();
+    sysex_id = 0;       /* sysex in seq has to correspond to a symbol */
+    the_score = seq;    /* current sequence is a global within this module */
+    if (!seq) return;
+    the_tempomap = tempomap_create();
+    /* insert an initial clock to correspond to the default midifile tempo
+       (tempomap_create creates a corresponding initial entry in the tempomap)
+       (see smf_tempo for explanation of the scale() call)
+     */
+    initial_clock = insert_clock(the_score, 0L, 0, 500L << 16);
+                  /*   scale(24 * 500000, 1 << 16, 24000) */
+    if (!the_tempomap) return;
+    Mf_getc = filegetc;
+    midifile();
+    /* fmac_close(F); -- do not close the file because the caller might try to 
+     * close it (in fact XLISP insists on closing it as a side effect of
+     * garbage collection.
+     */
+    gprintf(TRANS, "\nLoaded Midi file with %ld note(s), %ld ctrl(s).\n\n",
+        seq_notecount(seq), seq_ctrlcount(seq));
+    seq_reset(seq);
+    while (snding_list) {
+        snding_type snding = snding_list;
+        snding_list = snding_list->next;
+        gprintf(TRANS, "Note-on (key %d, chan %d) has no matching noteoff\n",
+                snding->pitch, snding->channel + 1);
+        snding_free(snding);
+    }
+    tempomap_free(the_tempomap);
+}
+
+
+/* gio_time -- get the time in millisec for Adagio */
+/*
+ * Since Adagio times are (in their precise form) 1/256 ms, we want
+ * a similar time for midifiles, whose natural unit would be microseconds.
+ * We'll shift the microsecond time by 2 to get 1/250 ms = 4 us units
+ * and convert using the scale function when necessary.
+ * Real time is the time of the last tempo change (last_tempo_time)
+ * which is in 4us units + elapsed time.  
+ * Elapsed time is the elapsed beats times the beat duration.
+ * Elapsed beats is Mf_currtime - last_tempo_beat.
+ * Beat duration is the specified tempo / division, where specified tempo
+ *  is in microseconds, and division is parts per quarternote.
+ */
+unsigned long divisions = 24L;
+
+time_type gio_time()
+{
+    return (tempomap_lookup(the_tempomap, Mf_currtime) + 125L) / 250L;
+}
+
+
+void smf_header(format,ntrks,division)
+{
+/*      gprintf(TRANS, "Header format=%d ntrks=%d division=%d\n",
+                format,ntrks,division); */
+        if (format > 1) gprintf(TRANS, 
+                          "Warning: format %d midi file may not work.\n",
+                          format);
+        divisions = division;
+        /* adjust the initial tempochange */
+        the_tempomap->entries->tempo = 500000L / division;
+}
+
+
+void smf_trackstart()
+{
+/*      gprintf(TRANS, "Track start\n"); */
+}
+
+void smf_trackend()
+{
+/*      gprintf(TRANS, "Track end\n"); */
+}
+
+void smf_noteon(chan,pitch,vol)
+{
+        snding_type snding;
+        if (vol == 0) {  /* convert to a noteoff */
+            smf_noteoff(chan, pitch, 0);
+            return;
+        }
+/*      prtime();
+        gprintf(TRANS, "Note on, chan=%d pitch=%d vol=%d\n",chan+1,pitch,vol);
+*/
+        /* get ready to remember the sounding note */
+        snding = snding_alloc();
+        snding->next = snding_list;
+        snding_list = snding;
+        /* enter an event into score and remember it */
+        snding->event_ptr = insert_note(the_score, gio_time(), 0, 
+                                        chan + 1, pitch, 0L, vol);
+        snding->pitch = pitch;
+        snding->channel = chan;
+}
+
+void smf_noteoff(chan,pitch,vol)
+{
+        snding_type *snding_ptr;
+        register snding_type snding;
+/*      prtime();
+        gprintf(TRANS, "Note off, chan=%d pitch=%d vol=%d\n",chan+1,pitch,vol);
+*/      /* search for the snding record */
+        for (snding_ptr = &snding_list; 
+               (snding = *snding_ptr) &&
+                   ((snding->pitch != pitch) || (snding->channel != chan));
+               snding_ptr = &(snding->next)) /* printf("* search *\n") */;
+        if (!snding) {
+            gprintf(TRANS, "Note off %d, channel %d ignored: no note on\n",
+                        pitch, chan + 1);
+        } else {
+                event_type event = snding->event_ptr;
+            event->u.note.ndur += (gio_time() - event->ntime) << 8;
+            /* free the snding record */
+            *snding_ptr = snding->next;
+            snding_free(snding);
+        }
+}
+
+
+void smf_pressure(chan,pitch,press)
+{
+        prtime();
+        gprintf(TRANS, "Pressure, chan=%d pitch=%d press=%d (IGNORED)\n",
+                chan + 1, pitch, press);
+}
+
+void smf_parameter(chan,control,value)
+{
+        int ctrl = 0;
+/*      prtime();
+        gprintf(TRANS, "Parameter, chan=%d c1=%d c2=%d\n",chan+1,control,value);
+ */     /* see if the control is one of the standard Adagio controls that
+           can be encoded in a special way.  If not, ctrl remains at zero.
+         */
+        switch (control) {
+          case PORTASWITCH: ctrl = PSWITCH_CTRL; break;
+          case MODWHEEL: ctrl = MODWHEEL_CTRL; break;
+          case VOLUME: ctrl = VOLUME_CTRL; break;
+        }
+        if (ctrl) /* then do special ctrl insert and save storage */
+            insert_ctrl(the_score, gio_time(), 0, ctrl, chan + 1, value);
+        else insert_macctrl(the_score, gio_time(), 0, control, chan + 1, value);
+}       
+
+
+/* smf_pitchbend -- handle a pitch bend event */
+/*
+ * NOTE: the midifile code from Tim Thompson has the msb and lsb bytes swapped.
+ *   Thus the parameter msb is really the low order byte and lsb is high order.
+ */
+void smf_pitchbend(chan,msb,lsb)
+{
+/*      prtime();
+        gprintf(TRANS, "Pitchbend, chan=%d msb=%d lsb=%d\n",chan+1,msb,lsb); */
+        insert_ctrl(the_score, gio_time(), 0, BEND_CTRL, chan + 1,
+                    ((lsb << 7) + msb) >> 6);
+}
+
+void smf_program(chan,program)
+{
+/*      prtime();
+        gprintf(TRANS, "Program, chan=%d program=%d\n",chan+1,program); */
+        insert_ctrl(the_score, gio_time(), 0, PROGRAM_CTRL, chan + 1, program);
+}
+
+void smf_chanpressure(chan,press)
+{
+/*      prtime();
+        gprintf(TRANS, "Channel pressure, chan=%d pressure=%d\n",chan+1,press);
+ */
+        insert_ctrl(the_score, gio_time(), 0, TOUCH_CTRL, chan + 1, press);
+}
+
+void smf_sysex(leng,mess)
+int leng;
+char *mess;
+{
+        char symb[10];
+        def_type defn;
+        int i;
+        sprintf(symb, "X%d", sysex_id++);
+        if (leng > 255) {
+            gprintf(TRANS, "sysex too long (%d bytes), ignored\n", leng - 2);
+            return;
+        }
+        /* need to end up with a prefix of [0][length], so add 2 to length;
+           note that this will copy past the end of the message -- this is
+           slightly dangerous and definitely crufty: 
+         */
+        defn = insert_def(the_score, symb, (unsigned char *) mess, leng + 2);
+        /* now fix up the definition by inserting the prefix bytes: */
+        for (i = leng + 1; i > 1; i--) 
+            defn->definition[i] = defn->definition[i - 2];
+        defn->definition[0] = 0;
+        defn->definition[1] = leng;
+        insert_macro(the_score, gio_time(), 0, defn, 1, 0, NULL);
+/*      prtime();
+        gprintf(TRANS, "Sysex, leng=%d (IGNORED)\n",leng); */
+}
+
+void smf_metamisc(type,leng,mess)
+char *mess;
+{
+        prtime();
+        gprintf(TRANS,
+                "Meta event, unrecognized, type=0x%02x leng=%d (IGNORED)\n",
+                type, leng);
+}
+
+void smf_metaspecial(type,leng,mess)
+char *mess;
+{
+        prtime();
+        gprintf(TRANS, 
+        "Meta event, sequencer-specific, type=0x%02x leng=%d (IGNORED)\n",
+                type, leng);
+}
+
+void smf_metatext(type,leng,mess)
+char *mess;
+{
+        static char *ttype[] = {
+                NULL,
+                "Text Event",           /* type=0x01 */
+                "Copyright Notice",     /* type=0x02 */
+                "Sequence/Track Name",
+                "Instrument Name",      /* ...       */
+                "Lyric",
+                "Marker",
+                "Cue Point",            /* type=0x07 */
+                "Unrecognized"
+        };
+        int unrecognized = (sizeof(ttype)/sizeof(char *)) - 1;
+
+        if ( type < 1 || type > unrecognized )
+                type = unrecognized;
+}
+
+void smf_metaseq(num)
+{
+        prtime();
+        gprintf(TRANS, "Meta event, sequence number = %d (IGNORED)\n",num);
+}
+
+void smf_metaeot()
+{
+/*      prtime();
+        gprintf(TRANS, "Meta event, end of track\n"); */
+}
+
+void smf_keysig(sf,mi)
+{
+/*      prtime();
+        gprintf(TRANS, "Key signature, sharp/flats=%d  minor=%d\n",sf,mi); */
+}
+
+/* smf_tempo -- handle a midifile tempo change */
+/*
+ * NOTE: if divisions is positive, it gives time units per quarter, and
+ * tempo is microsec per division.  The product is microsec per quarter.
+ * To convert to ticksize (parameter to insert_clock), we divide by 24*1000
+ * to get units of millisec and 24ths of quarter notes.  insert_clock
+ * expects this to have a 16 bit fractional part.
+ */
+void smf_tempo(tempo)
+long tempo;
+{
+        time_type ctime = gio_time();
+        long ticksize = scale(tempo, 1024L, 375L);
+/*      (tempo / 24000) << 16;   microsec/clock converted to ms/quarter, shifted 16*/
+
+/*      prtime();
+        gprintf(TRANS, "Tempo, microseconds-per-MIDI-quarter-note = %ld\n",tempo);
+*/ 
+        tempomap_insert(the_tempomap, Mf_currtime, tempo / divisions);
+        if (ctime == 0) {
+            /* we already have a clock event at t=0 -> fix it */
+            initial_clock->u.clock.ticksize = ticksize;
+        } else { /* we need a new one */
+            /* NOTE: after the first clock, insert clock events 1/2 tick early
+                to make sure ticksize is set before clock_tick() wakes up and
+                reads it.
+             */
+            insert_clock(the_score, ctime - (prev_ticksize >> 17), 0, ticksize);
+            prev_ticksize = ticksize;
+        }
+}
+
+void smf_timesig(nn,dd,cc,bb)
+{
+/*      int denom = 1;
+        while ( dd-- > 0 )
+                denom *= 2;
+        prtime();
+        gprintf(TRANS, 
+"Time signature=%d/%d  MIDI-clocks/click=%d  32nd-notes/24-MIDI-clocks=%d\n",
+                nn,denom,cc,bb); */
+}
+
+void smf_smpte(hr,mn,se,fr,ff)
+{
+        prtime();
+        gprintf(TRANS,
+    "SMPTE, hour=%d minute=%d second=%d frame=%d fract-frame=%d (IGNORED)\n",
+                hr, mn, se, fr, ff);
+}
+
+void smf_arbitrary(leng,mess)
+char *mess;
+{
+        prtime();
+        gprintf(TRANS, "Arbitrary bytes, leng=%d (IGNORED)\n",leng);
+}
+
+void smf_error(msg)
+  char *msg;
+{
+    gprintf(ERROR, msg);
+}
+
+
+void prtime()
+{
+        gprintf(TRANS, "Time=%ld/%ld ",Mf_currtime, gio_time());
+}
+
+void initfuncs()
+{
+        Mf_error = smf_error;
+        Mf_header =  smf_header;
+        Mf_starttrack =  smf_trackstart;
+        Mf_endtrack =  smf_trackend;
+        Mf_on =  smf_noteon;
+        Mf_off =  smf_noteoff;
+        Mf_pressure =  smf_pressure;
+        Mf_controller =  smf_parameter;
+        Mf_pitchbend =  smf_pitchbend;
+        Mf_program =  smf_program;
+        Mf_chanpressure =  smf_chanpressure;
+        Mf_sysex =  smf_sysex;
+        Mf_metamisc =  smf_metamisc;
+        Mf_seqnum =  smf_metaseq;
+        Mf_eot =  smf_metaeot;
+        Mf_timesig =  smf_timesig;
+        Mf_smpte =  smf_smpte;
+        Mf_tempo =  smf_tempo;
+        Mf_keysig =  smf_keysig;
+        Mf_sqspecific =  smf_metaspecial;
+        Mf_text =  smf_metatext;
+        Mf_arbitrary =  smf_arbitrary;
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/seqmread.h b/lib-src/libnyquist/nyquist/cmt/seqmread.h
new file mode 100644
index 0000000..a03da03
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqmread.h
@@ -0,0 +1,4 @@
+/* seqmread.h -- midi file reader */
+
+void seq_read_smf(seq_type seq, FILE *fp); /* LISP: (SEQ-READ-SMF SEQ FILE) */
+
diff --git a/lib-src/libnyquist/nyquist/cmt/seqmwrite.c b/lib-src/libnyquist/nyquist/cmt/seqmwrite.c
new file mode 100644
index 0000000..8afd7ad
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqmwrite.c
@@ -0,0 +1,651 @@
+/* created by DMH (damonhorowitz): write seq_type as standard midifile */
+/***************************************************************************
+*      Change Log
+*  Date     | Change
+*-----------+---------------------------------------------------------------
+* 11-Mar-94 | Created Change Log
+* 11-Mar-94 | PLu : Added private to function defs.
+* 28-Apr-03 |  DM : Change #include's for portability
+****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+
+#include "cext.h"
+#include "userio.h"
+#include "midicode.h"
+#include "mfmidi.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
+#include "seq.h"
+#include "seqread.h" /* to get scale() */
+#include "seqmwrite.h"
+
+long chunk_size_marker;
+int seti_counter;
+extern time_type a_start_time;
+
+long last_event;                        /*time from last_clock_event to the last event*/
+time_type last_clock_event;
+time_type last_tick_size;       /* millisec per tick shifted 16 bits */
+
+struct smf_write_seq {
+    seq_type seq;
+    int track;
+    FILE *outfile;
+    } smfw_seq;
+extern seq_type sequence; /* this is a global to be accessed by 
+               * routines called from the sequence */
+/* clock state: */
+extern time_type clock_ticksize;  /* millisec per tick shifted 16 bits */
+extern boolean clock_running;     /* TRUE if clock is running */
+extern boolean use_midi_clock;
+
+private void smfw_bend();
+private void smfw_cause_noteoff();
+private void smfw_ctrl();
+private void smfw_deltatime();
+private void smfw_dotrack();
+private void smfw_exclusive();
+private void smfw_noteoff();
+private void smfw_noteon();
+private void smfw_process_event();
+private void smfw_ramp_event(seq_type seq, event_type event, 
+    unsigned int value, unsigned int to_value, int increment,
+    time_type step, int n);
+private void smfw_send_macro();
+private void smfw_touch(seq_type seq, int voice, int value);
+private void writevarlen();
+
+
+/* smfw_bend -- write a pitch bend to a midi file */
+/**/
+private void smfw_bend(seq_type seq, int voice, int value)
+{
+    if(debug)   gprintf(TRANS, "smfw_bend %d\n", value);
+    smfw_deltatime();
+    putc(MIDI_BEND | (voice - 1), smfw_seq.outfile);
+    putc(0xFF & ((value & 0x1) << 6) , smfw_seq.outfile);
+    putc(0xFF & (value >> 1), smfw_seq.outfile);
+}
+
+
+/* smfw_cause_noteoff -- schedule a noteoff for midi file */
+/*
+ * NOTE: this is called by smfw_process_event when it handles a note
+ * event node in a seq_type's event list.  The ordinary moxc scheduler
+ * is used to "schedule" the noteoff in the future.  In reality, the
+ * output is done as fast as possible (by attempting an infinite rate),
+ * so no real timing delays occur.  The effect is to sort events by their
+ * specified time.
+ */
+private void smfw_cause_noteoff(seq, delay, voice, pitch)
+  seq_type seq;
+  time_type delay;
+  int voice;
+  int pitch;
+{
+    if(debug)       gprintf(TRANS, "cause noteoff at %ld...", virttime + delay);
+    pitch += seq->transpose;
+    while (pitch <= 0) pitch += 12;
+    while (pitch >= 127) pitch -= 12;
+    seq->noteoff_count++;
+    causepri((delay_type) delay, 10, seq->noteoff_fn,
+         seq, voice, pitch);
+    
+}
+
+private void smfw_clock_event(old_ticksize, new_ticksize)
+  time_type old_ticksize, new_ticksize;
+{
+    time_type temp_ticksize = new_ticksize;
+    new_ticksize = scale(new_ticksize, 375L, 1024L);
+/* (new_ticksize >> 16) * 24000 ms/clock becomes us/midiquarter */
+
+    if(debug)       gprintf(TRANS, "smfw_clock: write %ld (time:%ld) ->->->tempo %ld\n", 
+        new_ticksize, virttime, 2500L / (new_ticksize / 24000));
+
+    /*use old ticksize to write the delta for the clock event*/
+    last_tick_size = old_ticksize;
+    smfw_deltatime();
+    last_tick_size = temp_ticksize;/* reset to = new_tick_size */
+       putc(0xFF, smfw_seq.outfile);
+    putc(0x51, smfw_seq.outfile);
+    putc(0x03, smfw_seq.outfile);
+    putc((int) ((new_ticksize >> 16) & 0xFF), smfw_seq.outfile);
+    putc((int) ((new_ticksize >> 8) & 0xFF), smfw_seq.outfile);
+    putc((int) (new_ticksize & 0xFF), smfw_seq.outfile);
+
+    last_clock_event = virttime;
+    last_event = 0L;
+        /*no time expired between last clockevent and last event(they are the same).*/
+        /*next clock event will be exactly the next this_event from last_clock_event*/
+}
+
+
+/* smfw_ctrl -- write a control change to a midi file */
+/**/
+private void smfw_ctrl(seq_type seq, int voice, int ctrl_name, int value)
+{
+    if(debug)   gprintf(TRANS, "smfw_ctrl %d: %d\n", ctrl_name, value); 
+    smfw_deltatime();
+    putc(MIDI_CTRL | (voice - 1), smfw_seq.outfile);
+    putc(ctrl_name, smfw_seq.outfile);
+    putc(value, smfw_seq.outfile);
+}
+
+
+/* smfw_deltatime -- write the time difference between now an previous event */
+/**/
+private void smfw_deltatime()
+{
+    /* if last_ and clock_ are different, use last_ for clock deltatime*/
+    time_type use_ticksize = (clock_ticksize != last_tick_size) ?
+                last_tick_size : clock_ticksize;
+    time_type this_event = virttime - last_clock_event;
+    if(debug)   gprintf(TRANS, "delta! ticksize: %lu Lastev: %ld ThisevScaled: %lu Thisev: %lu ", 
+        clock_ticksize, last_event,  (this_event * ((2500L << 16) / use_ticksize)) / 100,
+         this_event);
+    
+    this_event = ((virttime - last_clock_event) * ((2500L << 16) / use_ticksize)) / 100;
+
+    if(debug)   gprintf(TRANS, "--- deltatime: %lu\n", this_event - last_event);        
+    writevarlen((long) (this_event - last_event));
+
+    last_event = this_event; 
+}
+
+
+/* smfw_dotrack -- write the remainder of a track  */
+private void smfw_dotrack(seq)
+  seq_type seq;
+{
+    long end_marker;
+    timebase_type old_timebase = timebase;
+    unsigned long chunk_size;
+
+    if (seq->runflag) {
+        if ((seq->timebase->virt_base == 0) &&
+          (seq->timebase->rate == STOPRATE)) 
+          /*we just set these last time through... do nothing*/;
+        seq_stop(seq);
+    }
+    timebase_use(seq->timebase);
+    set_rate(seq->timebase, STOPRATE);
+    set_virttime(seq->timebase, 0L);
+    seq->current = seq_events(seq);
+    seq->noteoff_count = 0L;
+    seq->runflag = TRUE;
+    seq->paused = TRUE;
+    last_clock_event = 0L;
+    last_event = 0L;
+    if(debug)   gprintf(TRANS, "dotrack (reset) %d %ld (%lu) \n", 
+        smfw_seq.track, last_event, virttime);
+
+    if (seq->current)   
+    cause((delay_type)(seq->current->ntime - virttime), smfw_process_event,
+         seq);
+    set_virttime(timebase, MAXTIME);
+    catchup();
+
+    putc(0x00, smfw_seq.outfile);
+    putc(0xFF, smfw_seq.outfile);/*end of track chunk*/
+    putc(0x2F, smfw_seq.outfile);
+    putc(0x00, smfw_seq.outfile);
+    end_marker = ftell(smfw_seq.outfile);
+    fseek(smfw_seq.outfile, chunk_size_marker, 0);/*go back to enter chunksize*/
+    chunk_size = (end_marker - chunk_size_marker) - 4;/* - 4 for 4 size bytes*/ 
+    if(debug)   gprintf(TRANS, "bytes written in previous track: %ld \n\n", chunk_size);
+    putc((int) ((0xFF & (chunk_size >> 24))), smfw_seq.outfile);
+    putc((int) ((0xFF & (chunk_size >> 16))), smfw_seq.outfile);
+    putc((int) ((0xFF & (chunk_size >> 8))), smfw_seq.outfile);
+    putc((int) ((0xFF & chunk_size)), smfw_seq.outfile);
+    fseek(smfw_seq.outfile, end_marker, 0);/*return file pointer to end of track*/
+    timebase_use(old_timebase);
+}
+
+
+/* smfw_exclusive -- write a system excl. msg to midi file */
+private void smfw_exclusive(length, msg)
+int length;
+unsigned char *msg; 
+{
+    int length_count = 0;
+
+    if(debug)   gprintf(TRANS, "SYSEX (time:%ld)\n", virttime);
+
+    smfw_deltatime();
+   
+    while (length > length_count){ /* *(msg-1) != MIDI_EOX) { */
+        putc(*msg++, smfw_seq.outfile); 
+        length_count++;
+    }
+    if(*(--msg) != MIDI_EOX) gprintf(TRANS, "ERROR: no end of sysex\n");
+}
+
+private void smfw_msg_write(n,c1,c2,c3)
+  int n;
+  unsigned char c1,c2,c3;
+{
+    if(debug)   gprintf(TRANS, "MSGWRITE %d bytes (time:%ld)\n", n, virttime);
+    smfw_deltatime();
+    switch(n) {
+    case 1: putc(c1, smfw_seq.outfile);
+        break;
+    case 2: putc(c1, smfw_seq.outfile);
+        putc(c2, smfw_seq.outfile);
+        break;
+    case 3: putc(c1, smfw_seq.outfile);
+        putc(c2, smfw_seq.outfile);
+        putc(c3, smfw_seq.outfile);
+        break;
+    }
+}
+
+
+/* smfw_noteoff -- write noteoff to midi file */
+/**/
+private void smfw_noteoff(seq_type seq, int voice, int pitch)
+{
+    if(debug)       gprintf(TRANS, "smfw_noteoff %d: %d (time:%ld)\n", voice, pitch, virttime);
+    smfw_deltatime();
+    putc(NOTEOFF | (voice - 1), smfw_seq.outfile);
+    putc(pitch, smfw_seq.outfile);
+    putc(0x40, smfw_seq.outfile);
+} 
+
+
+/* smfw_noteon -- write noteon to midi file */
+/*
+ * NOTE: the seq parameter is not used here, but is passed in by the
+ * seq_noteon macro, so we have to have a placeholder for it.
+ */
+private void smfw_noteon(seq, voice, pitch, vel)
+  seq_type seq;
+  int voice, pitch, vel;
+{
+    if(debug)   gprintf(TRANS, "smfw_noteon %d: %d %d(time:%ld)\n", voice, pitch, vel, virttime);
+    smfw_deltatime();
+    putc(NOTEON | (voice - 1), smfw_seq.outfile);
+    putc(pitch, smfw_seq.outfile);
+    putc(vel, smfw_seq.outfile);
+}
+
+
+/* smfw_process_event -- write a seq event to a midi file */
+/**/
+private void smfw_process_event(seq)
+  seq_type seq;
+{
+    register event_type event;
+    if (!seq->runflag) return;
+    while ((event = seq->current) && (event->ntime <= virttime)) {
+    unsigned int voice;
+    if ((vc_voice(event->nvoice) == smfw_seq.track) ||       /*if on current track*/
+        (((vc_voice(event->nvoice) - 16) == smfw_seq.track) 
+            && (smfw_seq.track > 0)) ||
+        /* acknowledge clock change on all tracks*/
+        (event->value == CLOCK_VALUE && vc_ctrl(event->nvoice) == ESC_CTRL)) {
+
+        /* process all current (and earlier) events */
+        if (is_note(event)) {   /*** play a note or rest ***/
+        /* if this note is not a rest, play it and schedule an off event */
+        if (event->value != NO_PITCH &&
+              (seq_channel_mask(seq) &
+               (1 << ((voice = vc_voice(event->nvoice)) - 1)))) {
+            seq_noteon(seq, voice, (0xFF & event->value), 
+            (int) (event->u.note.ndur & 0xFF));
+        
+            seq_cause_noteoff(seq, (event->u.note.ndur) >> 8, 
+              voice, (0xFF & event->value)); 
+        }
+        } else {                    /*** send a control command ***/
+        int n;
+        time_type step;
+        int delta;
+        int increment;
+        int voice = vc_voice(event->nvoice);
+        ulong enabled = seq_channel_mask(seq) & (1 << (voice - 1));
+
+        switch (vc_ctrl(event->nvoice)) {
+          case PSWITCH_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "porta %d (time:%ld)... ", event->value, virttime);
+            seq_midi_ctrl(seq, voice, PORTASWITCH, 0xFF & event->value);
+            break;
+          case MODWHEEL_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "modw %d (time:%ld)...", event->value, virttime);
+            seq_midi_ctrl(seq, voice, MODWHEEL, 0xFF & event->value);
+            break;
+          case TOUCH_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "touch %d (time:%ld)... ", event->value, virttime);
+            seq_midi_touch(seq, voice, 0xFF & event->value);
+            break;
+          case VOLUME_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "ftvol %d (time:%ld)...", event->value, virttime);
+            seq_midi_ctrl(seq, voice, VOLUME, 0xFF & event->value);
+            break;
+          case BEND_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "bend %d (time:%ld)... ", event->value, virttime);
+            seq_midi_bend(seq, voice, event->value);
+            break;
+          case PROGRAM_CTRL:
+            if (!enabled) break;
+            if(debug)    gprintf(TRANS, "prog %d (time:%ld)\n", event->value, virttime);
+            smfw_deltatime();
+            putc(MIDI_CH_PROGRAM | (voice - 1), smfw_seq.outfile);
+            putc(0xFF & event->value, smfw_seq.outfile);
+            break;
+          case ESC_CTRL:
+            switch (event->value) {
+              time_type this_event;
+              case CALL_VALUE:       /*called routine will write to midifile in execution */
+                sequence = seq;
+                (*(event->u.call.routine))(event->u.call.args);
+                break;
+              case CLOCK_VALUE:
+                clock_ticksize = event->u.clock.ticksize;
+                if(debug)    gprintf(TRANS, "clockevent! ticksize: %lu (time:%ld)\n",
+                    clock_ticksize, virttime);
+    
+                if (virttime > 0) {  /* any clock before this is already recorded in the header */
+                    if (smfw_seq.track == 0) {             /* record clock event on tempo track = 0 */
+                    /* cause clock write in half a newtick, because it was written .5 tick early*/
+                    cause((delay_type) (clock_ticksize >> 17), smfw_clock_event, 
+                          last_tick_size, clock_ticksize);
+                    last_tick_size = clock_ticksize; /*set new ticksize*/
+                    } else { /*not on tempo track*/
+                    this_event = ((virttime - last_clock_event) *
+                            ((2500L << 16) / last_tick_size)) / 100;
+                    if(debug)   gprintf(TRANS, "track != 0: Lastev: %ld Thisev: %ld NewLast: %ld\n", 
+                    last_event, this_event, this_event - last_event);
+                    last_event = 0L - (this_event - last_event);
+                        last_clock_event = virttime;
+                    /*last_event is negative, so will be ADDED to next this_event*/
+    
+                    last_tick_size = clock_ticksize;
+                    }               
+                } else if (debug) gprintf(TRANS, "IGNORED\n");/* if virttime <= 0 */
+                break;
+              case MACCTRL_VALUE:
+                if (!enabled) break;
+                if (debug) gprintf(TRANS, "MACCTRL %d: %d (time:%ld)\n", 
+                        event->u.macctrl.ctrl_number, event->u.macctrl.value, virttime);
+                smfw_deltatime();
+                putc(MIDI_CTRL | (voice - 1), smfw_seq.outfile);
+                putc(0xFF & event->u.macctrl.ctrl_number, smfw_seq.outfile);
+                putc(0xFF & event->u.macctrl.value, smfw_seq.outfile);
+                break;
+              case MACRO_VALUE:
+                if (!enabled) break;
+                if (debug) gprintf(TRANS, "MACRO sent to...\n");
+                smfw_send_macro(event->u.macro.definition,
+                  voice, event->u.macro.parameter, -1, 0);
+                break;
+              case CTRLRAMP_VALUE:
+              case DEFRAMP_VALUE: {
+                int from, to;
+                if (!enabled) break;
+                step = event->u.ramp.step;
+                if (event->value == CTRLRAMP_VALUE) {
+                if(debug)   gprintf(TRANS, "CTRLRAMP (time:%ld)...", virttime);
+                    from = event->u.ramp.u.ctrl.from_value;
+                    to = event->u.ramp.u.ctrl.to_value;
+                } else {
+                    if (debug) gprintf(TRANS, "DEFRAMP (time:%ld)...", virttime);
+                    from = event->u.ramp.u.def.parameter[
+                        event->u.ramp.u.def.parm_num];
+                    to = event->u.ramp.u.def.to_value;
+                }
+                delta = to - from;
+                increment = delta;
+                if (delta < 0) delta = -delta;
+                /* RBD - Note: Step is always non-zero */
+                n = event->u.ramp.dur / step;
+                increment = (increment << 8) / n;
+                smfw_ramp_event(seq, event, from << 8, to << 8, 
+                       increment, step, n);
+                seq->noteoff_count++;
+                break;
+              }
+              case SETI_VALUE:
+                seti_counter++; /*will be printed after writing is completed*/
+                *(event->u.seti.int_to_set) = event->u.seti.value;
+                break;
+              default:
+                gprintf(TRANS, "unexpected ESC_CTRL value\n");
+                break;
+            }
+            break;
+          default:
+            gprintf(TRANS, "unexpected seq data\n");
+            break;
+        }
+        }
+    }
+    seq->current = event->next;
+    }
+    if (seq->current) { /* if there is an event: delay, and then process again */
+    cause((delay_type)(event->ntime - virttime), smfw_process_event, seq);
+    }
+}
+
+/* smfw_ramp_event -- generate a ramp to write*/
+private void smfw_ramp_event(seq, event, value, to_value, increment, step, n)
+  seq_type seq;
+  register event_type event;
+  unsigned int value;
+  unsigned int to_value;
+  int increment;
+  time_type step;
+  int n;
+{
+    if(debug)   gprintf(TRANS, "ramp of %d: %d to %d\n", event->u.ramp.ctrl, value >> 8,
+        to_value >> 8);     
+    if (seq->runflag) {
+    int voice = vc_voice(event->nvoice);
+    if (n == 0) value = to_value;
+    else cause((delay_type)step, smfw_ramp_event, seq, event, value + increment,
+           to_value, increment, step, n - 1);
+    if (event->value == CTRLRAMP_VALUE) {
+        int ctrl = event->u.ramp.ctrl;
+        if (ctrl == -TOUCH_CTRL) smfw_touch(seq, voice, value >> 8);
+        else if (ctrl == -BEND_CTRL) smfw_bend(seq, voice, value >> 8);
+        else smfw_ctrl(seq, voice, ctrl, value >> 8);
+    } else { /* must be DEFRAMP_VALUE */
+        smfw_send_macro(event->u.ramp.u.def.definition,
+        vc_voice(event->nvoice),
+        event->u.ramp.u.def.parameter,
+        event->u.ramp.u.def.parm_num, value >> 8);
+    }
+    if (n == 0) seq_end_event(seq);
+    }
+}
+
+
+/* smfw_send_macro -- write msg to midi file from a seq "macro" event */
+/**/
+private void smfw_send_macro(ptr, voice, parameter, parm_num, value)
+  register unsigned char *ptr;
+  int voice;
+  short parameter[];
+  int parm_num;
+  int value;
+{
+    register unsigned char code, *loc;
+    while ((code = *ptr++)) {
+        loc = ptr + *ptr;
+        ptr++;
+        if (code <= nmacroparms) {
+            code--;
+            *loc = (code == parm_num ? value : parameter[code]) & 0x7f;
+        }
+        else if (code == nmacroparms + 1) {
+            *loc = ((voice - 1) & 0xF) | *loc;
+        }
+        else {
+            code -= (nmacroparms + 2);
+            *loc = ((code == parm_num ? value : parameter[code]) >> 7) & 0x7F;
+        }
+    }
+    if (ptr[1] == MIDI_SYSEX)
+        smfw_exclusive(*ptr, ptr + 1);
+    else
+        smfw_msg_write(*ptr, ptr[1], ptr[2], ptr[3]);
+}
+
+
+/* smfw_touch -- write aftertouch msg to midi file */
+/**/
+private void smfw_touch(seq_type seq, int voice, int value)
+{
+    if(debug)   gprintf(TRANS, "smfw_touch %d\n", value);
+    smfw_deltatime();
+    putc(MIDI_TOUCH | (voice - 1), smfw_seq.outfile);
+    putc(value, smfw_seq.outfile);
+}
+
+
+void seq_write_smf(seq, outfile)
+  seq_type seq;
+  FILE *outfile;
+{
+    time_type put_tick_size;
+    int i;
+    /* ticksize is milliseconds << 16, and tickrate = 24*tempo
+       60000ms/min / (24 * tempo) = 2500/tempo = 25
+       25 << 16 = 1638400 */
+    time_type starting_ticksize = 1638400L; /*default midifile tempo 100*/
+    int track_count = 0;
+    long track_count_marker;
+    register event_type event;
+
+    seti_counter = 0;
+    
+    /*initialize the smfw_seq struct*/
+    smfw_seq.outfile = outfile;
+    smfw_seq.seq = seq_copy(seq);
+
+    smfw_seq.seq->cause_noteoff_fn = smfw_cause_noteoff;
+    smfw_seq.seq->midi_bend_fn    = smfw_bend;
+    smfw_seq.seq->midi_ctrl_fn    = smfw_ctrl;
+    smfw_seq.seq->midi_touch_fn   = smfw_touch;
+    smfw_seq.seq->noteoff_fn      = smfw_noteoff;
+    smfw_seq.seq->noteon_fn       = smfw_noteon;
+
+    event = seq_events(smfw_seq.seq);
+
+    /*search for clock events up till start of score*/
+    while(event->ntime <= 0){
+        if(debug)   gprintf(TRANS, "event (time:%ld)\n", event->ntime); 
+        if(vc_ctrl(event->nvoice) == ESC_CTRL && event->value == CLOCK_VALUE) {
+            if(debug)   gprintf(TRANS, "clock %lu at 0\n", event->u.clock.ticksize);
+            starting_ticksize = event->u.clock.ticksize;
+            break;
+            }
+        event = event->next;
+    }
+
+    putc(0x4D, smfw_seq.outfile); /*header:  MThd*/
+    putc(0x54, smfw_seq.outfile);
+    putc(0x68, smfw_seq.outfile);
+    putc(0x64, smfw_seq.outfile);
+    putc(0x00, smfw_seq.outfile);
+    putc(0x00, smfw_seq.outfile);
+    putc(0x00, smfw_seq.outfile);
+    putc(0x06, smfw_seq.outfile);
+    putc(0x00, smfw_seq.outfile);
+    putc(0x01, smfw_seq.outfile);       /*format 1 */
+    putc(0x00, smfw_seq.outfile);
+
+    track_count_marker = ftell(smfw_seq.outfile);   /*number of tracks will be written later*/
+    putc(0x00, smfw_seq.outfile);                                       /*will be filled by track_count_marker*/
+
+    putc(0x02, smfw_seq.outfile);/*division resolution of 600*/
+    putc(0x58, smfw_seq.outfile);
+
+    for(i = 0; i < 17; i++){/*for each track..*/
+        if(((seq_used_mask(smfw_seq.seq) >> (i - 1)) & 0x1) || (i == 0)){
+        if(debug) gprintf(TRANS, "write track %d \n", i);
+        track_count++;
+        clock_ticksize = starting_ticksize;
+        last_tick_size = starting_ticksize;
+        putc(0x4D, smfw_seq.outfile);/*track header: MTrk*/
+        putc(0x54, smfw_seq.outfile);
+        putc(0x72, smfw_seq.outfile);
+        putc(0x6B, smfw_seq.outfile);
+       
+        chunk_size_marker = ftell(smfw_seq.outfile);/*size of chunk will be written later*/
+        putc(0x00, smfw_seq.outfile);                               /*will be filled by chunk_size_marker*/
+        putc(0x00, smfw_seq.outfile);
+        putc(0x00, smfw_seq.outfile);
+        putc(0x00, smfw_seq.outfile);
+
+        if(i == 0) { /*tempo and time signature track*/
+            putc(0x00, smfw_seq.outfile);/* default time sig stuff*/
+            putc(0xFF, smfw_seq.outfile);
+            putc(0x58, smfw_seq.outfile);
+            putc(0x04, smfw_seq.outfile);
+            putc(0x04, smfw_seq.outfile);
+            putc(0x02, smfw_seq.outfile);
+            putc(0x18, smfw_seq.outfile);
+            putc(0x08, smfw_seq.outfile);
+            putc(0x00, smfw_seq.outfile);
+            
+            putc(0xFF, smfw_seq.outfile);/*TEMPO: inserted here in case default is used*/
+            putc(0x51, smfw_seq.outfile);
+            putc(0x03, smfw_seq.outfile);
+            /* ticksize is in ms<<16, so to get milliseconds per tick, it's
+               ticksize / 65536. To get beat durations, multiply by 24 to get
+               ticksize * 24 / 65536. To get microseconds, multiply by 1000:
+               ticksize * 24000 / 65536. Divide both constants by 64 to get
+               ticksize * 375 / 1024 = microseconds per quarter note.
+            */
+            put_tick_size = scale(clock_ticksize, 375L, 1024L);
+            putc((int) ((put_tick_size >> 16) & 0xFF), smfw_seq.outfile);
+            putc((int) ((put_tick_size >> 8) & 0xFF), smfw_seq.outfile);
+            putc((int) (put_tick_size & 0xFF), smfw_seq.outfile);
+        }
+        smfw_seq.track = i;
+        smfw_dotrack(smfw_seq.seq);
+      }
+    }
+    if(seti_counter) gprintf(TRANS, "%d SETI events IGNORED!\n", seti_counter);
+    seq_stop(smfw_seq.seq);
+    fseek(smfw_seq.outfile, track_count_marker, 0);/*go back and insert number of tracks*/
+    putc(0xFF & track_count, smfw_seq.outfile);
+    fclose(smfw_seq.outfile);
+}
+
+
+/* writevarlen -- write a variable length integer to midi file */
+/**/
+private void writevarlen(value)
+  register long value;
+{       
+    register ulong buffer;
+
+    if(debug) gprintf(TRANS, "variable length quantity...");
+
+    buffer = value & 0x7f;
+
+    while((value >>= 7) > 0) {
+    buffer <<= 8;
+    buffer |= 0x80;
+    buffer += (value & 0x7f);
+    }
+
+    for(;;) {
+    if(debug) gprintf(TRANS, " byte ");
+    putc((int) (buffer & 0xFF), smfw_seq.outfile);
+    if (buffer & 0x80)  buffer >>= 8;
+    else break;
+    }
+    if(debug) gprintf(TRANS, "written!\n");
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/seqmwrite.h b/lib-src/libnyquist/nyquist/cmt/seqmwrite.h
new file mode 100644
index 0000000..458336f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqmwrite.h
@@ -0,0 +1,4 @@
+/* seqmwrite.h -- midi file writer */
+
+void seq_write_smf(seq_type seq, FILE *outfile); /* LISP: (SEQ-WRITE-SMF SEQ FILE) */
+
diff --git a/lib-src/libnyquist/nyquist/cmt/seqread.c b/lib-src/libnyquist/nyquist/cmt/seqread.c
new file mode 100644
index 0000000..62d759d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqread.c
@@ -0,0 +1,1890 @@
+/****************************************************************************
+               seqread.c -- Phase 1 of adagio compilation...
+
+ this module parses adagio programs and builds a linked list structure
+ consisting of notes and control changes in time order.
+
+ Copyright 1989 Carnegie Mellon University
+*****************************************************************************/
+
+/*****************************************************************************
+*       Change Log
+*  Date     | Change
+*-----------+-----------------------------------------------------------------
+* 31-Dec-85 | Created changelog
+* 31-Dec-85 | Add c:\ to include directives
+* 31-Dec-85 | Added standard command scanner, metronome variable, need to add 
+*           | cmdline_help procedure
+* 31-Dec-85 | Call intr_init
+* 31-Dec-85 | Set musictrace from command line via -trace
+* 31-Dec-85 | Added -poll
+*  1-Jan-86 | Put error messages out to stderr
+*  1-Jan-86 | Set IsAT.     Can be later overridden by -at and -xt switches,
+*           | currently only used for diagnostics (may be needed for
+*           | compatibles, who knows?  In which case remove the tests which
+*           | confirm the type of processor)
+*  1-Jan-86 | <rgd/jmn> Removed dur-adjusted message
+*  1-Jan-86 | Added miditrace
+* 18-Jan-86 | Shortened durations by 1/200 s to avoid roundoff problems --
+*           | see buildnote for details.
+*  3-Mar-86 | Allow octave and accidentals in either order after pitch name.
+*           | Default octave is now one that gets nearest previous pitch,
+*           |  the tritone (half an octave) interval is descending by default.
+*           | Special commands handled by table search, !Rate command added
+*           |  to scale all times by a percentage (50 = half speed).
+*  9-Mar-86 | Use space to limit amount of storage allocation.    Otherwise
+*           |    exhausting storage in phase1 caused phase2 to fail.
+* 12-Mar-86 | Broke off command line parser into adagio.c, only parser remains
+* 24-Mar-86 | Changed representation from note_struct to event_struct
+*           | Parse M, N, O, X, and Y as control change commands
+* 23-May-86 | Added , and ; syntax: "," means "N0\n", ";" means "\n"
+* 16-Jul-86 | modify to only call toupper/lower with upper/lower case as
+*           |  parameter to be compatible with standard C functions
+*  7-Aug-86 | fixed bug with default pitches and rests
+*  5-Jul-87 | F.H: Introduced new memory handling from Mac version.
+*           |    Changed:    init()
+*           |       ins_event()
+*           |       ins_ctrl()
+*           |       ins_note()
+*           |    Deleted:    reverse()
+*           |       nalloc()
+*           |    Introduced:    event_alloc()
+*           |       phase1_FreeMem()
+*           |       system.h & system.c dependencies
+* 10-Feb-88 | fixed parseend to accept blanks and tabs,
+*           | fixed rate scaling of durations
+* 11-Jun-88 | commented out gprintf of \n to ERROR after parsing finished.
+* 13-Oct-88 | JCD : exclusive AMIGA version.
+* 13-Apr-89 | JCD : New portable version.
+* 31-Jan-90 | GWL : Cleaned up for LATTICE
+* 30-Jun-90 | RBD : further changes
+*  2-Apr-91 | JDW : further changes
+* 30-Jun-91 | RBD : parse '+' and '/' in durations, * after space is comment
+* 28-Apr-03 |  DM : changes for portability
+*****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "cext.h"
+#include "cmdline.h"
+#include "midifns.h" /* to get time_type */
+#include "timebase.h"
+#include "moxc.h"    /* to get debug declared */
+#include "seq.h"
+#include "seqread.h"
+#include "userio.h"
+/* ctype.h used to be included only by UNIX and AMIGA,
+   surely everyone wants this? */
+#include "ctype.h"
+
+#ifndef toupper
+/* we're already taking precautions, so inline version of toupper is ok: */
+#define toupper(c) ((c)-'a'+'A')
+/* CAUTION: AZTEC V5.0 defines an inline version of toupper called _toupper,
+   but they got it wrong!
+ */
+#endif
+
+/* cmtcmd.h references amiga message ports */
+#ifdef AMIGA
+#ifdef LATTICE
+#include "amiga.h"
+#endif
+#include "exec/exec.h"
+#endif
+#include "cmtcmd.h"
+
+/* public stuff */
+extern long space;    /* remaining free bytes */
+extern int abort_flag;
+
+/****************************************************************************
+ The following are used to simulate fixed point with the radix point
+ 8 bits from the right:
+****************************************************************************/
+
+#define precise(x) (((time_type) x) << 8)
+#define seqround(x) ((((time_type) x) + 128) >> 8)
+#define trunc(x) (((time_type) x) >> 8)
+
+#define nullstring(s) (s[0] == EOS)
+
+
+/****************************************************************************
+* Routines local to this module:
+****************************************************************************/
+private void            do_a_rest();
+private time_type       doabsdur();
+private int             doabspitch();
+private void            doclock();
+private void            docomment();
+private void            doctrl();
+private void            dodef();
+private time_type       dodur();
+private void            doerror();
+private int             doloud();
+void            domacro();
+private void            donextdur();
+private int             dopitch();
+private void            doprogram();
+private void            dorate();
+private void            doset();
+private void            dospecial();
+private time_type       dosymdur();
+private void            dotempo();
+private void            dotime();
+private void            dovoice();
+private void            fferror();
+private void            init();
+private int             issymbol();
+private void            marker();
+private void            parseend();
+private void            parsefield();
+private boolean         parsenote();
+private boolean         parseparm();
+private int             scan();
+private int             scan1();
+private long            scanint();
+private void            scansymb();
+private long            scansgnint();
+
+/****************************************************************************
+* data structures for parser lookup tables
+****************************************************************************/
+
+struct durt {    /* duration translation table */
+    char symbol;
+    time_type value;
+};
+
+#define durtable_len 7
+struct durt durtable[durtable_len] = {
+    {'W', 4800L},
+    {'H', 2400L},
+    {'Q', 1200L},
+    {'I', 600L},
+    {'S', 300L},
+    {'%', 150L},
+    {'^', 75L}
+};
+
+struct loudt {    /* loudness translation table */
+    char symbol[4];
+    int value;
+};
+
+struct loudt loudtable[] = {
+    {"PPP", 20},
+    {"PP\0", 26},
+    {"P\0\0", 34},
+    {"MP\0", 44},
+    {"MF\0", 58},
+    {"F\0\0", 75},
+    {"FF\0", 98},
+    {"FFF", 127}
+};
+
+char too_many_error[] = "Too many parameters";
+
+private char *ssymbols[] = {"TEMPO", "RATE", "CSEC", "MSEC", 
+                            "SETI", "SETV", "CALL", "RAMP",
+                            "CLOCK", "DEF", "END"};
+
+#define sym_tempo 0
+#define sym_rate 1
+#define sym_csec 2
+#define sym_msec 3
+#define sym_seti 4
+#define sym_setv 5
+#define sym_call 6
+#define sym_ramp 7
+#define sym_clock 8
+#define sym_def 9
+#define sym_end 10
+
+/* number of symbols */
+#define sym_n 11
+
+#define linesize 100
+private char line[linesize];    /* the input line */
+private char token[linesize];    /* a token scanned from the input line */
+
+private boolean pitch_flag;    /* set when a pitch is indicated */
+/* (if controls changes are given, only allocate a note event if
+     *  a pitch was specified -- i.e. when pitch_flag is set)
+     */
+private boolean rest_flag;    /* set when a rest (R) is found */
+/* this flag is NOT inherited by the next line */
+
+private boolean symbolic_dur_flag;
+/* TRUE if last dur was not absolute
+         * (if this is set, then the default duration is changed
+         *  accordingly when the tempo is changed.)
+         */
+
+
+#define nctrl 8
+
+private boolean ctrlflag[nctrl];
+/* TRUE if control change was present
+         * ctrlflag[0] TRUE if ANY control change
+         * was present
+         */
+private int ctrlval[nctrl];
+/* the new value of the control */
+#define nmacroctrl 10
+short macctrlx;                 /* index into the following: */
+short macctrlnum[nmacroctrl];   /* macro ctrl number, e.g. for ~4(67), or
+                                 * number of parameters for a symbolic macro */
+short macctrlparmx[nmacroctrl]; /* ctrl value for ctrl change, or index of
+                                 * parameters for symbolic macro */
+short macctrlparms[nmacroctrl*nmacroparms]; /* parameters for symbolic macros */
+short macctrlnextparm;
+def_type macctrldef[nmacroctrl]; /* definition for symbolic macro */
+
+private time_type time_scale; /* 1000 if centisec, 100 if millisec */
+/* note: user_specified_time * (time_scale / rate) = millisec */
+
+
+
+/****************************************************************************
+*
+*    variables private to this module
+*
+****************************************************************************/
+
+private boolean end_flag = FALSE;    /* set "true" when "!END" is seen */
+
+/****************************************************************************
+*               state variables
+* Because each line of an Adagio score inherits properties from the previous
+* line, it makes sense to implement the parser as a collection of routines
+* that make small changes to some global state.     For example, pitch is a
+* global variable.  When the field G4 is encountered, the dopitch routine
+* assigns the pitch number for G4 to the variable pitch.  After all fields
+* are processed, these variables describe the current note and contain the
+* default parameters for the next note as well.
+*
+* Global variables that are used in this way by the parsing rountines are:
+****************************************************************************/
+private int
+linex,    /* index of the next character to be scanned */
+lineno,    /* current line number */
+fieldx,    /* index of the current character within a field */
+pitch,    /* pitch of note */
+loud,    /* loudness of note */
+voice,    /* voice (midi channel) of note */
+artic;  /* articulation (a percentage of duration) */
+
+private boolean ndurp;  /* set when a next (N) is indicated */
+/* (next time defaults to the current time plus duration unless
+     *  overridden by a next (N) command whose presence is signalled
+     *  by ndurp.)
+     */
+
+private time_type
+thetime,    /* the starting time of the note */
+rate,    /* time rate -- scales time and duration, default = 100 */
+ntime,    /* the starting time of the next note */
+dur,    /* the duration of the note */
+tempo,    /* the current tempo */
+start,    /* the reference time (time of last !tempo or !rate cmd) */
+ticksize; /* set by !clock command, zero for no clock */
+
+private int pitchtable[7] = { 
+    69, 71, 60, 62, 64, 65, 67 };
+
+extern char score_na[name_length];
+
+private seq_type the_score;  /* this is the score we are parsing */
+
+
+/* def_append -- append a byte to the current definition */
+/*
+ * The def data structure:
+ *     [code][offset][code][offset]...[0][length][data][data][data]...
+ * where code is 1:nmacroparms for %n,
+ *               nmacroparms+1 for %v,
+ *               nmacroparms+2:nmacroparms*2+1 for ^n
+ * and offset is the byte offset (from the offset byte) to the data
+ *      where the parameter should be substituted
+ * and length is the number of data bytes
+ */
+boolean def_append(def, nparms, data)
+  unsigned char def[];
+  int nparms;
+  int data;
+{
+    int base = (nparms << 1) + 1;       /* this byte is the length */
+    /* first parameter has to be able to reference last byte: */
+    if ((def[base])++ >= (254 - (nparms << 1))) {
+        fferror("Data too long");
+        return FALSE;
+    }
+    def[base + def[base]] = data;
+    return TRUE;
+}
+
+
+def_type def_lookup(symbol)
+  char *symbol;
+{
+    def_type defn = seq_dictionary(the_score);
+    while (defn) {
+        if (strcmp(defn->symbol, symbol) == 0) {
+            return defn;
+        }
+        defn = defn->next;
+    }
+    return NULL;
+}
+
+
+void def_parm(def, nparms, code)
+  unsigned char def[];
+  int nparms;
+  int code;
+{
+    int i, j;
+    /* in order to insert a 2-byte parameter descriptor, the offsets from
+     * previous descriptors (that precede the data) need to be increased by 2:
+     */
+    for (i = 1; i < (nparms << 1); i += 2) {
+        def[i] += 2;
+    }
+    /* now i is index of length; work backwards from the last byte, moving
+     * everything up by 2 bytes to make room for the new descriptor:
+     */
+    for (j = i + def[i] + 2; j > i; j--) {
+        def[j] = def[j - 2];
+    }
+    /* now i is index of offset; insert the descriptor code (first byte)
+     * and the offset to the parameter location in the message (second byte)
+     */
+    def[i - 1] = code;
+    def[i] = def[i + 2] + 2;
+}
+
+/****************************************************************************
+*               do_a_rest
+* Effect: parses a rest (R) command
+****************************************************************************/
+
+private void do_a_rest()
+{
+    if (token[fieldx])
+        fferror("Nothing expected after rest");
+    rest_flag = TRUE;
+}
+
+/****************************************************************************
+*               doabsdur
+* Effect: parses an absolute dur (U) command
+****************************************************************************/
+
+private time_type doabsdur()
+{
+    time_type result=1000L;
+    register char c;
+    if (isdigit(token[fieldx])) {
+        result = precise(scanint());
+        /* allow comma or paren for use in parameter lists */
+        if ((c = token[fieldx]) && (c != ',') && (c != ')') && (c != '+')) {
+            fferror("U must be followed by digits only");
+        }
+        if (time_scale == 1000) result *= 10; /* convert to ms */
+    } else fferror("No digit after U");
+    return result;
+}
+
+/****************************************************************************
+*               doabspitch
+* Effect: parses an absolute pitch (P) command
+****************************************************************************/
+
+private int doabspitch()
+{
+    int result = 60;
+    int startx = fieldx;
+    register char c;
+    int savex;
+    if (isdigit (token[fieldx])) {
+        result = (int) scanint();
+        /* allow comma or paren for abspitch in parameter */
+        if ((c = token[fieldx]) && c != ',' && c != ')')
+            fferror("P must be followed by digits only");
+        else if (result < minpitch) {
+            savex = fieldx;
+            fieldx = startx;
+            fferror("Minimum pitch of 0 will be used");
+            result = minpitch;
+            fieldx = savex;
+        } else if (result > maxpitch) {
+            savex = fieldx;
+            fieldx = startx;
+            fferror("Maximum pitch of 127 will be used");
+            result = maxpitch;
+            fieldx = savex;
+        }
+    } else fferror("No digits after P");
+    return result;
+}
+
+
+/* doartic -- compute an articulation factor */
+/*
+  NOTE: artic is a percentage that scales the duration
+  of notes but not the time to the next note onset. It
+  is applied to the final computed duration after all
+  other scaling is applied.
+ */
+private void doartic()
+{
+    if (isdigit(token[fieldx])) {
+        artic = (int) scanint();
+        if (token[fieldx])
+            fferror("Only digits were expected here");
+    } else fferror("No digits after /");
+}
+
+
+/* docall -- parse a call in the form !CALL fn(p1,p2,p3) */
+/**/
+private void docall()
+{
+    boolean error_flag = TRUE;
+    ndurp = FALSE;
+
+    linex += scan();
+
+    if (token[0] == 0) fferror("Function name expected");
+    else {
+        char symbol[100];
+        struct symb_descr *desc;
+        long value[SEQ_MAX_PARMS];
+        int i=0;
+
+        scansymb(symbol);
+        if (fieldx == 1) fferror("Routine name expected");
+        else if (token[fieldx] != '(') fferror("Open paren expected");
+        else {
+            desc = &HASHENTRY(lookup(symbol));
+            if (!desc->symb_type) {
+                fieldx = 0;
+                fferror("Function not defined");
+            } else if (desc->symb_type != fn_symb_type) {
+                fieldx = 0;
+                gprintf(TRANS, "desc->symb_type is %d\n", desc->symb_type);
+                fferror("This is not a function");
+            } else {
+                error_flag = FALSE;
+                fieldx++;       /* skip over paren */
+                for (i = 0; i < SEQ_MAX_PARMS; i++) value[i] = 0;
+                i = 0;
+                /* note that no params "()" is legal */
+                while (i < SEQ_MAX_PARMS && token[fieldx] != ')' && 
+                       parseparm(&value[i])) {
+                    i++;
+                    if (token[fieldx] == ',') {
+                        fieldx++;
+                    } else if (token[fieldx] != ')') {
+                        fferror("Unexpected character");
+                        error_flag = TRUE;
+                        break;
+                    }
+                }
+                fieldx++;
+                if (i > SEQ_MAX_PARMS) fferror("Too many parameters");
+            }
+            while (TRUE) {
+                linex += scan();
+                if (nullstring(token)) {
+                    break;
+                } 
+                switch (token[0]) {
+                  case 'T':
+                    fieldx = 1;
+                    dotime();
+                    break;
+                  case 'V':
+                    fieldx = 1;
+                    dovoice();
+                    break;
+                  case 'N':
+                    fieldx = 1;
+                    donextdur();
+                    break;
+                  default:
+                    fferror("Unexpected character");
+                }
+            }
+            if (!error_flag)
+                insert_call(the_score, seqround(thetime), lineno, voice, 
+                            desc->ptr.routine, value, i);
+            /* advance the time only if an N field was given */
+            if (ndurp) thetime += ntime;
+        }
+    }
+}
+
+
+/* doclock -- insert a clock command */
+/*
+ * derivation: if there is no previous clock running, then start the
+ *     clock on time.  Otherwise, start the clock half a tick early.
+ *     ticksize = (beattime / 24) = ((60sec/tempo)/24) =
+ *      ((60000ms/tempo)/24) = (60000/24)/tempo = 2500/tempo
+ */
+private void doclock()
+{
+    int oldticksize = ticksize;
+    ticksize = (2500L << 16) / tempo;
+    insert_clock(the_score, seqround(thetime) - (oldticksize >> 17),
+                 lineno, ticksize);
+}
+
+
+/****************************************************************************
+*               docomment
+* Effect: parses a comment (*) command
+****************************************************************************/
+
+private void docomment()
+{
+    line[linex] = '\n'; /* force end of line to skip comment line */
+    line[linex+1] = EOS;
+}
+
+/****************************************************************************
+*               doctrl
+* Inputs:
+*    n: control number
+* Effect: parses a control (K, M, O, X, or Y) command
+****************************************************************************/
+
+private void doctrl(n)
+int n;
+{
+    ctrlval[n] = (int) scanint();
+    if (token[fieldx]) {
+        fferror("Only digits expected here");
+    } else {
+        ctrlflag[n] = TRUE;
+        ctrlflag[0] = TRUE;    /* ctrlflag[0] set if any flag is set */
+    }
+}
+
+
+private void dodef()
+{
+    /* maximum def size is 256 + 9 parms * 2 + 2 = 276 */
+    unsigned char def[280];
+    char symbol[100];
+    int nparms = 0;
+    int nibcount = 0;
+    int data = 0;
+    register char c;
+
+    linex += scan();
+
+    if (!token[0]) fferror("Symbol expected");
+    else {
+        strcpy(symbol, token);
+        def[0] = def[1] = 0;
+        while (TRUE) {
+            linex += scan1(&line[linex]);
+            c = token[0];
+            if (!c) {
+                linex--;
+                if (nibcount & 1) {
+                    fferror("Expected pairs of hex digits: one missing");
+                    return;
+                }
+                break;
+            } else if (c == ' ' || c == '\t' || c == '\n') continue;
+            else if (isdigit(c)) {
+                data = (data << 4) + (c - '0');
+                nibcount++;
+                if (!(nibcount & 1)) {
+                    if (!def_append(def, nparms, data))
+                        return;
+                    data = 0;
+                }
+            } else if ('A' <= c && c <= 'F') {
+                data = (data << 4) + (c - 'A') + 10;
+                nibcount++; 
+                if (!(nibcount & 1)) {
+                    if (!def_append(def, nparms, data))
+                        return;
+                    data = 0;
+                }
+            } else if (c == 'V') {
+                data = data << 4;
+                nibcount++;
+                /* v without a leading nibble is equivalent to 0v: */
+                if (nibcount & 1) nibcount++;
+                if (!def_append(def, nparms, data))
+                    return;
+                def_parm(def, nparms++, nmacroparms+1);
+            } else if (c == '%') {
+                linex += scan1(&line[linex]);
+                c = token[0];
+                if (c < '1' || c > ('0' + nmacroparms)) {
+                    fferror(parm_expected_error);
+                    break;
+                }
+                if (!def_append(def, nparms, 0))
+                    return;
+                def_parm(def, nparms++, c - '0');               
+            } else if (c == '^') {
+                linex += scan1(&line[linex]);
+                c = token[0];
+                if (c < '1' || c > ('0' + nmacroparms)) {
+                    fferror(parm_expected_error);
+                    break;
+                }
+                if (!def_append(def, nparms, 0))
+                    return;
+                def_parm(def, nparms++, (c - '0') + nmacroparms + 1);
+            } else {  /* something unexpected here -- just exit */
+                linex--;
+                fferror("Unexpected data");
+                return;
+            }
+        }
+        insert_def(the_score, symbol, def,
+                   (nparms << 1) + def[(nparms << 1) + 1] + 2);
+    }
+}
+
+/****************************************************************************
+*               dodur
+* Effect: parses a duration (sum of dosymdur and/or doabsdur)
+* sets symbolic_dur_flag (according to the first addend in mixed arithmetic)
+*
+* Returns: duration in "precise" units
+****************************************************************************/
+private time_type dodur()
+{
+    time_type result = 0L;
+    symbolic_dur_flag = TRUE;
+
+    if (token[fieldx-1] == 'U') {
+        result = doabsdur();
+        symbolic_dur_flag = FALSE;
+    } else result = dosymdur();
+    while (token[fieldx] == '+') {
+        fieldx += 2;
+        if (token[fieldx-1] == 'U') result += doabsdur();
+        else result += dosymdur();
+    }
+    return scale(result, 100L, rate);
+}
+
+/****************************************************************************
+*               doerror
+* Effect: parse an unrecognized field by reporting an error
+****************************************************************************/
+
+private void doerror()
+{
+    fieldx = 0;
+    fferror("Bad field");
+}
+
+/****************************************************************************
+*               doloud
+* Effect: parse a loudness (L) command
+****************************************************************************/
+
+private int doloud()
+{
+    int i, j;
+    int result;
+    int oldfieldx = fieldx;
+    int newfieldx;
+    char symbol[100];
+
+    if (!token[fieldx] || token[fieldx]==')' || token[fieldx]==',') {
+        fferror("L must be followed by loudness indication");
+        return 100;
+    }
+    if (isdigit(token[fieldx])) {
+        result = (int) scanint();
+        newfieldx = fieldx;
+        if (token[fieldx] && token[fieldx]!=')' && token[fieldx]!=',')
+            fferror("Digits expected after L");
+        else if (result > 127) {
+            fieldx = oldfieldx;
+            fferror("Maximum loudness of 127 will be used");
+            fieldx = newfieldx;
+            result = 127;
+        } else if (result == 0) {
+            fieldx = oldfieldx;
+            fferror("Minimum loudness of 1 will be used");
+            fieldx = newfieldx;
+            result = 1;
+        }
+        return result;
+    }
+    scansymb(symbol);
+    newfieldx = fieldx;
+    if ((i = strlen(symbol)) > 3 ) {    /* maximum is 3, e.g. "ppp" */
+        fieldx = oldfieldx;
+        fferror("Loudness field too long");
+        fieldx = newfieldx;
+        return 100;
+    }
+    symbol[i + 1] = '\0';   /* pad short symbols with 0    */
+                            /* e.g. "p\0" -> "p\0\0"    */
+    for (i = 0; i <= 7; i++) {    /* loop through possibilities    */
+        for (j = 0; j <= 2; j++) {    /* test 3 characters    */
+            if (symbol[j] != loudtable[i].symbol[j])
+                break;
+        }
+        if (j == 3) {
+            return loudtable[i].value;
+        }
+    }
+    fieldx = oldfieldx;
+    fferror("Bad loudness indication");
+    fieldx = newfieldx;
+    return 100;
+}
+
+
+void domacro()
+{
+    int control_num;
+    int value;
+    if (isdigit(token[1])) {
+        control_num = (int) scanint();
+        if (token[fieldx] == '(') {
+            fieldx++;
+            if (!isdigit(token[fieldx])) {
+                fferror("Control value expected");
+            } else {
+                value = (int) scanint();
+                if (token[fieldx] != ')') {
+                    fferror("Missing close paren");
+                } else {
+                    fieldx++;
+                    if (token[fieldx])
+                        fferror("Nothing expected after paren");
+                    else if (macctrlx < nmacroctrl - 1) {
+                        macctrlnum[macctrlx] = control_num;
+                        macctrlparmx[macctrlx] = value;
+                        macctrldef[macctrlx] = NULL;
+                        macctrlx++;
+                    } else fferror("Too many controls");
+                }
+            }
+        } else fferror("Missing paren");
+    } else {
+        def_type def;
+        char symbol[100];
+        scansymb(symbol);
+        if (fieldx == 1) fferror("Macro name expected");
+        else if (token[fieldx] != '(') fferror("Open paren expected");
+        else {
+            fieldx++;
+            def = def_lookup(symbol);
+            if (!def) {
+                fieldx = 1;
+                fferror("Undefined macro");
+            } else {
+                long val;
+                macctrlnum[macctrlx] = 0;
+                macctrlparmx[macctrlx] = macctrlnextparm;
+                macctrldef[macctrlx] = def;
+                while (token[fieldx] != ')' && parseparm(&val)) {
+                    macctrlparms[macctrlnextparm++] = (short) val;
+                    macctrlnum[macctrlx]++;
+                    if (token[fieldx] == ',') {
+                        fieldx++;
+                    } else if (token[fieldx] != ')') {
+                        fferror("Unexpected character");
+                        break;
+                    }
+                }
+                fieldx++;
+                macctrlx++;
+            }
+        }
+    }
+}
+
+
+/****************************************************************************
+*               donextdur
+* Effect: parse a next (N) command
+* Implementation:
+*    The syntax is N followed by a duration, so save dur and use dosymdur()
+*    to parse the duration field.
+*    The form N<digits> is parsed directly with scanint().
+****************************************************************************/
+
+private void donextdur()
+{
+    ndurp = TRUE;    /* flag that N was given */
+    if (isdigit(token[fieldx])) {
+        ntime = precise(scanint());
+        ntime = scale(ntime, (ulong)time_scale, rate);
+        if (token[fieldx])
+            fferror("Only digits were expected here");
+    } else {
+        fieldx++;
+        ntime = dodur();
+    }
+}
+
+/****************************************************************************
+*               dopitch
+* Effect: parses a pitch command
+****************************************************************************/
+
+private int dopitch()
+{
+    int p, octave=0;
+    int octflag = FALSE;    /* set if octave is specified */
+    int oldfieldx = fieldx;
+
+    p = pitchtable[token[fieldx-1]-'A'];
+    while (TRUE) {
+        if (token[fieldx] == 'S') {                /* sharp */
+            p++;
+            fieldx++;
+        } 
+        else if (token[fieldx] == 'N') {            /* skip */
+            fieldx++;
+        } 
+        else if (token[fieldx] == 'F') {            /* flat */
+            p--;
+            fieldx++;
+        } 
+        else if (isdigit(token[fieldx]) && !octflag) {      /* octave */
+            octave = (int) scanint();
+            octflag = TRUE;
+        } 
+        else break;                /* none of the above */
+    }
+    if (octflag) p = (p-48) + 12 * octave;  /* adjust p to given octave */
+    else {        /* adjust p to note nearest the default pitch */
+        int octdiff = (p + 126 - pitch) / 12;
+        p = p + 120 - (octdiff * 12);
+    }
+    if (p > maxpitch) {              /* pitch in range? */
+        int newfield = fieldx;
+        fieldx = oldfieldx;
+        fferror("Pitch too high");
+        fieldx = newfield;
+        p = maxpitch;
+    }
+    /* We really should test for end-of-field, but we don't know if we're
+       in a parameter list, so comma may or may not be legal */
+    return p;
+}
+
+/****************************************************************************
+*               doprogram
+* Effect: parses a program change (Z) command
+****************************************************************************/
+
+private void doprogram()
+{
+    register int program = (int) scanint();
+    ctrlflag[PROGRAM_CTRL] = ctrlflag[0] = TRUE;
+    if (token[fieldx]) {
+        fferror("Z must be followed by digits only");
+    } else if (program < minprogram) {
+        fieldx = 1;
+        fferror("Minimum program of 1 will be used");
+        program = minprogram;
+    } else if (program > maxprogram) {
+        fieldx = 1;
+        fferror("Maximum program of 128 will be used");
+        program = maxprogram;
+    }
+    ctrlval[PROGRAM_CTRL] = program - 1;
+}
+
+
+private void doramp()
+{
+    int values[2];
+    time_type stepsize = 100L;  /* default 10 per second */
+    int index = 0;
+    ndurp = FALSE;
+    values[0] = values[1] = 0;
+    while (TRUE) {
+        linex += scan();
+        fieldx = 1;
+        if (nullstring(token)) {
+            break;
+        } else if (index == 2) { /* must be stepsize in dur syntax */
+            stepsize = dodur();
+        } else {
+            int ctrlx = 0;
+            static int ctrl_map[] = { -BEND_CTRL, VOLUME, -TOUCH_CTRL, MODWHEEL };
+
+            switch (token[0]) {
+              case 'M': ctrlx++;        /* modwheel */
+              case 'O': ctrlx++;        /* aftertouch */
+              case 'X': ctrlx++;        /* volume */
+              case 'Y':                 /* pitch bend */
+
+                if (index < 2) {
+                    macctrlnum[index] = ctrl_map[ctrlx];
+                    macctrlparmx[index] = (int) scanint();
+                    if (token[fieldx])
+                        fferror("Only digits expected here");
+                    macctrldef[index] = NULL;
+                } else fferror("Unexpected control");
+                break;
+              case '~':
+                if (index < 2) {
+                    domacro();
+                    if (token[fieldx]) fferror("Unexpected character");
+                } else fferror("Unexpected control");
+                break;
+              case 'T':
+                if (index < 2) fferror("Control expected");
+                dotime();
+                break;
+              case 'V':
+                if (index < 2) fferror("Control expected");
+                dovoice();
+                break;
+              case 'N':
+                if (index < 2) fferror("Control expected");
+                donextdur();
+                break;
+              default:
+                if (index < 2) fferror("Control expected");
+                dur = dodur();
+                break;
+            }
+            if (index == 1 && (macctrlnum[0] != macctrlnum[1] ||
+                               macctrldef[0] != macctrldef[1])) {
+                fferror("Controls do not match");
+            }
+        }
+        index++;
+    }
+    if (index < 3) fferror("Expected 2 controls and step size");
+    else {
+        if (macctrldef[0]) {
+            int i, j, n;
+            n = 0;
+            i = macctrlparmx[0];
+            j = macctrlparmx[1];
+            while (n < macctrlnum[0]) {
+                if (macctrlparms[i] != macctrlparms[j]) break;
+                n++; i++; j++;
+            }
+            if (n >= macctrlnum[0]) n = 0;
+            /* Note: duration shortened to prevent overlap with next ramp */
+            insert_deframp(the_score, seqround(thetime), lineno, voice,
+                seqround(stepsize), trunc(dur) - 1, macctrldef[0], macctrlnum[0],
+                macctrlparms + macctrlparmx[0], n, macctrlparms[j]);
+        } else {
+            /* Note: duration shortened to prevent overlap with next ramp */
+            insert_ctrlramp(the_score, seqround(thetime), lineno, voice,
+                seqround(stepsize), trunc(dur) - 1,
+                macctrlnum[0], macctrlparmx[0], macctrlparmx[1]);
+        }
+    }
+    /* advance the time only if an N field was given */
+    if (ndurp) thetime += ntime;
+    else thetime += dur;
+}
+
+
+/****************************************************************************
+*               dorate
+* Effect: parses a !rate command
+****************************************************************************/
+
+private void dorate()
+{
+    linex += scan();
+    if (!token[0])
+        fferror("rate number expected");
+    else {
+        long oldrate = rate;
+        rate = (int) scanint();
+        if (token[fieldx])
+            fferror("Only digits expected here");
+        if (rate == 0) {
+            fieldx = 0;
+            fferror("Rate 100 will be used here");
+            rate = 100L;
+        }
+        start = thetime;
+        /* adjust dur in case it is inherited by next note */
+        dur = (dur * oldrate);
+        dur = dur / rate;
+    }
+}
+
+
+private void doset(vec_flag)
+  boolean vec_flag;
+{
+    ndurp = FALSE;
+    linex += scan();
+    if (!token[0]) fferror("Variable name expected");
+    else {
+        struct symb_descr *desc = &HASHENTRY(lookup(token));
+        if (!desc->symb_type) fferror("Called function not defined");
+        else if (vec_flag && (desc->symb_type != vec_symb_type)) {
+                fferror("This is not an array");
+        } else if (!vec_flag && (desc->symb_type != var_symb_type)) {
+                fferror("This is not a variable");
+        } else {
+            int numargs = 1 + vec_flag;
+            int value[2];
+            int i;
+            int *address = desc->ptr.intptr;
+            value[0] = value[1] = 0;
+            i = 0;
+            while (TRUE) {
+                linex += scan();
+                if (nullstring(token)) {
+                    break;
+                } else if (isdigit(token[0]) || token[0] == '-' ||
+                           token[0] == '+') {
+                    if (i < numargs) {
+                        value[i++] = (int) scansgnint();
+                        if (token[fieldx])
+                            fferror("Only digits expected here");
+                    } else fferror(too_many_error);
+                } else {
+                    switch (token[0]) {
+                      case 'T':
+                        fieldx = 1;
+                        dotime();
+                        break;
+                      case 'V':
+                        fieldx = 1;
+                        dovoice();
+                        break;
+                      case 'N':
+                        fieldx = 1;
+                        donextdur();
+                        break;
+                      default:
+                        fieldx++;
+                        if (i < numargs) {
+                            value[i++] = seqround(dodur());
+                        } else fferror(too_many_error);
+                        break;
+                    }
+                }
+            }
+            if (vec_flag && i != 2) fferror("No index given");
+            if (vec_flag) {
+                if (value[0] >= desc->size) {
+                    fferror("Subscript out of bounds");
+                    return;
+                }
+                /* reduce to the seti case: */
+                address += value[0];    /* compute the vector address */
+                value[0] = value[1];    /* set up value[] and i as if */
+                i--;                    /* this were seti, not setv */
+            }
+            if (i != 1) fferror("No value given");
+            insert_seti(the_score, seqround(thetime), lineno, voice,
+                        address, value[0]);
+            /* advance the time only if an N field was given */
+            if (ndurp) thetime += ntime;
+        }
+    }
+}
+
+/****************************************************************************
+*               dospecial
+* Effect: parses special (those starting with "!") commands
+****************************************************************************/
+
+private void dospecial()
+{
+    switch (issymbol()) {
+      case sym_tempo: 
+        dotempo();
+        break;
+      case sym_rate: 
+        dorate();
+        break;
+      case sym_csec:
+        /* adjust dur for inheritance by next note */
+        dur = (dur * 1000L) / time_scale;
+        time_scale = 1000L;
+        break;
+      case sym_msec:
+        dur = (dur * 100L) / time_scale;
+        time_scale = 100L;
+        break;
+      case sym_seti:
+        doset(FALSE);
+        break;
+      case sym_setv:
+        doset(TRUE);
+        break;
+      case sym_call:
+        docall();
+        break;
+      case sym_ramp:
+        doramp();
+        break;
+      case sym_clock:
+        doclock();
+        break;
+      case sym_def:
+        dodef();
+        break;
+      case sym_end:
+        end_flag = TRUE;
+        break;
+      default: 
+        fferror("Special command expected");
+    }
+    parseend(); /* flush the rest of the line */
+}
+
+/****************************************************************************
+*               dosymdur
+* Effect: parses a duration (^, %, S, I, Q, H, or W) command
+****************************************************************************/
+
+private time_type dosymdur()
+{
+    int i, dotcnt = 0;
+    long dotfactor;
+    time_type result = 0;
+
+    for (i = 0; i < durtable_len; i++) {
+        if (durtable[i].symbol == token[fieldx-1]) {
+            /* the shift right is because durs are stored doubled because
+             *  otherwise a 64th note would have the value 75/2:  */
+            result = precise(durtable[i].value) >> 1;
+            break;
+        }
+    }
+    if (i == durtable_len) {
+        fieldx--;
+        fferror("Duration expected: one of W, H, Q, I, S, %, or ^");
+        return 0L;
+    }
+    while (token[fieldx]) {
+        if (token[fieldx] == 'T') {     /* triplet notation */
+            result = (result * 2) / 3;  /* lose a bit but avoid scale() */
+            fieldx++;
+        } 
+        else if (token[fieldx] == '.') {    /* dotted notation */
+            dotcnt++;
+            fieldx++;
+        } 
+        else if (token[fieldx] == '/') {
+            long divisor;
+            fieldx++;
+            divisor = scanint();
+            if (divisor > 0) result = result / divisor;
+            else fferror("non-zero integer expected");
+        }
+        else if (isdigit(token[fieldx])) {    /* numbers are multipliers */
+            result = result * scanint();
+        } 
+        else break;
+    }
+    dotfactor = 1L;
+    for (i=1; i<=dotcnt; i++)
+        dotfactor = dotfactor * 2;
+    result = (2 * result) - (result / dotfactor);
+
+    return scale(result, 100L, tempo);    /* time in milliseconds */
+}
+
+/****************************************************************************
+*               dotempo
+* Effect: parses a !tempo command
+****************************************************************************/
+
+private void dotempo()
+{
+    linex += scan();
+    if (!token[0])
+        fferror("Tempo number expected");
+    else {
+        long oldtempo = tempo;
+        tempo = scanint();
+        if (token[fieldx])
+            fferror("Only digits expected here");
+        if (tempo == 0) {
+            fieldx = 0;
+            fferror("Tempo 100 will be used here");
+            tempo = 100L;
+        }
+        start = thetime;
+        /* adjust dur in case it is inherited by next note */
+        if (symbolic_dur_flag) {
+            dur = (dur * oldtempo);
+            dur = dur / tempo;
+        }
+    }
+}
+
+/****************************************************************************
+*               dotime
+* Effect: parses a time (T) command
+* Implementation: see implementation of donextdur()
+****************************************************************************/
+
+private void dotime()
+{
+    if (isdigit(token[fieldx])) {
+        thetime = precise(scanint());
+        thetime = scale(thetime, (ulong)time_scale, rate);
+        if (token[fieldx] )
+            fferror("Only digits were expected here");
+    } else {
+        fieldx++;
+        thetime = dodur(); 
+    }
+    thetime += start;    /* time is relative to start */
+}
+
+/****************************************************************************
+*               dovoice
+* Effect: parse a voice (V) command (the voice is the MIDI channel)
+****************************************************************************/
+
+private void dovoice()
+{
+    if (isdigit(token[fieldx])) {
+        voice = (int) scanint();
+        if (token[fieldx])
+            fferror("V must be followed by digits only");
+        if (voice > MAX_CHANNELS) {
+                char msg[40];
+                sprintf(msg, "number too high, using %d instead", MAX_CHANNELS);
+            fferror(msg);
+            voice = MAX_CHANNELS;
+        } 
+        else if (voice < 1) {
+            fferror("number too low, using 1 instead");
+            voice = 1;
+        }
+    } 
+    else fferror("No digit after V");
+}
+
+/****************************************************************************
+*               fferror
+* Inputs:
+*    char *s: an error message string
+* Effect:
+*    prints the line with the error
+*    puts a cursor (^) at the error location
+*    prints the error message (s)
+* Implementation:
+*    this routine prints a carat under the character that
+*    was copied into token[fieldx].    E.g. if fieldx = 0, the
+*    carat will point to the first character in the field.
+****************************************************************************/
+
+private void fferror(s)
+  char *s;
+{
+    gprintf(ERROR, "%3d | %s", lineno, line);
+    marker(linex-strlen(token)+fieldx+1+6);
+    gprintf(ERROR, "Error: %s.\n", s);
+}
+
+/****************************************************************************
+*               init
+* Effect:
+*    initializes the state variables
+****************************************************************************/
+
+private void init()
+{
+    int i;
+
+    end_flag = FALSE;
+
+    /* initial (default) values for all state variables */
+    symbolic_dur_flag = TRUE; /* default dur is symbolic */
+    for (i = 0; i < nctrl; i++) {
+        /* no initial control changes */
+        ctrlflag[i] = FALSE;
+        ctrlval[i] = 0;
+    }
+
+    lineno = 0;
+    pitch = seq_dflt_pitch;
+    loud = seq_dflt_loud;
+    voice = seq_dflt_voice;
+    time_scale = 1000L;
+    tempo = 100L;
+    rate = 100L;
+    dur = precise(600); /* default dur is quarter note */
+    thetime = precise(0);
+    start = thetime;
+    ntime = 0L;
+    ticksize = 0L;
+    artic = 100;
+}
+
+/****************************************************************************
+*               ins_a_note
+* Returns:
+*    boolean: TRUE on success, FALSE if not enough memory
+* Effect:
+*    note events (if any) corresponding to the current line are inserted
+* Implementation:
+*    if a note on should occur after a note off and doesn't, and the
+*    two notes have the same pitch, then the note off can cancel the
+*    note on.  to make it unlikely that roundoff will cause this situation,
+*    dur is decreased by one half of a clock tick before rounding.
+*    also, phase2 gives precedence to note-offs that are simultaneous
+*    with note-ons.
+****************************************************************************/
+
+private boolean ins_a_note()
+{
+    long the_dur = (trunc(dur) * artic + 50) / 100;
+    int the_pitch = pitch;
+    event_type note;
+    if (rest_flag) the_pitch = NO_PITCH;
+    note = insert_note(the_score, seqround(thetime), lineno, voice,
+                       the_pitch, the_dur, loud);
+    if (!note) return FALSE;
+    return TRUE;    /* success! */
+}
+
+/****************************************************************************
+*               ins_ctrls
+* Returns:
+*    boolean: TRUE on success, FALSE if not enough memory
+* Effect:
+*    control events corresponding to current line are inserted in score
+* Implementation:
+*    ctrlflag[i] is TRUE if control i was specified in this line, so
+*    insert one control change for each ctrlflag[i] that is TRUE
+****************************************************************************/
+
+private boolean ins_ctrls()
+{
+    int i;
+    event_type ctrl;
+
+    for (i = 1; i < nctrl; i++) {
+        if (ctrlflag[i]) {
+            ctrl = insert_ctrl(the_score, seqround(thetime), lineno, i, voice,
+                               ctrlval[i]);
+            if (!ctrl) return FALSE;
+            ctrlflag[i] = FALSE;
+            ctrlval[i] = 0;
+        }
+    }
+    return TRUE;    /* success! */
+}
+
+/****************************************************************************
+*               issymbol
+* Outputs: returns symbol number, or -1 if no match
+* Assumes: token[1] has the symbol to look up (token[0] == '!')
+****************************************************************************/
+
+private int issymbol()
+{
+    int i, symb_num;
+    char *sym;
+
+    for (symb_num = 0; symb_num < sym_n; symb_num++) {
+        sym = ssymbols[symb_num];
+        i = 1;
+        while (TRUE) {
+            if (token[i] != *sym) break;
+            if (*sym == 0) return symb_num;
+            sym++; 
+            i++;
+        }
+    }
+    return -1;
+}
+
+/****************************************************************************
+*               marker
+* Inputs:
+*    int count: the number of characters to indent
+* Effect: 
+*    prints a carat (^) at the position specified on file stderr
+****************************************************************************/
+
+private void marker(count)
+int count;
+{
+    int i;
+    char s[128];
+    for (i=0; i<(count-1); s[i++]=' ') /* */ ;
+    s[count-1] = '^';
+    s[count] = '\0';
+    gprintf(ERROR,"%s\n",s);
+}
+
+/*****************************************************************
+*           parseend
+* Effect:
+*    parse the note terminator, either ",", ";", EOS or "\n"
+*
+****************************************************************/
+
+private void parseend()
+{
+    boolean done = FALSE;
+    while (!done) {
+        linex += scan1(&line[linex]);
+        switch (token[0]) {
+        case ',':
+            ndurp = TRUE;    /* switch that next time was specified */
+            ntime = 0L;
+            done = TRUE;
+            break;
+        case ';':
+        case '\n':
+        case EOS:
+            done = TRUE;
+            break;
+        case ' ':
+        case '\t':
+            break;      /* skip over blanks and scan1 again */
+        default:
+            fferror("Unexpected token");
+            linex += scan();  /* flush the token */
+            break;
+        }
+    }
+}
+
+/****************************************************************************
+*               parsefield
+* Effect: looks at first character of token and calls a parsing routine
+*
+****************************************************************************/
+
+private void parsefield()
+{
+    fieldx = 1;
+    switch (token[0]) {
+    case 'T' : 
+        dotime(); 
+        break;
+    case 'U':
+    case 'W': 
+    case 'H':
+    case 'Q':
+    case 'S':
+    case 'I': 
+    case '%':
+    case '^':
+        dur = dodur(); 
+        break;
+    case 'R': 
+        do_a_rest(); 
+        break;
+    case 'A':
+    case 'B':
+    case 'C':
+    case 'D':
+    case 'E':
+    case 'F':
+    case 'G': 
+        pitch = dopitch(); 
+        pitch_flag = TRUE;
+        break;
+    case 'P': 
+        pitch = doabspitch(); 
+        pitch_flag = TRUE;
+        break;
+    case 'L': 
+        loud = doloud(); 
+        break;
+    case 'N': 
+        donextdur(); 
+        break;
+/*    case 'J': 
+ *      doctrl(1);
+ *      break;
+ */
+    case 'K': 
+        doctrl(PSWITCH_CTRL);
+        break;
+    case 'M': 
+        doctrl(MODWHEEL_CTRL);
+        break;
+    case 'O': 
+        doctrl(TOUCH_CTRL);
+        break;
+    case 'X': 
+        doctrl(VOLUME_CTRL);
+        break;
+    case 'Y': 
+        doctrl(BEND_CTRL);
+        break;
+    case 'Z':
+        doprogram();
+        break;
+    case 'V': 
+        dovoice();
+        break;
+    case '~':
+        domacro();
+        break;
+    case '*':
+        docomment();
+        break;
+    case '#':
+        doartic();
+        break;
+    default : 
+        doerror();
+        break;
+    }
+}
+
+/****************************************************************************
+*               parsenote
+* Effect: 
+*    parses a note line -- control events (if any) and note event (if
+*    present) are inserted into score
+* Assumes:
+*    line contains a string to be parsed
+****************************************************************************/
+
+private boolean parsenote()
+{
+    boolean out_of_memory = FALSE;
+    int i;
+
+    ndurp = FALSE;
+    rest_flag = FALSE;
+
+    /* this loop reads tokens for a note */
+    while (token[0]) {
+        parsefield();
+        linex += scan();
+    }
+
+    parseend(); /* take care of note terminator */
+
+    /*
+     * insert ctrl's first so that will come before the note.
+     */
+    if (ctrlflag[0]) {
+        out_of_memory |= !ins_ctrls();
+        /* don't reset ctrlflag[0], it's used below */
+    }
+
+    /*
+     * insert macro's
+     */
+    for (i = 0; i < macctrlx; i++) {
+        event_type ctrl;
+        if (macctrldef[i] == NULL) {
+            ctrl = insert_macctrl(the_score, seqround(thetime), lineno,
+                                  macctrlnum[i], voice, macctrlparmx[i]);
+        } else {
+            ctrl = insert_macro(the_score, seqround(thetime), lineno,
+                        macctrldef[i], voice, macctrlnum[i],
+                        &(macctrlparms[macctrlparmx[i]]));
+        }
+        out_of_memory |= (ctrl == NULL);
+    }
+
+    /* insert a note if
+         *    (1) a pitch was specified OR
+         *    (2) no control was specified and this is not a rest 
+         *      (it's a pitch by default)
+         *
+         * NOTE: program changes during rests are advised since
+         *    synthesizers may not be able to process a program
+         *    change followed immediately by a note-on.  In fact, this
+         *    is why we insert notes whose pitch is NO_PITCH -- so that
+         *    the program change can be processed during the rest.
+         */
+    if (pitch_flag ||
+        (!ctrlflag[0] && !rest_flag && (macctrlx == 0))) {
+        out_of_memory |= !ins_a_note();
+    }
+
+    if (ndurp) thetime += ntime;
+    else thetime += dur;
+
+    return out_of_memory;
+}
+
+
+private boolean parseparm(valptr)
+  long *valptr;
+{
+    register char c = token[fieldx];
+    if (isdigit(c) || c == '-') {
+        *valptr = scansgnint();
+        return TRUE;
+    } else {
+        switch (c) {
+          case 'P':
+            fieldx++;
+            *valptr = doabspitch();
+             return TRUE;
+          case 'A':
+          case 'B':
+          case 'C':
+          case 'D':
+          case 'E':
+          case 'F':
+          case 'G':
+            fieldx++;
+            *valptr = dopitch();
+            return TRUE;
+          case 'U':
+          case 'W':
+          case 'H':
+          case 'Q':
+          case 'I':
+          case 'S':
+          case '%':
+          case '^':
+            fieldx++;
+            *valptr = seqround(dodur());
+            return TRUE;
+          case 'L':
+            fieldx++;
+            *valptr = doloud();
+            return TRUE;
+          case '\'':
+            fieldx++;
+            *valptr = token[fieldx];
+            fieldx++;
+            if (token[fieldx] != '\'') {
+                fferror("single quote expected");
+            }
+            fieldx++;
+            return TRUE;
+          default:
+            fferror("Parameter expected");
+            return FALSE;
+        }
+    }
+}
+
+
+
+/****************************************************************************
+*               scale
+* Inputs:
+*    time_type x
+*    int (ulong?) n, d
+* Outputs:
+*    returns time_type: result of scaling x by n/d
+****************************************************************************/
+
+public time_type scale(x, n, d)
+  ulong x;
+  ulong n, d;
+{
+    ulong lo = (x & 0xFFFFL) * n;
+    ulong hi = (x >> 16) * n;
+    ulong res = hi / d;
+    lo = (((hi - (res * d)) << 16) + lo + (d >> 1)) / d;
+    return (time_type)( (res << 16) + lo );
+}
+
+/****************************************************************************
+*               scan
+* Inputs:
+*    char *start: the string to scan
+* Outputs:
+*    returns int: the index of the next char in start to scan
+* Effect: 
+*    skips over leading blanks
+*    copies characters from start into token, converting to upper case
+*    scanning stops on delimiter: one of space, tab, newline, semicolon
+****************************************************************************/
+
+private int scan()
+{
+    char *start = line + linex;
+    register char c;
+    register int i = 0;
+    register int j = 0;
+    register int parens = 0;
+
+    while (((c = start[i]) == ' ') || (c == '\t')) i++;
+
+    while ((c = start[i]) != ' ' && c != '\n' && c != '\t' && c != EOS &&
+           (c != ',' || token[0] == '~' || parens > 0) && c != ';') {
+
+        if (islower(start[i])) token[j] = toupper(start[i]);
+        else token[j] = start[i];
+        if (c == '(') parens++;
+        else if (c == ')') parens--;
+        j++; 
+        i++;
+    }
+    token[j] = '\0';
+
+    fieldx = 0;
+    if (parens) fferror("Unbalanced parens");
+
+    return i;
+}
+
+/****************************************************************************
+*               scan1
+* Inputs:
+*    char *start: the string to scan
+* Outputs:
+*    returns int: the index of the next char in start to scan
+* Effect: 
+*    copies one char from start into token, converting to upper case
+****************************************************************************/
+
+private int scan1(start)
+char *start;
+{
+    int i = 0;
+
+    token[0] = *start;
+    if (islower(token[0])) token[0] = toupper(token[0]);
+
+    if (!nullstring(token)) {
+        token[1] = '\0';
+        i = 1;
+    }
+    fieldx = 0;
+    return i;
+}
+
+/****************************************************************************
+*               scanint
+* Outputs:
+*    returns long: the scanned integer
+* Effect:
+*    scans an unsigned long from token, starting at fieldx
+*    fieldx is incremented to end of the integer
+****************************************************************************/
+
+private long scanint()
+{
+    long i = 0;
+    char c;
+    while ((c = token[fieldx])) {
+        if (isdigit(c)) {
+            i = (i*10) + (c - '0');
+            fieldx++;
+        } else return i;
+    }
+    return i;
+}
+
+private long scansgnint()
+{
+    if (token[fieldx] == '-') {
+        fieldx++;
+        return -scanint();
+    } else {
+        if (token[fieldx] == '+') {
+            fieldx++;
+        }
+        return scanint();
+    }
+}
+
+
+/* scansymb -- scan a symbol from the token */
+/**/
+private void scansymb(str)
+  char *str;
+{
+    char c;
+    while ((c = token[fieldx])) {
+        if (isdigit(c) || isalpha(c) || c == '_') {
+            *str++ = c;
+            fieldx++;
+        } else break;
+    }
+    *str = EOS;
+}
+
+/****************************************************************************
+*               seq_read
+* Inputs:
+*    seq_type seq: the sequence to receive the score
+*    FILE *fp: input file
+* Outputs:
+*    none
+* Effect: 
+*    parses score from input file and builds score data structure
+****************************************************************************/
+
+void seq_read(seq, fp)
+  seq_type seq;
+  FILE *fp;
+{
+    boolean out_of_memory = FALSE;    /* set when no more memory */
+    /* printf("seq_read: chunklist is 0x%x\n", seq->chunklist); */
+    the_score = seq;  /* current sequence is a global within this module */
+    if (!seq) return;
+    init();
+    lineno = 0;
+        
+    /* make sure line is well terminated or scan might run off the end */
+    line[linesize - 1] = EOS;
+    line[linesize - 2] = '\n';
+
+    /* this loop reads lines */
+    while ((fgets(line, linesize - 2, fp) != NULL) && !out_of_memory &&
+           !check_aborted() && !end_flag) {
+        lineno++;
+        linex = 0;
+        /* this loop reads notes from a line */
+        while ((line[linex] != EOS) && !out_of_memory) {
+            /* loop invariant: line[linex] is first char of next note */
+            ctrlflag[0] = FALSE;  /* other ctrlflags are reset by ins_ctrls() */
+            macctrlx = 0;
+            macctrlnextparm = 0;
+            pitch_flag = FALSE;
+            linex += scan();
+            if (!nullstring(token)) {
+                if (token[0] == '*') docomment();
+                else if (token[0] == '!') dospecial();
+                else out_of_memory = parsenote();
+            } 
+            else parseend();
+        }
+    }
+
+    if (out_of_memory) {
+        gprintf(ERROR, "Out of note memory at line %d,\n", lineno-1);
+        gprintf(ERROR, "    the rest of your file will be ignored.\n");
+    }
+
+    if (check_aborted()) {
+        gprintf(ERROR, "User aborted score input,\n");
+        gprintf(ERROR, "    the rest of your file will be ignored.\n");
+        if (abort_flag == BREAK_LEVEL) abort_flag = 0;
+    }
+
+    /* fclose(fp); -- don't close the file; if you do, Nyquist's garbage
+       collector will close Nyquist's copy, and closing the file twice
+       in Linux will crash Nyquist */
+
+    gprintf(TRANS, "\nLoaded Adagio file with %ld note(s), %ld ctrl(s).\n\n",
+            seq_notecount(the_score), seq_ctrlcount(the_score));
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/seqread.h b/lib-src/libnyquist/nyquist/cmt/seqread.h
new file mode 100644
index 0000000..1348574
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqread.h
@@ -0,0 +1,7 @@
+/* seqread.h -- header file for users of seqread.c */
+/* Copyright 1989 Carnegie Mellon University */
+
+#define name_length 255
+void seq_read(seq_type seq, FILE *fp); /* LISP: (SEQ-READ SEQ FILE) */
+time_type scale(ulong, ulong, ulong);    /*now public for smf_write, smf_read*/
+
diff --git a/lib-src/libnyquist/nyquist/cmt/seqwrite.c b/lib-src/libnyquist/nyquist/cmt/seqwrite.c
new file mode 100644
index 0000000..fde0746
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqwrite.c
@@ -0,0 +1,282 @@
+/* seqwrite -- write a seq in Adagio format to a file */
+/***************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+--------------------------------------------------------------
+* 11-Mar-94 | Created Change Log
+* 11-Mar-94 | PLu : Added private to function defs.
+* 28-Apr-03 |  DM : changed for portability, true->TRUE, false->FALSE
+****************************************************************************/
+
+#include "switches.h"
+
+#include <stdio.h>
+
+#include "cext.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "seq.h"
+#include "seqwrite.h"
+#include "userio.h"
+#include "record.h"
+
+private boolean next_event_time();
+private void write_event();
+private void write_velocity(FILE *f, int velocity);
+private void write_voice();
+private void write_rest(FILE *f, event_type ev, boolean abs_flag);
+private void write_time();
+
+private boolean clock_started;
+private long clock_half_tick;
+private int new_tempo;
+/* non-zero indicates a pending tempo change... */
+private time_type tempo_change_at;
+
+private int macro_count;
+private int call_count;
+private int deframp_count;
+private int seti_count;
+
+private int last_velocity;
+private int last_voice = seq_dflt_voice;
+
+
+/* next_event_time -- get the time of the next event */
+/*
+ * NOTE: clock events are ignored (unless this is the first clock event)
+ */
+private boolean next_event_time(event, next_time)
+  event_type event;
+  time_type *next_time;
+{
+    while (event) {
+        if (vc_ctrl(event->nvoice) == ESC_CTRL &&
+            event->value == CLOCK_VALUE && 
+            clock_started) {
+            /* this is a clock event, ignore it: */
+            event = event->next;
+        } else {
+            *next_time = event->ntime;
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+
+/* seq_write -- write a seq to a file */
+/*
+ * NOTE: if abs_flag, then write using absolute times ('T'), otherwise use
+ *  relative timing ('N').  Also, only selected channels are written.
+ */
+void seq_write(seq_type seq, FILE *f, boolean abs_flag)
+{
+    event_type ev = seq_events(seq);
+
+    last_velocity = seq_dflt_loud;
+    last_voice = seq_dflt_voice;
+
+    fprintf(f, "!MSEC\n");
+    clock_started = FALSE;
+    tempo_change_at = 0;
+
+    macro_count = 0;
+    call_count = 0;
+    deframp_count = 0;
+    seti_count = 0;
+
+    while (ev) {
+        write_event(seq, ev, f, abs_flag);
+        ev = ev->next;
+    }
+    if (macro_count) gprintf(TRANS, "%d macros ignored.\n", macro_count);
+    if (call_count) gprintf(TRANS, "%d calls ignored.\n", call_count);
+    if (deframp_count) gprintf(TRANS, "%d deframps ignored.\n", deframp_count);
+    if (seti_count) gprintf(TRANS, "%d setis ignored.\n", seti_count);
+}
+
+
+private char ctrl_letter[] = "?KMOXYZ";
+
+/* write_event -- write a single event to a file */
+/**/
+private void write_event(seq, event, f, abs_flag)
+  seq_type seq;
+  event_type event;
+  FILE *f;
+  boolean abs_flag;
+{
+    int voice = vc_voice(event->nvoice);
+
+    /* process all current (and earlier) events */
+    if (is_note(event)) {       /*** a note or rest ***/
+        /* if this note is not a rest, write it */
+        if (event->value != NO_PITCH &&
+                  (seq_channel_mask(seq) &
+                   (1 << (voice - 1)))) {
+            write_pitch(f, event->value);
+            fprintf(f, " U%ld ", event->u.note.ndur >> 8);
+            write_velocity(f, (int) (event->u.note.ndur & 0xFF));
+            write_voice(f, voice);
+            write_time(f, event, abs_flag);
+        }
+    } else {            /*** a control command ***/
+        switch (vc_ctrl(event->nvoice)) {
+          case PSWITCH_CTRL:
+          case MODWHEEL_CTRL:
+          case TOUCH_CTRL:
+          case VOLUME_CTRL:
+          case BEND_CTRL:
+            fprintf(f, "%c%d ", ctrl_letter[vc_ctrl(event->nvoice)],
+                                    event->value);
+            write_voice(f, voice);
+            write_time(f, event, abs_flag);
+            break;
+          case PROGRAM_CTRL:
+            fprintf(f, "Z%d ", event->value + 1);
+            write_voice(f, voice);
+            write_time(f, event, abs_flag);
+            break;
+          case ESC_CTRL:
+            switch (event->value) {
+              case CALL_VALUE:
+                call_count++;
+                write_rest(f, event, abs_flag);
+                /* !call's are not written because there isn't enough
+                 * information.  A future version of seq should store
+                 * the hash table entry instead of the address of the
+                 * routine (then we could get string name of the call)
+                 * and the number of arguments.
+                 */
+                break;
+              case CLOCK_VALUE:
+                /* design for !clock: for absolute (absflag) files, put the
+                   clocks (if any) at the end where they can be edited out
+                   easily.  For relative files, keep the clocks in-line.
+                   On each clock, write a !tempo command inferred by the 
+                   clock and followed by the !clock.  Because the clock
+                   event comes before the actual tempo change, the chnage
+                   must be delayed by a half tick except for the first one.
+                 */
+                if (abs_flag) break;
+                new_tempo = (2500L << 16) / event->u.clock.ticksize;
+                if (clock_started) {
+                    tempo_change_at = event->ntime + clock_half_tick;
+                } else {
+                    fprintf(f, "!tempo %d\n", new_tempo);
+                    fprintf(f, "!clock\n");
+                    clock_started = TRUE;
+                }
+                clock_half_tick = (event->u.clock.ticksize) >> 17;
+                break;
+              case MACCTRL_VALUE:
+                fprintf(f, "~%d(%d) ", event->u.macctrl.ctrl_number,
+                                       event->u.macctrl.value);
+                write_voice(f, voice);
+                write_time(f, event, abs_flag);
+                break;
+              case MACRO_VALUE: 
+                macro_count++;
+                write_rest(f, event, abs_flag);
+                /* macros are not written because there isn't enough
+                 * information.  A future version of seq should store
+                 * the number of arguments in the event, or better yet,
+                 * in the definition.  Send complaints to RBD!
+                 */
+                break;
+              case CTRLRAMP_VALUE:
+                fprintf(f, "!ramp ~%d(%d) ~%d(%d) U%d U%d ",
+                        event->u.ramp.ctrl, event->u.ramp.u.ctrl.from_value,
+                        event->u.ramp.ctrl, event->u.ramp.u.ctrl.to_value,
+                        (int)event->u.ramp.step,
+                        (int)event->u.ramp.dur);
+                write_voice(f, voice);
+                write_time(f, event, abs_flag);
+                break;
+              case DEFRAMP_VALUE:
+                deframp_count++;
+                write_rest(f, event, abs_flag);
+                /* See MACRO_VALUE above for why this isn't implemented. */
+                break;
+              case SETI_VALUE:
+                seti_count++;
+                write_rest(f, event, abs_flag);
+                /* !seti and !setv are not implemented -- a future version
+                 * of seq should save more information so we can reconstruct
+                 * the Adagio source command.
+                 */
+                break;
+              default:
+                gprintf(TRANS, "unexpected ESC_CTRL value\n");
+                break;
+            }
+            break;
+          default:
+            gprintf(TRANS, "unexpected seq data\n");
+            break;
+        }
+    }
+}
+
+
+/* write_rest -- write a rest (in place of an event) */
+/**/
+private void write_rest(FILE *f, event_type ev, boolean abs_flag)
+{
+    fprintf(f, "R ");
+    write_time(f, ev, abs_flag);
+}
+
+
+/* write_time -- write the final field on the line with N or T command */
+/**/
+private void write_time(f, event, abs_flag)
+  FILE *f;
+  event_type event;
+  boolean abs_flag;
+{
+    time_type next_time;
+
+    if (abs_flag) {
+        fprintf(f, "T%ld\n", event->ntime);
+        return;
+    }
+
+    if (next_event_time(event->next, &next_time)) {
+        if (tempo_change_at && (next_time >= tempo_change_at)) {
+            fprintf(f, "N%ld\n!TEMPO %d\n!CLOCK\nR U%ld\n", 
+                        tempo_change_at - event->ntime,
+                        new_tempo, next_time - tempo_change_at);
+            tempo_change_at = 0;
+        } else {
+            fprintf(f, "N%ld\n", next_time - event->ntime);
+        }
+    } else {
+        fprintf(f, "\n");
+    }
+}
+
+
+/* write_velocity -- write the velocity field */
+/**/
+private void write_velocity(FILE *f, int velocity)
+{
+    if (last_velocity != velocity) {
+        last_velocity = velocity;
+        fprintf(f, "L%d ", velocity);
+    }
+}
+
+
+/* write_voice -- write the voice field */
+/**/
+private void write_voice(f, voice)
+  FILE *f;
+  int voice;
+{
+    if (last_voice != voice) {
+        last_voice = voice;
+        fprintf(f, "V%d ", voice);
+    }
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/seqwrite.h b/lib-src/libnyquist/nyquist/cmt/seqwrite.h
new file mode 100644
index 0000000..3f9ab6b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/seqwrite.h
@@ -0,0 +1,6 @@
+/* seqwrite.h -- write adagio format file */
+/* Copyright 1994 Carnegie Mellon University */
+
+void seq_write(seq_type seq, FILE *f, boolean abs_flag);
+        /* LISP: (SEQ-WRITE SEQ FILE BOOLEAN) */
+
diff --git a/lib-src/libnyquist/nyquist/cmt/swlogic.h b/lib-src/libnyquist/nyquist/cmt/swlogic.h
new file mode 100644
index 0000000..e09bd6c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/swlogic.h
@@ -0,0 +1,197 @@
+/********************************************************************
+*    swlogic.h - switch logic, loaded from various versions of switch.h
+*
+* Copyright 1989 Carnegie Mellon University
+*
+*********************************************************************/
+
+/* 
+ * When included, one of the following should be defined: 
+ *         AZTEC (manx compiler, implies AMIGA)
+ *         THINK_C (Think C compiler, implies Macintosh)
+ *         __MWERKS__ (Metrowerks C compiler, implies Macintosh)
+ *         LATTICE & DOS (Lattice compiler for IBM PC/AT/XT/CLONES)
+ *         MICROSOFT & DOS (Microsoft compiler, implies IBM PC/AT/XT/CLONES)
+ *         UNIX (emulator for UNIX)
+ *         UNIX_ITC (ITC code for RS6000)
+ *         UNIX_MACH (MACH ukernel system)
+ */
+ 
+/*------------------------------------------*/
+/* Other switches that might be defined in switches.h are as follows: */
+/* APPLICATION, SPACE_FOR_PLAY, MAX_CHANNELS */
+/*------------------------------------------*/
+
+/* We're moving toward the elimination of switches.h, so try to map
+ * predefined constants into our standard constants shown above:
+ */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  new conditional compilation structure
+ * 28Apr03  rbd remove macro redefinitions: MICROSOFT 
+ */
+
+
+
+/* Microsoft C compiler: */
+#ifdef _MSC_VER
+#endif
+#ifdef _MSDOS
+#define DOS
+#endif
+
+/* Quick C compiler: */
+#ifndef DOS
+#ifdef MICROSOFT
+#define DOS
+#endif
+#endif
+
+/* Borland C compiler: */
+#ifdef __BORLANDC__
+#define BORLAND
+#define DOS
+#endif
+
+/* Borland Turbo C compiler: */
+#ifdef __TURBOC__
+#define BORLAND]
+#define DOS
+#endif
+
+/* SGI systems */
+#ifdef sgi
+#ifndef UNIX
+#define UNIX
+#endif
+#define UNIX_IRIX
+#define MAX_CHANNELS 32
+#endif
+
+/* APPLICATION -- define APPLICATION if you want to disable
+ * looking for command line switches in the midi interface.
+ * I think this feature is here for the Piano Tutor project
+ * and you should not define APPLICATION for CMU Midi Toolkit
+ * projects (APPLICATION is a poor choice of terms):
+ */
+
+
+/* memory space management (system dependent):
+ *      SPACE_FOR_PLAY must be enough space to allow
+ *  seq to play a score.  This may include space for
+ *  note-off events, I/O buffers, etc.
+ */
+#ifndef SPACE_FOR_PLAY
+#define SPACE_FOR_PLAY 10000L
+#endif
+
+
+/* How many MIDI channels are there?  MACINTOSH can use 2 ports,
+ * so it supports 32 channels.  Others have one port, 16 channels.
+ * On the other hand, if you don't have all the MIDI ports plugged
+ * into MIDI interfaces, CMT will just hang, so I'll compile with
+ * just 16 channels.  The 32 channel option for the Mac is untested.
+ */
+#ifndef MAX_CHANNELS
+#define MAX_CHANNELS 16
+#endif
+
+
+/*------------------------------------------*/
+/* Now we get to the "logic": define things as a function of what
+ * was defined in switches.h
+ */
+
+#ifdef THINK_C
+#define MACINTOSH
+#endif
+
+#ifdef __MWERKS__
+#define MACINTOSH
+#endif
+
+#ifdef MACINTOSH
+#define MACINTOSH_OR_DOS
+#define MACINTOSH_OR_UNIX
+/* I don't know if THINK_C defines this and we need it for a few prototypes... */
+#ifndef __STDC__
+#define __STDC__
+#endif
+#ifndef TAB_WIDTH
+#define TAB_WIDTH 4
+#endif
+#endif
+
+#ifndef TAB_WIDTH
+#define TAB_WIDTH 8
+#endif
+
+/*
+ * If MIDIMGR is defined, compile for the Apple MIDI Manager
+ * (Non MIDI manager code is no longer supported)
+ */
+#ifdef MACINTOSH
+/* under Nyquist, the MidiMgr is not used, so you can't
+ * receive or send Midi as in CMU MIDI Toolkit; however,
+ * much of CMU MIDI Toolkit is used for Midi file IO
+ */
+#ifndef NYQUIST
+#define MIDIMGR
+#endif
+#define USE_VSPRINTF
+#endif
+
+#ifdef BORLAND
+#define DOS
+#endif
+
+#ifdef LATTICE322
+#define DOS
+#define OLD_PROTOTYPES
+#endif
+
+#ifdef UNIX_ITC
+#define UNIX
+#define ITC
+#endif
+
+#ifdef UNIX_MACH
+#define UNIX
+#define ITC
+#endif
+
+/* USE_VSPRINTF says vsprintf() is defined */
+#ifdef ITC
+#define USE_VSPRINTF
+#endif
+#ifdef AZTEC
+#define USE_VSPRINTF
+#endif
+
+
+/* DOTS_FOR_ARGS says ANSI "..." notation is recognized */
+#ifdef __STDC__
+#define DOTS_FOR_ARGS
+#endif
+#ifdef UNIX_ITC
+#define DOTS_FOR_ARGS
+#endif
+#ifdef BORLAND
+#define DOTS_FOR_ARGS
+#endif
+#ifdef MICROSOFT
+#define DOTS_FOR_ARGS
+#endif
+
+#ifdef DOS
+#define MACINTOSH_OR_DOS
+#else
+#define huge
+#endif
+
+#ifdef UNIX
+#define MACINTOSH_OR_UNIX
+#endif
+
+#define SWITCHES
diff --git a/lib-src/libnyquist/nyquist/cmt/tempomap.c b/lib-src/libnyquist/nyquist/cmt/tempomap.c
new file mode 100644
index 0000000..e56b9bf
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/tempomap.c
@@ -0,0 +1,124 @@
+/* tempomap.c -- used by midifile reader to record and lookup time maps */
+/*
+ *  This module is designed to provide tempo change list insert and
+ *  lookup facilities.  The exact interpretation of beat and tempo are
+ *  defined in one function, elapsed_time, which takes a tempo and a
+ *  number of beats, and returns time.
+ */
+
+#include "cext.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
+#include "seq.h"
+#include "tempomap.h"
+
+static time_type elapsed_time();
+
+/* tempomap_create -- create a tempomap */
+/**/
+tempomap_type tempomap_create()
+{
+    tempochange_type tempochange = tempochange_alloc();
+    tempomap_type tempomap = tempomap_alloc();
+    tempomap->hint = tempomap->entries = tempochange;
+    tempochange->beat = 0L;
+    /* default tempo is 120 (= 50000microsec/beat) and 24 divisions/quarter */
+    /* this may be overridden by a tempomap_insert */
+    tempochange->tempo = 500000L / 24;
+    tempochange->rtime = 0L;
+    tempochange->next = NULL;
+    return tempomap;
+}
+
+
+/* tempomap_free -- deallocate storage for tempo map */
+/**/
+void tempomap_free(tm)
+  tempomap_type tm;
+{
+    while (tm->entries) {
+        tempochange_type tc = tm->entries;
+        tm->entries = tc->next;
+        tempochange_free(tc);
+    }
+    memfree(tm, sizeof(tempomap_node));
+}
+
+
+/* tempomap_insert -- insert a tempo change into the map */
+/**/
+void tempomap_insert(tempomap, beat, tempo)
+  tempomap_type tempomap;
+  long beat;    /* beat division number */
+  long tempo;   /* microseconds per beat division */
+{
+    tempochange_type tempochange = tempochange_alloc();
+    register tempochange_type prev;
+    register tempochange_type next;
+
+    tempochange->tempo = tempo;
+    tempochange->beat = beat;
+
+    if ((!(tempomap->hint->next)) ||
+          (tempomap->hint->beat > beat))
+        tempomap->hint = tempomap->entries;
+
+    /* find the insert point */
+    for (prev = tempomap->hint;
+         (next = prev->next) && (next->beat <= beat);
+         prev = next);
+
+     /* make the insert */
+    tempochange->next = next;
+    prev->next = tempochange;
+    tempomap->hint = prev;
+
+    /* update the real time of each change */
+    for (tempochange = prev;
+         tempochange->next;
+         tempochange = tempochange->next) {
+        tempochange->next->rtime =
+            tempochange->rtime +
+            elapsed_time(tempochange->tempo,
+                         tempochange->next->beat - tempochange->beat);
+    }
+}
+
+
+/* tempomap_lookup -- convert beat to 4us time */
+/*
+ * The returned time is real time in units of 4us.
+ */
+time_type tempomap_lookup(tempomap, beat)
+  tempomap_type tempomap;
+  long beat;
+{
+    register tempochange_type prev;
+    register tempochange_type next;
+
+    if ((!(tempomap->hint->next)) || 
+          (tempomap->hint->beat > beat))
+        tempomap->hint = tempomap->entries;
+
+    /* find the last inflection point */
+    for (prev = tempomap->hint;
+         (next = prev->next) && (next->beat <= beat);
+         prev = next);
+
+    /* interpolate */
+    return prev->rtime +
+           elapsed_time(prev->tempo, beat - prev->beat);
+}
+
+
+/* elapsed_time -- compute the real elapsed time at a given tempo */
+/*
+ * the time returned is in units of 4us.
+ */
+static time_type elapsed_time(tempo, beat)
+  long tempo;
+  long beat;
+{
+    return (time_type)((tempo * beat) >> 2);
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/tempomap.h b/lib-src/libnyquist/nyquist/cmt/tempomap.h
new file mode 100644
index 0000000..a437c25
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/tempomap.h
@@ -0,0 +1,25 @@
+/* tempomap.h -- list of tempo changes */
+
+typedef struct tempochange_struct {
+    struct tempochange_struct *next;
+    time_type rtime;
+    long beat;
+    long tempo;
+} tempochange_node, *tempochange_type;
+
+
+typedef struct tempomap_struct {
+    tempochange_type entries;
+    tempochange_type hint;
+} tempomap_node, *tempomap_type;
+
+
+#define tempochange_alloc() (tempochange_type) memget(sizeof(tempochange_node))
+#define tempochange_free(tc) memfree(tc, sizeof(tempochange_node))
+#define tempomap_alloc() (tempomap_type) memget(sizeof(tempomap_node))
+tempomap_type tempomap_create(void);
+void tempomap_free(tempomap_type tm);
+void tempomap_insert(tempomap_type tempomap, long beat, long tempo);
+time_type tempomap_lookup(tempomap_type tempomap, long beat);
+
+    
diff --git a/lib-src/libnyquist/nyquist/cmt/timebase.c b/lib-src/libnyquist/nyquist/cmt/timebase.c
new file mode 100644
index 0000000..0bb1713
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/timebase.c
@@ -0,0 +1,322 @@
+/* timebase.c -- management of calls, time bases and heaps for moxc */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+*  2-Apr-91 | JDW : further changes
+* 21-Mar-92 | GWL : abort recovery
+* 28-Apr-03 |  DM : true->TRUE
+*****************************************************************************/
+
+
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
+
+
+timebase_type timebase_queue = NULL;    /* waiting to run timebase queue */
+call_type callfree = NULL;      /* free list */
+
+private void fatal();
+
+
+/****************************************************************************
+*                           timebase_create
+* Inputs:
+*       maxsize is the initial size of the heap
+* Outputs:
+*       returns an initialized timebase_type
+****************************************************************************/
+
+timebase_type timebase_create(maxsize)
+  int maxsize;
+{
+   static char *error_msg = "Out of memory in timebase_create()";
+    timebase_type base = (timebase_type) memget(sizeof(timebase_node));
+    if (!base) fatal(error_msg);
+    base->next = NULL;
+    base->next_time = MAXTIME;
+    base->virt_base = 0L;
+    base->real_base = 0L;
+    base->rate = 256L;
+    base->heap_size = 0;
+    base->heap_max = maxsize;
+    base->heap = (call_type *) memget(sizeof(call_type) * maxsize);
+    if (!base->heap) fatal(error_msg);
+    return base;
+}
+
+/****************************************************************************
+*                           callinsert
+* Inputs:
+*       timebase_type base: the time base and heap
+*       call_type call: the call to insert in heap
+* Outputs:
+        none
+* Implementation:
+*       linear insertion; to be changed to heap
+****************************************************************************/
+
+void callinsert(base, call)
+  timebase_type base;
+  call_type call;
+{
+    int i;
+    register call_type *heap = base->heap;
+
+    /* handle overflow -- this should never be executed if the user 
+     * gives the right initial heap size 
+     */
+    base->heap_size++;
+    if (base->heap_size >= base->heap_max) {
+        call_type *new_heap = (call_type *)
+            memget((base->heap_max << 1) * sizeof(call_type));
+        int i;
+        call_type *oldptr;
+        call_type *newptr;
+        if (!new_heap) {
+            gprintf(TRANS, "Out of space, can't allocate new heap\n");
+            EXIT(1);
+        }
+
+        oldptr = base->heap;
+        newptr = new_heap;
+
+        for (i = base->heap_max; i > 0; i--) *newptr++ = *oldptr++;
+        memfree((char *) heap, base->heap_max * sizeof(call_type));
+        base->heap = heap = new_heap;
+        base->heap_max = (base->heap_max << 1);
+    }
+
+    /* now do the heap insert */
+    i = base->heap_size;
+    while (i > 1) {
+        int parent = i >> 1;
+        if (heap[parent]->u.e.time < call->u.e.time ||
+            (heap[parent]->u.e.time == call->u.e.time &&
+             heap[parent]->u.e.priority <= call->u.e.priority)) break;
+        heap[i] = heap[parent];
+        i = parent;
+    }
+    heap[i] = call;
+
+    /* if next_time might change, reinsert base into queue */
+    if (heap[1] == call) {
+        remove_base(base);
+        insert_base(base);
+    }
+}
+
+/****************************************************************************
+*                               callshow
+* Inputs:
+*       calltype call: the call to show
+* Effect: 
+*       prints a description of call
+* Assumes:
+*       call is not null
+****************************************************************************/
+void callshow(call)
+    call_type call;
+{
+    int i;
+    gprintf(TRANS,"address:  %lx\n", (ulong)call);
+    gprintf(TRANS,"time:     %ld\n", call->u.e.time);
+    gprintf(TRANS,"routine:  %lx\n", (ulong)call->u.e.routine);
+    gprintf(TRANS,"parameters:");
+    for (i = 0; i < MAX_CALL_ARGS; i++) {
+        gprintf(TRANS, " %d", call->u.e.p.arg[i]);
+    }
+    gprintf(TRANS, "\n");
+}
+
+/***************************************************************
+*                           fatal
+*
+* Input : msg: a message to be displayed
+* Effect: print message and exit program
+***************************************************************/
+
+private void fatal(msg)
+  char *msg;
+{
+    gprintf(FATAL, msg);
+    EXIT(1);
+}
+
+/***************************************************************
+*                           timebase_free
+*
+* Input : a time base
+* Effect: deallocate the time base
+***************************************************************/
+
+void timebase_free(timebase)
+  timebase_type timebase;
+{
+    remove_base(timebase);
+    if (timebase->heap) {
+        memfree((char *) timebase->heap,
+                (timebase->heap_max * sizeof(call_type)));
+    }
+    memfree((char *) timebase, sizeof(timebase_node));
+}
+
+/***************************************************************
+*                           insert_base
+*
+* Input : a time base not in the list 
+* Effect: insert timebase at the appropriate spot in the list
+*       computes the next_time field from the top of the heap
+***************************************************************/
+
+void insert_base(timebase)
+  timebase_type timebase;
+{
+    register timebase_type *ptr = &timebase_queue;
+    register time_type next_time = MAXTIME;
+    /* compute next_time */
+    if (timebase->heap_size != 0) {
+        register call_type call = timebase->heap[1];
+        /* virt to real calculation */
+        next_time = (virt_to_real_256(timebase, call->u.e.time) &
+                     0xFFFFFF00) + call->u.e.priority;
+/*      gprintf(TRANS,
+                "insert next_time is %ld, vt %ld, rb %ld, vb %ld rt %ld\n",
+                next_time, timebase->heap[1]->u.e.time,
+                timebase->real_base, timebase->virt_base, timebase->rate);
+ */
+    }
+    timebase->next_time = next_time;
+
+    if (next_time != MAXTIME) {
+        /* insert into the list */
+        while (TRUE) {
+            if (! *ptr) {
+                *ptr = timebase;
+                timebase->next = NULL;
+                return;
+            } else if ((*ptr)->next_time >= next_time) {
+                timebase->next = *ptr;
+                *ptr = timebase;
+                return;
+            } else ptr = &((*ptr)->next);
+        }
+    }
+}
+
+/***************************************************************
+*                           remove_base
+*
+* Input : timebase
+* Effect: if timebase is in the queue, remove it
+***************************************************************/
+
+void remove_base(timebase)
+  timebase_type timebase;
+{
+    timebase_type *ptr = &timebase_queue;
+    while (*ptr) {
+        if (*ptr == timebase) {
+            *ptr = timebase->next;
+            return;
+        } else ptr = &((*ptr)->next);
+    }
+}
+
+/***************************************************************
+*                           remove_call
+*
+* Input : a timebase -- passed as a global
+* Assumes: a_timebase->heap_size > 0
+* Returns: the earliest call in the queue
+* Effect: removes the earliest call in the queue
+***************************************************************/
+
+call_type remove_call(timebase_type a_timebase)
+{
+    register call_type *heap = a_timebase->heap;
+    call_type result = heap[1];
+    register call_type large;
+    int i = 1;
+    int child = i << 1;;
+    large = heap[a_timebase->heap_size--];
+    while (child <= a_timebase->heap_size) {
+        if (child + 1 <= a_timebase->heap_size) {
+            if (heap[child + 1]->u.e.time < heap[child]->u.e.time ||
+                (heap[child + 1]->u.e.time == heap[child]->u.e.time &&
+                 heap[child + 1]->u.e.priority < heap[child]->u.e.priority))
+                child++;
+        }
+        /* child is now the index of the least child */
+        if (large->u.e.time < heap[child]->u.e.time ||
+            (large->u.e.time == heap[child]->u.e.time &&
+             large->u.e.priority <= heap[child]->u.e.priority)) break;
+        /* swap */
+        heap[i] = heap[child];
+        i = child;
+        child = i << 1;
+    }
+    heap[i] = large;
+    return result;
+}
+
+/***************************************************************
+*                           set_rate
+*
+* Input : timebase and new rate
+* Effect: makes the current rate of timebase be rate
+***************************************************************/
+
+void set_rate(base, rate)
+  timebase_type base;
+  time_type rate;
+{
+    if (base == timebase) base->virt_base = virttime;
+    else base->virt_base = real_to_virt(base, eventtime);
+    base->real_base = eventtime;
+    base->rate = rate;
+/*    gprintf(TRANS, "new real_base %ld virt_base %ld\n",
+                   base->real_base, base->virt_base);
+ */
+    remove_base(base);
+    insert_base(base);
+}
+  
+/***************************************************************
+*                           set_virttime
+*
+* Input : virtual time
+* Effect: makes the current virtual time of timebase be vtime
+***************************************************************/
+
+void set_virttime(base, vtime)
+  timebase_type base;
+  time_type vtime;
+{
+    base->real_base = eventtime;
+    base->virt_base = vtime;
+    if (base == timebase) virttime = vtime;
+    remove_base(base);
+    insert_base(base);
+}
+
+/***************************************************************
+*                           timebase_use
+*
+* Input : a timebase to use for scheduling
+* Effect: sets up globals: timebase, virttime
+***************************************************************/
+
+void timebase_use(base)
+  register timebase_type base;
+{
+    if (timebase != base) {
+        timebase = base;
+        virttime = real_to_virt(base, eventtime);
+    }
+}
diff --git a/lib-src/libnyquist/nyquist/cmt/timebase.h b/lib-src/libnyquist/nyquist/cmt/timebase.h
new file mode 100644
index 0000000..9da4e90
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/timebase.h
@@ -0,0 +1,85 @@
+/* timebase.h -- management of calls, time bases and heaps for moxc */
+
+#define STOPRATE 0xFFFFL
+
+/***************************************************************************
+* call structure
+****************************************************************************/
+
+/* ---NOTE!!! if you change MAX_CALL_ARGS, change CALLARGS macro below--- */
+#define MAX_CALL_ARGS 8
+typedef struct call_args_struct {
+  long arg[MAX_CALL_ARGS];
+} call_args_node;
+
+typedef struct call {
+    union {
+        struct {
+            time_type time;     /* virtual time of this call */
+            int priority;       /* an 8-bit the priority, low priority first */
+            int (*routine)();   /* who to call */
+            call_args_node p; /* what to pass */
+        } e;
+        struct call *p; /* used to link free calls */
+    } u;
+} *call_type, call_node;
+
+/* CALLARGS - given a call_type, this macro generates an argument list */
+/*
+ * NOTE: originally, I thought call->u.e.p (a structure), would do it, but
+ * Lattice C for the Amiga has a compiler bug, and even in places where the
+ * bug doesn't show up, the code generated for the structure passing is 
+ * a sequence of two loops: one to copy data to a local area on the stack,
+ * and one to push this data (a byte at a time!) to the top of the stack.
+ * With Lattice (and perhaps others, I haven't checked), it's better to 
+ * push the data in-line.
+ */
+#ifdef LATTICE
+#define CARG(n) call->u.e.p.arg[n]
+#define CALLARGS(call) CARG(0), CARG(1), CARG(2), CARG(3), \
+                CARG(4), CARG(5), CARG(6), CARG(7)
+#else
+#define CALLARGS(call) call->u.e.p
+#endif
+
+/***************************************************************************
+* timebase structure
+****************************************************************************/
+
+typedef struct timebase_struct {
+    struct timebase_struct *next;       /* used for list */
+    time_type next_time;
+    time_type virt_base;
+    time_type real_base;
+    time_type rate; /* ratio of real/virt time, STOPRATE or more is infinity */
+    short heap_size;
+    short heap_max;
+    call_type *heap;
+} timebase_node, *timebase_type;
+
+extern timebase_type timebase_queue;
+
+#define call_alloc() ((call_type) memget(sizeof(call_node)))
+#define call_free(c) memfree((char *) (c), sizeof(call_node))
+
+timebase_type   timebase_create(int maxsize);
+void            callinsert(timebase_type base, call_type call);
+void            callshow(call_type call);
+void            timebase_free(timebase_type timebase);
+void            insert_base(timebase_type timebase);
+void            remove_base(timebase_type timebase);
+call_type       remove_call(timebase_type a_timebase);
+void            set_rate(timebase_type base, time_type rate);
+void            set_virttime(timebase_type base, time_type vtime);
+void            timebase_use(timebase_type base);
+
+#define real_to_virt(base, rtime) ((base)->rate == 0 ? MAXTIME : \
+ ((base)->virt_base + (((rtime) - (base)->real_base) << 8) / (base)->rate))
+
+#define virt_to_real(base, vtime) ((base)->rate >= STOPRATE ? \
+ ((base)->virt_base > vtime ? (base)->real_base : MAXTIME) : \
+ (base)->real_base + ((((vtime) - (base)->virt_base) * (base)->rate) >> 8))
+
+#define virt_to_real_256(base, vtime) ((base)->rate >= STOPRATE ? \
+ ((base)->virt_base > vtime ? (base)->real_base << 8 : MAXTIME) : \
+ ((base)->real_base << 8) + ((((vtime) - (base)->virt_base) * (base)->rate)))
diff --git a/lib-src/libnyquist/nyquist/cmt/userio.c b/lib-src/libnyquist/nyquist/cmt/userio.c
new file mode 100644
index 0000000..a06ff77
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/userio.c
@@ -0,0 +1,1282 @@
+/* userio.c -- handy user interface functions */
+/* Copyright 1989 Carnegie Mellon University */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+* 21-May-86 | Created
+* 11-Aug-87 | F.H: Added clear_abort(), stop()
+*    May-88 | JCD : AMIGA VERSION 
+* 11-Jun-88 | RBD: disable printing of GDEBUG messages
+* 12-Oct-88 | JCD : EXCLUSIVE AMIGA VERSION
+* 13-Apr-89 | JCD : New portable version.
+*  5-Apr    | JDW : Further changes
+*  2-Mar-92 | GWL : Little changes to satisfy compiler
+* 19-Nov-92 | JDZ : Mach tty io threads
+* 28-Apr-03 |  DM : portability changes. true->TRUE, false->FALSE
+*****************************************************************************/
+
+/* Notes on ascii input:
+
+Input is complicated because different systems have varying input models,
+especially with regard to handling ^C.  The CMT model handles ^C and ^G as
+special characters, and these do not cause software interrupts.  Also, the
+lowest level of the CMT model does not support line editing: Every character
+is acted upon immediately.  This has two implications:
+(1) CMT must "read ahead" looking for ^C and ^G characters.  This is handled
+by the check_aborted() procedure, which reads characters into the 
+type_ahead[] array.
+(2) CMT must do its own line editing.  This is handled by the ggets() routine.
+
+A number of functions support ascii input, only some of which are visible
+to the application programmer.  Let's start at the top-level and work down;
+each of the following calls the routine below it:
+
+ggets() - gets a string with line editing support.  This function is fairly
+machine independent, except for some backspace-and-erase control character
+code sequences.
+
+ggetchar() - gets a raw character.  This function calls wait_ascii()
+ and echoes it.  Note that it may return ABORT_CHAR or BREAK_CHAR.
+
+wait_ascii() - gets a raw character without echo and without character
+code translation.  wait_ascii() either polls get_ascii() or uses some
+kind of system-dependent event waiting.  Returns ABORT_CHAR or BREAK_CHAR
+immediately if abort_flag has been set, regardless of whether there is
+new ascii input.
+
+get_ascii() - checks to see if a character is available.  (Using
+check_aborted().)
+The only dependency here is on the Amiga, we restart input when buffer goes
+from full to non-full.
+
+check_aborted() - looks for input by calling ascii_input.  If found,
+put the input into the type_ahead[] buffer. Returns abort_flag.
+
+ascii_input() - lowest level of input; just gets a character if there is
+one.  Does conversion from RETURN (\r) to EOL (\n).  The Amiga handles
+this in-line directly in check_aborted().
+
+Here's a quick summary:
+
+ggets = ggetchar + line editing & string building
+ggetchar = wait_ascii + character echo
+wait_ascii = get_ascii + wait for character
+get_ascii = check_aborted + pull char from buffer
+check_aborted = ascii_input + test for ^C,^G + put in buffer
+ascii_input = poll for char + CR->EOL conversion
+
+*/
+
+#include "switches.h"
+
+#include <stdio.h>
+#include <string.h>
+#if HAS_STDLIB_H
+#include <stdlib.h> /* normal case */
+#endif
+
+
+#ifdef MACINTOSH
+# include "StandardFile.h"
+  /* added for ThinkC 7 */
+# ifdef THINK_C
+#  include <pascal.h>
+# endif
+#endif
+
+#ifdef AMIGA
+
+# ifdef AZTEC
+#  include "functions.h"
+# else /* LATTICE */
+#  include "amiga.h"
+#  include "stdarg.h"
+# endif
+
+# include "intuition/intuition.h"
+# include "devices/console.h"
+#endif
+
+#include "ctype.h"
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+
+#ifdef MICROSOFT
+#include "signal.h"
+#endif
+
+#ifdef UNIX_MACH
+#include <varargs.h>
+#include <midistruct.h>
+extern char a_in;
+extern int a_in_flag;
+extern int i_am_running;
+#ifdef RTMach
+extern itc_mutex_t a_mutex;
+extern itc_condition_t a_cond, a_in_cond;
+#define A_LOCK() itc_mutex_lock(&a_mutex)
+#define A_UNLOCK() itc_mutex_unlock(&a_mutex)
+#else /* RTMach */
+extern struct mutex a_mutex;
+extern struct condition a_cond, a_in_cond;
+#define A_LOCK() mutex_lock(&a_mutex)
+#define A_UNLOCK() mutex_unlock(&a_mutex)
+#endif /* RTMach */
+#endif
+
+#ifdef DOTS_FOR_ARGS
+#include <stdarg.h>
+#endif
+
+#ifdef UNIX
+#include <sys/param.h>
+#include "cmtio.h"
+#ifdef _IBMR2
+#define NBBY 8
+#define OPEN_MAX 2000
+#endif
+#include <sys/select.h>
+#endif
+
+#ifdef linux
+#include <sys/time.h> /* for FD_ZERO / FD_SET */
+#endif
+
+extern int debug;
+
+#ifdef NYQUIST
+/* get definitions for stdputstr, etc. */
+#include "xlisp.h"
+#endif
+
+
+/****************************************************************************
+*
+*       routines private to this module
+*
+****************************************************************************/
+
+int GetReadFileName();
+int GetWriteFileName();
+
+#ifdef MACINTOSH
+private void PtoC_StrCopy(char *p1, char *p2);
+#endif
+
+#ifdef AMIGA
+        char ConGetChar();
+        ConMayGetChar();
+private void ConRead();
+private void ConPutStr();
+private void ConPutChar();
+UBYTE   ascii_signal();
+UBYTE   KeybSig();
+#endif
+
+
+/****************************************************************************
+*
+* variables shared with other modules
+*
+****************************************************************************/
+
+public int abort_flag;          /* control C or control G equivalent */
+public int redirect_flag;		/* check whether the I/O has been redirected--
+                                    Added by Ning Hu	Apr.2001*/
+/* extern void musicterm(); */ /*DMH: from macmidi.c, to allow abort_check*/
+public boolean ascii_input();
+
+/****************************************************************************
+*
+* variables private to this module
+*
+****************************************************************************/
+
+#ifdef AMIGA
+struct IntuitionBase *IntuitionBase;
+private struct IOStdReq *ConOutReq;
+private struct MsgPort *ConOutPort;
+private struct IOStdReq *ConInReq;
+private struct MsgPort *ConInPort;
+private char KeyBuff[16];
+private struct Window *Window;
+private struct NewWindow NewWindow = {
+    0,11,640,189,
+    0,1,
+    NULL,
+    SMART_REFRESH | ACTIVATE | WINDOWDRAG | WINDOWDEPTH |
+        WINDOWSIZING,
+    NULL,NULL,
+    (STRPTR) "Carnegie Mellon University MIDI Toolkit for Commodore AMIGA",
+    NULL,NULL,
+    100,25,640,200,
+    WBENCHSCREEN };
+#endif
+
+#ifdef MACINTOSH
+private OSType io_file_type = 0x3F3F3F3F; /* '????' */
+private OSType io_file_creator = 0x3F3F3F3F; /* '????' */
+#endif
+
+#define type_ahead_max 100
+char type_ahead[100];
+int type_ahead_head = 0;
+int type_ahead_tail = 0;
+int type_ahead_count = 0;
+
+
+#ifdef DOS
+#ifdef BORLAND
+int c_break(void)
+{
+    gprintf(TRANS, " BREAK ");
+    abort_flag = ABORT_LEVEL;
+    return 1; /* non-zero means do not exit program */
+}
+#endif
+#ifdef MICROSOFT
+void c_break(int sig)
+{
+    abort_flag = ABORT_LEVEL;
+    /* The CTRL+C interrupt must be reset to our handler since
+     * by default it is reset to the system handler.
+     */
+    signal(SIGINT, c_break); /* assume this succeeds */
+}
+#endif
+#endif
+
+#ifdef MACINTOSH
+#ifdef NYQUIST
+void FlushOutput (void);
+#endif
+#endif
+
+/* gflush -- flush output produced by gprintf, etc. */
+/**/
+void gflush(void)
+{
+#ifdef MACINTOSH
+#ifdef NYQUIST
+    FlushOutput();
+#else
+    fflush(stdout);    /* make sure any prompts or errors have been output */
+    fflush(STDERR);
+#endif /* NYQUIST */
+#endif /* MACINTOSH */
+#ifdef UNIX
+    fflush(stdout);    /* make sure any prompts or errors have been output */
+    fflush(STDERR);
+#endif
+}
+
+
+/****************************************************************************
+*                                io_init
+*
+*  I added this init function for the AMIGA version. 
+*
+*  io_init : opens a window
+*  and exits if initialisation can not be done properly.
+*  registers cleanup calls to carefully deallocate resources.
+*
+*  io_init is not amiga specific : the simplest version 
+*  of io_init could be a clear screen statement for example, and a
+*  printf("Good bye !\n") on exit.
+*
+*  for the Mac, it seems that ascii_input doesn't work unless getchar() is
+*  called first.  I assume this is because getchar() initializes the ability
+*  of the window to process type-in, so there is probably a way to set this
+*  directly.  If you figure it out, let me know.  -RBD
+*
+*****************************************************************************/
+
+void
+io_init()
+{
+
+#ifdef AMIGA
+    int error;
+
+    /* Window and console initialisation  */
+    IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",1L);
+    if (IntuitionBase == NULL) EXIT(1);
+    cu_register((cu_fn_type) CloseLibrary, IntuitionBase);
+    
+    ConOutPort = CreatePort("conoutport", 0L);
+    if (ConOutPort == NULL) EXIT(1);
+    cu_register((cu_fn_type) DeletePort, ConOutPort);
+    
+    ConOutReq = CreateStdIO(ConOutPort);
+    if (ConOutReq == NULL) EXIT(1);
+    cu_register((cu_fn_type) DeleteStdIO, ConOutReq);
+    
+    ConInPort = CreatePort("coninport", 0L);
+    if (ConInPort == NULL) EXIT(1);
+    cu_register((cu_fn_type) DeletePort, ConInPort);
+    
+    ConInReq = CreateStdIO(ConInPort);
+    if (ConInReq == NULL) EXIT(1);
+    cu_register((cu_fn_type) DeleteStdIO, ConInReq);
+    
+    Window = OpenWindow(&NewWindow);
+    if (Window == NULL) EXIT(1);
+    cu_register((cu_fn_type) CloseWindow, Window);
+    
+    ConOutReq->io_Data = (APTR)Window;
+    ConOutReq->io_Length = sizeof(*Window);
+    error = OpenDevice("console.device", 0L, (struct IORequest *) ConOutReq, 0L);
+    ConInReq->io_Device = ConOutReq->io_Device;
+    ConInReq->io_Unit = ConOutReq->io_Unit;
+    if (error != NULL) EXIT(1);
+    cu_register((cu_fn_type) CloseDevice, ConOutReq);
+    
+    ConInReq->io_Command = CMD_READ;
+    ConInReq->io_Data = (APTR)KeyBuff;
+    ConInReq->io_Length = 1;
+    SendIO((struct IORequest *) ConInReq);
+#endif
+
+#ifdef UNIX
+#ifndef BUFFERED_SYNCHRONOUS_INPUT
+    IOsetup(0 /* standard input */);
+    cu_register((cu_fn_type) IOcleanup, NULL);
+#endif
+#endif
+
+#ifdef MACINTOSH
+#ifndef NYQUIST /* don't need this if we're in Nyquist */
+    char s[100];
+    printf("Type <return> to start: ");
+    fgets(s, 100, stdin);
+#endif /* NYQUIST */
+#endif
+
+#ifdef DOS
+#ifdef MICROSOFT
+    if (signal(SIGINT, c_break) == SIG_ERR) {
+        gprintf(ERROR, "Couldn't set Ctrl C handler\n");
+        EXIT(1);
+    }
+#else
+#ifdef BORLAND
+    ctrlbrk(c_break);
+#else
+    ... we are in DOS, but neither MICROSOFT nor BORLAND,
+    please set up a control C handler here...
+#endif
+#endif
+#endif
+}
+
+#ifdef MACINTOSH
+
+/****************************************************************************
+*                                       abort_check
+* Effect:
+*       exit nicely if the aborted flag is set
+****************************************************************************/
+
+public void abort_check()
+{
+    if (abort_flag) clean_exit();
+}
+
+
+/****************************************************************************
+*                                       clean_exit
+* Effect:
+*       clean up and exit
+****************************************************************************/
+
+public void clean_exit()
+{
+        gprintf(TRANS, "Exiting...\n");
+        EXIT(1);
+}
+
+#ifdef MPW
+/****************************************************************************
+*                                       cleanup_abort_handler
+* Effect:
+*       shuts down abort watcher
+****************************************************************************/
+
+public void cleanup_abort_handler()
+{
+        (void) sigset(SIGINT, SIG_DFL); /* deactivate abort watcher */
+}
+
+
+/****************************************************************************
+*                                       init_abort_handler
+* Effect:
+*       starts abort watcher
+*       aborted flag is set to FALSE
+****************************************************************************/
+
+public void init_abort_handler()
+{
+        abort_flag = FALSE;
+        (void) sigset(SIGINT, abort_watcher);   /* activate abort watcher */
+}
+#endif
+
+#endif
+
+
+/****************************************************************************
+*               askbool
+* Inputs:
+*    char *prompt: string to prompt for user input
+*    int deflt: TRUE or FALSE default
+* Returns:
+*    boolean: TRUE or FALSE as entered by user
+* Effect:
+*    prompts user for yes or no input, returns result
+****************************************************************************/
+
+int askbool(prompt, deflt)
+char *prompt;
+int deflt;
+{
+#define undefined -1
+    char defchar;    /* the default answer */
+    char c;     /* user input */
+    char in_string[100];
+    int result = -1;    /* the result: -1 = undefined, 0 = FALSE, 1 = TRUE */
+    if (deflt) defchar = 'y';
+    else defchar = 'n';
+    while (result == undefined) {
+        gprintf(TRANS, "%s? [%c]: ", prompt, defchar);
+        ggets(in_string);
+        c = in_string[0];
+        if (islower(c)) c = toupper(c);
+        if (c == 'Y') result = TRUE;
+        else if (c == 'N') result = FALSE;
+        else if (c == EOS) result = deflt;
+        else if (abort_flag) result = deflt;
+        /* space before Please to separate from user's type-in: */
+        else gprintf(TRANS, " Please type Y or N.\n");
+    }
+    if (abort_flag == BREAK_LEVEL) {
+        abort_flag = 0;
+        result = deflt;
+        gprintf(TRANS, "\n");
+    }
+    return result;
+}
+
+
+/****************************************************************************
+*               fileopen
+* Inputs:
+*    char *deflt: the default file name (e.g. from command line)
+*    char *extension: default extension
+*    char *mode: read ("r") or write ("w")
+*    char *prompt: prompt for user
+* Returns:
+*    opened file pointer
+* Effect: 
+*    opens file, prompts for user input if necessary and warns about
+*    possible confusion.  If deflt is a null string or NULL, the user will
+*    be prompted for a name.     The routine loops until a file is opened.
+*    If the mode is "r", a check is made to see if the file exists
+*    with and without the extension.     If both exist a warning is given.
+*    For mode "w", a check is made to see if the file will be overwritten.
+*    The extension is automatically added if the default or user-typed
+*    file has no "."     At the bottom of the loop body, if no file has
+*    been opened, the user is prompted for another file name.
+****************************************************************************/
+
+char fileopen_name[100];        /* name of the opened file */
+
+FILE *fileopen(deflt, extension, mode, prompt)
+  char *deflt;
+  char *extension;    /* default extension */
+  char *mode;   /* read "r" or write "w" */
+  char *prompt;    /* prompt for user */
+{
+    char extname[100];          /* trial name with extension added */
+    FILE *fp = NULL;            /* file corresponding to filename */
+    FILE *fpext;                /* file corresponding to extname */
+    char *problem = NULL;       /* tells user why he has to try again */
+
+    if (!deflt) deflt = "";     /* treat NULL as the empty string */
+    strcpy(fileopen_name, deflt);
+    /* keep trying until a good file is found: */
+    while (fp == NULL) {
+        /* avoid null file names: */
+        while (strlen(fileopen_name) == 0) {
+#ifndef MACINTOSH
+            gprintf(TRANS, "%s : ", prompt);
+            ggets(fileopen_name);
+            if (abort_flag) {
+                if (abort_flag == BREAK_LEVEL) {
+                    abort_flag = 0;
+                    /* type return since user didn't... */
+                    gprintf(TRANS, "\n");
+                }
+                return NULL;
+            }
+#else /* use Macintosh file dialog */
+            if (mode[0] == 'r') {
+                 if (!GetReadFileName(fileopen_name)) return NULL;
+             } else if (mode[0] == 'w') {
+                 if (!(GetWriteFileName(fileopen_name, prompt))) return NULL;
+             } else {
+                 gprintf(ERROR, "(fileopen) internal error: bad mode\n");
+             }
+#endif /* MACINTOSH */
+        }
+        if (mode[0] == 'r') {
+            strcpy(extname, fileopen_name);
+            strcat(extname, ".");
+            strcat(extname, extension);
+            fp = fopen(fileopen_name, mode);
+            fpext = fopen(extname, mode);
+            if (fp != NULL && fpext != NULL) {
+                gprintf(TRANS,
+                "warning: both %s and %s exist.     %s will be used.\n",
+                fileopen_name, extname, fileopen_name);
+                fclose(fpext);
+            } else if (fpext != NULL) {
+                fp = fpext;
+                strcpy(fileopen_name, extname);  /* remember what was opened */
+            }
+            if (fp == NULL) problem = "Couldn't find %s.\n";
+        } else if (mode[0] == 'w') {
+            boolean added_extension = FALSE;
+            
+            /* add the extension if there is no '.' in the file name */
+            if (!strchr(fileopen_name, '.')) {
+                strcat(fileopen_name, ".");
+                strcat(fileopen_name, extension);
+                added_extension = TRUE;
+            }
+            if (TRUE
+#ifdef MACINTOSH
+                /* file open dialog already asked user to confirm unless we're
+                 * adding an extension
+                 */
+                && added_extension
+#endif
+                ) {
+                fp = fopen(fileopen_name, "r");
+                if (fp != NULL) {
+                    char question[100];
+                    fclose(fp);
+                    strcpy(question, "OK to overwrite ");
+                    strcat(question, fileopen_name);
+                    if (!askbool(question, FALSE)) {
+                        fp = NULL;
+                        problem = "\n";
+                        goto tryagain;
+                    }
+                }
+            }
+            fp = fopen(fileopen_name, mode);
+            if (fp == NULL) problem = "Couldn't create %s.\n";
+        }
+  tryagain:
+        if (fp == NULL) {
+            gprintf(TRANS, problem, fileopen_name);
+            gprintf(TRANS,"Try again.\n");
+            fileopen_name[0] = EOS;
+        }
+    }
+    return fp;
+}
+
+
+#ifdef MACINTOSH
+
+static int GetReadFileName(name)
+char *name;
+{
+    static Point p = {100,100};
+    SFReply loadfile;
+    SFTypeList mytypes;
+    
+    mytypes[0] = 0x54455854; /* 'TEXT' */
+    mytypes[1] = 0x4D696469; /* 'Midi' */
+    mytypes[2] = 0x3F3F3F3F; /* '????' */
+/* could put any filter here (i.e. giofilefileter) */
+    SFGetFile(p, "\p", NULL, 3, mytypes, 0L, &loadfile); 
+    if (loadfile.good) {
+        SetVol(0L,loadfile.vRefNum); 
+        PtoC_StrCopy((char *) &loadfile.fName, name);
+        return(true);
+    } else return(false);
+}
+
+
+static int GetWriteFileName(fn, str)
+char *fn, *str;
+{
+        static Point SFPwhere = { 106, 104 };
+        unsigned char Pstr[100], Pfn[100];
+        SFReply reply;
+ 
+        strcpy((char *)Pstr, str);
+        CtoPstr((char *)Pstr);
+        strcpy((char *)Pfn, fn);
+        CtoPstr((char *)Pfn);
+
+        SFPutFile(SFPwhere, (ConstStr255Param) Pstr, (ConstStr255Param) Pfn,
+                  0L, &reply);
+        if (reply.good) {
+                SetVol (0L,reply.vRefNum);
+                PtoC_StrCopy((char *) &reply.fName, fn); 
+                return(true);
+        }
+        else return(false);
+}
+
+
+void PtoC_StrCopy(p1, p2)
+  register char *p1, *p2;
+/* copies a pascal string from p1 to p2 */
+{
+        register int len;
+        
+        len = *p1++;
+        while (--len>=0) *p2++=*p1++;
+        *p2 = '\0';
+}
+
+
+boolean get_file_info(char *filename, OSType *file_type, OSType *file_creator)
+{
+    short rc;           /* toolbox return code */
+    FInfo fi;           /* toolbox file info */
+    char fn[101];       /* temporary file name */
+
+    strcpy(fn, filename);
+    CtoPstr(fn);
+    if (rc = GetFInfo((byte*)fn, 0, &fi)) {
+        gprintf(ERROR, "rc from GetFInfo=%d\n", rc);
+        gprintf(ERROR, "unable to get file type\n");
+        *file_type = 0x3F3F3F3F; /* '????' */
+        *file_creator = 0x3F3F3F3F; /* '????' */
+        return FALSE;
+    } else /* set file type & creator */ {
+        if (debug) gprintf(TRANS, "File Type: '%.4s'  File Creator: '%.4s'\n",
+                           &fi.fdType, &fi.fdCreator );
+        *file_type = fi.fdType;
+        *file_creator = fi.fdCreator;
+    }
+    return TRUE;
+}
+
+
+boolean put_file_info(char *filename, OSType file_type, OSType file_creator)
+{
+    short rc;           /* toolbox return code */
+    FInfo fi;           /* toolbox file info */
+    char fn[101];       /* temporary file name */
+
+    if (debug) gprintf(TRANS,"set file %s to become type '%.4s'\n", filename, &file_type);
+    strcpy(fn, filename);
+    CtoPstr(fn);
+    if (rc = GetFInfo((byte*)fn, 0, &fi)) {
+        gprintf(TRANS, "rc from GetFInfo=%d\n", rc);
+        gprintf(TRANS, "unable to set file type\n");
+    } else /* set file type & creator */ {
+        if (debug) gprintf(TRANS, "File Type: '%.4s'  File Creator: '%.4s'\n",
+                           &fi.fdType, &fi.fdCreator );
+        fi.fdType = file_type;
+        fi.fdCreator = file_creator;
+        if (rc=SetFInfo((byte*)fn, 0, &fi)) {
+            gprintf(TRANS, "rc from SetFInfo=%d\n", rc);
+            gprintf(TRANS, "unable to set file type\n");
+        } else if (rc=GetFInfo((byte*)fn, 0, &fi)) {
+            gprintf(TRANS, "rc from GetFInfo=%d\n", rc);
+            gprintf(TRANS, "unable to verify file type\n");
+        } else {
+            if (debug) gprintf(TRANS, "File Type: '%.4s'  File Creator: '%.4s'\n",
+                               &fi.fdType, &fi.fdCreator );
+        }
+    }
+}
+#endif /* MACINTOSH */
+
+
+
+#ifdef AMIGA
+/***************************************************************
+*                           ascii_signal
+*
+* Input : none
+* Ouput : none
+* Return: the signal that will be raised on ascii input
+* Effect: none
+***************************************************************/
+
+UBYTE ascii_signal()
+{
+    return ConInPort->mp_SigBit;
+}
+#endif
+
+/* check_aborted -- see if any characters are available, check for ctrl C */
+
+int check_aborted()
+{
+        char in_c;
+#ifdef AMIGA 
+    if (GetMsg(ConInPort)) {
+        in_c = KeyBuff[0];
+        if (in_c == '\r') in_c = '\n';
+#endif
+#ifndef AMIGA   /* DOS or MACINTOSH or UNIX */
+    if (type_ahead_count < type_ahead_max && ascii_input(&in_c)) {
+#endif
+        type_ahead[type_ahead_tail] = in_c;
+        if (in_c == ABORT_CHAR) abort_flag = ABORT_LEVEL;
+        else if (!abort_flag && in_c == BREAK_CHAR) 
+            abort_flag = BREAK_LEVEL;
+
+        /* go ahead and insert anything into buffer, including ^C, ^G: */
+        type_ahead_count++;
+        type_ahead_tail++;
+        if (type_ahead_tail == type_ahead_max) type_ahead_tail = 0;
+
+#ifdef AMIGA
+        if (type_ahead_count < type_ahead_max) ConRead();
+#endif
+    }
+    return abort_flag;
+}    
+
+
+/****************************************************************************
+*                   readln
+* Inputs:
+*    FILE * fp: File to read from
+* Effect: 
+*    Reads and discards characters until a newline is seen
+****************************************************************************/
+
+void readln(fp)
+  register FILE *fp;
+{
+    register int c;
+    while (((c = getc(fp)) != '\n') && (c != EOF)) ;
+}
+
+
+/****************************************************************************
+*                   gprintf
+* Inputs:
+*    int * handler: pointer to output handler (say, a window)
+*        or one of {TRANS, ERROR, FATAL, GDEBUG} from userio.h
+*    char * format: a null-terminated printf style format string
+*    int arg0 through arg14: a variable number of arguments for printf
+* Effect:
+*    formats and outputs the specified information to an output handler.
+*    this is a system-independent approach to output.  On
+*    a simple machine, it is like printf.  on a more complex machine,
+*    output is directed to the appropriate window.
+* Implementation
+*    Note that to handle the variable argument list, a number of different
+*    approaches are implemented.  The first part of the implementation selects
+*    one of 4 ways to build temp1, a formatted string.  The 4 ways arise from
+*    use or non-use of vsprintf, and use or non-use of ... in the arg list.
+*    After building temp1, non-Amiga systems write to stdout or stderr, 
+*    whereas AMIGA writes to a special console.  Why? Because the Amiga
+*    needs a new console so we can set up a signal upon character typein.
+****************************************************************************/
+
+#ifndef gprintf
+#define GPRINTF_MESSAGE_LEN 512
+#ifdef USE_VSPRINTF
+#ifdef DOTS_FOR_ARGS
+
+/* define with ... in arg list and use vsprintf to get temp1 */
+public void gprintf(long where, char *format, ...)
+{
+    char temp1[GPRINTF_MESSAGE_LEN];
+#ifdef AMIGA
+    char temp2[GPRINTF_MESSAGE_LEN];
+#endif
+    va_list ap;
+
+    va_start(ap, format);
+    vsprintf(temp1, format, ap);
+    va_end(ap);
+
+#else /* !DOTS_FOR_ARGS */
+
+/* define with va_alist and use vsprintf to get temp1 */
+public void gprintf(where, format, va_alist)
+long where;
+char *format;
+va_dcl
+{
+    char temp1[GPRINTF_MESSAGE_LEN];
+    va_list pvar;
+/* this is a syntax error - if you don't have to remove this, */
+/* then this whole section of code is unnecessary. */
+    va_start(pvar);
+    vsprintf(temp1, format, pvar);
+    va_end(pvar);
+
+#endif /* DOTS_FOR_ARGS */
+
+#else /* !USE_VSPRINTF */
+#define MAX_GPRINTF_ARGS 10
+typedef struct gp_args_struct {
+    long arg[MAX_GPRINTF_ARGS];
+} gp_args_node;
+
+#ifdef DOTS_FOR_ARGS
+/* use ... but not vsprintf */
+public void gprintf(long where, char *format, ...)
+{
+    char temp1[GPRINTF_MESSAGE_LEN];
+#ifdef AMIGA
+    char temp2[GPRINTF_MESSAGE_LEN];
+#endif
+    va_list ap;
+    gp_args_node args;
+    va_start(ap, format);
+    args = va_arg(ap, gp_args_node);
+    va_end(ap);
+#else /* !DOTS_FOR_ARGS */
+/* don't use ... and don't use vsprintf */
+public void gprintf(where, format, args)
+  long where;
+  char *format;
+  gp_args_node args;
+{
+    char temp1[GPRINTF_MESSAGE_LEN];
+#ifdef AMIGA
+    char temp2[GPRINTF_MESSAGE_LEN];
+#endif /* AMIGA*/
+#endif /* DOTS_FOR_ARGS */
+
+    sprintf(temp1, format, args);
+
+#endif /* USE_VSPRINTF */
+
+/*
+ * Now we've got formatted output in temp1.  Write it out.
+ */
+#ifdef NYQUIST
+    switch ((long) where) {
+      case TRANS:
+          stdputstr(temp1);
+          break;
+      case ERROR:
+        errputstr(temp1);
+        break;
+      case FATAL:
+        errputstr("FATAL: ");
+        errputstr(temp1);
+        break;
+      case GDEBUG:
+        errputstr("DEBUG: ");
+        errputstr(temp1);
+        break;
+      default:
+        errputstr("UNKNOWN: ");
+        errputstr(temp1);
+        break;
+    }
+    gflush();
+#else /* not NYQUIST */
+#ifdef AMIGA
+
+    switch((long) where) {
+      case TRANS:
+        strcpy(temp2, temp1);
+        break;
+      case ERROR:
+        strcpy(temp2, temp1);
+        break;
+      case FATAL:
+        strcpy(temp2, "FATAL: ");
+        strcat(temp2, temp1);
+        break;
+      case GDEBUG:
+        strcpy(temp2,"DEBUG: ");
+        strcat(temp2, temp1);
+        break;
+      default:
+        strcpy(temp2, "UNKNOWN: ");
+        strcat(temp2, temp1);
+        break;
+    }
+    ConOutReq->io_Command = CMD_WRITE;
+    ConOutReq->io_Data = (APTR)temp2;
+    ConOutReq->io_Length = -1;   /* NULL terminated string */
+    DoIO((struct IORequest *) ConOutReq);            
+#else /* not NYQUIST or AMIGA */
+    switch(where) {
+      case TRANS:
+        printf("%s", temp1);
+        break;
+      case ERROR:
+        fprintf(STDERR, "%s", temp1);
+        break;
+      case GDEBUG:
+        fprintf(STDERR, "DEBUG %s", temp1);
+        break;
+      case FATAL:
+        fprintf(STDERR, "FATAL %s", temp1);
+        break;
+      default:
+        fprintf(STDERR, "UNKNOWN %s", temp1);
+        break;
+    }
+#endif /* AMIGA */
+#endif /* NYQUIST */
+}
+
+#endif  /* ifndef gprintf */
+
+
+/**************************************************************************
+*                               gputchar
+* General putchar
+**************************************************************************/
+
+#ifndef gputchar
+
+#ifdef AMIGA
+public int gputchar(c)
+int c;
+{
+    ConPutChar((char)c);
+    return(c);
+}
+#else
+public int gputchar(c)
+int c;
+{
+    putchar((char)c);
+    return(c);
+}
+#endif
+
+#endif  /* ifndef gputchar */
+
+/**************************************************************************
+*                               ggetchar
+* General getchar
+**************************************************************************/
+
+public int ggetchar()
+{
+#ifdef BUFFERED_SYNCHRONOUS_INPUT
+    return getchar();
+#else
+    int key = wait_ascii();
+    if (key != ABORT_CHAR && key != '\b') gputchar((char)key);
+    return(key);
+#endif
+}
+
+
+/**************************************************************************
+*                                  ggets
+* General gets
+**************************************************************************/
+
+
+#ifndef ggets
+
+public char *ggets(str)
+  char *str;
+{
+    char *s = str;
+    int c;
+
+    do {
+        c = ggetchar();
+        if (c == '\b' /* backspace */) {
+            if (s != str) {
+                gputchar('\b');
+                gputchar((int)' ');
+                gputchar('\b');
+                s--;
+            } else {
+#ifdef AMIGA
+                gputchar((int)0x9b);
+                gputchar((int)0x43);
+#else
+                /* gputchar((int)' '); */
+#endif
+                gputchar((int)0x07);
+            }
+        } else *s++ = (char) c;
+    } while (c != (int) '\n' && !abort_flag);
+
+    *(s-1) = EOS;
+    if (abort_flag) *str = EOS;
+    return str;
+}
+
+#endif  /* ifndef ggets */
+
+
+/****************************************************************************
+*                 get_ascii
+* Returns:
+*    boolean: TRUE if a character was found
+*    int * c: pointer to int into which to store the character, if any
+* Effect:
+*    polls (doesn't wait) for an ascii character and says if it got one
+*    the character is returned in *c.
+****************************************************************************/
+
+public boolean get_ascii(c)
+  char *c;
+{
+    check_aborted(); /* input buffer check */
+    if (type_ahead_count == 0) return FALSE;
+#ifdef AMIGA
+    /* if the buffer is full, then there is no outstanding read, restart it: */
+    if (type_ahead_count == type_ahead_max) ConRead();
+#endif
+    type_ahead_count--;
+    *c = type_ahead[type_ahead_head++];
+    if (type_ahead_head == type_ahead_max) type_ahead_head = 0;
+    return TRUE;
+}
+
+#ifdef MACINTOSH  /** Macintosh direct ascii input**/
+public boolean ascii_input(c)
+char *c;
+{
+    EventRecord theEvent;
+
+    (void) GetNextEvent((keyDownMask | autoKeyMask), &theEvent);
+    if ((theEvent.what == keyDown) || (theEvent.what == autoKey)) {
+        *c = theEvent.message & charCodeMask;
+        if (*c == '\r') *c = '\n';
+        return(true);
+    } 
+    else {
+        return(false);
+    }
+}
+#endif
+
+#ifdef WINDOWS
+#include "conio.h"
+#define kbhit _kbhit
+#define getch _getch
+#endif
+
+#ifdef DOS
+public boolean ascii_input(c)
+char *c;
+{
+    if (abort_flag == ABORT_LEVEL) {
+            *c=ABORT_CHAR;
+        return((boolean)TRUE);
+    }
+    if (kbhit()) {              /* If the keyboard was hit */
+        *c = getch();           /* Don't echo it */
+//      printf("now break");
+        if (*c == '\r') *c = '\n';
+        return((boolean)TRUE);
+    }
+    return((boolean)FALSE);     /* Keeps Lattice compiler happy */
+}
+#endif
+
+#ifdef UNIX
+public boolean ascii_input(c)
+char *c;
+{
+#ifdef UNIX_MACH
+        /*
+         * we can't read from stdin directly, because the ascii
+         * input thread is already doing so, so instead we'll
+         * wait for that thread to read a character and then take
+         * it
+         */
+        boolean ret = FALSE;
+
+        A_LOCK();
+                if (a_in_flag) {
+                        (*c) = a_in;
+                        a_in_flag = 0;
+                        ret = TRUE;
+                }
+        A_UNLOCK();
+        if (ret) {
+#ifdef RTMach
+                itc_condition_signal(&a_cond);
+#else /* RTMach */
+                condition_signal(&a_cond);
+#endif /* RTMach */
+        }
+        if ((*c) == '\r')
+                (*c) = '\n';
+        return(ret);
+#else /* UNIX_MACH */
+#ifndef BUFFERED_SYNCHRONOUS_INPUT
+    int input = IOgetchar();
+    if (input != IOnochar) {
+        *c = input;
+        if (*c == '\r') *c = '\n';
+        return TRUE;
+    }
+#endif /* BUFFERED_SYNCHRONOUS_INPUT */
+    return FALSE;
+#endif /* UNIX_MACH */
+}
+#endif
+
+#ifndef AMIGA /*DOS and MAC and UNIX */
+public void unget_ascii(char c)
+{
+        if (type_ahead_head == 0) type_ahead_head = type_ahead_max;
+        type_ahead_head--;
+        type_ahead[type_ahead_head] = c;
+        type_ahead_count++;
+}
+
+
+public boolean check_ascii()
+{
+        char c;
+        
+        if(get_ascii(&c)) {
+                unget_ascii(c);
+                return TRUE;
+        }
+        else return FALSE;
+}
+#endif
+
+
+/****************************************************************************
+*                   wait_ascii
+* Returns:
+*    int: character for key pressed
+* Effect:
+*    waits for the user to type a key on the terminal keyboard
+*    (versus the synthesizer keyboard) and returns the key typed
+****************************************************************************/
+
+#ifdef MACINTOSH
+public int wait_ascii()
+{
+    char key ;    /* key typed */
+
+    if (abort_flag == ABORT_LEVEL) return ABORT_CHAR;
+    if (abort_flag == BREAK_LEVEL) return BREAK_CHAR;
+    gflush();
+    while (!get_ascii(&key)) ;
+    return(key); 
+}
+#endif
+
+#ifdef DOS
+public int wait_ascii()
+{
+    char key ;    /* key typed */
+
+    if (abort_flag == ABORT_LEVEL) return ABORT_CHAR;
+    if (abort_flag == BREAK_LEVEL) return BREAK_CHAR;
+    if (!get_ascii(&key)) {
+        key = _getch(); // block until we get an input
+    }
+    /* GWL - check for abort on previos line */
+    return (int)key; 
+}
+#endif
+
+#ifndef MACINTOSH
+#ifndef DOS
+public int wait_ascii()
+{
+#ifdef UNIX /* was defined (UNIX) || defined(ITC) */
+#ifndef UNIX_MACH
+        fd_set readfds;
+#endif /* !UNIX_MACH */
+#endif
+    char c;
+
+    if (abort_flag == ABORT_LEVEL) return ABORT_CHAR;
+    if (abort_flag == BREAK_LEVEL) return BREAK_CHAR;
+    while (!get_ascii(&c)) {
+#ifdef AMIGA
+        WaitPort(ConInPort);
+#endif
+#ifdef UNIX
+        fflush(stdout);
+#ifdef UNIX_MACH
+        /*
+         * we can't select, since another thread is reading
+         * from stdin, and we don't want to have an input war
+         * so instead, the ascii input thread will signal
+         * a_in_cond when it gets input, so we just wait
+         * for that to happen
+         */
+        A_LOCK();
+#ifdef RTMach
+                itc_condition_wait(&a_in_cond, &a_mutex);
+#else /* RTMach */
+                condition_wait(&a_in_cond, &a_mutex);
+#endif /* RTMach */
+        A_UNLOCK();
+#else /* UNIX_MACH */
+        FD_ZERO(&readfds);
+        FD_SET(IOinputfd, &readfds);
+        gflush();
+        select(NOFILE+1, &readfds, 0, 0, NULL);
+#endif /* !UNIX_MACH */
+#endif /* ifdef UNIX */
+    }
+    return (int) c;
+}
+#endif
+#endif
+
+#ifdef AMIGA
+/******************************************************************
+                              AMIGA 2000.
+                         Console IO Functions
+                             JCD 25-Apr-88
+*******************************************************************/
+
+UBYTE KeybSig()
+{
+    return ConInPort->mp_SigBit;
+}
+
+private void ConPutChar(c)
+char c;
+{
+    ConOutReq->io_Command = CMD_WRITE;
+    ConOutReq->io_Data = (APTR)&c;
+    ConOutReq->io_Length = 1;
+    DoIO((struct IORequest *) ConOutReq);
+}
+
+private void ConPutStr(str)
+char *str;
+{
+    ConOutReq->io_Command = CMD_WRITE;
+    ConOutReq->io_Data = (APTR)str;
+    ConOutReq->io_Length = -1;
+    DoIO((struct IORequest *) ConOutReq);
+}
+
+private void ConRead()
+{
+    ConInReq->io_Command = CMD_READ;
+    ConInReq->io_Data = (APTR)KeyBuff;
+    ConInReq->io_Length = 1;
+    SendIO((struct IORequest *) ConInReq);
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/cmt/userio.h b/lib-src/libnyquist/nyquist/cmt/userio.h
new file mode 100644
index 0000000..7c05e96
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/cmt/userio.h
@@ -0,0 +1,96 @@
+/* Copyright 1989 Carnegie Mellon University */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+* 5-Apr |JDW : Further changes
+*****************************************************************************/
+
+/* classes of output for gprintf */
+#ifdef MACINTOSH
+#undef false
+#undef true
+#include <MacTypes.h>
+#define TRANS    (long)    0
+#define ERROR    (long)    1
+#define FATAL    (long)    2
+#define GDEBUG   (long)    3
+#endif
+
+#ifdef  DONT_USE_CMT_IO
+#define TRANS   stdout
+#define ERROR   stdout
+#define FATAL   stdout
+#define GDEBUG   stdout
+#endif
+
+#ifndef TRANS   /* default */
+#define TRANS   0
+#define ERROR   1
+#define FATAL   2
+#define GDEBUG   3
+#endif
+
+#define CR '\n'
+#define ABORT_CHAR 0x03
+#ifdef NYQUIST
+#define BREAK_CHAR 0x02
+#else
+#define BREAK_CHAR 0x07
+#endif
+
+#define BREAK_LEVEL 1
+#define ABORT_LEVEL 2
+
+#define read_to_eol(ch) if (ch != CR) { char temp[100]; ggets(temp); }
+
+extern char fileopen_name[];
+extern int abort_flag;
+extern int redirect_flag;		/* added by Ning Hu, Apr 2001 */
+
+boolean get_ascii(char *c);    /* polls for an ascii character */
+#ifdef DOTS_FOR_ARGS
+/* was (defined(ITC_MACH) && defined(__STDC__)) || defined(MACINTOSH) || defined(AZTEC) || (defined(AMIGA) && defined(LATTICE)) || defined(UNIX_ITC) */
+void    gprintf(long where, char *format, ...); /* general printf */
+#else
+void gprintf();
+#endif
+
+char    *ggets(char *str);       /* general gets */
+int     wait_ascii(void);   /* a waiting version of get_ascii */
+void    clean_exit(void);   /* exit the program after cleaning up */
+void    io_init(void);      /* overall initialization */
+void    abort_check(void);  /* exit if aborted */
+
+int check_aborted(void);        /* looks to see if user typed ctrl-C */
+
+int     askbool(char *prompt, int deflt);
+FILE    *fileopen(char *deflt, char *extension, char *mode, char *prompt);
+void    readln(FILE *fp);
+void gflush(void);
+int gputchar(int c);
+int ggetchar();
+char *ggets(char *str);
+boolean ascii_input(char *c);
+void unget_ascii(char c);
+boolean check_ascii(void);
+
+#ifdef MACINTOSH
+boolean get_file_info(char *filename, OSType *file_type, OSType *file_creator);
+boolean put_file_info(char *filename, OSType file_type, OSType file_creator);
+#endif
+
+#ifdef DONT_USE_CMT_IO
+#define ggetchar        getchar
+#define ggets           gets
+#define gprintf         fprintf
+#define gputchar        putchar
+#define gprintf fprintf
+#define gputchar putchar
+#endif
+
+#ifdef MICROSOFT
+void c_break(int sig);
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dTest.c b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dTest.c
new file mode 100644
index 0000000..37213e6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dTest.c
@@ -0,0 +1,116 @@
+/*  A program to test fast 2d real convolution	*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "fft2d.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+//#define	BIPRAND(a) round(100*(2.0/(RAND_MAX+1.0)*a-1.0))
+
+void main(){
+long 	N = 256;	/* the number of cols in 2d ffts, must be power of 2 */
+long 	N2 = 64;	/* the number of rows in 2d ffts, must be power of 2 */
+long 	kernSize = 53;	/* kernal cols must be less than N */
+long 	kernSize2 = 29;	/* kernal rows must be less than N2*/
+long 	dataSize = N-kernSize+1;	/* data cols */
+long 	dataSize2 = N2-kernSize2+1;	/* data rows */
+float	*a;
+float	*b;
+long 	i1;
+long 	i2;
+long 	TheErr;
+long		M;
+long		M2;
+
+FILE *fdataout;				/* output file */
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+printf(" randseed = %10u\n", randseed);
+
+srand(randseed);
+M = roundtol(LOG2(N));
+N = POW2(M);
+M2 = roundtol(LOG2(N2));
+N2 = POW2(M2);
+
+printf("fft size = %6d X%6d,  ", N2, N);
+
+if ((dataSize <= 0)||(dataSize2 <= 0)) TheErr = 22;
+else TheErr = 0;
+
+if(!TheErr){
+	TheErr = fft2dInit(M2, M);
+}
+
+a = (float *) calloc(N2*N,sizeof(float) );	// calloc to zero pad data to fill N to N2
+if (a == 0) TheErr = 2;
+if(!TheErr){
+	b = (float *) calloc(N2*N,sizeof(float) );	// calloc to zero pad data to fill N to N2
+	if (b == 0) TheErr = 2;
+}
+if(!TheErr){
+	fdataout = fopen("conv2ddat.c2d", "wb");
+	if (fdataout == NULL) TheErr = -50;
+}
+if(!TheErr){
+
+		/*  write sizes to fdataout */
+	fwrite(&dataSize, sizeof(dataSize), 1, fdataout);
+	fwrite(&dataSize2, sizeof(dataSize2), 1, fdataout);
+	fwrite(&kernSize, sizeof(kernSize), 1, fdataout);
+	fwrite(&kernSize2, sizeof(kernSize2), 1, fdataout);
+		/*  set up a simple test case and write to fdataout */
+	for (i2=0; i2<dataSize2; i2++){
+		for (i1=0; i1<dataSize; i1++){
+			rannum = rand();
+			a[i2*N+i1] = BIPRAND(rannum);
+		}
+		fwrite(&a[i2*N], dataSize*sizeof(float), 1, fdataout);
+	}
+	for (i2=0; i2<kernSize2; i2++){
+		for (i1=0; i1<kernSize; i1++){
+			rannum = rand();
+			b[i2*N+i1] = BIPRAND(rannum);
+		}
+		fwrite(&b[i2*N], kernSize*sizeof(float), 1, fdataout);
+	}
+
+	/* fast 2d convolution of zero padded sequences */
+	rfft2d(a, M2, M);
+	rfft2d(b, M2, M);
+	rspect2dprod(a, b, a, N2, N);
+	rifft2d(a, M2, M);
+
+	/* write out answer */
+	fwrite(a, N2*N*sizeof(float), 1, fdataout);
+
+	fclose(fdataout);
+
+	free(b);
+	free(a);
+	fft2dFree();
+}
+else{
+	if(TheErr==2)	printf(" out of memory \n");
+	else	printf(" error \n");
+	fft2dFree();
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dtest.m b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dtest.m
new file mode 100644
index 0000000..5439ba1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/conv2dtest.m
@@ -0,0 +1,25 @@
+% program to test 2d real fast conv
+
+% let user select file then open it
+[fname, pname] = uigetfile('*.c2d', 'select conv file');
+cd(pname);
+fidout=fopen(fname,'r');
+
+% read header info
+aN=fread(fidout,1,'long');
+aM=fread(fidout,1,'long');
+bN=fread(fidout,1,'long');
+bM=fread(fidout,1,'long');
+% read in data
+%status=fseek(fidout,Nheader,'bof');
+a=fread(fidout,aN*aM,'float');
+a=reshape(a,aN,aM);
+b=fread(fidout,bN*bM,'float');
+b=reshape(b,bN,bM);
+c=fread(fidout,(aN+bN-1)*(aM+bM-1),'float');
+c=reshape(c,(aN+bN-1),(aM+bM-1));
+fclose(fidout);
+
+c2=conv2(a,b);
+
+max(max(abs(c2-c)))
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convTest.c b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convTest.c
new file mode 100644
index 0000000..ee34475
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convTest.c
@@ -0,0 +1,113 @@
+/*  A program to test fast 1d real convolution	*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+//#define	BIPRAND(a) round(100*(2.0/(RAND_MAX+1.0)*a-1.0))
+
+void main(){
+const long N2 = 2;		/* the number ffts to test */
+long 	N = 2048;		/* size of FFTs, must be power of 2 */
+long 	kernSize = 1003;	/* kernal size must be less than N */
+long 	dataSize = N-kernSize+1;	/* data size */
+float	*a;
+float	*b;
+long 	i1;
+long 	i2;
+long 	TheErr;
+long		M;
+
+FILE *fdataout;				/* output file */
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+printf(" randseed = %10u\n", randseed);
+
+srand(randseed);
+M = roundtol(LOG2(N));
+N = POW2(M);
+
+printf("fft size = %6d,  ",  N);
+
+if (dataSize <= 0) TheErr = 22;
+else TheErr = 0;
+
+if(!TheErr){
+	TheErr = fftInit(M);
+}
+
+a = (float *) calloc(N2*N,sizeof(float) );	// calloc to zero pad data to fill N
+if (a == 0) TheErr = 2;
+if(!TheErr){
+	b = (float *) calloc(N2*N,sizeof(float) );	// calloc to zero pad data to fill N
+	if (b == 0) TheErr = 2;
+}
+if(!TheErr){
+	fdataout = fopen("convdat.cnv", "wb");
+	if (fdataout == NULL) TheErr = -50;
+}
+if(!TheErr){
+
+		/*  write sizes to fdataout */
+	fwrite(&dataSize, sizeof(dataSize), 1, fdataout);
+	fwrite(&kernSize, sizeof(kernSize), 1, fdataout);
+	fwrite(&N2, sizeof(N2), 1, fdataout);
+		/*  set up a simple test case and write to fdataout */
+	for (i2=0; i2<N2; i2++){
+		for (i1=0; i1<dataSize; i1++){
+			rannum = rand();
+			a[i2*N+i1] = BIPRAND(rannum);
+		}
+		fwrite(&a[i2*N], dataSize*sizeof(float), 1, fdataout);
+	}
+	for (i2=0; i2<N2; i2++){
+		for (i1=0; i1<kernSize; i1++){
+			rannum = rand();
+			b[i2*N+i1] = BIPRAND(rannum);
+		}
+		fwrite(&b[i2*N], kernSize*sizeof(float), 1, fdataout);
+	}
+
+
+	/* fast convolution of zero padded sequences */
+	rffts(a, M, N2);
+	rffts(b, M, N2);
+	for (i2=0; i2<N2*N; i2+=N){
+		rspectprod(&a[i2], &b[i2], &a[i2], N);
+	}
+	riffts(a, M, N2);
+
+	/* write out answer */
+	fwrite(a, N2*N*sizeof(float), 1, fdataout);
+
+	fclose(fdataout);
+
+	free(b);
+	free(a);
+	fftFree();
+}
+else{
+	if(TheErr==2)	printf(" out of memory \n");
+	else	printf(" error \n");
+	fftFree();
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convtest.m b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convtest.m
new file mode 100644
index 0000000..b899911
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/convtest.m
@@ -0,0 +1,26 @@
+% program to test 1d real fast conv
+clear c2
+
+% let user select file then open it
+[fname, pname] = uigetfile('*.cnv', 'select conv file');
+cd(pname);
+fidout=fopen(fname,'r');
+
+% read header info
+aN=fread(fidout,1,'long');
+bN=fread(fidout,1,'long');
+M=fread(fidout,1,'long');
+% read in data
+%status=fseek(fidout,Nheader,'bof');
+a=fread(fidout,aN*M,'float');
+a=reshape(a,aN,M);
+b=fread(fidout,bN*M,'float');
+b=reshape(b,bN,M);
+c=fread(fidout,(aN+bN-1)*M,'float');
+c=reshape(c,(aN+bN-1),M);
+fclose(fidout);
+
+for i1=1:M;
+	c2(:,i1)=conv(a(:,i1),b(:,i1));
+end;
+max(max(abs(c2-c)))
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.c b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.c
new file mode 100644
index 0000000..2cb8d0f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.c
@@ -0,0 +1,102 @@
+/*  A program to test real 2d forward and inverse fast fourier transform routines	*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "fft2d.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+
+void main(){
+long 	N2 = 64;	/* the number of rows in 2d ffts, must be power of 2 */
+long 	N = 256;	/* the number of cols in 2d ffts, must be power of 2 */
+float	*a;
+float	maxerrfft;
+long 	i1;
+long 	TheErr;
+long		M;
+long		M2;
+
+FILE *fdataout;				/* output file */
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+printf(" randseed = %10u\n", randseed);
+
+srand(randseed);
+M = roundtol(LOG2(N));
+N = POW2(M);
+M2 = roundtol(LOG2(N2));
+N2 = POW2(M2);
+
+printf("fft size = %6d X%6d,  ", N2, N);
+
+TheErr = 0;
+
+if(!TheErr){
+	TheErr = fft2dInit(M2, M);
+}
+
+a = (float *) malloc(N2*N*sizeof(float) );
+if (a == 0) TheErr = 2;
+if(!TheErr){
+	fdataout = fopen("fftdat.dr2", "wb");
+	if (fdataout == NULL) TheErr = -50;
+}
+if(!TheErr){
+
+		/*  write sizes to fdataout */
+	fwrite(&N, sizeof(N), 1, fdataout);
+	fwrite(&N2, sizeof(N2), 1, fdataout);
+		/*  set up a simple test case and write to fdataout */
+	for (i1=0; i1<N2*N; i1++){
+		rannum = rand();
+		a[i1] = BIPRAND(rannum);
+	}
+	fwrite(a, N2*N*sizeof(float), 1, fdataout);
+
+	/* real, 2d fast fourier transform */
+	rfft2d(a, M2, M);
+
+	/* write out answer */
+	fwrite(a, N2*N*sizeof(float), 1, fdataout);
+	fclose(fdataout);
+
+	/* compute and check inverse transform */
+	rifft2d(a, M2, M);
+
+	maxerrfft = 0;
+	srand(randseed);
+	for (i1=0; i1<N2*N; i1++){
+		rannum = rand();
+		maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a[i1]));
+	}
+
+	printf("maxerr rfft = %6.4e\n", maxerrfft);
+
+	free(a);
+	fft2dFree();
+}
+else{
+	if(TheErr==2)	printf(" out of memory \n");
+	else	printf(" error \n");
+	fft2dFree();
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.m b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.m
new file mode 100644
index 0000000..03ba5a2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Matlab-testing/rfft2dTestML.m
@@ -0,0 +1,39 @@
+% program to test 2d real fft
+
+% let user select file then open it
+[fname, pname] = uigetfile('*.dr2', 'select conv file');
+cd(pname);
+fidout=fopen(fname,'r');
+
+% read header info
+N=fread(fidout,1,'long');
+M=fread(fidout,1,'long');
+% read in data
+%status=fseek(fidout,Nheader,'bof');
+a=fread(fidout,N*M,'float');
+a=reshape(a,N,M);
+c=fread(fidout,N*M,'float');
+c=reshape(c,N,M);
+c=c(1:2:N,:)+j*c(2:2:N,:);
+fclose(fidout);
+
+c2=fft2(a);
+
+% Remember Matlab is column major order, C is row major order
+% Matlab starts with index of 1, f and k start at 0
+
+%%%% check the real transforms of DC and Nyquest frequencies
+% check the four real values
+maxerr=abs(real(c(1,1))-c2(1,1));					% 0 f, 0 k
+maxerr=max(maxerr,abs(imag(c(1,1))-c2(1,M/2+1)));	% 0 f, M/2 k
+maxerr=max(maxerr,abs(real(c(1,M/2+1))-c2(N/2+1,1)));% N/2 f, 0 k
+maxerr=max(maxerr,abs(imag(c(1,M/2+1))-c2(N/2+1,M/2+1)));% N/2 f, M/2 k
+%check the rest of the pos wavenumbers of DC and Nyquest frequencies
+maxerr=max(maxerr,max(abs(c(1,2:M/2)-c2(1,2:M/2))));	%f = 0, k=1 to M/2-1
+maxerr=max(maxerr,max(abs(c(1,M/2+2:M)-c2(N/2+1,2:M/2))));%f = N/2, k=1 to M/2-1
+%%%%
+
+% check all the other positive frequencies at all wavenumbers
+	% f from 1 to N/2-1, k from 0 to M-1 (wraps around through negative k)
+maxerr=max(maxerr,max(max(abs(c(2:N/2,:)-c2(2:N/2,:)))))
+
diff --git a/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest.c b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest.c
new file mode 100644
index 0000000..0cdca37
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest.c
@@ -0,0 +1,121 @@
+/*  A program to test complex forward and inverse fast fourier transform routines	*/
+
+#include <NR.H>	/* uses four1 from numerical recipes in C to verify iffts */
+			/*change fmin in numerical recipes to fminnr to avoid conflict with fp.h */
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 	24		/* the number of different fft sizes to test */
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+
+typedef  struct{
+	float Re;
+	float Im;
+	} Complex;
+
+void main(){
+long 	fftSize[NSIZES] = 	/* size of FFTs, must be powers of 2 */
+		{2, 		4, 		8, 		16, 		32, 		64, 		128, 	256,
+		512, 	1024, 	2048, 	4096, 	8192, 	16384, 	32768, 	65536,
+		131072, 	262144, 	524288, 	1048576, 	2097152, 	4194304, 	8388608, 	16777216};
+Complex	*a1;
+const long N2 = 2;		/* the number ffts to test at each size */
+long 	isize;
+long 	i1;
+long 	TheErr;
+long		N;
+long		M;
+float 	maxerrifft;
+float 	maxerrfft;
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a1[0].Re));
+printf(" randseed = %10u\n", randseed);
+for (isize = 0; isize < NSIZES; isize++){
+
+	srand(randseed);
+	N = fftSize[isize];
+	printf("ffts size = %8d,  ", N);
+	M = roundtol(LOG2(N));
+
+	TheErr = fftInit(M);
+
+	if(!TheErr){
+		a1 = (Complex *) malloc( N2*N*sizeof(Complex) );
+		if (a1 == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a1 simple test case */
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+			/*  first use four1 from numerical recipes in C to verify iffts */
+			/*  Note their inverse fft is really the conventional forward fft */
+		for (i1=0; i1<N2; i1++){
+			four1((float *)(a1+i1*N)-1, N, -1);
+		}
+		iffts((float *)a1, M, N2);
+
+		maxerrifft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Im));
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+		printf("maxerrifft = %6.4e,  ", maxerrifft);
+
+			/*  now use iffts to verify ffts */
+		iffts((float *)a1, M, N2);
+		ffts((float *)a1, M, N2);
+
+		maxerrfft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Im));
+		}
+
+		printf("maxerrfft = %6.4e\n", maxerrfft);
+
+		free(a1);
+		fftFree();
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fftFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest2d.c b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest2d.c
new file mode 100644
index 0000000..8d22bdd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest2d.c
@@ -0,0 +1,130 @@
+/*  A program to test 2d complex forward and inverse fast fourier transform routines	*/
+
+#include <NR.H>	/* uses fourn from numerical recipes in C to verify ifft2d */
+			/*change fmin in numerical recipes to fminnr to avoid conflict with fp.h */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "fft2d.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 	24		/* the number of different ffts col sizes to test */
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+//#define	BIPRAND(a) round(100*(2.0/(RAND_MAX+1.0)*a-1.0))
+typedef  struct{
+	float Re;
+	float Im;
+	} Complex;
+
+void main(){
+long 	fftSize[NSIZES] = 	/* size of FFTs cols, must be powers of 2 */
+		{2, 		4, 		8, 		16, 		32, 		64, 		128, 	256,
+		512, 	1024, 	2048, 	4096, 	8192, 	16384, 	32768, 	65536,
+		131072, 	262144, 	524288, 	1048576, 	2097152, 	4194304, 	8388608, 	16777216};
+Complex	*a1;
+long	N2 = 64;	/* the number of rows in the 2d fft */
+long 	isize;
+long 	i1;
+long 	TheErr;
+long	N;
+long	M;
+long	M2;
+float 	maxerrifft;
+float 	maxerrfft;
+unsigned long 	nn[2];
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a1[0].Re));
+printf(" randseed = %10u\n", randseed);
+for (isize = 0; isize < NSIZES; isize++){
+
+	srand(randseed);
+	N = fftSize[isize];
+	M = roundtol(LOG2(N));
+	N = POW2(M);
+	M2 = roundtol(LOG2(N2));
+	N2 = POW2(M2);
+
+	printf("ffts size = %6d X%6d,  ", N2, N);
+
+	nn[0] = N2;
+	nn[1] = N;
+	
+	TheErr = fft2dInit(M2, M);
+
+	if(!TheErr){
+		a1 = (Complex *) malloc(N2*N*sizeof(Complex) );
+		if (a1 == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a simple test case */
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+			/*  first use fourn from numerical recipes in C to verify ifft2d */
+			/*  Note their inverse fft is really the conventional forward fft */
+		fourn((float *)a1-1, nn-1, 2, -1);
+
+		ifft2d((float *)a1, M2, M);
+
+		maxerrifft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Im));
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+		printf("maxerrifft = %6.4e,  ", maxerrifft);
+
+			/*  now use iffts to verify ffts */
+		ifft2d((float *)a1, M2, M);
+		fft2d((float *)a1, M2, M);
+
+		maxerrfft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Im));
+		}
+
+		printf("maxerrfft = %6.4e\n", maxerrfft);
+
+		free(a1);
+		fft2dFree();
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fft2dFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest3d.c b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest3d.c
new file mode 100644
index 0000000..0624ebe
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/fftTest3d.c
@@ -0,0 +1,135 @@
+/*  A program to test 3d complex forward and inverse fast fourier transform routines	*/
+
+#include <NR.H>	/* uses fourn from numerical recipes in C to verify ifft3d */
+			/*change fmin in numerical recipes to fminnr to avoid conflict with fp.h */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "fft2d.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 	24		/* the number of different ffts col sizes to test */
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+
+typedef  struct{
+	float Re;
+	float Im;
+	} Complex;
+
+void main(){
+long 	fftSize[NSIZES] = 	/* size of FFTs cols, must be powers of 2 */
+		{2, 		4, 		8, 		16, 		32, 		64, 		128, 	256,
+		512, 	1024, 	2048, 	4096, 	8192, 	16384, 	32768, 	65536,
+		131072, 	262144, 	524288, 	1048576, 	2097152, 	4194304, 	8388608, 	16777216};
+Complex	*a1;
+long 	isize;
+long 	i1;
+long 	TheErr;
+long		N;
+long		M;
+long		N2 = 16;	/* the number of rows in the 3d fft */
+long		M2;
+long		N3 = 32;	/* the number of pages in the 3d fft */
+long		M3;
+float 	maxerrifft;
+float 	maxerrfft;
+unsigned long 	nn[3];
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a1[0].Re));
+printf(" randseed = %10u\n", randseed);
+for (isize = 0; isize < NSIZES; isize++){
+
+	srand(randseed);
+	N = fftSize[isize];
+	M = roundtol(LOG2(N));
+	N = POW2(M);
+	M2 = roundtol(LOG2(N2));
+	N2 = POW2(M2);
+	M3 = roundtol(LOG2(N3));
+	N3 = POW2(M3);
+
+	printf("ffts size = %5d X%5d X%6d,  ", N3, N2, N);
+
+	nn[0] = N3;
+	nn[1] = N2;
+	nn[2] = N;
+	
+	TheErr = fft3dInit(M3, M2, M);
+
+	if(!TheErr){
+		a1 = (Complex *) malloc(N3*N2*N*sizeof(Complex) );
+		if (a1 == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a simple test case */
+		for (i1=0; i1<N3*N2*N; i1++){
+			rannum = rand();
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+			/*  first use fourn from numerical recipes in C to verify ifft3d */
+			/*  Note their inverse fft is really the conventional forward fft */
+		fourn((float *)a1-1, nn-1, 3, -1);
+
+		ifft3d((float *)a1, M3, M2, M);
+
+		maxerrifft = 0;
+		srand(randseed);
+		for (i1=0; i1<N3*N2*N; i1++){
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			a1[i1].Re = BIPRAND(rannum);
+			rannum = rand();
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a1[i1].Im));
+			a1[i1].Im = BIPRAND(rannum);
+		}
+
+		printf("errifft = %4.3e,  ", maxerrifft);
+
+			/*  now use iffts to verify ffts */
+		ifft3d((float *)a1, M3, M2, M);
+		fft3d((float *)a1, M3, M2, M);
+
+		maxerrfft = 0;
+		srand(randseed);
+		for (i1=0; i1<N3*N2*N; i1++){
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Re));
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a1[i1].Im));
+		}
+
+		printf("errfft = %4.3e\n", maxerrfft);
+
+		free(a1);
+		fft3dFree();
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fft3dFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest.c b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest.c
new file mode 100644
index 0000000..b5e6c92
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest.c
@@ -0,0 +1,121 @@
+/*  A program to test real forward and inverse fast fourier transform routines	*/
+
+#include <NR.H>	/* uses realft from numerical recipes in C to verify riffts */
+			/*change fmin in numerical recipes to fminnr to avoid conflict with fp.h */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 	24		/* the number of different fft sizes to test */
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+
+void main(){
+long 	fftSize[NSIZES] = 	/* size of FFTs, must be powers of 2 */
+		{2,		4, 		8,		16, 		32, 		64, 		128, 	256,
+		512, 	1024, 	2048, 	4096, 	8192, 	16384, 	32768, 	65536,
+		131072, 	262144, 	524288, 	1048576, 	2097152, 	4194304, 	8388608, 	16777216};
+float	*a;
+const long N2 = 2;		/* the number ffts to test at each size */
+long 	isize;
+long 	i1;
+long 	i2;
+long 	TheErr;
+long		N;
+long		M;
+float 	maxerrifft;
+float 	maxerrfft;
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+printf(" randseed = %10u\n", randseed);
+for (isize = 0; isize < NSIZES; isize++){
+
+	srand(randseed);
+	N = fftSize[isize];
+	printf("rffts size = %8d,  ", N);
+	M = roundtol(LOG2(N));
+
+	TheErr = 0;
+	TheErr = fftInit(M);
+
+	if(!TheErr){
+		a = (float *) malloc(N2*N*sizeof(float) );
+		if (a == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a simple test case */
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a[i1] = BIPRAND(rannum);
+		}
+
+			/*  first use realft from numerical recipes in C to verify riffts */
+			/*  unfortunately  numerical recipes in C uses backwards time */
+			/*  forward fft, so our answer comes out time reversed */
+		for (i2=0; i2<N2; i2++){
+			realft((a+i2*N)-1, N, 1);
+		}
+		riffts(a, M, N2);
+
+		srand(randseed);
+		for (i2=0; i2<N2; i2++){
+			rannum = rand();
+			maxerrifft = fabs(BIPRAND(rannum)-a[i2*N]);
+			for (i1=1; i1<N; i1++){
+				rannum = rand();
+				maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a[i2*N+N-i1]));
+			}
+		}
+
+		printf("maxerrifft = %6.4e,  ", maxerrifft);
+
+			/*  now use iffts to verify ffts */
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a[i1] = BIPRAND(rannum);
+		}
+
+		riffts(a, M, N2);
+		rffts(a, M, N2);
+
+		maxerrfft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a[i1]));
+		}
+
+		printf("maxerrfft = %6.4e\n", maxerrfft);
+
+		fftFree();
+		free(a);
+		a = 0;
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fftFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest2d.c b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest2d.c
new file mode 100644
index 0000000..123746c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Numerical-Recipes-testing/rfftTest2d.c
@@ -0,0 +1,158 @@
+/*  A program to test real 2d forward and inverse fast fourier transform routines	*/
+
+#include <NR.H>	/* uses rlft3 from numerical recipes in C to verify rifft2d */
+			/*change fmin in numerical recipes to fminnr to avoid conflict with fp.h */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "fft2d.h"
+#include <NRUTIL.H>	// uses ugly tensors from numerical recipes; so can call rlft3
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 	24		/* the number of different ffts sizes to test */
+
+#define	BIPRAND(a) (2.0/(RAND_MAX+1.0)*a-1.0)
+
+void main(){
+long 	fftSize[NSIZES] = 	/* size of FFTs, must be powers of 2 */
+		{2,		4, 		8,		16, 		32, 		64, 		128, 	256,
+		512, 	1024, 	2048, 	4096, 	8192, 	16384, 	32768, 	65536,
+		131072, 	262144, 	524288, 	1048576, 	2097152, 	4194304, 	8388608, 	16777216};
+float	*a;
+long 	N2 = 64;	/* the number of rows in 2d ffts, must be power of 2 */
+long 	isize;
+long 	i1;
+long 	i2;
+long 	TheErr;
+long		N;
+long		M;
+long		M2;
+float 	maxerrifft;
+float 	maxerrfft;
+
+float	***NRtensdata;	/* needed for rlft3 */
+float	**NRmatdata;	/* needed for rlft3 */
+float	*specdata;	/* needed for rlft3 */
+float t1,t2;
+
+unsigned int	randseed = 777;
+int		rannum;
+#if macintosh
+	UnsignedWide 		TheTime1;
+	Microseconds(&TheTime1);
+	randseed = TheTime1.lo;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+printf(" randseed = %10u\n", randseed);
+for (isize = 0; isize < NSIZES; isize++){
+
+	srand(randseed);
+	N = fftSize[isize];
+	M = roundtol(LOG2(N));
+	N = POW2(M);
+	M2 = roundtol(LOG2(N2));
+	N2 = POW2(M2);
+
+	printf("rffts size = %6d X%6d,  ", N2, N);
+
+	TheErr = 0;
+	TheErr = fft2dInit(M2, M);
+
+	if(!TheErr){
+		NRmatdata=matrix(1,1,1,2*N2);
+		specdata = &NRmatdata[1][1];
+		NRtensdata=f3tensor(1,1,1,N2,1,N);	// uses ugly tensors from NRUTIL; so can call rlft3
+		a = &NRtensdata[1][1][1];
+		if ((a == 0)||(specdata == 0)) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a simple test case */
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a[i1] = BIPRAND(rannum);
+		}
+
+			/*  first use rlft3 from numerical recipes in C to verify rifft2d */
+			/*  unfortunately  numerical recipes in C uses backwards time and space */
+			/*  forward fft, so our answer comes out time and space reversed */
+
+		rlft3(NRtensdata, NRmatdata, 1, N2, N, 1);
+		
+		/* move data to my in-place order */
+		a[1] = a[N2/2*N];			// pack in nyquest wavenumber point for DC freq transform
+		for (i2=0; i2<N2/2; i2++){ // move transform of nyquest frequency
+			a[(N2/2+i2)*N] = specdata[i2*2];
+			a[(N2/2+i2)*N+1] = specdata[i2*2+1];
+		}
+		a[N2/2*N+1] = specdata[N2];	// pack in nyquest wavenumber point for nyquest freq transform
+
+
+		rifft2d(a, M2, M);
+
+		srand(randseed);
+		rannum = rand();
+		maxerrifft = fabs(BIPRAND(rannum)-a[0]);
+		for (i1=1; i1<N; i1++){
+			rannum = rand();
+		t1=BIPRAND(rannum);
+		t2=a[N-i1];
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a[N-i1]));
+		}
+		for (i2=1; i2<N2; i2++){
+			rannum = rand();
+			t1=BIPRAND(rannum);
+			t2=a[(N2-i2)*N];
+			maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a[(N2-i2)*N]));
+			for (i1=1; i1<N; i1++){
+				rannum = rand();
+			t1=BIPRAND(rannum);
+			t2=a[(N2-i2)*N+N-i1];
+				maxerrifft = fmax(maxerrifft, fabs(BIPRAND(rannum)-a[(N2-i2)*N+N-i1]));
+			}
+		}
+
+		printf("maxerrifft = %6.4e,  ", maxerrifft);
+
+			/*  now use rifft2d to verify rfft2d */
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			a[i1] = BIPRAND(rannum);
+		}
+
+		rifft2d(a, M2, M);
+		rfft2d(a, M2, M);
+
+		maxerrfft = 0;
+		srand(randseed);
+		for (i1=0; i1<N2*N; i1++){
+			rannum = rand();
+			maxerrfft = fmax(maxerrfft, fabs(BIPRAND(rannum)-a[i1]));
+		}
+
+		printf("maxerrfft = %6.4e\n", maxerrfft);
+
+		fft2dFree();
+		free_f3tensor(NRtensdata,1,1,1,N2,1,N);
+		free_matrix(NRmatdata,1,1,1,2*N2);
+		a = 0;
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fft2dFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/README.txt b/lib-src/libnyquist/nyquist/ffts/README.txt
new file mode 100644
index 0000000..d3d8192
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/README.txt
@@ -0,0 +1,70 @@
+This directory contains a public domain FFT library which was optimized
+for speed on RISC processors such as the PowerPC.  All ffts
+use single precision floats, for double precision just use a
+global search and replace to change float to double in all 
+source files.
+Codewarrier Pro 1.0 project files are also supplied.
+
+** Warning **   Perform rigorous testing to
+your own standards before using this code.
+
+ (John Green) green_jt at vsdec.npt.nuwc.navy.mil
+
+files:
+	fftTiming
+Application to time complex ffts
+
+	rfftTiming
+Application to time real ffts
+
+// Directory: fft libraries
+
+files:
+
+	fftext.c
+Library of in-place fast fourier transforms. Contains forward 
+and inverse complex and real transforms.  The real fft's expect the
+frequency domain data to have the real part of the fsamp/2 bin (which
+has a 0 imaginary part) to be stored in the location for the imaginary
+part of the DC bin (the DC bin of real data is also strictly real.)
+You must first call an initialization routine fftInit  before calling 
+the fft computation routines ffts, iffts, rffts and riffts.
+The init routines malloc the memory to store the cosine and
+bit reversed counter tables as well as initializing their values.
+
+	fftlib.c
+Lower level library of in-place fast fourier transforms. Same as fftext.c but you
+need to manage the mallocs for the cosine and bit reversed tables yourself.
+
+
+	fft2d.c
+Library of 2d and 3d complex and 2d real in-place fast fourier transforms.
+The init routine fft2dInit must be called before using the 2d routines and
+fft3dInit must be called before using the 3d routines.  These init routines
+will also call the appropriate 1d init routines in fftext.c
+
+	matlib.c
+Matrix transpose routines used by fft2d.c and complex vector multiply
+for forming the product of two spectra.
+
+	dxpose.c
+Double precision matrix transpose for quick single precision complex transposing
+
+// Directory: timing code
+This directory contains the source to fftTiming and rfftTiming
+
+// Directory: Numerical Recipes testing
+This directory contains files used to test the various fft routines using
+the Numerical Recipes in C routines as a baseline.  These routines can be purchased
+in PeeCee (after expanding you can move them to a Mac) format from:
+http://cfata2.harvard.edu/numerical-recipes/
+Unfortunately Numerical Recipes defines its forward and inverse fft's backwards.
+For complex fft's I just use their inverse fft as a forward one, but for real ffts
+their forward fft followed by my inverse fft reverses the data.  They also have ugly matrix
+and tensor data types and start their indices with one, Fortran style, but these are
+minor annoyances.
+
+// Directory: Matlab testing
+This directory contains files to test fast 1d and 2d convolution with Matlab used to
+verify the results.  An example of using Matlab to test the fft library routines is
+also given for the 2d real fft.
diff --git a/lib-src/libnyquist/nyquist/ffts/Timing-code/fftTiming.c b/lib-src/libnyquist/nyquist/ffts/Timing-code/fftTiming.c
new file mode 100644
index 0000000..ffa4bcb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Timing-code/fftTiming.c
@@ -0,0 +1,98 @@
+/*  A program to time complex forward and inverse fast fourier transform routines	*/
+void four1(float data[], unsigned long nn, int isign);
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 3		/* the number of different ffts sizes to time */
+
+typedef  struct{
+	float Re;
+	float Im;
+	} Complex;
+
+void main(){
+long 	fftSize[NSIZES] = {1024, 16384, 262144};	/* size of FFTs, must be powers of 2 */
+long 	fftRepeats[NSIZES] = {2000, 50, 1};		/* number of timing loops */
+Complex	*a;
+long 	isize;
+long 	i1;
+long 	TheErr;
+long	N;
+long	M;
+
+#if macintosh
+UnsignedWide 		TheTime1;
+UnsignedWide 		TheTime2;
+double		TheTime;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0].Re));
+for (isize = 0; isize < NSIZES; isize++){
+
+	N = fftSize[isize];
+	printf("ffts size = %7d,  ", N);
+	M = roundtol(LOG2(N));
+
+	TheErr = fftInit(M);
+
+	if(!TheErr){
+		a = (Complex *) malloc(N*sizeof(Complex) );
+		if (a == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+
+			/*  set up a simple test case */
+		for (i1=0; i1<N; i1++){
+			a[i1].Re = sqrt(i1+.77777);
+			a[i1].Im = sqrt(i1+.22222);	
+		}
+
+	#if macintosh
+							/* make sure routines are in physical (not virtual) memory */
+		Microseconds(&TheTime1);
+		ffts((float *)a, M, 1);
+		iffts((float *)a, M, 1);
+
+		Microseconds(&TheTime1);
+
+		for (i1=0;i1<fftRepeats[isize];i1++){		/* do many times for timing */
+			ffts((float *)a, M, 1);
+			iffts((float *)a, M, 1);
+		}	
+
+		Microseconds(&TheTime2);
+
+		TheTime = (double)(TheTime2.hi - TheTime1.hi) * 65536.0 * 65536.0;
+		TheTime = (TheTime + (double)(TheTime2.lo - TheTime1.lo));
+		printf("ffts time = %12.1f  µs,  a[0].Re=%6e\n", TheTime/fftRepeats[isize]/2, a[0].Re);
+
+	#else
+		printf("start timing %12d real ffts's\n", fftRepeats[isize]*2);
+		for (i1=0;i1<fftRepeats[isize];i1++){		/* do many times for timing */
+			ffts((float *)a, M, 1);
+			iffts((float *)a, M, 1);
+		}
+		printf("end timing \n");
+	#endif
+		free(a);
+		fftFree();
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory \n");
+		else	printf(" error \n");
+		fftFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/Timing-code/rfftTiming.c b/lib-src/libnyquist/nyquist/ffts/Timing-code/rfftTiming.c
new file mode 100644
index 0000000..ac8498a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/Timing-code/rfftTiming.c
@@ -0,0 +1,90 @@
+/*  A program to time real input fast fourier transform routine	*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fp.h>
+#include <math.h>
+#include "fftlib.h"
+#include "fftext.h"
+
+#if macintosh
+#include <timer.h>
+#endif
+
+#define NSIZES 3		/* the number of different fft sizes to time */
+
+void main(){
+float	*a;
+long 	fftSize[NSIZES] = {2048, 32768, 524288};	/* size of FFTs, must be powers of 2 */
+long 	fftRepeats[NSIZES] = {2000, 50, 1};		/* number of timing loops */
+long 	isize;
+long 	i1;
+long 	TheErr;
+long	N;
+long	M;
+
+#if macintosh
+UnsignedWide 		TheTime1;
+UnsignedWide 		TheTime2;
+double		TheTime;
+#endif
+
+printf(" %6d  Byte Floats \n", sizeof(a[0]));
+for (isize = 0; isize < NSIZES; isize++){
+
+	N = fftSize[isize];
+	printf("rffts size = %9d  ", N);
+	M = roundtol(LOG2(N));
+	TheErr = fftInit(M);
+
+	if(!TheErr){
+		a = (float *) malloc(N*sizeof(float));
+		if (a == 0) TheErr = 2;
+	}
+
+	if(!TheErr){
+				/*  set up a simple test case */
+		for (i1=0; i1<N; i1++){
+			a[i1] = sqrt(i1+.77777);	
+		}
+
+	#if macintosh
+							/* make sure routines are in physical (not virtual) memory */
+		Microseconds(&TheTime1);
+		rffts(a, M, 1);
+		riffts(a, M, 1);
+
+		Microseconds(&TheTime1);
+
+		for (i1 = 0; i1 < fftRepeats[isize]; i1++){		/* do many times for timing */
+			rffts(a, M, 1);
+			riffts(a, M, 1);
+		}
+
+		Microseconds(&TheTime2);
+
+
+		TheTime = (double)(TheTime2.hi - TheTime1.hi) * 65536.0 * 65536.0;
+		TheTime = (TheTime + (double)(TheTime2.lo - TheTime1.lo));
+		printf("Ave of rffts & riffts Times = %14.1f  µs.\n", TheTime/fftRepeats[isize]/2);
+
+	#else
+		printf("start timing %12d real fft's\n", fftRepeats[isize]*2);
+		for (i1=0;i1<fftRepeats[isize];i1++){		/* do many times for timing */
+			rffts(a, M, 1);
+			riffts(a, M, 1);
+		}
+		printf("end timing \n");
+	#endif
+		free (a);
+		fftFree();
+	}
+	else{
+		if(TheErr==2)	printf(" out of memory ");
+		else	printf(" error ");
+		fftFree();
+	}
+}
+printf(" Done. \n");
+return;
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/abstract b/lib-src/libnyquist/nyquist/ffts/abstract
new file mode 100644
index 0000000..45f3aa8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/abstract
@@ -0,0 +1,37 @@
+Subject:     FFT for RISC 2.0
+To:          macgifts at sumex-aim.stanford.edu
+Enclosure:   FFTs-for-RISC-2.sit
+
+Enclosed is a stuffit archive of version 2.0 of my 'C' source code fft library.
+
+   Very-Fast Fourier Transform routines.  Routines are provided for real and complex
+forward and inverse 1d and 2d fourier transforms and 3d complex forward and inverse ffts.
+I coded these to optimize execution speed on Risc processors like the PowerPC.
+All fft sizes must still be a power of two.
+Test programs based on the Numerical Recipes in C routines are provided.
+Also included are some simple applications with source code which time the FFTs.
+See the enclosed read me file for more information.
+
+Revision version 2.0:
+		Rewrote code to rely more on compiler optimization (and be less ugly.)
+		Removed restrictions on too small or too large ffts.
+		Provided a library extension that manages memory for cosine and bit
+reversed counter tables.
+		Added 2d and 3d complex and 2d real ffts.
+		Speeded routines for data too large to fit in primary cache.
+		Changed most testing from Matlab to Numerical Recipes based (because its cheaper.)
+		Changed call parameters (watch out.)
+Revision version 1.21:
+       line 126 of rfftTest.c corrected.
+Revisions version 1.2:
+       I now store the Nyquest point of the real transform where the 0 for the DC term's
+imaginary part used to be.  !! WATCH OUT FOR THIS IF YOU USE rfft !!
+       Added the real inverse Fourier transform.
+
+Revisions version 1.1:
+       Re-arranged to put fft routines in a shared library and changed source file name to fftlib.c.
+       Removed some ugly optimizations that are no longer needed for CodeWarrier.
+
+This code is public domain, do anything you want to with it.
+
+[Moderators- This file should replace ffts-for-risc-121-c.hqx and can be included on any CD]
diff --git a/lib-src/libnyquist/nyquist/ffts/src/dxpose.c b/lib-src/libnyquist/nyquist/ffts/src/dxpose.c
new file mode 100644
index 0000000..9ee8836
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/dxpose.c
@@ -0,0 +1,79 @@
+/*********************
+This matrix transpose is in a seperate file because it should always be double precision.
+*********************/
+#include "dxpose.h"
+void dxpose(xdouble *indata, long iRsiz, xdouble *outdata, long oRsiz, long Nrows, long Ncols){
+/* not in-place double precision matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
+
+xdouble	*irow; 		/* pointer to input row start */
+xdouble	*ocol; 		/* pointer to output col start */
+xdouble	*idata; 	/* pointer to input data */
+xdouble	*odata; 	/* pointer to output data */
+long 	RowCnt;		/* row counter */
+long 	ColCnt;		/* col counter */
+xdouble	T0; 		/* data storage */
+xdouble	T1; 		/* data storage */
+xdouble	T2; 		/* data storage */
+xdouble	T3; 		/* data storage */
+xdouble	T4; 		/* data storage */
+xdouble	T5; 		/* data storage */
+xdouble	T6; 		/* data storage */
+xdouble	T7; 		/* data storage */
+const long inRsizd1 = iRsiz;
+const long inRsizd2 = 2*iRsiz;
+const long inRsizd3 = inRsizd2+iRsiz;
+const long inRsizd4 = 4*iRsiz;
+const long inRsizd5 = inRsizd3+inRsizd2;
+const long inRsizd6 = inRsizd4+inRsizd2;
+const long inRsizd7 = inRsizd4+inRsizd3;
+const long inRsizd8 = 8*iRsiz;
+
+ocol = outdata;
+irow = indata;
+for (RowCnt=Nrows/8; RowCnt>0; RowCnt--){
+	idata = irow;
+	odata = ocol;
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		T0 = *idata;
+		T1 = *(idata+inRsizd1);
+		T2 = *(idata+inRsizd2);
+		T3 = *(idata+inRsizd3);
+		T4 = *(idata+inRsizd4);
+		T5 = *(idata+inRsizd5);
+		T6 = *(idata+inRsizd6);
+		T7 = *(idata+inRsizd7);
+		*odata = T0;
+		*(odata+1) = T1;
+		*(odata+2) = T2;
+		*(odata+3) = T3;
+		*(odata+4) = T4;
+		*(odata+5) = T5;
+		*(odata+6) = T6;
+		*(odata+7) = T7;
+		idata++;
+		odata += oRsiz;
+	}
+	irow += inRsizd8;
+	ocol += 8;
+}
+if (Nrows%8 != 0){
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		idata = irow++;
+		odata = ocol;
+		ocol += oRsiz;
+		for (RowCnt=Nrows%8; RowCnt>0; RowCnt--){
+			T0 = *idata;
+			*odata++ = T0;
+			idata += iRsiz;
+		}
+	}
+}
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/src/dxpose.h b/lib-src/libnyquist/nyquist/ffts/src/dxpose.h
new file mode 100644
index 0000000..730f81f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/dxpose.h
@@ -0,0 +1,16 @@
+/*********************
+This matrix transpose is in a seperate file because it should always be double precision.
+*********************/
+typedef double_t xdouble;	// I use double_t so that global search and replace on double won't 
+						// change this to float accidentally.
+
+void dxpose(xdouble *indata, long iRsiz, xdouble *outdata, long oRsiz, long Nrows, long Ncols);
+/* not in-place double precision matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fft2d.c b/lib-src/libnyquist/nyquist/ffts/src/fft2d.c
new file mode 100644
index 0000000..0d8c3d8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fft2d.c
@@ -0,0 +1,402 @@
+/*******************************************************************
+	This file extends the fftlib with 2d and 3d complex fft's and
+	2d real fft's.  All fft's return results in-place.  Temporary buffers
+	for transposing columns are maintained privately via calls to
+	fft2dInit, fft2dFree, fft3dInit, and fft3dFree.
+	Note that you can call fft2dInit and fft3dInit repeatedly
+	with the same sizes, the extra calls will be ignored.
+	So, you could make a macro to call fft2dInit every time you call fft2d.
+	*** Warning *** fft2dFree and fft3dFree also call fftFree
+	so you must re-init all 1d fft sizes you are going to continue using
+*******************************************************************/
+#include <stdlib.h>
+#include <fp.h>
+#include "fftlib.h"
+#include "fftext.h"
+#include "matlib.h"
+#include "dxpose.h"
+#include "fft2d.h"
+	// use trick of using a real double transpose in place of a complex transpose if it fits
+#define cxpose(a,b,c,d,e,f) (2*sizeof(float)==sizeof(xdouble)) ? dxpose((xdouble *)(a), b, (xdouble *)(c), d, e, f) : cxpose(a,b,c,d,e,f);
+	// for this trick to work you must NOT replace the xdouble declarations in
+	// dxpose with float declarations.
+
+
+	// pointers for temporary storage for four columns
+static float *Array2d[8*sizeof(long)] = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+									0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0};
+int fft2dInit(long M2, long M){
+	// init for fft2d, ifft2d, rfft2d, and rifft2d
+	// malloc storage for 4 columns of 2d ffts then call fftinit for both row and column ffts sizes
+/* INPUTS */
+/* M = log2 of number of columns */
+/* M2 = log2 of number of rows */
+/*       of 2d matrix to be fourier transformed */
+/* OUTPUTS */
+/* private storage for columns of 2d ffts	*/
+/* calls fftInit for cosine and bit reversed tables	*/
+int theError = 1;
+if ((M2 >= 0) && (M2 < 8*sizeof(long))){
+	theError = 0;
+	if (Array2d[M2] == 0){
+		Array2d[M2] = (float *) malloc( 4*2*POW2(M2)*sizeof(float) );
+		if (Array2d[M2] == 0)
+			theError = 2;
+		else{
+			theError = fftInit(M2);
+		}
+	}
+	if (theError == 0)
+		theError = fftInit(M);
+}
+return theError;
+}
+
+void fft2dFree(){
+// free storage for columns of 2d ffts and call fftFree to free all BRLow and Utbl storage
+long i1;
+for (i1=8*sizeof(long)-1; i1>=0; i1--){
+	if (Array2d[i1] != 0){
+		free(Array2d[i1]);
+		Array2d[i1] = 0;
+	};
+};
+fftFree();
+}
+
+void fft2d(float *data, long M2, long M){
+/* Compute 2D complex fft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+if((M2>0)&&(M>0)){
+	ffts(data, M, POW2(M2));
+	if (M>2)
+		for (i1=0; i1<POW2(M); i1+=4){
+			cxpose(data + i1*2, POW2(M), Array2d[M2], POW2(M2), POW2(M2), 4);
+			ffts(Array2d[M2], M2, 4);
+			cxpose(Array2d[M2], POW2(M2), data + i1*2, POW2(M), 4, POW2(M2));
+		}
+	else{
+		cxpose(data, POW2(M), Array2d[M2], POW2(M2), POW2(M2), POW2(M));
+		ffts(Array2d[M2], M2, POW2(M));
+		cxpose(Array2d[M2], POW2(M2), data, POW2(M), POW2(M), POW2(M2));
+	}
+}
+else
+	ffts(data, M2+M, 1);
+}
+
+void ifft2d(float *data, long M2, long M){
+/* Compute 2D complex ifft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+if((M2>0)&&(M>0)){
+	iffts(data, M, POW2(M2));
+	if (M>2)
+		for (i1=0; i1<POW2(M); i1+=4){
+			cxpose(data + i1*2, POW2(M), Array2d[M2], POW2(M2), POW2(M2), 4);
+			iffts(Array2d[M2], M2, 4);
+			cxpose(Array2d[M2], POW2(M2), data + i1*2, POW2(M), 4, POW2(M2));
+		}
+	else{
+		cxpose(data, POW2(M), Array2d[M2], POW2(M2), POW2(M2), POW2(M));
+		iffts(Array2d[M2], M2, POW2(M));
+		cxpose(Array2d[M2], POW2(M2), data, POW2(M), POW2(M), POW2(M2));
+	}
+}
+else
+	iffts(data, M2+M, 1);
+}
+
+int fft3dInit(long L, long M2, long M){
+	// init for fft3d, ifft3d
+	// malloc storage for 4 columns and 4 pages of 3d ffts
+	// then call fftinit for page, row and column ffts sizes
+//* M = log2 of number of columns */
+/* M2 = log2 of number of rows */
+/* L = log2 of number of pages */
+/*       of 3d matrix to be fourier transformed */
+/* OUTPUTS */
+/* private storage for columns and pages of 3d ffts	*/
+/* calls fftInit for cosine and bit reversed tables	*/
+int theError = 1;
+if ((L >= 0) && (L < 8*sizeof(long))){
+	theError = 0;
+	if (Array2d[L] == 0){
+		Array2d[L] = (float *) malloc( 4*2*POW2(L)*sizeof(float) );
+		if (Array2d[L] == 0)
+			theError = 2;
+		else{
+			theError = fftInit(L);
+		}
+	}
+	if (theError == 0){
+		if (Array2d[M2] == 0){
+			Array2d[M2] = (float *) malloc( 4*2*POW2(M2)*sizeof(float) );
+			if (Array2d[M2] == 0)
+				theError = 2;
+			else{
+				theError = fftInit(M2);
+			}
+		}
+	}
+	if (theError == 0)
+		theError = fftInit(M);
+}
+return theError;
+}
+
+void fft3dFree(){
+// free storage for columns of all 2d&3d ffts and call fftFree to free all BRLow and Utbl storage
+fft2dFree();
+}
+
+void fft3d(float *data, long M3, long M2, long M){
+/* Compute 2D complex fft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M3 = log2 of fft size number of pages */
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+long i2;
+const long N = POW2(M);
+const long N2 = POW2(M2);
+const long N3 = POW2(M3);
+if((M3>0)&&(M2>0)&&(M>0)){
+	ffts(data, M, N3*N2);
+	if (M>2)
+		for (i2=0; i2<N3; i2++){
+			for (i1=0; i1<N; i1+=4){
+				cxpose(data + i2*2*POW2(M2+M) + i1*2, N, Array2d[M2], N2, N2, 4);
+				ffts(Array2d[M2], M2, 4);
+				cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M) + i1*2, N, 4, N2);
+			}
+		}
+	else{
+		for (i2=0; i2<N3; i2++){
+			cxpose(data + i2*2*POW2(M2+M), N, Array2d[M2], N2, N2, N);
+			ffts(Array2d[M2], M2, N);
+			cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M), N, N, N2);
+		}
+	}
+	if ((M2+M)>2)
+		for (i1=0; i1<POW2(M2+M); i1+=4){
+			cxpose(data + i1*2, POW2(M2+M), Array2d[M3], N3, N3, 4);
+			ffts(Array2d[M3], M3, 4);
+			cxpose(Array2d[M3], N3, data + i1*2, POW2(M2+M), 4, N3);
+		}
+	else{
+		cxpose(data, POW2(M2+M), Array2d[M3], N3, N3, POW2(M2+M));
+		ffts(Array2d[M3], M3, POW2(M2+M));
+		cxpose(Array2d[M3], N3, data, POW2(M2+M), POW2(M2+M), N3);
+	}
+}
+else
+	if(M3==0) fft2d(data, M2, M);
+	else
+		if(M2==0) fft2d(data, M3, M);
+		else
+			if(M==0) fft2d(data, M3, M2);
+}
+
+void ifft3d(float *data, long M3, long M2, long M){
+/* Compute 2D complex ifft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M3 = log2 of fft size number of pages */
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+long i2;
+const long N = POW2(M);
+const long N2 = POW2(M2);
+const long N3 = POW2(M3);
+if((M3>0)&&(M2>0)&&(M>0)){
+	iffts(data, M, N3*N2);
+	if (M>2)
+		for (i2=0; i2<N3; i2++){
+			for (i1=0; i1<N; i1+=4){
+				cxpose(data + i2*2*POW2(M2+M) + i1*2, N, Array2d[M2], N2, N2, 4);
+				iffts(Array2d[M2], M2, 4);
+				cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M) + i1*2, N, 4, N2);
+			}
+		}
+	else{
+		for (i2=0; i2<N3; i2++){
+			cxpose(data + i2*2*POW2(M2+M), N, Array2d[M2], N2, N2, N);
+			iffts(Array2d[M2], M2, N);
+			cxpose(Array2d[M2], N2, data + i2*2*POW2(M2+M), N, N, N2);
+		}
+	}
+	if ((M2+M)>2)
+		for (i1=0; i1<POW2(M2+M); i1+=4){
+			cxpose(data + i1*2, POW2(M2+M), Array2d[M3], N3, N3, 4);
+			iffts(Array2d[M3], M3, 4);
+			cxpose(Array2d[M3], N3, data + i1*2, POW2(M2+M), 4, N3);
+		}
+	else{
+		cxpose(data, POW2(M2+M), Array2d[M3], N3, N3, POW2(M2+M));
+		iffts(Array2d[M3], M3, POW2(M2+M));
+		cxpose(Array2d[M3], N3, data, POW2(M2+M), POW2(M2+M), N3);
+	}
+}
+else
+	if(M3==0) ifft2d(data, M2, M);
+	else
+		if(M2==0) ifft2d(data, M3, M);
+		else
+			if(M==0) ifft2d(data, M3, M2);
+}
+
+void rfft2d(float *data, long M2, long M){
+/* Compute 2D real fft and return results in-place	*/
+/* First performs real fft on rows using size from M to compute positive frequencies */
+/* then performs transform on columns using size from M2 to compute wavenumbers */
+/* If you think of the result as a complex pow(2,M2) by pow(2,M-1) matrix */
+/* then the first column contains the positive wavenumber spectra of DC frequency */
+/* followed by the positive wavenumber spectra of the nyquest frequency */
+/* since these are two positive wavenumber spectra the first complex value */
+/* of each is really the real values for the zero and nyquest wavenumber packed together */
+/* All other columns contain the positive and negative wavenumber spectra of a positive frequency */
+/* See rspect2dprod for multiplying two of these spectra together- ex. for fast convolution */
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows in */
+/* M = log2 of fft size number of columns in */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+if((M2>0)&&(M>0)){
+	rffts(data, M, POW2(M2));
+	if (M==1){
+		cxpose(data, POW2(M)/2, Array2d[M2]+POW2(M2)*2, POW2(M2), POW2(M2), 1);
+		xpose(Array2d[M2]+POW2(M2)*2, 2, Array2d[M2], POW2(M2), POW2(M2), 2);
+		rffts(Array2d[M2], M2, 2);
+		cxpose(Array2d[M2], POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+	}
+	else if (M==2){
+		cxpose(data, POW2(M)/2, Array2d[M2]+POW2(M2)*2, POW2(M2), POW2(M2), 1);
+		xpose(Array2d[M2]+POW2(M2)*2, 2, Array2d[M2], POW2(M2), POW2(M2), 2);
+		rffts(Array2d[M2], M2, 2);
+		cxpose(Array2d[M2], POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+
+		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
+		ffts(Array2d[M2], M2, 1);
+		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 1, POW2(M2));
+	}
+	else{
+		cxpose(data, POW2(M)/2, Array2d[M2]+POW2(M2)*2, POW2(M2), POW2(M2), 1);
+		xpose(Array2d[M2]+POW2(M2)*2, 2, Array2d[M2], POW2(M2), POW2(M2), 2);
+		rffts(Array2d[M2], M2, 2);
+		cxpose(Array2d[M2], POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+
+		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 3);
+		ffts(Array2d[M2], M2, 3);
+		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 3, POW2(M2));
+		for (i1=4; i1<POW2(M)/2; i1+=4){
+			cxpose(data + i1*2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 4);
+			ffts(Array2d[M2], M2, 4);
+			cxpose(Array2d[M2], POW2(M2), data + i1*2, POW2(M)/2, 4, POW2(M2));
+		}
+	}
+}
+else
+	rffts(data, M2+M, 1);
+}
+
+void rifft2d(float *data, long M2, long M){
+/* Compute 2D real ifft and return results in-place	*/
+/* The input must be in the order as outout from rfft2d */
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows out */
+/* M = log2 of fft size number of columns out */
+/* OUTPUTS */
+/* *data = output data array	*/
+long i1;
+if((M2>0)&&(M>0)){
+	if (M==1){
+		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
+		riffts(Array2d[M2], M2, 2);
+		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2));
+		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+	}
+	else if (M==2){
+		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
+		riffts(Array2d[M2], M2, 2);
+		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2)); 
+		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+
+		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
+		iffts(Array2d[M2], M2, 1);
+		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 1, POW2(M2));
+	}
+	else{
+		cxpose(data, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 1);
+		riffts(Array2d[M2], M2, 2);
+		xpose(Array2d[M2], POW2(M2), Array2d[M2]+POW2(M2)*2, 2, 2, POW2(M2));
+		cxpose(Array2d[M2]+POW2(M2)*2, POW2(M2), data, POW2(M)/2, 1, POW2(M2));
+
+		cxpose(data + 2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 3);
+		iffts(Array2d[M2], M2, 3);
+		cxpose(Array2d[M2], POW2(M2), data + 2, POW2(M)/2, 3, POW2(M2));
+		for (i1=4; i1<POW2(M)/2; i1+=4){
+			cxpose(data + i1*2, POW2(M)/2, Array2d[M2], POW2(M2), POW2(M2), 4);
+			iffts(Array2d[M2], M2, 4);
+			cxpose(Array2d[M2], POW2(M2), data + i1*2, POW2(M)/2, 4, POW2(M2));
+		}
+	}
+	riffts(data, M, POW2(M2));
+}
+else
+	riffts(data, M2+M, 1);
+}
+
+void rspect2dprod(float *data1, float *data2, float *outdata, long N2, long N1){
+// When multiplying a pair of 2d spectra from rfft2d care must be taken to multiply the
+// four real values seperately from the complex ones. This routine does it correctly.
+// the result can be stored in-place over one of the inputs
+/* *data1 = input data array	first spectra */
+/* *data2 = input data array	second spectra */
+/* N2 = fft size number of rows into rfft2d for both data1 and data2 */
+/* N1 = fft size number of columns into rfft2d for both data1 and data2 */
+long N = N2 * N1/2;		// number of "complex" numbers in spectra
+
+if( (N2 > 1) && (N1>1)){
+	outdata[0] = data1[0] * data2[0];	// multiply the zero freq, zero wavenumber values
+	outdata[1] = data1[1] * data2[1];	// multiply the zero freq, nyquest wavenumber values
+
+	cvprod(data1 + 2, data2 + 2, outdata + 2, N/2-1);
+
+	outdata[N] = data1[N] * data2[N];		// multiply the nyquest freq, zero wavenumber values
+	outdata[N+1] = data1[N+1] * data2[N+1];	// multiply the nyquest freq, nyquest wavenumber values
+
+	cvprod(data1 + N+2, data2 + N+2, outdata + N+2, N/2-1);
+}
+else{	// really 1D rfft spectra
+	N = N2 * N1;	// one of these is a 1
+	if(N>1){
+		outdata[0] = data1[0] * data2[0];	// multiply the zero freq values
+		outdata[1] = data1[1] * data2[1];	// multiply the nyquest freq values
+		cvprod(data1 + 2, data2 + 2, outdata + 2, N/2-1);	// multiply the other positive freq values
+	}
+	else{
+		outdata[0] = data1[0] * data2[0];
+	}
+}
+}
\ No newline at end of file
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fft2d.h b/lib-src/libnyquist/nyquist/ffts/src/fft2d.h
new file mode 100644
index 0000000..fd074ff
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fft2d.h
@@ -0,0 +1,114 @@
+/*******************************************************************
+	This file extends the fftlib with 2d and 3d complex fft's and
+	2d real fft's.  All fft's return results in-place.  Temporary buffers
+	for transposing columns are maintained privately via calls to
+	fft2dInit, fft2dFree, fft3dInit, and fft3dFree.
+	Note that you can call fft2dInit and fft3dInit repeatedly
+	with the same sizes, the extra calls will be ignored.
+	So, you could make a macro to call fft2dInit every time you call fft2d.
+	*** Warning *** fft2dFree and fft3dFree also call fftFree
+	so you must re-init all 1d fft sizes you are going to continue using
+*******************************************************************/
+int fft2dInit(long M2, long M);
+	// init for fft2d, ifft2d, rfft2d, and rifft2d
+	// malloc storage for columns of 2d ffts then call fftinit for both row and column ffts sizes
+/* INPUTS */
+/* M = log2 of number of columns */
+/* M2 = log2 of number of rows */
+/*       of 2d matrix to be fourier transformed */
+/* OUTPUTS */
+/* private storage for columns of 2d ffts	*/
+/* calls fftInit for cosine and bit reversed tables	*/
+
+void fft2dFree();
+// free storage for columns of all 2d&3d ffts and call fftFree to free all BRLow and Utbl storage
+
+void fft2d(float *data, long M2, long M);
+/* Compute 2D complex fft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+void ifft2d(float *data, long M2, long M);
+/* Compute 2D complex ifft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+int fft3dInit(long L, long M2, long M);
+	// init for fft3d, ifft3d
+	// malloc storage for 4 columns and 4 pages of 3d ffts
+	// then call fftinit for page, row and column ffts sizes
+/* M = log2 of number of columns */
+/* M2 = log2 of number of rows */
+/* L = log2 of number of pages */
+/*       of 3d matrix to be fourier transformed */
+/* OUTPUTS */
+/* private storage for columns and pages of 3d ffts	*/
+/* calls fftInit for cosine and bit reversed tables	*/
+
+void fft3dFree();
+// free storage for columns of all 2d&3d ffts and call fftFree to free all BRLow and Utbl storage
+
+void fft3d(float *data, long M3, long M2, long M);
+/* Compute 2D complex fft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M3 = log2 of fft size number of pages */
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+void ifft3d(float *data, long M3, long M2, long M);
+/* Compute 2D complex ifft and return results in-place	*/
+/* INPUTS */
+/* *data = input data array	*/
+/* M3 = log2 of fft size number of pages */
+/* M2 = log2 of fft size number of rows */
+/* M = log2 of fft size number of columns */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+void rfft2d(float *data, long M2, long M);
+/* Compute 2D real fft and return results in-place	*/
+/* First performs real fft on rows using size from M to compute positive frequencies */
+/* then performs transform on columns using size from M2 to compute wavenumbers */
+/* If you think of the result as a complex pow(2,M2) by pow(2,M-1) matrix */
+/* then the first column contains the positive wavenumber spectra of DC frequency */
+/* followed by the positive wavenumber spectra of the nyquest frequency */
+/* since these are two positive wavenumber spectra the first complex value */
+/* of each is really the real values for the zero and nyquest wavenumber packed together */
+/* All other columns contain the positive and negative wavenumber spectra of a positive frequency */
+/* See rspect2dprod for multiplying two of these spectra together- ex. for fast convolution */
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows in */
+/* M = log2 of fft size number of columns in */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+void rifft2d(float *data, long M2, long M);
+/* Compute 2D real ifft and return results in-place	*/
+/* The input must be in the order as outout from rfft2d */
+/* INPUTS */
+/* *data = input data array	*/
+/* M2 = log2 of fft size number of rows out */
+/* M = log2 of fft size number of columns out */
+/* OUTPUTS */
+/* *data = output data array	*/
+
+void rspect2dprod(float *data1, float *data2, float *outdata, long N2, long N1);
+// When multiplying a pair of 2d spectra from rfft2d care must be taken to multiply the
+// four real values seperately from the complex ones. This routine does it correctly.
+// the result can be stored in-place over one of the inputs
+/* *data1 = input data array	first spectra */
+/* *data2 = input data array	second spectra */
+/* N2 = fft size number of rows into rfft2d for both data1 and data2 */
+/* N1 = fft size number of columns into rfft2d for both data1 and data2 */
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fftext.c b/lib-src/libnyquist/nyquist/ffts/src/fftext.c
new file mode 100644
index 0000000..a39911c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fftext.c
@@ -0,0 +1,156 @@
+/*******************************************************************
+	This file extends the fftlib with calls to maintain the cosine and bit reversed tables
+	for you (including mallocs and free's).  Call the init routine for each fft size you will
+	be using.  Then you can call the fft routines below which will make the fftlib library 
+	call with the appropriate tables passed.  When you are done with all fft's you can call 
+	fftfree to release the storage for the tables.  Note that you can call fftinit repeatedly
+	with the same size, the extra calls will be ignored. So, you could make a macro to call
+	fftInit every time you call ffts. For example you could have someting like:
+	#define FFT(a,n) if(!fftInit(roundtol(LOG2(n)))) ffts(a,roundtol(LOG2(n)),1);else printf("fft error\n");
+*******************************************************************/
+#include <stdlib.h>
+#include "fftlib.h"
+#include "matlib.h"
+#include "fftext.h"
+
+// pointers to storage of Utbl's and  BRLow's
+static float *UtblArray[8*sizeof(long)] = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+									0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0};
+static short *BRLowArray[8*sizeof(long)/2]  = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0};
+
+int fftInit(long M){
+// malloc and init cosine and bit reversed tables for a given size fft, ifft, rfft, rifft
+/* INPUTS */
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* OUTPUTS */
+/* private cosine and bit reversed tables	*/
+
+int theError = 1;
+/*** I did NOT test cases with M>27 ***/
+if ((M >= 0) && (M < 8*sizeof(long))){
+	theError = 0;
+	if (UtblArray[M] == 0){	// have we not inited this size fft yet?
+		// init cos table
+		UtblArray[M] = (float *) malloc( (POW2(M)/4+1)*sizeof(float) );
+		if (UtblArray[M] == 0)
+			theError = 2;
+		else{
+			fftCosInit(M, UtblArray[M]);
+		}
+		if (M > 1){
+			if (BRLowArray[M/2] == 0){	// init bit reversed table for cmplx fft
+				BRLowArray[M/2] = (short *) malloc( POW2(M/2-1)*sizeof(short) );
+				if (BRLowArray[M/2] == 0)
+					theError = 2;
+				else{
+					fftBRInit(M, BRLowArray[M/2]);
+				}
+			}
+		}
+		if (M > 2){
+			if (BRLowArray[(M-1)/2] == 0){	// init bit reversed table for real fft
+				BRLowArray[(M-1)/2] = (short *) malloc( POW2((M-1)/2-1)*sizeof(short) );
+				if (BRLowArray[(M-1)/2] == 0)
+					theError = 2;
+				else{
+					fftBRInit(M-1, BRLowArray[(M-1)/2]);
+				}
+			}
+		}
+	}
+};
+return theError;
+}
+
+void fftFree(){
+// release storage for all private cosine and bit reversed tables
+long i1;
+for (i1=8*sizeof(long)/2-1; i1>=0; i1--){
+	if (BRLowArray[i1] != 0){
+		free(BRLowArray[i1]);
+		BRLowArray[i1] = 0;
+	};
+};
+for (i1=8*sizeof(long)-1; i1>=0; i1--){
+	if (UtblArray[i1] != 0){
+		free(UtblArray[i1]);
+		UtblArray[i1] = 0;
+	};
+};
+}
+
+/*************************************************
+ The following calls are easier than calling to fftlib directly.
+ Just make sure fftlib has been called for each M first.
+**************************************************/
+
+void ffts(float *data, long M, long Rows){
+/* Compute in-place complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+	ffts1(data, M, Rows, UtblArray[M], BRLowArray[M/2]);
+}
+
+void iffts(float *data, long M, long Rows){
+/* Compute in-place inverse complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+	iffts1(data, M, Rows, UtblArray[M], BRLowArray[M/2]);
+}
+
+void rffts(float *data, long M, long Rows){
+/* Compute in-place real fft on the rows of the input array	*/
+/* The result is the complex spectra of the positive frequencies */
+/* except the location for the first complex number contains the real */
+/* values for DC and Nyquest */
+/* See rspectprod for multiplying two of these spectra together- ex. for fast convolution */
+/* INPUTS */
+/* *ioptr = real input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	in the following order */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+	rffts1(data, M, Rows, UtblArray[M], BRLowArray[(M-1)/2]);
+}
+
+void riffts(float *data, long M, long Rows){
+/* Compute in-place real ifft on the rows of the input array	*/
+/* data order as from rffts */
+/* INPUTS */
+/* *ioptr = input data array in the following order	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = real output data array	*/
+	riffts1(data, M, Rows, UtblArray[M], BRLowArray[(M-1)/2]);
+}
+
+void rspectprod(float *data1, float *data2, float *outdata, long N){
+// When multiplying a pair of spectra from rfft care must be taken to multiply the
+// two real values seperately from the complex ones. This routine does it correctly.
+// the result can be stored in-place over one of the inputs
+/* INPUTS */
+/* *data1 = input data array	first spectra */
+/* *data2 = input data array	second spectra */
+/* N = fft input size for both data1 and data2 */
+/* OUTPUTS */
+/* *outdata = output data array spectra */
+if(N>1){
+	outdata[0] = data1[0] * data2[0];	// multiply the zero freq values
+	outdata[1] = data1[1] * data2[1];	// multiply the nyquest freq values
+	cvprod(data1 + 2, data2 + 2, outdata + 2, N/2-1);	// multiply the other positive freq values
+}
+else{
+	outdata[0] = data1[0] * data2[0];
+}
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fftext.h b/lib-src/libnyquist/nyquist/ffts/src/fftext.h
new file mode 100644
index 0000000..15d8a6b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fftext.h
@@ -0,0 +1,106 @@
+/*******************************************************************
+	This file extends the fftlib with calls to maintain the cosine and bit reversed tables
+	for you (including mallocs and free's).  Call the init routine for each fft size you will
+	be using.  Then you can call the fft routines below which will make the fftlib library 
+	call with the appropriate tables passed.  When you are done with all fft's you can call 
+	fftfree to release the storage for the tables.  Note that you can call fftinit repeatedly
+	with the same size, the extra calls will be ignored. So, you could make a macro to call
+	fftInit every time you call ffts. For example you could have someting like:
+	#define FFT(a,n) if(!fftInit(roundtol(LOG2(n)))) ffts(a,roundtol(LOG2(n)),1);else printf("fft error\n");
+*******************************************************************/
+
+int fftInit(long M);
+// malloc and init cosine and bit reversed tables for a given size fft, ifft, rfft, rifft
+/* INPUTS */
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* OUTPUTS */
+/* private cosine and bit reversed tables	*/
+
+void fftFree();
+// release storage for all private cosine and bit reversed tables
+
+void ffts(float *data, long M, long Rows);
+/* Compute in-place complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+void iffts(float *data, long M, long Rows);
+/* Compute in-place inverse complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+void rffts(float *data, long M, long Rows);
+/* Compute in-place real fft on the rows of the input array	*/
+/* The result is the complex spectra of the positive frequencies */
+/* except the location for the first complex number contains the real */
+/* values for DC and Nyquest */
+/* See rspectprod for multiplying two of these spectra together- ex. for fast convolution */
+/* INPUTS */
+/* *ioptr = real input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = output data array	in the following order */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+
+void riffts(float *data, long M, long Rows);
+/* Compute in-place real ifft on the rows of the input array	*/
+/* data order as from rffts */
+/* INPUTS */
+/* *ioptr = input data array in the following order	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+/* Rows = number of rows in ioptr array (use 1 for Rows for a single fft)	*/
+/* OUTPUTS */
+/* *ioptr = real output data array	*/
+
+void rspectprod(float *data1, float *data2, float *outdata, long N);
+// When multiplying a pair of spectra from rfft care must be taken to multiply the
+// two real values seperately from the complex ones. This routine does it correctly.
+// the result can be stored in-place over one of the inputs
+/* INPUTS */
+/* *data1 = input data array	first spectra */
+/* *data2 = input data array	second spectra */
+/* N = fft input size for both data1 and data2 */
+/* OUTPUTS */
+/* *outdata = output data array spectra */
+
+
+// The following is FYI
+
+
+//Note that most of the fft routines require full matrices, ie Rsiz==Ncols
+//This is how I like to define a real matrix:
+//struct matrix {		// real matrix
+//	float *d; 		// pointer to data
+//	long Nrows;		// number of rows in the matrix
+//	long Ncols;		// number of columns in the matrix (can be less than Rsiz)
+//	long Rsiz;		// number of floats from one row to the next
+//};
+//typedef struct matrix matrix;
+
+
+
+// CACHEFILLMALLOC and CEILCACHELINE can be used instead of malloc to make
+// arrays that start exactly on a cache line start.
+// First we CACHEFILLMALLOC a void * (use this void * when free'ing),
+// then we set our array pointer equal to the properly cast CEILCACHELINE of this void *
+// example:
+// aInit = CACHEFILLMALLOC( NUMFLOATS*sizeof(float) );
+// a = (float *) CEILCACHELINE(ainit);
+// ... main body of code ...
+// free(aInit);
+//
+// To disable this alignment, set CACHELINESIZE to 1
+//#define CACHELINESIZE 32				// Bytes per cache line
+//#define CACHELINEFILL (CACHELINESIZE-1)
+//#define CEILCACHELINE(p) ((((unsigned long)p+CACHELINEFILL)/CACHELINESIZE)*CACHELINESIZE)
+//#define CACHEFILLMALLOC(n) malloc((n)+CACHELINEFILL)
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fftlib.c b/lib-src/libnyquist/nyquist/ffts/src/fftlib.c
new file mode 100644
index 0000000..d832f89
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fftlib.c
@@ -0,0 +1,3174 @@
+/*******************************************************************
+lower level fft stuff including routines called in fftext.c and fft2d.c
+*******************************************************************/
+#include "fftlib.h"
+#include <math.h>
+#define	MCACHE	(11-(sizeof(float)/8))	// fft's with M bigger than this bust primary cache
+#ifdef WIN32
+#define inline __inline
+#endif
+
+// some math constants to 40 decimal places
+#define MYPI		3.141592653589793238462643383279502884197	// pi
+#define MYROOT2 	1.414213562373095048801688724209698078569	// sqrt(2)
+#define MYCOSPID8	0.9238795325112867561281831893967882868224	// cos(pi/8)
+#define MYSINPID8	0.3826834323650897717284599840303988667613	// sin(pi/8)
+
+
+/*************************************************
+routines to initialize tables used by fft routines
+**************************************************/
+
+void fftCosInit(long M, float *Utbl){
+/* Compute Utbl, the cosine table for ffts	*/
+/* of size (pow(2,M)/4 +1)	*/
+/* INPUTS */
+/* M = log2 of fft size	*/
+/* OUTPUTS */
+/* *Utbl = cosine table	*/
+unsigned long fftN = POW2(M);
+unsigned long i1;
+	Utbl[0] = 1.0;
+	for (i1 = 1; i1 < fftN/4; i1++)
+		Utbl[i1] = cos( (2.0 * MYPI * i1) / fftN );
+	Utbl[fftN/4] = 0.0;
+}
+
+void fftBRInit(long M, short *BRLow){
+/* Compute BRLow, the bit reversed table for ffts	*/
+/* of size pow(2,M/2 -1)	*/
+/* INPUTS */
+/* M = log2 of fft size	*/
+/* OUTPUTS */
+/* *BRLow = bit reversed counter table	*/
+long	Mroot_1 = M / 2 - 1;
+long	Nroot_1 = POW2(Mroot_1);
+long i1;
+long bitsum;
+long bitmask;
+long bit;
+for (i1 = 0; i1 < Nroot_1; i1++){
+	bitsum = 0;
+	bitmask = 1;
+	for (bit=1; bit <= Mroot_1; bitmask<<=1, bit++)
+		if (i1 & bitmask)
+			bitsum = bitsum + (Nroot_1 >> bit);
+	BRLow[i1] = bitsum;
+};
+}
+
+/************************************************
+parts of ffts1
+*************************************************/
+
+inline void bitrevR2(float *ioptr, long M, short *BRLow);
+inline void bitrevR2(float *ioptr, long M, short *BRLow){
+/*** bit reverse and first radix 2 stage of forward or inverse fft ***/
+float	f0r;
+float	f0i;
+float	f1r;
+float	f1i;
+float	f2r;
+float	f2i;
+float	f3r;
+float	f3i;
+float	f4r;
+float	f4i;
+float	f5r;
+float	f5i;
+float	f6r;
+float	f6i;
+float	f7r;
+float	f7i;
+float	t0r;
+float	t0i;
+float	t1r;
+float	t1i;
+float	*p0r;
+float	*p1r;
+float	*IOP;
+float 	*iolimit;
+long 	Colstart;
+long 	iCol;
+unsigned long 	posA;
+unsigned long 	posAi;
+unsigned long 	posB;
+unsigned long 	posBi;
+
+const unsigned long Nrems2 = POW2((M+3)/2);
+const unsigned long Nroot_1_ColInc = POW2(M)-Nrems2;
+const unsigned long Nroot_1 = POW2(M/2-1)-1;
+const unsigned long ColstartShift = (M+1)/2 +1;
+posA = POW2(M);		// 1/2 of POW2(M) complexes
+posAi = posA + 1;
+posB = posA + 2;
+posBi = posB + 1;
+
+iolimit = ioptr + Nrems2;
+for (; ioptr < iolimit; ioptr += POW2(M/2+1)){
+	for (Colstart = Nroot_1; Colstart >= 0; Colstart--){
+		iCol = Nroot_1;
+		p0r = ioptr+ Nroot_1_ColInc + BRLow[Colstart]*4;
+		IOP = ioptr + (Colstart << ColstartShift);
+		p1r = IOP + BRLow[iCol]*4;
+		f0r = *(p0r);
+		f0i = *(p0r+1);
+		f1r = *(p0r+posA);
+		f1i = *(p0r+posAi);
+		for (; iCol > Colstart;){
+			f2r = *(p0r+2);
+			f2i = *(p0r+(2+1));
+			f3r = *(p0r+posB);
+			f3i = *(p0r+posBi);
+			f4r = *(p1r);
+			f4i = *(p1r+1);
+			f5r = *(p1r+posA);
+			f5i = *(p1r+posAi);
+			f6r = *(p1r+2);
+			f6i = *(p1r+(2+1));
+			f7r = *(p1r+posB);
+			f7i = *(p1r+posBi);
+			
+			t0r	= f0r + f1r;
+			t0i	= f0i + f1i;
+			f1r = f0r - f1r;
+			f1i = f0i - f1i;
+			t1r = f2r + f3r;
+			t1i = f2i + f3i;
+			f3r = f2r - f3r;
+			f3i = f2i - f3i;
+			f0r = f4r + f5r;
+			f0i = f4i + f5i;
+			f5r = f4r - f5r;
+			f5i = f4i - f5i;
+			f2r = f6r + f7r;
+			f2i = f6i + f7i;
+			f7r = f6r - f7r;
+			f7i = f6i - f7i;
+
+			*(p1r) = t0r;
+			*(p1r+1) = t0i;
+			*(p1r+2) = f1r;
+			*(p1r+(2+1)) = f1i;
+			*(p1r+posA) = t1r;
+			*(p1r+posAi) = t1i;
+			*(p1r+posB) = f3r;
+			*(p1r+posBi) = f3i;
+			*(p0r) = f0r;
+			*(p0r+1) = f0i;
+			*(p0r+2) = f5r;
+			*(p0r+(2+1)) = f5i;
+			*(p0r+posA) = f2r;
+			*(p0r+posAi) = f2i;
+			*(p0r+posB) = f7r;
+			*(p0r+posBi) = f7i;
+
+			p0r -= Nrems2;
+			f0r = *(p0r);
+			f0i = *(p0r+1);
+			f1r = *(p0r+posA);
+			f1i = *(p0r+posAi);
+			iCol -= 1;
+			p1r = IOP + BRLow[iCol]*4;
+		};
+		f2r = *(p0r+2);
+		f2i = *(p0r+(2+1));
+		f3r = *(p0r+posB);
+		f3i = *(p0r+posBi);
+
+		t0r   = f0r + f1r;
+		t0i   = f0i + f1i;
+		f1r = f0r - f1r;
+		f1i = f0i - f1i;
+		t1r   = f2r + f3r;
+		t1i   = f2i + f3i;
+		f3r = f2r - f3r;
+		f3i = f2i - f3i;
+
+		*(p0r) = t0r;
+		*(p0r+1) = t0i;
+		*(p0r+2) = f1r;
+		*(p0r+(2+1)) = f1i;
+		*(p0r+posA) = t1r;
+		*(p0r+posAi) = t1i;
+		*(p0r+posB) = f3r;
+		*(p0r+posBi) = f3i;
+
+	};
+};
+}
+
+inline void fft2pt(float *ioptr);
+inline void fft2pt(float *ioptr){
+/***   RADIX 2 fft	***/
+float f0r, f0i, f1r, f1i;
+float t0r, t0i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[2];
+f1i = ioptr[3];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0
+		f1	-  1 -	f1
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+	/* store result */
+ioptr[0] = t0r;
+ioptr[1] = t0i;
+ioptr[2] = f1r;
+ioptr[3] = f1i;
+}
+
+
+inline void fft4pt(float *ioptr);
+inline void fft4pt(float *ioptr){
+/***   RADIX 4 fft	***/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float t0r, t0i, t1r, t1i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[4];
+f1i = ioptr[5];
+f2r = ioptr[2];
+f2i = ioptr[3];
+f3r = ioptr[6];
+f3i = ioptr[7];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0	-	-	f0
+		f1	-  1 -	f1	-	-	f1
+		f2	-	-	f2	-  1 -	f2
+		f3	-  1 -	t1	- -i -	f3
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r - t1i;
+f3i = f1i + t1r;
+f1r = f1r + t1i;
+f1i = f1i - t1r;
+
+	/* store result */
+ioptr[0] = f0r;
+ioptr[1] = f0i;
+ioptr[2] = f1r;
+ioptr[3] = f1i;
+ioptr[4] = f2r;
+ioptr[5] = f2i;
+ioptr[6] = f3r;
+ioptr[7] = f3i;
+}
+
+inline void fft8pt(float *ioptr);
+inline void fft8pt(float *ioptr){
+/***   RADIX 8 fft	***/
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[8];
+f1i = ioptr[9];
+f2r = ioptr[4];
+f2i = ioptr[5];
+f3r = ioptr[12];
+f3i = ioptr[13];
+f4r = ioptr[2];
+f4i = ioptr[3];
+f5r = ioptr[10];
+f5i = ioptr[11];
+f6r = ioptr[6];
+f6i = ioptr[7];
+f7r = ioptr[14];
+f7i = ioptr[15];
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1	-  1 -	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	-  1 -	f2	-	-	f2
+			f3	-  1 -	t1	- -i -	f3	-	-	f3
+			f4	-	-	t0	-	-	f4	-  1 -	t0
+			f5	-  1 -	f5	-	-	f5	- w3 -	f4
+			f6	-	-	f6	-  1 -	f6	- -i -	t1
+			f7	-  1 -	t1	- -i -	f7	- iw3-	f6
+			*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r - t1i;
+f3i = f1i + t1r;
+f1r = f1r + t1i;
+f1i = f1i - t1r;
+
+
+t0r = f4r + f5r;
+t0i = f4i + f5i;
+f5r = f4r - f5r;
+f5i = f4i - f5i;
+
+t1r = f6r - f7r;
+t1i = f6i - f7i;
+f6r = f6r + f7r;
+f6i = f6i + f7i;
+
+f4r = t0r + f6r;
+f4i = t0i + f6i;
+f6r = t0r - f6r;
+f6i = t0i - f6i;
+
+f7r = f5r - t1i;
+f7i = f5i + t1r;
+f5r = f5r + t1i;
+f5i = f5i - t1r;
+
+
+t0r = f0r - f4r;
+t0i = f0i - f4i;
+f0r = f0r + f4r;
+f0i = f0i + f4i;
+
+t1r = f2r - f6i;
+t1i = f2i + f6r;
+f2r = f2r + f6i;
+f2i = f2i - f6r;
+
+f4r = f1r - f5r * w0r - f5i * w0r;
+f4i = f1i + f5r * w0r - f5i * w0r;
+f1r = f1r * Two - f4r;
+f1i = f1i * Two - f4i;
+
+f6r = f3r + f7r * w0r - f7i * w0r;
+f6i = f3i + f7r * w0r + f7i * w0r;
+f3r = f3r * Two - f6r;
+f3i = f3i * Two - f6i;
+
+	/* store result */
+ioptr[0] = f0r;
+ioptr[1] = f0i;
+ioptr[2] = f1r;
+ioptr[3] = f1i;
+ioptr[4] = f2r;
+ioptr[5] = f2i;
+ioptr[6] = f3r;
+ioptr[7] = f3i;
+ioptr[8] = t0r;
+ioptr[9] = t0i;
+ioptr[10] = f4r;
+ioptr[11] = f4i;
+ioptr[12] = t1r;
+ioptr[13] = t1i;
+ioptr[14] = f6r;
+ioptr[15] = f6i;
+}
+
+inline void bfR2(float *ioptr, long M, long NDiffU);
+inline void bfR2(float *ioptr, long M, long NDiffU){
+/*** 2nd radix 2 stage ***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long 	NSameU;
+unsigned long 	SameUCnt;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 4;
+pos = 2;
+posi = pos+1;
+NSameU = POW2(M) / 4 /NDiffU;	// 4 Us at a time
+pstrt = ioptr;
+p0r = pstrt;
+p1r = pstrt+pinc;
+p2r = p1r+pinc;
+p3r = p2r+pinc;
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4
+		f1	-  1 -	f5
+		f2	-	-	f6
+		f3	-  1 -	f7
+		*/
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4
+		f1	-  1 -	f5
+		f2	-	-	f6
+		f3	-  1 -	f7
+		*/
+
+for (SameUCnt = NSameU; SameUCnt > 0 ; SameUCnt--){
+
+	f0r = *p0r;
+	f1r = *p1r;
+	f0i = *(p0r + 1);
+	f1i = *(p1r + 1);
+	f2r = *p2r;
+	f3r = *p3r;
+	f2i = *(p2r + 1);
+	f3i = *(p3r + 1);
+
+	f4r = f0r + f1r;
+	f4i = f0i + f1i;
+	f5r = f0r - f1r;
+	f5i = f0i - f1i;
+
+	f6r = f2r + f3r;
+	f6i = f2i + f3i;
+	f7r = f2r - f3r;
+	f7i = f2i - f3i;
+
+	*p0r = f4r;
+	*(p0r + 1) = f4i;
+	*p1r = f5r;
+	*(p1r + 1) = f5i;
+	*p2r = f6r;
+	*(p2r + 1) = f6i;
+	*p3r = f7r;
+	*(p3r + 1) = f7i;
+
+	f0r = *(p0r + pos);
+	f1i = *(p1r + posi);
+	f0i = *(p0r + posi);
+	f1r = *(p1r + pos);
+	f2r = *(p2r + pos);
+	f3i = *(p3r + posi);
+	f2i = *(p2r + posi);
+	f3r = *(p3r + pos);
+
+	f4r = f0r + f1i;
+	f4i = f0i - f1r;
+	f5r = f0r - f1i;
+	f5i = f0i + f1r;
+
+	f6r = f2r + f3i;
+	f6i = f2i - f3r;
+	f7r = f2r - f3i;
+	f7i = f2i + f3r;
+
+	*(p0r + pos) = f4r;
+	*(p0r + posi) = f4i;
+	*(p1r + pos) = f5r;
+	*(p1r + posi) = f5i;
+	*(p2r + pos) = f6r;
+	*(p2r + posi) = f6i;
+	*(p3r + pos) = f7r;
+	*(p3r + posi) = f7i;
+
+	p0r += pnext;
+	p1r += pnext;
+	p2r += pnext;
+	p3r += pnext;
+
+}
+}
+
+inline void bfR4(float *ioptr, long M, long NDiffU);
+inline void bfR4(float *ioptr, long M, long NDiffU){
+/*** 1 radix 4 stage ***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long	pnexti;
+unsigned long 	NSameU;
+unsigned long 	SameUCnt;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+
+float w1r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t1r, t1i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 4;
+pnexti =  pnext + 1;
+pos = 2;
+posi = pos+1;
+NSameU = POW2(M) / 4 /NDiffU;	// 4 pts per butterfly
+pstrt = ioptr;
+p0r = pstrt;
+p1r = pstrt+pinc;
+p2r = p1r+pinc;
+p3r = p2r+pinc;
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	f0	-	-	f4
+		f1	-  1 -	f5	-	-	f5
+		f2	-	-	f6	-  1 -	f6
+		f3	-  1 -	f3	- -i -	f7
+		*/
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4	-	-	f4
+		f1	- -i -	t1	-	-	f5
+		f2	-	-	f2	- w1 -	f6
+		f3	- -i -	f7	- iw1-	f7
+		*/
+
+f0r = *p0r;
+f1r = *p1r;
+f2r = *p2r;
+f3r = *p3r;
+f0i = *(p0r + 1);
+f1i = *(p1r + 1);
+f2i = *(p2r + 1);
+f3i = *(p3r + 1);
+
+f5r = f0r - f1r;
+f5i = f0i - f1i;
+f0r = f0r + f1r;
+f0i = f0i + f1i;
+
+f6r = f2r + f3r;
+f6i = f2i + f3i;
+f3r = f2r - f3r;
+f3i = f2i - f3i;
+
+for (SameUCnt = NSameU-1; SameUCnt > 0 ; SameUCnt--){
+
+	f7r = f5r - f3i;
+	f7i = f5i + f3r;
+	f5r = f5r + f3i;
+	f5i = f5i - f3r;
+
+	f4r = f0r + f6r;
+	f4i = f0i + f6i;
+	f6r = f0r - f6r;
+	f6i = f0i - f6i;
+
+	f2r = *(p2r + pos);
+	f2i = *(p2r + posi);
+	f1r = *(p1r + pos);
+	f1i = *(p1r + posi);
+	f3i = *(p3r + posi);
+	f0r = *(p0r + pos);
+	f3r = *(p3r + pos);
+	f0i = *(p0r + posi);
+
+	*p3r = f7r;
+	*p0r = f4r;
+	*(p3r + 1) = f7i;
+	*(p0r + 1) = f4i;
+	*p1r = f5r;
+	*p2r = f6r;
+	*(p1r + 1) = f5i;
+	*(p2r + 1) = f6i;
+
+	f7r = f2r - f3i;
+	f7i = f2i + f3r;
+	f2r = f2r + f3i;
+	f2i = f2i - f3r;
+
+	f4r = f0r + f1i;
+	f4i = f0i - f1r;
+	t1r = f0r - f1i;
+	t1i = f0i + f1r;
+
+	f5r = t1r - f7r * w1r + f7i * w1r;
+	f5i = t1i - f7r * w1r - f7i * w1r;
+	f7r = t1r * Two - f5r;
+	f7i = t1i * Two - f5i;
+
+	f6r = f4r - f2r * w1r - f2i * w1r;
+	f6i = f4i + f2r * w1r - f2i * w1r;
+	f4r = f4r * Two - f6r;
+	f4i = f4i * Two - f6i;
+
+	f3r = *(p3r + pnext);
+	f0r = *(p0r + pnext);
+	f3i = *(p3r + pnexti);
+	f0i = *(p0r + pnexti);
+	f2r = *(p2r + pnext);
+	f2i = *(p2r + pnexti);
+	f1r = *(p1r + pnext);
+	f1i = *(p1r + pnexti);
+
+	*(p2r + pos) = f6r;
+	*(p1r + pos) = f5r;
+	*(p2r + posi) = f6i;
+	*(p1r + posi) = f5i;
+	*(p3r + pos) = f7r;
+	*(p0r + pos) = f4r;
+	*(p3r + posi) = f7i;
+	*(p0r + posi) = f4i;
+
+	f6r = f2r + f3r;
+	f6i = f2i + f3i;
+	f3r = f2r - f3r;
+	f3i = f2i - f3i;
+
+	f5r = f0r - f1r;
+	f5i = f0i - f1i;
+	f0r = f0r + f1r;
+	f0i = f0i + f1i;
+
+	p3r += pnext;
+	p0r += pnext;
+	p1r += pnext;
+	p2r += pnext;
+
+}
+f7r = f5r - f3i;
+f7i = f5i + f3r;
+f5r = f5r + f3i;
+f5i = f5i - f3r;
+
+f4r = f0r + f6r;
+f4i = f0i + f6i;
+f6r = f0r - f6r;
+f6i = f0i - f6i;
+
+f2r = *(p2r + pos);
+f2i = *(p2r + posi);
+f1r = *(p1r + pos);
+f1i = *(p1r + posi);
+f3i = *(p3r + posi);
+f0r = *(p0r + pos);
+f3r = *(p3r + pos);
+f0i = *(p0r + posi);
+
+*p3r = f7r;
+*p0r = f4r;
+*(p3r + 1) = f7i;
+*(p0r + 1) = f4i;
+*p1r = f5r;
+*p2r = f6r;
+*(p1r + 1) = f5i;
+*(p2r + 1) = f6i;
+
+f7r = f2r - f3i;
+f7i = f2i + f3r;
+f2r = f2r + f3i;
+f2i = f2i - f3r;
+
+f4r = f0r + f1i;
+f4i = f0i - f1r;
+t1r = f0r - f1i;
+t1i = f0i + f1r;
+
+f5r = t1r - f7r * w1r + f7i * w1r;
+f5i = t1i - f7r * w1r - f7i * w1r;
+f7r = t1r * Two - f5r;
+f7i = t1i * Two - f5i;
+
+f6r = f4r - f2r * w1r - f2i * w1r;
+f6i = f4i + f2r * w1r - f2i * w1r;
+f4r = f4r * Two - f6r;
+f4i = f4i * Two - f6i;
+
+*(p2r + pos) = f6r;
+*(p1r + pos) = f5r;
+*(p2r + posi) = f6i;
+*(p1r + posi) = f5i;
+*(p3r + pos) = f7r;
+*(p0r + pos) = f4r;
+*(p3r + posi) = f7i;
+*(p0r + posi) = f4i;
+
+}
+
+inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+/***   RADIX 8 Stages	***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long 	NSameU;
+unsigned long 	Uinc;
+unsigned long 	Uinc2;
+unsigned long 	Uinc4;
+unsigned long 	DiffUCnt;
+unsigned long 	SameUCnt;
+unsigned long 	U2toU3;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+float 	*u0r, *u0i, *u1r, *u1i, *u2r, *u2i;
+
+float w0r, w0i, w1r, w1i, w2r, w2i, w3r, w3i;
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 8;
+pos = pinc * 4;
+posi =  pos + 1;
+NSameU = POW2(M) / 8 /NDiffU;	// 8 pts per butterfly
+Uinc = NSameU * Ustride;
+Uinc2 = Uinc * 2;
+Uinc4 = Uinc * 4;
+U2toU3 = (POW2(M) / 8)*Ustride;
+for (; StageCnt > 0 ; StageCnt--){
+
+	u0r = &Utbl[0];
+	u0i = &Utbl[POW2(M-2)*Ustride];
+	u1r = u0r;
+	u1i = u0i;
+	u2r = u0r;
+	u2i = u0i;
+
+	w0r =  *u0r;
+	w0i =  *u0i;
+	w1r =  *u1r;
+	w1i =  *u1i;
+	w2r =  *u2r;
+	w2i =  *u2i;
+	w3r =  *(u2r+U2toU3);
+	w3i =  *(u2i-U2toU3);
+
+	pstrt = ioptr;
+
+	p0r = pstrt;
+	p1r = pstrt+pinc;
+	p2r = p1r+pinc;
+	p3r = p2r+pinc;
+
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1	- w0-	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	- w1-	f2	-	-	f4
+			f3	- w0-	t1	- iw1-	f3	-	-	f5
+
+			f4	-	-	t0	-	-	f4	- w2-	t0
+			f5	- w0-	f5	-	-	f5	- w3-	t1
+			f6	-	-	f6	- w1-	f6	- iw2-	f6
+			f7	- w0-	t1	- iw1-	f7	- iw3-	f7
+			*/
+
+	for (DiffUCnt = NDiffU; DiffUCnt > 0 ; DiffUCnt--){
+		f0r = *p0r;
+		f0i = *(p0r + 1);
+		f1r = *p1r;
+		f1i = *(p1r + 1);
+		for (SameUCnt = NSameU-1; SameUCnt > 0 ; SameUCnt--){
+			f2r = *p2r;
+			f2i = *(p2r + 1);
+			f3r = *p3r;
+			f3i = *(p3r + 1);
+
+			t0r = f0r + f1r * w0r + f1i * w0i;
+			t0i = f0i - f1r * w0i + f1i * w0r;
+			f1r = f0r * Two - t0r;
+			f1i = f0i * Two - t0i;
+
+			f4r = *(p0r + pos);
+			f4i = *(p0r + posi);
+			f5r = *(p1r + pos);
+			f5i = *(p1r + posi);
+
+			f6r = *(p2r + pos);
+			f6i = *(p2r + posi);
+			f7r = *(p3r + pos);
+			f7i = *(p3r + posi);
+
+			t1r = f2r - f3r * w0r - f3i * w0i;
+			t1i = f2i + f3r * w0i - f3i * w0r;
+			f2r = f2r * Two - t1r;
+			f2i = f2i * Two - t1i;
+
+			f0r = t0r + f2r * w1r + f2i * w1i;
+			f0i = t0i - f2r * w1i + f2i * w1r;
+			f2r = t0r * Two - f0r;
+			f2i = t0i * Two - f0i;
+
+			f3r = f1r + t1r * w1i - t1i * w1r;
+			f3i = f1i + t1r * w1r + t1i * w1i;
+			f1r = f1r * Two - f3r;
+			f1i = f1i * Two - f3i;
+
+
+			t0r = f4r + f5r * w0r + f5i * w0i;
+			t0i = f4i - f5r * w0i + f5i * w0r;
+			f5r = f4r * Two - t0r;
+			f5i = f4i * Two - t0i;
+
+			t1r = f6r - f7r * w0r - f7i * w0i;
+			t1i = f6i + f7r * w0i - f7i * w0r;
+			f6r = f6r * Two - t1r;
+			f6i = f6i * Two - t1i;
+
+			f4r = t0r + f6r * w1r + f6i * w1i;
+			f4i = t0i - f6r * w1i + f6i * w1r;
+			f6r = t0r * Two - f4r;
+			f6i = t0i * Two - f4i;
+
+			f7r = f5r + t1r * w1i - t1i * w1r;
+			f7i = f5i + t1r * w1r + t1i * w1i;
+			f5r = f5r * Two - f7r;
+			f5i = f5i * Two - f7i;
+
+			t0r = f0r - f4r * w2r - f4i * w2i;
+			t0i = f0i + f4r * w2i - f4i * w2r;
+			f0r = f0r * Two - t0r;
+			f0i = f0i * Two - t0i;
+
+			t1r = f1r - f5r * w3r - f5i * w3i;
+			t1i = f1i + f5r * w3i - f5i * w3r;
+			f1r = f1r * Two - t1r;
+			f1i = f1i * Two - t1i;
+
+			*(p0r + pos) = t0r;
+			*(p1r + pos) = t1r;
+			*(p0r + posi) = t0i;
+			*(p1r + posi) = t1i;
+			*p0r = f0r;
+			*p1r = f1r;
+			*(p0r + 1) = f0i;
+			*(p1r + 1) = f1i;
+
+			p0r += pnext;
+			f0r = *p0r;
+			f0i = *(p0r + 1);
+
+			p1r += pnext;
+
+			f1r = *p1r;
+			f1i = *(p1r + 1);
+
+			f4r = f2r - f6r * w2i + f6i * w2r;
+			f4i = f2i - f6r * w2r - f6i * w2i;
+			f6r = f2r * Two - f4r;
+			f6i = f2i * Two - f4i;
+
+			f5r = f3r - f7r * w3i + f7i * w3r;
+			f5i = f3i - f7r * w3r - f7i * w3i;
+			f7r = f3r * Two - f5r;
+			f7i = f3i * Two - f5i;
+
+			*p2r = f4r;
+			*p3r = f5r;
+			*(p2r + 1) = f4i;
+			*(p3r + 1) = f5i;
+			*(p2r + pos) = f6r;
+			*(p3r + pos) = f7r;
+			*(p2r + posi) = f6i;
+			*(p3r + posi) = f7i;
+
+			p2r += pnext;
+			p3r += pnext;
+
+		}
+		
+		f2r = *p2r;
+		f2i = *(p2r + 1);
+		f3r = *p3r;
+		f3i = *(p3r + 1);
+
+		t0r = f0r + f1r * w0r + f1i * w0i;
+		t0i = f0i - f1r * w0i + f1i * w0r;
+		f1r = f0r * Two - t0r;
+		f1i = f0i * Two - t0i;
+
+		f4r = *(p0r + pos);
+		f4i = *(p0r + posi);
+		f5r = *(p1r + pos);
+		f5i = *(p1r + posi);
+
+		f6r = *(p2r + pos);
+		f6i = *(p2r + posi);
+		f7r = *(p3r + pos);
+		f7i = *(p3r + posi);
+
+		t1r = f2r - f3r * w0r - f3i * w0i;
+		t1i = f2i + f3r * w0i - f3i * w0r;
+		f2r = f2r * Two - t1r;
+		f2i = f2i * Two - t1i;
+
+		f0r = t0r + f2r * w1r + f2i * w1i;
+		f0i = t0i - f2r * w1i + f2i * w1r;
+		f2r = t0r * Two - f0r;
+		f2i = t0i * Two - f0i;
+
+		f3r = f1r + t1r * w1i - t1i * w1r;
+		f3i = f1i + t1r * w1r + t1i * w1i;
+		f1r = f1r * Two - f3r;
+		f1i = f1i * Two - f3i;
+
+		if (DiffUCnt == NDiffU/2)
+			Uinc4 = -Uinc4;
+
+		u0r += Uinc4;
+		u0i -= Uinc4;
+		u1r += Uinc2;
+		u1i -= Uinc2;
+		u2r += Uinc;
+		u2i -= Uinc;
+
+		pstrt += 2;
+
+		t0r = f4r + f5r * w0r + f5i * w0i;
+		t0i = f4i - f5r * w0i + f5i * w0r;
+		f5r = f4r * Two - t0r;
+		f5i = f4i * Two - t0i;
+
+		t1r = f6r - f7r * w0r - f7i * w0i;
+		t1i = f6i + f7r * w0i - f7i * w0r;
+		f6r = f6r * Two - t1r;
+		f6i = f6i * Two - t1i;
+
+		f4r = t0r + f6r * w1r + f6i * w1i;
+		f4i = t0i - f6r * w1i + f6i * w1r;
+		f6r = t0r * Two - f4r;
+		f6i = t0i * Two - f4i;
+
+		f7r = f5r + t1r * w1i - t1i * w1r;
+		f7i = f5i + t1r * w1r + t1i * w1i;
+		f5r = f5r * Two - f7r;
+		f5i = f5i * Two - f7i;
+
+		w0r = *u0r;
+		w0i =  *u0i;
+		w1r =  *u1r;
+		w1i =  *u1i;
+
+		if (DiffUCnt <= NDiffU/2)
+			w0r = -w0r;
+
+		t0r = f0r - f4r * w2r - f4i * w2i;
+		t0i = f0i + f4r * w2i - f4i * w2r;
+		f0r = f0r * Two - t0r;
+		f0i = f0i * Two - t0i;
+
+		f4r = f2r - f6r * w2i + f6i * w2r;
+		f4i = f2i - f6r * w2r - f6i * w2i;
+		f6r = f2r * Two - f4r;
+		f6i = f2i * Two - f4i;
+
+		*(p0r + pos) = t0r;
+		*p2r = f4r;
+		*(p0r + posi) = t0i;
+		*(p2r + 1) = f4i;
+		w2r =  *u2r;
+		w2i =  *u2i;
+		*p0r = f0r;
+		*(p2r + pos) = f6r;
+		*(p0r + 1) = f0i;
+		*(p2r + posi) = f6i;
+
+		p0r = pstrt;
+		p2r = pstrt + pinc + pinc;	
+
+		t1r = f1r - f5r * w3r - f5i * w3i;
+		t1i = f1i + f5r * w3i - f5i * w3r;
+		f1r = f1r * Two - t1r;
+		f1i = f1i * Two - t1i;
+
+		f5r = f3r - f7r * w3i + f7i * w3r;
+		f5i = f3i - f7r * w3r - f7i * w3i;
+		f7r = f3r * Two - f5r;
+		f7i = f3i * Two - f5i;
+
+		*(p1r + pos) = t1r;
+		*p3r = f5r;
+		*(p1r + posi) = t1i;
+		*(p3r + 1) = f5i;
+		w3r =  *(u2r+U2toU3);
+		w3i =  *(u2i-U2toU3);
+		*p1r = f1r;
+		*(p3r + pos) = f7r;
+		*(p1r + 1) = f1i;
+		*(p3r + posi) = f7i;
+
+		p1r = pstrt + pinc;
+		p3r = p2r + pinc;	
+	}
+	NSameU /= 8;
+	Uinc /= 8;
+	Uinc2 /= 8;
+	Uinc4 = Uinc * 4;
+	NDiffU *= 8;
+	pinc *= 8;
+	pnext *= 8;
+	pos *= 8;
+	posi =  pos + 1;
+}
+}
+
+void fftrecurs(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+void fftrecurs(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+/* recursive bfstages calls to maximize on chip cache efficiency */
+long i1;
+if (M <= MCACHE)  // fits on chip ?
+	bfstages(ioptr, M, Utbl, Ustride, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+else{
+	for (i1=0; i1<8; i1++){
+		fftrecurs(&ioptr[i1*POW2(M-3)*2], M-3, Utbl, 8*Ustride, NDiffU, StageCnt-1);	/*  RADIX 8 Stages	*/
+	}
+	bfstages(ioptr, M, Utbl, Ustride, POW2(M-3), 1);	/*  RADIX 8 Stage	*/
+}
+}
+
+void ffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){
+/* Compute in-place complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+long 	StageCnt;
+long 	NDiffU;
+
+switch (M){
+case 0:
+	break;
+case 1:
+	for (;Rows>0;Rows--){
+		fft2pt(ioptr);				/* a 2 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 2:
+	for (;Rows>0;Rows--){
+		fft4pt(ioptr);				/* a 4 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 3:
+	for (;Rows>0;Rows--){
+		fft8pt(ioptr);				/* an 8 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+default:
+	for (;Rows>0;Rows--){
+
+		bitrevR2(ioptr, M, BRLow);						/* bit reverse and first radix 2 stage */
+		
+		StageCnt = (M-1) / 3;		// number of radix 8 stages
+		NDiffU = 2;				// one radix 2 stage already complete
+
+		if ( (M-1-(StageCnt * 3)) == 1 ){
+			bfR2(ioptr, M, NDiffU);				/* 1 radix 2 stage */
+			NDiffU *= 2;
+		}
+
+		if ( (M-1-(StageCnt * 3)) == 2 ){
+			bfR4(ioptr, M, NDiffU);			/* 1 radix 4 stage */
+			NDiffU *= 4;
+		}
+
+		if (M <= MCACHE)
+			bfstages(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+
+		else{
+			fftrecurs(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+		}
+
+		ioptr += 2*POW2(M);
+	}
+}
+}
+
+/************************************************
+parts of iffts1
+*************************************************/
+
+inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale);
+inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale){
+/*** scaled bit reverse and first radix 2 stage forward or inverse fft ***/
+float	f0r;
+float	f0i;
+float	f1r;
+float	f1i;
+float	f2r;
+float	f2i;
+float	f3r;
+float	f3i;
+float	f4r;
+float	f4i;
+float	f5r;
+float	f5i;
+float	f6r;
+float	f6i;
+float	f7r;
+float	f7i;
+float	t0r;
+float	t0i;
+float	t1r;
+float	t1i;
+float	*p0r;
+float	*p1r;
+float	*IOP;
+float 	*iolimit;
+long 	Colstart;
+long 	iCol;
+unsigned long 	posA;
+unsigned long 	posAi;
+unsigned long 	posB;
+unsigned long 	posBi;
+
+const unsigned long Nrems2 = POW2((M+3)/2);
+const unsigned long Nroot_1_ColInc = POW2(M)-Nrems2;
+const unsigned long Nroot_1 = POW2(M/2-1)-1;
+const unsigned long ColstartShift = (M+1)/2 +1;
+posA = POW2(M);		// 1/2 of POW2(M) complexes
+posAi = posA + 1;
+posB = posA + 2;
+posBi = posB + 1;
+
+iolimit = ioptr + Nrems2;
+for (; ioptr < iolimit; ioptr += POW2(M/2+1)){
+	for (Colstart = Nroot_1; Colstart >= 0; Colstart--){
+		iCol = Nroot_1;
+		p0r = ioptr+ Nroot_1_ColInc + BRLow[Colstart]*4;
+		IOP = ioptr + (Colstart << ColstartShift);
+		p1r = IOP + BRLow[iCol]*4;
+		f0r = *(p0r);
+		f0i = *(p0r+1);
+		f1r = *(p0r+posA);
+		f1i = *(p0r+posAi);
+		for (; iCol > Colstart;){
+			f2r = *(p0r+2);
+			f2i = *(p0r+(2+1));
+			f3r = *(p0r+posB);
+			f3i = *(p0r+posBi);
+			f4r = *(p1r);
+			f4i = *(p1r+1);
+			f5r = *(p1r+posA);
+			f5i = *(p1r+posAi);
+			f6r = *(p1r+2);
+			f6i = *(p1r+(2+1));
+			f7r = *(p1r+posB);
+			f7i = *(p1r+posBi);
+			
+			t0r	= f0r + f1r;
+			t0i	= f0i + f1i;
+			f1r = f0r - f1r;
+			f1i = f0i - f1i;
+			t1r = f2r + f3r;
+			t1i = f2i + f3i;
+			f3r = f2r - f3r;
+			f3i = f2i - f3i;
+			f0r = f4r + f5r;
+			f0i = f4i + f5i;
+			f5r = f4r - f5r;
+			f5i = f4i - f5i;
+			f2r = f6r + f7r;
+			f2i = f6i + f7i;
+			f7r = f6r - f7r;
+			f7i = f6i - f7i;
+
+			*(p1r) = scale*t0r;
+			*(p1r+1) = scale*t0i;
+			*(p1r+2) = scale*f1r;
+			*(p1r+(2+1)) = scale*f1i;
+			*(p1r+posA) = scale*t1r;
+			*(p1r+posAi) = scale*t1i;
+			*(p1r+posB) = scale*f3r;
+			*(p1r+posBi) = scale*f3i;
+			*(p0r) = scale*f0r;
+			*(p0r+1) = scale*f0i;
+			*(p0r+2) = scale*f5r;
+			*(p0r+(2+1)) = scale*f5i;
+			*(p0r+posA) = scale*f2r;
+			*(p0r+posAi) = scale*f2i;
+			*(p0r+posB) = scale*f7r;
+			*(p0r+posBi) = scale*f7i;
+
+			p0r -= Nrems2;
+			f0r = *(p0r);
+			f0i = *(p0r+1);
+			f1r = *(p0r+posA);
+			f1i = *(p0r+posAi);
+			iCol -= 1;
+			p1r = IOP + BRLow[iCol]*4;
+		};
+		f2r = *(p0r+2);
+		f2i = *(p0r+(2+1));
+		f3r = *(p0r+posB);
+		f3i = *(p0r+posBi);
+
+		t0r   = f0r + f1r;
+		t0i   = f0i + f1i;
+		f1r = f0r - f1r;
+		f1i = f0i - f1i;
+		t1r   = f2r + f3r;
+		t1i   = f2i + f3i;
+		f3r = f2r - f3r;
+		f3i = f2i - f3i;
+
+		*(p0r) = scale*t0r;
+		*(p0r+1) = scale*t0i;
+		*(p0r+2) = scale*f1r;
+		*(p0r+(2+1)) = scale*f1i;
+		*(p0r+posA) = scale*t1r;
+		*(p0r+posAi) = scale*t1i;
+		*(p0r+posB) = scale*f3r;
+		*(p0r+posBi) = scale*f3i;
+
+	};
+};
+}
+
+inline void ifft2pt(float *ioptr, float scale);
+inline void ifft2pt(float *ioptr, float scale){
+/***   RADIX 2 ifft	***/
+float f0r, f0i, f1r, f1i;
+float t0r, t0i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[2];
+f1i = ioptr[3];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0
+		f1	-  1 -	f1
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+	/* store result */
+ioptr[0] = scale*t0r;
+ioptr[1] = scale*t0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+}
+
+inline void ifft4pt(float *ioptr, float scale);
+inline void ifft4pt(float *ioptr, float scale){
+/***   RADIX 4 ifft	***/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float t0r, t0i, t1r, t1i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[4];
+f1i = ioptr[5];
+f2r = ioptr[2];
+f2i = ioptr[3];
+f3r = ioptr[6];
+f3i = ioptr[7];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0	-	-	f0
+		f1	-  1 -	f1	-	-	f1
+		f2	-	-	f2	-  1 -	f2
+		f3	-  1 -	t1	-  i -	f3
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r + t1i;
+f3i = f1i - t1r;
+f1r = f1r - t1i;
+f1i = f1i + t1r;
+
+	/* store result */
+ioptr[0] = scale*f0r;
+ioptr[1] = scale*f0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[4] = scale*f2r;
+ioptr[5] = scale*f2i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+}
+
+inline void ifft8pt(float *ioptr, float scale);
+inline void ifft8pt(float *ioptr, float scale){
+/***   RADIX 8 ifft	***/
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[8];
+f1i = ioptr[9];
+f2r = ioptr[4];
+f2i = ioptr[5];
+f3r = ioptr[12];
+f3i = ioptr[13];
+f4r = ioptr[2];
+f4i = ioptr[3];
+f5r = ioptr[10];
+f5i = ioptr[11];
+f6r = ioptr[6];
+f6i = ioptr[7];
+f7r = ioptr[14];
+f7i = ioptr[15];
+
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1	-  1 -	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	-  1 -	f2	-	-	f2
+			f3	-  1 -	t1	-  i -	f3	-	-	f3
+			f4	-	-	t0	-	-	f4	-  1 -	t0
+			f5	-  1 -	f5	-	-	f5	- w3 -	f4
+			f6	-	-	f6	-  1 -	f6	-  i -	t1
+			f7	-  1 -	t1	-  i -	f7	- iw3-	f6
+			*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r + t1i;
+f3i = f1i - t1r;
+f1r = f1r - t1i;
+f1i = f1i + t1r;
+
+
+t0r = f4r + f5r;
+t0i = f4i + f5i;
+f5r = f4r - f5r;
+f5i = f4i - f5i;
+
+t1r = f6r - f7r;
+t1i = f6i - f7i;
+f6r = f6r + f7r;
+f6i = f6i + f7i;
+
+f4r = t0r + f6r;
+f4i = t0i + f6i;
+f6r = t0r - f6r;
+f6i = t0i - f6i;
+
+f7r = f5r + t1i;
+f7i = f5i - t1r;
+f5r = f5r - t1i;
+f5i = f5i + t1r;
+
+
+t0r = f0r - f4r;
+t0i = f0i - f4i;
+f0r = f0r + f4r;
+f0i = f0i + f4i;
+
+t1r = f2r + f6i;
+t1i = f2i - f6r;
+f2r = f2r - f6i;
+f2i = f2i + f6r;
+
+f4r = f1r - f5r * w0r + f5i * w0r;
+f4i = f1i - f5r * w0r - f5i * w0r;
+f1r = f1r * Two - f4r;
+f1i = f1i * Two - f4i;
+
+f6r = f3r + f7r * w0r + f7i * w0r;
+f6i = f3i - f7r * w0r + f7i * w0r;
+f3r = f3r * Two - f6r;
+f3i = f3i * Two - f6i;
+
+	/* store result */
+ioptr[0] = scale*f0r;
+ioptr[1] = scale*f0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[4] = scale*f2r;
+ioptr[5] = scale*f2i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+ioptr[8] = scale*t0r;
+ioptr[9] = scale*t0i;
+ioptr[10] = scale*f4r;
+ioptr[11] = scale*f4i;
+ioptr[12] = scale*t1r;
+ioptr[13] = scale*t1i;
+ioptr[14] = scale*f6r;
+ioptr[15] = scale*f6i;
+}
+
+inline void ibfR2(float *ioptr, long M, long NDiffU);
+inline void ibfR2(float *ioptr, long M, long NDiffU){
+/*** 2nd radix 2 stage ***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long 	NSameU;
+unsigned long 	SameUCnt;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 4;
+pos = 2;
+posi = pos+1;
+NSameU = POW2(M) / 4 /NDiffU;	// 4 Us at a time
+pstrt = ioptr;
+p0r = pstrt;
+p1r = pstrt+pinc;
+p2r = p1r+pinc;
+p3r = p2r+pinc;
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4
+		f1	-  1 -	f5
+		f2	-	-	f6
+		f3	-  1 -	f7
+		*/
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4
+		f1	-  1 -	f5
+		f2	-	-	f6
+		f3	-  1 -	f7
+		*/
+
+for (SameUCnt = NSameU; SameUCnt > 0 ; SameUCnt--){
+
+	f0r = *p0r;
+	f1r = *p1r;
+	f0i = *(p0r + 1);
+	f1i = *(p1r + 1);
+	f2r = *p2r;
+	f3r = *p3r;
+	f2i = *(p2r + 1);
+	f3i = *(p3r + 1);
+
+	f4r = f0r + f1r;
+	f4i = f0i + f1i;
+	f5r = f0r - f1r;
+	f5i = f0i - f1i;
+
+	f6r = f2r + f3r;
+	f6i = f2i + f3i;
+	f7r = f2r - f3r;
+	f7i = f2i - f3i;
+
+	*p0r = f4r;
+	*(p0r + 1) = f4i;
+	*p1r = f5r;
+	*(p1r + 1) = f5i;
+	*p2r = f6r;
+	*(p2r + 1) = f6i;
+	*p3r = f7r;
+	*(p3r + 1) = f7i;
+
+	f0r = *(p0r + pos);
+	f1i = *(p1r + posi);
+	f0i = *(p0r + posi);
+	f1r = *(p1r + pos);
+	f2r = *(p2r + pos);
+	f3i = *(p3r + posi);
+	f2i = *(p2r + posi);
+	f3r = *(p3r + pos);
+
+	f4r = f0r - f1i;
+	f4i = f0i + f1r;
+	f5r = f0r + f1i;
+	f5i = f0i - f1r;
+
+	f6r = f2r - f3i;
+	f6i = f2i + f3r;
+	f7r = f2r + f3i;
+	f7i = f2i - f3r;
+
+	*(p0r + pos) = f4r;
+	*(p0r + posi) = f4i;
+	*(p1r + pos) = f5r;
+	*(p1r + posi) = f5i;
+	*(p2r + pos) = f6r;
+	*(p2r + posi) = f6i;
+	*(p3r + pos) = f7r;
+	*(p3r + posi) = f7i;
+
+	p0r += pnext;
+	p1r += pnext;
+	p2r += pnext;
+	p3r += pnext;
+
+}
+}
+
+inline void ibfR4(float *ioptr, long M, long NDiffU);
+inline void ibfR4(float *ioptr, long M, long NDiffU){
+/*** 1 radix 4 stage ***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long	pnexti;
+unsigned long 	NSameU;
+unsigned long 	SameUCnt;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+
+float w1r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t1r, t1i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 4;
+pnexti =  pnext + 1;
+pos = 2;
+posi = pos+1;
+NSameU = POW2(M) / 4 /NDiffU;	// 4 pts per butterfly
+pstrt = ioptr;
+p0r = pstrt;
+p1r = pstrt+pinc;
+p2r = p1r+pinc;
+p3r = p2r+pinc;
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	f0	-	-	f4
+		f1	-  1 -	f5	-	-	f5
+		f2	-	-	f6	-  1 -	f6
+		f3	-  1 -	f3	- -i -	f7
+		*/
+		/* Butterflys		*/
+		/*
+		f0	-	-	f4	-	-	f4
+		f1	- -i -	t1	-	-	f5
+		f2	-	-	f2	- w1 -	f6
+		f3	- -i -	f7	- iw1-	f7
+		*/
+
+f0r = *p0r;
+f1r = *p1r;
+f2r = *p2r;
+f3r = *p3r;
+f0i = *(p0r + 1);
+f1i = *(p1r + 1);
+f2i = *(p2r + 1);
+f3i = *(p3r + 1);
+
+f5r = f0r - f1r;
+f5i = f0i - f1i;
+f0r = f0r + f1r;
+f0i = f0i + f1i;
+
+f6r = f2r + f3r;
+f6i = f2i + f3i;
+f3r = f2r - f3r;
+f3i = f2i - f3i;
+
+for (SameUCnt = NSameU-1; SameUCnt > 0 ; SameUCnt--){
+
+	f7r = f5r + f3i;
+	f7i = f5i - f3r;
+	f5r = f5r - f3i;
+	f5i = f5i + f3r;
+
+	f4r = f0r + f6r;
+	f4i = f0i + f6i;
+	f6r = f0r - f6r;
+	f6i = f0i - f6i;
+
+	f2r = *(p2r + pos);
+	f2i = *(p2r + posi);
+	f1r = *(p1r + pos);
+	f1i = *(p1r + posi);
+	f3i = *(p3r + posi);
+	f0r = *(p0r + pos);
+	f3r = *(p3r + pos);
+	f0i = *(p0r + posi);
+
+	*p3r = f7r;
+	*p0r = f4r;
+	*(p3r + 1) = f7i;
+	*(p0r + 1) = f4i;
+	*p1r = f5r;
+	*p2r = f6r;
+	*(p1r + 1) = f5i;
+	*(p2r + 1) = f6i;
+
+	f7r = f2r + f3i;
+	f7i = f2i - f3r;
+	f2r = f2r - f3i;
+	f2i = f2i + f3r;
+
+	f4r = f0r - f1i;
+	f4i = f0i + f1r;
+	t1r = f0r + f1i;
+	t1i = f0i - f1r;
+
+	f5r = t1r - f7r * w1r - f7i * w1r;
+	f5i = t1i + f7r * w1r - f7i * w1r;
+	f7r = t1r * Two - f5r;
+	f7i = t1i * Two - f5i;
+
+	f6r = f4r - f2r * w1r + f2i * w1r;
+	f6i = f4i - f2r * w1r - f2i * w1r;
+	f4r = f4r * Two - f6r;
+	f4i = f4i * Two - f6i;
+
+	f3r = *(p3r + pnext);
+	f0r = *(p0r + pnext);
+	f3i = *(p3r + pnexti);
+	f0i = *(p0r + pnexti);
+	f2r = *(p2r + pnext);
+	f2i = *(p2r + pnexti);
+	f1r = *(p1r + pnext);
+	f1i = *(p1r + pnexti);
+
+	*(p2r + pos) = f6r;
+	*(p1r + pos) = f5r;
+	*(p2r + posi) = f6i;
+	*(p1r + posi) = f5i;
+	*(p3r + pos) = f7r;
+	*(p0r + pos) = f4r;
+	*(p3r + posi) = f7i;
+	*(p0r + posi) = f4i;
+
+	f6r = f2r + f3r;
+	f6i = f2i + f3i;
+	f3r = f2r - f3r;
+	f3i = f2i - f3i;
+
+	f5r = f0r - f1r;
+	f5i = f0i - f1i;
+	f0r = f0r + f1r;
+	f0i = f0i + f1i;
+
+	p3r += pnext;
+	p0r += pnext;
+	p1r += pnext;
+	p2r += pnext;
+
+}
+f7r = f5r + f3i;
+f7i = f5i - f3r;
+f5r = f5r - f3i;
+f5i = f5i + f3r;
+
+f4r = f0r + f6r;
+f4i = f0i + f6i;
+f6r = f0r - f6r;
+f6i = f0i - f6i;
+
+f2r = *(p2r + pos);
+f2i = *(p2r + posi);
+f1r = *(p1r + pos);
+f1i = *(p1r + posi);
+f3i = *(p3r + posi);
+f0r = *(p0r + pos);
+f3r = *(p3r + pos);
+f0i = *(p0r + posi);
+
+*p3r = f7r;
+*p0r = f4r;
+*(p3r + 1) = f7i;
+*(p0r + 1) = f4i;
+*p1r = f5r;
+*p2r = f6r;
+*(p1r + 1) = f5i;
+*(p2r + 1) = f6i;
+
+f7r = f2r + f3i;
+f7i = f2i - f3r;
+f2r = f2r - f3i;
+f2i = f2i + f3r;
+
+f4r = f0r - f1i;
+f4i = f0i + f1r;
+t1r = f0r + f1i;
+t1i = f0i - f1r;
+
+f5r = t1r - f7r * w1r - f7i * w1r;
+f5i = t1i + f7r * w1r - f7i * w1r;
+f7r = t1r * Two - f5r;
+f7i = t1i * Two - f5i;
+
+f6r = f4r - f2r * w1r + f2i * w1r;
+f6i = f4i - f2r * w1r - f2i * w1r;
+f4r = f4r * Two - f6r;
+f4i = f4i * Two - f6i;
+
+*(p2r + pos) = f6r;
+*(p1r + pos) = f5r;
+*(p2r + posi) = f6i;
+*(p1r + posi) = f5i;
+*(p3r + pos) = f7r;
+*(p0r + pos) = f4r;
+*(p3r + posi) = f7i;
+*(p0r + posi) = f4i;
+
+}
+
+inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+/***   RADIX 8 Stages	***/
+unsigned long	pos;
+unsigned long	posi;
+unsigned long	pinc;
+unsigned long	pnext;
+unsigned long 	NSameU;
+unsigned long 	Uinc;
+unsigned long 	Uinc2;
+unsigned long 	Uinc4;
+unsigned long 	DiffUCnt;
+unsigned long 	SameUCnt;
+unsigned long 	U2toU3;
+
+float	*pstrt;
+float 	*p0r, *p1r, *p2r, *p3r;
+float 	*u0r, *u0i, *u1r, *u1i, *u2r, *u2i;
+
+float w0r, w0i, w1r, w1i, w2r, w2i, w3r, w3i;
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+pinc = NDiffU * 2;		// 2 floats per complex
+pnext =  pinc * 8;
+pos = pinc * 4;
+posi =  pos + 1;
+NSameU = POW2(M) / 8 /NDiffU;	// 8 pts per butterfly
+Uinc = NSameU * Ustride;
+Uinc2 = Uinc * 2;
+Uinc4 = Uinc * 4;
+U2toU3 = (POW2(M) / 8)*Ustride;
+for (; StageCnt > 0 ; StageCnt--){
+
+	u0r = &Utbl[0];
+	u0i = &Utbl[POW2(M-2)*Ustride];
+	u1r = u0r;
+	u1i = u0i;
+	u2r = u0r;
+	u2i = u0i;
+
+	w0r =  *u0r;
+	w0i =  *u0i;
+	w1r =  *u1r;
+	w1i =  *u1i;
+	w2r =  *u2r;
+	w2i =  *u2i;
+	w3r =  *(u2r+U2toU3);
+	w3i =  *(u2i-U2toU3);
+
+	pstrt = ioptr;
+
+	p0r = pstrt;
+	p1r = pstrt+pinc;
+	p2r = p1r+pinc;
+	p3r = p2r+pinc;
+
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1	- w0-	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	- w1-	f2	-	-	f4
+			f3	- w0-	t1	- iw1-	f3	-	-	f5
+
+			f4	-	-	t0	-	-	f4	- w2-	t0
+			f5	- w0-	f5	-	-	f5	- w3-	t1
+			f6	-	-	f6	- w1-	f6	- iw2-	f6
+			f7	- w0-	t1	- iw1-	f7	- iw3-	f7
+			*/
+
+	for (DiffUCnt = NDiffU; DiffUCnt > 0 ; DiffUCnt--){
+		f0r = *p0r;
+		f0i = *(p0r + 1);
+		f1r = *p1r;
+		f1i = *(p1r + 1);
+		for (SameUCnt = NSameU-1; SameUCnt > 0 ; SameUCnt--){
+			f2r = *p2r;
+			f2i = *(p2r + 1);
+			f3r = *p3r;
+			f3i = *(p3r + 1);
+
+			t0r = f0r + f1r * w0r - f1i * w0i;
+			t0i = f0i + f1r * w0i + f1i * w0r;
+			f1r = f0r * Two - t0r;
+			f1i = f0i * Two - t0i;
+
+			f4r = *(p0r + pos);
+			f4i = *(p0r + posi);
+			f5r = *(p1r + pos);
+			f5i = *(p1r + posi);
+
+			f6r = *(p2r + pos);
+			f6i = *(p2r + posi);
+			f7r = *(p3r + pos);
+			f7i = *(p3r + posi);
+
+			t1r = f2r - f3r * w0r + f3i * w0i;
+			t1i = f2i - f3r * w0i - f3i * w0r;
+			f2r = f2r * Two - t1r;
+			f2i = f2i * Two - t1i;
+
+			f0r = t0r + f2r * w1r - f2i * w1i;
+			f0i = t0i + f2r * w1i + f2i * w1r;
+			f2r = t0r * Two - f0r;
+			f2i = t0i * Two - f0i;
+
+			f3r = f1r + t1r * w1i + t1i * w1r;
+			f3i = f1i - t1r * w1r + t1i * w1i;
+			f1r = f1r * Two - f3r;
+			f1i = f1i * Two - f3i;
+
+
+			t0r = f4r + f5r * w0r - f5i * w0i;
+			t0i = f4i + f5r * w0i + f5i * w0r;
+			f5r = f4r * Two - t0r;
+			f5i = f4i * Two - t0i;
+
+			t1r = f6r - f7r * w0r + f7i * w0i;
+			t1i = f6i - f7r * w0i - f7i * w0r;
+			f6r = f6r * Two - t1r;
+			f6i = f6i * Two - t1i;
+
+			f4r = t0r + f6r * w1r - f6i * w1i;
+			f4i = t0i + f6r * w1i + f6i * w1r;
+			f6r = t0r * Two - f4r;
+			f6i = t0i * Two - f4i;
+
+			f7r = f5r + t1r * w1i + t1i * w1r;
+			f7i = f5i - t1r * w1r + t1i * w1i;
+			f5r = f5r * Two - f7r;
+			f5i = f5i * Two - f7i;
+
+			t0r = f0r - f4r * w2r + f4i * w2i;
+			t0i = f0i - f4r * w2i - f4i * w2r;
+			f0r = f0r * Two - t0r;
+			f0i = f0i * Two - t0i;
+
+			t1r = f1r - f5r * w3r + f5i * w3i;
+			t1i = f1i - f5r * w3i - f5i * w3r;
+			f1r = f1r * Two - t1r;
+			f1i = f1i * Two - t1i;
+
+			*(p0r + pos) = t0r;
+			*(p0r + posi) = t0i;
+			*p0r = f0r;
+			*(p0r + 1) = f0i;
+
+			p0r += pnext;
+			f0r = *p0r;
+			f0i = *(p0r + 1);
+
+			*(p1r + pos) = t1r;
+			*(p1r + posi) = t1i;
+			*p1r = f1r;
+			*(p1r + 1) = f1i;
+
+			p1r += pnext;
+
+			f1r = *p1r;
+			f1i = *(p1r + 1);
+
+			f4r = f2r - f6r * w2i - f6i * w2r;
+			f4i = f2i + f6r * w2r - f6i * w2i;
+			f6r = f2r * Two - f4r;
+			f6i = f2i * Two - f4i;
+
+			f5r = f3r - f7r * w3i - f7i * w3r;
+			f5i = f3i + f7r * w3r - f7i * w3i;
+			f7r = f3r * Two - f5r;
+			f7i = f3i * Two - f5i;
+
+			*p2r = f4r;
+			*(p2r + 1) = f4i;
+			*(p2r + pos) = f6r;
+			*(p2r + posi) = f6i;
+
+			p2r += pnext;
+
+			*p3r = f5r;
+			*(p3r + 1) = f5i;
+			*(p3r + pos) = f7r;
+			*(p3r + posi) = f7i;
+
+			p3r += pnext;
+
+		}
+		
+		f2r = *p2r;
+		f2i = *(p2r + 1);
+		f3r = *p3r;
+		f3i = *(p3r + 1);
+
+		t0r = f0r + f1r * w0r - f1i * w0i;
+		t0i = f0i + f1r * w0i + f1i * w0r;
+		f1r = f0r * Two - t0r;
+		f1i = f0i * Two - t0i;
+
+		f4r = *(p0r + pos);
+		f4i = *(p0r + posi);
+		f5r = *(p1r + pos);
+		f5i = *(p1r + posi);
+
+		f6r = *(p2r + pos);
+		f6i = *(p2r + posi);
+		f7r = *(p3r + pos);
+		f7i = *(p3r + posi);
+
+		t1r = f2r - f3r * w0r + f3i * w0i;
+		t1i = f2i - f3r * w0i - f3i * w0r;
+		f2r = f2r * Two - t1r;
+		f2i = f2i * Two - t1i;
+
+		f0r = t0r + f2r * w1r - f2i * w1i;
+		f0i = t0i + f2r * w1i + f2i * w1r;
+		f2r = t0r * Two - f0r;
+		f2i = t0i * Two - f0i;
+
+		f3r = f1r + t1r * w1i + t1i * w1r;
+		f3i = f1i - t1r * w1r + t1i * w1i;
+		f1r = f1r * Two - f3r;
+		f1i = f1i * Two - f3i;
+
+		if (DiffUCnt == NDiffU/2)
+			Uinc4 = -Uinc4;
+
+		u0r += Uinc4;
+		u0i -= Uinc4;
+		u1r += Uinc2;
+		u1i -= Uinc2;
+		u2r += Uinc;
+		u2i -= Uinc;
+
+		pstrt += 2;
+
+		t0r = f4r + f5r * w0r - f5i * w0i;
+		t0i = f4i + f5r * w0i + f5i * w0r;
+		f5r = f4r * Two - t0r;
+		f5i = f4i * Two - t0i;
+
+		t1r = f6r - f7r * w0r + f7i * w0i;
+		t1i = f6i - f7r * w0i - f7i * w0r;
+		f6r = f6r * Two - t1r;
+		f6i = f6i * Two - t1i;
+
+		f4r = t0r + f6r * w1r - f6i * w1i;
+		f4i = t0i + f6r * w1i + f6i * w1r;
+		f6r = t0r * Two - f4r;
+		f6i = t0i * Two - f4i;
+
+		f7r = f5r + t1r * w1i + t1i * w1r;
+		f7i = f5i - t1r * w1r + t1i * w1i;
+		f5r = f5r * Two - f7r;
+		f5i = f5i * Two - f7i;
+
+		w0r = *u0r;
+		w0i =  *u0i;
+		w1r =  *u1r;
+		w1i =  *u1i;
+
+		if (DiffUCnt <= NDiffU/2)
+			w0r = -w0r;
+
+		t0r = f0r - f4r * w2r + f4i * w2i;
+		t0i = f0i - f4r * w2i - f4i * w2r;
+		f0r = f0r * Two - t0r;
+		f0i = f0i * Two - t0i;
+
+		f4r = f2r - f6r * w2i - f6i * w2r;
+		f4i = f2i + f6r * w2r - f6i * w2i;
+		f6r = f2r * Two - f4r;
+		f6i = f2i * Two - f4i;
+
+		*(p0r + pos) = t0r;
+		*p2r = f4r;
+		*(p0r + posi) = t0i;
+		*(p2r + 1) = f4i;
+		w2r =  *u2r;
+		w2i =  *u2i;
+		*p0r = f0r;
+		*(p2r + pos) = f6r;
+		*(p0r + 1) = f0i;
+		*(p2r + posi) = f6i;
+
+		p0r = pstrt;
+		p2r = pstrt + pinc + pinc;	
+
+		t1r = f1r - f5r * w3r + f5i * w3i;
+		t1i = f1i - f5r * w3i - f5i * w3r;
+		f1r = f1r * Two - t1r;
+		f1i = f1i * Two - t1i;
+
+		f5r = f3r - f7r * w3i - f7i * w3r;
+		f5i = f3i + f7r * w3r - f7i * w3i;
+		f7r = f3r * Two - f5r;
+		f7i = f3i * Two - f5i;
+
+		*(p1r + pos) = t1r;
+		*p3r = f5r;
+		*(p1r + posi) = t1i;
+		*(p3r + 1) = f5i;
+		w3r =  *(u2r+U2toU3);
+		w3i =  *(u2i-U2toU3);
+		*p1r = f1r;
+		*(p3r + pos) = f7r;
+		*(p1r + 1) = f1i;
+		*(p3r + posi) = f7i;
+
+		p1r = pstrt + pinc;
+		p3r = p2r + pinc;	
+	}
+	NSameU /= 8;
+	Uinc /= 8;
+	Uinc2 /= 8;
+	Uinc4 = Uinc * 4;
+	NDiffU *= 8;
+	pinc *= 8;
+	pnext *= 8;
+	pos *= 8;
+	posi =  pos + 1;
+}
+}
+
+void ifftrecurs(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+void ifftrecurs(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+/* recursive bfstages calls to maximize on chip cache efficiency */
+long i1;
+if (M <= MCACHE)
+	ibfstages(ioptr, M, Utbl, Ustride, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+else{
+	for (i1=0; i1<8; i1++){
+		ifftrecurs(&ioptr[i1*POW2(M-3)*2], M-3, Utbl, 8*Ustride, NDiffU, StageCnt-1);	/*  RADIX 8 Stages	*/
+	}
+	ibfstages(ioptr, M, Utbl, Ustride, POW2(M-3), 1);	/*  RADIX 8 Stage	*/
+}
+}
+
+void iffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){
+/* Compute in-place inverse complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	*/
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+long 	StageCnt;
+long 	NDiffU;
+const float scale = 1.0/POW2(M);
+
+switch (M){
+case 0:
+	break;
+case 1:
+	for (;Rows>0;Rows--){
+		ifft2pt(ioptr, scale);				/* a 2 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 2:
+	for (;Rows>0;Rows--){
+		ifft4pt(ioptr, scale);				/* a 4 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 3:
+	for (;Rows>0;Rows--){
+		ifft8pt(ioptr, scale);				/* an 8 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+default:
+	for (;Rows>0;Rows--){
+
+		scbitrevR2(ioptr, M, BRLow, scale);	/* bit reverse and first radix 2 stage */
+		
+		StageCnt = (M-1) / 3;		// number of radix 8 stages
+		NDiffU = 2;				// one radix 2 stage already complete
+
+		if ( (M-1-(StageCnt * 3)) == 1 ){
+			ibfR2(ioptr, M, NDiffU);				/* 1 radix 2 stage */
+			NDiffU *= 2;
+		}
+
+		if ( (M-1-(StageCnt * 3)) == 2 ){
+			ibfR4(ioptr, M, NDiffU);			/* 1 radix 4 stage */
+			NDiffU *= 4;
+		}
+
+		if (M <= MCACHE)
+			ibfstages(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+
+		else{
+			ifftrecurs(ioptr, M, Utbl, 1, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+		}
+
+		ioptr += 2*POW2(M);
+	}
+}
+}
+
+/************************************************
+parts of rffts1
+*************************************************/
+
+inline void rfft1pt(float *ioptr);
+inline void rfft1pt(float *ioptr){
+/***   RADIX 2 rfft	***/
+float f0r, f0i;
+float t0r, t0i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+
+	/* finish rfft */
+t0r = 	f0r + f0i;
+t0i = 	f0r - f0i;
+
+	/* store result */
+ioptr[0] = t0r;
+ioptr[1] = t0i;
+}
+
+inline void rfft2pt(float *ioptr);
+inline void rfft2pt(float *ioptr){
+/***   RADIX 4 rfft	***/
+float f0r, f0i, f1r, f1i;
+float t0r, t0i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[2];
+f1i = ioptr[3];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0
+		f1	-  1 -	f1
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f1i - f0i;
+	/* finish rfft */
+f0r = 	t0r + t0i;
+f0i = 	t0r - t0i;
+
+	/* store result */
+ioptr[0] = f0r;
+ioptr[1] = f0i;
+ioptr[2] = f1r;
+ioptr[3] = f1i;
+}
+
+inline void rfft4pt(float *ioptr);
+inline void rfft4pt(float *ioptr){
+/***   RADIX 8 rfft	***/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float t0r, t0i, t1r, t1i;
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+const float Two = 2.0;
+const float scale = 0.5;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[4];
+f1i = ioptr[5];
+f2r = ioptr[2];
+f2i = ioptr[3];
+f3r = ioptr[6];
+f3i = ioptr[7];
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0	-	-	f0
+		f1	-  1 -	f1	-	-	f1
+		f2	-	-	f2	-  1 -	f2
+		f3	-  1 -	t1	- -i -	f3
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = f2i - t0i;	// neg for rfft
+
+f3r = f1r - t1i;
+f3i = f1i + t1r;
+f1r = f1r + t1i;
+f1i = f1i - t1r;
+
+	/* finish rfft */
+t0r = 	f0r + f0i;    /* compute Re(x[0]) */
+t0i = 	f0r - f0i;    /* compute Re(x[N/2]) */
+
+t1r = f1r + f3r;
+t1i = f1i - f3i;
+f0r = f1i + f3i;
+f0i = f3r - f1r;
+
+f1r = t1r + w0r * f0r + w0r * f0i;
+f1i = t1i - w0r * f0r + w0r * f0i;
+f3r = Two * t1r - f1r;
+f3i = f1i - Two * t1i;
+
+	/* store result */
+ioptr[4] = f2r;
+ioptr[5] = f2i;
+ioptr[0] = t0r;
+ioptr[1] = t0i;
+
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+}
+
+inline void rfft8pt(float *ioptr);
+inline void rfft8pt(float *ioptr){
+/***   RADIX 16 rfft	***/
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float w1r = MYCOSPID8; /* cos(pi/8)	*/
+float w1i = MYSINPID8; /* sin(pi/8)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+const float scale = 0.5;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+f1r = ioptr[8];
+f1i = ioptr[9];
+f2r = ioptr[4];
+f2i = ioptr[5];
+f3r = ioptr[12];
+f3i = ioptr[13];
+f4r = ioptr[2];
+f4i = ioptr[3];
+f5r = ioptr[10];
+f5i = ioptr[11];
+f6r = ioptr[6];
+f6i = ioptr[7];
+f7r = ioptr[14];
+f7i = ioptr[15];
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1	-  1 -	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	-  1 -	f2	-	-	f2
+			f3	-  1 -	t1	- -i -	f3	-	-	f3
+			f4	-	-	t0	-	-	f4	-  1 -	t0
+			f5	-  1 -	f5	-	-	f5	- w3 -	f4
+			f6	-	-	f6	-  1 -	f6	- -i -	t1
+			f7	-  1 -	t1	- -i -	f7	- iw3-	f6
+			*/
+
+t0r = f0r + f1r;
+t0i = f0i + f1i;
+f1r = f0r - f1r;
+f1i = f0i - f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r - t1i;
+f3i = f1i + t1r;
+f1r = f1r + t1i;
+f1i = f1i - t1r;
+
+
+t0r = f4r + f5r;
+t0i = f4i + f5i;
+f5r = f4r - f5r;
+f5i = f4i - f5i;
+
+t1r = f6r - f7r;
+t1i = f6i - f7i;
+f6r = f6r + f7r;
+f6i = f6i + f7i;
+
+f4r = t0r + f6r;
+f4i = t0i + f6i;
+f6r = t0r - f6r;
+f6i = t0i - f6i;
+
+f7r = f5r - t1i;
+f7i = f5i + t1r;
+f5r = f5r + t1i;
+f5i = f5i - t1r;
+
+
+t0r = f0r - f4r;
+t0i = f4i - f0i;	// neg for rfft
+f0r = f0r + f4r;
+f0i = f0i + f4i;
+
+t1r = f2r - f6i;
+t1i = f2i + f6r;
+f2r = f2r + f6i;
+f2i = f2i - f6r;
+
+f4r = f1r - f5r * w0r - f5i * w0r;
+f4i = f1i + f5r * w0r - f5i * w0r;
+f1r = f1r * Two - f4r;
+f1i = f1i * Two - f4i;
+
+f6r = f3r + f7r * w0r - f7i * w0r;
+f6i = f3i + f7r * w0r + f7i * w0r;
+f3r = f3r * Two - f6r;
+f3i = f3i * Two - f6i;
+
+	/* finish rfft */
+f5r = 	f0r + f0i;    /* compute Re(x[0]) */
+f5i = 	f0r - f0i;    /* compute Re(x[N/2]) */
+
+f0r = f2r + t1r;
+f0i = f2i - t1i;
+f7r = f2i + t1i;
+f7i = t1r - f2r;
+
+f2r = f0r + w0r * f7r + w0r * f7i;
+f2i = f0i - w0r * f7r + w0r * f7i;
+t1r = Two * f0r - f2r;
+t1i = f2i - Two * f0i;
+
+
+f0r = f1r + f6r;
+f0i = f1i - f6i;
+f7r = f1i + f6i;
+f7i = f6r - f1r;
+
+f1r = f0r + w1r * f7r + w1i * f7i;
+f1i = f0i - w1i * f7r + w1r * f7i;
+f6r = Two * f0r - f1r;
+f6i = f1i - Two * f0i;
+
+f0r = f3r + f4r;
+f0i = f3i - f4i;
+f7r = f3i + f4i;
+f7i = f4r - f3r;
+
+f3r = f0r + w1i * f7r + w1r * f7i;
+f3i = f0i - w1r * f7r + w1i * f7i;
+f4r = Two * f0r - f3r;
+f4i = f3i - Two * f0i;
+
+	/* store result */
+ioptr[8] = t0r;
+ioptr[9] = t0i;
+ioptr[0] = f5r;
+ioptr[1] = f5i;
+
+ioptr[4] = scale*f2r;
+ioptr[5] = scale*f2i;
+ioptr[12] = scale*t1r;
+ioptr[13] = scale*t1i;
+
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+ioptr[10] = scale*f4r;
+ioptr[11] = scale*f4i;
+ioptr[14] = scale*f6r;
+ioptr[15] = scale*f6i;
+}
+
+inline void frstage(float *ioptr, long M, float *Utbl);
+inline void frstage(float *ioptr, long M, float *Utbl){
+/*	Finish RFFT		*/
+
+unsigned long 	pos;
+unsigned long 	posi;
+unsigned long 	diffUcnt;
+
+float 	*p0r, *p1r;
+float 	*u0r, *u0i;
+
+float w0r, w0i;
+float f0r, f0i, f1r, f1i, f4r, f4i, f5r, f5i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+pos = POW2(M-1);
+posi = pos + 1;
+
+p0r = ioptr;
+p1r = ioptr + pos/2;
+
+u0r = Utbl + POW2(M-3);
+
+w0r =  *u0r,
+
+f0r = *(p0r);
+f0i = *(p0r + 1);
+f4r = *(p0r + pos);
+f4i = *(p0r + posi);
+f1r = *(p1r);
+f1i = *(p1r + 1);
+f5r = *(p1r + pos);
+f5i = *(p1r + posi);
+
+	t0r = Two * f0r + Two * f0i;    /* compute Re(x[0]) */
+	t0i = Two * f0r - Two * f0i;    /* compute Re(x[N/2]) */
+	t1r = f4r + f4r;
+	t1i = -f4i - f4i;
+
+	f0r = f1r + f5r;
+	f0i = f1i - f5i;
+	f4r = f1i + f5i;
+	f4i = f5r - f1r;
+
+	f1r = f0r + w0r * f4r + w0r * f4i;
+	f1i = f0i - w0r * f4r + w0r * f4i;
+	f5r = Two * f0r - f1r;
+	f5i = f1i - Two * f0i;
+
+*(p0r) = t0r;
+*(p0r + 1) = t0i;
+*(p0r + pos) = t1r;
+*(p0r + posi) = t1i;
+*(p1r) = f1r;
+*(p1r + 1) = f1i;
+*(p1r + pos) = f5r;
+*(p1r + posi) = f5i;
+
+u0r = Utbl + 1;
+u0i = Utbl + (POW2(M-2)-1);
+
+w0r =  *u0r,
+w0i =  *u0i;
+	
+p0r = (ioptr + 2);
+p1r = (ioptr + (POW2(M-2)-1)*2);
+
+				/* Butterflys */
+				/*
+		f0	-	t0	-	-	f0
+		f5	-	t1	- w0	-	f5
+
+		f1	-	t0	-	-	f1
+		f4	-	t1	-iw0 -	f4
+				*/
+
+for (diffUcnt = POW2(M-3)-1; diffUcnt > 0 ; diffUcnt--){
+
+	f0r = *(p0r);
+	f0i = *(p0r + 1);
+	f5r = *(p1r + pos);
+	f5i = *(p1r + posi);
+	f1r = *(p1r);
+	f1i = *(p1r + 1);
+	f4r = *(p0r + pos);
+	f4i = *(p0r + posi);
+
+	t0r = f0r + f5r;
+	t0i = f0i - f5i;
+	t1r = f0i + f5i;
+	t1i = f5r - f0r;
+
+	f0r = t0r + w0r * t1r + w0i * t1i;
+	f0i = t0i - w0i * t1r + w0r * t1i;
+	f5r = Two * t0r - f0r;
+	f5i = f0i - Two * t0i;
+
+	t0r = f1r + f4r;
+	t0i = f1i - f4i;
+	t1r = f1i + f4i;
+	t1i = f4r - f1r;
+
+	f1r = t0r + w0i * t1r + w0r * t1i;
+	f1i = t0i - w0r * t1r + w0i * t1i;
+	f4r = Two * t0r - f1r;
+	f4i = f1i - Two * t0i;
+
+	*(p0r) = f0r;
+	*(p0r + 1) = f0i;
+	*(p1r + pos) = f5r;
+	*(p1r + posi) = f5i;
+
+	w0r = *++u0r;
+	w0i = *--u0i;
+
+	*(p1r) = f1r;
+	*(p1r + 1) = f1i;
+	*(p0r + pos) = f4r;
+	*(p0r + posi) = f4i;
+
+	p0r += 2;
+	p1r -= 2;
+};
+}
+
+void rffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){
+/* Compute in-place real fft on the rows of the input array	*/
+/* The result is the complex spectra of the positive frequencies */
+/* except the location for the first complex number contains the real */
+/* values for DC and Nyquest */
+/* INPUTS */
+/* *ioptr = real input data array	*/
+/* M = log2 of fft size	*/
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	in the following order */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+
+float	scale;
+long 	StageCnt;
+long 	NDiffU;
+
+M=M-1;
+switch (M){
+case -1:
+	break;
+case 0:
+	for (;Rows>0;Rows--){
+		rfft1pt(ioptr);				/* a 2 pt fft */
+		ioptr += 2*POW2(M);
+	}
+case 1:
+	for (;Rows>0;Rows--){
+		rfft2pt(ioptr);				/* a 4 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 2:
+	for (;Rows>0;Rows--){
+		rfft4pt(ioptr);				/* an 8 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 3:
+	for (;Rows>0;Rows--){
+		rfft8pt(ioptr);				/* a 16 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+default:
+	scale = 0.5;
+	for (;Rows>0;Rows--){
+
+		scbitrevR2(ioptr, M, BRLow, scale);						/* bit reverse and first radix 2 stage */
+		
+		StageCnt = (M-1) / 3;		// number of radix 8 stages
+		NDiffU = 2;				// one radix 2 stage already complete
+
+		if ( (M-1-(StageCnt * 3)) == 1 ){
+			bfR2(ioptr, M, NDiffU);			/* 1 radix 2 stage */
+			NDiffU *= 2;
+		}
+
+		if ( (M-1-(StageCnt * 3)) == 2 ){
+			bfR4(ioptr, M, NDiffU);			/* 1 radix 4 stage */
+			NDiffU *= 4;
+		}
+
+		if (M <= MCACHE){
+			bfstages(ioptr, M, Utbl, 2, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+			frstage(ioptr, M+1, Utbl);
+		}
+
+		else{
+			fftrecurs(ioptr, M, Utbl, 2, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+			frstage(ioptr, M+1, Utbl);
+		}
+
+		ioptr += 2*POW2(M);
+	}
+}
+}
+
+/************************************************
+parts of riffts1
+*************************************************/
+
+inline void rifft1pt(float *ioptr, float scale);
+inline void rifft1pt(float *ioptr, float scale){
+/***   RADIX 2 rifft	***/
+float f0r, f0i;
+float t0r, t0i;
+
+	/* bit reversed load */
+f0r = ioptr[0];
+f0i = ioptr[1];
+
+	/* finish rfft */
+t0r = 	f0r + f0i;
+t0i = 	f0r - f0i;
+
+	/* store result */
+ioptr[0] = scale*t0r;
+ioptr[1] = scale*t0i;
+}
+
+inline void rifft2pt(float *ioptr, float scale);
+inline void rifft2pt(float *ioptr, float scale){
+/***   RADIX 4 rifft	***/
+float f0r, f0i, f1r, f1i;
+float t0r, t0i;
+const float Two = 2.0;
+
+	/* bit reversed load */
+t0r = ioptr[0];
+t0i = ioptr[1];
+f1r = Two * ioptr[2];
+f1i = Two * ioptr[3];
+
+	/* start rifft */
+f0r = 	t0r + t0i;
+f0i = 	t0r - t0i;
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0
+		f1	-  1 -	f1
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i - f1i;
+f1r = f0r - f1r;
+f1i = f0i + f1i;
+
+	/* store result */
+ioptr[0] = scale*t0r;
+ioptr[1] = scale*t0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+}
+
+inline void rifft4pt(float *ioptr, float scale);
+inline void rifft4pt(float *ioptr, float scale){
+/***   RADIX 8 rifft	***/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float t0r, t0i, t1r, t1i;
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+const float Two = 2.0;
+
+	/* bit reversed load */
+t0r = ioptr[0];
+t0i = ioptr[1];
+f2r = ioptr[2];
+f2i = ioptr[3];
+f1r = Two * ioptr[4];
+f1i = Two * ioptr[5];
+f3r = ioptr[6];
+f3i = ioptr[7];
+
+	/* start rfft */
+f0r = 	t0r + t0i;    /* compute Re(x[0]) */
+f0i = 	t0r - t0i;    /* compute Re(x[N/2]) */
+
+t1r = f2r + f3r;
+t1i = f2i - f3i;
+t0r = f2r - f3r;
+t0i = f2i + f3i;
+
+f2r = t1r - w0r * t0r - w0r * t0i;
+f2i = t1i + w0r * t0r - w0r * t0i;
+f3r = Two * t1r - f2r;
+f3i = f2i - Two * t1i;
+
+		/* Butterflys		*/
+		/*
+		f0	-	-	t0	-	-	f0
+		f1	-  1 -	f1	-	-	f1
+		f2	-	-	f2	-  1 -	f2
+		f3	-  1 -	t1	-  i -	f3
+		*/
+
+t0r = f0r + f1r;
+t0i = f0i - f1i;
+f1r = f0r - f1r;
+f1i = f0i + f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r + t1i;
+f3i = f1i - t1r;
+f1r = f1r - t1i;
+f1i = f1i + t1r;
+
+	/* store result */
+ioptr[0] = scale*f0r;
+ioptr[1] = scale*f0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[4] = scale*f2r;
+ioptr[5] = scale*f2i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+}
+
+inline void rifft8pt(float *ioptr, float scale);
+inline void rifft8pt(float *ioptr, float scale){
+/***   RADIX 16 rifft	***/
+float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+float w1r = MYCOSPID8; /* cos(pi/8)	*/
+float w1i = MYSINPID8; /* sin(pi/8)	*/
+float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+	/* bit reversed load */
+t0r = ioptr[0];
+t0i = ioptr[1];
+f4r = ioptr[2];
+f4i = ioptr[3];
+f2r = ioptr[4];
+f2i = ioptr[5];
+f6r = ioptr[6];
+f6i = ioptr[7];
+f1r = Two * ioptr[8];
+f1i = Two * ioptr[9];
+f5r = ioptr[10];
+f5i = ioptr[11];
+f3r = ioptr[12];
+f3i = ioptr[13];
+f7r = ioptr[14];
+f7i = ioptr[15];
+
+
+	/* start rfft */
+f0r = 	t0r + t0i;    /* compute Re(x[0]) */
+f0i = 	t0r - t0i;    /* compute Re(x[N/2]) */
+
+t0r = f2r + f3r;
+t0i = f2i - f3i;
+t1r = f2r - f3r;
+t1i = f2i + f3i;
+
+f2r = t0r - w0r * t1r - w0r * t1i;
+f2i = t0i + w0r * t1r - w0r * t1i;
+f3r = Two * t0r - f2r;
+f3i = f2i - Two * t0i;
+
+t0r = f4r + f7r;
+t0i = f4i - f7i;
+t1r = f4r - f7r;
+t1i = f4i + f7i;
+
+f4r = t0r - w1i * t1r - w1r * t1i;
+f4i = t0i + w1r * t1r - w1i * t1i;
+f7r = Two * t0r - f4r;
+f7i = f4i - Two * t0i;
+
+t0r = f6r + f5r;
+t0i = f6i - f5i;
+t1r = f6r - f5r;
+t1i = f6i + f5i;
+
+f6r = t0r - w1r * t1r - w1i * t1i;
+f6i = t0i + w1i * t1r - w1r * t1i;
+f5r = Two * t0r - f6r;
+f5i = f6i - Two * t0i;
+
+			/* Butterflys		*/
+			/*
+			f0	-	-	t0	-	-	f0	-	-	f0
+			f1*	-  1 -	f1	-	-	f1	-	-	f1
+			f2	-	-	f2	-  1 -	f2	-	-	f2
+			f3	-  1 -	t1	-  i -	f3	-	-	f3
+			f4	-	-	t0	-	-	f4	-  1 -	t0
+			f5	-  1 -	f5	-	-	f5	- w3 -	f4
+			f6	-	-	f6	-  1 -	f6	-  i -	t1
+			f7	-  1 -	t1	-  i -	f7	- iw3-	f6
+			*/
+
+t0r = f0r + f1r;
+t0i = f0i - f1i;
+f1r = f0r - f1r;
+f1i = f0i + f1i;
+
+t1r = f2r - f3r;
+t1i = f2i - f3i;
+f2r = f2r + f3r;
+f2i = f2i + f3i;
+
+f0r = t0r + f2r;
+f0i = t0i + f2i;
+f2r = t0r - f2r;
+f2i = t0i - f2i;
+
+f3r = f1r + t1i;
+f3i = f1i - t1r;
+f1r = f1r - t1i;
+f1i = f1i + t1r;
+
+
+t0r = f4r + f5r;
+t0i = f4i + f5i;
+f5r = f4r - f5r;
+f5i = f4i - f5i;
+
+t1r = f6r - f7r;
+t1i = f6i - f7i;
+f6r = f6r + f7r;
+f6i = f6i + f7i;
+
+f4r = t0r + f6r;
+f4i = t0i + f6i;
+f6r = t0r - f6r;
+f6i = t0i - f6i;
+
+f7r = f5r + t1i;
+f7i = f5i - t1r;
+f5r = f5r - t1i;
+f5i = f5i + t1r;
+
+
+t0r = f0r - f4r;
+t0i = f0i - f4i;
+f0r = f0r + f4r;
+f0i = f0i + f4i;
+
+t1r = f2r + f6i;
+t1i = f2i - f6r;
+f2r = f2r - f6i;
+f2i = f2i + f6r;
+
+f4r = f1r - f5r * w0r + f5i * w0r;
+f4i = f1i - f5r * w0r - f5i * w0r;
+f1r = f1r * Two - f4r;
+f1i = f1i * Two - f4i;
+
+f6r = f3r + f7r * w0r + f7i * w0r;
+f6i = f3i - f7r * w0r + f7i * w0r;
+f3r = f3r * Two - f6r;
+f3i = f3i * Two - f6i;
+
+	/* store result */
+ioptr[0] = scale*f0r;
+ioptr[1] = scale*f0i;
+ioptr[2] = scale*f1r;
+ioptr[3] = scale*f1i;
+ioptr[4] = scale*f2r;
+ioptr[5] = scale*f2i;
+ioptr[6] = scale*f3r;
+ioptr[7] = scale*f3i;
+ioptr[8] = scale*t0r;
+ioptr[9] = scale*t0i;
+ioptr[10] = scale*f4r;
+ioptr[11] = scale*f4i;
+ioptr[12] = scale*t1r;
+ioptr[13] = scale*t1i;
+ioptr[14] = scale*f6r;
+ioptr[15] = scale*f6i;
+}
+
+inline void ifrstage(float *ioptr, long M, float *Utbl);
+inline void ifrstage(float *ioptr, long M, float *Utbl){
+/*	Start RIFFT		*/
+
+unsigned long 	pos;
+unsigned long 	posi;
+unsigned long 	diffUcnt;
+
+float 	*p0r, *p1r;
+float 	*u0r, *u0i;
+
+float w0r, w0i;
+float f0r, f0i, f1r, f1i, f4r, f4i, f5r, f5i;
+float t0r, t0i, t1r, t1i;
+const float Two = 2.0;
+
+pos = POW2(M-1);
+posi = pos + 1;
+
+p0r = ioptr;
+p1r = ioptr + pos/2;
+
+u0r = Utbl + POW2(M-3);
+
+w0r =  *u0r,
+
+f0r = *(p0r);
+f0i = *(p0r + 1);
+f4r = *(p0r + pos);
+f4i = *(p0r + posi);
+f1r = *(p1r);
+f1i = *(p1r + 1);
+f5r = *(p1r + pos);
+f5i = *(p1r + posi);
+
+	t0r = f0r + f0i;
+	t0i = f0r - f0i;
+	t1r = f4r + f4r;
+	t1i = -f4i - f4i;
+
+	f0r = f1r + f5r;
+	f0i = f1i - f5i;
+	f4r = f1r - f5r;
+	f4i = f1i + f5i;
+
+	f1r = f0r - w0r * f4r - w0r * f4i;
+	f1i = f0i + w0r * f4r - w0r * f4i;
+	f5r = Two * f0r - f1r;
+	f5i = f1i - Two * f0i;
+
+*(p0r) = t0r;
+*(p0r + 1) = t0i;
+*(p0r + pos) = t1r;
+*(p0r + posi) = t1i;
+*(p1r) = f1r;
+*(p1r + 1) = f1i;
+*(p1r + pos) = f5r;
+*(p1r + posi) = f5i;
+
+u0r = Utbl + 1;
+u0i = Utbl + (POW2(M-2)-1);
+
+w0r =  *u0r,
+w0i =  *u0i;
+	
+p0r = (ioptr + 2);
+p1r = (ioptr + (POW2(M-2)-1)*2);
+
+				/* Butterflys */
+				/*
+		f0	-	 t0		-	f0
+		f1	-     t1     -w0-   f1
+
+		f2	-	 t0		-	f2
+		f3	-     t1	   -iw0-  f3
+				*/
+
+for (diffUcnt = POW2(M-3)-1; diffUcnt > 0 ; diffUcnt--){
+
+	f0r = *(p0r);
+	f0i = *(p0r + 1);
+	f5r = *(p1r + pos);
+	f5i = *(p1r + posi);
+	f1r = *(p1r);
+	f1i = *(p1r + 1);
+	f4r = *(p0r + pos);
+	f4i = *(p0r + posi);
+
+	t0r = f0r + f5r;
+	t0i = f0i - f5i;
+	t1r = f0r - f5r;
+	t1i = f0i + f5i;
+
+	f0r = t0r - w0i * t1r - w0r * t1i;
+	f0i = t0i + w0r * t1r - w0i * t1i;
+	f5r = Two * t0r - f0r;
+	f5i = f0i - Two * t0i;
+
+	t0r = f1r + f4r;
+	t0i = f1i - f4i;
+	t1r = f1r - f4r;
+	t1i = f1i + f4i;
+
+	f1r = t0r - w0r * t1r - w0i * t1i;
+	f1i = t0i + w0i * t1r - w0r * t1i;
+	f4r = Two * t0r - f1r;
+	f4i = f1i - Two * t0i;
+
+	*(p0r) = f0r;
+	*(p0r + 1) = f0i;
+	*(p1r + pos) = f5r;
+	*(p1r + posi) = f5i;
+
+	w0r = *++u0r;
+	w0i = *--u0i;
+
+	*(p1r) = f1r;
+	*(p1r + 1) = f1i;
+	*(p0r + pos) = f4r;
+	*(p0r + posi) = f4i;
+
+	p0r += 2;
+	p1r -= 2;
+};
+}
+
+void riffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){
+/* Compute in-place real ifft on the rows of the input array	*/
+/* data order as from rffts1 */
+/* INPUTS */
+/* *ioptr = input data array in the following order	*/
+/* M = log2 of fft size	*/
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = real output data array	*/
+
+float	scale;
+long 	StageCnt;
+long 	NDiffU;
+
+scale = 1.0/POW2(M);
+M=M-1;
+switch (M){
+case -1:
+	break;
+case 0:
+	for (;Rows>0;Rows--){
+		rifft1pt(ioptr, scale);				/* a 2 pt fft */
+		ioptr += 2*POW2(M);
+	}
+case 1:
+	for (;Rows>0;Rows--){
+		rifft2pt(ioptr, scale);				/* a 4 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 2:
+	for (;Rows>0;Rows--){
+		rifft4pt(ioptr, scale);				/* an 8 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+case 3:
+	for (;Rows>0;Rows--){
+		rifft8pt(ioptr, scale);				/* a 16 pt fft */
+		ioptr += 2*POW2(M);
+	}
+	break;
+default:
+	for (;Rows>0;Rows--){
+
+		ifrstage(ioptr, M+1, Utbl);
+
+		scbitrevR2(ioptr, M, BRLow, scale);						/* bit reverse and first radix 2 stage */
+		
+		StageCnt = (M-1) / 3;		// number of radix 8 stages
+		NDiffU = 2;				// one radix 2 stage already complete
+
+		if ( (M-1-(StageCnt * 3)) == 1 ){
+			ibfR2(ioptr, M, NDiffU);			/* 1 radix 2 stage */
+			NDiffU *= 2;
+		}
+
+		if ( (M-1-(StageCnt * 3)) == 2 ){
+			ibfR4(ioptr, M, NDiffU);			/* 1 radix 4 stage */
+			NDiffU *= 4;
+		}
+
+		if (M <= MCACHE){
+			ibfstages(ioptr, M, Utbl, 2, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+		}
+
+		else{
+			ifftrecurs(ioptr, M, Utbl, 2, NDiffU, StageCnt);		/*  RADIX 8 Stages	*/
+		}
+
+		ioptr += 2*POW2(M);
+	}
+}
+}
+
diff --git a/lib-src/libnyquist/nyquist/ffts/src/fftlib.h b/lib-src/libnyquist/nyquist/ffts/src/fftlib.h
new file mode 100644
index 0000000..86de4ac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/fftlib.h
@@ -0,0 +1,76 @@
+#define MYRECIPLN2	1.442695040888963407359924681001892137426	// 1.0/log(2)
+
+/* some useful conversions between a number and its power of 2 */
+#define LOG2(a)	(MYRECIPLN2*log(a))	// floating point logarithm base 2
+#define POW2(m) ((unsigned long) 1 << (m))	// integer power of 2 for m<32
+
+/*******************************************************************
+lower level fft stuff called by routines in fftext.c and fft2d.c
+*******************************************************************/
+
+void fftCosInit(long M, float *Utbl);
+/* Compute Utbl, the cosine table for ffts	*/
+/* of size (pow(2,M)/4 +1)	*/
+/* INPUTS */
+/* M = log2 of fft size	*/
+/* OUTPUTS */
+/* *Utbl = cosine table	*/
+
+void fftBRInit(long M, short *BRLow);
+/* Compute BRLow, the bit reversed table for ffts	*/
+/* of size pow(2,M/2 -1)	*/
+/* INPUTS */
+/* M = log2 of fft size	*/
+/* OUTPUTS */
+/* *BRLow = bit reversed counter table	*/
+
+void ffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow);
+/* Compute in-place complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	(ex M=10 for 1024 point fft) */
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+void iffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow);
+/* Compute in-place inverse complex fft on the rows of the input array	*/
+/* INPUTS */
+/* *ioptr = input data array	*/
+/* M = log2 of fft size	*/
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	*/
+
+void rffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow);
+/* Compute in-place real fft on the rows of the input array	*/
+/* The result is the complex spectra of the positive frequencies */
+/* except the location for the first complex number contains the real */
+/* values for DC and Nyquest */
+/* INPUTS */
+/* *ioptr = real input data array	*/
+/* M = log2 of fft size	*/
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = output data array	in the following order */
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+
+
+void riffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow);
+/* Compute in-place real ifft on the rows of the input array	*/
+/* data order as from rffts1 */
+/* INPUTS */
+/* *ioptr = input data array in the following order	*/
+/* M = log2 of fft size	*/
+/* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
+/* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array)	*/
+/* *Utbl = cosine table	*/
+/* *BRLow = bit reversed counter table	*/
+/* OUTPUTS */
+/* *ioptr = real output data array	*/
diff --git a/lib-src/libnyquist/nyquist/ffts/src/files b/lib-src/libnyquist/nyquist/ffts/src/files
new file mode 100644
index 0000000..2833fee
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/files
@@ -0,0 +1,22 @@
+tr "\r" "\n" < dxpose.c > tmp.c
+mv tmp.c dxpose.c
+tr "\r" "\n" < dxpose.h > tmp.c
+mv tmp.c dxpose.h
+tr "\r" "\n" < fft2d.c > tmp.c
+mv tmp.c fft2d.c
+tr "\r" "\n" < fft2d.h > tmp.c
+mv tmp.c fft2d.h
+tr "\r" "\n" < fftext.c > tmp.c
+mv tmp.c fftext.c
+tr "\r" "\n" < fftext.h > tmp.c
+mv tmp.c fftext.h
+tr "\r" "\n" < fftlib.c > tmp.c
+mv tmp.c fftlib.c
+tr "\r" "\n" < fftlib.h > tmp.c
+mv tmp.c fftlib.h
+tr "\r" "\n" < files > tmp.c
+mv tmp.c n" < files
+tr "\r" "\n" < matlib.c > tmp.c
+mv tmp.c matlib.c
+tr "\r" "\n" < matlib.h > tmp.c
+mv tmp.c matlib.h
diff --git a/lib-src/libnyquist/nyquist/ffts/src/matlib.c b/lib-src/libnyquist/nyquist/ffts/src/matlib.c
new file mode 100644
index 0000000..4e8b682
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/matlib.c
@@ -0,0 +1,297 @@
+/* a few routines from a vector/matrix library */
+#include "matlib.h"
+
+void xpose(float *indata, long iRsiz, float *outdata, long oRsiz, long Nrows, long Ncols){
+/* not in-place matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
+
+float	*irow; 		/* pointer to input row start */
+float	*ocol; 		/* pointer to output col start */
+float	*idata; 	/* pointer to input data */
+float	*odata; 	/* pointer to output data */
+long 	RowCnt;		/* row counter */
+long 	ColCnt;		/* col counter */
+float	T0; 		/* data storage */
+float	T1; 		/* data storage */
+float	T2; 		/* data storage */
+float	T3; 		/* data storage */
+float	T4; 		/* data storage */
+float	T5; 		/* data storage */
+float	T6; 		/* data storage */
+float	T7; 		/* data storage */
+const long inRsizd1 = iRsiz;
+const long inRsizd2 = 2*iRsiz;
+const long inRsizd3 = inRsizd2+iRsiz;
+const long inRsizd4 = 4*iRsiz;
+const long inRsizd5 = inRsizd3+inRsizd2;
+const long inRsizd6 = inRsizd4+inRsizd2;
+const long inRsizd7 = inRsizd4+inRsizd3;
+const long inRsizd8 = 8*iRsiz;
+
+ocol = outdata;
+irow = indata;
+for (RowCnt=Nrows/8; RowCnt>0; RowCnt--){
+	idata = irow;
+	odata = ocol;
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		T0 = *idata;
+		T1 = *(idata+inRsizd1);
+		T2 = *(idata+inRsizd2);
+		T3 = *(idata+inRsizd3);
+		T4 = *(idata+inRsizd4);
+		T5 = *(idata+inRsizd5);
+		T6 = *(idata+inRsizd6);
+		T7 = *(idata+inRsizd7);
+		*odata = T0;
+		*(odata+1) = T1;
+		*(odata+2) = T2;
+		*(odata+3) = T3;
+		*(odata+4) = T4;
+		*(odata+5) = T5;
+		*(odata+6) = T6;
+		*(odata+7) = T7;
+		idata++;
+		odata += oRsiz;
+	}
+	irow += inRsizd8;
+	ocol += 8;
+}
+if (Nrows%8 != 0){
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		idata = irow++;
+		odata = ocol;
+		ocol += oRsiz;
+		for (RowCnt=Nrows%8; RowCnt>0; RowCnt--){
+			T0 = *idata;
+			*odata++ = T0;
+			idata += iRsiz;
+		}
+	}
+}
+}
+
+void cxpose(float *indata, long iRsiz, float *outdata, long oRsiz, long Nrows, long Ncols){
+/* not in-place complex float matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
+
+float	*irow; 		/* pointer to input row start */
+float	*ocol; 		/* pointer to output col start */
+float	*idata; 	/* pointer to input data */
+float	*odata; 	/* pointer to output data */
+long 	RowCnt;		/* row counter */
+long 	ColCnt;		/* col counter */
+float	T0r; 		/* data storage */
+float	T0i; 		/* data storage */
+float	T1r; 		/* data storage */
+float	T1i; 		/* data storage */
+float	T2r; 		/* data storage */
+float	T2i; 		/* data storage */
+float	T3r; 		/* data storage */
+float	T3i; 		/* data storage */
+const long inRsizd1 = 2*iRsiz;
+const long inRsizd1i = 2*iRsiz + 1;
+const long inRsizd2 = 4*iRsiz;
+const long inRsizd2i = 4*iRsiz + 1;
+const long inRsizd3 = inRsizd2+inRsizd1;
+const long inRsizd3i = inRsizd2+inRsizd1 + 1;
+const long inRsizd4 = 8*iRsiz;
+
+ocol = outdata;
+irow = indata;
+for (RowCnt=Nrows/4; RowCnt>0; RowCnt--){
+	idata = irow;
+	odata = ocol;
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		T0r = *idata;
+		T0i = *(idata +1);
+		T1r = *(idata+inRsizd1);
+		T1i = *(idata+inRsizd1i);
+		T2r = *(idata+inRsizd2);
+		T2i = *(idata+inRsizd2i);
+		T3r = *(idata+inRsizd3);
+		T3i = *(idata+inRsizd3i);
+		*odata = T0r;
+		*(odata+1) = T0i;
+		*(odata+2) = T1r;
+		*(odata+3) = T1i;
+		*(odata+4) = T2r;
+		*(odata+5) = T2i;
+		*(odata+6) = T3r;
+		*(odata+7) = T3i;
+		idata+=2;
+		odata += 2*oRsiz;
+	}
+	irow += inRsizd4;
+	ocol += 8;
+}
+if (Nrows%4 != 0){
+	for (ColCnt=Ncols; ColCnt>0; ColCnt--){
+		idata = irow;
+		odata = ocol;
+		for (RowCnt=Nrows%4; RowCnt>0; RowCnt--){
+			T0r = *idata;
+			T0i = *(idata+1);
+			*odata = T0r;
+			*(odata+1) = T0i;
+			odata+=2;
+			idata += 2*iRsiz;
+		}
+		irow+=2;
+		ocol += 2*oRsiz;
+	}
+}
+}
+
+void cvprod(float *a, float *b, float *out, long N){
+/* complex vector product, can be in-place */
+/* product of complex vector *a times complex vector *b */
+/* INPUTS */
+/* N vector length */
+/* *a complex vector length N complex numbers */
+/* *b complex vector length N complex numbers */
+/* OUTPUTS */
+/* *out complex vector length N */
+
+long	OutCnt;		/* output counter */
+float	A0R; 		/* A storage */
+float	A0I; 		/* A storage */
+float	A1R; 		/* A storage */
+float	A1I; 		/* A storage */
+float	A2R; 		/* A storage */
+float	A2I; 		/* A storage */
+float	A3R; 		/* A storage */
+float	A3I; 		/* A storage */
+float	B0R; 		/* B storage */
+float	B0I; 		/* B storage */
+float	B1R; 		/* B storage */
+float	B1I; 		/* B storage */
+float	B2R; 		/* B storage */
+float	B2I; 		/* B storage */
+float	B3R; 		/* B storage */
+float	B3I; 		/* B storage */
+float	T0R; 		/* TMP storage */
+float	T0I; 		/* TMP storage */
+float	T1R; 		/* TMP storage */
+float	T1I; 		/* TMP storage */
+float	T2R; 		/* TMP storage */
+float	T2I; 		/* TMP storage */
+float	T3R; 		/* TMP storage */
+float	T3I; 		/* TMP storage */
+
+if (N>=4){
+	A0R = *a;
+	B0R = *b;
+	A0I = *(a +1);
+	B0I = *(b +1);
+	A1R = *(a +2);
+	B1R = *(b +2);
+	A1I = *(a +3);
+	B1I = *(b +3);
+	A2R = *(a +4);
+	B2R = *(b +4);
+	A2I = *(a +5);
+	B2I = *(b +5);
+	A3R = *(a +6);
+	B3R = *(b +6);
+	A3I = *(a +7);
+	B3I = *(b +7);
+	T0R = A0R * B0R;
+	T0I = (A0R * B0I);
+	T1R = A1R * B1R;
+	T1I = (A1R * B1I);
+	T2R = A2R * B2R;
+	T2I = (A2R * B2I);
+	T3R = A3R * B3R;
+	T3I = (A3R * B3I);
+	T0R -= (A0I * B0I);
+	T0I = A0I * B0R + T0I;
+	T1R -= (A1I * B1I);
+	T1I = A1I * B1R + T1I;
+	T2R -= (A2I * B2I);
+	T2I = A2I * B2R + T2I;
+	T3R -= (A3I * B3I);
+	T3I = A3I * B3R + T3I;
+	for (OutCnt=N/4-1; OutCnt > 0; OutCnt--){
+		a += 8;
+		b += 8;
+		A0R = *a;
+		B0R = *b;
+		A0I = *(a +1);
+		B0I = *(b +1);
+		A1R = *(a +2);
+		B1R = *(b +2);
+		A1I = *(a +3);
+		B1I = *(b +3);
+		A2R = *(a +4);
+		B2R = *(b +4);
+		A2I = *(a +5);
+		B2I = *(b +5);
+		A3R = *(a +6);
+		B3R = *(b +6);
+		A3I = *(a +7);
+		B3I = *(b +7);
+		*out = T0R;
+		*(out +1) = T0I;
+		*(out +2) = T1R;
+		*(out +3) = T1I;
+		*(out +4) = T2R;
+		*(out +5) = T2I;
+		*(out +6) = T3R;
+		*(out +7) = T3I;
+		T0R = A0R * B0R;
+		T0I = (A0R * B0I);
+		T1R = A1R * B1R;
+		T1I = (A1R * B1I);
+		T2R = A2R * B2R;
+		T2I = (A2R * B2I);
+		T3R = A3R * B3R;
+		T3I = (A3R * B3I);
+		T0R -= (A0I * B0I);
+		T0I = A0I * B0R + T0I;
+		T1R -= (A1I * B1I);
+		T1I = A1I * B1R + T1I;
+		T2R -= (A2I * B2I);
+		T2I = A2I * B2R + T2I;
+		T3R -= (A3I * B3I);
+		T3I = A3I * B3R + T3I;
+		out += 8;
+	}
+	a += 8;
+	b += 8;
+	*out = T0R;
+	*(out +1) = T0I;
+	*(out +2) = T1R;
+	*(out +3) = T1I;
+	*(out +4) = T2R;
+	*(out +5) = T2I;
+	*(out +6) = T3R;
+	*(out +7) = T3I;
+	out += 8;
+}
+for (OutCnt=N%4; OutCnt > 0; OutCnt--){
+	A0R = *a++;
+	B0R = *b++;
+	A0I = *a++;
+	B0I = *b++;
+	T0R = A0R * B0R;
+	T0I = (A0R * B0I);
+	T0R -= (A0I * B0I);
+	T0I = A0I * B0R + T0I;
+	*out++ = T0R;
+	*out++ = T0I;
+}
+}
diff --git a/lib-src/libnyquist/nyquist/ffts/src/matlib.h b/lib-src/libnyquist/nyquist/ffts/src/matlib.h
new file mode 100644
index 0000000..baf9e6e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/ffts/src/matlib.h
@@ -0,0 +1,33 @@
+/* a few routines from a vector/matrix library */
+
+void xpose(float *indata, long iRsiz, float *outdata, long oRsiz, long Nrows, long Ncols);
+/* not in-place matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
+
+void cxpose(float *indata, long iRsiz, float *outdata, long oRsiz, long Nrows, long Ncols);
+/* not in-place complex matrix transpose	*/
+/* INPUTS */
+/* *indata = input data array	*/
+/* iRsiz = offset to between rows of input data array	*/
+/* oRsiz = offset to between rows of output data array	*/
+/* Nrows = number of rows in input data array	*/
+/* Ncols = number of columns in input data array	*/
+/* OUTPUTS */
+/* *outdata = output data array	*/
+
+void cvprod(float *a, float *b, float *out, long N);
+/* complex vector product, can be in-place */
+/* product of complex vector *a times complex vector *b */
+/* INPUTS */
+/* N vector length */
+/* *a complex vector length N complex numbers */
+/* *b complex vector length N complex numbers */
+/* OUTPUTS */
+/* *out complex vector length N */
diff --git a/lib-src/libnyquist/nyquist/license.txt b/lib-src/libnyquist/nyquist/license.txt
new file mode 100644
index 0000000..3b320cc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/license.txt
@@ -0,0 +1,116 @@
+LICENSE INFORMATION
+
+Nyquist is built upon and derived from XLISP. Both are copyrighted software.
+Two copyright notices and licenses appear below.
+
+In addition, Nyquist uses two LGPL libraries: libsndfile and liblo.
+These libraries are NOT covered by the Nyquist license, and Nyquist
+is NOT licensed under or restricted by GPL or LGPL licenses. The
+license agreements for libsndfile and liblo can be found in the 
+Nyquist source libraries nyquist/nylsf and nyquist/liblo, respectively.
+
+--------------------------------------------------------------------------------
+COPYRIGHT AND LICENSE INFORMATION FOR NYQUIST
+
+Copyright (c) 2000-2002, by Roger B. Dannenberg
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer.
+
+Redistributions of source code must retain the copyright notice, the
+list of conditions, and the disclaimer, all three of which appear below under
+"COPYRIGHT AND LICENSE INFORMATION FOR XLISP."
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Redistributions in binary form must reproduce the copyright notice, the
+list of conditions, and the disclaimer, all three of which appear below under
+"COPYRIGHT AND LICENSE INFORMATION FOR XLISP," in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of Roger B. Dannenberg, Carnegie Mellon University, nor the 
+names of any contributors may be used to endorse or promote products derived 
+from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+What follows is not a part of the license:
+
+Please send bug fixes and improvements to me at the address below.
+
+Please do not distribute modified versions of Nyquist without permission.
+
+Any redistribution of Nyquist should include a notice that Nyquist can be
+obtained free from http://www.cs.cmu.edu/~music.
+
+In addition, as a courtesy, I ask that you send me a copy of any product that
+makes substantial use of Nyquist. Please contact me at the address below for my
+current mailing address. I am asking this because I enjoy learning about
+applications of my software.
+
+When Nyquist is used to generate music and conduct research, please mention
+and acknowledge the use of Nyquist in program notes, acknowledgement sections
+of papers, and whereever thanks or credits would normally be given.
+
+Roger B. Dannenberg
+
+roger.dannenberg at cs.cmu.edu
+
+--------------------------------------------------------------------------------
+COPYRIGHT AND LICENSE INFORMATION FOR XLISP
+
+Copyright (c) 1984-2002, by David Michael Betz
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer. 
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of David Michael Betz nor the names of any contributors may be
+used to endorse or promote products derived from this software without specific
+prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+What follows is not a part of the license:
+
+Please send bug fixes and improvements to me at the address below.
+
+In addition, as a courtesy, I ask that you send me a copy of any product that
+makes substantial use of XLISP. Please contact me at the address below for my
+current mailing address. I am asking this because I enjoy learning about
+applications of my software.
+
+David Betz
+
+dbetz at xlisper.mv.com
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/add.c b/lib-src/libnyquist/nyquist/nyqsrc/add.c
new file mode 100644
index 0000000..24ae7e4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/add.c
@@ -0,0 +1,898 @@
+/* add.c -- add two signals */
+/* CHANGE LOG
+ * 19May92 rbd  fix t0 to mean time rather than samples
+                fix to logically stop and terminate at MAX of 2 inputs
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+/* DOCUMENTATION:
+     Most DSP modules in Nyquist select a single fetch routine
+and use it until the signal terminates.  The ADD operation
+instead can use a number of different fetch routines in sequence.
+This allows ADD to do the most efficient computation, such as
+simply copying pointers when only one input signal is defined
+(the other is zero.)
+     Here's what the functions assume and do:
+add_s1_s2_nn_fetch: both arguments (s1, s2) have signals; add
+    them.
+add_s1_nn_fetch: only s1 is active, so pass along pointers if 
+    possible.  Revert to add_s1_s2_nn_fetch when s2 becomes active.
+add_s2_nn_fetch: symetric with add_s1_nn_fetch.
+add_zero_fill_nn_fetch: fill in when one input has terminated and
+    the other hasn't begun.
+
+An important optimization (we think) is the ability to collapse
+ADD operations.  When one operand goes to zero, the ADD just
+passes along pointers to blocks from the other operand.  In some
+cases, we can just splice out the ADD suspension and link
+directly to the suspension of the second operand.
+
+Doing this requires that there be no scale factors, so ADD does
+not deal with scaling.  If an operand comes in with a scale
+factor, ADD will create a rescaling of the operand.
+*/
+
+#include "switches.h"
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "cext.h"
+#include "scale.h"
+#include "multiseq.h"
+#include "add.h"
+#include "assert.h"
+
+
+#define debugA 0
+#define A if (debugA)
+/* I don't know how these debug switches (A and D) differ: */
+#define D A
+
+/* switch B is/was to look for a particular zero block length bug */
+#define debugB 0
+#define B if (debugB | debugA) 
+
+/* #define GC_DEBUG 1 */
+
+
+void add_s1_s2_nn_fetch(add_susp_type, snd_list_type);
+void add_s1_nn_fetch(add_susp_type, snd_list_type);
+void add_s2_nn_fetch(add_susp_type, snd_list_type);
+void add_zero_fill_nn_fetch(add_susp_type, snd_list_type);
+void add_free();
+
+
+void add_s1_s2_nn_fetch(susp, snd_list)
+  register add_susp_type susp;
+  snd_list_type snd_list;
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+    register sample_block_values_type s1_ptr_reg;
+    register sample_block_values_type s2_ptr_reg;
+    register sample_block_values_type out_ptr_reg;
+
+#ifdef GC_DEBUG
+    snd_list_report(snd_list, "add_s1_s2_nn_fetch");
+#endif
+    /* assume the snd_list is the one with a null block */
+    /* put a fresh, clean block in the snd_list (get new snd_list later) */
+    falloc_sample_block(out, "add_s1_s2_nn_fetch");
+    snd_list->block = out;
+    out_ptr = out->samples;
+A   nyquist_printf("add[%p,%p] (s1_s2_nn) %p new block %p\n", 
+                   susp->s1, susp->s2, susp, out);
+    
+    /* fill up the new block */
+    while (cnt < max_sample_block_len && susp->terminate_bits == 0) {
+A       nyquist_printf("add[%p,%p] (s1_s2_nn) %p starting outer loop, cnt %d\n",
+               susp->s1, susp->s2, susp, cnt);
+        
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = max_sample_block_len - cnt;
+        
+        /* don't run past the s1 input sample block: */
+A	nyquist_printf("add[%p,%p]: look for samples (for s1) \n", susp->s1, susp->s2);
+/*        if (!susp->s1->list->block) watch_susp(susp->s1->list->u.susp); */
+        susp_check_term_log_block_samples(s1, s1_bptr, s1_ptr, s1_cnt, 1, 3);
+A	nyquist_printf("add[%p,%p]: found samples (for s1) s1_cnt=%d\n",
+               susp->s1, susp->s2, (int)susp->s1_cnt);
+        togo = MIN(togo, susp->s1_cnt);
+        if (susp->terminate_bits & 1) {
+A	    nyquist_printf("add[%p,%p]: terminate bits on (for s1) togo=%d\n",
+                   susp->s1, susp->s2, togo);
+        }
+        
+        /* don't run past the s2 input sample block: */
+A	nyquist_printf("add[%p,%p]: look for samples (for s2) \n", susp->s1, susp->s2);
+        susp_check_term_log_block_samples(s2, s2_bptr, s2_ptr, s2_cnt, 2, 3);
+A	nyquist_printf("add[%p,%p]: found samples (for s2) s2_cnt=%d\n",
+               susp->s1, susp->s2, (int)susp->s2_cnt);
+        togo = MIN(togo, susp->s2_cnt);
+A	if (susp->terminate_bits & 2) {
+            nyquist_printf("add[%p,%p]: terminate bits on (for s2) togo=%d\n",
+                   susp->s1, susp->s2, togo);
+        }
+        
+        /* don't run past logical stop time (need to check this even
+         * if a sound has terminated)
+         */
+A	nyquist_printf(
+ "add[%p,%p] (s1_s2_nn) %p: logically_stopped %d, logical_stop_cnt %d, s1 logical_stop_cnt %d, s2 logical_stop_cnt %d \n",
+               susp->s1, susp->s2, susp, susp->logically_stopped, 
+               (int) susp->susp.log_stop_cnt,
+               susp->s1->logical_stop_cnt,
+               susp->s2->logical_stop_cnt);
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN &&
+            (susp->logical_stop_bits == 3)) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+A	    nyquist_printf("add[%p,%p]: to_stop = %d\n", susp->s1, susp->s2, to_stop);
+            /* logical stops have to be indicated on block boundaries */
+            if (to_stop < togo) {
+                if (to_stop == 0) {
+                    if (cnt) {
+                        togo = 0;
+                        break; /* block is non-empty, log-stop on next block */
+                    } else /* to_stop is 0, indicate logical stop immediately */
+                        susp->logically_stopped = true;
+                } else {
+                    /* logical stop will take place on the following block,
+                     * so compute up to logical stop and return partial block
+                     */
+                    togo = to_stop;
+                }
+            }
+        }
+        
+        /* check please */
+        if (susp->terminate_bits) {
+            break;
+        }
+        
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+D	    nyquist_printf("add[%p,%p]: togo = %d\n", susp->s1, susp->s2, togo);
+            if (togo == 0) break;
+        }
+        
+        n = togo;
+A	nyquist_printf("add[%p,%p] (s1_s2_nn) %p starting inner loop, n %d\n", 
+               susp->s1, susp->s2, susp, n);
+        s1_ptr_reg = susp->s1_ptr;
+        s2_ptr_reg = susp->s2_ptr;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            /* scale? */
+A 	    nyquist_printf("add_s1_s2_nn: %g + %g\n", *s1_ptr_reg, *s2_ptr_reg);
+            *out_ptr_reg++ = *(s1_ptr_reg++) + *(s2_ptr_reg++);
+        } while (--n); /* inner loop */
+        /* using s1_ptr_reg is a bad idea on RS/6000 */
+        susp->s1_ptr += togo;
+        /* using s2_ptr_reg is a bad idea on RS/6000 */
+        susp->s2_ptr += togo;
+        /* using out_ptr_reg is a bad idea on RS/6000 */
+        out_ptr += togo;
+        susp_took(s1_cnt, togo);
+        susp_took(s2_cnt, togo);
+        cnt += togo;
+    } /* outer loop */
+    
+A   nyquist_printf("add[%p,%p] (s1_s2_nn) %p ending outer loop, cnt %d\n",
+           susp->s1, susp->s2, susp, cnt);
+    
+    snd_list->block_len = cnt;
+    
+    /* test for logical stop  - normally this is detected by 
+     * susp.log_stop_cnt == susp->susp.current, but then the logical
+     * stop flag is set on the NEXT block. To remember to set on the
+     * NEXT block, set susp->logically_stopped, which is also tested
+     * below.  One special case is if the current block should indicate
+     * logically stopped (this happens sometimes when the sounds have
+     * zero logical length) then susp->logically_stopped will be set
+     * (see above) and we just never test susp->susp.log_stop_cnt.
+     */
+    if (susp->logically_stopped) {
+A   nyquist_printf("add[%p,%p] (s1_s2_nn) %p->logically_stopped already true\n",
+           susp->s1, susp->s2, susp);
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current &&
+               susp->logical_stop_bits == 3) {
+A   nyquist_printf("add[%p,%p] (s1_s2_nn) %p->logically_stopped set to true\n",
+           susp->s1, susp->s2, susp);
+        susp->logically_stopped = true;
+    }
+    
+    /* test for termination of s1 */
+    if (susp->terminate_bits == 3) {
+D	nyquist_printf("add[%p,%p] (s1_s2_nn) s1 and s2 terminated, unrefed\n",
+               susp->s1, susp->s2);
+        /* free susp and point to terminal zeros (leaving pending snd_lists)*/
+        if (cnt) {
+            /* we have samples, put zero_block at end */
+            snd_list_unref(snd_list->u.next);
+            snd_list->u.next = zero_snd_list;
+        } else {
+            /* no samples generated */
+            snd_list_terminate(snd_list);
+        }
+D	nyquist_printf("add[%p,%p] (s1_s2_nn) %p terminated.\n",
+               susp->s1, susp->s2, susp);
+    } else {
+        if (susp->terminate_bits & 1) {
+D	    nyquist_printf("add[%p,%p] (s1_s2_nn) s1 terminated, unrefed\n",
+                   susp->s1, susp->s2);
+            sound_unref(susp->s1);
+            susp->s1 = NULL;
+            susp->susp.fetch = add_s2_nn_fetch;
+D           nyquist_printf("add_s1_s2_nn_fetch: add_s2_nn_fetch installed\n");
+            if (cnt == 0) {
+D		nyquist_printf("add[%p,%p]: calling add_s2_nn_fetch\n",
+                       susp->s1, susp->s2);
+                add_s2_nn_fetch(susp, snd_list);
+            }
+        }
+        else if (susp->terminate_bits & 2) {
+D	    nyquist_printf("add[%p,%p] (s1_s2_nn) s2 terminated, unrefed\n",
+                   susp->s1, susp->s2);
+            sound_unref(susp->s2);
+            susp->s2 = NULL;
+            susp->susp.fetch = add_s1_nn_fetch;
+D           stdputstr("add_s1_s2_nn_fetch: add_s1_nn_fetch installed\n");
+            if (cnt == 0) {
+D		nyquist_printf("add[%p,%p]: calling add_s1_nn_fetch\n",
+                       susp->s1, susp->s2);
+                add_s1_nn_fetch(susp, snd_list);
+            }
+        }
+        
+        /* add a new snd_list for the susp */
+        susp->susp.current += cnt;
+    }
+
+} /* add_s1_s2_nn_fetch */
+
+
+
+/* Note that add_s1_nn_fetch and add_s2_nn_fetch are symetric.
+ * They should probably be made into one routine, but for now,
+ * any changes to one should be made to the other.
+ */
+void add_s1_nn_fetch(susp, snd_list)
+  register add_susp_type susp;
+  snd_list_type snd_list;
+{
+    /* expansion of add_s_nn_fetch(snd_list,s1,s2,1); follows: */
+    int togo, s2_start=0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+D   nyquist_printf("add_s1_nn_fetch(susp %p, snd_list %p, s1_cnt %d)\n",
+           susp, snd_list, (int)susp->s1_cnt);
+
+#ifdef GC_DEBUG
+    snd_list_report(snd_list, "add_s1_nn_fetch");
+#endif
+    /*
+     * first compute how many samples to copy (or transfer)
+     */
+
+    /* see what the next samples look like */
+    susp_check_term_log_block_samples(s1, s1_bptr,
+                                      s1_ptr, s1_cnt, 1, 3);
+B   if (susp->terminate_bits & 1)
+        nyquist_printf("add[%p,%p]: s1 terminates\n", susp->s1, susp->s2);
+
+    /* don't run past the s1 input sample block: */
+    togo = susp->s1_cnt;
+B   if (togo == 0) stdputstr("togo is zero at checkpoint 1\n");
+
+    /* don't run past terminate time of this signal */
+/*    if (susp->s1_ptr == zero_block->samples) { -sep21 RBD*/
+    if (susp->terminate_bits & 1) {
+        if (susp->s2) {
+            s2_start = (long) ((susp->s2->t0 - susp->susp.t0) *
+                susp->s2->sr + 0.5);
+D 	    nyquist_printf("add_s_nn_fetch: s2_start %d\n", s2_start);
+        }
+        togo = 0;
+B       if (togo == 0) stdputstr("togo is zero at checkpoint 2\n");
+        if (susp->s2 && susp->susp.current == s2_start) {
+            /* s2 starting and s1 stops */
+            /* go to s2 alone state */
+            sound_unref(susp->s1);
+            susp->s1 = NULL;
+            susp->susp.fetch = add_s2_nn_fetch;
+D            stdputstr("add_s_nn_fetch: other installed, calling now...\n");
+            add_s2_nn_fetch(susp, snd_list);
+        } else if (susp->s2 && susp->susp.current < s2_start) {
+            /* s2 not started and s1 stops */
+            /* go to zero-fill state */
+            sound_unref(susp->s1);
+            susp->s1 = NULL;
+            susp->susp.fetch = add_zero_fill_nn_fetch;
+B           stdputstr("add_s_nn_fetch: zero_fill installed\n");
+            add_zero_fill_nn_fetch(susp, snd_list);
+        } else if (susp->s2) {
+D	    stdputstr("add_s_nn_fetch: unexpected condition\n");
+            EXIT(1);
+        } else /* no s2 */ {
+            snd_list_terminate(snd_list);
+        }
+D	nyquist_printf("add_s_nn_fetch: special return, susp %p\n", susp);
+        return; /* fetching taken care of by another routine */
+    }
+/*    if (susp->terminate_cnt != UNKNOWN &&
+        susp->terminate_cnt <= susp->susp.current + togo) {
+        togo = susp->terminate_cnt - susp->susp.current;
+    }
+ */
+    /* don't run past logical stop time */
+    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN &&
+        susp->logical_stop_bits == 3) {
+        int to_stop = susp->susp.log_stop_cnt - susp->susp.current;
+        if (to_stop < togo) {
+            if (to_stop == 0) {
+                susp->logically_stopped = true;
+            } else togo = to_stop;
+        }
+B       if (togo == 0) stdputstr("togo is zero at checkpoint 3\n");
+D	nyquist_printf("add_s1_nn_fetch: to_stop %d togo %d\n", to_stop, togo);
+    }
+
+    /* consider other signal? don't run past its start time... */
+    if (susp->s2) {
+        s2_start = ROUND((susp->s2->t0 - susp->susp.t0) *
+            susp->s2->sr);
+        if (s2_start < susp->susp.current + togo)
+            togo = MIN(togo, s2_start - susp->susp.current);
+B           if (togo == 0) stdputstr("togo is zero at checkpoint 4\n");
+    }
+
+    /*
+     * two cases: copy a partial block or manipulate pointers for
+     * copyless transfer of whole block (may not be full block):
+     *
+     * copy partial block when:
+     *   o samples begin in middle of block
+     *   o stopping time is before end of block (when other signal
+     *     splits the block for this signal)
+     * transfer (copyless) block when:
+     *   o the block is of maximum size
+     *   o the block is small due to logical stop time or termination
+     *     time
+     */
+    if (susp->s1_ptr == susp->s1_bptr->samples &&
+        susp->s1_cnt == togo) {
+        /*
+         * we want to copy this whole block (starting at the beginning
+         * and going to the rest of the block) -- just do pointers.
+         */
+
+        /* just fetch and pass blocks on */
+        if (0) nyquist_printf("add[%p,%p] (s%d_nn) %p starting uncopy, togo %d\n", susp->s1, susp->s2,
+               1, susp, togo);
+        snd_list->block = susp->s1_bptr;
+        (susp->s1_bptr->refcnt)++;
+        if (0) nyquist_printf("add[%p,%p] (s%d_nn) %p shared block %p zero_block %p\n",susp->s1, susp->s2,
+               1, susp, susp->s1_bptr, zero_block);
+
+        susp_took(s1_cnt, togo);
+        snd_list->block_len = togo;
+
+        /* if other is terminated and sound_types match, collapse */
+        /* NOTE: in order to collapse, we need s2 to be generating
+         * blocks and linking them onto a sound list.  This is true
+         * when the get_next fn is SND_get_next.  (A counterexample is
+         * SND_get_zeros, which returns zero blocks but does not link
+         * them onto the sound list.
+         */
+        if (0) nyquist_printf("s2 %p thissr %g suspsr %g get_next %d lsc %d\n",
+                susp->s2, susp->s1->sr, susp->susp.sr,
+                susp->s1->get_next == SND_get_next,
+                susp->s1->logical_stop_cnt == UNKNOWN);
+        if (susp->s2 == NULL && susp->s1->sr == susp->susp.sr &&
+            susp->s1->get_next == SND_get_next &&
+            susp->s1->logical_stop_cnt == UNKNOWN) {
+            snd_list_type addend_list;
+D	    nyquist_printf("add[%p,%p]: collapsing! LSC %d\n", susp->s1, susp->s2,
+                      (int)susp->s1->logical_stop_cnt);
+D	    sound_print_tree(susp->s1);
+            /* will "current" values match? */
+            /* test for logical stop */
+            if (susp->logically_stopped) {
+                snd_list->logically_stopped = true;
+            }
+            else if (susp->susp.log_stop_cnt == susp->susp.current) {
+                susp->logically_stopped = true;
+            }
+            /* free the superfluous sound_type and susp */
+            addend_list = susp->s1->list->u.next;
+            snd_list_ref(addend_list);
+            snd_list_unref(snd_list->u.next);
+            snd_list->u.next = addend_list;
+            return;
+        }
+    } else {
+        /*
+         * we want to copy a partial block
+         */
+
+        /* assume the snd_list is the one with a null block */
+        /*
+         * put a fresh, clean block in the snd_list
+         * (get new snd_list later)
+         */
+        falloc_sample_block(out, "add_s1_nn_fetch");
+        snd_list->block = out;
+        out_ptr = out->samples;
+B        nyquist_printf("add[%p,%p] (s1_nn) %p new block %p, s1_ptr %p block %p s1_cnt %d togo %d\n", susp->s1, susp->s2, susp, out, susp->s1_ptr, susp->s1_bptr->samples, (int)susp->s1_cnt, togo);
+        n = togo;
+B       if (togo == 0) stdputstr("togo is zero at checkpoint 5\n");
+B	if (togo == 0) nyquist_printf(
+        "add[%p,%p] (s%d_nn) %p starting copy loop, togo %d\n",
+               susp->s1, susp->s2, 1, susp, togo);
+        while (n--) { /* the inner sample computation loop */
+            /* scale? */
+            *out_ptr++ = *(susp->s1_ptr++);
+        } /* inner loop */
+
+        susp_took(s1_cnt, togo);
+        snd_list->block_len = togo;
+    }
+
+    /* add a new snd_list for the susp */
+    susp->susp.current += togo;
+
+D   stdputstr("testing...");
+    /*
+     * test for termination or change of state,
+     * note s2_start computed earlier
+     */
+    if (susp->s2 && susp->susp.current == s2_start &&
+        susp->s1->list != zero_snd_list) {
+        /* s2 starting and s1 continues */
+        /* go to s1+s2 state */
+        susp->susp.fetch = add_s1_s2_nn_fetch;
+D        stdputstr("add_s_nn_fetch: add_s1_s2_fetch installed\n");
+    } else if (susp->terminate_bits == 3) {
+        /* s2 finished and s1 stops */
+        /* go to terminal state */
+        susp->s1 = NULL;
+D        nyquist_printf("add_s_nn_fetch: go to terminal state.  susp->s2 %p, \
+               susp->susp.current %d, s2_start %d, susp->s1->list %p, \
+               zero_snd_list %p\n", susp->s2, (int)susp->susp.current,
+               s2_start, susp->s1->list, zero_snd_list);
+        /* !!! free resources and set up pointers to terminal snd_list */
+        /* !!! logically stopped? */
+    }
+
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+D        stdputstr("add_s_nn_fetch: snd_list->logically_stopped\n");
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current &&
+               susp->logical_stop_bits == 3) {
+D        stdputstr("add_s_nn_fetch: susp->logically_stopped\n");
+        susp->logically_stopped = true;
+    }
+D    {
+        if (susp->logically_stopped || snd_list->logically_stopped) 
+            stdputstr("STOPPED\n");
+        else nyquist_printf("ok: current %d\n", (int)susp->susp.current); }
+}
+
+
+void add_s2_nn_fetch(susp, snd_list)
+  register add_susp_type susp;
+  snd_list_type snd_list;
+{
+    int togo, s1_start=0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+D   nyquist_printf("add_s2_nn_fetch(susp %p, snd_list %p)\n",
+           susp, snd_list);
+
+#ifdef GC_DEBUG
+    snd_list_report(snd_list, "add_s2_nn_fetch");
+#endif
+
+    /*
+     * first compute how many samples to copy (or transfer)
+     */
+
+    /* see what the next samples look like */
+    susp_check_term_log_block_samples(s2, s2_bptr,
+                                      s2_ptr, s2_cnt, 2, 3);
+
+    /* don't run past the s2 input sample block: */
+    togo = susp->s2_cnt;
+    assert(togo > 0);
+
+    /* don't run past terminate time of this signal */
+    /* if (susp->s2_ptr == zero_block->samples) { -sep21 RBD*/
+    if (susp->terminate_bits & 2) {
+        if (susp->s1) {
+            s1_start = ROUND((susp->s1->t0 - susp->susp.t0) *
+                susp->s1->sr);
+             if (0) nyquist_printf("add_s_nn_fetch: s1_start %d\n", s1_start);
+        }
+        togo = 0;
+        if (susp->s1 && susp->susp.current == s1_start) {
+            /* s1 starting and s2 stops */
+            /* go to s1 alone state */
+            sound_unref(susp->s2);
+            susp->s2 = NULL;
+            susp->susp.fetch = add_s1_nn_fetch;
+D            stdputstr("add_s_nn_fetch: other installed, calling now...\n");
+            add_s1_nn_fetch(susp, snd_list);
+        } else if (susp->s1 && susp->susp.current < s1_start) {
+            /* s1 not started and s2 stops */
+            /* go to zero-fill state */
+            sound_unref(susp->s2);
+            susp->s2 = NULL;
+            susp->susp.fetch = add_zero_fill_nn_fetch;
+D            stdputstr("add_s_nn_fetch: zero_fill installed\n");
+            add_zero_fill_nn_fetch(susp, snd_list);
+        } else if (susp->s1) {
+D	    stdputstr("add_s_nn_fetch: unexpected condition\n");
+            EXIT(1);
+        } else /* no s1 */ {
+            snd_list_terminate(snd_list);
+        }
+D	nyquist_printf("add_s_nn_fetch: special return, susp %p\n", susp);
+        return; /* fetching taken care of by another routine */
+    }
+/*    if (susp->terminate_cnt != UNKNOWN &&
+        susp->terminate_cnt <= susp->susp.current + togo) {
+        togo = susp->terminate_cnt - susp->susp.current;
+    }
+ */
+    /* don't run past logical stop time */
+    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN &&
+        /* check if we've seen the logical stop from s2. If so then
+           log_stop_cnt is max of s1 and s2 stop times */
+        (susp->logical_stop_bits & 2)) {
+        int to_stop = susp->susp.log_stop_cnt - susp->susp.current;
+        if (to_stop < togo) {
+            if (to_stop == 0) {
+                susp->logically_stopped = true;
+            } else togo = to_stop;
+        }
+B       if (togo == 0) stdputstr("togo is zero at checkpoint 3\n");
+D	nyquist_printf("add_s2_nn_fetch: to_stop %d togo %d\n", to_stop, togo);
+    }
+
+    /* consider other signal? don't run past its start time... */
+    if (susp->s1) {
+        s1_start = ROUND((susp->s1->t0 - susp->susp.t0) *
+            susp->s1->sr);
+        if (s1_start < susp->susp.current + togo)
+            togo = MIN(togo, s1_start - susp->susp.current);
+            assert(togo > 0);
+    }
+
+    /*
+     * two cases: copy a partial block or manipulate pointers for
+     * copyless transfer of whole block (may not be full block):
+     *
+     * copy partial block when:
+     *   o samples begin in middle of block
+     *   o stopping time is before end of block (when other signal
+     *     splits the block for this signal)
+     * transfer (copyless) block when:
+     *   o the block is of maximum size
+     *   o the block is small due to logical stop time or termination
+     *     time
+     */
+    if (susp->s2_ptr == susp->s2_bptr->samples &&
+        susp->s2_cnt == togo) {
+        /*
+         * we want to copy this whole block (starting at the beginning
+         * and going to the rest of the block) -- just do pointers.
+         */
+
+        /* just fetch and pass blocks on */
+D	nyquist_printf("add[%p,%p] (s%d_nn) %p starting uncopy, togo %d\n", susp->s2, susp->s1,
+               2, susp, togo);
+        snd_list->block = susp->s2_bptr;
+        (susp->s2_bptr->refcnt)++;
+D	nyquist_printf("add[%p,%p] (s%d_nn) %p shared block %p zero_block %p\n",susp->s2, susp->s1,
+               2, susp, susp->s2_bptr, zero_block);
+
+        susp_took(s2_cnt, togo);
+        snd_list->block_len = togo;
+
+        /* if other is terminated and sound_types match, collapse */
+        /* NOTE: in order to collapse, we need s1 to be generating
+         * blocks and linking them onto a sound list.  This is true
+         * when the get_next fn is SND_get_next.  (A counterexample is
+         * SND_get_zeros, which returns zero blocks but does not link
+         * them onto the sound list.
+         */
+        if (0) nyquist_printf("s1 %p thissr %g suspsr %g get_next %d lsc %d\n",
+                susp->s1, susp->s2->sr, susp->susp.sr,
+                susp->s2->get_next == SND_get_next,
+                susp->s2->logical_stop_cnt == UNKNOWN);
+        if (susp->s1 == NULL && susp->s2->sr == susp->susp.sr &&
+            susp->s2->get_next == SND_get_next &&
+            susp->s2->logical_stop_cnt == UNKNOWN) {
+            snd_list_type addend_list;
+D	    nyquist_printf("add[%p,%p]: collapsing! LSC %d\n",
+                      susp->s2, susp->s1, (int)susp->s2->logical_stop_cnt);
+D	    sound_print_tree(susp->s2);
+            /* will "current" values match? */
+            /* test for logical stop */
+            if (susp->logically_stopped) {
+                snd_list->logically_stopped = true;
+            }
+            else if (susp->susp.log_stop_cnt == susp->susp.current) {
+                susp->logically_stopped = true;
+            }
+            /* free the superfluous sound_type and susp */
+            addend_list = susp->s2->list->u.next;
+            snd_list_ref(addend_list);
+            snd_list_unref(snd_list->u.next);
+            snd_list->u.next = addend_list;
+            return;
+        }
+    } else {
+        /*
+         * we want to copy a partial block
+         */
+
+        /* assume the snd_list is the one with a null block */
+        /*
+         * put a fresh, clean block in the snd_list
+         * (get new snd_list later)
+         */
+        falloc_sample_block(out, "add_s2_nn_fetch");
+        snd_list->block = out;
+        out_ptr = out->samples;
+B       nyquist_printf("add[%p,%p] (s2_nn) %p new block %p\n",
+               susp->s2, susp->s1, susp, out);
+        n = togo;
+        if (n == 0)
+            stdputstr("zero block length error in add_s2_nn_fetch\n");
+        assert(n > 0);
+B       nyquist_printf(
+        "add[%p,%p] (s2_nn) %p starting copy loop, togo %d\n",
+               susp->s2, susp->s1, susp, togo);
+        while (n--) { /* the inner sample computation loop */
+            /* scale? */
+            *out_ptr++ = *(susp->s2_ptr++);
+        } /* inner loop */
+
+        susp_took(s2_cnt, togo);
+        snd_list->block_len = togo;
+    }
+
+    /* add a new snd_list for the susp */
+    susp->susp.current += togo;
+
+    if (0) stdputstr("testing...");
+    /*
+     * test for termination or change of state,
+     * note s1_start computed earlier
+     */
+    if (susp->s1 && susp->susp.current == s1_start &&
+        susp->s2->list != zero_snd_list) {
+        /* s1 starting and s2 continues */
+        /* go to s1+s2 state */
+        susp->susp.fetch = add_s1_s2_nn_fetch;
+D        stdputstr("add_s_nn_fetch: add_s1_s2_fetch installed\n");
+    }
+/*    else if (!susp->s1 && susp->s2->list == zero_snd_list) { */
+      else if (susp->terminate_bits == 3) {
+        /* s1 finished and s2 stops */
+        /* go to terminal state */
+        susp->s2 = NULL;
+D        nyquist_printf("add_s_nn_fetch: go to terminal state.  susp->s1 %p, \
+               susp->susp.current %d, s1_start %d, susp->s2->list %p, \
+               zero_snd_list %p\n", susp->s1, (int)susp->susp.current,
+               s1_start, susp->s2->list, zero_snd_list);
+        /* !!! free resources and set up pointers to terminal snd_list */
+        /* !!! logically stopped? */
+    }
+
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+D        stdputstr("add_s_nn_fetch: snd_list->logically_stopped\n");
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current &&
+               (susp->logical_stop_bits & 2)) {
+D        stdputstr("add_s_nn_fetch: susp->logically_stopped\n");
+        susp->logically_stopped = true;
+    }
+    if (0) {
+        if (susp->logically_stopped || snd_list->logically_stopped) 
+            stdputstr("STOPPED\n");
+        else
+            nyquist_printf("ok: current %d\n", (int)susp->susp.current);
+    }
+}
+
+
+
+void add_zero_fill_nn_fetch(susp, snd_list)
+  register add_susp_type susp;
+  snd_list_type snd_list;
+{
+    int togo, s_start=0;
+
+#ifdef GC_DEBUG
+    snd_list_report(snd_list, "add_zero_fill_nn_fetch");
+#endif
+    togo = max_sample_block_len;
+
+    if (0) fprintf(STDERR, "add_zero_fill_nn_fetch, susp.current %d\n",
+                   (int)susp->susp.current);
+    /* don't run past start time ... */
+    if (susp->s1) {
+        s_start = ROUND((susp->s1->t0 - susp->susp.t0) * susp->s1->sr);
+        if (s_start < susp->susp.current + togo) {
+            togo = s_start - susp->susp.current;
+        }
+    } else if (susp->s2) {
+        s_start = ROUND((susp->s2->t0 - susp->susp.t0) * susp->s2->sr);
+        if (s_start < susp->susp.current + togo) {
+            togo = s_start - susp->susp.current;
+        }
+    }
+
+    snd_list->block_len = togo;
+    susp->susp.current += togo;
+    /*
+     * test for change of state,
+     * note s_start computed earlier
+     */
+    if (susp->s1 && susp->susp.current == s_start) {
+        /* s1 starting, go to s1 state */
+        susp->susp.fetch = add_s1_nn_fetch;
+D        stdputstr("add_zero_fill_nn_fetch: add_s1_nn_fetch installed\n");
+    } else if (susp->s2 && susp->susp.current == s_start) {
+        /* s2 starting, go to s2 state */
+        susp->susp.fetch = add_s2_nn_fetch;
+D       stdputstr("add_zero_fill_nn_fetch: add_s2_nn_fetch installed\n");
+    }
+} /* add_zero_fill_nn_fetch */
+
+
+void add_free(add_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(add_susp_node), "add_free");
+}
+
+
+void add_mark(add_susp_type susp)
+{
+/*    nyquist_printf("add_mark(%p)\n", susp);*/
+/*    nyquist_printf("marking s1@%p in add@%p\n", susp->s1, susp);*/
+    sound_xlmark(susp->s1);
+/*    nyquist_printf("marking s2@%p in add@%p\n", susp->s2, susp);*/
+    sound_xlmark(susp->s2);
+
+}
+
+
+void add_print_tree(add_susp_type susp, int n)
+{
+    indent(n);
+    nyquist_printf("logically_stopped %d logical_stop_bits %d terminate_bits %d\n", 
+           susp->logically_stopped, susp->logical_stop_bits, susp->terminate_bits);
+    indent(n);
+    stdputstr("s1:");
+    if (susp->s1) sound_print_tree_1(susp->s1, n);
+    else stdputstr(" NULL\n");
+
+    indent(n);
+    stdputstr("s2:");
+    if (susp->s2) sound_print_tree_1(susp->s2, n);
+    else stdputstr(" NULL\n");
+}
+
+
+sound_type snd_make_add(s1, s2)
+  sound_type s1;
+  sound_type s2;
+{
+    register add_susp_type susp;
+    rate_type sr = MAX(s1->sr, s2->sr);
+    time_type t0 = MIN(s1->t0, s2->t0);
+    int interp_desc = 0;
+    double sample_offset;
+
+    /* sort commutative signals: (S1 S2) */
+    snd_sort_2(&s1, &s2, sr);
+
+    falloc_generic(susp, add_susp_node, "snd_make_add");
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_style(s1, sr) << 2) + interp_style(s2, sr);
+    switch (interp_desc) {
+      case INTERP_nn:
+      case INTERP_ns:
+      case INTERP_ss:
+        /* eliminate scale factor on s1 if any */
+        if (((interp_desc >> INTERP_SHIFT) & INTERP_MASK) == INTERP_s) {
+            /* stdputstr("add: prescaling s1\n");*/
+            s1 = snd_make_normalize(s1);
+        }
+        /* eliminate scale factor on s2 if any */
+        if ((interp_desc & INTERP_MASK) == INTERP_s) {
+            /* stdputstr("add: prescaling s2\n"); */
+            s2 = snd_make_normalize(s2);
+        }
+        sample_offset = (s2->t0 - s1->t0) * sr;
+        if (sample_offset >= 0.5) { /* s1 starts first */
+            susp->susp.fetch = add_s1_nn_fetch;
+D            stdputstr("snd_make_add: add_s1_nn_fetch installed\n");
+        } else if (sample_offset < -0.5) { /* s2 starts first */
+            susp->susp.fetch = add_s2_nn_fetch;
+D            stdputstr("snd_make_add: add_s2_nn_fetch installed\n");
+        } else {	/* equal start times */
+            susp->susp.fetch = add_s1_s2_nn_fetch;
+D            stdputstr("snd_make_add: add_s1_s2_nn_fetch installed\n");
+        }
+        break;
+      case INTERP_ni:
+      case INTERP_nr:
+        errputstr("add: can't interpolate!\n");
+        EXIT(1);
+      default:
+        errputstr("add: can't add these operands!\n");
+        EXIT(1);
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    susp->terminate_bits = 0;   /* bits for s1 and s2 termination */
+    susp->logical_stop_bits = 0;    /* bits for s1 and s2 logical stop */
+
+    /* initialize susp state */
+    susp->susp.free = add_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = add_mark;
+    susp->susp.print_tree = add_print_tree;
+    susp->susp.name = "add";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = s2;
+    susp->s2_cnt = 0;
+#ifdef UPSAMPLECODE
+    susp->susp.s2_phase = 0.0;
+    susp->susp.s2_phase_incr = s2->sr / sr;
+    susp->susp.output_per_s2 = sr / s2->sr;
+#endif
+    return sound_create((snd_susp_type)susp, t0, sr, 1.0);
+}
+
+
+sound_type snd_add(s1, s2, t0)
+  sound_type s1;
+  sound_type s2;
+  time_type t0;
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type s2_copy = sound_copy(s2);
+/*    nyquist_printf("snd_add %p %p copied to %p %p\n", s1, s2, s1_copy,  s2_copy); */
+    return snd_make_add(s1_copy, s2_copy, t0);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/add.h b/lib-src/libnyquist/nyquist/nyqsrc/add.h
new file mode 100644
index 0000000..e1835ac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/add.h
@@ -0,0 +1,44 @@
+/* this typedef goes here because it is needed by multiseq.c */
+
+typedef struct add_susp_struct {
+    snd_susp_node               susp;
+    boolean                     started;
+    int                         terminate_bits;
+    long                        terminate_cnt;
+    int                         logical_stop_bits;
+    boolean                     logically_stopped;
+    sound_type                  s1;
+    long                        s1_cnt;
+    sample_block_type           s1_bptr;        /* block pointer */
+    sample_block_values_type    s1_ptr;
+    sound_type                  s2;
+    long                        s2_cnt;
+    sample_block_type           s2_bptr;        /* block pointer */
+    sample_block_values_type    s2_ptr;
+
+#ifdef UPSAMPLECODE
+    /* support for interpolation of s2 */
+    sample_type s2_x1_sample;
+    double s2_phase;
+    double s2_phase_incr;
+
+    /* support for ramp between samples of s2 */
+    double output_per_s2;
+#endif
+    /* pointer used to synchronize adds in multiseq */
+    struct multiseq_struct      *multiseq;
+    long                        s1_prepend; /* offset to susp.current */
+} add_susp_node, *add_susp_type;
+
+sound_type snd_make_add();
+sound_type snd_add();
+    /* LISP: (SND-ADD SOUND SOUND) */
+
+/* we export these for seq.c and multiseq.c */ 
+void add_zero_fill_nn_fetch(add_susp_type susp, snd_list_type snd_list);
+void add_s1_s2_nn_fetch(add_susp_type susp, snd_list_type snd_list);
+void add_s2_nn_fetch(add_susp_type susp, snd_list_type snd_list);
+void add_s1_nn_fetch(add_susp_type susp, snd_list_type snd_list);
+void add_mark(add_susp_type susp);
+void add_print_tree(add_susp_type susp, int n);
+void add_free(add_susp_type susp);
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/avg.c b/lib-src/libnyquist/nyquist/nyqsrc/avg.c
new file mode 100644
index 0000000..31c1406
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/avg.c
@@ -0,0 +1,266 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "avg.h"
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+
+void avg_free();
+
+typedef sample_type (*process_block_type)(/* struct avg_susp_struct *susp */);
+
+typedef struct avg_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    long blocksize;
+    long stepsize;
+    sample_type *block;
+    sample_type *fillptr;
+    sample_type *endptr;
+    process_block_type process_block;
+} avg_susp_node, *avg_susp_type;
+
+
+sample_type average_block(avg_susp_type susp)
+{
+    /* this version just computes average */
+    double sum = 0.0;
+    int i;
+    for (i = 0; i < susp->blocksize; i++) {
+        sum += susp->block[i];
+    }
+    for (i = susp->stepsize; i < susp->blocksize; i++) {
+    susp->block[i - susp->stepsize] = susp->block[i];
+    }
+    return (sample_type) (sum / susp->blocksize);
+}
+
+
+sample_type peak_block(avg_susp_type susp)
+{
+    /* this version just computes average */
+    sample_type peak = 0.0F;
+    sample_type minus_peak = 0.0F;
+    int i;
+    for (i = 0; i < susp->blocksize; i++) {
+        sample_type s = susp->block[i];
+    if (s > peak) {
+        peak = s; minus_peak = -s;
+    } else if (s < minus_peak) {
+        minus_peak = s; peak = -s;
+    }
+    }
+    for (i = susp->stepsize; i < susp->blocksize; i++) {
+    susp->block[i - susp->stepsize] = susp->block[i];
+    }
+    return peak;
+}
+
+
+void avg_s_fetch(avg_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo = 0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_type *fillptr_reg;
+    register sample_type *endptr_reg = susp->endptr;
+
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "avg_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+    /* first compute how many samples to generate in inner loop: */
+    /* don't overflow the output sample block: */
+    togo = (max_sample_block_len - cnt) * susp->stepsize;
+
+    /* don't run past the s input sample block: */
+    susp_check_term_log_samples(s, s_ptr, s_cnt);
+    togo = MIN(togo, susp->s_cnt);
+
+    /* don't run past terminate time */
+    if (susp->terminate_cnt != UNKNOWN &&
+        susp->terminate_cnt <= susp->susp.current + cnt + togo/susp->stepsize) {
+        togo = (susp->terminate_cnt - (susp->susp.current + cnt)) * susp->stepsize;
+        if (togo == 0) break;
+    }
+
+
+    /* don't run past logical stop time */
+    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+        int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+        /* break if to_stop == 0 (we're at the logical stop)
+         * AND cnt > 0 (we're not at the beginning of the
+         * output block).
+         */
+        if (to_stop < togo/susp->stepsize) {
+        if (to_stop == 0) {
+            if (cnt) {
+            togo = 0;
+            break;
+            } else /* keep togo as is: since cnt == 0, we
+                * can set the logical stop flag on this
+                * output block
+                */
+            susp->logically_stopped = true;
+        } else /* limit togo so we can start a new
+            * block at the LST
+            */
+            togo = to_stop * susp->stepsize;
+        }
+    }
+
+    n = togo;
+    s_ptr_reg = susp->s_ptr;
+    fillptr_reg = susp->fillptr;
+    if (n) do { /* the inner sample computation loop */
+        *fillptr_reg++ = *s_ptr_reg++;
+        if (fillptr_reg >= endptr_reg) {
+           *out_ptr++ = (*(susp->process_block))(susp);
+           cnt++;
+           fillptr_reg -= susp->stepsize;
+        }
+    } while (--n); /* inner loop */
+
+    /* using s_ptr_reg is a bad idea on RS/6000: */
+    susp->s_ptr += togo;
+    susp->fillptr = fillptr_reg;
+    susp_took(s_cnt, togo);
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+    snd_list_terminate(snd_list);
+    } else {
+    snd_list->block_len = cnt;
+    susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+    snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+    susp->logically_stopped = true;
+    }
+} /* avg_s_fetch */
+
+
+void avg_toss_fetch(susp, snd_list)
+  avg_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = MIN(susp->susp.current + max_sample_block_len,
+               susp->susp.toss_cnt);
+    time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while (((long) ((final_time - susp->s->t0) * susp->s->sr + 0.5)) >=
+       susp->s->current)
+    susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    if (final_count == susp->susp.toss_cnt) {
+    n = ROUND((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    }
+    snd_list->block_len = (short) (final_count - susp->susp.current);
+    susp->susp.current = final_count;
+    snd_list->u.next = snd_list_create((snd_susp_type) susp);
+    snd_list->block = internal_zero_block;
+}
+
+
+void avg_mark(avg_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void avg_free(avg_susp_type susp)
+{
+    sound_unref(susp->s);
+    free(susp->block);
+    ffree_generic(susp, sizeof(avg_susp_node), "avg_free");
+}
+
+
+void avg_print_tree(avg_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_avg(sound_type s, long blocksize, long stepsize, long op)
+{
+    register avg_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+    time_type t0_min = t0;
+
+    falloc_generic(susp, avg_susp_node, "snd_make_avg");
+    susp->susp.fetch = avg_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = MIN(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = ROUND((t0 - t0_min) * sr);
+    if (susp->susp.toss_cnt > 0) {
+    susp->susp.keep_fetch = susp->susp.fetch;
+    susp->susp.fetch = avg_toss_fetch;
+    t0 = t0_min;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = avg_free;
+    susp->susp.sr = sr / stepsize;
+    susp->susp.t0 = t0;
+    susp->susp.mark = avg_mark;
+    susp->susp.print_tree = avg_print_tree;
+    susp->susp.name = "avg";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->blocksize = blocksize;
+    susp->stepsize = stepsize;
+    susp->block = (sample_type *) malloc(blocksize * sizeof(sample_type));
+    susp->fillptr = susp->block;
+    susp->endptr = susp->block + blocksize;
+    susp->process_block = average_block;
+    if (op == op_peak) susp->process_block = peak_block;
+    /* scale factor gets passed to output signal: */
+    return sound_create((snd_susp_type) susp, t0, susp->susp.sr, susp->s->scale);
+}
+
+
+sound_type snd_avg(sound_type s, long blocksize, long stepsize, long op)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_avg(s_copy, blocksize, stepsize, op);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/avg.h b/lib-src/libnyquist/nyquist/nyqsrc/avg.h
new file mode 100644
index 0000000..4c21cc3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/avg.h
@@ -0,0 +1,6 @@
+sound_type snd_make_avg(sound_type s, long blocksize, long stepsize, long op);
+sound_type snd_avg(sound_type s, long blocksize, long stepsize, long op);
+    /* LISP: (snd-avg SOUND FIXNUM FIXNUM FIXNUM) */
+#define op_average 1
+#define op_peak 2
+/* LISP-SRC: (setf OP-AVERAGE 1) (setf OP-PEAK 2) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/compose.c b/lib-src/libnyquist/nyquist/nyqsrc/compose.c
new file mode 100644
index 0000000..a15fe34
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/compose.c
@@ -0,0 +1,304 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "compose.h"
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+void compose_free();
+
+
+typedef struct compose_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type f;
+    long f_cnt;
+    sample_block_values_type f_ptr;
+    sample_type f_prev;
+    double f_time;
+    double f_time_increment;
+    boolean started;
+    sound_type g;
+    long g_cnt;
+    sample_block_values_type g_ptr;
+} compose_susp_node, *compose_susp_type;
+
+
+/* compose_fetch -- computes f(g(t)) */
+/**/
+void compose_fetch(register compose_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo = 0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_block_values_type g_ptr_reg;
+    register sample_block_values_type f_ptr_reg;
+    falloc_sample_block(out, "compose_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure we are primed with first value of f */
+    /* This is a lot of work just to prefetch susp->f_prev! */
+    if (!susp->started) {
+        susp->started = true;
+        /* see comments below about susp_check_term_log_samples() */
+        if (susp->f_cnt == 0) {
+            susp_get_samples(f, f_ptr, f_cnt);
+            if (susp->f_ptr == zero_block->samples) {
+                susp->terminate_cnt = susp->susp.current;
+            }
+        }
+        susp->f_prev = susp_fetch_sample(f, f_ptr, f_cnt);
+        susp->f_time += susp->f_time_increment;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = max_sample_block_len - cnt;
+
+        /* don't run past the f input sample block: */
+        /* most fetch routines call susp_check_term_log_samples() here
+         * but we can't becasue susp_check_term_log_samples() assumes
+          * that output time progresses at the same rate as input time.
+         * Here, some time warping is going on, so this doesn't work.
+         * Instead, check for termination of f and fix terminate_cnt to
+         * be the current output count rather than the current input time.
+         */
+        if (susp->f_cnt == 0) {
+            susp_get_samples(f, f_ptr, f_cnt);
+            if (susp->f->logical_stop_cnt == susp->f->current - susp->f_cnt) {
+                if (susp->susp.log_stop_cnt == UNKNOWN) {
+                    susp->susp.log_stop_cnt = susp->susp.current + cnt;
+                }
+            }
+            if (susp->f_ptr == zero_block->samples) {
+                susp->terminate_cnt = susp->susp.current + cnt;
+                /* we can't simply terminate here because we might have 
+                 * some output samples computed already, in which case we
+                 * want to return them now and terminate the NEXT time we're
+                 * called.
+                 */
+            }
+        }
+
+#ifdef CUT
+        /* don't run past the f input sample block: */
+        susp_check_term_log_samples(f, f_ptr, f_cnt);
+        togo = MIN(togo, susp->f_cnt);
+#endif
+        /* don't run past the g input sample block: */
+        susp_check_term_samples(g, g_ptr, g_cnt);
+        togo = MIN(togo, susp->g_cnt);
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo == 0) break;
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            if (to_stop < togo && ((togo = to_stop) == 0)) break;
+        }
+
+        n = togo;
+
+        g_ptr_reg = susp->g_ptr;
+        f_ptr_reg = susp->f_ptr;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            double g_of_t = *g_ptr_reg;
+            #if 0
+            float tmp;  /* for debugging */
+            nyquist_printf("output sample %d, g_of_t %g", susp->susp.current + cnt, g_of_t);
+            #endif
+            /* now we scan f and interpolate at time point g_of_t */
+            while (susp->f_time < g_of_t) {
+                susp->f_time += susp->f_time_increment;
+                susp->f_prev = *f_ptr_reg++;
+/*                nyquist_printf(", (f_time %g, f %g)", susp->f_time, *f_ptr_reg); */
+                susp->f_ptr++;
+                susp->f_cnt--;
+                if (susp->f_cnt == 0) {
+                    togo -= n;
+/*                    stdputstr("\n\tf out of samples...\n"); */
+                    goto f_out_of_samples;
+                }
+            }
+            g_ptr_reg++;
+            *out_ptr_reg++ /* = tmp */ = 
+                (sample_type) (*f_ptr_reg - (*f_ptr_reg - susp->f_prev) *
+                                            (susp->f_time - g_of_t) * susp->f->sr);
+/*            nyquist_printf(", output %g\n", tmp);*/
+        } while (--n); /* inner loop */
+f_out_of_samples:
+        /* using g_ptr_reg is a bad idea on RS/6000: */
+        susp->g_ptr += togo;
+        out_ptr += togo;
+        susp_took(g_cnt, togo);
+        cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* compose_fetch */
+
+
+void compose_toss_fetch(susp, snd_list)
+  register compose_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = MIN(susp->susp.current + max_sample_block_len,
+                           susp->susp.toss_cnt);
+    time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
+    long n;
+
+    /* fetch samples from f up to final_time for this block of zeros */
+    while (((long) ((final_time - susp->f->t0) * susp->f->sr + 0.5)) >=
+           susp->f->current)
+        susp_get_samples(f, f_ptr, f_cnt);
+    /* fetch samples from g up to final_time for this block of zeros */
+    while (((long) ((final_time - susp->g->t0) * susp->g->sr + 0.5)) >=
+           susp->g->current)
+        susp_get_samples(g, g_ptr, g_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    if (final_count == susp->susp.toss_cnt) {
+        n = ROUND((final_time - susp->f->t0) * susp->f->sr -
+                  (susp->f->current - susp->f_cnt));
+        susp->f_ptr += n;
+        susp_took(f_cnt, n);
+        n = ROUND((final_time - susp->g->t0) * susp->g->sr -
+                  (susp->g->current - susp->g_cnt));
+        susp->g_ptr += n;
+        susp_took(g_cnt, n);
+        susp->susp.fetch = susp->susp.keep_fetch;
+    }
+    snd_list->block_len = (short) (final_count - susp->susp.current);
+    susp->susp.current = final_count;
+    snd_list->u.next = snd_list_create((snd_susp_type) susp);
+    snd_list->block = internal_zero_block;
+}
+
+
+void compose_mark(compose_susp_type susp)
+{
+    sound_xlmark(susp->f);
+    sound_xlmark(susp->g);
+}
+
+
+void compose_free(compose_susp_type susp)
+{
+    sound_unref(susp->f);
+    sound_unref(susp->g);
+    ffree_generic(susp, sizeof(compose_susp_node), "compose_free");
+}
+
+
+void compose_print_tree(compose_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("f:");
+    sound_print_tree_1(susp->f, n);
+
+    indent(n);
+    stdputstr("g:");
+    sound_print_tree_1(susp->g, n);
+}
+
+
+sound_type snd_make_compose(sound_type f, sound_type g)
+{
+    register compose_susp_type susp;
+    rate_type sr = g->sr;
+    time_type t0 = g->t0;
+
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+
+    /* combine scale factors of linear inputs (S1 S2) */
+    scale_factor *= f->scale;
+    f->scale = 1.0F;
+
+    /* scale factor in g effectively scales sample rate of f: */
+    f->sr *= g->scale;
+/* BUG */
+    /* probably need to correct f->t0, but I don't understand this,
+        so I'll leave this until we have some test cases */
+
+    falloc_generic(susp, compose_susp_node, "snd_make_compose");
+    susp->susp.fetch = compose_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+/* BUG: do we need to prepend to f?
+    if (t0 < f->t0) sound_prepend_zeros(f, t0); */
+    if (t0 < g->t0) sound_prepend_zeros(g, t0);
+    /* minimum start time over all inputs: */
+    t0_min = MIN(g->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = ROUND((t0 - t0_min) * sr);
+    if (susp->susp.toss_cnt > 0) {
+        susp->susp.keep_fetch = susp->susp.fetch;
+        susp->susp.fetch = compose_toss_fetch;
+        t0 = t0_min;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = compose_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = compose_mark;
+    susp->susp.print_tree = compose_print_tree;
+    susp->susp.name = "compose";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = f->logical_stop_cnt;
+    if (susp->susp.log_stop_cnt > g->logical_stop_cnt)
+        susp->susp.log_stop_cnt = g->logical_stop_cnt;
+    susp->susp.current = 0;
+    susp->f = f;
+    susp->f_cnt = 0;
+    susp->f_time = 0;
+    susp->f_time_increment = 1 / f->sr;
+    susp->g = g;
+    susp->g_cnt = 0;
+    susp->started = false;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_compose(sound_type f, sound_type g)
+{
+    sound_type f_copy = sound_copy(f);
+    sound_type g_copy = sound_copy(g);
+    return snd_make_compose(f_copy, g_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/compose.h b/lib-src/libnyquist/nyquist/nyqsrc/compose.h
new file mode 100644
index 0000000..efd773c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/compose.h
@@ -0,0 +1,3 @@
+sound_type snd_make_compose(sound_type f, sound_type g);
+sound_type snd_compose(sound_type f, sound_type g);
+    /* LISP: (snd-compose SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/convolve.c b/lib-src/libnyquist/nyquist/nyqsrc/convolve.c
new file mode 100644
index 0000000..e234171
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/convolve.c
@@ -0,0 +1,300 @@
+/* convolve.c -- implements (non-"fast") convolution */
+/* 
+ * Note: this code is mostly generated by translate.lsp (see convole.tran
+ * in the tran directory), but it has been modified by hand to extend the
+ * stop time to include the "tail" of the convolution beyond the length
+ * of the first parameter.
+ */
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "convolve.h"
+
+void convolve_free();
+
+
+typedef struct convolve_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type x_snd;
+    long x_snd_cnt;
+    sample_block_values_type x_snd_ptr;
+
+    table_type table;
+    sample_type *h_buf;
+    double length_of_h;
+    long h_len;
+    long x_buf_len;
+    sample_type *x_buffer_pointer;
+    sample_type *x_buffer_current;
+} convolve_susp_node, *convolve_susp_type;
+
+
+void h_reverse(sample_type *h, long len)
+{
+    sample_type temp;
+    int i;
+    
+    for (i = 0; i < len; i++) {
+        temp = h[i];
+        h[i] = h[len - 1];
+        h[len - 1] = temp;
+        len--;
+    }
+}
+
+
+void convolve_s_fetch(register convolve_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type * h_buf_reg;
+    register long h_len_reg;
+    register long x_buf_len_reg;
+    register sample_type * x_buffer_pointer_reg;
+    register sample_type * x_buffer_current_reg;
+    register sample_type x_snd_scale_reg = susp->x_snd->scale;
+    register sample_block_values_type x_snd_ptr_reg;
+    falloc_sample_block(out, "convolve_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	    /* first compute how many samples to generate in inner loop: */
+	    /* don't overflow the output sample block: */
+	    togo = max_sample_block_len - cnt;
+
+	    /* don't run past the x_snd input sample block: */
+	    /* based on susp_check_term_log_samples, but offset by h_len */
+
+	    /* THIS IS EXPANDED BELOW
+	     * susp_check_term_log_samples(x_snd, x_snd_ptr, x_snd_cnt);
+	     */
+	    if (susp->x_snd_cnt == 0) {
+	        susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);
+	      
+	        /* THIS IS EXPANDED BELOW
+	         *logical_stop_test(x_snd, susp->x_snd_cnt);
+	         */
+                if (susp->x_snd->logical_stop_cnt == 
+		            susp->x_snd->current - susp->x_snd_cnt) {
+	            min_cnt(&susp->susp.log_stop_cnt, susp->x_snd, 
+			    (snd_susp_type) susp, susp->x_snd_cnt);
+	        }
+
+	        /* THIS IS EXPANDED BELOW
+	         * terminate_test(x_snd_ptr, x_snd, susp->x_snd_cnt);
+	         */
+	        if (susp->x_snd_ptr == zero_block->samples) {
+	            /* ### modify this to terminate at an offset of (susp->h_len) */
+                /* Note: in the min_cnt function, susp->x_snd_cnt is *subtracted*
+                 *   from susp->x_snd->current to form the terminate time, so to
+                 *   increase the time, we need to *subtract* susp->h_len, which
+                 *   due to the double negative, *adds* susp->h_len to the ultimate
+                 *   terminate time calculation.
+                 */
+	            min_cnt(&susp->terminate_cnt, susp->x_snd, 
+			            (snd_susp_type) susp, susp->x_snd_cnt - susp->h_len);
+	        }
+	    }
+
+
+	    togo = min(togo, susp->x_snd_cnt);
+
+	    /* don't run past terminate time */
+	    if (susp->terminate_cnt != UNKNOWN &&
+	        susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	        togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	        if (togo == 0) break;
+	    }
+
+
+	    /* don't run past logical stop time */
+	    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	        int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	        /* break if to_stop == 0 (we're at the logical stop)
+	         * AND cnt > 0 (we're not at the beginning of the
+	         * output block).
+	         */
+	        if (to_stop < togo) {
+		    if (to_stop == 0) {
+		        if (cnt) {
+			    togo = 0;
+			    break;
+		        } else /* keep togo as is: since cnt == 0, we
+		                * can set the logical stop flag on this
+		                * output block
+		                */
+			    susp->logically_stopped = true;
+		    } else /* limit togo so we can start a new
+		            * block at the LST
+		            */
+		        togo = to_stop;
+	        }
+	    }
+
+	    n = togo;
+	    h_buf_reg = susp->h_buf;
+	    h_len_reg = susp->h_len;
+	    x_buf_len_reg = susp->x_buf_len;
+	    x_buffer_pointer_reg = susp->x_buffer_pointer;
+	    x_buffer_current_reg = susp->x_buffer_current;
+	    x_snd_ptr_reg = susp->x_snd_ptr;
+	    out_ptr_reg = out_ptr;
+	    if (n) do { /* the inner sample computation loop */
+            long i; double sum;
+            /* see if we've reached end of x_buffer */
+            if ((x_buffer_pointer_reg + x_buf_len_reg) <= (x_buffer_current_reg + h_len_reg)) {
+                /* shift x_buffer from current back to base */
+                for (i = 1; i < h_len_reg; i++) {
+                    x_buffer_pointer_reg[i-1] = x_buffer_current_reg[i];
+                }    
+                /* this will be incremented back to x_buffer_pointer_reg below */
+                x_buffer_current_reg = x_buffer_pointer_reg - 1;
+            }
+
+            x_buffer_current_reg++;
+
+            x_buffer_current_reg[h_len_reg - 1] = (x_snd_scale_reg * *x_snd_ptr_reg++);
+
+            sum = 0.0;
+            for (i = 0; i < h_len_reg; i++) {
+                sum += x_buffer_current_reg[i] * h_buf_reg[i];
+            }
+
+            *out_ptr_reg++ = (sample_type) sum;
+	    } while (--n); /* inner loop */
+
+	    susp->x_buffer_pointer = x_buffer_pointer_reg;
+	    susp->x_buffer_current = x_buffer_current_reg;
+	    /* using x_snd_ptr_reg is a bad idea on RS/6000: */
+	    susp->x_snd_ptr += togo;
+	    out_ptr += togo;
+	    susp_took(x_snd_cnt, togo);
+	    cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	    snd_list_terminate(snd_list);
+    } else {
+	    snd_list->block_len = cnt;
+	    susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	    snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	    susp->logically_stopped = true;
+    }
+} /* convolve_s_fetch */
+
+
+void convolve_toss_fetch(susp, snd_list)
+  register convolve_susp_type susp;
+  snd_list_type snd_list;
+{
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from x_snd up to final_time for this block of zeros */
+    while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >=
+	   susp->x_snd->current)
+	susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr -
+         (susp->x_snd->current - susp->x_snd_cnt));
+    susp->x_snd_ptr += n;
+    susp_took(x_snd_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void convolve_mark(convolve_susp_type susp)
+{
+    sound_xlmark(susp->x_snd);
+}
+
+
+void convolve_free(convolve_susp_type susp)
+{
+    table_unref(susp->table); 
+    free(susp->x_buffer_pointer);    sound_unref(susp->x_snd);
+    ffree_generic(susp, sizeof(convolve_susp_node), "convolve_free");
+}
+
+
+void convolve_print_tree(convolve_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("x_snd:");
+    sound_print_tree_1(susp->x_snd, n);
+}
+
+
+sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd)
+{
+    register convolve_susp_type susp;
+    rate_type sr = x_snd->sr;
+    time_type t0 = x_snd->t0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, convolve_susp_node, "snd_make_convolve");
+    susp->table = sound_to_table(h_snd);
+    susp->h_buf = susp->table->samples;
+    susp->length_of_h = susp->table->length;
+    susp->h_len = (long) susp->length_of_h;
+         h_reverse(susp->h_buf, susp->h_len);
+    susp->x_buf_len = 2 * susp->h_len;
+    susp->x_buffer_pointer = calloc((2 * (susp->h_len)), sizeof(float));
+    susp->x_buffer_current = susp->x_buffer_pointer;
+    susp->susp.fetch = convolve_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < x_snd->t0) sound_prepend_zeros(x_snd, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(x_snd->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = convolve_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = convolve_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = convolve_mark;
+    susp->susp.print_tree = convolve_print_tree;
+    susp->susp.name = "convolve";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(x_snd);
+    susp->susp.current = 0;
+    susp->x_snd = x_snd;
+    susp->x_snd_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_convolve(sound_type x_snd, sound_type h_snd)
+{
+    sound_type x_snd_copy = sound_copy(x_snd);
+    return snd_make_convolve(x_snd_copy, h_snd);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/convolve.h b/lib-src/libnyquist/nyquist/nyqsrc/convolve.h
new file mode 100644
index 0000000..27eac33
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/convolve.h
@@ -0,0 +1,3 @@
+sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd);
+sound_type snd_convolve(sound_type x_snd, sound_type h_snd);
+    /* LISP: (snd-convolve SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/cque.h b/lib-src/libnyquist/nyquist/nyqsrc/cque.h
new file mode 100644
index 0000000..e001e3c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/cque.h
@@ -0,0 +1,25 @@
+/* 
+ * cque.h
+ * macros for free lists.
+ */
+
+typedef struct cque {
+    struct cque	*qnext;
+} CQUE;
+
+#define	Qinit(q1)	{ (q1) = 0; }
+
+/* q1 points to a stack CQUE*, new is an element to insert */
+#define Qenter(q1,new)  {   \
+    ((CQUE *)(new))->qnext = ((CQUE *)(q1)); \
+    q1 = ((CQUE *)(new)); }
+
+
+/* q1 points to a list of CQUE*: remove elt and assign to new */
+/* NOTE: q1 must be non-empty */
+#define Qget(q1,newtype,new) {  \
+    (new) = (newtype)(q1);  \
+    q1 = ((CQUE *)(q1))->qnext; }
+
+
+#define	Qempty(q1)	((q1) == 0)
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/debug.c b/lib-src/libnyquist/nyquist/nyqsrc/debug.c
new file mode 100644
index 0000000..74a77f5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/debug.c
@@ -0,0 +1,249 @@
+#include <stdio.h>
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "debug.h"
+
+/* The DEBUG_MEM related routines are:
+ *    dbg_mem_allocated: called when memory is allocated
+ *    dbg_mem_freed: called when memory is freed
+ *    dbg_mem_released: called when memory is released
+ */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+
+#if DEBUG_MEM
+typedef struct {
+    long seq_num;
+    char *who;
+} dbg_mem_node, *dbg_mem_type;
+
+static long dbg_mem_last_seq_num = 0;
+long dbg_mem_seq_num = 0;
+long dbg_mem_trace = 0x410988;
+
+void dbg_mem_pause(void)
+{
+    stdputstr("RETURN to continue: ");
+    getchar();
+}
+
+
+void dbg_mem_allocated(void *p, char *who)
+{
+    dbg_mem_type info = (dbg_mem_type) p;
+    if (p == (void *) dbg_mem_trace) {
+        nyquist_printf("dbg_mem_allocated(%p, %s)\n", p, who);
+    }
+    info--; /* info is stored (hidden) BEFORE the data */
+    dbg_mem_last_seq_num++;
+    if (dbg_mem_last_seq_num == dbg_mem_seq_num) {
+        nyquist_printf("dbg_mem_allocated: "
+                       "%s just allocated %p as number %d\n",
+                       who, p, (int)dbg_mem_last_seq_num);
+        dbg_mem_pause();
+    }
+    info->seq_num = dbg_mem_last_seq_num;
+    info->who = who;
+}
+
+
+void dbg_mem_freed(void *p, char *who)
+{
+    dbg_mem_type info = (dbg_mem_type) p;
+    if (p == (void *) dbg_mem_trace) {
+        nyquist_printf("dbg_mem_freed(%p, %s)\n", p, who);
+    }
+    info--; /* info is stored (hidden) BEFORE the data */
+    if (!info->who) {
+        nyquist_printf("MEMORY %p FREED TWICE!, "
+                       "second time by: %s, seq_num %d\n",
+                       p, who, (int)info->seq_num);
+        fflush(stdout);
+        dbg_mem_pause();
+    }
+    if (info->seq_num == dbg_mem_seq_num) {
+        nyquist_printf("dbg_mem_freed: %s freeing %p, number %d\n",
+                       who, p, (int)dbg_mem_seq_num);
+        dbg_mem_pause();
+    }
+    info->who = NULL;
+}
+
+void dbg_mem_released(void *p, char *who)
+{
+    dbg_mem_type info = (dbg_mem_type) p;
+    if (p == (void *) dbg_mem_trace) {
+        nyquist_printf("dbg_mem_released(%p, %s)\n", p, who);
+    }
+    info--; /* info is stored (hidden) BEFORE the data */
+    if (!info->who) {
+        nyquist_printf("MEMORY %p RELEASED BUT NOT ALLOCATED!, "
+                       "released by: %s, seq_num %d\n",
+                       p, who, (int)info->seq_num);
+        fflush(stdout);
+        dbg_mem_pause();
+    }
+    if (info->seq_num == dbg_mem_seq_num) {
+       nyquist_printf("dbg_mem_released: %s releasing %p, number %d\n",
+                      who, p, (int)dbg_mem_seq_num);
+        dbg_mem_pause();
+    }
+}
+
+
+void dbg_mem_check(void *p, char *who)
+{
+    dbg_mem_type info = (dbg_mem_type) p;
+    if (!info) {
+        nyquist_printf("DBG_MEM_CHECK (from %s): NULL POINTER!", who);
+         fflush(stdout);
+        dbg_mem_pause();
+    }
+    info--; /* info is stored (hidden) BEFORE the data */
+    if (!info->who) {
+       nyquist_printf("DBG_MEM_CHECK (from %s): %p IS FREE!, seq_num %d\n", 
+                      who, p, (int)info->seq_num);
+       fflush(stdout);
+       dbg_mem_pause();
+    }
+}
+
+
+void dbg_mem_print(char *msg, void *p)
+{
+    dbg_mem_type info = (dbg_mem_type) p;
+    stdputstr(msg);
+    if (!info) {
+        stdputstr(" NULL POINTER");
+    } else {
+        info--; /* info is stored (hidden) BEFORE the data */
+        if (!info->who) {
+            nyquist_printf(" %p IS FREE!, ", p);
+        } else {
+            nyquist_printf(" %p allocated by %s, ", p, info->who);
+        }
+        nyquist_printf("seq_num %d\n", (int)info->seq_num);
+    }
+}
+#endif
+
+
+void print_sound_type(sound_type s)
+{
+    snd_list_type list;
+    int blockcount;
+
+    nyquist_printf("sound_type: 0x%p\n", s);
+    nyquist_printf("\tt0: %f\n", s->t0);
+    nyquist_printf("\tsr: %f\n", s->sr);
+    nyquist_printf("\tcurrent: %d\n", (int)s->current);
+    nyquist_printf("\tlogical_stop_cnt: %d\n", (int)s->logical_stop_cnt);
+    nyquist_printf("\tlist: 0x%p\n", s->list);
+    nyquist_printf("\tscale: %f\n", s->scale);
+
+    list = s->list;
+    blockcount = 0;
+    nyquist_printf("\t(0x%p:0x%p)->", list, list->block);
+    while (list->block) {
+        list = list->u.next;
+        if (blockcount < 5) {
+            nyquist_printf("(0x%p:0x%p)->", list, list->block);
+        }
+        else if (blockcount == 5) {
+            stdputstr(" ... ");
+            break;
+        }
+        blockcount++;
+    }
+    stdputstr("\n");
+}
+
+void print_snd_list_type(snd_list_type list)
+{
+    nyquist_printf("%p: [%p[%d], %p] refcnt %d ls %d", list, list->block,
+            list->block_len, list->u.next, 
+            list->refcnt, list->logically_stopped);
+}
+
+
+
+void print_sample_block_type(char *label,
+                             sample_block_type sampblock,
+                             int len)
+{
+    int j;
+    sample_block_values_type samp;
+
+    samp = sampblock->samples;
+    nyquist_printf("%s: [%p(ref %d): len %d]: =========>>",
+                   label, sampblock, (int)sampblock->refcnt, len);
+    for (j = 0; j < len; j++) {
+        nyquist_printf("%6g ", *samp++);
+    }
+    stdputstr("\n");
+}
+
+
+/*******/
+snd_susp_type susp_to_watch = NULL;
+
+void watch_susp(snd_susp_type s)
+{
+    if (!susp_to_watch) {
+        susp_to_watch = s;
+        nyquist_printf("watching susp %p\n", s);
+    }
+}
+
+sound_type sound_to_watch = NULL;
+
+void watch_sound(sound_type s)
+{
+    if (!sound_to_watch) {
+        sound_to_watch = s;
+        nyquist_printf("watching sound %p\n", s);
+    }
+}
+
+
+snd_list_type snd_list_to_watch = NULL;
+
+void watch_snd_list(snd_list_type s)
+{
+    snd_list_to_watch = s;
+    nyquist_printf("watching snd_list %p\n", s);
+}
+
+
+void snd_list_debug(snd_list_type snd_list, char *s)
+{
+    if (snd_list == snd_list_to_watch) {
+        nyquist_printf("%s%s\n", s,
+               " appended to snd_list_to_watch.");
+        watch_snd_list(snd_list->u.next);
+    }
+}
+
+
+void snd_list_report(snd_list_type snd_list, char *s)
+{
+    if (snd_list == snd_list_to_watch) {
+        nyquist_printf("%s: fetching block for watched snd_list.\n",
+               s);
+    }
+}
+
+
+#ifdef IGNORE
+void test_it()
+{
+    if (susp_to_watch && susp_to_watch->keep_fetch) 
+        stdputstr("WE FOUND A SERIOUS PROBLEM\n");
+}
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/debug.h b/lib-src/libnyquist/nyquist/nyqsrc/debug.h
new file mode 100644
index 0000000..6874ed2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/debug.h
@@ -0,0 +1,47 @@
+#ifndef DEBUG_H
+
+#ifdef PARTIAL_DECLARATIONS
+typedef struct partial_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    long logical_stop_cnt;
+    boolean logically_stopped;
+    sound_type env;
+    long env_cnt;
+    sample_block_values_type env_ptr;
+
+    /* support for interpolation of env */
+    sample_type env_x1_sample;
+    double env_pHaSe;
+    double env_pHaSe_iNcR;
+
+    /* support for ramp between samples of env */
+    double output_per_env;
+    long env_n;
+
+    long phase;
+    long ph_incr;
+    double max_diff;
+    double prev_output;
+} partial_susp_node, *partial_susp_type;
+#endif
+
+extern sound_type watch_table_sound;
+extern int table_ptr_check_enable;
+
+void print_sound_type(sound_type s);
+void print_sample_block_type(char *label, 
+       sample_block_type sampblock, int len);
+void watch_susp(snd_susp_type s);
+void watch_sound(sound_type s);
+void snd_list_debug(snd_list_type snd_list, char *s);
+void watch_snd_list(snd_list_type s);
+void dbg_mem_allocated(void *p, char *who);
+void dbg_mem_freed(void *p, char *who);
+void dbg_mem_print(char *msg, void *p);
+void table_ptr_check();
+/* #define TRACESNDGC */
+
+#define DEBUG_H
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/downsample.c b/lib-src/libnyquist/nyquist/nyqsrc/downsample.c
new file mode 100644
index 0000000..a796ee5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/downsample.c
@@ -0,0 +1,404 @@
+/* downsample.c -- linear interpolation to a lower sample rate */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "cext.h"
+#include "downsample.h"
+
+void down_free();
+
+
+typedef struct down_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+
+    /* support for interpolation of s */
+    sample_type s_x1_sample;
+    double s_pHaSe;
+    double s_pHaSe_iNcR;
+
+    /* support for ramp between samples of s */
+    double output_per_s;
+    long s_n;
+} down_susp_node, *down_susp_type;
+
+
+void down_n_fetch(susp, snd_list)
+  register down_susp_type susp;
+  snd_list_type snd_list;
+{
+    int cnt = 0; /* how many samples computed */
+    int togo = 0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "down_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = max_sample_block_len - cnt;
+
+        /* don't run past the s input sample block: */
+        susp_check_term_log_samples(s, s_ptr, s_cnt);
+        togo = MIN(togo, susp->s_cnt);
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo == 0) break;
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            if (to_stop < togo && ((togo = to_stop) == 0)) break;
+        }
+
+        n = togo;
+        s_ptr_reg = susp->s_ptr;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            *out_ptr_reg++ = *s_ptr_reg++;
+        } while (--n); /* inner loop */
+
+        /* using s_ptr_reg is a bad idea on RS/6000: */
+        susp->s_ptr += togo;
+        out_ptr += togo;
+        susp_took(s_cnt, togo);
+        cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* down_n_fetch */
+
+
+void down_s_fetch(susp, snd_list)
+  register down_susp_type susp;
+  snd_list_type snd_list;
+{
+    int cnt = 0; /* how many samples computed */
+    int togo = 0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type s_scale_reg = susp->s->scale;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "down_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = max_sample_block_len - cnt;
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo == 0) break;
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            if (to_stop < togo && ((togo = to_stop) == 0)) break;
+        }
+
+        n = togo;
+        s_ptr_reg = susp->s_ptr;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            *out_ptr_reg++ = (s_scale_reg * *s_ptr_reg++);
+        } while (--n); /* inner loop */
+
+        susp->s_ptr = s_ptr_reg;
+        out_ptr += togo;
+        cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* down_s_fetch */
+
+
+void down_i_fetch(susp, snd_list)
+  register down_susp_type susp;
+  snd_list_type snd_list;
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type s_x2_sample;
+    int togo = 0;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type s_pHaSe_iNcR_rEg = (sample_type) susp->s_pHaSe_iNcR;
+    register double s_pHaSe_ReG;
+    register sample_type s_x1_sample_reg;
+
+    falloc_sample_block(out, "down_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+        susp->started = true;
+        susp_check_term_log_samples(s, s_ptr, s_cnt);
+        susp->s_x1_sample = susp_fetch_sample(s, s_ptr, s_cnt);
+    }
+
+    susp_check_term_log_samples(s, s_ptr, s_cnt);
+    s_x2_sample = susp_current_sample(s, s_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = max_sample_block_len - cnt;
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo <= 0) {
+                togo = 0;
+                break;
+            }
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            if (to_stop < togo && ((togo = to_stop) <= 0)) {
+                togo = 0;
+                break;
+            }
+        }
+
+        n = togo;
+        s_pHaSe_ReG = susp->s_pHaSe;
+        s_x1_sample_reg = susp->s_x1_sample;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            while (s_pHaSe_ReG >= 1.0) {
+                s_x1_sample_reg = s_x2_sample;
+                /* pick up next sample as s_x2_sample: */
+                susp->s_ptr++;
+                susp_took(s_cnt, 1);
+                s_pHaSe_ReG -= 1.0;
+                /* derived from susp_check_term_log_samples_break, but with
+                        a goto instead of a break */
+                if (susp->s_cnt == 0) {
+                    susp_get_samples(s, s_ptr, s_cnt);
+                    terminate_test(s_ptr, s, susp->s_cnt);
+                    /* see if newly discovered logical stop time: */
+                    logical_stop_test(s, susp->s_cnt);
+                    if ((susp->terminate_cnt != UNKNOWN &&
+                         susp->terminate_cnt <
+                           susp->susp.current + cnt + togo) ||
+                        (!susp->logically_stopped && 
+                         susp->susp.log_stop_cnt != UNKNOWN &&
+                         susp->susp.log_stop_cnt < 
+                           susp->susp.current + cnt + togo)) {
+                        goto breakout;
+                    }
+                }
+                s_x2_sample = susp_current_sample(s, s_ptr);
+            }
+            *out_ptr_reg++ = (sample_type) 
+                (s_x1_sample_reg * (1 - s_pHaSe_ReG) + 
+                 s_x2_sample * s_pHaSe_ReG);
+            s_pHaSe_ReG += s_pHaSe_iNcR_rEg;
+        } while (--n); /* inner loop */
+breakout:
+        togo -= n;
+        susp->s_pHaSe = s_pHaSe_ReG;
+        susp->s_x1_sample = s_x1_sample_reg;
+        out_ptr += togo;
+        cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* down_i_fetch */
+
+
+void down_toss_fetch(snd_list)
+  snd_list_type snd_list;
+{
+    register down_susp_type susp = (down_susp_type) snd_list->u.susp;
+    long final_count = MIN(susp->susp.current + max_sample_block_len,
+                           susp->susp.toss_cnt);
+    time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while (((long) ((final_time - susp->s->t0) * susp->s->sr + 0.5)) >=
+           susp->s->current)
+        susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    if (final_count == susp->susp.toss_cnt) {
+        n = ROUND((final_time - susp->s->t0) * susp->s->sr -
+             (susp->s->current - susp->s_cnt));
+        susp->s_ptr += n;
+        susp_took(s_cnt, n);
+        susp->susp.fetch = susp->susp.keep_fetch;
+    }
+    snd_list->block_len = (short) (final_count - susp->susp.current);
+    susp->susp.current = final_count;
+    snd_list->u.next = snd_list_create((snd_susp_type) susp);
+    snd_list->block = internal_zero_block;
+}
+
+
+void down_mark(down_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void down_free(down_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(down_susp_node), "down_free");
+}
+
+
+void down_print_tree(down_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_down(sr, s)
+  rate_type sr;
+  sound_type s;
+{
+    register down_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = s->t0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+
+    if (s->sr < sr) {
+        sound_unref(s);
+        xlfail("snd-down: output sample rate must be lower than input");
+    }
+    falloc_generic(susp, down_susp_node, "snd_make_down");
+
+    /* select a susp fn based on sample rates */
+    if (s->sr == sr) {
+        susp->susp.fetch = ((s->scale == 1.0) ?
+                                down_n_fetch : down_s_fetch);
+    } else {
+        susp->susp.fetch = down_i_fetch;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = MIN(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = ROUND((t0 - t0_min) * sr);
+    if (susp->susp.toss_cnt > 0) {
+        susp->susp.keep_fetch = susp->susp.fetch;
+        susp->susp.fetch = down_toss_fetch;
+        t0 = t0_min;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = down_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = down_mark;
+    susp->susp.print_tree = down_print_tree;
+    susp->susp.name = "down";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->s_pHaSe = 0.0;
+    susp->s_pHaSe_iNcR = s->sr / sr;
+    susp->s_n = 0;
+    susp->output_per_s = sr / s->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_down(sr, s)
+  rate_type sr;
+  sound_type s;
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_down(sr, s_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/downsample.h b/lib-src/libnyquist/nyquist/nyqsrc/downsample.h
new file mode 100644
index 0000000..1435a73
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/downsample.h
@@ -0,0 +1,3 @@
+sound_type snd_make_down();
+sound_type snd_down();
+    /* LISP: (snd-down ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/exitpa.h b/lib-src/libnyquist/nyquist/nyqsrc/exitpa.h
new file mode 100644
index 0000000..ffdd22d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/exitpa.h
@@ -0,0 +1,3 @@
+/* exitpa.h -- declare portaudio_exit() */
+
+void portaudio_exit();
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp b/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp
new file mode 100644
index 0000000..7b4f08e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp
@@ -0,0 +1,139 @@
+// f0 -- frequency estimation
+
+#include <stdio.h>
+
+
+
+// Estimate a local minimum (or maximum) using parabolic 
+// interpolation. The parabola is defined by the points 
+// (x1,y1),(x2,y2), and (x3,y3).
+float parabolic_interp(float x1, float x2, float x3, float y1, float y2, float y3, float *min)
+{
+  float a, b, c;
+  float pos;
+
+  //  y1=a*x1^2+b*x1+c
+  //  y2=a*x2^2+b*x2+c
+  //  y3=a*x3^2+b*x3+c
+
+  //  y1-y2=a*(x1^2-x2^2)+b*(x1-x2)
+  //  y2-y3=a*(x2^2-x3^2)+b*(x2-x3)
+
+  //  (y1-y2)/(x1-x2)=a*(x1+x2)+b
+  //  (y2-y3)/(x2-x3)=a*(x2+x3)+b
+
+  a= ((y1-y2)/(x1-x2)-(y2-y3)/(x2-x3))/(x1-x3);
+  b= (y1-y2)/(x1-x2) - a*(x1+x2);
+  c= y1-a*x1*x1-b*x1;
+
+  *min= c;
+
+  // dy/dx = 2a*x + b = 0
+  
+  pos= -b/2.0/a;
+
+  return pos;
+
+}
+
+
+
+float f0_estimate(float *samples, int n, int m, float threshold, float *results, float *min)
+    // samples is a buffer of samples
+    // n is the number of samples, equals twice longest period, must be even
+    // m is the shortest period in samples
+    // results is an array of size n/2 - m + 1, the number of different lags
+{
+    // work from the middle of the buffer:
+    int middle = n / 2;
+    int i, j; // loop counters
+    // how many different lags do we compute?
+    float left_energy = 0;
+    float right_energy = 0;
+    // for each window, we keep the energy so we can compute the next one 
+    // incrementally. First, we need to compute the energies for lag m-1:
+    for (i = 0; i < m - 1; i++) {
+        float left = samples[middle - 1 - i];
+        left_energy += left * left;
+        float right = samples[middle + i];
+        right_energy += right * right;
+    }
+    for (i = m; i <= middle; i++) {
+        // i is the lag and the length of the window
+        // compute the energy for left and right
+        float left = samples[middle - i];
+        left_energy += left * left;
+        float right = samples[middle - 1 + i];
+ 
+        right_energy += right * right;
+        //  compute the autocorrelation
+        float auto_corr = 0;
+        for (j = 0; j < i; j++) {
+            auto_corr += samples[middle - i + j] * samples[middle + j];
+        }
+        float non_periodic = (left_energy + right_energy - 2 * auto_corr);// / i;
+        results[i - m] = non_periodic;
+
+    }
+
+
+    // normalize by the cumulative sum
+    float cum_sum=0.0;
+    for (i = m; i <= middle; i++) {
+      cum_sum+=results[i-m];
+      results[i-m]=results[i-m]/(cum_sum/(i-m+1));
+
+    }
+
+    int min_i=m;  // value of initial estimate
+    for (i = m; i <= middle; i++) {
+      if (results[i - m] < threshold) {
+	min_i=i;
+	break;
+      } else if (results[i-m]<results[min_i-m])
+	min_i=i;
+
+    }
+    
+
+
+    // use parabolic interpolation to improve estimate
+    float freq;
+    if (i>m && i<middle) {
+      freq=parabolic_interp((float)(min_i-1),(float)(min_i),(float)(min_i+1),
+      				results[min_i-1-m],results[min_i-m],results[min_i+1-m], min);
+      //freq=(float)min_i;
+      printf("%d %f\n",min_i,freq);
+    } else {
+      freq=(float)min_i;
+      *min=results[min_i-m];
+    }
+    return freq;
+}
+
+
+
+float best_f0(float *samples, int n, int m, float threshold, int Tmax)
+ // samples is a buffer of samples
+ // n is the number of samples, equals twice longest period plus Tmax, must be even
+ // m is the shortest period in samples
+ // threshold is the 
+ // results is an array of size n/2 - m + 1, the number of different lags
+  // Tmax is the length of the search 
+{
+  float* results=new float[n/2-m+1];
+  float min=10000000.0;
+  float temp;
+  float best_f0;
+  float f0;
+
+  for (int i=0; i<Tmax; i++) {
+    f0=f0_estimate(&samples[i], n, m, threshold, results, &temp);
+    if (temp<min) {
+      min=temp;
+      best_f0=f0;
+    }
+  }
+  delete(results);
+  return best_f0;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/f0.h b/lib-src/libnyquist/nyquist/nyqsrc/f0.h
new file mode 100644
index 0000000..13c3308
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/f0.h
@@ -0,0 +1,8 @@
+#ifndef _FLOAT_H
+#define _FLOAT_H
+
+float f0_estimate(float *samples, int n, int m, float threshold, float *results, float *min);
+
+float best_f0(float *samples, int n, int m, float threshold, int Tmax);
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/falloc.c b/lib-src/libnyquist/nyquist/nyqsrc/falloc.c
new file mode 100644
index 0000000..25609c7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/falloc.c
@@ -0,0 +1,255 @@
+/*
+ * falloc.c
+ * data for Nyquist memory allocation.
+ */
+
+#include <stdio.h>
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+
+/* special free lists */
+CQUE *sample_block_free = NULL;    /* really a sample_block_type */
+
+/* special counts */
+int sample_block_used = 0;
+int sample_block_low_water = 0;
+int sample_block_total = 0;
+int snd_list_used = 0;
+int sound_used = 0;
+
+/* generic free lists */
+CQUE *generic_free[MAXLISTS];
+
+
+void falloc_init(void)
+{
+    int i;
+    for (i = 0; i < MAXLISTS; i++) generic_free[i] = NULL;
+}
+
+
+/* memory pool */
+char *poolp = NULL;
+char *poolend = NULL;
+
+/* sample block memory pool */
+char *spoolp = NULL;
+char *spoolend = NULL;
+
+int npools = 0;
+
+#if defined(TRACK_POOLS) && TRACK_POOLS
+#define POOL_HEAD_SIZE (round_size(sizeof(CQUE)))
+CQUE *pools = NULL;
+#endif
+
+void sound_already_free_test(s)
+  sound_type s;
+{
+    sound_type sp;
+    for (sp = (sound_type) sound_free; sp; sp = (sound_type) ((CQUE *) sp)->qnext) {
+        if (s == sp) {
+            stdputstr("SOUND ALREADY FREE!!!");
+            fflush(stdout);
+            sp = 0; sp->list = 0;   /* trap to debugger */
+        }
+    }
+}
+
+
+/* new_pool -- allocate a new pool from which mem is allocated */
+/**/
+void new_pool(void)
+{
+    poolp = (char *) malloc(MAXPOOLSIZE);
+
+    if (poolp == NULL) {
+        fprintf(STDERR, "Nyquist: out of memory!\n");
+        EXIT(1);
+    }
+
+    poolend = poolp + MAXPOOLSIZE;
+    npools++;
+    /* stick to double word boundaries */
+    poolp = (char *) round_size(((long) poolp));
+}
+
+/* new_pool -- allocate a new pool from which mem is allocated */
+/**/
+void new_spool(void)
+{
+#if defined(TRACK_POOLS) && TRACK_POOLS
+    spoolp = (char *) malloc(MAXSPOOLSIZE + POOL_HEAD_SIZE);
+#else
+    spoolp = (char *) malloc(MAXSPOOLSIZE);
+#endif
+
+    if (spoolp == NULL) {
+        fprintf(STDERR, "Nyquist: out of memory!\n");
+        EXIT(1);
+    }
+
+#if defined(TRACK_POOLS) && TRACK_POOLS
+    Qenter(pools, spoolp);
+    spoolp += POOL_HEAD_SIZE;
+#endif
+
+    spoolend = spoolp + MAXSPOOLSIZE;
+    npools++;
+    /* stick to double word boundaries */
+    spoolp = (char *) round_size(((long) spoolp));
+}
+
+
+/* find_sample_block -- get sample block when freelist is empty */
+/* Try these strategies in order:
+   1) try free list
+   2) use pool to get sample_blocks_low_water + BLOCKS_PER_GC blocks or until
+      pool runs out
+   3) GC and try free list again, set sample_blocks_low_water to 
+      sample_blocks_used
+   4) try pool again
+   5) allocate new pool and use it
+ */
+sample_block_type find_sample_block(void)
+{	
+    sample_block_type sp;
+    if (sample_block_total < sample_block_low_water + BLOCKS_PER_GC &&
+        check_spool(round_size(sizeof(sample_block_node)))) {
+        if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE;
+        sp = (sample_block_type) spoolp;
+        spoolp += round_size(sizeof(sample_block_node));
+        sample_block_total++;
+/*	printf("fp%d ", sample_block_total - sample_block_low_water); */
+    } else {
+/*	printf("falloc calling gc\n"); */
+        gc();
+        sample_block_low_water = sample_block_used;
+        if (!Qempty(sample_block_free)) {
+            Qget(sample_block_free, sample_block_type, sp);
+/*	    printf("gc, then from freelist\n"); */
+        } else if (check_spool(round_size(sizeof(sample_block_node)))) {
+            if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE;
+            sp = (sample_block_type) spoolp;
+            spoolp += round_size(sizeof(sample_block_node));
+            sample_block_total++;
+/*	    printf("gc, then from spool\n"); */
+        } else {
+            new_spool();
+            if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE;
+            sp = (sample_block_type) spoolp;
+            spoolp += round_size(sizeof(sample_block_node));
+            sample_block_total++;
+/*	    printf("gc, then new spool\n"); */
+        }
+    }
+    return sp;
+}
+
+
+
+/* get_from_pool -- return size bytes from pool memory */
+/**/
+char *get_from_pool(size_t siz)
+{
+    if (!check_pool(siz)) {
+        new_pool();
+    }
+    poolp += siz;
+    if (DEBUG_MEM) poolp += DEBUG_MEM_INFO_SIZE; /* allow for debug info */
+    return poolp - siz;
+}
+
+
+#if defined(TRACK_POOLS) && TRACK_POOLS
+
+/* falloc_gc -- return empty pools to the system */
+/**/
+void falloc_gc()
+{
+   CQUE *lp = NULL;
+   CQUE *cp;
+   CQUE *np;
+   CQUE *tlist = NULL;
+
+   /* Scan all allocated pools */
+   for (cp = pools; cp; lp = cp, cp = np) {
+      char *str = ((char *)cp) + POOL_HEAD_SIZE;
+      char *end = str + MAXSPOOLSIZE;
+      long tsiz = end - str;
+      long csiz = 0;
+      CQUE *tsave = NULL;
+      CQUE *ln = NULL;
+      CQUE *cn;
+      CQUE *nn;
+
+      /* Save pointer to next pool */
+      np = cp->qnext;
+
+      /* Remember head of temp free list */
+      tsave = tlist;
+
+      /* Scan all nodes on the free list */
+      for (cn = sample_block_free; cn; ln = cn, cn = nn) {
+
+         /* Get next node */
+         nn = cn->qnext;
+
+         /* Count it if the node belongs to this pool */
+         if (cn >= (CQUE *) str && cn <= (CQUE *) end) {
+            csiz += round_size(sizeof(sample_block_node));
+
+            Qenter(tlist, cn);
+
+            /* Unlink the node */
+            if (cn == sample_block_free) {
+               sample_block_free = nn;
+               cn = NULL;
+            }
+            else {
+               ln->qnext = nn;
+               cn = ln;
+            }
+         }
+      }
+
+      /* The pool had inuse nodes */
+      if (csiz != tsiz) {
+         continue;
+      }
+   
+      /* Remove the nodes from the temp free list */
+      tlist = tsave;
+
+      /* Maintain stats */
+      sample_block_total -= (tsiz / round_size(sizeof(sample_block_node)));
+      npools--;
+
+      /* If this is the active pool, then reset current pointers */
+      if (spoolp >= str && spoolp <= end) {
+         spoolp = NULL;
+         spoolend = NULL;
+      }
+
+      /* Release the pool to the system */
+      free(cp);
+
+      /* Unlink this pool from the list */
+      if (cp == pools) {
+         pools = np;
+         cp = NULL;
+      }
+      else {
+         lp->qnext = np;
+         cp = lp;
+      }
+   }
+
+   /* Resave list of free nodes */
+   sample_block_free = tlist;
+}
+
+#endif
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/falloc.h b/lib-src/libnyquist/nyquist/nyqsrc/falloc.h
new file mode 100644
index 0000000..1219bfd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/falloc.h
@@ -0,0 +1,253 @@
+/*
+ * falloc.h
+ * nyquist memory allocation data structures and macros
+ * 
+ * there is an falloc and ffree for each major type of data structure
+ * there is an falloc and ffree for generic (not so common) structures
+ * there is an frelease for some structures.  this reduces the 
+ *      reference count for the particular structure by 1; it 
+ *      does not continue recursively.
+ */
+
+/* Debugging support:
+ * When DEBUG_MEM is set, each piece of allocated storage will contain
+ * a pointer to a string naming the caller or other allocation info,
+ * and a sequence number.  (8 extra bytes are allocated for this info).
+ *
+ * When storage is freed, the ID is set to NULL, and the routine
+ * dbg_mem_check(ptr) will abort if ID is NULL.  Call this routine to
+ * avoid following a pointer to data that was previously freed.
+ *
+ * The goal of this support is to allow you to "go back" to the point
+ * where memory is corrupted; specifically where a memory block is freed
+ * too early.
+ *
+ * When a memory-related bug is crashing the system:
+ * (1) Recompile with DEBUG_MEM on.
+ * (2) Develop some Nyquist code that will predictably crash the system.
+ * (3) When Nyquist crashes, use a debugger to find where the bad
+ *   pointer came from.  See if the source of the pointer was freed.
+ * (4) If the source of the pointer was freed, then notice the sequence
+ *   number.
+ * (5) Rerun with dbg_mem_seq_num set to the number noted in (4).
+ * (6) Nyquist will print when the storage in question was allocated and
+ *   freed.  Use the debugger to find out why the storage is
+ *   freed too early and who did it.
+ * (7) If the source of the pointer in (3) was not freed, you're on your
+ *   own.
+ *
+ * The DEBUG_MEM related routines are:
+ *    dbg_mem_allocated: called when memory is allocated
+ *    dbg_mem_freed: called when memory is freed
+ *    dbg_mem_released: called when memory is released
+ *    dbg_mem_check: called to check memory
+ *
+ * see also xldmem.c:
+ * by setting xldmem_trace to a pointer, you can trace when the
+ * pointer is referenced by anything in the heap
+ */
+
+
+/* to get size_t on pmax: */
+#ifdef pmax
+#include "sys/types.h"
+#endif
+
+#include "cque.h"
+#include "debug.h"
+
+#define DEBUG_MEM 0
+#define DEBUG_MEM_INFO_SIZE (sizeof(long) + sizeof(char *))
+
+/* special free lists */
+extern CQUE *sample_block_free; /* really a sample_block_type */
+
+/* special counts */
+extern int sample_block_total;
+extern int sample_block_used;
+extern int snd_list_used;
+extern int sound_used;
+extern long table_memory;
+
+/* generic free lists */
+#define MAXLISTS 128
+extern CQUE *generic_free[MAXLISTS];
+
+/* general memory pool */
+#define MAXPOOLSIZE 1000000
+extern char *poolp;
+extern char *poolend;
+
+/* sample block memory pool */
+#define MAXSPOOLSIZE (256 * round_size(sizeof(sample_block_node)))
+extern char *spoolp;
+extern char *spoolend;
+
+extern int npools;
+extern int sample_blocks_since_gc;
+
+#if !defined(TRACK_POOLS)
+#define TRACK_POOLS 1
+#endif
+
+#if defined(TRACK_POOLS) && TRACK_POOLS
+// extern CQUE *pools;
+void falloc_gc();
+#endif
+
+void falloc_init(void);
+void new_pool(void);
+void new_spool(void);
+sample_block_type find_sample_block(void);
+
+char *get_from_pool(size_t siz);
+
+#define round_size(n)  (((n) + 7) & ~7)
+
+/* check_pool -- returns true if enough bytes are available */
+#if DEBUG_MEM
+#define check_pool(size) (poolp + (size) + DEBUG_MEM_INFO_SIZE <= poolend)
+#define check_spool(size) (spoolp + (size) + DEBUG_MEM_INFO_SIZE <= spoolend)
+#define DBG_MEM_ALLOCATED(p, who) dbg_mem_allocated(p, who)
+#define DBG_MEM_FREED(p, who) dbg_mem_freed(p, who)
+#define DBG_MEM_RELEASED(p, who) dbg_mem_released(p, who)
+#else
+#define check_pool(size) (poolp + (size) <= poolend)
+#define check_spool(size) (spoolp + (size) <= spoolend)
+#define DBG_MEM_ALLOCATED(p, who)
+#define DBG_MEM_FREED(p, who)
+#define DBG_MEM_RELEASED(p, who)
+#endif
+
+#define BLOCKS_PER_GC 100
+
+#define falloc_sample_block(sp, who) {  \
+    if (!Qempty(sample_block_free)) \
+        Qget(sample_block_free, sample_block_type, sp) \
+    else sp = find_sample_block(); \
+    /* sample_block_test(sp, "falloc_sample_block"); */ \
+    /* printf("[%x] ", sp); */ \
+    DBG_MEM_ALLOCATED(sp, who); \
+    sp->refcnt = 1; \
+    sample_block_used++; \
+}
+
+
+#define ffree_sample_block(sp, who) { \
+    /* printf("freeing sample_block@%x\n", sp); */ \
+    DBG_MEM_FREED(sp, who); \
+    Qenter(sample_block_free, sp); \
+    sample_block_used--; \
+}
+
+#define frelease_sample_block(sp, who) { \
+    sp->refcnt--; \
+    DBG_MEM_RELEASED(sp, who); \
+    if (sp->refcnt <= 0) { \
+        ffree_sample_block(sp); \
+    } \
+}
+
+
+/* NOTE: This must not cause garbage collection.
+ * LVAL parameters to snd_make_? functions are not
+ * protected and falloc_sound is invoked there.
+ */
+#define snd_list_free (generic_free[round_size(sizeof(snd_list_node)) >> 3])
+
+#define falloc_snd_list(sp, who) {  \
+    if (!Qempty(snd_list_free)) \
+        Qget(snd_list_free, snd_list_type, sp) \
+    else \
+        sp = (snd_list_type)get_from_pool(round_size(sizeof(snd_list_node)));\
+    snd_list_used++; \
+    DBG_MEM_ALLOCATED(sp, who); \
+}
+
+
+#define ffree_snd_list(sp, who) { \
+    DBG_MEM_FREED(sp, who); \
+    Qenter(snd_list_free, sp); \
+    snd_list_used--; \
+}
+
+
+#define frelease_snd_list(sp, who) { \
+    sp->refcnt--; \
+    DBG_MEM_RELEASED(sp, who); \
+    if (sp->refcnt <= 0) { \
+        ffree_snd_list(sp, who); \
+    } \
+}
+
+
+#define sound_free (generic_free[round_size(sizeof(sound_node)) >> 3])
+
+#define NORMALSOUNDALLOC
+#ifdef NORMALSOUNDALLOC
+#define falloc_sound(sp, who) {  \
+    if (!Qempty(sound_free)) { \
+        Qget(sound_free, sound_type, sp); \
+    } else { \
+        sp = (sound_type) get_from_pool(round_size(sizeof(sound_node))); \
+    } \
+    sound_used++; \
+    DBG_MEM_ALLOCATED(sp, who); \
+}
+#else
+#define falloc_sound(sp) \
+    sp =(sound_type) \
+        get_from_pool(round_size(sizeof(sound_node)))
+#endif
+
+/* note: usually you call sound_unref, not this macro */
+#define ffree_sound(sp, who) { \
+/*    sound_already_free_test(); */ \
+    DBG_MEM_FREED(sp, who); \
+    Qenter(sound_free, sp); \
+    sound_used--; \
+}
+
+
+/* falloc_generic -- sp gets new node of type sptype */
+/**/
+#define falloc_generic(sp, sptype, who) { \
+    int size = round_size(sizeof(sptype)); \
+    falloc_generic_bytes(sp, sptype, size, who) }
+
+/* falloc_generic_n -- sp gets new array of n sptype's */
+/**/
+#define falloc_generic_n(sp, sptype, n, who) { \
+    int min_size = sizeof(sptype) * (n); \
+    int size = round_size(min_size); \
+    falloc_generic_bytes(sp, sptype, size, who) }
+
+#define falloc_generic_bytes(sp, sptype, size, who) \
+    if ((size >> 3) >= MAXLISTS) { \
+        stdputstr("falloc_generic problem\n"); \
+        sp = (sptype *) malloc(size); \
+    } else if (!Qempty(generic_free[size >> 3])) { \
+        Qget(generic_free[size >> 3], sptype *, sp); \
+    } else { \
+        sp = (sptype *) get_from_pool(size); \
+    } \
+    DBG_MEM_ALLOCATED(sp, who); \
+/*    printf("GENERIC ALLOC %x\n", sp);  */
+
+
+/* ffree_generic puts an item back on proper freelist */
+/* NOTE: sIzE is capitalized funny so that it will not
+ * match an actual parameter, e.g. if the caller writes
+ * ffree_generic(ptr, size), we don't want the expanded
+ * code to include: "int size = round_size(size) >> 3"!
+ */
+#define ffree_generic(sp, nn, who) { \
+    int sIzE = round_size(nn) >> 3; \
+    DBG_MEM_FREED(sp, who); \
+    /* printf("GENERIC FREE %x SIZE %d\n", sp, nnn); */ \
+    if ((sIzE) >= MAXLISTS) { \
+        free(sp); \
+    } else { \
+        Qenter(generic_free[sIzE], sp); \
+    } \
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.c b/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.c
new file mode 100644
index 0000000..d78d5c5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.c
@@ -0,0 +1,123 @@
+/*
+ * ffilterkit.c (library "filterkit.a"):  
+ * Kaiser-windowed low-pass filter support.
+ */
+
+/* ffilterkit.c
+ *
+ * FilterUp() - Applies a filter to a given sample when up-converting.
+ * FilterUD() - Applies a filter to a given sample when up- or down-
+ *                   converting.
+ */
+
+ /* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include "stdefs.h"
+#include "fresample.h"
+#include "ffilterkit.h"
+
+
+fast_float FilterUp(float Imp[], float ImpD[], 
+                     int Nwing, boolean Interp,
+                     float *Xp, double Ph, int Inc)
+{
+    float *Hp, *Hdp = NULL, *End;
+    fast_float a = 0;
+    fast_float v, t;
+    double exact_index = Ph * Npc;
+    long index = (long) exact_index; /* convert fraction to filter index */
+
+/*	nyquist_printf("FilterUp, Inc %d, phase %g\n", Inc, Ph);  */
+    v=0;
+    Hp = &Imp[index];
+    End = &Imp[Nwing];
+    if (Interp) {
+        Hdp = &ImpD[index];
+        a = exact_index - index;
+/*	nyquist_printf("fraction %g\n", a); */
+    }
+    if (Inc == 1)		/* If doing right wing...              */
+    {				/* ...drop extra coeff, so when Ph is  */
+        End--;			/*    0.5, we don't do too many mult's */
+        if (Ph == 0)		/* If the phase is zero...           */
+        {			/* ...then we've already skipped the */
+            Hp += Npc;		/*    first sample, so we must also  */
+            Hdp += Npc;		/*    skip ahead in Imp[] and ImpD[] */
+        }
+    }
+    if (Interp) {
+      while (Hp < End) {
+          t = *Hp;		/* Get filter coeff */
+          /*  t scaled by 2^(16 + NLpScl)/LpScl */
+          t += *Hdp *a;	 /* t is now interp'd filter coeff */
+          Hdp += Npc;		/* Filter coeff differences step */
+          t *= *Xp;		/* Mult coeff by input sample */
+          /*  t scaled by 2^(16 + NLpScl)/LpScl */
+          v += t;			/* The filter output */
+          Hp += Npc;		/* Filter coeff step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      } 
+    } else {
+      while (Hp < End) {
+          t = *Hp;		/* Get filter coeff */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Hp += Npc;		/* Filter coeff step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      }
+    }
+    return(v);
+}
+
+fast_float FilterUD( float Imp[], float ImpD[],
+                     int Nwing, boolean Interp,
+                     float *Xp, double Ph, int Inc, double dhb)
+{
+    double a;
+    float *Hp, *Hdp, *End;
+    fast_float v, t;
+    double Ho;
+    
+    v=0;
+    Ho = Ph*dhb;
+    End = &Imp[Nwing];
+    if (Inc == 1)		/* If doing right wing...              */
+    {				/* ...drop extra coeff, so when Ph is  */
+        End--;			/*    0.5, we don't do too many mult's */
+        if (Ph == 0)		/* If the phase is zero...           */
+          Ho += dhb;		/* ...then we've already skipped the */
+    }				/*    first sample, so we must also  */
+                                /*    skip ahead in Imp[] and ImpD[] */
+    if (Interp) {
+      long HoIndex = (long) Ho;
+      while ((Hp = &Imp[HoIndex]) < End) {
+          t = *Hp;		/* Get IR sample */
+          Hdp = &ImpD[HoIndex];  /* get interp (lower Na) bits from diff table*/
+          a = Ho - HoIndex;	/* a is logically between 0 and 1 */
+          t += *Hdp * a; /* t is now interp'd filter coeff */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Ho += dhb;		/* IR step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+          HoIndex = (long) Ho;
+      }
+    } else {
+      long HoIndex = (long) Ho;
+      while ((Hp = &Imp[HoIndex]) < End) {
+          t = *Hp;		/* Get IR sample */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Ho += dhb;		/* IR step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+          HoIndex = (long) Ho;
+      }
+    }
+    return(v);
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.h b/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.h
new file mode 100644
index 0000000..d277e7d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/ffilterkit.h
@@ -0,0 +1,15 @@
+/*:filterkit.h */
+
+/*
+ * FilterUp() - Applies a filter to a given sample when up-converting.
+ * FilterUD() - Applies a filter to a given sample when up- or down-
+ *                   converting.
+ */
+
+fast_float FilterUp(mem_float Imp[], mem_float ImpD[], int Nwing, 
+                    boolean Interp, mem_float *Xp, double Ph, int Inc);
+
+fast_float FilterUD(mem_float Imp[], mem_float ImpD[], int Nwing,
+                    boolean Interp, mem_float *Xp, double Ph, int Inc,
+                    double dhb);
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fft-rbd.c b/lib-src/libnyquist/nyquist/nyqsrc/fft-rbd.c
new file mode 100644
index 0000000..6d01e6a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fft-rbd.c
@@ -0,0 +1,156 @@
+/* samples.c -- fugue sound data type */
+
+#include <stdio.h>
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "fft.h"
+
+
+/* NOTE: this code does not properly handle start times that do not
+ * correspond to the time of the first actual sample
+ */
+
+
+/* snd_fetch_array -- fetch a lisp array of samples */
+/*
+ * storage layout: the extra field points to extra state that we'll use
+ * extra[0] -> length of extra storage
+ * extra[1] -> CNT (number of samples in current block)
+ * extra[2] -> INDEX (current sample index in current block)
+ * extra[3] -> FILLCNT (how many samples in buffer)
+ * extra[4] -> TERMCNT (how many samples until termination)
+ * extra[4 .. 4+len-1] -> samples (stored as floats)
+ * 
+ * Termination details:
+ *   Return NIL when the sound terminates.
+ *   Termination is defined as the point where all original
+ * signal samples have been shifted out of the samples buffer
+ * so that all that's left are zeros from beyond the termination
+ * point.
+ *   Implementation: when termination is discovered, set TERMCNT
+ * to the number of samples to be shifted out. TERMCNT is initially
+ * -1 as a flag that we haven't seen the termination yet. 
+ * Each time samples are shifted, decrement TERMCNT by the shift amount.
+ * When TERMCNT goes to zero, return NULL.
+ */
+
+#define CNT extra[1]
+#define INDEX extra[2]
+#define FILLCNT extra[3]
+#define TERMCNT extra[4]
+#define OFFSET 5
+#define SAMPLES list->block->samples
+
+LVAL snd_fft(sound_type s, long len, long step /* more parameters may belong here */)
+{
+    long i, maxlen, skip, fillptr;
+    float *samples;
+    LVAL result;
+    
+    if (len < 1) xlfail("len < 1");
+
+    if (!s->extra) { /* this is the first call, so fix up s */
+        /* note: any storage required by fft must be allocated here in a contiguous
+         * block of memory who's size is given by the first long in the block.
+         * Here, there are 4 more longs after the size, and then room for len floats
+         * (assumes that floats and longs take equal space).
+         *
+         * The reason for this storage restriction is that when a sound is freed, the
+         * block of memory pointed to by extra is also freed. There is no function
+         * call that might free a more complex structure (this could be added in sound.c
+         * however if it's really necessary).
+         */
+        falloc_generic_n(s->extra, long, len + OFFSET, "snd_fft");
+        s->extra[0] = sizeof(long) * (len + OFFSET);
+        s->CNT = s->INDEX = s->FILLCNT = 0;
+        s->TERMCNT = -1;
+        maxlen = len;
+    } else {
+        maxlen = (s->extra[0] / sizeof(long)) - OFFSET;
+        if (maxlen < 1) xlfail("sound in use by another iterator");
+        if (maxlen < len) xlfail("len grew");
+    }
+    samples = (float *) &(s->extra[OFFSET]);
+    
+    /* step 1: refill buffer with samples */
+    fillptr = s->FILLCNT;
+    while (fillptr < maxlen) {
+        if (s->INDEX == s->CNT) {
+            sound_get_next(s, &(s->CNT));
+            if (s->SAMPLES == zero_block->samples) {
+                if (s->TERMCNT < 0) s->TERMCNT = fillptr;
+            }	
+            s->INDEX = 0;
+        }
+        samples[fillptr++] = s->SAMPLES[s->INDEX++] * s->scale;
+    }
+    s->FILLCNT = fillptr;
+
+    /* it is important to test here AFTER filling the buffer, because
+     * if fillptr WAS 0 when we hit the zero_block, then filling the 
+     * buffer will set TERMCNT to 0.
+     */
+    if (s->TERMCNT == 0) return NULL;
+    
+    /* logical stop time is ignored by this code -- to fix this,
+     * you would need a way to return the logical stop time to 
+     * the caller.
+     */
+
+    /* HERE IS WHERE THE FFT SHOULD TAKE PLACE ON samples. DO NOT
+     * DESTROY SAMPLES IF YOU WANT TO ALLOW OVERLAPPED FFT'S. THE
+     * CURRENT CODE RETURNS SAMPLES, BUT A REAL FFT WOULD RETURN
+     * THE RESULT OF THE FFT IN STEP 2, WHICH FOLLOWS:
+     */
+
+    /* step 2: construct an array and return it */
+    xlsave1(result);
+    result = newvector(len);
+
+    for (i = 0; i < len; i++) {
+        setelement(result, i, cvflonum(samples[i]));
+    }
+
+    /* step 3: shift samples by step */
+    if (step < 0) xlfail("step < 0");
+    s->FILLCNT -= step;
+    if (s->FILLCNT < 0) s->FILLCNT = 0;
+    for (i = 0; i < s->FILLCNT; i++) {
+        samples[i] = samples[i + step];
+    }
+    
+
+    if (s->TERMCNT >= 0) {
+        s->TERMCNT -= step;
+        if (s->TERMCNT < 0) s->TERMCNT = 0;
+    }
+
+
+    /* step 4: advance in sound to next sample we need
+     *   (only does work if step > size of buffer)
+     */
+    skip = step - maxlen;
+    while (skip > 0) {
+        long remaining = s->CNT - s->INDEX;
+        if (remaining >= skip) {
+            s->INDEX += skip;
+            skip = 0;
+        } else {
+            skip -= remaining;
+            sound_get_next(s, &(s->CNT));
+            s->INDEX = 0;
+        }
+    }
+    
+    /* restore the stack */
+    xlpop();
+    return result;
+} /* snd_fetch_array */
+
+
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fft.c b/lib-src/libnyquist/nyquist/nyqsrc/fft.c
new file mode 100644
index 0000000..95095ac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fft.c
@@ -0,0 +1,223 @@
+/* fft.c -- implement snd_fft */
+
+#define _USE_MATH_DEFINES 1 /* for Visual C++ to get M_LN2 */
+#include <math.h>
+#include <stdio.h>
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "fft.h"
+#include "fftext.h"
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  change for portability: min->MIN
+ */
+
+
+/* NOTE: this code does not properly handle start times that do not
+ * correspond to the time of the first actual sample
+ */
+
+
+/* The snd_fft function is based on snd_fetch_array */
+/*
+ * storage layout: the extra field points to extra state that we'll use
+ * extra[0] -> length of extra storage
+ * extra[1] -> CNT (number of samples in current block)
+ * extra[2] -> INDEX (current sample index in current block)
+ * extra[3] -> FILLCNT (how many samples in buffer)
+ * extra[4] -> TERMCNT (how many samples until termination)
+ * extra[5 .. 5+len-1] -> samples (stored as floats)
+ * extra[5+len .. 5+2*len-1] -> array of samples to fft
+ * extra[5+2*len ... 5+3*len-1] -> window coefficients
+ * 
+ * Termination details:
+ *   Return NIL when the sound terminates.
+ *   Termination is defined as the point where all original
+ * signal samples have been shifted out of the samples buffer
+ * so that all that's left are zeros from beyond the termination
+ * point.
+ *   Implementation: when termination is discovered, set TERMCNT
+ * to the number of samples to be shifted out. TERMCNT is initially
+ * -1 as a flag that we haven't seen the termination yet. 
+ * Each time samples are shifted, decrement TERMCNT by the shift amount.
+ * When TERMCNT goes to zero, return NULL.
+ */
+
+#define CNT extra[1]
+#define INDEX extra[2]
+#define FILLCNT extra[3]
+#define TERMCNT extra[4]
+#define OFFSET 5
+#define SAMPLES list->block->samples
+
+/* DEBUGGING PRINT FUNCTION:
+    void printfloats(char *caption, float *data, int len)
+    {
+        int i;
+        printf("%s: ", caption);
+        for (i = 0; i < len; i++) {
+            printf("%d:%g ", i, data[i]);
+        }
+        printf("\n");
+    }
+*/
+
+void n_samples_from_sound(sound_type s, long n, float *table)
+{
+    long blocklen;
+    sample_type scale_factor = s->scale;
+    s = sound_copy(s);
+    while (n > 0) {
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        long togo = MIN(blocklen, n);
+        long i;
+        sample_block_values_type sbufp = sampblock->samples;
+        for (i = 0; i < togo; i++) {
+            *table++ = (float) (*sbufp++ * scale_factor);
+        }
+        n -= togo;
+    }
+    sound_unref(s);
+}
+
+
+LVAL snd_fft(sound_type s, long len, long step, LVAL winval)
+{
+    long i, m, maxlen, skip, fillptr;
+    float *samples;
+    float *temp_fft;
+    float *window;
+    LVAL result;
+    
+    if (len < 1) xlfail("len < 1");
+
+    if (!s->extra) { /* this is the first call, so fix up s */
+        sound_type w = NULL;
+        if (winval) {
+            if (soundp(winval)) {
+                w = getsound(winval);
+            } else {
+                xlerror("expected a sound", winval);
+            }
+        }
+        /* note: any storage required by fft must be allocated here in a 
+         * contiguous block of memory who's size is given by the first long
+         * in the block. Here, there are 4 more longs after the size, and 
+         * then room for 3*len floats (assumes that floats and longs take 
+         * equal space).
+         *
+         * The reason for 3*len floats is to provide space for:
+         *    the samples to be transformed (len)
+         *    the complex FFT result (len)
+         *    the window coefficients (len)
+         *
+         * The reason for this storage restriction is that when a sound is 
+         * freed, the block of memory pointed to by extra is also freed. 
+         * There is no function call that might free a more complex 
+         * structure (this could be added in sound.c, however, if it's 
+         * really necessary).
+         */
+        s->extra = (long *) malloc(sizeof(long) * (3 * len + OFFSET));
+        s->extra[0] = sizeof(long) * (3 * len + OFFSET);
+        s->CNT = s->INDEX = s->FILLCNT = 0;
+        s->TERMCNT = -1;
+        maxlen = len;
+        window = (float *) &(s->extra[OFFSET + 2 * len]);
+        /* fill the window from w */
+        if (!w) {
+            for (i = 0; i < len; i++) *window++ = 1.0F;
+        } else {
+            n_samples_from_sound(w, len, window);
+        }
+    } else {
+        maxlen = ((s->extra[0] / sizeof(long)) - OFFSET) / 3;
+        if (maxlen != len) xlfail("len changed from initial value");
+    }
+    samples = (float *) &(s->extra[OFFSET]);
+    temp_fft = samples + len;
+    window = temp_fft + len;
+    /* step 1: refill buffer with samples */
+    fillptr = s->FILLCNT;
+    while (fillptr < maxlen) {
+        if (s->INDEX == s->CNT) {
+            sound_get_next(s, &(s->CNT));
+            if (s->SAMPLES == zero_block->samples) {
+                if (s->TERMCNT < 0) s->TERMCNT = fillptr;
+            }
+            s->INDEX = 0;
+        }
+        samples[fillptr++] = s->SAMPLES[s->INDEX++] * s->scale;
+    }
+    s->FILLCNT = fillptr;
+
+    /* it is important to test here AFTER filling the buffer, because
+     * if fillptr WAS 0 when we hit the zero_block, then filling the 
+     * buffer will set TERMCNT to 0.
+     */
+    if (s->TERMCNT == 0) return NULL;
+    
+    /* logical stop time is ignored by this code -- to fix this,
+     * you would need a way to return the logical stop time to 
+     * the caller.
+     */
+
+    /* step 2: construct an array and return it */
+    xlsave1(result);
+    result = newvector(len);
+
+    /* first len floats will be real part, second len floats imaginary
+     * copy buffer to temp_fft with windowing
+     */
+    for (i = 0; i < len; i++) {
+        temp_fft[i] = samples[i] * *window++;
+    }
+    /* perform the fft: */
+    m = round(log(len) / M_LN2); /* compute log-base-2(len) */
+    if (!fftInit(m)) rffts(temp_fft, m, 1);
+    else xlfail("FFT initialization error");
+
+    /* move results to Lisp array */
+    setelement(result, 0, cvflonum(temp_fft[0]));
+    setelement(result, len - 1, cvflonum(temp_fft[1]));
+    for (i = 2; i < len; i++) {
+        setelement(result, i - 1, cvflonum(temp_fft[i]));
+    }
+
+    /* step 3: shift samples by step */
+    if (step < 0) xlfail("step < 0");
+    s->FILLCNT -= step;
+    if (s->FILLCNT < 0) s->FILLCNT = 0;
+    for (i = 0; i < s->FILLCNT; i++) {
+        samples[i] = samples[i + step];
+    }
+
+    if (s->TERMCNT >= 0) {
+        s->TERMCNT -= step;
+        if (s->TERMCNT < 0) s->TERMCNT = 0;
+    }
+
+    /* step 4: advance in sound to next sample we need
+     *   (only does work if step > size of buffer)
+     */
+    skip = step - maxlen;
+    while (skip > 0) {
+        long remaining = s->CNT - s->INDEX;
+        if (remaining >= skip) {
+            s->INDEX += skip;
+            skip = 0;
+        } else {
+            skip -= remaining;
+            sound_get_next(s, &(s->CNT));
+            s->INDEX = 0;
+        }
+    }
+    
+    /* restore the stack */
+    xlpop();
+    return result;
+} /* snd_fetch_array */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fft.h b/lib-src/libnyquist/nyquist/nyqsrc/fft.h
new file mode 100644
index 0000000..74b2b24
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fft.h
@@ -0,0 +1,4 @@
+/* fft.h -- fft returned through a lisp array */
+
+LVAL snd_fft(sound_type s, long len, long step, LVAL w); 
+  /* LISP: (SND-FFT SOUND FIXNUM FIXNUM ANY) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fftr4.c b/lib-src/libnyquist/nyquist/nyqsrc/fftr4.c
new file mode 100644
index 0000000..d5dfcc9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fftr4.c
@@ -0,0 +1,264 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#ifdef WIN32
+#include <sys\time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#define PI 3.14159265359
+#define MAXPOW 24
+
+struct complex
+{
+    double r;
+    double i;
+};
+
+int pow_2[MAXPOW];
+int pow_4[MAXPOW];
+
+void twiddle(struct complex *W, int N, double stuff)
+{
+    W->r=cos(stuff*2.0*PI/(double)N);
+    W->i=-sin(stuff*2.0*PI/(double)N);
+}
+
+void bit_reverse_reorder(struct complex *W, int N)
+{
+    int bits, i, j, k;
+    double tempr, tempi;
+    
+    for (i=0; i<MAXPOW; i++)
+        if (pow_2[i]==N) bits=i;
+
+    for (i=0; i<N; i++)
+    {
+        j=0;
+        for (k=0; k<bits; k++)
+            if (i&pow_2[k]) j+=pow_2[bits-k-1];
+
+        if (j>i)  /** Only make "up" swaps */
+        {
+            tempr=W[i].r;
+            tempi=W[i].i;
+            W[i].r=W[j].r;
+            W[i].i=W[j].i;
+            W[j].r=tempr;
+            W[j].i=tempi;
+        }
+    }
+}
+void bit_r4_reorder(struct complex *W, int N)
+{
+    int bits, i, j, k;
+    double tempr, tempi;
+    
+    for (i=0; i<MAXPOW; i++)
+        if (pow_2[i]==N) bits=i;
+
+    for (i=0; i<N; i++)
+    {
+        j=0;
+        for (k=0; k<bits; k+=2)
+        {
+            if (i&pow_2[k]) j+=pow_2[bits-k-2];
+            if (i&pow_2[k+1]) j+=pow_2[bits-k-1];
+        }
+
+        if (j>i)  /** Only make "up" swaps */
+        {
+            tempr=W[i].r;
+            tempi=W[i].i;
+            W[i].r=W[j].r;
+            W[i].i=W[j].i;
+            W[j].r=tempr;
+            W[j].i=tempi;
+        }
+    }
+}
+
+/** RADIX-4 FFT ALGORITHM */
+void radix4(struct complex *x, int N)
+{ 
+    int    n2, k1, N1, N2;
+    struct complex W, bfly[4];
+
+    N1=4;
+    N2=N/4;
+    
+    /** Do 4 Point DFT */ 
+    for (n2=0; n2<N2; n2++)
+    {
+        /** Don't hurt the butterfly */
+        bfly[0].r = (x[n2].r + x[N2 + n2].r + x[2*N2+n2].r + x[3*N2+n2].r);
+        bfly[0].i = (x[n2].i + x[N2 + n2].i + x[2*N2+n2].i + x[3*N2+n2].i);
+
+        bfly[1].r = (x[n2].r + x[N2 + n2].i - x[2*N2+n2].r - x[3*N2+n2].i);
+        bfly[1].i = (x[n2].i - x[N2 + n2].r - x[2*N2+n2].i + x[3*N2+n2].r);
+
+        bfly[2].r = (x[n2].r - x[N2 + n2].r + x[2*N2+n2].r - x[3*N2+n2].r);
+        bfly[2].i = (x[n2].i - x[N2 + n2].i + x[2*N2+n2].i - x[3*N2+n2].i);
+
+        bfly[3].r = (x[n2].r - x[N2 + n2].i - x[2*N2+n2].r + x[3*N2+n2].i);
+        bfly[3].i = (x[n2].i + x[N2 + n2].r - x[2*N2+n2].i - x[3*N2+n2].r);
+
+
+        /** In-place results */
+        for (k1=0; k1<N1; k1++)
+        {
+            twiddle(&W, N, (double)k1*(double)n2);
+            x[n2 + N2*k1].r = bfly[k1].r*W.r - bfly[k1].i*W.i;
+            x[n2 + N2*k1].i = bfly[k1].i*W.r + bfly[k1].r*W.i;
+        }
+    }
+    
+    /** Don't recurse if we're down to one butterfly */
+    if (N2!=1)
+        for (k1=0; k1<N1; k1++)
+        {
+            radix4(&x[N2*k1], N2);
+        }
+}
+
+/** RADIX-2 FFT ALGORITHM */
+void radix2(struct complex *data, int N)
+{
+    int    n2, k1, N1, N2;
+    struct complex W, bfly[2];
+
+    N1=2;
+    N2=N/2;
+    
+    /** Do 2 Point DFT */
+    for (n2=0; n2<N2; n2++)
+    {
+        /** Don't hurt the butterfly */
+        twiddle(&W, N, (double)n2);
+        bfly[0].r = (data[n2].r + data[N2 + n2].r);
+        bfly[0].i = (data[n2].i + data[N2 + n2].i);
+        bfly[1].r = (data[n2].r - data[N2 + n2].r) * W.r - 
+            ((data[n2].i - data[N2 + n2].i) * W.i); 
+        bfly[1].i = (data[n2].i - data[N2 + n2].i) * W.r +
+            ((data[n2].r - data[N2 + n2].r) * W.i);
+
+        /** In-place results */
+        for (k1=0; k1<N1; k1++)
+        {
+            data[n2 + N2*k1].r = bfly[k1].r;
+            data[n2 + N2*k1].i = bfly[k1].i;
+        }
+    }
+    
+    /** Don't recurse if we're down to one butterfly */
+    if (N2!=1)
+        for (k1=0; k1<N1; k1++)
+            radix2(&data[N2*k1], N2);
+}
+
+void main(int argc, char *argv[])
+{
+    FILE   *infile;
+    int    N, radix, numsamp;
+    int    i;
+    struct complex *data;
+    double freq, phase, fs, A;
+    int    dotime;
+    struct timeval start, end;
+    long   totaltime;
+    
+#ifdef GEN
+    if (argc!=9)
+    {
+        printf("usage:\n");
+        printf("    fft [A] [f] [phase] [fs] [num samp] [sequence length] [radix] [time]\n");
+        printf("        output: DFT\n");
+        exit(1);
+    }
+    
+    
+    sscanf(argv[1], "%lf", &A);
+    sscanf(argv[2], "%lf", &freq);
+    sscanf(argv[3], "%lf", &phase);
+    sscanf(argv[4], "%lf", &fs);
+    sscanf(argv[5], "%d", &numsamp);
+    sscanf(argv[6], "%d", &N);
+    sscanf(argv[7], "%d", &radix);
+    sscanf(argv[8], "%d", &dotime);
+#endif
+#ifndef GEN
+    if (argc<4)
+    {
+        printf("usage:\n");
+        printf("    fft [input file] [sequence length] [radix]\n");
+        printf("        output: DFT\n");
+        exit(1);
+    }
+    else if ((infile=fopen(argv[1], "r"))==NULL)
+    {
+        printf("Error reading input sequence file: %s\n", argv[1]);
+        exit(1);
+    }
+    
+    sscanf(argv[2], "%d", &N);
+    sscanf(argv[3], "%d", &radix);
+    dotime=0;
+#endif
+
+
+    /** Set up power of two arrays */
+    pow_2[0]=1;
+    for (i=1; i<MAXPOW; i++)
+        pow_2[i]=pow_2[i-1]*2;
+    pow_4[0]=1;
+    for (i=1; i<MAXPOW; i++)
+        pow_4[i]=pow_4[i-1]*4;
+    
+    if ((data=malloc(sizeof(struct complex)*(size_t)N))==NULL)
+    {
+        fprintf(stderr, "Out of memory!\n");
+        exit(1);
+    }
+    
+    /** Generate cosine **/
+#ifdef GEN
+    for (i=0; i<N; i++)
+    {
+        data[i].r=0.0;
+        data[i].i=0.0;
+    }
+    for (i=0; i<numsamp; i++)
+        data[i].r=A*cos(2.0*PI*freq*i/fs - phase*PI/180);
+#endif
+#ifndef GEN
+    for (i=0; i<N; i++)
+    {
+        fscanf(infile, "%lf", &data[i].r);
+        data[i].i=0.0;
+    }
+#endif    
+
+    gettimeofday(&start, (struct timezone *) 0);
+    if (radix==2) radix2(data, N);
+    if (radix==4) radix4(data, N);
+    gettimeofday(&end, (struct timezone *) 0);
+    totaltime=(end.tv_sec*1000000 + end.tv_usec)-(start.tv_sec*1000000
+                                                  + start.tv_usec);
+    if (radix==2) bit_reverse_reorder(data, N);
+    if (radix==4) bit_r4_reorder(data, N);
+
+    if (!dotime)
+        for (i=0; i<N; i++)
+            printf("%f\n", sqrt(data[i].r*data[i].r +
+                                data[i].i*data[i].i));
+    else
+        printf("%ld us\n\n", totaltime);
+
+#ifndef GEN
+    fclose(infile);
+#endif
+}
+
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fftw.h b/lib-src/libnyquist/nyquist/nyqsrc/fftw.h
new file mode 100644
index 0000000..ca11c95
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fftw.h
@@ -0,0 +1,412 @@
+/* -*- C -*- */
+/*
+ * Copyright (c) 1997-1999 Massachusetts Institute of Technology
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+/* fftw.h -- system-wide definitions */
+/* $Id: fftw.h,v 1.2 2009/03/05 16:34:00 llucius Exp $ */
+
+#ifndef FFTW_H
+#define FFTW_H
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif				/* __cplusplus */
+
+/* Define for using single precision */
+/*
+ * If you can, use configure --enable-float instead of changing this
+ * flag directly 
+ */
+/* #undef FFTW_ENABLE_FLOAT */
+
+/* our real numbers */
+#ifdef FFTW_ENABLE_FLOAT
+typedef float fftw_real;
+#else
+typedef double fftw_real;
+#endif
+
+/*********************************************
+ * Complex numbers and operations 
+ *********************************************/
+typedef struct {
+     fftw_real re, im;
+} fftw_complex;
+
+#define c_re(c)  ((c).re)
+#define c_im(c)  ((c).im)
+
+typedef enum {
+     FFTW_FORWARD = -1, FFTW_BACKWARD = 1
+} fftw_direction;
+
+/* backward compatibility with FFTW-1.3 */
+typedef fftw_complex FFTW_COMPLEX;
+typedef fftw_real FFTW_REAL;
+
+#ifndef FFTW_1_0_COMPATIBILITY
+#define FFTW_1_0_COMPATIBILITY 0
+#endif
+
+#if FFTW_1_0_COMPATIBILITY
+/* backward compatibility with FFTW-1.0 */
+#define REAL fftw_real
+#define COMPLEX fftw_complex
+#endif
+
+/*********************************************
+ * Success or failure status
+ *********************************************/
+
+typedef enum {
+     FFTW_SUCCESS = 0, FFTW_FAILURE = -1
+} fftw_status;
+
+/*********************************************
+ *              Codelets
+ *********************************************/
+typedef void (fftw_notw_codelet) 
+     (const fftw_complex *, fftw_complex *, int, int);
+typedef void (fftw_twiddle_codelet)
+     (fftw_complex *, const fftw_complex *, int,
+      int, int);
+typedef void (fftw_generic_codelet) 
+     (fftw_complex *, const fftw_complex *, int,
+      int, int, int);
+typedef void (fftw_real2hc_codelet)
+     (const fftw_real *, fftw_real *, fftw_real *,
+      int, int, int);
+typedef void (fftw_hc2real_codelet)
+     (const fftw_real *, const fftw_real *,
+      fftw_real *, int, int, int);
+typedef void (fftw_hc2hc_codelet)
+     (fftw_real *, const fftw_complex *,
+      int, int, int);
+typedef void (fftw_rgeneric_codelet)
+     (fftw_real *, const fftw_complex *, int,
+      int, int, int);
+
+/*********************************************
+ *     Configurations
+ *********************************************/
+/*
+ * A configuration is a database of all known codelets
+ */
+
+enum fftw_node_type {
+     FFTW_NOTW, FFTW_TWIDDLE, FFTW_GENERIC, FFTW_RADER,
+     FFTW_REAL2HC, FFTW_HC2REAL, FFTW_HC2HC, FFTW_RGENERIC
+};
+
+/* description of a codelet */
+typedef struct {
+     const char *name;		/* name of the codelet */
+     void (*codelet) ();	/* pointer to the codelet itself */
+     int size;			/* size of the codelet */
+     fftw_direction dir;	/* direction */
+     enum fftw_node_type type;	/* TWIDDLE or NO_TWIDDLE */
+     int signature;		/* unique id */
+     int ntwiddle;		/* number of twiddle factors */
+     const int *twiddle_order;	/* 
+                                 * array that determines the order 
+                                 * in which the codelet expects
+                                 * the twiddle factors
+                                 */
+} fftw_codelet_desc;
+
+/* On Win32, you need to do funny things to access global variables
+   in shared libraries.  Thanks to Andrew Sterian for this hack. */
+#if defined(__WIN32__) || defined(WIN32) || defined(_WINDOWS)
+#  if defined(BUILD_FFTW_DLL)
+#    define DL_IMPORT(type) __declspec(dllexport) type
+#  elif defined(USE_FFTW_DLL)
+#    define DL_IMPORT(type) __declspec(dllimport) type
+#  else
+#    define DL_IMPORT(type) type
+#  endif
+#else
+#  define DL_IMPORT(type) type
+#endif
+
+extern DL_IMPORT(const char *) fftw_version;
+
+/*****************************
+ *        Plans
+ *****************************/
+/*
+ * A plan is a sequence of reductions to compute a FFT of
+ * a given size.  At each step, the FFT algorithm can:
+ *
+ * 1) apply a notw codelet, or
+ * 2) recurse and apply a twiddle codelet, or
+ * 3) apply the generic codelet.
+ */
+
+/* structure that contains twiddle factors */
+typedef struct fftw_twiddle_struct {
+     int n;
+     const fftw_codelet_desc *cdesc;
+     fftw_complex *twarray;
+     struct fftw_twiddle_struct *next;
+     int refcnt;
+} fftw_twiddle;
+
+typedef struct fftw_rader_data_struct {
+     struct fftw_plan_struct *plan;
+     fftw_complex *omega;
+     int g, ginv;
+     int p, flags, refcount;
+     struct fftw_rader_data_struct *next;
+     fftw_codelet_desc *cdesc;
+} fftw_rader_data;
+
+typedef void (fftw_rader_codelet) 
+     (fftw_complex *, const fftw_complex *, int,
+      int, int, fftw_rader_data *);
+
+/* structure that holds all the data needed for a given step */
+typedef struct fftw_plan_node_struct {
+     enum fftw_node_type type;
+
+     union {
+          /* nodes of type FFTW_NOTW */
+          struct {
+               int size;
+               fftw_notw_codelet *codelet;
+               const fftw_codelet_desc *codelet_desc;
+          } notw;
+
+          /* nodes of type FFTW_TWIDDLE */
+          struct {
+               int size;
+               fftw_twiddle_codelet *codelet;
+               fftw_twiddle *tw;
+               struct fftw_plan_node_struct *recurse;
+               const fftw_codelet_desc *codelet_desc;
+          } twiddle;
+
+          /* nodes of type FFTW_GENERIC */
+          struct {
+               int size;
+               fftw_generic_codelet *codelet;
+               fftw_twiddle *tw;
+               struct fftw_plan_node_struct *recurse;
+          } generic;
+
+          /* nodes of type FFTW_RADER */
+          struct {
+               int size;
+               fftw_rader_codelet *codelet;
+               fftw_rader_data *rader_data;
+               fftw_twiddle *tw;
+               struct fftw_plan_node_struct *recurse;
+          } rader;
+
+          /* nodes of type FFTW_REAL2HC */
+          struct {
+               int size;
+               fftw_real2hc_codelet *codelet;
+               const fftw_codelet_desc *codelet_desc;
+          } real2hc;
+
+          /* nodes of type FFTW_HC2REAL */
+          struct {
+               int size;
+               fftw_hc2real_codelet *codelet;
+               const fftw_codelet_desc *codelet_desc;
+          } hc2real;
+
+          /* nodes of type FFTW_HC2HC */
+          struct {
+               int size;
+               fftw_direction dir;
+               fftw_hc2hc_codelet *codelet;
+               fftw_twiddle *tw;
+               struct fftw_plan_node_struct *recurse;
+               const fftw_codelet_desc *codelet_desc;
+          } hc2hc;
+
+          /* nodes of type FFTW_RGENERIC */
+          struct {
+               int size;
+               fftw_direction dir;
+               fftw_rgeneric_codelet *codelet;
+               fftw_twiddle *tw;
+               struct fftw_plan_node_struct *recurse;
+          } rgeneric;
+     } nodeu;
+
+     int refcnt;
+} fftw_plan_node;
+
+struct fftw_plan_struct {
+     int n;
+     int refcnt;
+     fftw_direction dir;
+     int flags;
+     int wisdom_signature;
+     enum fftw_node_type wisdom_type;
+     struct fftw_plan_struct *next;
+     fftw_plan_node *root;
+     double cost;
+};
+
+/* a plan is just an array of instructions */
+typedef struct fftw_plan_struct *fftw_plan;
+
+/* flags for the planner */
+#define  FFTW_ESTIMATE (0)
+#define  FFTW_MEASURE  (1)
+
+#define FFTW_OUT_OF_PLACE (0)
+#define FFTW_IN_PLACE (8)
+#define FFTW_USE_WISDOM (16)
+
+#define FFTW_THREADSAFE (128)  /* guarantee plan is read-only so that the
+                                  same plan can be used in parallel by
+                                  multiple threads */
+
+#define FFTWND_FORCE_BUFFERED (256)	/* internal, undocumented flag */
+
+extern fftw_plan fftw_create_plan_specific(int n, fftw_direction dir,
+                                           int flags,
+                                           fftw_complex *in, int istride,
+                                         fftw_complex *out, int ostride);
+#define FFTW_HAS_PLAN_SPECIFIC
+extern fftw_plan fftw_create_plan(int n, fftw_direction dir, int flags);
+extern void fftw_print_plan(fftw_plan plan);
+extern void fftw_destroy_plan(fftw_plan plan);
+extern void fftw(fftw_plan plan, int howmany, fftw_complex *in, int istride,
+                 int idist, fftw_complex *out, int ostride, int odist);
+extern void fftw_one(fftw_plan plan, fftw_complex *in, fftw_complex *out);
+extern void fftw_die(const char *s);
+extern void *fftw_malloc(size_t n);
+extern void fftw_free(void *p);
+extern void fftw_check_memory_leaks(void);
+extern void fftw_print_max_memory_usage(void);
+
+typedef void *(*fftw_malloc_type_function) (size_t n);
+typedef void  (*fftw_free_type_function) (void *p);
+typedef void  (*fftw_die_type_function) (const char *errString);
+extern DL_IMPORT(fftw_malloc_type_function) fftw_malloc_hook;
+extern DL_IMPORT(fftw_free_type_function) fftw_free_hook;
+extern DL_IMPORT(fftw_die_type_function) fftw_die_hook;
+
+extern size_t fftw_sizeof_fftw_real(void);
+
+/* Wisdom: */
+/*
+ * define this symbol so that users know we are using a version of FFTW
+ * with wisdom
+ */
+#define FFTW_HAS_WISDOM
+extern void fftw_forget_wisdom(void);
+extern void fftw_export_wisdom(void (*emitter) (char c, void *), void *data);
+extern fftw_status fftw_import_wisdom(int (*g) (void *), void *data);
+extern void fftw_export_wisdom_to_file(FILE *output_file);
+extern fftw_status fftw_import_wisdom_from_file(FILE *input_file);
+extern char *fftw_export_wisdom_to_string(void);
+extern fftw_status fftw_import_wisdom_from_string(const char *input_string);
+
+/*
+ * define symbol so we know this function is available (it is not in
+ * older FFTWs)
+ */
+#define FFTW_HAS_FPRINT_PLAN
+extern void fftw_fprint_plan(FILE *f, fftw_plan plan);
+
+/*****************************
+ *    N-dimensional code
+ *****************************/
+typedef struct {
+     int is_in_place;		/* 1 if for in-place FFTs, 0 otherwise */
+
+     int rank;			/* 
+                                 * the rank (number of dimensions) of the
+                                 * array to be FFTed 
+                                 */
+     int *n;			/*
+                                 * the dimensions of the array to the
+                                 * FFTed 
+                                 */
+     fftw_direction dir;
+
+     int *n_before;		/*
+                                 * n_before[i] = product of n[j] for j < i 
+                                 */
+     int *n_after;		/* n_after[i] = product of n[j] for j > i */
+
+     fftw_plan *plans;		/* 1d fftw plans for each dimension */
+
+     int nbuffers, nwork;
+     fftw_complex *work;	/* 
+                                 * work array big enough to hold
+                                 * nbuffers+1 of the largest dimension 
+                                 * (has nwork elements)
+                                 */
+} fftwnd_data;
+
+typedef fftwnd_data *fftwnd_plan;
+
+/* Initializing the FFTWND plan: */
+extern fftwnd_plan fftw2d_create_plan(int nx, int ny, fftw_direction dir,
+                                      int flags);
+extern fftwnd_plan fftw3d_create_plan(int nx, int ny, int nz,
+                                      fftw_direction dir, int flags);
+extern fftwnd_plan fftwnd_create_plan(int rank, const int *n,
+                                      fftw_direction dir,
+                                      int flags);
+
+extern fftwnd_plan fftw2d_create_plan_specific(int nx, int ny,
+                                               fftw_direction dir,
+                                               int flags,
+                                           fftw_complex *in, int istride,
+                                         fftw_complex *out, int ostride);
+extern fftwnd_plan fftw3d_create_plan_specific(int nx, int ny, int nz,
+                                           fftw_direction dir, int flags,
+                                           fftw_complex *in, int istride,
+                                         fftw_complex *out, int ostride);
+extern fftwnd_plan fftwnd_create_plan_specific(int rank, const int *n,
+                                               fftw_direction dir,
+                                               int flags,
+                                           fftw_complex *in, int istride,
+                                         fftw_complex *out, int ostride);
+
+/* Freeing the FFTWND plan: */
+extern void fftwnd_destroy_plan(fftwnd_plan plan);
+
+/* Printing the plan: */
+extern void fftwnd_fprint_plan(FILE *f, fftwnd_plan p);
+extern void fftwnd_print_plan(fftwnd_plan p);
+#define FFTWND_HAS_PRINT_PLAN
+
+/* Computing the N-Dimensional FFT */
+extern void fftwnd(fftwnd_plan plan, int howmany,
+                   fftw_complex *in, int istride, int idist,
+                   fftw_complex *out, int ostride, int odist);
+extern void fftwnd_one(fftwnd_plan p, fftw_complex *in, fftw_complex *out);
+
+#ifdef __cplusplus
+}                               /* extern "C" */
+
+#endif				/* __cplusplus */
+#endif				/* FFTW_H */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fresample.h b/lib-src/libnyquist/nyquist/nyqsrc/fresample.h
new file mode 100644
index 0000000..be1a199
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fresample.h
@@ -0,0 +1,75 @@
+/*
+ * FILE: fresample.h
+ *
+ * The configuration constants below govern
+ * the number of bits in the input sample and filter coefficients, the 
+ * number of bits to the right of the binary-point for fixed-point math, etc.
+ *
+ */
+
+/* #include "stdefs.h" */
+
+typedef double SAMPLE_TYPE;
+#define SCALE_FACTOR_TO_SHORT 32767
+
+/* Conversion constants */
+#define Nhc       8
+/* #define Na        7 */
+/* #define Np       (Nhc+Na)*/
+#define Npc      (1<<Nhc)
+/* #define Amask    ((1<<Na)-1) */
+/* #define Pmask    ((1<<Np)-1) */
+/* #define Nh       16 */
+/* #define Nb       16 */
+/* #define Nhxn     14 */
+/* #define Nhg      (Nh-Nhxn) */
+/* #define NLpScl   13 */
+
+/* Description of constants:
+ *
+ * Npc - is the number of look-up values available for the lowpass filter
+ *    between the beginning of its impulse response and the "cutoff time"
+ *    of the filter.  The cutoff time is defined as the reciprocal of the
+ *    lowpass-filter cut off frequence in Hz.  For example, if the
+ *    lowpass filter were a sinc function, Npc would be the index of the
+ *    impulse-response lookup-table corresponding to the first zero-
+ *    crossing of the sinc function.  (The inverse first zero-crossing
+ *    time of a sinc function equals its nominal cutoff frequency in Hz.)
+ *    Npc must be a power of 2 due to the details of the current
+ *    implementation. The default value of 512 is sufficiently high that
+ *    using linear interpolation to fill in between the table entries
+ *    gives approximately 16-bit accuracy in filter coefficients.
+ *
+ * Nhc - is log base 2 of Npc.
+ *
+ * Na - is the number of bits devoted to linear interpolation of the
+ *    filter coefficients.
+ *
+ * Np - is Na + Nhc, the number of bits to the right of the binary point
+ *    in the integer "time" variable. To the left of the point, it indexes
+ *    the input array (X), and to the right, it is interpreted as a number
+ *    between 0 and 1 sample of the input X.  Np must be less than 16 in
+ *    this implementation.
+ *
+ * Nh - is the number of bits in the filter coefficients. The sum of Nh and
+ *    the number of bits in the input data (typically 16) cannot exceed 32.
+ *    Thus Nh should be 16.  The largest filter coefficient should nearly
+ *    fill 16 bits (32767).
+ *
+ * Nb - is the number of bits in the input data. The sum of Nb and Nh cannot
+ *    exceed 32.
+ *
+ * Nhxn - is the number of bits to right shift after multiplying each input
+ *    sample times a filter coefficient. It can be as great as Nh and as
+ *    small as 0. Nhxn = Nh-2 gives 2 guard bits in the multiply-add
+ *    accumulation.  If Nhxn=0, the accumulation will soon overflow 32 bits.
+ *
+ * Nhg - is the number of guard bits in mpy-add accumulation (equal to Nh-Nhxn)
+ *
+ * NLpScl - is the number of bits allocated to the unity-gain normalization
+ *    factor.  The output of the lowpass filter is multiplied by LpScl and
+ *    then right-shifted NLpScl bits. To avoid overflow, we must have 
+ *    Nb+Nhg+NLpScl < 32.
+ */
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fsmallfilter.h b/lib-src/libnyquist/nyquist/nyqsrc/fsmallfilter.h
new file mode 100644
index 0000000..8cd6e12
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/fsmallfilter.h
@@ -0,0 +1,3079 @@
+/* Included by resamplesubs.c */
+#define SMALL_FILTER_NMULT 13
+#define SMALL_FILTER_SCALE 13128 /* Unity-gain scale factor */
+#define SMALL_FILTER_NWING 1536 /* Filter table length */
+static float SMALL_FILTER_IMP[] /* Impulse response */ = {
+32767.0F,
+32766.0F,
+32765.0F,
+32762.0F,
+32758.0F,
+32753.0F,
+32747.0F,
+32739.0F,
+32731.0F,
+32722.0F,
+32711.0F,
+32699.0F,
+32686.0F,
+32672.0F,
+32657.0F,
+32641.0F,
+32623.0F,
+32605.0F,
+32585.0F,
+32565.0F,
+32543.0F,
+32520.0F,
+32496.0F,
+32471.0F,
+32445.0F,
+32417.0F,
+32389.0F,
+32359.0F,
+32329.0F,
+32297.0F,
+32264.0F,
+32230.0F,
+32195.0F,
+32159.0F,
+32122.0F,
+32084.0F,
+32044.0F,
+32004.0F,
+31962.0F,
+31920.0F,
+31876.0F,
+31832.0F,
+31786.0F,
+31739.0F,
+31691.0F,
+31642.0F,
+31592.0F,
+31541.0F,
+31489.0F,
+31436.0F,
+31382.0F,
+31327.0F,
+31271.0F,
+31214.0F,
+31156.0F,
+31096.0F,
+31036.0F,
+30975.0F,
+30913.0F,
+30849.0F,
+30785.0F,
+30720.0F,
+30654.0F,
+30586.0F,
+30518.0F,
+30449.0F,
+30379.0F,
+30308.0F,
+30236.0F,
+30163.0F,
+30089.0F,
+30014.0F,
+29938.0F,
+29861.0F,
+29784.0F,
+29705.0F,
+29625.0F,
+29545.0F,
+29464.0F,
+29381.0F,
+29298.0F,
+29214.0F,
+29129.0F,
+29043.0F,
+28956.0F,
+28869.0F,
+28780.0F,
+28691.0F,
+28601.0F,
+28510.0F,
+28418.0F,
+28325.0F,
+28232.0F,
+28137.0F,
+28042.0F,
+27946.0F,
+27849.0F,
+27752.0F,
+27653.0F,
+27554.0F,
+27454.0F,
+27353.0F,
+27252.0F,
+27149.0F,
+27046.0F,
+26943.0F,
+26838.0F,
+26733.0F,
+26627.0F,
+26520.0F,
+26413.0F,
+26305.0F,
+26196.0F,
+26086.0F,
+25976.0F,
+25865.0F,
+25753.0F,
+25641.0F,
+25528.0F,
+25415.0F,
+25301.0F,
+25186.0F,
+25070.0F,
+24954.0F,
+24838.0F,
+24720.0F,
+24602.0F,
+24484.0F,
+24365.0F,
+24245.0F,
+24125.0F,
+24004.0F,
+23883.0F,
+23761.0F,
+23639.0F,
+23516.0F,
+23392.0F,
+23268.0F,
+23144.0F,
+23019.0F,
+22893.0F,
+22767.0F,
+22641.0F,
+22514.0F,
+22386.0F,
+22259.0F,
+22130.0F,
+22001.0F,
+21872.0F,
+21743.0F,
+21613.0F,
+21482.0F,
+21352.0F,
+21220.0F,
+21089.0F,
+20957.0F,
+20825.0F,
+20692.0F,
+20559.0F,
+20426.0F,
+20292.0F,
+20158.0F,
+20024.0F,
+19889.0F,
+19754.0F,
+19619.0F,
+19483.0F,
+19347.0F,
+19211.0F,
+19075.0F,
+18939.0F,
+18802.0F,
+18665.0F,
+18527.0F,
+18390.0F,
+18252.0F,
+18114.0F,
+17976.0F,
+17838.0F,
+17700.0F,
+17561.0F,
+17422.0F,
+17283.0F,
+17144.0F,
+17005.0F,
+16866.0F,
+16726.0F,
+16587.0F,
+16447.0F,
+16307.0F,
+16167.0F,
+16027.0F,
+15887.0F,
+15747.0F,
+15607.0F,
+15467.0F,
+15327.0F,
+15187.0F,
+15046.0F,
+14906.0F,
+14766.0F,
+14625.0F,
+14485.0F,
+14345.0F,
+14205.0F,
+14065.0F,
+13924.0F,
+13784.0F,
+13644.0F,
+13504.0F,
+13364.0F,
+13225.0F,
+13085.0F,
+12945.0F,
+12806.0F,
+12666.0F,
+12527.0F,
+12388.0F,
+12249.0F,
+12110.0F,
+11971.0F,
+11833.0F,
+11694.0F,
+11556.0F,
+11418.0F,
+11280.0F,
+11142.0F,
+11005.0F,
+10867.0F,
+10730.0F,
+10594.0F,
+10457.0F,
+10321.0F,
+10185.0F,
+10049.0F,
+9913.0F,
+9778.0F,
+9643.0F,
+9508.0F,
+9374.0F,
+9239.0F,
+9105.0F,
+8972.0F,
+8839.0F,
+8706.0F,
+8573.0F,
+8441.0F,
+8309.0F,
+8177.0F,
+8046.0F,
+7915.0F,
+7785.0F,
+7655.0F,
+7525.0F,
+7396.0F,
+7267.0F,
+7138.0F,
+7010.0F,
+6882.0F,
+6755.0F,
+6628.0F,
+6502.0F,
+6376.0F,
+6250.0F,
+6125.0F,
+6001.0F,
+5876.0F,
+5753.0F,
+5630.0F,
+5507.0F,
+5385.0F,
+5263.0F,
+5141.0F,
+5021.0F,
+4900.0F,
+4781.0F,
+4661.0F,
+4543.0F,
+4425.0F,
+4307.0F,
+4190.0F,
+4073.0F,
+3957.0F,
+3842.0F,
+3727.0F,
+3613.0F,
+3499.0F,
+3386.0F,
+3273.0F,
+3161.0F,
+3050.0F,
+2939.0F,
+2828.0F,
+2719.0F,
+2610.0F,
+2501.0F,
+2394.0F,
+2286.0F,
+2180.0F,
+2074.0F,
+1968.0F,
+1864.0F,
+1760.0F,
+1656.0F,
+1554.0F,
+1451.0F,
+1350.0F,
+1249.0F,
+1149.0F,
+1050.0F,
+951.0F,
+853.0F,
+755.0F,
+658.0F,
+562.0F,
+467.0F,
+372.0F,
+278.0F,
+185.0F,
+92.0F,
+0.0F,
+-90.0F,
+-181.0F,
+-271.0F,
+-360.0F,
+-448.0F,
+-536.0F,
+-623.0F,
+-709.0F,
+-795.0F,
+-880.0F,
+-964.0F,
+-1047.0F,
+-1130.0F,
+-1212.0F,
+-1293.0F,
+-1373.0F,
+-1453.0F,
+-1532.0F,
+-1610.0F,
+-1688.0F,
+-1764.0F,
+-1840.0F,
+-1916.0F,
+-1990.0F,
+-2064.0F,
+-2137.0F,
+-2209.0F,
+-2281.0F,
+-2351.0F,
+-2421.0F,
+-2491.0F,
+-2559.0F,
+-2627.0F,
+-2694.0F,
+-2760.0F,
+-2825.0F,
+-2890.0F,
+-2954.0F,
+-3017.0F,
+-3080.0F,
+-3141.0F,
+-3202.0F,
+-3262.0F,
+-3322.0F,
+-3380.0F,
+-3438.0F,
+-3495.0F,
+-3551.0F,
+-3607.0F,
+-3662.0F,
+-3716.0F,
+-3769.0F,
+-3821.0F,
+-3873.0F,
+-3924.0F,
+-3974.0F,
+-4024.0F,
+-4072.0F,
+-4120.0F,
+-4167.0F,
+-4214.0F,
+-4259.0F,
+-4304.0F,
+-4348.0F,
+-4392.0F,
+-4434.0F,
+-4476.0F,
+-4517.0F,
+-4558.0F,
+-4597.0F,
+-4636.0F,
+-4674.0F,
+-4712.0F,
+-4748.0F,
+-4784.0F,
+-4819.0F,
+-4854.0F,
+-4887.0F,
+-4920.0F,
+-4953.0F,
+-4984.0F,
+-5015.0F,
+-5045.0F,
+-5074.0F,
+-5103.0F,
+-5131.0F,
+-5158.0F,
+-5184.0F,
+-5210.0F,
+-5235.0F,
+-5259.0F,
+-5283.0F,
+-5306.0F,
+-5328.0F,
+-5349.0F,
+-5370.0F,
+-5390.0F,
+-5409.0F,
+-5428.0F,
+-5446.0F,
+-5463.0F,
+-5480.0F,
+-5496.0F,
+-5511.0F,
+-5526.0F,
+-5540.0F,
+-5553.0F,
+-5566.0F,
+-5578.0F,
+-5589.0F,
+-5600.0F,
+-5610.0F,
+-5619.0F,
+-5628.0F,
+-5636.0F,
+-5643.0F,
+-5650.0F,
+-5656.0F,
+-5662.0F,
+-5667.0F,
+-5671.0F,
+-5674.0F,
+-5678.0F,
+-5680.0F,
+-5682.0F,
+-5683.0F,
+-5684.0F,
+-5684.0F,
+-5683.0F,
+-5682.0F,
+-5680.0F,
+-5678.0F,
+-5675.0F,
+-5672.0F,
+-5668.0F,
+-5663.0F,
+-5658.0F,
+-5652.0F,
+-5646.0F,
+-5639.0F,
+-5632.0F,
+-5624.0F,
+-5616.0F,
+-5607.0F,
+-5597.0F,
+-5587.0F,
+-5577.0F,
+-5566.0F,
+-5554.0F,
+-5542.0F,
+-5529.0F,
+-5516.0F,
+-5503.0F,
+-5489.0F,
+-5474.0F,
+-5459.0F,
+-5444.0F,
+-5428.0F,
+-5412.0F,
+-5395.0F,
+-5378.0F,
+-5360.0F,
+-5342.0F,
+-5323.0F,
+-5304.0F,
+-5284.0F,
+-5264.0F,
+-5244.0F,
+-5223.0F,
+-5202.0F,
+-5180.0F,
+-5158.0F,
+-5136.0F,
+-5113.0F,
+-5090.0F,
+-5066.0F,
+-5042.0F,
+-5018.0F,
+-4993.0F,
+-4968.0F,
+-4943.0F,
+-4917.0F,
+-4891.0F,
+-4864.0F,
+-4838.0F,
+-4810.0F,
+-4783.0F,
+-4755.0F,
+-4727.0F,
+-4698.0F,
+-4670.0F,
+-4640.0F,
+-4611.0F,
+-4581.0F,
+-4551.0F,
+-4521.0F,
+-4490.0F,
+-4460.0F,
+-4428.0F,
+-4397.0F,
+-4365.0F,
+-4333.0F,
+-4301.0F,
+-4269.0F,
+-4236.0F,
+-4203.0F,
+-4170.0F,
+-4137.0F,
+-4103.0F,
+-4069.0F,
+-4035.0F,
+-4001.0F,
+-3966.0F,
+-3932.0F,
+-3897.0F,
+-3862.0F,
+-3827.0F,
+-3791.0F,
+-3755.0F,
+-3720.0F,
+-3684.0F,
+-3648.0F,
+-3611.0F,
+-3575.0F,
+-3538.0F,
+-3502.0F,
+-3465.0F,
+-3428.0F,
+-3390.0F,
+-3353.0F,
+-3316.0F,
+-3278.0F,
+-3241.0F,
+-3203.0F,
+-3165.0F,
+-3127.0F,
+-3089.0F,
+-3051.0F,
+-3013.0F,
+-2974.0F,
+-2936.0F,
+-2898.0F,
+-2859.0F,
+-2820.0F,
+-2782.0F,
+-2743.0F,
+-2704.0F,
+-2666.0F,
+-2627.0F,
+-2588.0F,
+-2549.0F,
+-2510.0F,
+-2471.0F,
+-2432.0F,
+-2393.0F,
+-2354.0F,
+-2315.0F,
+-2276.0F,
+-2237.0F,
+-2198.0F,
+-2159.0F,
+-2120.0F,
+-2081.0F,
+-2042.0F,
+-2003.0F,
+-1964.0F,
+-1925.0F,
+-1886.0F,
+-1847.0F,
+-1808.0F,
+-1770.0F,
+-1731.0F,
+-1692.0F,
+-1654.0F,
+-1615.0F,
+-1577.0F,
+-1538.0F,
+-1500.0F,
+-1462.0F,
+-1424.0F,
+-1386.0F,
+-1348.0F,
+-1310.0F,
+-1272.0F,
+-1234.0F,
+-1197.0F,
+-1159.0F,
+-1122.0F,
+-1084.0F,
+-1047.0F,
+-1010.0F,
+-973.0F,
+-936.0F,
+-900.0F,
+-863.0F,
+-827.0F,
+-790.0F,
+-754.0F,
+-718.0F,
+-682.0F,
+-646.0F,
+-611.0F,
+-575.0F,
+-540.0F,
+-505.0F,
+-470.0F,
+-435.0F,
+-401.0F,
+-366.0F,
+-332.0F,
+-298.0F,
+-264.0F,
+-230.0F,
+-197.0F,
+-163.0F,
+-130.0F,
+-97.0F,
+-64.0F,
+-31.0F,
+0.0F,
+32.0F,
+64.0F,
+96.0F,
+128.0F,
+159.0F,
+190.0F,
+221.0F,
+252.0F,
+283.0F,
+313.0F,
+343.0F,
+373.0F,
+403.0F,
+432.0F,
+462.0F,
+491.0F,
+519.0F,
+548.0F,
+576.0F,
+604.0F,
+632.0F,
+660.0F,
+687.0F,
+714.0F,
+741.0F,
+768.0F,
+794.0F,
+821.0F,
+847.0F,
+872.0F,
+898.0F,
+923.0F,
+948.0F,
+972.0F,
+997.0F,
+1021.0F,
+1045.0F,
+1068.0F,
+1092.0F,
+1115.0F,
+1138.0F,
+1160.0F,
+1183.0F,
+1205.0F,
+1227.0F,
+1248.0F,
+1270.0F,
+1291.0F,
+1311.0F,
+1332.0F,
+1352.0F,
+1372.0F,
+1392.0F,
+1411.0F,
+1430.0F,
+1449.0F,
+1468.0F,
+1486.0F,
+1504.0F,
+1522.0F,
+1539.0F,
+1556.0F,
+1573.0F,
+1590.0F,
+1607.0F,
+1623.0F,
+1639.0F,
+1654.0F,
+1669.0F,
+1685.0F,
+1699.0F,
+1714.0F,
+1728.0F,
+1742.0F,
+1756.0F,
+1769.0F,
+1782.0F,
+1795.0F,
+1808.0F,
+1820.0F,
+1832.0F,
+1844.0F,
+1855.0F,
+1867.0F,
+1878.0F,
+1888.0F,
+1899.0F,
+1909.0F,
+1919.0F,
+1929.0F,
+1938.0F,
+1947.0F,
+1956.0F,
+1964.0F,
+1973.0F,
+1981.0F,
+1989.0F,
+1996.0F,
+2003.0F,
+2010.0F,
+2017.0F,
+2024.0F,
+2030.0F,
+2036.0F,
+2042.0F,
+2047.0F,
+2052.0F,
+2057.0F,
+2062.0F,
+2066.0F,
+2071.0F,
+2074.0F,
+2078.0F,
+2082.0F,
+2085.0F,
+2088.0F,
+2091.0F,
+2093.0F,
+2095.0F,
+2097.0F,
+2099.0F,
+2101.0F,
+2102.0F,
+2103.0F,
+2104.0F,
+2104.0F,
+2105.0F,
+2105.0F,
+2105.0F,
+2104.0F,
+2104.0F,
+2103.0F,
+2102.0F,
+2101.0F,
+2100.0F,
+2098.0F,
+2096.0F,
+2094.0F,
+2092.0F,
+2089.0F,
+2087.0F,
+2084.0F,
+2081.0F,
+2077.0F,
+2074.0F,
+2070.0F,
+2066.0F,
+2062.0F,
+2058.0F,
+2053.0F,
+2048.0F,
+2043.0F,
+2038.0F,
+2033.0F,
+2028.0F,
+2022.0F,
+2016.0F,
+2010.0F,
+2004.0F,
+1998.0F,
+1991.0F,
+1984.0F,
+1978.0F,
+1970.0F,
+1963.0F,
+1956.0F,
+1948.0F,
+1941.0F,
+1933.0F,
+1925.0F,
+1917.0F,
+1908.0F,
+1900.0F,
+1891.0F,
+1882.0F,
+1873.0F,
+1864.0F,
+1855.0F,
+1846.0F,
+1836.0F,
+1826.0F,
+1817.0F,
+1807.0F,
+1797.0F,
+1787.0F,
+1776.0F,
+1766.0F,
+1755.0F,
+1745.0F,
+1734.0F,
+1723.0F,
+1712.0F,
+1701.0F,
+1689.0F,
+1678.0F,
+1667.0F,
+1655.0F,
+1643.0F,
+1632.0F,
+1620.0F,
+1608.0F,
+1596.0F,
+1583.0F,
+1571.0F,
+1559.0F,
+1546.0F,
+1534.0F,
+1521.0F,
+1509.0F,
+1496.0F,
+1483.0F,
+1470.0F,
+1457.0F,
+1444.0F,
+1431.0F,
+1417.0F,
+1404.0F,
+1391.0F,
+1377.0F,
+1364.0F,
+1350.0F,
+1337.0F,
+1323.0F,
+1309.0F,
+1296.0F,
+1282.0F,
+1268.0F,
+1254.0F,
+1240.0F,
+1226.0F,
+1212.0F,
+1198.0F,
+1184.0F,
+1170.0F,
+1156.0F,
+1141.0F,
+1127.0F,
+1113.0F,
+1099.0F,
+1084.0F,
+1070.0F,
+1056.0F,
+1041.0F,
+1027.0F,
+1013.0F,
+998.0F,
+984.0F,
+969.0F,
+955.0F,
+940.0F,
+926.0F,
+911.0F,
+897.0F,
+882.0F,
+868.0F,
+854.0F,
+839.0F,
+825.0F,
+810.0F,
+796.0F,
+781.0F,
+767.0F,
+753.0F,
+738.0F,
+724.0F,
+709.0F,
+695.0F,
+681.0F,
+667.0F,
+652.0F,
+638.0F,
+624.0F,
+610.0F,
+596.0F,
+581.0F,
+567.0F,
+553.0F,
+539.0F,
+525.0F,
+511.0F,
+498.0F,
+484.0F,
+470.0F,
+456.0F,
+442.0F,
+429.0F,
+415.0F,
+402.0F,
+388.0F,
+375.0F,
+361.0F,
+348.0F,
+335.0F,
+321.0F,
+308.0F,
+295.0F,
+282.0F,
+269.0F,
+256.0F,
+243.0F,
+230.0F,
+217.0F,
+205.0F,
+192.0F,
+180.0F,
+167.0F,
+155.0F,
+142.0F,
+130.0F,
+118.0F,
+106.0F,
+94.0F,
+82.0F,
+70.0F,
+58.0F,
+46.0F,
+35.0F,
+23.0F,
+11.0F,
+0.0F,
+-10.0F,
+-22.0F,
+-33.0F,
+-44.0F,
+-55.0F,
+-66.0F,
+-77.0F,
+-87.0F,
+-98.0F,
+-109.0F,
+-119.0F,
+-130.0F,
+-140.0F,
+-150.0F,
+-160.0F,
+-170.0F,
+-180.0F,
+-190.0F,
+-200.0F,
+-209.0F,
+-219.0F,
+-228.0F,
+-238.0F,
+-247.0F,
+-256.0F,
+-265.0F,
+-274.0F,
+-283.0F,
+-292.0F,
+-301.0F,
+-309.0F,
+-318.0F,
+-326.0F,
+-335.0F,
+-343.0F,
+-351.0F,
+-359.0F,
+-367.0F,
+-375.0F,
+-382.0F,
+-390.0F,
+-397.0F,
+-405.0F,
+-412.0F,
+-419.0F,
+-426.0F,
+-433.0F,
+-440.0F,
+-447.0F,
+-454.0F,
+-460.0F,
+-467.0F,
+-473.0F,
+-479.0F,
+-486.0F,
+-492.0F,
+-498.0F,
+-504.0F,
+-509.0F,
+-515.0F,
+-521.0F,
+-526.0F,
+-531.0F,
+-537.0F,
+-542.0F,
+-547.0F,
+-552.0F,
+-557.0F,
+-561.0F,
+-566.0F,
+-571.0F,
+-575.0F,
+-579.0F,
+-584.0F,
+-588.0F,
+-592.0F,
+-596.0F,
+-600.0F,
+-604.0F,
+-607.0F,
+-611.0F,
+-614.0F,
+-618.0F,
+-621.0F,
+-624.0F,
+-627.0F,
+-630.0F,
+-633.0F,
+-636.0F,
+-638.0F,
+-641.0F,
+-644.0F,
+-646.0F,
+-648.0F,
+-651.0F,
+-653.0F,
+-655.0F,
+-657.0F,
+-658.0F,
+-660.0F,
+-662.0F,
+-664.0F,
+-665.0F,
+-666.0F,
+-668.0F,
+-669.0F,
+-670.0F,
+-671.0F,
+-672.0F,
+-673.0F,
+-674.0F,
+-675.0F,
+-675.0F,
+-676.0F,
+-676.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-677.0F,
+-676.0F,
+-676.0F,
+-675.0F,
+-675.0F,
+-674.0F,
+-674.0F,
+-673.0F,
+-672.0F,
+-671.0F,
+-670.0F,
+-669.0F,
+-668.0F,
+-667.0F,
+-665.0F,
+-664.0F,
+-663.0F,
+-661.0F,
+-660.0F,
+-658.0F,
+-656.0F,
+-654.0F,
+-653.0F,
+-651.0F,
+-649.0F,
+-647.0F,
+-645.0F,
+-643.0F,
+-641.0F,
+-638.0F,
+-636.0F,
+-634.0F,
+-631.0F,
+-629.0F,
+-626.0F,
+-624.0F,
+-621.0F,
+-619.0F,
+-616.0F,
+-613.0F,
+-610.0F,
+-608.0F,
+-605.0F,
+-602.0F,
+-599.0F,
+-596.0F,
+-593.0F,
+-589.0F,
+-586.0F,
+-583.0F,
+-580.0F,
+-576.0F,
+-573.0F,
+-570.0F,
+-566.0F,
+-563.0F,
+-559.0F,
+-556.0F,
+-552.0F,
+-549.0F,
+-545.0F,
+-541.0F,
+-538.0F,
+-534.0F,
+-530.0F,
+-526.0F,
+-522.0F,
+-519.0F,
+-515.0F,
+-511.0F,
+-507.0F,
+-503.0F,
+-499.0F,
+-495.0F,
+-491.0F,
+-487.0F,
+-482.0F,
+-478.0F,
+-474.0F,
+-470.0F,
+-466.0F,
+-462.0F,
+-457.0F,
+-453.0F,
+-449.0F,
+-445.0F,
+-440.0F,
+-436.0F,
+-432.0F,
+-427.0F,
+-423.0F,
+-419.0F,
+-414.0F,
+-410.0F,
+-406.0F,
+-401.0F,
+-397.0F,
+-392.0F,
+-388.0F,
+-383.0F,
+-379.0F,
+-375.0F,
+-370.0F,
+-366.0F,
+-361.0F,
+-357.0F,
+-352.0F,
+-348.0F,
+-343.0F,
+-339.0F,
+-334.0F,
+-330.0F,
+-325.0F,
+-321.0F,
+-316.0F,
+-312.0F,
+-307.0F,
+-303.0F,
+-298.0F,
+-294.0F,
+-290.0F,
+-285.0F,
+-281.0F,
+-276.0F,
+-272.0F,
+-267.0F,
+-263.0F,
+-259.0F,
+-254.0F,
+-250.0F,
+-245.0F,
+-241.0F,
+-237.0F,
+-232.0F,
+-228.0F,
+-224.0F,
+-219.0F,
+-215.0F,
+-211.0F,
+-207.0F,
+-202.0F,
+-198.0F,
+-194.0F,
+-190.0F,
+-185.0F,
+-181.0F,
+-177.0F,
+-173.0F,
+-169.0F,
+-165.0F,
+-161.0F,
+-157.0F,
+-153.0F,
+-149.0F,
+-145.0F,
+-141.0F,
+-137.0F,
+-133.0F,
+-129.0F,
+-125.0F,
+-121.0F,
+-117.0F,
+-113.0F,
+-110.0F,
+-106.0F,
+-102.0F,
+-98.0F,
+-95.0F,
+-91.0F,
+-87.0F,
+-84.0F,
+-80.0F,
+-77.0F,
+-73.0F,
+-69.0F,
+-66.0F,
+-62.0F,
+-59.0F,
+-56.0F,
+-52.0F,
+-49.0F,
+-46.0F,
+-42.0F,
+-39.0F,
+-36.0F,
+-32.0F,
+-29.0F,
+-26.0F,
+-23.0F,
+-20.0F,
+-17.0F,
+-14.0F,
+-11.0F,
+-8.0F,
+-5.0F,
+-2.0F,
+0.0F,
+3.0F,
+6.0F,
+8.0F,
+11.0F,
+14.0F,
+17.0F,
+19.0F,
+22.0F,
+25.0F,
+27.0F,
+30.0F,
+32.0F,
+35.0F,
+37.0F,
+40.0F,
+42.0F,
+44.0F,
+47.0F,
+49.0F,
+51.0F,
+54.0F,
+56.0F,
+58.0F,
+60.0F,
+62.0F,
+64.0F,
+66.0F,
+68.0F,
+70.0F,
+72.0F,
+74.0F,
+76.0F,
+78.0F,
+80.0F,
+82.0F,
+83.0F,
+85.0F,
+87.0F,
+89.0F,
+90.0F,
+92.0F,
+93.0F,
+95.0F,
+96.0F,
+98.0F,
+99.0F,
+101.0F,
+102.0F,
+104.0F,
+105.0F,
+106.0F,
+107.0F,
+109.0F,
+110.0F,
+111.0F,
+112.0F,
+113.0F,
+114.0F,
+116.0F,
+117.0F,
+118.0F,
+119.0F,
+120.0F,
+120.0F,
+121.0F,
+122.0F,
+123.0F,
+124.0F,
+125.0F,
+125.0F,
+126.0F,
+127.0F,
+128.0F,
+128.0F,
+129.0F,
+129.0F,
+130.0F,
+131.0F,
+131.0F,
+132.0F,
+132.0F,
+133.0F,
+133.0F,
+133.0F,
+134.0F,
+134.0F,
+134.0F,
+135.0F,
+135.0F,
+135.0F,
+135.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+137.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+136.0F,
+135.0F,
+135.0F,
+135.0F,
+135.0F,
+135.0F,
+134.0F,
+134.0F,
+134.0F,
+133.0F,
+133.0F,
+133.0F,
+132.0F,
+132.0F,
+131.0F,
+131.0F,
+131.0F,
+130.0F,
+130.0F,
+129.0F,
+129.0F,
+128.0F,
+128.0F,
+127.0F,
+127.0F,
+126.0F,
+125.0F,
+125.0F,
+124.0F,
+124.0F,
+123.0F,
+122.0F,
+122.0F,
+121.0F,
+120.0F,
+120.0F,
+119.0F,
+118.0F,
+118.0F,
+117.0F,
+116.0F,
+115.0F,
+115.0F,
+114.0F,
+113.0F,
+112.0F,
+112.0F,
+111.0F,
+110.0F,
+109.0F,
+108.0F,
+108.0F,
+107.0F,
+106.0F,
+105.0F,
+104.0F,
+103.0F,
+103.0F,
+102.0F,
+101.0F,
+100.0F,
+99.0F,
+98.0F,
+97.0F,
+96.0F,
+96.0F,
+95.0F,
+94.0F,
+93.0F,
+92.0F,
+91.0F,
+90.0F,
+89.0F,
+88.0F,
+87.0F,
+87.0F,
+86.0F,
+85.0F,
+84.0F,
+83.0F,
+82.0F,
+81.0F,
+80.0F,
+79.0F,
+78.0F,
+77.0F,
+76.0F,
+76.0F,
+75.0F,
+74.0F,
+73.0F,
+72.0F,
+71.0F,
+70.0F,
+69.0F,
+68.0F,
+67.0F,
+66.0F,
+65.0F,
+65.0F,
+64.0F,
+63.0F,
+62.0F,
+61.0F,
+60.0F,
+59.0F,
+58.0F,
+57.0F,
+57.0F,
+56.0F,
+55.0F,
+54.0F,
+53.0F,
+52.0F,
+51.0F,
+51.0F,
+50.0F,
+49.0F,
+48.0F,
+47.0F,
+46.0F,
+46.0F,
+45.0F,
+44.0F,
+43.0F,
+42.0F,
+42.0F,
+41.0F,
+40.0F,
+39.0F,
+38.0F,
+38.0F,
+37.0F,
+36.0F,
+35.0F,
+35.0F,
+34.0F,
+33.0F,
+33.0F,
+32.0F,
+31.0F,
+30.0F,
+30.0F,
+29.0F,
+28.0F,
+28.0F};
+
+static float SMALL_FILTER_IMPD[] = {
+-1.0F,
+-1.0F,
+-3.0F,
+-4.0F,
+-5.0F,
+-6.0F,
+-8.0F,
+-8.0F,
+-9.0F,
+-11.0F,
+-12.0F,
+-13.0F,
+-14.0F,
+-15.0F,
+-16.0F,
+-18.0F,
+-18.0F,
+-20.0F,
+-20.0F,
+-22.0F,
+-23.0F,
+-24.0F,
+-25.0F,
+-26.0F,
+-28.0F,
+-28.0F,
+-30.0F,
+-30.0F,
+-32.0F,
+-33.0F,
+-34.0F,
+-35.0F,
+-36.0F,
+-37.0F,
+-38.0F,
+-40.0F,
+-40.0F,
+-42.0F,
+-42.0F,
+-44.0F,
+-44.0F,
+-46.0F,
+-47.0F,
+-48.0F,
+-49.0F,
+-50.0F,
+-51.0F,
+-52.0F,
+-53.0F,
+-54.0F,
+-55.0F,
+-56.0F,
+-57.0F,
+-58.0F,
+-60.0F,
+-60.0F,
+-61.0F,
+-62.0F,
+-64.0F,
+-64.0F,
+-65.0F,
+-66.0F,
+-68.0F,
+-68.0F,
+-69.0F,
+-70.0F,
+-71.0F,
+-72.0F,
+-73.0F,
+-74.0F,
+-75.0F,
+-76.0F,
+-77.0F,
+-77.0F,
+-79.0F,
+-80.0F,
+-80.0F,
+-81.0F,
+-83.0F,
+-83.0F,
+-84.0F,
+-85.0F,
+-86.0F,
+-87.0F,
+-87.0F,
+-89.0F,
+-89.0F,
+-90.0F,
+-91.0F,
+-92.0F,
+-93.0F,
+-93.0F,
+-95.0F,
+-95.0F,
+-96.0F,
+-97.0F,
+-97.0F,
+-99.0F,
+-99.0F,
+-100.0F,
+-101.0F,
+-101.0F,
+-103.0F,
+-103.0F,
+-103.0F,
+-105.0F,
+-105.0F,
+-106.0F,
+-107.0F,
+-107.0F,
+-108.0F,
+-109.0F,
+-110.0F,
+-110.0F,
+-111.0F,
+-112.0F,
+-112.0F,
+-113.0F,
+-113.0F,
+-114.0F,
+-115.0F,
+-116.0F,
+-116.0F,
+-116.0F,
+-118.0F,
+-118.0F,
+-118.0F,
+-119.0F,
+-120.0F,
+-120.0F,
+-121.0F,
+-121.0F,
+-122.0F,
+-122.0F,
+-123.0F,
+-124.0F,
+-124.0F,
+-124.0F,
+-125.0F,
+-126.0F,
+-126.0F,
+-126.0F,
+-127.0F,
+-128.0F,
+-127.0F,
+-129.0F,
+-129.0F,
+-129.0F,
+-129.0F,
+-130.0F,
+-131.0F,
+-130.0F,
+-132.0F,
+-131.0F,
+-132.0F,
+-132.0F,
+-133.0F,
+-133.0F,
+-133.0F,
+-134.0F,
+-134.0F,
+-134.0F,
+-135.0F,
+-135.0F,
+-135.0F,
+-136.0F,
+-136.0F,
+-136.0F,
+-136.0F,
+-136.0F,
+-137.0F,
+-137.0F,
+-138.0F,
+-137.0F,
+-138.0F,
+-138.0F,
+-138.0F,
+-138.0F,
+-138.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-140.0F,
+-139.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-141.0F,
+-140.0F,
+-140.0F,
+-141.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-141.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-140.0F,
+-139.0F,
+-140.0F,
+-140.0F,
+-139.0F,
+-140.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-139.0F,
+-138.0F,
+-139.0F,
+-138.0F,
+-138.0F,
+-138.0F,
+-138.0F,
+-137.0F,
+-138.0F,
+-137.0F,
+-136.0F,
+-137.0F,
+-136.0F,
+-136.0F,
+-136.0F,
+-136.0F,
+-135.0F,
+-135.0F,
+-135.0F,
+-134.0F,
+-135.0F,
+-134.0F,
+-133.0F,
+-133.0F,
+-133.0F,
+-133.0F,
+-132.0F,
+-132.0F,
+-132.0F,
+-131.0F,
+-131.0F,
+-130.0F,
+-130.0F,
+-130.0F,
+-129.0F,
+-129.0F,
+-129.0F,
+-128.0F,
+-128.0F,
+-127.0F,
+-127.0F,
+-126.0F,
+-126.0F,
+-126.0F,
+-125.0F,
+-124.0F,
+-125.0F,
+-123.0F,
+-123.0F,
+-123.0F,
+-122.0F,
+-122.0F,
+-122.0F,
+-120.0F,
+-121.0F,
+-119.0F,
+-120.0F,
+-118.0F,
+-118.0F,
+-118.0F,
+-117.0F,
+-117.0F,
+-116.0F,
+-115.0F,
+-115.0F,
+-114.0F,
+-114.0F,
+-113.0F,
+-113.0F,
+-112.0F,
+-111.0F,
+-111.0F,
+-111.0F,
+-109.0F,
+-109.0F,
+-109.0F,
+-107.0F,
+-108.0F,
+-106.0F,
+-106.0F,
+-106.0F,
+-104.0F,
+-104.0F,
+-104.0F,
+-102.0F,
+-103.0F,
+-101.0F,
+-101.0F,
+-100.0F,
+-99.0F,
+-99.0F,
+-98.0F,
+-98.0F,
+-97.0F,
+-96.0F,
+-95.0F,
+-95.0F,
+-94.0F,
+-93.0F,
+-93.0F,
+-92.0F,
+-90.0F,
+-91.0F,
+-90.0F,
+-89.0F,
+-88.0F,
+-88.0F,
+-87.0F,
+-86.0F,
+-86.0F,
+-85.0F,
+-84.0F,
+-83.0F,
+-83.0F,
+-82.0F,
+-81.0F,
+-80.0F,
+-80.0F,
+-79.0F,
+-78.0F,
+-78.0F,
+-76.0F,
+-76.0F,
+-76.0F,
+-74.0F,
+-74.0F,
+-73.0F,
+-72.0F,
+-72.0F,
+-70.0F,
+-70.0F,
+-70.0F,
+-68.0F,
+-68.0F,
+-67.0F,
+-66.0F,
+-65.0F,
+-65.0F,
+-64.0F,
+-63.0F,
+-63.0F,
+-61.0F,
+-61.0F,
+-60.0F,
+-60.0F,
+-58.0F,
+-58.0F,
+-57.0F,
+-56.0F,
+-56.0F,
+-55.0F,
+-54.0F,
+-53.0F,
+-52.0F,
+-52.0F,
+-51.0F,
+-50.0F,
+-50.0F,
+-48.0F,
+-48.0F,
+-47.0F,
+-47.0F,
+-45.0F,
+-45.0F,
+-44.0F,
+-44.0F,
+-42.0F,
+-42.0F,
+-41.0F,
+-41.0F,
+-39.0F,
+-39.0F,
+-38.0F,
+-38.0F,
+-36.0F,
+-36.0F,
+-35.0F,
+-35.0F,
+-33.0F,
+-33.0F,
+-33.0F,
+-31.0F,
+-31.0F,
+-30.0F,
+-29.0F,
+-29.0F,
+-28.0F,
+-27.0F,
+-26.0F,
+-26.0F,
+-25.0F,
+-24.0F,
+-24.0F,
+-23.0F,
+-22.0F,
+-21.0F,
+-21.0F,
+-20.0F,
+-19.0F,
+-19.0F,
+-18.0F,
+-17.0F,
+-17.0F,
+-16.0F,
+-15.0F,
+-15.0F,
+-14.0F,
+-13.0F,
+-13.0F,
+-12.0F,
+-11.0F,
+-11.0F,
+-10.0F,
+-9.0F,
+-9.0F,
+-8.0F,
+-7.0F,
+-7.0F,
+-6.0F,
+-6.0F,
+-5.0F,
+-4.0F,
+-3.0F,
+-4.0F,
+-2.0F,
+-2.0F,
+-1.0F,
+-1.0F,
+0.0F,
+1.0F,
+1.0F,
+2.0F,
+2.0F,
+3.0F,
+3.0F,
+4.0F,
+5.0F,
+5.0F,
+6.0F,
+6.0F,
+7.0F,
+7.0F,
+8.0F,
+8.0F,
+9.0F,
+10.0F,
+10.0F,
+10.0F,
+11.0F,
+12.0F,
+12.0F,
+13.0F,
+13.0F,
+13.0F,
+14.0F,
+15.0F,
+15.0F,
+15.0F,
+16.0F,
+16.0F,
+17.0F,
+17.0F,
+18.0F,
+18.0F,
+19.0F,
+19.0F,
+20.0F,
+20.0F,
+20.0F,
+21.0F,
+21.0F,
+22.0F,
+22.0F,
+22.0F,
+23.0F,
+23.0F,
+24.0F,
+24.0F,
+24.0F,
+25.0F,
+25.0F,
+25.0F,
+26.0F,
+26.0F,
+27.0F,
+26.0F,
+28.0F,
+27.0F,
+28.0F,
+28.0F,
+29.0F,
+28.0F,
+30.0F,
+29.0F,
+30.0F,
+30.0F,
+30.0F,
+31.0F,
+30.0F,
+32.0F,
+31.0F,
+32.0F,
+32.0F,
+32.0F,
+32.0F,
+33.0F,
+33.0F,
+33.0F,
+33.0F,
+34.0F,
+34.0F,
+34.0F,
+34.0F,
+35.0F,
+34.0F,
+35.0F,
+35.0F,
+35.0F,
+36.0F,
+36.0F,
+35.0F,
+36.0F,
+36.0F,
+37.0F,
+36.0F,
+37.0F,
+36.0F,
+37.0F,
+37.0F,
+38.0F,
+37.0F,
+37.0F,
+38.0F,
+37.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+39.0F,
+38.0F,
+38.0F,
+39.0F,
+39.0F,
+38.0F,
+39.0F,
+39.0F,
+38.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+39.0F,
+38.0F,
+39.0F,
+39.0F,
+38.0F,
+39.0F,
+38.0F,
+39.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+38.0F,
+37.0F,
+38.0F,
+37.0F,
+38.0F,
+37.0F,
+37.0F,
+37.0F,
+37.0F,
+36.0F,
+37.0F,
+36.0F,
+37.0F,
+36.0F,
+36.0F,
+36.0F,
+36.0F,
+35.0F,
+36.0F,
+35.0F,
+35.0F,
+35.0F,
+35.0F,
+34.0F,
+35.0F,
+34.0F,
+34.0F,
+34.0F,
+34.0F,
+33.0F,
+34.0F,
+33.0F,
+33.0F,
+33.0F,
+33.0F,
+31.0F,
+32.0F,
+32.0F,
+32.0F,
+32.0F,
+31.0F,
+31.0F,
+31.0F,
+31.0F,
+31.0F,
+30.0F,
+30.0F,
+30.0F,
+30.0F,
+29.0F,
+30.0F,
+29.0F,
+28.0F,
+29.0F,
+28.0F,
+28.0F,
+28.0F,
+28.0F,
+27.0F,
+27.0F,
+27.0F,
+27.0F,
+26.0F,
+27.0F,
+26.0F,
+25.0F,
+26.0F,
+25.0F,
+25.0F,
+24.0F,
+25.0F,
+24.0F,
+24.0F,
+23.0F,
+24.0F,
+23.0F,
+23.0F,
+22.0F,
+23.0F,
+22.0F,
+22.0F,
+21.0F,
+22.0F,
+21.0F,
+20.0F,
+21.0F,
+20.0F,
+20.0F,
+20.0F,
+19.0F,
+19.0F,
+19.0F,
+19.0F,
+18.0F,
+18.0F,
+18.0F,
+17.0F,
+17.0F,
+17.0F,
+17.0F,
+17.0F,
+16.0F,
+16.0F,
+15.0F,
+15.0F,
+16.0F,
+14.0F,
+15.0F,
+14.0F,
+14.0F,
+14.0F,
+13.0F,
+13.0F,
+13.0F,
+13.0F,
+12.0F,
+12.0F,
+12.0F,
+11.0F,
+12.0F,
+11.0F,
+10.0F,
+11.0F,
+10.0F,
+10.0F,
+10.0F,
+9.0F,
+9.0F,
+9.0F,
+8.0F,
+9.0F,
+8.0F,
+8.0F,
+7.0F,
+7.0F,
+7.0F,
+7.0F,
+7.0F,
+6.0F,
+6.0F,
+6.0F,
+5.0F,
+5.0F,
+5.0F,
+5.0F,
+4.0F,
+5.0F,
+3.0F,
+4.0F,
+4.0F,
+3.0F,
+3.0F,
+3.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+1.0F,
+1.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-2.0F,
+-2.0F,
+-2.0F,
+-2.0F,
+-3.0F,
+-2.0F,
+-3.0F,
+-3.0F,
+-4.0F,
+-3.0F,
+-4.0F,
+-4.0F,
+-4.0F,
+-4.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-6.0F,
+-6.0F,
+-6.0F,
+-6.0F,
+-6.0F,
+-7.0F,
+-7.0F,
+-6.0F,
+-8.0F,
+-7.0F,
+-7.0F,
+-8.0F,
+-7.0F,
+-8.0F,
+-8.0F,
+-8.0F,
+-9.0F,
+-8.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-10.0F,
+-10.0F,
+-9.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-11.0F,
+-10.0F,
+-11.0F,
+-10.0F,
+-11.0F,
+-11.0F,
+-11.0F,
+-11.0F,
+-12.0F,
+-11.0F,
+-11.0F,
+-12.0F,
+-12.0F,
+-11.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-15.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-13.0F,
+-14.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-13.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-13.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-12.0F,
+-11.0F,
+-12.0F,
+-12.0F,
+-11.0F,
+-10.0F,
+-12.0F,
+-11.0F,
+-11.0F,
+-11.0F,
+-11.0F,
+-11.0F,
+-10.0F,
+-11.0F,
+-11.0F,
+-10.0F,
+-11.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-10.0F,
+-9.0F,
+-10.0F,
+-9.0F,
+-10.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-9.0F,
+-8.0F,
+-9.0F,
+-8.0F,
+-9.0F,
+-8.0F,
+-8.0F,
+-8.0F,
+-8.0F,
+-8.0F,
+-7.0F,
+-8.0F,
+-7.0F,
+-8.0F,
+-7.0F,
+-7.0F,
+-7.0F,
+-7.0F,
+-7.0F,
+-7.0F,
+-7.0F,
+-6.0F,
+-7.0F,
+-6.0F,
+-6.0F,
+-7.0F,
+-6.0F,
+-6.0F,
+-6.0F,
+-5.0F,
+-6.0F,
+-6.0F,
+-5.0F,
+-5.0F,
+-6.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-5.0F,
+-4.0F,
+-5.0F,
+-5.0F,
+-4.0F,
+-4.0F,
+-5.0F,
+-4.0F,
+-4.0F,
+-4.0F,
+-4.0F,
+-4.0F,
+-3.0F,
+-4.0F,
+-3.0F,
+-4.0F,
+-3.0F,
+-3.0F,
+-3.0F,
+-3.0F,
+-3.0F,
+-3.0F,
+-2.0F,
+-3.0F,
+-3.0F,
+-2.0F,
+-2.0F,
+-3.0F,
+-2.0F,
+-2.0F,
+-2.0F,
+-1.0F,
+-2.0F,
+-2.0F,
+-2.0F,
+-1.0F,
+-1.0F,
+-2.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+2.0F,
+1.0F,
+1.0F,
+2.0F,
+1.0F,
+2.0F,
+2.0F,
+2.0F,
+1.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+3.0F,
+2.0F,
+2.0F,
+3.0F,
+2.0F,
+3.0F,
+2.0F,
+3.0F,
+2.0F,
+3.0F,
+3.0F,
+3.0F,
+2.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+4.0F,
+3.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+4.0F,
+5.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+3.0F,
+4.0F,
+4.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+4.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+3.0F,
+2.0F,
+3.0F,
+3.0F,
+2.0F,
+3.0F,
+3.0F,
+3.0F,
+2.0F,
+3.0F,
+3.0F,
+2.0F,
+3.0F,
+2.0F,
+3.0F,
+2.0F,
+3.0F,
+2.0F,
+2.0F,
+3.0F,
+2.0F,
+2.0F,
+3.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+2.0F,
+1.0F,
+2.0F,
+2.0F,
+2.0F,
+1.0F,
+2.0F,
+1.0F,
+2.0F,
+1.0F,
+2.0F,
+1.0F,
+2.0F,
+1.0F,
+2.0F,
+1.0F,
+1.0F,
+1.0F,
+2.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+2.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+0.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+1.0F,
+0.0F,
+1.0F,
+1.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+1.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+1.0F,
+0.0F,
+0.0F,
+1.0F,
+0.0F,
+0.0F,
+1.0F,
+0.0F,
+0.0F,
+0.0F,
+1.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+1.0F,
+-1.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+0.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-1.0F,
+-1.0F,
+0.0F,
+-28.0F};
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/handlers.c b/lib-src/libnyquist/nyquist/nyqsrc/handlers.c
new file mode 100644
index 0000000..a57691c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/handlers.c
@@ -0,0 +1,120 @@
+/* handlers.c -- null handlers to avoid link errors due to callouts in moxc.c */
+
+#include "musiprog.h"
+
+char *app_syntax = "";
+
+/* note -- a simple way to make a midi note on channel 1 */
+/**/
+void note(pitch, dur)
+{
+}
+
+/* asciievent -- ascii event handler */
+/**/
+void asciievent(char c)
+{
+}
+
+
+/* keyup -- key up handler */
+/**/
+void keyup(int c, int k)
+{
+    /* insert key up actions here */
+}
+
+
+/* keydown -- key down handler */
+/**/
+void keydown(int c, int k, int v)
+{
+    /* insert key down actions here */
+}
+
+
+/* midievent -- handle a midi message */
+/**/
+void midievent(midi_data)
+  byte midi_data[4];
+{
+    /* this is only called if mididecode is false so */
+    /* you can assume this function is never called  */
+}
+
+
+/* prgmchange -- program change handler */
+/**/
+void prgmchange(int chan, int value)
+{
+    /* insert program change actions here */
+}
+
+
+/* bendchange -- pitch bend handler */
+/**/
+void bendchange(int chan, int value)
+{
+    /* insert pitchbend actions here */
+}
+
+
+/* ctrlchange -- control change handler */
+/**/
+void ctrlchange(int chan, int ctrl, int value)
+{
+    /* insert control change actions here */
+}
+
+
+/* peddown -- pedal down handler */
+/**/
+void peddown(int c)
+{
+    /* insert pedal down actions here */
+    /* the following default action invokes your control change handler */
+    ctrlchange(c, SUSTAIN, 127);
+}
+
+
+/* pedup -- pedal up handler */
+/**/
+void pedup(int c)
+{
+    /* insert pedal up actions here */
+    /* the following default action invokes your control change handler */
+    ctrlchange(c, SUSTAIN, 0);
+}
+
+
+/* touchchange -- after touch handler */
+/**/
+void touchchange(int chan, int value)
+{
+    /* insert after touch actions here */
+}
+
+
+void sysex(void)
+{
+}
+
+
+/*
+ * NOTE: this is called just before closing down the midi interface.
+ */
+void coda(void)
+{
+}
+
+
+#ifdef AMIGA
+void buttonchange(int number, int value)
+{
+}
+
+void propchange(int number, int value)
+{
+        /* insert propchange actions here */
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/inverse.c b/lib-src/libnyquist/nyquist/nyqsrc/inverse.c
new file mode 100644
index 0000000..1dd757c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/inverse.c
@@ -0,0 +1,214 @@
+/* inverse.c -- compute the inverse of a sampled function */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "cext.h"
+
+#include "falloc.h"
+#include "inverse.h"
+
+void inverse_free();
+
+
+typedef struct inverse_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    double s_prev;
+    double s_time;
+    double s_time_increment;
+    double out_time_increment;
+    boolean started;
+} inverse_susp_node, *inverse_susp_type;
+
+void inverse_fetch(register inverse_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples read from s */
+    int out_cnt = 0; /* how many samples output */
+    int togo = 0; /* how many more to read from s in inner loop */
+    int n;
+    sample_block_type out;
+    double out_time = susp->susp.current * susp->out_time_increment;
+    
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "inverse_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure we are primed with first value */
+    /* This is a lot of work just to prefetch susp->s_prev! */
+    if (!susp->started) {
+        susp->started = true;
+        /* see comments below about susp_check_term_log_samples() */
+        if (susp->s_cnt == 0) {
+            susp_get_samples(s, s_ptr, s_cnt);
+            if (susp->s_ptr == zero_block->samples) {
+                susp->terminate_cnt = susp->susp.current;
+            }
+        }
+        susp->s_prev = susp_fetch_sample(s, s_ptr, s_cnt);
+    }
+
+    while (out_cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't run past the s input sample block: */
+        /* most fetch routines call susp_check_term_log_samples() here
+         * but we can't becasue susp_check_term_log_samples() assumes
+          * that output time progresses at the same rate as input time.
+         * Here, some time warping is going on, so this doesn't work.
+         * Instead, check for termination of s and fix terminate_cnt to
+         * be the current output count rather than the current input time.
+         */
+        if (susp->s_cnt == 0) {
+            susp_get_samples(s, s_ptr, s_cnt);
+            if (susp->s_ptr == zero_block->samples) {
+                susp->terminate_cnt = susp->susp.current + out_cnt;
+                /* we can't simply terminate here because we might have 
+                 * some output samples computed already, in which case we
+                 * want to return them now and terminate the NEXT time we're
+                 * called.
+                 */
+            }
+        }
+        togo = susp->s_cnt;
+
+        /* if we ran past terminate time, fix up output */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + out_cnt) {
+            /* pretend like we computed the correct number of samples */
+            togo = 0;
+            out_cnt = susp->terminate_cnt - susp->susp.current;
+            /* exit the loop to complete the termination */
+            break;
+        }
+        n = togo;
+        s_ptr_reg = susp->s_ptr;
+        if (n) do { /* the inner sample computation loop */
+            /* scan s_ptr_reg to time t, output and loop */
+            register double next_value = *s_ptr_reg++;
+            while (out_time < next_value) {
+                *out_ptr++ = (float) (susp->s_time +
+                             (out_time - susp->s_prev) /
+                             (susp->s->sr * (next_value - susp->s_prev)));
+                out_time += susp->out_time_increment;
+                if (++out_cnt >= max_sample_block_len) goto output_full;
+            }
+            susp->s_prev = next_value;
+            susp->s_time += susp->s_time_increment;
+        } while (--n); /* inner loop */
+  output_full:
+        /* using s_ptr_reg is a bad idea on RS/6000: */
+        susp->s_ptr += (togo - n);
+        susp_took(s_cnt, (togo - n));
+        cnt += (togo - n);
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && out_cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = out_cnt;
+        susp->susp.current += out_cnt;
+    }
+} /* inverse_fetch */
+
+
+void inverse_toss_fetch(susp, snd_list)
+  register inverse_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = MIN(susp->susp.current + max_sample_block_len,
+                           susp->susp.toss_cnt);
+    time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while (((long) ((final_time - susp->s->t0) * susp->s->sr + 0.5)) >=
+           susp->s->current)
+        susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    if (final_count == susp->susp.toss_cnt) {
+        n = ROUND((final_time - susp->s->t0) * susp->s->sr -
+                       (susp->s->current - susp->s_cnt));
+        susp->s_ptr += n;
+        susp_took(s_cnt, n);
+        susp->susp.fetch = susp->susp.keep_fetch;
+    }
+    snd_list->block_len = (short) (final_count - susp->susp.current);
+    susp->susp.current = final_count;
+    snd_list->u.next = snd_list_create((snd_susp_type) susp);
+    snd_list->block = internal_zero_block;
+}
+
+
+void inverse_mark(inverse_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void inverse_free(inverse_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(inverse_susp_node), "inverse_free");
+}
+
+
+void inverse_print_tree(inverse_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_inverse(sound_type s, time_type t0, rate_type sr)
+{
+    register inverse_susp_type susp;
+
+    falloc_generic(susp, inverse_susp_node, "snd_make_inverse");
+    susp->susp.fetch = inverse_fetch;
+    susp->terminate_cnt = UNKNOWN;
+
+    /* initialize susp state */
+    susp->susp.free = inverse_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = inverse_mark;
+    susp->susp.print_tree = inverse_print_tree;
+    susp->susp.name = "inverse";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = UNKNOWN; /* log stop time = term time */
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->s_prev = 0;
+    susp->s_time = 0;
+    susp->s_time_increment = 1 / s->sr;
+    susp->out_time_increment = 1 / (sr * s->scale);
+    susp->started = false;
+    return sound_create((snd_susp_type)susp, t0, sr, 1.0 /* scale */);
+}
+
+
+sound_type snd_inverse(sound_type s, time_type t0, rate_type sr)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_inverse(s_copy, t0, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/inverse.h b/lib-src/libnyquist/nyquist/nyqsrc/inverse.h
new file mode 100644
index 0000000..4ecf563
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/inverse.h
@@ -0,0 +1,3 @@
+sound_type snd_make_inverse(sound_type s, time_type t0, rate_type sr);
+sound_type snd_inverse(sound_type s, time_type t0, rate_type sr);
+    /* LISP: (snd-inverse SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/local.c b/lib-src/libnyquist/nyquist/nyqsrc/local.c
new file mode 100644
index 0000000..1cd3eed
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/local.c
@@ -0,0 +1,55 @@
+/* local.c -- call initialization code for all extensions */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include "xlisp.h"
+#include "sound.h"
+#include "samples.h"
+#ifdef CMTSTUFF
+#include "seqext.h"
+#endif
+#include "falloc.h"
+#include "sine.h"
+#include "stkinit.h"
+
+LVAL RSLT_sym;
+
+void localinit(void)
+{
+    falloc_init();
+/*    probe_init(true);*/
+    sound_init();
+#ifdef CMTSTUFF
+    seqext_init();
+#endif
+    sine_init();
+    stk_init();
+}
+
+
+void localsymbols(void)
+{
+    RSLT_sym = xlenter("*RSLT*");
+    sound_symbols();
+    samples_symbols();
+#ifdef CMTSTUFF
+    seqext_symbols();
+#endif
+}
+
+extern int sample_block_total;
+extern int sample_block_used;
+
+void print_local_gc_info(void)
+{
+    char buf[50];
+    /* print sample blocks */
+    sprintf(buf, "; samples %dKB, %dKB free",
+            (sample_block_total * max_sample_block_len) / 1024,
+            ((sample_block_total - sample_block_used) *
+             max_sample_block_len) / 1024);
+    stdputstr(buf);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/localdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/localdefs.h
new file mode 100644
index 0000000..b227c2f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/localdefs.h
@@ -0,0 +1,3 @@
+/* include actual local file headers: */
+#include "sndfnintdefs.h"
+#include "seqfnintdefs.h"
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/localptrs.h b/lib-src/libnyquist/nyquist/nyqsrc/localptrs.h
new file mode 100644
index 0000000..8789cfa
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/localptrs.h
@@ -0,0 +1,9 @@
+/* localptrs.h -- extend XLISP with these functions
+ *
+ * CHANGE LOG
+ * 28-Apr-03  rbd  Removed "include switches.h" -- already included
+ */
+ 
+/* extension to xlisp */
+#include "sndfnintptrs.h"
+#include "seqfnintptrs.h"
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c
new file mode 100644
index 0000000..d6baf98
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c
@@ -0,0 +1,177 @@
+/* lpc.c -- implement LPC analysis */
+
+#include <math.h>
+
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+
+
+void abs_max(double *x, long desde, long hasta, double *x_maxptr, long *indptr)
+{
+              /*  use:
+	                  abs_max(s,0,10,&mimax,&miind);
+	          */
+
+	double x_max = x[desde];
+	long ind = desde;
+	long i;
+	for(i = desde+1; i<hasta; i++)
+		if (fabs(x[i]) > x_max)
+		{
+			x_max = fabs(x[i]);
+            ind = i;
+		}
+	*x_maxptr = x_max;
+	*indptr = ind;
+
+}
+
+void xcorr(double *s, double *rxx, long N)
+{
+	/* use:
+	xcorr(s,rxx,N);
+	*/
+	long i,j;
+	for(i=0; i < N; i++)
+	{
+		rxx[i] = 0.0;
+		for(j=0; j < N-i; j++)
+			rxx[i] += s[j]*s[j+i]; 
+    }
+}
+
+
+
+
+// SOUND PARAMETERS
+// w         Lisp vector containinig signal values
+// P         number of poles
+// N         length of sound
+
+// AUTOCORRELEATION PARAMETERS
+// rxx       array containing autocorrelation coefs
+// max_rxx   temporal maximun value of rxx
+// i_max     index of max_rxx
+
+// LPC PARAMETERS
+// alpha     array of filter coefs
+// k         reflection coef
+// E         residual energy
+// rms1      energy of input signal (not RMS)
+// rms2      residual energy = E    
+// unv       voiced/unvoiced parameter = ERR = rms2/rms1
+
+// PITCH DETECTION ALGORITHM: Implemented separately
+
+
+
+LVAL snd_lpanal(LVAL w, long P)
+{
+    
+	double *s, *rxx;
+	long N;
+	double *alpha;
+	// double *k, *E; THIS ONLY FOR VECTORIZED k AND E
+	double k, E;
+	double rms1; // rms2=E;
+	double unv;
+	double suma, alphatemp; // help variables
+	
+
+	long i,j;
+	LVAL result;
+
+	xlsave1(result);
+
+
+
+	//// end vars /////////////
+
+
+
+	//// allocate memory ///////
+    N = getsize(w);
+	s   = calloc(sizeof(double),N); //signal
+    rxx = calloc(sizeof(double),N); //autocorrelation
+	alpha = calloc(sizeof(double), P); // filter coefs
+	//k = calloc(sizeof(double), P); // reflection coefs
+	//E = calloc(sizeof(double), P); // residual energy
+    
+
+	//////   copy Lisp array sound data to array of double ///////
+	for(i=0; i<N; i++)
+		s[i] = getflonum(getelement(w,i));
+
+    /////   autocorrelation  ////////////////
+
+	xcorr(s,rxx,N); // this may be optimized as only P autocorr factors are needed (not N)
+
+
+	////////     LPC   analysis    //////////////////////////////////
+    
+	/// Durbin algorithm
+
+	/// inicialization
+    //for(i=0; i<P;i++)
+	//	alpha[i]=k[i]=E[i]=0.0; // don't need this. Done by default.
+	
+	//E[0] = rxx[0] - pow(rxx[1],2)/rxx[0];	
+	//k[0] = rxx[1]/rxx[0];
+	//alpha[0] = k[0];
+	E = rxx[0] - pow(rxx[1],2)/rxx[0]; // NO VECTORS k OR E	
+	k = rxx[1]/rxx[0];                 //
+	alpha[0] = k;                      //
+
+	/// recursive solve
+	for(i=1;i<P;i++)
+	{
+		suma=0.0;
+		for(j=0;j<i;j++)
+			suma += alpha[j] * rxx[i-j];
+		//k[i] = (rxx[i+1]-suma)/E[i-1];
+		//alpha[i]=k[i];
+		k = (rxx[i+1]-suma)/E;
+        alpha[i]=k;
+		for(j=0; j <= ((i-1) >> 1); j++)
+		{
+			//alphatemp = alpha[j] - k[i] * alpha[i-j-1];
+			//alpha[i-j-1] -= k[i] * alpha[j];
+			//alpha[j] = alphatemp;
+			alphatemp = alpha[j] - k * alpha[i-j-1];
+			alpha[i-j-1] -= k * alpha[j];
+			alpha[j] = alphatemp;
+
+		}
+		//E[i] = E[i-1] * (1 - pow(k[i],2));
+		E *= (1 - pow(k,2));
+
+	}
+
+	// input signal energy = rxx[0];
+	rms1 = rxx[0];
+
+    // voiced/unvoiced
+	unv= sqrt(E/rms1); 
+
+    ///// HERE: CHECK STABILITY AND MODIFY COEFS  /////////////
+    /////       not implemented
+
+	
+
+	// prepare output result
+     result = newvector(P);
+     for (i = 0; i < P; i++) setelement(result, i, cvflonum(alpha[P-i-1])); // alpoles format
+     
+	xlpop();	
+	
+	// free memory
+	free(s); free(rxx); free(alpha);
+
+	return (cons  (cvflonum(rms1),                    // input signal energy
+		          cons(cvflonum(E),                   // residual energy
+		          cons(cvflonum(unv),                 // ERR, voiced/unvoiced
+				  cons(result,  NULL)))));           // coefs
+
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/lpanal.h b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.h
new file mode 100644
index 0000000..87af9c0
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.h
@@ -0,0 +1,4 @@
+/* lpanal.h -- LPC analysis */
+
+LVAL snd_lpanal(LVAL v, long P);
+  /* LISP: (SND-LPANAL ANY FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/multiread.c b/lib-src/libnyquist/nyquist/nyqsrc/multiread.c
new file mode 100644
index 0000000..9c34be3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/multiread.c
@@ -0,0 +1,298 @@
+/* multiread.c -- read multichannel sound file */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include "stdio.h"
+#ifdef UNIX
+#include "sys/file.h"
+#endif
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "sndfmt.h"
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "sndfile.h"
+#include "sndread.h"
+#include "multiread.h"
+
+/* allocate input buffer space for this many bytes/frame,
+ * e.g. 8 allows 2 channels
+ * If frames are bigger, then multiple reads will be issued.
+ */
+#define max_bytes_per_frame (sizeof(float) * 2)
+#define input_buffer_max (max_sample_block_len * max_bytes_per_frame)
+#define input_buffer_samps (max_sample_block_len * 2)
+
+
+/* multiread_fetch - read samples into multiple channels.  */
+/*
+ * The susp is shared by all channels.  The susp has backpointers
+ * to the tail-most snd_list node of each channels, and it is by
+ * extending the list at these nodes that sounds are read in.
+ * To avoid a circularity, the reference counts on snd_list nodes
+ * do not include the backpointers from this susp.  When a snd_list
+ * node refcount goes to zero, the multiread susp's free routine
+ * is called.  This must scan the backpointers to find the node that
+ * has a zero refcount (the free routine is called before the node
+ * is deallocated, so this is safe).  The backpointer is then set
+ * to NULL.  When all backpointers are NULL, the susp itself is
+ * deallocated, because it can only be referenced through the
+ * snd_list nodes to which there are backpointers.
+ */
+void multiread_fetch(susp, snd_list)
+  register read_susp_type susp;
+  snd_list_type snd_list;
+{
+    int i, j;
+    int frames_read = 0; /* total frames read in this call to fetch */
+    int n;
+    sample_block_type out;
+    // char input_buffer[input_buffer_max];
+    float input_buffer[input_buffer_samps];
+    int file_frame_size;
+
+    /* when we are called, the caller (SND_get_first) will insert a new
+     * snd_list node.  We need to do this here for all other channels.
+     */
+    for (j = 0; j < susp->sf_info.channels; j++) {
+
+/*        nyquist_printf("multiread_fetch: chan[%d] = ", j);
+        print_snd_list_type(susp->chan[j]);
+        stdputstr("\n");
+ */
+        if (!susp->chan[j]) {   /* ignore non-existent channels */
+/*          nyquist_printf("multiread_fetch: ignore channel %d\n", j);*/
+            continue;
+        }
+        falloc_sample_block(out, "multiread_fetch");
+/*      nyquist_printf("multiread: allocated block %x\n", out); */
+        /* Since susp->chan[i] exists, we want to append a block of samples.
+         * The block, out, has been allocated.  Before we insert the block,
+         * we must figure out whether to insert a new snd_list_type node for
+         * the block.  Recall that before SND_get_next is called, the last
+         * snd_list_type in the list will have a null block pointer, and the
+         * snd_list_type's susp field points to the suspension (in this case,
+         * susp).  When SND_get_next (in sound.c) is called, it appends a new
+         * snd_list_type and points the previous one to internal_zero_block 
+         * before calling this fetch routine.  On the other hand, since 
+         * SND_get_next is only going to be called on one of the channels, the
+         * other channels will not have had a snd_list_type appended.
+         * SND_get_next does not tell us directly which channel it wants (it
+         * doesn't know), but we can test by looking for a non-null block in the
+         * snd_list_type pointed to by our back-pointers in susp->chan[].  If
+         * the block is null, the channel was untouched by SND_get_next, and
+         * we should append a snd_list_type.  If it is non-null, then it
+         * points to internal_zero_block (the block inserted by SND_get_next)
+         * and a new snd_list_type has already been appended.
+         */
+        /* Before proceeding, it may be that garbage collection ran when we
+         * allocated out, so check again to see if susp->chan[j] is Null:
+         */
+        if (!susp->chan[j]) {
+            ffree_sample_block(out, "multiread_fetch");
+            continue;
+        }
+        if (!susp->chan[j]->block) {
+            snd_list_type snd_list = snd_list_create((snd_susp_type) susp);
+            /* Now we have a snd_list to append to the channel, but a very
+             * interesting thing can happen here.  snd_list_create, which
+             * we just called, MAY have invoked the garbage collector, and
+             * the GC MAY have freed all references to this channel, in which
+             * case multread_free(susp) will have been called, and susp->chan[j]
+             * will now be NULL!
+             */
+            if (!susp->chan[j]) {
+                nyquist_printf("susp %p Channel %d disappeared!\n", susp, j);
+                ffree_snd_list(snd_list, "multiread_fetch");
+            } else {
+                susp->chan[j]->u.next = snd_list;
+            }
+        }
+        /* see the note above: we don't know if susp->chan still exists */
+        /* Note: We DO know that susp still exists because even if we lost
+         * some channels in a GC, someone is still calling SND_get_next on
+         * some channel.  I suppose that there might be some very pathological
+         * code that could free a global reference to a sound that is in the
+         * midst of being computed, perhaps by doing something bizarre in the
+         * closure that snd_seq activates at the logical stop time of its first
+         * sound, but I haven't thought that one through.
+         */
+        if (susp->chan[j]) {
+            susp->chan[j]->block = out;
+            /* check some assertions */
+            if (susp->chan[j]->u.next->u.susp != (snd_susp_type) susp) {
+                nyquist_printf("didn't find susp at end of list for chan %d\n", j);
+            }
+        } else { /* we allocated out, but don't need it anymore due to GC */
+            ffree_sample_block(out, "multiread_fetch");
+        }
+    }
+
+    file_frame_size = susp->sf_info.channels;
+
+    /* now fill sample blocks with frames from the file 
+       until eof or end of blocks */
+    while (true) {
+
+        /* compute how many frames to read to fill sample blocks */
+        long frame_count = max_sample_block_len - frames_read;
+        long actual;         /* how many frames actually read */
+
+        /* make sure frames will fit in buffer */
+        if (frame_count * file_frame_size > input_buffer_samps) {
+            frame_count = input_buffer_samps / file_frame_size;
+        }
+
+        actual = sf_readf_float(susp->sndfile, input_buffer, frame_count);
+        n = actual;  
+
+        /* don't read too many */
+        if (n > (susp->cnt - susp->susp.current)) {
+            n = susp->cnt - susp->susp.current;
+        }
+
+        /* process one channel at a time, multiple passes through input */
+        for (j = 0; j < susp->sf_info.channels; j++) {
+            register sample_block_values_type out_ptr;
+            /* offset by channel number: */
+            float *float_ptr = input_buffer + j;
+
+            /* ignore nonexistent channels */
+            if (!susp->chan[j]) continue;
+
+            /* find pointer to sample buffer */
+            out_ptr = susp->chan[j]->block->samples + frames_read;
+
+            /* copy samples */
+            for (i = 0; i < n; i++) {
+                *out_ptr++ = *float_ptr;
+                float_ptr += susp->sf_info.channels;
+            }
+            susp->chan[j]->block_len = frames_read + n;
+        }
+
+	/* jlh BECAUSE, at this point, all the code cares about is
+	   that n frames have been read and the samples put into their
+	   appropriate snd_node buffers. */
+
+        frames_read += n;
+        susp->susp.current += n;
+
+        if (frames_read == 0) {
+            /* NOTE: this code should probably be removed -- how could we
+               ever get here? Since file formats know the sample count, we'll
+               always read frames. When we hit the end-of-file, the else
+               clause below will run and terminate the sound, so we'll never
+               try and read samples that are not there. The only exception is
+               an empty sound file with no samples, in which case we could omit
+               this if test and execute the else part below.
+
+               This code *might* be good for formats that do not encode a
+               sample count and where reading the end of file is the only way
+               to detect the end of the data.
+
+               Since it seeems to work, I'm going to leave this in place.
+               One tricky point of the algorithm: when we get here, we set up
+               susp->chan[j] to point to the right place and then call
+               snd_list_terminate(). This deletes the snd_list that chan[j]
+               is pointing to, but not before calling multiread_free(), which
+               upon detecting that the sound is being freed, sets chan[j] to
+               NULL. This works sequentially on each channel and than last
+               time, this susp is freed because no channels are active.
+             */
+            /* we didn't read anything, but can't return length zero, so
+             * convert snd_list's to pointer to zero block.  This loop
+             * will free the susp via snd_list_unref().
+             */
+            for (j = 0; j < susp->sf_info.channels; j++) {
+                if (susp->chan[j]) {
+                    snd_list_type the_snd_list = susp->chan[j];
+                    /* this is done so that multiread_free works right: */
+                    susp->chan[j] = susp->chan[j]->u.next;
+                    /* nyquist_printf("end of file, terminating channel %d\n", j); */
+                    /* this fixes up the tail of channel j */
+                    snd_list_terminate(the_snd_list);
+                }
+            }
+            return;
+        } else if (susp->cnt == susp->susp.current || actual < frame_count) {
+            /* we've read the requested number of frames or we
+             * reached end of file
+             * last iteration will close file and free susp:
+             */
+            for (j = 0; j < susp->sf_info.channels; j++) {
+                snd_list_type the_snd_list = susp->chan[j];
+                /* nyquist_printf("reached susp->cnt, terminating chan %d\n", j); */
+                if (the_snd_list) {
+                    /* assert: */
+                    if (the_snd_list->u.next->u.susp != (snd_susp_type) susp) {
+                        stdputstr("assertion violation");
+                    }
+                    /* this is done so that multiread_free works right: */
+                    susp->chan[j] = the_snd_list->u.next;
+                    snd_list_unref(the_snd_list->u.next);
+                    /* terminate by pointing to zero block */
+                    the_snd_list->u.next = zero_snd_list;
+                }
+            }
+            return;
+        } else if (frames_read >= max_sample_block_len) {
+            /* move pointer to next list node */
+            for (j = 0; j < susp->sf_info.channels; j++) {
+                if (susp->chan[j]) susp->chan[j] = susp->chan[j]->u.next;
+            }
+            return;
+        }
+    }
+} /* multiread__fetch */
+  
+
+void multiread_free(read_susp_type susp)
+{
+    int j;
+    boolean active = false;
+/*    stdputstr("multiread_free: "); */
+    for (j = 0; j < susp->sf_info.channels; j++) {
+        if (susp->chan[j]) {
+            if (susp->chan[j]->refcnt) active = true;
+            else {
+                susp->chan[j] = NULL;
+                /* nyquist_printf("deactivating channel %d\n", j); */
+            }
+        }
+    }
+    if (!active) {
+        /* stdputstr("all channels freed, freeing susp now\n"); */
+        read_free(susp);
+    }
+}
+
+
+LVAL multiread_create(susp)
+  read_susp_type susp;
+{
+    LVAL result;
+    int j;
+
+    xlsave1(result);
+
+    result = newvector(susp->sf_info.channels);      /* create array for sounds */
+    falloc_generic_n(susp->chan, snd_list_type, susp->sf_info.channels, 
+                     "multiread_create");
+    /* create sounds to return */
+    for (j = 0; j < susp->sf_info.channels; j++) {
+        sound_type snd = sound_create((snd_susp_type)susp, 
+                                      susp->susp.t0, susp->susp.sr, 1.0);
+        LVAL snd_lval = cvsound(snd);
+/*      nyquist_printf("multiread_create: sound %d is %x, LVAL %x\n", j, snd, snd_lval); */
+        setelement(result, j, snd_lval);
+        susp->chan[j] = snd->list;
+    }
+    xlpop();
+    return result;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/multiread.h b/lib-src/libnyquist/nyquist/nyqsrc/multiread.h
new file mode 100644
index 0000000..7bd1b17
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/multiread.h
@@ -0,0 +1,3 @@
+LVAL multiread_create(read_susp_type susp);
+void multiread_fetch(read_susp_type susp, snd_list_type snd_list);
+void multiread_free(read_susp_type susp);
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/multiseq.c b/lib-src/libnyquist/nyquist/nyqsrc/multiseq.c
new file mode 100644
index 0000000..367b5f6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/multiseq.c
@@ -0,0 +1,673 @@
+/* multiseq.c -- return a multichannel signal until its logical stop, then
+   evaluate a closure to get another signal and convert to adds
+   of two multichannel signals */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "multiseq.h"
+#include "add.h"
+#include "scale.h"
+#include "extern.h"
+#include "cext.h"
+
+/* #define MULTISEQ_GC_DEBUG */
+#ifdef MULTISEQ_GC_DEBUG
+extern snd_list_type snd_list_to_watch;
+#endif
+
+/* #define GC_DEBUG */
+#ifdef GC_DEBUG
+extern sound_type sound_to_watch;
+#endif
+
+
+#define D if(0)
+
+/* Design:
+
+This operator implements sequences of multichannel signals.
+A single data structure manages an array of susps that
+initially are used to fetch blocks from the first multichannel
+signal.  When the LAST logical stop is reached, a closure
+is evaluated to yield a new multichannel signal.  The component
+sounds of this are stored into the susps which are then
+converted into add suspensions.  The other managing structures
+are then freed.
+
+The main constraint here is that the conversion to add susps
+must take place at the same time across all channels, so before
+the conversion, a fetch from the susp can only be made if it is
+known that the samples returned happen BEFORE the conversion will
+take place.  Since the conversion takes place at the maximum of
+the logical stop times of all channels, we have to advance all
+channels synchronously.  We keep track of a greatest lower bound,
+refered to as the horizon, on the maximum logical stop time.  It
+is safe to fetch blocks up to the horizon, but not beyond.
+
+This synchronous fetching is done by a single routine and an
+auxilliarly structure that manages the whole multichannel array
+of susps.  The basic idea is that a fetch from a 
+suspension gets forwarded to the managing structure, which
+uses its array of susps to fetch from ALL suspensions up to
+the requested time or until the logical stop, whichever comes
+first.  These "synchronous" fetches are not made by calling the
+fetch routines on the suspensions to avoid infinite recursion.
+
+At any time, there will be some set of channels whose logical 
+stop time is unknown.  The "s1" fields (s1, s1_ptr, s1_bptr) of
+these suspensions are used to look ahead by geting a block from
+s1.  If no logical stop is indicated, then we can append the block
+to the snd_list and update the horizon, allowing fetches from other
+susps.  In other words, the s1_bptr of each susp provides a one
+buffer lookahead by which we can obtain advance knowledge of the
+maximum logical stop time.
+
+The algorithm is as follows:
+
+1. When fetch is called on a suspension, compute when any
+prefetched samples will end (if there are none, then fetch
+a block from s1 and compute the time at which the block ends).
+This becomes the target time for other fetches.
+
+2. Call multiseq_advance(), passing the target time and the
+manager structure (which has pointers to all other channels).
+(Note: every susp has a pointer to the manager).
+The function of multiseq_advance() is to push the horizon for
+the logical stop forward.  This is done by 
+iterating over the array of susps until the target is reached.
+Actually, the array contains pointers to the snd_list_node that
+points to each susp and where the next block will be linked.
+The goal of this loop is to satisfy the original fetch, which
+means we have to push low_water to greater than or equal to the
+target.  (Low water is the minimum time of the next sample to
+be returned by any multiseq susp.) This goal will be met unless
+we reach the last logical stop time, in which case we evaluate
+the closure for the next multichannel sound, convert 
+everything to add's and let the additions take care of returning
+blocks.
+
+3. The Iteration Loop:
+low_water is the lowest sample count of the next sample 
+horizon is the greatest lower bound on the maximum logical stop time
+Iterate over susps until low_water >= target
+(Note: whenever data is fetched for a sound whose logical stop time
+is unknown, update the horizon.  If a logical stop time becomes known,
+then test if the final maximum logical stop time is known (by keeping
+a count of how many are still unknown), and if the count goes to zero,
+evaluate the continuation and convert to multiple adds.)
+(Another Note: we may reach the logical stop time and convert to 
+multiple adds before the loop terminates, in which case we return
+without finishing the loop.  Take care that the caller does the right
+thing to produce a sample block in this case.)
+
+3a. If a block hasn't been prefetched, do it.
+
+3b. While the susp has prefetched a block that ends at or before horizon,
+put the block on the snd_list and prefetch another block.
+
+3c. If the susp hasn't a known logical stop time, set new_horizon to
+the end time of the last sample prefetched in 3b.
+
+3d. If new_horizon == horizon, signal an error, no progress was made.
+
+3d. Set horizon to new_horizon and repeat the loop.
+
+NOTE ON A BUG FIX (1 Jul 95): old code assumed that when a logical stop
+was detected it was at the beginning of the next block, but if logical
+stop is explicit, then it may be way in the future.  We could convert
+to adds at this point, but that would force early evaluation of the
+closure, which we'd like to delay (be lazy when possible). Therefore,
+we want to ignore knowledge of a logical stop time until the logical
+stop time falls within the currently known block of samples. By "currently
+known", I mean somewhere in the block referenced by ->s1_ptr and ->s1_cnt.
+
+*/
+
+/* extern LVAL s_stdout; */
+
+void multiseq_convert(multiseq_type ms);
+void multiseq_free(add_susp_type susp);
+sample_block_type multiseq_get_next(sound_type snd, long * cnt);
+void multiseq_print_tree(add_susp_type susp, int n);
+
+
+#define susp_cnt_time(ssp, ms, cnt) (ssp->susp.t0 - ms->t0 + (cnt)/ssp->s1->sr)
+#define susp_time(ssp, ms) susp_cnt_time(ssp, ms, \
+                                         (ssp->susp.current + ssp->s1_cnt))
+#define susp_low_water(ssp, ms) susp_cnt_time(ssp, ms, ssp->susp.current)
+#define susp_log_stop_time(ssp, ms) susp_cnt_time(ssp, ms, ssp->susp.log_stop_cnt)
+
+
+/* multiseq_advance fetches from each channel to advance to target time */
+/*
+ * If a channel terminates early, we must be careful: continuing to
+ * fetch will return pointers to the zero_block, but this will
+ * indicate termination to whoever is fetching from multiseq. We
+ * must check the pointers and substitute internal_zero_block to
+ * avoid premature termination.
+ */
+void multiseq_advance(multiseq_type ms, time_type target)
+{
+    int i;
+    time_type new_horizon;
+    time_type new_low_water;
+
+D    nyquist_printf("multiseq_advance: %p->low_water %g, target %g\n", 
+            ms, ms->low_water, target);
+    while (ms->low_water < target - 0.000001) {
+        new_horizon = 0.0;
+D        nyquist_printf("multiseq_advance loop: target %g low_water %g horizon %g\n",
+                target, ms->low_water, ms->horizon);
+        /* new_low_water will be a minimum over every
+         * channel, so start with a big number */
+        new_low_water = target;
+        for (i = 0; i < ms->nchans; i++) {
+            snd_list_type snd_list = ms->chans[i];
+            add_susp_type susp = (add_susp_type) snd_list->u.susp;
+            time_type my_hor;
+            time_type my_low_water;
+D            nyquist_printf("chans[%d]: ", i);
+
+            /* fetch up to horizon */
+
+            /* see if susp has an unprocessed block (test on susp->s1_ptr
+             * is probably not necessary, in fact, it isn't initialized
+             * until the first block is fetched, but s1_cnt is
+             */
+            if (susp->s1_cnt && susp->s1_ptr && 
+                susp->s1_ptr == susp->s1_bptr->samples) {
+                /* do nothing, unprocessed block already there as a
+                 * result of the initiating fetch
+                 */
+            } else if (susp->s1_cnt != 0) {
+                stdputstr("multiseq_advance: s1_cnt != 0\n");
+                EXIT(1);	/* this should never happen */
+            } else { /* otherwise fetch it */
+D                stdputstr("prefetching samples ");
+                susp_get_block_samples(s1, s1_bptr, s1_ptr, s1_cnt);
+                if (susp->s1_ptr == zero_block->samples) {
+                    susp->terminate_bits = 1;
+                    susp->s1_bptr = internal_zero_block;
+                    susp->s1_ptr = internal_zero_block->samples;
+                }
+                /* see if we've reached a logical stop
+                 * (I can't believe this code block is in 3 places -
+                 *  there must be a better way... RBD)
+                 */
+                if (!susp->logical_stop_bits) {
+                    if (susp->s1->logical_stop_cnt != UNKNOWN) {
+                        if (susp->susp.current + susp->s1_cnt >=
+                            susp->s1->logical_stop_cnt) {
+                            susp->logical_stop_bits = 1;
+                            susp->susp.log_stop_cnt = 
+                                susp->s1->logical_stop_cnt;
+                            ms->not_logically_stopped_cnt--;
+D			    nyquist_printf(
+  "snd_make_multiseq: Logical stop reached, not_logically_stopped_cnt %d\n",
+                                   ms->not_logically_stopped_cnt);
+                        }
+                    }
+                }
+            }
+D           nyquist_printf(" current %d cnt %d ", 
+                (int)susp->susp.current, (int)susp->s1_cnt);
+
+            /* while the susp has prefetched a block that ends at or
+             * before horizon, put the block on the snd_list and
+             * prefetch another block
+             */
+            while (susp_time(susp, ms) < ms->horizon + 0.000001) {
+                snd_list->block = susp->s1_bptr;
+                snd_list->block_len = (short) susp->s1_cnt;
+                susp->susp.current += susp->s1_cnt;
+                (susp->s1_bptr->refcnt)++;
+                susp->s1_cnt = 0;
+#ifdef MULTISEQ_GC_DEBUG
+                nyquist_printf(
+                "multiseq: output block %p%s on snd_list %p to chan %d\n",
+                       susp->s1_bptr,
+                       (susp->s1_bptr == internal_zero_block ?
+                        " (INTERNAL ZERO BLOCK)" : ""), 
+                       snd_list, i);
+#endif
+                snd_list->u.next = snd_list_create(&(susp->susp));
+#ifdef MULTISEQ_GC_DEBUG
+                snd_list_debug(snd_list, "multiseq_advance");
+#endif
+                ms->chans[i] = snd_list = snd_list->u.next;
+                susp_get_block_samples(s1, s1_bptr, s1_ptr, s1_cnt);
+                if (susp->s1_ptr == zero_block->samples) {
+                    susp->terminate_bits = 1;
+                    susp->s1_bptr = internal_zero_block;
+                    susp->s1_ptr = internal_zero_block->samples;
+                }
+                if (susp->s1_ptr != susp->s1_bptr->samples) {
+                    stdputstr("bug in multiseq_advance\n");
+                    EXIT(1);
+                }
+                /* see if we've reached a logical stop
+                 * (I can't believe this code block is in 3 places -
+                 *  there must be a better way... RBD)
+                 */
+                if (!susp->logical_stop_bits) {
+                    if (susp->s1->logical_stop_cnt != UNKNOWN) {
+                        if (susp->susp.current + susp->s1_cnt >=
+                            susp->s1->logical_stop_cnt) {
+                            susp->logical_stop_bits = 1;
+                            susp->susp.log_stop_cnt = 
+                                susp->s1->logical_stop_cnt;
+                            ms->not_logically_stopped_cnt--;
+D			    nyquist_printf(
+  "snd_make_multiseq: Logical stop reached, not_logically_stopped_cnt %d\n",
+                                   ms->not_logically_stopped_cnt);
+                        }
+                    }
+                }
+D               nyquist_printf("\n\toutput block, current %d cnt %d ",
+                               (int)susp->susp.current, (int)susp->s1_cnt);
+            }
+            if (!susp->logical_stop_bits)
+                 my_hor = susp_time(susp, ms);
+            else my_hor = susp_log_stop_time(susp, ms);
+            if (new_horizon < my_hor) {
+D                nyquist_printf("new_horizon %g ", my_hor);
+                new_horizon = my_hor;
+            }
+            if (ms->not_logically_stopped_cnt == 0) {
+                ms->horizon = new_horizon; /* pass t0 to multiseq_convert */
+D		stdputstr("Calling multiseq_convert\n");
+                multiseq_convert(ms);
+                return;
+            }
+            my_low_water = susp_low_water(susp, ms);
+            if (my_low_water < new_low_water) {
+                new_low_water = my_low_water;
+            }
+D            stdputstr("\n");
+        }
+        ms->low_water = new_low_water;
+        if (new_horizon <= ms->horizon) {
+            stdputstr("no progress in multiseq_advance\n");
+            EXIT(1);
+        } else {
+            ms->horizon = new_horizon;
+        }
+    }
+}
+
+
+/* multiseq_convert -- eval closure and convert to adds */
+/**/
+void multiseq_convert(multiseq_type ms)
+{
+    LVAL result, new;
+    sound_type snd;
+    time_type now = ms->t0 + ms->horizon;
+    int i;
+    long size;
+
+    xlsave1(result);
+    result = xleval(cons(ms->closure, consa(cvflonum(now))));
+    if (exttypep(result, a_sound)) {
+        snd = sound_copy(getsound(result));
+        result = newvector(ms->nchans);
+        setelement(result, 0, cvsound(snd));
+        for (i = 1; i < ms->nchans; i++) {
+            setelement(result, i, cvsound(sound_zero(now, ms->sr)));
+        }
+    } else if (vectorp(result)) {
+        if (getsize(result) > ms->nchans) {
+            xlerror("too few channels", result);
+        } else if (getsize(result) < ms->nchans) {
+            new = newvector(ms->nchans);
+            for (i = 1; i < getsize(result); i++) {
+                setelement(new, i, getelement(result, i));
+            }
+            for (i = getsize(result); i < ms->nchans; i++) {
+                setelement(new, i, cvsound(sound_zero(now, ms->sr)));
+            }
+            result = new;
+        }
+    } else xlerror("closure did not return a (multi-channel) sound", result);
+
+    /* now result holds a vector of nchans, insert them into add_susp's */
+    for (i = 0; i < ms->nchans; i++) {
+        snd_list_type snd_list = ms->chans[i];
+        add_susp_type susp = (add_susp_type) snd_list->u.susp;
+        long sother_start;
+
+        /* remove backpointer to ms */
+        susp->multiseq = NULL;
+        susp->susp.print_tree = add_print_tree;
+        susp->susp.free = add_free;
+        susp->susp.mark = add_mark;
+
+        susp->s2 = sound_copy(getsound(getelement(result, i)));
+        if (susp->s1->sr != susp->s2->sr)
+            xlfail("multiseq: sample rates must match");
+
+        if (susp->s2->scale != 1.0) {
+            susp->s2 = snd_make_normalize(susp->s2);
+        }
+
+        sother_start = ROUND((susp->s2->t0 - susp->susp.t0) * susp->s2->sr);
+D	    nyquist_printf("sother_start computed for %p: %d\n",
+                      susp, (int)sother_start);
+        if (sother_start > susp->susp.current) {
+D	    nyquist_printf("susp %p using add_s1_nn_fetch\n", susp);
+            susp->susp.fetch = add_s1_nn_fetch;
+            susp->susp.name = "multiseq:add_s1_nn_fetch";
+        } else if (susp->terminate_bits) { /* s1 is done, just get s2 now */
+            sound_unref(susp->s1);
+            susp->s1 = NULL;
+D	    nyquist_printf("susp %p using add_s2_nn_fetch\n", susp);
+            susp->susp.fetch = add_s2_nn_fetch;
+            susp->susp.name = "multiseq:add_s2_nn_fetch";
+        } else {
+D	    nyquist_printf("susp %p using add_s1_s2_nn_fetch\n", susp);
+            susp->susp.fetch = add_s1_s2_nn_fetch;
+            susp->susp.name = "multiseq:add_s1_s2_nn_fetch";
+        }
+
+        /* fix up logical stop info */
+        /* BUG: what if s2 is already stopped? */
+        susp->susp.log_stop_cnt = UNKNOWN;
+        susp->logically_stopped = false;
+
+        /* we need to compute at least 1 sample
+         * (at this point we don't really know if we've
+         * computed anything or not, so to be safe, do it.
+         */
+        snd_list->u.next = snd_list_create(&(susp->susp));
+        snd_list->block = internal_zero_block;
+        (*(susp->susp.fetch))(susp, snd_list);
+    }
+    
+    /* now free the multiseq struct */
+    size = sizeof(snd_list_type) * ms->nchans;
+    ffree_generic(ms->chans, size, "multiseq_convert");
+    ffree_generic(ms, sizeof(multiseq_node), "multiseq_convert(2)");
+
+    ms->closure = NIL;	/* allow garbage collection now */
+    xlpop();
+}
+
+
+/* multiseq_fetch returns blocks of s1 until the logical stop time of s1's */
+/*
+ * Fetch routines (in particular, the add_*_fetch routines that will
+ * be installed on this susp at a later time) expect to be called with
+ * a new snd_list installed and ready for a new block.  However, since
+ * we are going to call multiseq_advance to pull blocks out of susps 
+ * that will not be set up with a fresh snd_list in this way, it is 
+ * simpler to dispose of the preallocated snd_list so that all susps
+ * look alike to multiseq_advance.  Of course, multiseq_advance will
+ * redo the work of allocating a snd_list.
+ *
+ * If a channel terminates early, we must be careful: continuing to
+ * fetch will return pointers to the zero_block, but this will
+ * indicate termination to whoever is fetching from multiseq. We
+ * must check the pointers and substitute internal_zero_block to
+ * avoid premature termination.
+ */
+void multiseq_fetch(susp, snd_list)
+  register add_susp_type susp;
+  snd_list_type snd_list;
+{
+    time_type block_end_time;
+
+    /* undo the preallocation of a snd_list_node */
+    /* we can bypass the reference counting code because we
+     * know that this snd_list was just allocated and has no
+     * other references
+     */
+#ifdef MULTISEQ_GC_DEBUG
+    if (snd_list_to_watch == snd_list->u.next) {
+        nyquist_printf("multiseq_fetch: backing out snd_list_to_watch from %p\n",
+               snd_list_to_watch);
+        watch_snd_list(snd_list);
+    }
+#endif
+    ffree_snd_list(snd_list->u.next, "multiseq_fetch");
+    snd_list->u.susp = (snd_susp_type) susp;
+    snd_list->block = NULL;
+
+D    nyquist_printf("multiseq_fetch called: susp %p s1_cnt %d\n",
+                    susp, (int)susp->s1_cnt);
+
+    /* first compute how many samples we can generate from s1: */
+    if (susp->s1_cnt == 0) {
+        susp_get_block_samples(s1, s1_bptr, s1_ptr, s1_cnt);
+        if (susp->s1_ptr == zero_block->samples) {
+            susp->terminate_bits = 1;   /* mark s1 as terminated */
+            susp->s1_bptr = internal_zero_block;
+            susp->s1_ptr = internal_zero_block->samples;
+        }
+        /* see if we've reached a logical stop
+         * (I can't believe this code block is in 3 places -
+         *  there must be a better way... RBD)
+         */
+        if (!susp->logical_stop_bits) {
+            if (susp->s1->logical_stop_cnt != UNKNOWN) {
+                if (susp->susp.current + susp->s1_cnt >=
+                    susp->s1->logical_stop_cnt) {
+                    susp->logical_stop_bits = 1;
+                    susp->susp.log_stop_cnt = 
+                      susp->s1->logical_stop_cnt;
+                    susp->multiseq->not_logically_stopped_cnt--;
+D		    nyquist_printf(
+ "snd_make_multiseq: Logical stop reached, not_logically_stopped_cnt %d\n",
+                          susp->multiseq->not_logically_stopped_cnt);
+                }
+            }
+        }
+    }
+    /* s1_cnt has the number of samples we can return */
+
+    /* now compute time of the last sample */
+    block_end_time = susp_time(susp, susp->multiseq);
+D   nyquist_printf("block_end_time of %p: %g\n", susp, block_end_time);
+    multiseq_advance(susp->multiseq,  block_end_time);
+}
+
+
+/* multiseq_mark -- mark routine for multiseq susps */
+/**/
+void multiseq_mark(add_susp_type susp)
+{
+    int i;
+    multiseq_type ms = susp->multiseq;
+D    nyquist_printf("multiseq_mark(%p)\n", susp);
+/*    nyquist_printf("marking s1@%p in add@%p\n", susp->s1, susp);*/
+    if (ms->closure) mark(ms->closure);
+
+    /* mark s1 of each susp in multiseq */
+    for (i = 0; i < ms->nchans; i++) {
+        snd_list_type snd_list = ms->chans[i];
+        if (snd_list) {
+            while (snd_list->block != NULL) {
+                if (snd_list == zero_snd_list) break;
+                snd_list = snd_list->u.next;
+            }
+            sound_xlmark(((add_susp_type) snd_list->u.susp)->s1);
+        }
+    }
+}
+
+
+/* snd_make_multiseq -- make a multiseq from an array and a closure */
+/*
+ * NOTE: the resulting array of sounds will not use the normal
+ * SND_get_first and SND_get_next routines to fetch new blocks
+ * because these extend the snd_list of the sound immediately,
+ * and this would confuse multiseq_advance() which has to extend
+ * multiple snd_lists synchronously.  So, we use multiseq_get_next()
+ * instead.
+ */
+LVAL snd_make_multiseq(LVAL s1, LVAL closure)
+{
+    multiseq_type ms;
+    int i;
+    LVAL result;
+
+    xlsave1(result);
+
+    /* allocate multiseq */
+    falloc_generic(ms, multiseq_node, "snd_make_multiseq");
+
+    /* install its array of snd_list_type */
+    if (!vectorp(s1) || getsize(s1) == 0) {
+        ffree_generic(ms, sizeof(multiseq_node), "snd_make_multiseq");
+        xlerror("bad argument type", s1);
+    }
+    ms->nchans = getsize(s1);
+    ms->closure = closure;
+    ms->not_logically_stopped_cnt = 0;
+    ms->low_water = 0.0;
+    ms->horizon = 0.0;
+    falloc_generic_n(ms->chans, snd_list_type, ms->nchans,
+                     "snd_make_multiseq");
+
+    /* allocate sounds to return */
+    result = newvector(ms->nchans);
+
+    /* ms->t0 will be the minimum of all t0's in array */
+    ms->t0 = (getsound(getelement(s1, 0)))->t0;
+
+    /* create sounds to return */
+    for (i = 0; i < ms->nchans; i++) {
+        add_susp_type susp;
+        sound_type snd;
+        falloc_generic(susp, add_susp_node, "snd_make_multiseq(add_susp)");
+        susp->s1 = sound_copy(getsound(getelement(s1, i)));
+        /* we used to only incr this if lsc was UNKNOWN, but
+           that's wrong. Should move this out of the loop now.
+         */
+        if (susp->s1->scale != 1.0) {
+            /* stdputstr("normalizing first sound in a seq\n"); */
+            susp->s1 = snd_make_normalize(susp->s1);
+        }
+
+        ms->not_logically_stopped_cnt++;
+D	nyquist_printf("snd_make_multiseq: not_logically_stopped_cnt %d\n",
+               ms->not_logically_stopped_cnt);
+        susp->s1_cnt = 0;
+        susp->s2 = NULL;
+        susp->s2_cnt = 0;
+        susp->susp.fetch = multiseq_fetch;
+        susp->susp.free = multiseq_free;
+        susp->susp.sr = susp->s1->sr;
+        susp->susp.mark = multiseq_mark;
+        susp->susp.print_tree = multiseq_print_tree;
+        susp->susp.name = "multiseq";
+        susp->susp.t0 = susp->s1->t0;
+        susp->terminate_bits = 0;   /* bits for s1 and s2 termination */
+        susp->terminate_cnt = UNKNOWN;
+        susp->logical_stop_bits = 0;    /* bits for s1 and s2 log. stop */
+        susp->susp.log_stop_cnt = UNKNOWN;
+        susp->logically_stopped = false;
+        susp->started = false;
+        susp->susp.current = 0;
+        susp->multiseq = ms;
+        snd = sound_create((snd_susp_type) susp, susp->s1->t0, susp->susp.sr,
+                           1.0);
+#ifdef GC_DEBUG
+        if (snd == sound_to_watch) {
+            nyquist_printf("watched sound is channel %d\n", i);
+        }
+#endif	
+        setelement(result, i, cvsound(snd));
+        if (snd->list->block || !snd->list->u.susp) {
+            stdputstr("data inconsistency in snd_make_seq\n");
+            EXIT(1);
+        }
+        ms->chans[i] = snd->list;
+D        nyquist_printf("ms->chans[%d] = %p, %p->u.susp = %p\n",
+                i, snd->list, snd->list, snd->list->u.susp);
+        ms->t0 = MIN(ms->t0, susp->s1->t0);
+        ms->sr = susp->s1->sr;	/* assume all samp rates are equal */
+D        nyquist_printf("Multiseq sound[%d]: \n", i);
+D        sound_print_tree(susp->s1);
+    }
+D    nyquist_printf("ms->t0 == %g\n", ms->t0);
+    xlpop();
+    return result;
+}
+
+
+/* note: snd_multiseq is a noop, just call snd_make_multiseq */
+
+void multiseq_free(add_susp_type susp)
+{
+    int i;
+    multiseq_type ms = susp->multiseq;
+    boolean dead = true;
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);  /* probably not necessary */
+    /* tricky part: remove pointer from ms->chans */
+    for (i = 0; i < ms->nchans; i++) {
+        if (ms->chans[i]) {
+            dead = false;
+            /* 
+             * note that ms->chans is still a valid 
+             * pointer (see snd_list_unref)
+             */
+            if (ms->chans[i]->u.susp == (snd_susp_type) susp) {
+                ms->chans[i] = NULL;
+D                nyquist_printf("susp %p freed, ms@%p->chans[%d] = NULL\n",
+                        susp, ms, i);
+            }
+        }
+    }
+
+    /* if last element is freed, free the multiseq struct too */
+    if (dead) {
+        i = sizeof(snd_list_type) * ms->nchans;
+        ffree_generic(ms->chans, i, "multiseq_free");
+        ffree_generic(ms, sizeof(multiseq_node), "multiseq_free(2)");
+    }
+
+    susp->multiseq = NULL;  /* just to be safe */
+    ffree_generic(susp, sizeof(add_susp_node), "multiseq_free(3)");
+}
+
+
+void multiseq_print_tree(add_susp_type susp, int n)
+{
+    int i;
+
+    indent(n);
+    if (!susp->multiseq) {
+        xlfail("internal error: missing multiseq structure");
+    }
+    nyquist_printf("multiseq@%p = [ ", susp->multiseq);
+    for (i = 0; i < susp->multiseq->nchans; i++) {
+        if (susp->multiseq->chans[i]) {
+            nyquist_printf("%p", susp->multiseq->chans[i]->u.susp);
+        } else {
+            stdputstr("NULL");
+        }
+    }
+
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("closure:");
+    stdprint(susp->multiseq->closure);
+
+    indent(n);
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/multiseq.h b/lib-src/libnyquist/nyquist/nyqsrc/multiseq.h
new file mode 100644
index 0000000..921ba24
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/multiseq.h
@@ -0,0 +1,19 @@
+/* this typedef goes here because it is needed by add */
+
+typedef struct multiseq_struct {
+    int			not_logically_stopped_cnt;
+    int			nchans;
+    /* greatest lower bound on logical stop time: */
+    time_type		horizon;
+    /* lowest time corresp to sample count on a snd_list: */
+    time_type	        low_water; 
+    snd_list_type	*chans;
+    time_type		t0;
+    rate_type		sr;
+    LVAL closure;
+} multiseq_node, *multiseq_type;
+
+
+
+LVAL snd_make_multiseq(LVAL s1, LVAL closure);
+    /* LISP: (SND-MULTISEQ ANY ANY) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.c b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.c
new file mode 100644
index 0000000..00e7f65
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.c
@@ -0,0 +1,199 @@
+/*
+ * nfilterkit.c - windowed low-pass filter support.
+ *  adapted from filterkit.c, by Julius Smith et al., CCRMA, Stanford University
+ *
+
+/*
+ * FilterUp() - Applies a filter to a given sample when up-converting.
+ * FilterUD() - Applies a filter to a given sample when up- or down-
+ *                   converting.
+ */
+
+#include "soundstruct.h"
+#include "nresample.h"
+#include "nfilterkit.h"
+
+/* #include <libc.h> */
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+
+#include <math.h>
+
+fast_float FilterUp(float Imp[], float ImpD[], 
+                     UHWORD Nwing, BOOL Interp,
+                     float *Xp, double Ph, HWORD Inc)
+{
+    float *Hp, *Hdp = NULL, *End;
+    fast_float a = 0;
+    fast_float v, t;
+    double exact_index = Ph * Npc;
+    long index = exact_index; /* convert fraction to filter index */
+
+/*	printf("FilterUp, Inc %d, phase %g\n", Inc, Ph);  */
+    v=0;
+    Hp = &Imp[index];
+    End = &Imp[Nwing];
+    if (Interp) {
+        Hdp = &ImpD[index];
+        a = exact_index - index;
+/*	printf("fraction %g\n", a); */
+    }
+    if (Inc == 1)		/* If doing right wing...              */
+    {				/* ...drop extra coeff, so when Ph is  */
+        End--;			/*    0.5, we don't do too many mult's */
+        if (Ph == 0)		/* If the phase is zero...           */
+        {			/* ...then we've already skipped the */
+            printf("Ph == 0\n");
+            Hp += Npc;		/*    first sample, so we must also  */
+            Hdp += Npc;		/*    skip ahead in Imp[] and ImpD[] */
+        }
+    }
+    if (Interp) {
+      while (Hp < End) {
+          t = *Hp;		/* Get filter coeff */
+        /*  t scaled by 2^(16 + NLpScl)/LpScl */
+/*	printf("coeff %g ", t);  */
+          t += *Hdp *a;	 /* t is now interp'd filter coeff */
+/*	printf("interp'd coeff %g ", t);*/
+          Hdp += Npc;		/* Filter coeff differences step */
+/*	printf("input sample %g ", *Xp);  */
+          t *= *Xp;		/* Mult coeff by input sample */
+        /*  t scaled by 2^(16 + NLpScl)/LpScl */
+/*	printf("product %g\n", t); */
+          v += t;			/* The filter output */
+          Hp += Npc;		/* Filter coeff step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      } 
+    } else {
+      while (Hp < End) {
+          t = *Hp;		/* Get filter coeff */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Hp += Npc;		/* Filter coeff step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      }
+    }
+/*	printf("FilterUp, Inc %d returns %g\n", Inc, v); */
+    return(v);
+}
+
+fast_float FilterUD( float Imp[], float ImpD[],
+                     UHWORD Nwing, BOOL Interp,
+                     float *Xp, double Ph, HWORD Inc, double dhb)
+{
+    double a;
+    float *Hp, *Hdp, *End;
+    fast_float v, t;
+    double Ho;
+    
+    v=0;
+    Ho = Ph*dhb;
+    End = &Imp[Nwing];
+    if (Inc == 1)		/* If doing right wing...              */
+    {				/* ...drop extra coeff, so when Ph is  */
+        End--;			/*    0.5, we don't do too many mult's */
+        if (Ph == 0)		/* If the phase is zero...           */
+          Ho += dhb;		/* ...then we've already skipped the */
+    }				/*    first sample, so we must also  */
+                                /*    skip ahead in Imp[] and ImpD[] */
+    if (Interp) {
+      long HoIndex = Ho;
+      while ((Hp = &Imp[HoIndex]) < End) {
+          t = *Hp;		/* Get IR sample */
+          Hdp = &ImpD[HoIndex];  /* get interp (lower Na) bits from diff table*/
+          a = Ho - HoIndex;	/* a is logically between 0 and 1 */
+          t += *Hdp * a; /* t is now interp'd filter coeff */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Ho += dhb;		/* IR step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+          HoIndex = Ho;
+      }
+    } else {
+      long HoIndex = Ho;
+      while ((Hp = &Imp[HoIndex]) < End) {
+          t = *Hp;		/* Get IR sample */
+          t *= *Xp;		/* Mult coeff by input sample */
+          v += t;			/* The filter output */
+          Ho += dhb;		/* IR step */
+          Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+          HoIndex = Ho;
+      }
+    }
+    return(v);
+}
+
+/* Sampling rate up-conversion only subroutine;
+ * Slightly faster than down-conversion;
+ */
+static int SrcUp(float X[], float Y[], double factor, double *Time,
+                 UHWORD Nx, UHWORD Nwing, double LpScl,
+                 float Imp[], float ImpD[], BOOL Interp)
+{
+    mem_float *Xp, *Ystart;
+    fast_float v;
+    
+    double dt;                  /* Step through input signal */ 
+    double endTime;             /* When Time reaches EndTime, return to user */
+    
+/*    printf("SrcUp: interpFilt %d\n", Interp);*/
+
+    dt = 1.0/factor;            /* Output sampling period */
+    
+    Ystart = Y;
+    endTime = *Time + Nx;
+    while (*Time < endTime)
+    {
+        long iTime = *Time;
+        Xp = &X[iTime];      /* Ptr to current input sample */
+        /* Perform left-wing inner product */
+        v = FilterUp(Imp, ImpD, Nwing, Interp, Xp, *Time - iTime, -1);
+        /* Perform right-wing inner product */
+        v += FilterUp(Imp, ImpD, Nwing, Interp, Xp+1, 
+                      (1 + iTime) - *Time, 1);
+        v *= LpScl;		/* Normalize for unity filter gain */
+/*	printf("SrcUp output sample %g\n", v); */
+        *Y++ = v;
+        *Time += dt;		/* Move to next sample by time increment */
+    }
+    return (Y - Ystart);        /* Return the number of output samples */
+}
+
+
+/* Sampling rate conversion subroutine */
+
+static int SrcUD(float X[], float Y[], double factor, double *Time,
+                 UHWORD Nx, UHWORD Nwing, double LpScl,
+                 float Imp[], float ImpD[], BOOL Interp)
+{
+    mem_float *Xp, *Ystart;
+    fast_float v;
+    
+    double dh;                  /* Step through filter impulse response */
+    double dt;                  /* Step through input signal */
+    double endTime;             /* When Time reaches EndTime, return to user */
+    
+    dt = 1.0/factor;            /* Output sampling period */
+    
+    dh = MIN(Npc, factor*Npc);  /* Filter sampling period */
+    
+    Ystart = Y;
+    endTime = *Time + Nx;
+    while (*Time < endTime)
+    {
+        long iTime = *Time;
+        Xp = &X[iTime];		/* Ptr to current input sample */
+        v = FilterUD(Imp, ImpD, Nwing, Interp, Xp, *Time - iTime,
+                     -1, dh);	/* Perform left-wing inner product */
+        v += FilterUD(Imp, ImpD, Nwing, Interp, Xp+1, (1 + iTime) - *Time,
+                      1, dh);	/* Perform right-wing inner product */
+        v *= LpScl;		/* Normalize for unity filter gain */
+        *Y++ = v;
+        *Time += dt;		/* Move to next sample by time increment */
+    }
+    return (Y - Ystart);        /* Return the number of output samples */
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h
new file mode 100644
index 0000000..b7343e5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h
@@ -0,0 +1,80 @@
+/* nfilterkit.h -- header for adapted version of filterkit */
+
+typedef char           BOOL;
+typedef short          HWORD;
+typedef unsigned short UHWORD;
+typedef int            WORD;
+typedef unsigned int   UWORD;
+
+#define MAX_HWORD (32767)
+#define MIN_HWORD (-32768)
+
+#ifdef DEBUG
+#define INLINE
+#else DEBUG
+/* #define INLINE inline */
+#define INLINE
+#endif DEBUG
+
+/*
+ * FilterUp() - Applies a filter to a given sample when up-converting.
+ * FilterUD() - Applies a filter to a given sample when up- or down-
+ */
+
+/* Conversion constants */
+#define Nhc       8
+#define Np       (Nhc+Na)
+
+/* Description of constants:
+ *
+ * Npc - is the number of look-up values available for the lowpass filter
+ *    between the beginning of its impulse response and the "cutoff time"
+ *    of the filter.  The cutoff time is defined as the reciprocal of the
+ *    lowpass-filter cut off frequence in Hz.  For example, if the
+ *    lowpass filter were a sinc function, Npc would be the index of the
+ *    impulse-response lookup-table corresponding to the first zero-
+ *    crossing of the sinc function.  (The inverse first zero-crossing
+ *    time of a sinc function equals its nominal cutoff frequency in Hz.)
+ *    Npc must be a power of 2 due to the details of the current
+ *    implementation. The default value of 512 is sufficiently high that
+ *    using linear interpolation to fill in between the table entries
+ *    gives approximately 16-bit accuracy in filter coefficients.
+ *
+ * Nhc - is log base 2 of Npc.
+ *
+ * Na - is the number of bits devoted to linear interpolation of the
+ *    filter coefficients.
+ *
+ * Np - is Na + Nhc, the number of bits to the right of the binary point
+ *    in the integer "time" variable. To the left of the point, it indexes
+ *    the input array (X), and to the right, it is interpreted as a number
+ *    between 0 and 1 sample of the input X.  Np must be less than 16 in
+ *    this implementation.
+ *
+ * Nh - is the number of bits in the filter coefficients. The sum of Nh and
+ *    the number of bits in the input data (typically 16) cannot exceed 32.
+ *    Thus Nh should be 16.  The largest filter coefficient should nearly
+ *    fill 16 bits (32767).
+ *
+ * Nb - is the number of bits in the input data. The sum of Nb and Nh cannot
+ *    exceed 32.
+ *
+ * Nhxn - is the number of bits to right shift after multiplying each input
+ *    sample times a filter coefficient. It can be as great as Nh and as
+ *    small as 0. Nhxn = Nh-2 gives 2 guard bits in the multiply-add
+ *    accumulation.  If Nhxn=0, the accumulation will soon overflow 32 bits.
+ *
+ * Nhg - is the number of guard bits in mpy-add accumulation (equal to Nh-Nhxn)
+ *
+ * NLpScl - is the number of bits allocated to the unity-gain normalization
+ *    factor.  The output of the lowpass filter is multiplied by LpScl and
+ *    then right-shifted NLpScl bits. To avoid overflow, we must have 
+ *    Nb+Nhg+NLpScl < 32.
+ */
+
+
+fast_float FilterUp(mem_float Imp[], mem_float ImpD[], UHWORD Nwing, BOOL Interp,
+              mem_float *Xp, double Ph, HWORD Inc);
+
+fast_float FilterUD(mem_float Imp[], mem_float ImpD[], UHWORD Nwing, BOOL Interp,
+              mem_float *Xp, double Ph, HWORD Inc, double dhb);
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c
new file mode 100644
index 0000000..49cc0ae
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c
@@ -0,0 +1,112 @@
+/* nosc-server.c -- an OSC server for Nyquist */
+/*
+ * this enables OSC clients to set slider values in Nyquist
+ * for security reasons, OSC clients cannot invoke Lisp expressions
+ * the only operation allowed is to set a value in a Lisp array
+ *
+ * The API is:
+ *
+ * int nosc_init() -- initialize the server, return error, 0 means none
+ * int nosc_poll() -- poll for messages and process them, return error, 0 means none
+ * void nosc_finish() -- free data structures, return error, 0 means none
+ */
+
+#ifdef OSC
+#ifdef WIN32
+#include <winsock2.h>
+#include <malloc.h>
+#include <process.h>
+#else
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <strings.h>
+#include <unistd.h>
+#include <stdio.h>
+#endif
+#include "xlisp.h"
+#include "sound.h" /* to get nosc_enabled */
+#include "lo/lo.h"
+#include "sliders.h"
+
+static lo_server the_server = NULL;
+static int lo_fd;
+
+static void error(int num, const char *msg, const char *path)
+{
+    char s[256];
+    sprintf(s, "liblo server error %d in path %s: %s\n", num, path, msg);
+    stdputstr(s);
+}
+
+
+static int slider_handler(const char *path, const char *types, lo_arg **argv, 
+			  int argc, void *data, void *user_data)
+{
+    // printf("%s <- %d, %g\n", path, argv[0]->i, argv[1]->f);
+    // fflush(stdout);
+    set_slider(argv[0]->i, argv[1]->f);
+    return 0;
+}
+
+// wii_orientation_handler -- controls sliders 0 and 1 in range [0, 1]
+//    using wii orientation messages from OSC
+static int wii_orientation_handler(const char *path, const char *types, 
+                                   lo_arg **argv, int argc, void *data, 
+                                   void *user_data)
+{
+    set_slider(0, min(1.0F, max(0.0F, (argv[0]->f / 180) + 0.5)));
+    set_slider(1, min(1.0F, max(0.0F, (argv[1]->f / 180) + 0.5)));
+    return 0;
+}
+
+
+int nosc_init()
+{
+    the_server = lo_server_new("7770", error);
+    /* add method that will match the path /slider, with two numbers, coerced
+     * to int and float */
+    lo_server_add_method(the_server, "/slider", "if", slider_handler, NULL);
+    lo_server_add_method(the_server, "/wii/orientation", "ff", 
+                         wii_orientation_handler, NULL);
+    lo_fd = lo_server_get_socket_fd(the_server);
+    nosc_enabled = true;
+    return 0;
+}
+
+
+int nosc_poll()
+{
+    fd_set rfds;
+    struct timeval tv;
+    int retval;
+
+    // loop, receiving all pending OSC messages
+    while (true) {
+        FD_ZERO(&rfds);
+        FD_SET(lo_fd, &rfds);
+	    tv.tv_sec = 0;
+        tv.tv_usec = 0;
+
+        retval = select(lo_fd + 1, &rfds, NULL, NULL, &tv); 
+	    if (retval == -1) {
+            stdputstr("select() error in nosc_poll\n");
+		    return -1;
+        } else if (retval > 0 && FD_ISSET(lo_fd, &rfds)) {
+            /* printf("lo_server_recv_noblock 1\n"); */
+            lo_server_recv_noblock(the_server, 0);
+        } else {
+        	return 0;
+        }
+    }
+}
+
+
+void nosc_finish()
+{
+    lo_server_free(the_server);
+    nosc_enabled = false;
+}
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.h b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.h
new file mode 100644
index 0000000..655c7b5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.h
@@ -0,0 +1,9 @@
+/*
+ *  nyq-osc-server.h
+ *  nyquist
+ *
+ *  Created by Roger Dannenberg on 10/1/06.
+ *  Copyright 2006 __MyCompanyName__. All rights reserved.
+ *
+ */
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nyx.c b/lib-src/libnyquist/nyquist/nyqsrc/nyx.c
new file mode 100644
index 0000000..4cc1fea
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nyx.c
@@ -0,0 +1,1294 @@
+/**********************************************************************
+
+  nyx.c
+
+  Nyx: A very simple external interface to Nyquist
+
+  Dominic Mazzoni
+
+**********************************************************************/
+
+/* system includes */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+/* nyx includes */
+#include "nyx.h"
+
+/* xlisp includes */
+#include "switches.h"
+#include "xlisp.h"
+#include "cext.h"
+
+/* nyquist includes */
+#include "sound.h"
+#include "samples.h"
+#include "falloc.h"
+
+/* use full copy */
+#define NYX_FULL_COPY 1
+
+/* show memory stats */
+// #define NYX_MEMORY_STATS 1
+
+/* show details of obarray copy */
+// #define NYX_DEBUG_COPY 1
+
+/* macro to compute the size of a segment (taken from xldmem.h) */
+#define segsize(n) (sizeof(SEGMENT)+((n)-1)*sizeof(struct node))
+
+/* xldmem external variables */
+extern long nnodes;
+extern long nfree;
+extern long total;
+extern int nsegs;
+extern SEGMENT *segs;
+extern SEGMENT *lastseg;
+extern LVAL fnodes;
+
+/* nyquist externs */
+extern LVAL a_sound;
+extern snd_list_type zero_snd_list;
+
+/* globals */
+LOCAL nyx_os_callback     nyx_os_cb = NULL;
+LOCAL void               *nyx_os_ud;
+LOCAL nyx_output_callback nyx_output_cb;
+LOCAL void               *nyx_output_ud;
+LOCAL int                 nyx_expr_pos;
+LOCAL int                 nyx_expr_len;
+LOCAL const char         *nyx_expr_string;
+LOCAL LVAL                nyx_result;
+LOCAL nyx_rval            nyx_result_type = nyx_error;
+LOCAL XLCONTEXT           nyx_cntxt;
+LOCAL int                 nyx_first_time = 1;
+LOCAL LVAL                nyx_obarray;
+LOCAL FLOTYPE             nyx_warp_stretch;
+
+/* Suspension node */
+typedef struct nyx_susp_struct {
+   snd_susp_node       susp;        // Must be first
+   nyx_audio_callback  callback;
+   void               *userdata;
+   long                len;
+   int                 channel;
+} nyx_susp_node, *nyx_susp_type;
+
+#if defined(NYX_DEBUG_COPY) && NYX_DEBUG_COPY
+static const char *_types_[] = 
+{
+   "FREE_NODE",
+   "SUBR",
+   "FSUBR",
+   "CONS",
+   "SYMBOL",
+   "FIXNUM",
+   "FLONUM",
+   "STRING",
+   "OBJECT",
+   "STREAM",
+   "VECTOR",
+   "CLOSURE",
+   "CHAR",
+   "USTREAM",
+   "EXTERN"
+};
+
+// Dump the contents of the obarray
+LOCAL void nyx_show_obarray()
+{
+   LVAL array = getvalue(obarray);
+   LVAL sym;
+   int i;
+
+   for (i = 0; i < HSIZE; i++) {
+      for (sym = getelement(array, i); sym; sym = cdr(sym)) {
+         LVAL syma = car(sym);
+
+         printf("_sym_ = ");
+         xlprint(getvalue(s_stdout), syma, TRUE);
+
+         if (getvalue(syma)) {
+            printf(" _type_ = %s _val_ = ", _types_[ntype(getvalue(syma))]);
+            xlprint(getvalue(s_stdout), getvalue(syma), TRUE);
+         }
+
+         if (getfunction(syma)) {
+            printf(" _type_ = %s _fun_ = ", _types_[ntype(getfunction(syma))]);
+            xlprint(getvalue(s_stdout), getfunction(syma), TRUE);
+         }
+
+         printf("\n");
+      }
+   }
+}
+#endif
+
+//
+// Free empty segments
+//
+LOCAL void freesegs()
+{
+   SEGMENT *seg;
+   SEGMENT *next;
+
+   // Free up as many nodes as possible
+   gc();
+
+   // Reset free node tracking
+   fnodes = NIL;
+   nfree = 0L;
+
+   // Reset the last segment pointer
+   lastseg = NULL;
+
+   // Scan all segments
+   for (seg = segs; seg != NULL; seg = next) {
+      int n = seg->sg_size;
+      int empty = TRUE;
+      int i;
+      LVAL p;
+
+      // Check this segment for in-use nodes
+      p = &seg->sg_nodes[0];
+      for (i = n; --i >= 0; ++p) {
+         if (ntype(p) != FREE_NODE) {
+            empty = FALSE;
+            break;
+         }
+      }
+
+      // Retain pointer to next segment
+      next = seg->sg_next;
+
+      // Was the current segment empty?
+      if (empty) {
+         // Free the segment;
+         free((void *) seg);
+
+         // Unlink it from the list.  No need to worry about a NULL lastseg
+         // pointer here since the fixnum and char segments will always exist
+         // at the head of the list and they will always have nodes.  So, lastseg
+         // will have been set before we find any empty nodes.
+         lastseg->sg_next = next;
+
+         // Reduce the stats
+         total -= (long) segsize(n);
+         nsegs--;
+         nnodes -= n;
+      }
+      else {
+         // Not empty, so remember this node as the last segment
+         lastseg = seg;
+
+         // Add all of the free nodes in this segment to the free list
+         p = &seg->sg_nodes[0];
+         for (i = n; --i >= 0; ++p) {
+            if (ntype(p) == FREE_NODE) {
+               rplaca(p, NIL);
+               rplacd(p, fnodes);
+               fnodes = p;
+               nfree++;
+            }
+         }
+      }
+   }
+}
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+
+// Copy a node (recursively if appropriate)
+LOCAL LVAL nyx_dup_value(LVAL val)
+{
+   LVAL nval = val;
+
+   // Protect old and new values
+   xlprot1(val);
+   xlprot1(nval);
+
+   // Copy the node
+   if (val != NIL) {
+      switch (ntype(val))
+      {
+         case FIXNUM:
+            nval = cvfixnum(getfixnum(val));
+         break;
+
+         case FLONUM:
+            nval = cvflonum(getflonum(val));
+         break;
+
+         case CHAR:
+            nval = cvchar(getchcode(val));
+         break;
+
+         case STRING:
+            nval = cvstring((char *) getstring(val));
+         break;
+
+         case VECTOR:
+         {
+            int len = getsize(val);
+            int i;
+
+            nval = newvector(len);
+            nval->n_type = ntype(val);
+
+            for (i = 0; i < len; i++) {
+               if (getelement(val, i) == val) {
+                  setelement(nval, i, val);
+               }
+               else {
+                  setelement(nval, i, nyx_dup_value(getelement(val, i)));
+               }
+            }
+         }
+         break;
+
+         case CONS:
+            nval = cons(nyx_dup_value(car(val)), nyx_dup_value(cdr(val)));
+         break;
+
+         case SUBR:
+         case FSUBR:
+            nval = cvsubr(getsubr(val), ntype(val), getoffset(val));
+         break;
+
+         // Symbols should never be copied since their addresses are cached
+         // all over the place.
+         case SYMBOL:
+            nval = val;
+         break;
+
+         // Streams are not copied (although USTREAM could be) and reference
+         // the original value.
+         case USTREAM:
+         case STREAM:
+            nval = val;
+         break;
+
+         // Externals aren't copied because I'm not entirely certain they can be.
+         case EXTERN:
+            nval = val;
+         break;
+
+         // For all other types, just allow them to reference the original
+         // value.  Probably not the right thing to do, but easier.
+         case OBJECT:
+         case CLOSURE:
+         default:
+            nval = val;
+         break;
+      }
+   }
+
+   xlpop();
+   xlpop();
+
+   return nval;
+}
+
+// Make a copy of the original obarray, leaving the original in place
+LOCAL void nyx_save_obarray()
+{
+   LVAL newarray;
+   int i;
+
+   // This provide permanent protection for nyx_obarray as we do not want it
+   // to be garbage-collected.
+   xlprot1(nyx_obarray);
+   nyx_obarray = getvalue(obarray);
+
+   // Create and set the new vector.  This allows us to use xlenter() to
+   // properly add the new symbol.  Probably slower than adding directly,
+   // but guarantees proper hashing.
+   newarray = newvector(HSIZE);
+   setvalue(obarray, newarray);
+
+   // Scan all obarray vectors
+   for (i = 0; i < HSIZE; i++) {
+      LVAL sym;
+
+      // Scan all elements
+      for (sym = getelement(nyx_obarray, i); sym; sym = cdr(sym)) {
+         LVAL syma = car(sym);
+         char *name = (char *) getstring(getpname(syma));
+         LVAL nsym = xlenter(name);
+
+         // Ignore *OBARRAY* since there's no need to copy it
+         if (strcmp(name, "*OBARRAY*") == 0) {
+            continue;
+         }
+
+         // Duplicate the symbol's values
+         setvalue(nsym, nyx_dup_value(getvalue(syma)));
+         setplist(nsym, nyx_dup_value(getplist(syma)));
+         setfunction(nsym, nyx_dup_value(getfunction(syma)));
+      }
+   }
+
+   // Swap the obarrays, so that the original is put back into service
+   setvalue(obarray, nyx_obarray);
+   nyx_obarray = newarray;
+}
+
+// Restore the symbol values to their original value and remove any added
+// symbols.
+LOCAL void nyx_restore_obarray()
+{
+   LVAL obvec = getvalue(obarray);
+   int i;
+
+   // Scan all obarray vectors
+   for (i = 0; i < HSIZE; i++) {
+      LVAL last = NULL;
+      LVAL dcon;
+
+      for (dcon = getelement(obvec, i); dcon; dcon = cdr(dcon)) {
+         LVAL dsym = car(dcon);
+         char *name = (char *)getstring(getpname(dsym));
+         LVAL scon;
+
+         // Ignore *OBARRAY* since setting it causes the input array to be
+         // truncated.
+         if (strcmp(name, "*OBARRAY*") == 0) {
+            continue;
+         }
+
+         // Find the symbol in the original obarray.
+         for (scon = getelement(nyx_obarray, hash(name, HSIZE)); scon; scon = cdr(scon)) {
+            LVAL ssym = car(scon);
+
+            // If found, then set the current symbols value to the original.
+            if (strcmp(name, (char *)getstring(getpname(ssym))) == 0) {
+               setvalue(dsym, nyx_dup_value(getvalue(ssym)));
+               setplist(dsym, nyx_dup_value(getplist(ssym)));
+               setfunction(dsym, nyx_dup_value(getfunction(ssym)));
+               break;
+            }
+         }
+
+         // If we didn't find the symbol in the original obarray, then it must've
+         // been added since and must be removed from the current obarray.
+         if (scon == NULL) {
+            if (last) {
+               rplacd(last, cdr(dcon));
+            }
+            else {
+               setelement(obvec, i, cdr(dcon));
+            }
+         }
+
+         // Must track the last dcon for symbol removal
+         last = dcon;
+      }
+   }
+}
+
+#else
+
+LOCAL LVAL copylist(LVAL from)
+{
+   LVAL nsym;
+   if (from == NULL) {
+      return NULL;
+   }
+
+   return cons(car(from), copylist(cdr(from)));
+}
+
+/* Make a copy of the obarray so that we can erase any
+   changes the user makes to global variables */
+LOCAL void nyx_copy_obarray()
+{
+   LVAL newarray;
+   int i;
+
+   // Create and set the new vector.
+   newarray = newvector(HSIZE);
+   setvalue(obarray, newarray);
+
+   for (i = 0; i < HSIZE; i++) {
+      LVAL from = getelement(nyx_obarray, i);
+      if (from) {
+         setelement(newarray, i, copylist(from));
+      }
+   }
+}
+
+#endif
+
+void nyx_init()
+{
+   if (nyx_first_time) {
+      char *argv[1];
+      argv[0] = "nyquist";
+      xlisp_main_init(1, argv);
+
+      nyx_os_cb = NULL;
+      nyx_output_cb = NULL;
+      
+      nyx_first_time = 0;
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+      // Save a copy of the original obarray's contents.
+      nyx_save_obarray();
+#else
+      // Permanently protect the original obarray value.  This is needed since
+      // it would be unreferenced in the new obarray and would be garbage
+      // collected.  We want to keep it around so we can make copies of it to 
+      // refresh the execution state.
+      xlprot1(nyx_obarray);
+      nyx_obarray = getvalue(obarray);
+#endif
+   }
+
+#if !defined(NYX_FULL_COPY) || !NYX_FULL_COPY
+   // Create a copy of the original obarray
+   nyx_copy_obarray();
+#endif
+
+   // Keep nyx_result from being garbage-collected
+   xlprot1(nyx_result);
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_init\n");
+   xmem();
+#endif
+}
+
+void nyx_cleanup()
+{
+   // Garbage-collect nyx_result
+   xlpop();
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+
+   // Restore the original symbol values
+   nyx_restore_obarray();
+
+#else
+
+   // Restore obarray to original state...but not the values
+   setvalue(obarray, nyx_obarray);
+
+#endif
+
+   // Make sure the sound nodes can be garbage-collected.  Sounds are EXTERN
+   // nodes whose value does not get copied during a full copy of the obarray.
+   setvalue(xlenter("S"), NIL);
+
+   // Free excess memory segments - does a gc()
+   freesegs();
+
+   // No longer need the callbacks
+   nyx_output_cb = NULL;
+   nyx_os_cb = NULL;
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_cleanup\n");
+   xmem();
+#endif
+}
+
+LOCAL void nyx_susp_fetch(register nyx_susp_type susp, snd_list_type snd_list)
+{
+   sample_block_type         out;
+   sample_block_values_type  out_ptr;
+   long                      n;
+   int                       err;
+
+   falloc_sample_block(out, "nyx_susp_fetch");
+   out_ptr = out->samples;
+   snd_list->block = out;
+
+   n = max_sample_block_len;
+   if (susp->susp.current + n > susp->len)
+      n = susp->len - susp->susp.current;
+
+   err = susp->callback(out_ptr, susp->channel,
+                            susp->susp.current, n, 0, susp->userdata);
+   if (err) {
+      // The user canceled or some other error occurred, so we use
+      // xlsignal() to jump back to our error handler.
+      xlsignal(NULL, NULL);
+      // never get here.
+   }
+
+   snd_list->block_len = (short)n;
+   susp->susp.current += n;
+
+   if (n == 0) {
+      /* we didn't read anything, but can't return length zero, so
+         convert snd_list to pointer to zero block */
+      snd_list_terminate(snd_list);
+   }
+   else if (n < max_sample_block_len) {
+      /* should free susp */
+      snd_list_unref(snd_list->u.next);
+      /* if something is in buffer, terminate by pointing to zero block */
+      snd_list->u.next = zero_snd_list;
+   }
+}
+
+LOCAL void nyx_susp_free(nyx_susp_type susp)
+{
+   ffree_generic(susp, sizeof(nyx_susp_node), "nyx_susp_free");
+}
+
+LOCAL void nyx_susp_print_tree(nyx_susp_type susp, int n)
+{
+}
+
+void nyx_capture_output(nyx_output_callback callback, void *userdata)
+{
+   nyx_output_cb = callback;
+   nyx_output_ud = userdata;
+}
+
+void nyx_set_audio_params(double rate, long len)
+{
+   double stretch_len = (len > 0 ? len / rate : 1.0);
+   LVAL warp;
+
+   /* Bind the sample rate to the "*sound-srate*" global */
+   setvalue(xlenter("*SOUND-SRATE*"), cvflonum(rate));
+
+   /* Bind selection len to "len" global */
+   setvalue(xlenter("LEN"), cvflonum(len));
+
+   /* Set the "*warp*" global based on the length of the audio */
+   xlprot1(warp);
+   warp = cons(cvflonum(0),                    /* time offset */
+               cons(cvflonum(stretch_len),     /* time stretch */
+                    cons(NULL,                 /* cont. time warp */
+                         NULL)));
+   setvalue(xlenter("*WARP*"), warp);
+   xlpop();
+}
+
+void nyx_set_input_audio(nyx_audio_callback callback,
+                         void *userdata,
+                         int num_channels,
+                         long len, double rate)
+{
+   sample_type      scale_factor = 1.0;
+   time_type        t0 = 0.0;
+   nyx_susp_type   *susp;
+   sound_type      *snd;
+   int              ch;
+
+   nyx_set_audio_params(rate, len);
+
+   susp = (nyx_susp_type *)malloc(num_channels * sizeof(nyx_susp_type));
+   snd = (sound_type *)malloc(num_channels * sizeof(sound_type));
+
+   for(ch=0; ch < num_channels; ch++) {
+      falloc_generic(susp[ch], nyx_susp_node, "nyx_set_input_audio");
+
+      susp[ch]->callback = callback;
+      susp[ch]->userdata = userdata;
+      susp[ch]->len = len;
+      susp[ch]->channel = ch;
+
+      susp[ch]->susp.fetch = nyx_susp_fetch;
+      susp[ch]->susp.keep_fetch = NULL;
+      susp[ch]->susp.free = nyx_susp_free;
+      susp[ch]->susp.mark = NULL;
+      susp[ch]->susp.print_tree = nyx_susp_print_tree;
+      susp[ch]->susp.name = "nyx";
+      susp[ch]->susp.toss_cnt = 0;
+      susp[ch]->susp.current = 0;
+      susp[ch]->susp.sr = rate;
+      susp[ch]->susp.t0 = t0;
+      susp[ch]->susp.log_stop_cnt = 0;
+      
+      snd[ch] = sound_create((snd_susp_type)susp[ch], t0, 
+                             rate, 
+                             scale_factor);
+   }
+
+   if (num_channels > 1) {
+      LVAL array = newvector(num_channels);
+      for(ch=0; ch<num_channels; ch++)
+         setelement(array, ch, cvsound(snd[ch]));
+
+      setvalue(xlenter("S"), array);
+   }
+   else {
+      LVAL s = cvsound(snd[0]);
+
+      setvalue(xlenter("S"), s);
+   }
+}
+
+LOCAL int nyx_is_labels(LVAL expr)
+{
+   /* make sure that we have a list whose first element is a
+      list of the form (time "label") */
+
+   LVAL label;
+   LVAL first;
+   LVAL second;
+   LVAL third;
+
+   if (expr == NULL) {
+      return 0;
+   }
+
+   while (expr != NULL) {
+      if (!consp(expr))
+         return 0;
+
+      label = car(expr);
+
+      if (!consp(label))
+         return 0;
+
+      first = car(label);
+      if (!(floatp(first) || fixp(first)))
+         return 0;
+
+      if (!consp(cdr(label)))
+         return 0;
+
+      second = car(cdr(label));
+
+      if (floatp(second) || fixp(second)) {
+         if (!consp(cdr(cdr(label))))
+            return 0;
+         third = car(cdr(cdr(label)));
+         if (!(stringp(third)))
+            return 0;
+      }
+      else
+         if (!(stringp(second)))
+            return 0;
+
+      expr = cdr(expr);
+   }
+
+   return 1;
+}
+
+nyx_rval nyx_get_type(LVAL expr)
+{
+   if (nyx_result_type != nyx_error) {
+      return nyx_result_type;
+   }
+
+   nyx_result_type = nyx_error;
+
+   if (expr==NULL) {
+      return nyx_result_type;
+   }
+
+   switch(ntype(expr))
+   {
+      case FIXNUM:
+         nyx_result_type = nyx_int;
+      break;
+         
+      case FLONUM:
+         nyx_result_type = nyx_double;
+      break;
+
+      case STRING:
+         nyx_result_type = nyx_string;
+      break;
+
+      case VECTOR:
+      {
+         /* make sure it's a vector of sounds */
+         int i;
+         nyx_result_type = nyx_audio;
+         for(i=0; i<getsize(expr); i++) {
+            if (!soundp(getelement(expr, i))) {
+               nyx_result_type = nyx_error;
+               break;
+            }
+         }
+      }
+      break;
+
+      case CONS:
+      {
+         /* see if it's a list of time/string pairs representing a
+            label track */
+         if (nyx_is_labels(expr))
+            nyx_result_type = nyx_labels;
+      }
+      break;
+
+      case EXTERN:
+      {
+         if (soundp(expr))
+            nyx_result_type = nyx_audio;
+      }
+      break;
+   } /* switch */
+
+   return nyx_result_type;
+}
+
+nyx_rval nyx_eval_expression(const char *expr_string)
+{
+   LVAL expr = NULL;
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_eval_expression before\n");
+   xmem();
+#endif
+
+   nyx_expr_string = expr_string;
+   nyx_expr_len = strlen(nyx_expr_string);
+   nyx_expr_pos = 0;
+
+   nyx_result = NULL;
+   nyx_result_type = nyx_error;
+
+   xlprot1(expr);
+
+   /* Setup a new context */
+   xlbegin(&nyx_cntxt, CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL|CF_ERROR, s_true);
+
+   /* setup the error return */
+   if (setjmp(nyx_cntxt.c_jmpbuf)) {
+      // If the script is cancelled or some other condition occurs that causes
+      // the script to exit and return to this level, then we don't need to
+      // restore the previous context.
+      goto finish;
+   }
+
+   while(nyx_expr_pos < nyx_expr_len) {
+      expr = NULL;
+
+      /* read an expression */
+      if (!xlread(getvalue(s_stdin), &expr, FALSE))
+         break;
+
+      #if 0
+      /* save the input expression (so the user can refer to it
+         as +, ++, or +++) */
+      xlrdsave(expr);
+      #endif
+      
+      /* evaluate the expression */
+      nyx_result = xleval(expr);
+   }
+
+   xlflush();
+
+   xltoplevel();
+
+ finish:
+
+   xlpop(); /* unprotect expr */
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_eval_expression after\n");
+   xmem();
+#endif
+
+   return nyx_get_type(nyx_result);
+}
+
+int nyx_get_audio_num_channels()
+{
+   if (nyx_get_type(nyx_result) != nyx_audio)
+      return 0;
+
+   if (vectorp(nyx_result))
+      return getsize(nyx_result);
+   else
+      return 1;
+}
+
+int nyx_get_audio(nyx_audio_callback callback, void *userdata)
+{
+   sample_block_type block;
+   sound_type snd;
+   sound_type *snds = NULL;
+   float *buffer = NULL;
+   long bufferlen = 0;
+   long *totals = NULL;
+   long *lens = NULL;
+   long cnt;
+   int result = 0;
+   int num_channels;
+   int ch, i;
+   int success = FALSE;
+
+   if (nyx_get_type(nyx_result) != nyx_audio)
+      return success;
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_get_audio before\n");
+   xmem();
+#endif
+
+   num_channels = nyx_get_audio_num_channels();
+
+   snds = (sound_type *)malloc(num_channels * sizeof(sound_type));
+   if (snds == NULL) {
+      goto finish;
+   }
+
+   totals = (long *)malloc(num_channels * sizeof(long));
+   if (totals == NULL) {
+      goto finish;
+   }
+
+   lens = (long *)malloc(num_channels * sizeof(long));
+   if (lens == NULL) {
+      goto finish;
+   }
+
+   /* Setup a new context */
+   xlbegin(&nyx_cntxt, CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL|CF_ERROR, s_true);
+
+   /* setup the error return */
+   if (setjmp(nyx_cntxt.c_jmpbuf)) {
+      // If the script is cancelled or some other condition occurs that causes
+      // the script to exit and return to this level, then we don't need to
+      // restore the previous context.
+      goto finish;
+   }
+
+   for(ch=0; ch<num_channels; ch++) {
+      if (num_channels == 1)
+         snd = getsound(nyx_result);
+      else
+         snd = getsound(getelement(nyx_result, ch));
+      snds[ch] = snd;
+      totals[ch] = 0;
+      lens[ch] = snd_length(snd, snd->stop);
+   }
+
+   while(result==0) {
+      for(ch=0; ch<num_channels; ch++) {
+         snd = snds[ch];
+         cnt = 0;
+         block = snd->get_next(snd, &cnt);
+         if (block == zero_block || cnt == 0) {
+            result = -1;
+            break;
+         }
+
+         /* copy the data to a temporary buffer and scale it
+            by the appropriate scale factor */
+
+         if (cnt > bufferlen) {
+            if (buffer)
+               free(buffer);
+
+            buffer = (float *)malloc(cnt * sizeof(float));
+            if (buffer == NULL) {
+               goto finish;
+            }
+
+            bufferlen = cnt;
+         }
+
+         memcpy(buffer, block->samples, cnt * sizeof(float));
+
+         for(i=0; i<cnt; i++)
+            buffer[i] *= snd->scale;
+
+         result = callback(buffer, ch,
+                           totals[ch], cnt, lens[ch], userdata);
+
+         if (result != 0) {
+            // The user canceled or some other error occurred, so we use
+            // xlsignal() to jump back to our error handler.
+            xlsignal(NULL, NULL);
+            // never get here.
+         }
+
+         totals[ch] += cnt;
+      }
+   }
+
+   success = TRUE;
+
+   xltoplevel();
+
+ finish:
+
+   gc();
+
+   if (buffer) {
+      free(buffer);
+   }
+
+   if (lens) {
+      free(lens);
+   }
+
+   if (totals) {
+      free(totals);
+   }
+
+   if (snds) {
+      free(snds);
+   }
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_get_audio after\n");
+   xmem();
+#endif
+
+   return success;
+}
+
+int nyx_get_int()
+{
+   if (nyx_get_type(nyx_result) != nyx_int)
+      return -1;
+
+   return getfixnum(nyx_result);
+}
+
+double nyx_get_double()
+{
+   if (nyx_get_type(nyx_result) != nyx_double)
+      return -1.0;
+
+   return getflonum(nyx_result);
+}
+
+const char *nyx_get_string()
+{
+   if (nyx_get_type(nyx_result) != nyx_string)
+      return NULL;
+
+   return (const char *)getstring(nyx_result);
+}
+
+unsigned int nyx_get_num_labels()
+{
+   LVAL s = nyx_result;
+   int count = 0;
+
+   if (nyx_get_type(nyx_result) != nyx_labels)
+      return 0;
+
+   while(s) {
+      count++;
+      s = cdr(s);
+   }
+
+   return count;
+}
+
+void nyx_get_label(unsigned int index,
+                   double *start_time,
+                   double *end_time,
+                   const char **label)
+{
+   LVAL s = nyx_result;
+   LVAL label_expr;
+   LVAL t0_expr;
+   LVAL t1_expr;
+   LVAL str_expr;
+
+   if (nyx_get_type(nyx_result) != nyx_labels)
+      return;
+
+   while(index) {
+      index--;
+      s = cdr(s);
+      if (s == NULL) {
+         // index was larger than number of labels
+         return;
+      }
+   }
+
+   /* We either have (t0 "label") or (t0 t1 "label") */
+
+   label_expr = car(s);
+   t0_expr = car(label_expr);
+   t1_expr = car(cdr(label_expr));
+   if (stringp(t1_expr)) {
+      str_expr = t1_expr;
+      t1_expr = t0_expr;
+   }
+   else
+      str_expr = car(cdr(cdr(label_expr)));
+
+   if (floatp(t0_expr))
+      *start_time = getflonum(t0_expr);
+   else if (fixp(t0_expr))
+      *start_time = (double)getfixnum(t0_expr);
+
+   if (floatp(t1_expr))
+      *end_time = getflonum(t1_expr);
+   else if (fixp(t1_expr))
+      *end_time = (double)getfixnum(t1_expr);
+
+   *label = (const char *)getstring(str_expr);
+}
+
+const char *nyx_get_error_str()
+{
+   return NULL;
+}
+
+void nyx_set_os_callback(nyx_os_callback callback, void *userdata)
+{
+   nyx_os_cb = callback;
+   nyx_os_ud = userdata;
+}
+
+void nyx_stop()
+{
+   xlflush();
+   xltoplevel();
+}
+
+void nyx_break()
+{
+   xlflush();
+   xlbreak("BREAK", s_unbound);
+}
+
+void nyx_continue()
+{
+   xlflush();
+   xlcontinue();
+}
+
+int ostgetc()
+{
+   if (nyx_expr_pos < nyx_expr_len) {
+      fflush(stdout);
+      return (nyx_expr_string[nyx_expr_pos++]);
+   }
+   else if (nyx_expr_pos == nyx_expr_len) {
+      /* Add whitespace at the end so that the parser
+         knows that this is the end of the expression */
+      nyx_expr_pos++;
+      return '\n';
+   }
+   else
+      return EOF;
+}
+
+/* osinit - initialize */
+void osinit(char *banner)
+{
+}
+
+/* osfinish - clean up before returning to the operating system */
+void osfinish(void) 
+{
+}
+
+/* oserror - print an error message */
+void oserror(char *msg)
+{
+   printf("nyx error: %s\n", msg);
+}
+
+long osrand(long n)
+{
+   return (((int) rand()) % n);
+}
+
+/* cd ..
+open - open an ascii file */
+FILE *osaopen(name,mode) char *name,*mode;
+{
+   FILE *fp;
+   fp = fopen(name,mode);
+   return fp;
+}
+
+/* osbopen - open a binary file */
+FILE *osbopen(char *name, char *mode)
+{
+   char bmode[10];
+   FILE *fp;
+   
+   strncpy(bmode, mode, 8);
+   strcat(bmode,"b");
+   fp = fopen(name,bmode);
+   return fp;
+}
+
+/* osclose - close a file */
+int osclose(FILE *fp)
+{
+   return (fclose(fp));
+}
+
+/* osagetc - get a character from an ascii file */
+int osagetc(FILE *fp)
+{
+   return (getc(fp));
+}
+
+/* osaputc - put a character to an ascii file */
+int osaputc(int ch, FILE *fp)
+{
+   return (putc(ch,fp));
+}
+
+/* osoutflush - flush output to a file */
+void osoutflush(FILE *fp) { fflush(fp); }
+
+extern int dbgflg;
+
+/* osbgetc - get a character from a binary file */
+/* int osbgetc(fp) FILE *fp; {return (getc(fp));} */
+#ifndef WIN32  // duplicated in winfun.c, per James Crook, 7/4/2003
+	int osbgetc(FILE *fp)
+	{
+		return (getc(fp));
+	}
+#endif
+
+/* osbputc - put a character to a binary file */
+int osbputc(int ch, FILE *fp)
+{
+   return (putc(ch,fp));
+}
+
+/* ostputc - put a character to the terminal */
+void ostputc(int ch)
+{     
+   oscheck();		/* check for control characters */
+   
+   if (nyx_output_cb)
+      nyx_output_cb(ch, nyx_output_ud);
+   else
+      putchar(((char) ch));
+}
+
+/* ostoutflush - flush output buffer */
+void ostoutflush()
+{
+   if (!nyx_output_cb)
+      fflush(stdout);
+}
+
+/* osflush - flush the terminal input buffer */
+void osflush(void)
+{
+}
+
+/* oscheck - check for control characters during execution */
+void oscheck(void)
+{
+   if (nyx_os_cb) {
+      nyx_os_cb(nyx_os_ud);
+   }
+   /* if they hit control-c:
+      xflush(); xltoplevel(); return;
+   */
+}
+
+/* xsystem - execute a system command */
+#ifndef WIN32  // duplicated in winfun.c, per James Crook, 7/4/2003
+LVAL xsystem()
+{
+   if (moreargs()) {
+      unsigned char *cmd;
+      cmd = (unsigned char *)getstring(xlgastring());
+      fprintf(stderr, "Will not execute system command: %s\n", cmd);
+   }
+   return s_true;
+}
+#endif
+
+#ifndef WIN32
+/* xsetdir -- set current directory of the process */
+LVAL xsetdir()
+{
+   char *dir = (char *)getstring(xlgastring());
+   int result;
+   LVAL cwd = NULL;
+   xllastarg();
+   result = chdir(dir);
+   if (result) {
+      perror("SETDIR");
+   }
+   dir = getcwd(NULL, 1000);
+   if (dir) {
+       cwd = cvstring(dir);
+       free(dir);
+    }
+   return cwd;
+}
+#endif
+
+/* xgetkey - get a key from the keyboard */
+#ifndef WIN32  // duplicated in winfun.c, per James Crook, 7/4/2003
+	LVAL xgetkey() {xllastarg(); return (cvfixnum((FIXTYPE)getchar()));}
+#endif
+
+/* ossymbols - enter os specific symbols */
+#ifndef WIN32  // duplicated in winfun.c, per James Crook, 7/4/2003
+	void ossymbols(void) {}
+#endif
+
+/* xsetupconsole -- used to configure window in Win32 version */
+#ifndef WIN32  // duplicated in winfun.c, per James Crook, 7/4/2003
+	LVAL xsetupconsole() { return NULL; }
+#endif
+
+const char os_pathchar = '/';
+const char os_sepchar = ':';
+
+/* control-C handling */
+void ctcinit()	{}
+
+/* xechoenabled -- set/clear echo_enabled flag (unix only) */
+LVAL xechoenabled() { return NULL; }
+
+/* osdir_list_start -- open a directory listing */
+int osdir_list_start(char *path) { return FALSE; }
+
+/* osdir_list_next -- read the next entry from a directory */
+char *osdir_list_next() { return NULL; }
+
+/* osdir_list_finish -- close an open directory */
+void osdir_list_finish() { return; }
+
+#ifndef WIN32
+/* xget_temp_path -- get a path to create temp files */
+LVAL xget_temp_path()
+{
+   char *tmp = getenv("TMPDIR");
+   if (!tmp || !*tmp) {
+      tmp = getenv("TMP");
+      if (!tmp || !*tmp) {
+         tmp = "/tmp/";
+      }
+   }
+   return cvstring(tmp);
+}
+#endif
+
+#ifndef WIN32
+/* xget_user -- get a string identifying the user, for use in file names */
+LVAL xget_user()
+{
+   char *user = getenv("USER");
+   if (!user || !*user) {
+      user = getenv("USERNAME");
+      if (!user || !*user) {
+         errputstr("Warning: could not get user ID, using 'nyquist'\n");
+         user = "nyquist";
+      }
+   }
+   return cvstring(user);
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nyx.h b/lib-src/libnyquist/nyquist/nyqsrc/nyx.h
new file mode 100644
index 0000000..8dccb99
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/nyx.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+
+  nyx.h
+
+  Nyx: A very simple external interface to Nyquist
+
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#ifndef __NYX__
+#define __NYX__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+   typedef enum {
+      nyx_error,
+      nyx_audio,
+      nyx_int,
+      nyx_double,
+      nyx_string,
+      nyx_labels
+   } nyx_rval;
+   
+   void        nyx_init();
+   void        nyx_cleanup();
+
+   /* should return return 0 for success, -1 for error */
+   typedef int (*nyx_audio_callback)(float *buffer,
+                                     int channel,
+                                     long start, long len,
+                                     void *userdata);
+   
+   void        nyx_set_input_audio(nyx_audio_callback callback,
+                                   void *userdata,
+                                   int num_channels,
+                                   long len, double rate);
+   
+   nyx_rval    nyx_eval_expression(const char *expr);
+   
+   int         nyx_get_audio_num_channels();
+   void        nyx_get_audio(nyx_audio_callback callback,
+                             void *userdata);
+
+   int         nyx_get_int();
+   double      nyx_get_double();
+   const char *nyx_get_string();
+
+   int         nyx_get_num_labels();
+   void        nyx_get_label(int index,
+                             double *time,
+                             const char **label);
+
+   const char *nyx_get_error_str();
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+   
+#endif /* __NYX__ */
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/oldyin.c b/lib-src/libnyquist/nyquist/nyqsrc/oldyin.c
new file mode 100644
index 0000000..43387b1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/oldyin.c
@@ -0,0 +1,466 @@
+/* yin.c -- partial implementation of the YIN algorithm, with some 
+ *   fixes by DM. This code should be replaced with the fall 2002
+ *   intro to computer music implementation project.
+ */
+
+#include "stdio.h"
+#ifdef UNIX
+#include "sys/file.h"
+#endif
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "snd.h"
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "yin.h"
+
+void yin_free();
+
+/* for multiple channel results, one susp is shared by all sounds */
+/* the susp in turn must point back to all sound list tails */
+
+typedef struct yin_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    long blocksize;
+    long stepsize;
+    sample_type *block;
+    float *temp;
+    sample_type *fillptr;
+    sample_type *endptr;
+    snd_list_type chan[2];	/* array of back pointers */
+    long cnt;	/* how many sample frames to read */
+    long m;
+    long middle;
+} yin_susp_node, *yin_susp_type;
+
+
+// Uses cubic interpolation to return the value of x such
+// that the function defined by f(0), f(1), f(2), and f(3)
+// is maximized.
+//
+float CubicMaximize(float y0, float y1, float y2, float y3)
+{
+  // Find coefficients of cubic
+
+  float a, b, c, d;
+  float da, db, dc;
+  float discriminant;
+  float x1, x2;
+  float dda, ddb;
+  
+  a = (float) (y0/-6.0 + y1/2.0 - y2/2.0 + y3/6.0);
+  b = (float) (y0 - 5.0*y1/2.0 + 2.0*y2 - y3/2.0);
+  c = (float) (-11.0*y0/6.0 + 3.0*y1 - 3.0*y2/2.0 + y3/3.0);
+  d = y0;
+
+  // Take derivative
+
+  da = 3*a;
+  db = 2*b;
+  dc = c;
+
+  // Find zeroes of derivative using quadratic equation
+  
+  discriminant = db*db - 4*da*dc;
+  if (discriminant < 0.0)
+    return -1.0; // error
+  
+  x1 = (float) ((-db + sqrt(discriminant)) / (2 * da));
+  x2 = (float) ((-db - sqrt(discriminant)) / (2 * da));
+  
+  // The one which corresponds to a local _maximum_ in the
+  // cubic is the one we want - the one with a negative
+  // second derivative
+  
+  dda = 2*da;
+  ddb = db;
+  
+  if (dda*x1 + ddb < 0)
+    return x1;
+  else
+    return x2;
+}
+
+
+void yin_compute(yin_susp_type susp, float *pitch, float *harmonicity)
+{
+    float *samples = susp->block;
+    int middle = susp->middle;
+    /* int n = middle * 2; */
+    int m = susp->m;
+    float threshold = 0.9F;
+    float *results = susp->temp;
+
+    /* samples is a buffer of samples */
+    /* n is the number of samples, equals twice longest period, must be even */
+    /* m is the shortest period in samples */
+    /* results is an array of size n/2 - m + 1, the number of different lags */
+
+    /* work from the middle of the buffer: */
+    int i, j; /* loop counters */
+    /* how many different lags do we compute? */
+    /* int iterations = middle + 1 - m; */
+    float left_energy = 0;
+    float right_energy = 0;
+    /* for each window, we keep the energy so we can compute the next one */
+    /* incrementally. First, we need to compute the energies for lag m-1: */
+    *pitch = 0;
+    for (i = 0; i < m - 1; i++) {
+        float left = samples[middle - 1 - i];
+        float right = samples[middle + i];
+        left_energy += left * left;
+        right_energy += right * right;
+    }
+    for (i = m; i <= middle; i++) {
+        /* i is the lag and the length of the window */
+        /* compute the energy for left and right */
+        float left, right, energy, a;
+        float harmonic;
+        left = samples[middle - i];
+        left_energy += left * left;
+        right = samples[middle - 1 + i];
+        right_energy += right * right;
+        /*  compute the autocorrelation */
+        a = 0;
+        for (j = 0; j < i; j++) {
+            a += samples[middle - i + j] * samples[middle + j];
+        }
+        energy = left_energy + right_energy;
+        harmonic = (2 * a) / energy;
+        results[i - m] = harmonic;
+    }
+    for (i = m; i <= middle; i++) {
+        if (results[i - m] > threshold) {
+            float f_i = (i - 1) + 
+                CubicMaximize(results[i - m - 1], results[i - m],
+                              results[i - m + 1], results[i - m + 2]);
+            if (f_i < i - m - 1 || f_i > i - m + 2) f_i = (float) i;
+            *pitch = (float) hz_to_step((float) susp->susp.sr / f_i);
+            *harmonicity = results[i - m];
+            break;
+        }
+    }
+}
+
+
+/* yin_fetch - compute F0 and harmonicity using YIN approach.  */
+/*
+ * The pitch (F0) is determined by finding two periods whose
+ * inner product accounts for almost all of the energy. Let X and Y
+ * be adjacent vectors of length N in the sample stream. Then, 
+ *    if 2X*Y > threshold * (X*X + Y*Y)
+ *    then the period is given by N
+ * In the algorithm, we compute different sizes until we find a
+ * peak above threshold. Then, we use cubic interpolation to get
+ * a precise value. If no peak above threshold is found, we return
+ * the first peak. The second channel returns the value 2X*Y/(X*X+Y*Y)
+ * which is refered to as the "harmonicity" -- the amount of energy
+ * accounted for by periodicity.
+ *
+ * Low sample rates are advised because of the high cost of computing
+ * inner products (fast autocorrelation is not used).
+ *
+ * The result is a 2-channel signal running at the requested rate.
+ * The first channel is the estimated pitch, and the second channel
+ * is the harmonicity.
+ *
+ * This code is adopted from multiread, currently the only other
+ * multichannel suspension in Nyquist. Comments from multiread include:
+ * The susp is shared by all channels.  The susp has backpointers
+ * to the tail-most snd_list node of each channel, and it is by
+ * extending the list at these nodes that sounds are read in.
+ * To avoid a circularity, the reference counts on snd_list nodes
+ * do not include the backpointers from this susp.  When a snd_list
+ * node refcount goes to zero, the yin susp's free routine
+ * is called.  This must scan the backpointers to find the node that
+ * has a zero refcount (the free routine is called before the node
+ * is deallocated, so this is safe).  The backpointer is then set
+ * to NULL.  When all backpointers are NULL, the susp itself is
+ * deallocated, because it can only be referenced through the
+ * snd_list nodes to which there are backpointers.
+ */
+void yin_fetch(yin_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo = 0;
+    int n;
+    sample_block_type f0;
+    sample_block_values_type f0_ptr = NULL;
+    sample_block_type harmonicity;
+    sample_block_values_type harmonicity_ptr = NULL;
+
+    register sample_block_values_type s_ptr_reg;
+    register sample_type *fillptr_reg;
+    register sample_type *endptr_reg = susp->endptr;
+
+    if (susp->chan[0]) {
+        falloc_sample_block(f0, "yin_fetch");
+        f0_ptr = f0->samples;
+        /* Since susp->chan[i] exists, we want to append a block of samples.
+         * The block, out, has been allocated.  Before we insert the block,
+         * we must figure out whether to insert a new snd_list_type node for
+         * the block.  Recall that before SND_get_next is called, the last
+         * snd_list_type in the list will have a null block pointer, and the
+         * snd_list_type's susp field points to the suspension (in this case,
+         * susp).  When SND_get_next (in sound.c) is called, it appends a new
+         * snd_list_type and points the previous one to internal_zero_block 
+         * before calling this fetch routine.  On the other hand, since 
+         * SND_get_next is only going to be called on one of the channels, the
+         * other channels will not have had a snd_list_type appended.
+         * SND_get_next does not tell us directly which channel it wants (it
+         * doesn't know), but we can test by looking for a non-null block in the
+         * snd_list_type pointed to by our back-pointers in susp->chan[].  If
+         * the block is null, the channel was untouched by SND_get_next, and
+         * we should append a snd_list_type.  If it is non-null, then it
+         * points to internal_zero_block (the block inserted by SND_get_next)
+         * and a new snd_list_type has already been appended.
+         */
+        /* Before proceeding, it may be that garbage collection ran when we
+         * allocated out, so check again to see if susp->chan[j] is Null:
+         */
+        if (!susp->chan[0]) {
+            ffree_sample_block(f0, "yin_fetch");
+            f0 = NULL; /* make sure we don't free it again */
+            f0_ptr = NULL; /* make sure we don't output f0 samples */
+        } else if (!susp->chan[0]->block) {
+            snd_list_type snd_list = snd_list_create((snd_susp_type) susp);
+            /* Now we have a snd_list to append to the channel, but a very
+             * interesting thing can happen here.  snd_list_create, which
+             * we just called, MAY have invoked the garbage collector, and
+             * the GC MAY have freed all references to this channel, in which
+             * case yin_free(susp) will have been called, and susp->chan[0]
+             * will now be NULL!
+             */
+            if (!susp->chan[0]) {
+                ffree_snd_list(snd_list, "yin_fetch");
+            } else {
+                susp->chan[0]->u.next = snd_list;
+            }
+        }
+        /* see the note above: we don't know if susp->chan still exists */
+        /* Note: We DO know that susp still exists because even if we lost
+         * some channels in a GC, someone is still calling SND_get_next on
+         * some channel.  I suppose that there might be some very pathological
+         * code that could free a global reference to a sound that is in the
+         * midst of being computed, perhaps by doing something bizarre in the
+         * closure that snd_seq activates at the logical stop time of its first
+         * sound, but I haven't thought that one through.
+         */
+        if (susp->chan[0]) {
+            susp->chan[0]->block = f0;
+            /* check some assertions */
+            if (susp->chan[0]->u.next->u.susp != (snd_susp_type) susp) {
+                nyquist_printf("didn't find susp at end of list for chan 0\n");
+            }
+        } else if (f0) { /* we allocated f0, but don't need it anymore due to GC */
+            ffree_sample_block(f0, "yin_fetch");
+            f0_ptr = NULL;
+        }
+    }
+
+    /* Now, repeat for channel 1 (comments omitted) */
+    if (susp->chan[1]) {
+        falloc_sample_block(harmonicity, "yin_fetch");
+        harmonicity_ptr = harmonicity->samples;
+        if (!susp->chan[1]) {
+            ffree_sample_block(harmonicity, "yin_fetch");
+            harmonicity = NULL; /* make sure we don't free it again */
+            harmonicity_ptr = NULL;
+        } else if (!susp->chan[1]->block) {
+            snd_list_type snd_list = snd_list_create((snd_susp_type) susp);
+            if (!susp->chan[1]) {
+                ffree_snd_list(snd_list, "yin_fetch");
+            } else {
+                susp->chan[1]->u.next = snd_list;
+            }
+        }
+        if (susp->chan[1]) {
+            susp->chan[1]->block = harmonicity;
+            if (susp->chan[1]->u.next->u.susp != (snd_susp_type) susp) {
+                nyquist_printf("didn't find susp at end of list for chan 1\n");
+            }
+        } else if (harmonicity) { /* we allocated harmonicity, but don't need it anymore due to GC */
+            ffree_sample_block(harmonicity, "yin_fetch");
+            harmonicity_ptr = NULL;
+        }
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first, compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block */
+        togo = (max_sample_block_len - cnt) * susp->stepsize;
+
+        /* don't run past the s input sample block */
+        susp_check_term_log_samples(s, s_ptr, s_cnt);
+        togo = min(togo, susp->s_cnt);
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo/susp->stepsize) {
+            togo = (susp->terminate_cnt - (susp->susp.current + cnt)) * susp->stepsize;
+            if (togo == 0) break;
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            /* break if to_stop = 0 (we're at the logical stop)
+             * AND cnt > 0 (we're not at the beginning of the output block)
+             */
+            if (to_stop < togo/susp->stepsize) {
+                if (to_stop == 0) {
+                    if (cnt) {
+                        togo = 0;
+                        break;
+                    } else /* keep togo as is: since cnt == 0, we can set
+                            * the logical stop flag on this output block
+                            */
+                        susp->logically_stopped = true;
+                } else /* limit togo so we can start a new block a the LST */
+                    togo = to_stop * susp->stepsize;
+            }
+        }
+        n = togo;
+        s_ptr_reg = susp->s_ptr;
+        fillptr_reg = susp->fillptr;
+        if (n) do { /* the inner sample computation loop */
+            *fillptr_reg++ = *s_ptr_reg++;
+            if (fillptr_reg >= endptr_reg) {
+                float f0;
+                float harmonicity;
+                yin_compute(susp, &f0, &harmonicity);
+                if (f0_ptr) *f0_ptr++ = f0;
+                if (harmonicity_ptr) *harmonicity_ptr++ = harmonicity;
+                cnt++;
+                fillptr_reg -= susp->stepsize;
+            }
+        } while (--n); /* inner loop */
+
+        /* using s_ptr_reg is a bad idea on RS/6000: */
+        susp->s_ptr += togo;
+        susp->fillptr = fillptr_reg;
+        susp_took(s_cnt, togo);
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* yin_fetch */
+
+  
+void yin_mark(yin_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void yin_free(yin_susp_type susp)
+{
+    int j;
+    boolean active = false;
+/*    stdputstr("yin_free: "); */
+
+    for (j = 0; j < 2; j++) {
+        if (susp->chan[j]) {
+            if (susp->chan[j]->refcnt) active = true;
+            else {
+                susp->chan[j] = NULL;
+                /* nyquist_printf("deactivating channel %d\n", j); */
+            }
+        }
+    }
+    if (!active) {
+/*      stdputstr("all channels freed, freeing susp now\n"); */
+        ffree_generic(susp, sizeof(yin_susp_node), "yin_free");
+        sound_unref(susp->s);
+        free(susp->block);
+        free(susp->temp);
+    }
+}
+
+
+void yin_print_tree(yin_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+LVAL snd_make_yin(sound_type s, double low_step, double high_step, long stepsize)
+{
+    LVAL result;
+    int j;
+    register yin_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+
+    falloc_generic(susp, yin_susp_node, "snd_make_yin");
+    susp->susp.fetch = yin_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    
+    /* initialize susp state */
+    susp->susp.free = yin_free;
+    susp->susp.sr = sr / stepsize;
+    susp->susp.t0 = t0;
+    susp->susp.mark = yin_mark;
+    susp->susp.print_tree = yin_print_tree;
+    susp->susp.name = "yin";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->m = (long) (sr / step_to_hz(high_step));
+    if (susp->m < 2) susp->m = 2;
+    /* add 1 to make sure we round up */
+    susp->middle = (long) (sr / step_to_hz(low_step)) + 1;
+    susp->blocksize = susp->middle * 2;
+    susp->stepsize = stepsize;
+    /* blocksize must be at least step size to implement stepping */
+    if (susp->stepsize > susp->blocksize) susp->blocksize = susp->stepsize;
+    susp->block = (sample_type *) malloc(susp->blocksize * sizeof(sample_type));
+    susp->temp = (float *) malloc((susp->middle - susp->m + 1) * sizeof(float));
+    susp->fillptr = susp->block;
+    susp->endptr = susp->block + susp->blocksize;
+
+    xlsave1(result);
+
+    result = newvector(2);      /* create array for F0 and harmonicity */
+    /* create sounds to return */
+    for (j = 0; j < 2; j++) {
+        sound_type snd = sound_create((snd_susp_type)susp, 
+                                      susp->susp.t0, susp->susp.sr, 1.0);
+        LVAL snd_lval = cvsound(snd);
+/*      nyquist_printf("yin_create: sound %d is %x, LVAL %x\n", j, snd, snd_lval); */
+        setelement(result, j, snd_lval);
+        susp->chan[j] = snd->list;
+    }
+    xlpop();
+    return result;
+}
+
+
+LVAL snd_yin(sound_type s, double low_step, double high_step, long stepsize)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_yin(s_copy, low_step, high_step, stepsize);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/oldyin.h b/lib-src/libnyquist/nyquist/nyqsrc/oldyin.h
new file mode 100644
index 0000000..656aa81
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/oldyin.h
@@ -0,0 +1,6 @@
+/* yin.h -- Nyquist code for F0 estimation using YIN approach */
+
+
+LVAL snd_yin(sound_type s, double low_step, double high_step, long stepsize);
+/* LISP: (SND-YIN SOUND ANYNUM ANYNUM FIXNUM) */
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/probe.c b/lib-src/libnyquist/nyquist/nyqsrc/probe.c
new file mode 100644
index 0000000..9a04b4a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/probe.c
@@ -0,0 +1,38 @@
+/* probe.c -- used to test resampling */
+
+#include "stdio.h"
+#include "string.h"
+#include "xlisp.h"
+
+static FILE* probefile = NULL;
+static long line_num = 0;
+
+void probe_init(int readflag)
+{
+    line_num = 0;
+    probefile = fopen("probe.log", (readflag ? "r" : "w"));
+}
+
+
+double probe(char *s, double x)
+{
+    fprintf(probefile, "%s %g\n", s, x);
+    return x;
+}
+
+
+double probe2(char *s, double x)
+{
+    char buf1[100], buf2[100];
+    sprintf(buf1, "%s %g\n", s, x);
+    fgets(buf2, 100, probefile);
+    line_num++;
+    if (strcmp(buf1, buf2)) {
+        nyquist_printf("probe2: difference at line %ld: \n", line_num);
+        nyquist_printf("correct: %s", buf2);
+        nyquist_printf("actual:  %s", buf1);
+        abort();
+    }
+    return x;
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/probe.h b/lib-src/libnyquist/nyquist/nyqsrc/probe.h
new file mode 100644
index 0000000..ca727d6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/probe.h
@@ -0,0 +1,6 @@
+/* probe.h -- used to test resampling */
+
+void probe_init(int readflag);
+double probe(char *s, double x);
+double probe2(char *s, double x);
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/resamp.c b/lib-src/libnyquist/nyquist/nyqsrc/resamp.c
new file mode 100644
index 0000000..e02e344
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/resamp.c
@@ -0,0 +1,348 @@
+/* resamp.c -- resample signal using sinc interpolation */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  min->MIN, max->MAX
+ */
+
+
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "assert.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "resamp.h"
+#include "fresample.h"
+#include "ffilterkit.h"
+#include "fsmallfilter.h"
+
+/* Algorithm:
+   To resample, we convolve a sinc function with the input stream at
+times corresponding to the output samples.  This requires a sliding
+window on the input samples. Since samples are accessed a block at a
+time, the places where the sliding window would span two blocks are
+too tricky for me. Instead of trying to manage the breaks across 
+blocks, I copy the blocks into another buffer (called X).  When the
+sliding window reaches the end of X, the samples at the end of X
+are copied to the beginning of X, the remainder of X is filled with
+new samples, and the computation continues.  The trickiest part of
+all this is keeping all the pointers and phase accumulators correct
+when the sliding window is relocated from the end of X to the 
+beginning.
+    Although there are different ways to do this, I decided that the
+output would always go directly to a Nyquist sample block, so the
+resampling routines (SrcUp and SrcUD) are always called upon to 
+compute max_sample_block_len samples (except that a partial block
+may be computed when the input sound terminates).
+    To compute max_sample_block_len samples, the input buffer needs:
+
+  - max_sample_block_len/factor samples, where factor is the ratio of
+    the new sample rate to the old one. I.e. if upsampling by a factor
+    of 2, the input buffer needs half the samples of the output block
+    size.
+
+  - additional samples the size of the sliding window.  Since the
+    output is taken from the center of the window, we can't take
+    samples from the first or last windowsize/2 samples.
+
+  - to simplify rounding, we throw in some extra samples. This costs
+    only a bit of space and an extra copy for each spare sample.
+
+    The window size is determined by the particular filter used and 
+by factor (the sample rate ratio).  The filter size is Nmult, the 
+number of filter coefficients. When upsampling, this is the window
+size (the filter acts as a reconstruction filter for the additional
+samples).  When downsampling, the filter is stretched by 1/factor
+(the filter acts as an anti-aliasing low-pass filter).
+
+*/
+
+void resample_free();
+
+typedef struct resample_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    float *X;
+    long Xsize;
+    double Time; /* location (offset) in X of next output sample */
+    double LpScl;
+    double factor;
+    sample_type *Imp;
+    sample_type *ImpD;
+    boolean interpFilt;
+    int Nmult;
+    int Nwing;
+    int Xp; /* first free location at end of X */
+    int Xoff; /* number of extra samples at beginning and end of X */
+} resample_susp_node, *resample_susp_type;
+
+/* Sampling rate up-conversion only subroutine;
+ * Slightly faster than down-conversion;
+ */
+static int SrcUp(float X[], float Y[], double factor, double *Time,
+                 int Nx, int Nwing, double LpScl,
+                 float Imp[], float ImpD[], boolean Interp)
+{
+    mem_float *Xp, *Ystart;
+    fast_float v;
+    
+    double dt;                  /* Step through input signal */ 
+    mem_float *Yend;             /* When Y reaches Yend, return to user */
+    
+/*    nyquist_printf("SrcUp: interpFilt %d\n", Interp);*/
+
+    dt = 1.0/factor;            /* Output sampling period */
+    
+    Ystart = Y;
+    Yend = Y + Nx;
+    while (Y < Yend) {
+        long iTime = (long) *Time;
+        Xp = &X[iTime];      /* Ptr to current input sample */
+        /* Perform left-wing inner product */
+        v = FilterUp(Imp, ImpD, Nwing, Interp, Xp, *Time - iTime, -1);
+        /* Perform right-wing inner product */
+        v += FilterUp(Imp, ImpD, Nwing, Interp, Xp+1, 
+                      (1 + iTime) - *Time, 1);
+        v *= LpScl;		/* Normalize for unity filter gain */
+/*	nyquist_printf("SrcUp output sample %g\n", v); */
+        *Y++ = (float) v;
+        *Time += dt;		/* Move to next sample by time increment */
+    }
+    return (Y - Ystart);        /* Return the number of output samples */
+}
+
+
+/* Sampling rate conversion subroutine */
+
+static int SrcUD(float X[], float Y[], double factor, double *Time,
+                 int Nx, int Nwing, double LpScl,
+                 float Imp[], float ImpD[], boolean Interp)
+{
+    mem_float *Xp, *Ystart;
+    fast_float v;
+    
+    double dh;                  /* Step through filter impulse response */
+    double dt;                  /* Step through input signal */
+    mem_float *Yend;             /* When Y reaches Yend, return to user */
+    
+    dt = 1.0/factor;            /* Output sampling period */
+    
+    dh = MIN(Npc, factor*Npc);  /* Filter sampling period */
+    
+    Ystart = Y;
+    Yend = Y + Nx;
+    while (Y < Yend) {
+        long iTime = (long) *Time;
+        Xp = &X[iTime];		/* Ptr to current input sample */
+        v = FilterUD(Imp, ImpD, Nwing, Interp, Xp, *Time - iTime,
+                     -1, dh);	/* Perform left-wing inner product */
+        v += FilterUD(Imp, ImpD, Nwing, Interp, Xp+1, (1 + iTime) - *Time,
+                      1, dh);	/* Perform right-wing inner product */
+        v *= LpScl;		/* Normalize for unity filter gain */
+        *Y++ = (float) v;
+        *Time += dt;		/* Move to next sample by time increment */
+    }
+    return (Y - Ystart);        /* Return the number of output samples */
+}
+
+
+void resample__fetch(register resample_susp_type susp, snd_list_type snd_list)
+{
+    int togo;
+    int n;
+    int Nout;
+    sample_block_type out;
+    /* note that in this fetch routine, out_ptr is used to remember where
+     * to put the "real" output, while X_ptr_reg is used in the inner
+     * loop that copies input samples into X, a buffer
+     */
+    register sample_block_values_type out_ptr;
+    register sample_block_values_type X_ptr_reg;
+
+    register sample_type *s_ptr_reg;
+    falloc_sample_block(out, "resample__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+/* Algorithm:
+    Fetch samples until X (the buffered input) is full. X stores enough
+contiguous samples that a sliding window convolving with the filter
+coefficients can output a full block without sliding beyond the range
+of X. Every time we reenter resample__fetch, we take the remaining
+samples at the end of X, shift them to the beginning, and refill.
+    After X is full, call on SrcUp or SrcUD to compute an output block.
+    The first time resample__fetch is called, the fill pointer Xp will
+point near the beginning of X, indicating that no previously read
+samples need to be shifted from the end of X to the beginning.
+*/
+
+    /* first, shift samples from end of X to beginning if necessary */
+    if (susp->Xp > 2 * susp->Xoff) {
+        int i;
+        int shiftcount = (long) (susp->Time) - susp->Xoff;
+
+/*	nyquist_printf("shift %d from %d to %lx\n", susp->Xsize + susp->Xoff - susp->Xp, susp->Xp - susp->Xoff, susp->X); */
+        for (i = 0; i < susp->Xp - shiftcount; i++) { 
+            susp->X[i] = susp->X[i + shiftcount];
+/*	    if (susp->X[i] == 0.0) nyquist_printf("shifted zero to X[%d]\n", i);*/
+        }
+        susp->Time -= shiftcount;
+        susp->Xp -= shiftcount;
+    }
+
+    while (susp->Xp < susp->Xsize) { /* outer loop */
+        /* read samples from susp->s into X */
+        togo = susp->Xsize - susp->Xp;
+        /* don't run past the s input sample block. If termination or
+         * logical stop info become available, translate to susp->terminate_cnt
+         * and susp->log_stop_cnt.
+         */
+        susp_check_term_log_samples(s, s_ptr, s_cnt);
+        togo = MIN(togo, susp->s_cnt);
+        
+        memcpy(susp->X + susp->Xp, susp->s_ptr, togo * sizeof(sample_type));
+        susp->s_ptr += togo;
+        susp_took(s_cnt, togo);
+        susp->Xp += togo;
+    } /* outer loop */
+
+    /* second, compute samples to output, this is done in one pass because
+     * we have enough data in X
+     */
+
+    /* don't run past terminate time */
+    togo = max_sample_block_len;
+    if (susp->terminate_cnt != UNKNOWN &&
+        susp->terminate_cnt <= susp->susp.current + max_sample_block_len) {
+        togo = susp->terminate_cnt - susp->susp.current;
+    }
+    if (!susp->logically_stopped &&
+        susp->susp.log_stop_cnt != UNKNOWN) {
+        int to_stop = susp->susp.log_stop_cnt - susp->susp.current;
+        assert(to_stop >= 0);
+        if (to_stop < togo) {
+            if (to_stop == 0) susp->logically_stopped = true;
+            else togo = to_stop;
+        }
+    }
+    if (togo == 0) {
+/*	stdputstr("resamp calling snd_list_terminate\n"); */
+        snd_list_terminate(snd_list);
+    } else {
+        if (susp->factor >= 1) { /* SrcUp() is faster if we can use it */
+            Nout = SrcUp(susp->X, out_ptr, susp->factor, &susp->Time, 
+                         togo, susp->Nwing, susp->LpScl, susp->Imp, 
+                         susp->ImpD, susp->interpFilt);
+        } else {
+           Nout = SrcUD(susp->X, out_ptr, susp->factor, &susp->Time, 
+                        togo, susp->Nwing, susp->LpScl, susp->Imp, 
+                        susp->ImpD, susp->interpFilt);
+        }
+        snd_list->block_len = togo;
+        susp->susp.current += togo;
+    }
+#ifdef RESAMPTEST
+    for (n = 0; n < snd_list->block_len; n++) {
+        if (out->samples[n] == 0.0) {
+            nyquist_printf("resamp: zero at samples[%d]\n", n);
+        }
+    }
+#endif
+/*
+    if (susp->logically_stopped) {
+        snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+ */
+} /* resample__fetch */
+
+
+void resample_mark(resample_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void resample_free(resample_susp_type susp)
+{
+    sound_unref(susp->s);
+    free(susp->X);
+    ffree_generic(susp, sizeof(resample_susp_node), "resample_free");
+}
+
+
+void resample_print_tree(resample_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_resample(sound_type s, rate_type sr)
+{
+    register resample_susp_type susp;
+    int i;
+
+    falloc_generic(susp, resample_susp_node, "snd_make_resample");
+    susp->susp.fetch = resample__fetch;
+
+    susp->Nmult = SMALL_FILTER_NMULT;
+    susp->Imp = SMALL_FILTER_IMP;
+    susp->ImpD = SMALL_FILTER_IMPD;
+    /* these scale factors are here because filter coefficients
+     are expressed as integers, and so is SMALL_FILTER_SCALE: */
+    susp->LpScl = SMALL_FILTER_SCALE / 32768.0;
+    susp->LpScl /= 16384.0;
+    /* this is just a fudge factor, is SMALL_FILTER_SCALE  wrong? */
+    susp->LpScl /= 1.0011;
+
+    susp->Nwing = SMALL_FILTER_NWING;
+    susp->factor = sr / s->sr;
+    if (susp->factor < 1) susp->LpScl *= susp->factor;
+
+    /* factor in the scale factor of s, since resample is linear */
+    susp->LpScl *= s->scale;
+
+    susp->terminate_cnt = UNKNOWN;
+    /* initialize susp state */
+    susp->susp.free = resample_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = s->t0;
+    susp->susp.mark = resample_mark;
+    susp->susp.print_tree = resample_print_tree;
+    susp->susp.name = "resample";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->Xoff = (int) (((susp->Nmult + 1) / 2.0) * MAX(1.0, 1.0 / susp->factor) + 10);
+    susp->Xsize = (long) ((max_sample_block_len / susp->factor) + 2 * susp->Xoff);
+    susp->X = calloc(susp->Xsize, sizeof(sample_type));
+    susp->Xp = susp->Xoff;
+    susp->Time = susp->Xoff;
+    susp->interpFilt = true;
+    for (i = 0; i < susp->Xoff; i++) susp->X[i] = 0.0F;
+    
+    return sound_create((snd_susp_type)susp, susp->susp.t0,
+                        susp->susp.sr, 1.0 /* scale factor */);
+}
+
+
+sound_type snd_resample(sound_type s, rate_type sr)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_resample(s_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/resamp.h b/lib-src/libnyquist/nyquist/nyqsrc/resamp.h
new file mode 100644
index 0000000..4f390b8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/resamp.h
@@ -0,0 +1,3 @@
+sound_type snd_make_resample(sound_type s, rate_type sr);
+sound_type snd_resample(sound_type s, rate_type sr);
+    /* LISP: (snd-resample SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/resampv.c b/lib-src/libnyquist/nyquist/nyqsrc/resampv.c
new file mode 100644
index 0000000..67dcf7b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/resampv.c
@@ -0,0 +1,394 @@
+/* resampv.c -- use sinc interpolation to resample at a time-varying sample rate */
+
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  min->MIN, max->MAX
+ */
+
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "resampv.h"
+#include "fresample.h"
+#include "ffilterkit.h"
+#include "fsmallfilter.h"
+#include "assert.h"
+
+
+/* Algorithm:
+ First compute a factor = ratio of new sample rate to original sample rate.
+ We have Time, the offset into X
+ We want Xoff = ((susp->Nmult + 1) / 2.0) * MAX(1.0, 1.0 / factor) + 10
+ samples on either side of Time before we interpolate.
+ If Xoff * 2 > Xsize, then we're in trouble because X is not big enough.
+ Assume this is a pathalogical case, raise the cutoff frequency to
+ reduce Xoff to less than Xsize/2.
+ If Time is too small, then we're in trouble because we've lost the
+ beginning of the buffer. Raise the cutoff frequency until Xoff is
+ less than Time. This should only happen if factor suddenly drops.
+ If Time is too big, we can handle it: shift X down and load X with new
+ samples. When X is shifted by N samples, N is subtracted from Time.
+ To minimize the "Time is too small" case, don't shift too far: leave
+ a cushion of Xoff * 2 samples rather than the usual Xoff.
+
+ Now compute a sample at Time using SrcUD and output it.
+
+ What is Time?
+ Time is the offset into X, so Time is g_of_now - (sum of all X shifts)
+ So, let Time = g_of_now - shift_sum
+ Whenever shift_sum or g_of_now is updated, recompute Time
+
+ To compute the next g_of_now, do a lookup of g at now + 1/sr,
+ using linear interpolation (be sure to do computation with
+ doubles to minimize sampling time jitter).
+
+ */
+
+/* maximum ratio for downsampling (downsampling will still take place,
+ * but the lowest prefilter cutoff frequency will be
+ * (original_sample_rate/2) / MAX_FACTOR_INVERSE
+ */
+#define MAX_FACTOR_INVERSE 64
+
+typedef struct resamplev_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type f;
+    long f_cnt;
+    sample_block_values_type f_ptr;
+
+    sound_type g;
+    long g_cnt;
+    sample_block_values_type g_ptr;
+    double prev_g;	/* data for interpolation: */
+    double next_g;
+    double phase_in_g;
+    double phase_in_g_increment;
+    double g_of_now;
+    
+    float *X;
+    long Xsize;
+    double Time; /* location (offset) in X of next output sample */
+    double shift_sum; /* total amount by which we have shifted X; also, the
+                         sample number of X[0] */
+    double LpScl;
+    double factor_inverse; /* computed at every sample from g */
+    /* this is the amount by which we step through the input signal, so
+       factor_inverse is the output_sample_rate / input_sample_rate, and
+       factor is the input_sample_rate / output_sample_rate. Alternatively,
+       factor is the amount to downsample and
+       factor_inverse is the amount to upsample. */
+    /* double factor; -- computed from factor_inverse */
+    sample_type *Imp;
+    sample_type *ImpD;
+    boolean interpFilt;
+    int Nmult;
+    int Nwing;
+    int Xp; /* first free location at end of X */
+    int Xoff; /* number of extra samples at beginning and end of X */
+} resamplev_susp_node, *resamplev_susp_type;
+
+void resamplev_free();
+void resampv_refill(resamplev_susp_type susp);
+
+/* Sampling rate conversion subroutine
+ * Note that this is not the same as SrcUD in resamp.c!
+ * X[] is the input signal to be resampled,
+ * dt is the ratio of sample rates; when dt=1, the skip size is
+ *    Npc/dt = Npc, where Npc is how many filter coefficients to
+ *    get the cutoff frequency equal to the Nyquist rate. As dt
+ *    gets larger, we step through the filter more slowly, so low-pass
+ *    filtering occurs. As dt gets smaller, it is X[] that limits
+ *    frequency, and we use the filter to interpolate samples (upsample).
+ *    Therefore, dt>1 means downsample, dt<1 means upsample.
+ *    dt is how much we increment Time to compute each output sample.
+ * Time is the offset in samples, including fractional samples, of X
+ * Nwing is the size of one wing of the filter
+ * LpScl is a corrective scale factor to make the gain == 1 or whatever
+ *    (Nyquist uses a gain of 0.95 to minimize clipping when peaks are
+ *    interpolated.)
+ * Imp[] and ImpD[] are the filter coefficient table and table differences
+ *    (for interpolation)
+ * Interp is true to interpolate filter coefficient lookup
+ */
+static float SrcUD(float X[], double dt, double Time,
+                 int Nwing, double LpScl,
+                 float Imp[], float ImpD[], boolean Interp)
+{
+    mem_float *Xp;
+    fast_float v;
+    
+    double dh;           /* Step through filter impulse response */
+    long iTime = (long) Time;
+    
+    dh = MIN(Npc, Npc/dt);  /* Filter sampling period */
+    
+    Xp = &X[iTime];		/* Ptr to current input sample */
+    v = FilterUD(Imp, ImpD, Nwing, Interp, Xp, Time - iTime,
+                 -1, dh);	/* Perform left-wing inner product */
+    v += FilterUD(Imp, ImpD, Nwing, Interp, Xp+1, (1 + iTime) - Time,
+                  1, dh);	/* Perform right-wing inner product */
+    v *= LpScl;		/* Normalize for unity filter gain */
+    return (float) v;
+}
+
+
+void resamplev__fetch(register resamplev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_block_type out;
+    /* note that in this fetch routine, out_ptr is used to remember where
+     * to put the "real" output, while X_ptr_reg is used in the inner
+     * loop that copies input samples into X, a buffer
+     */
+    register sample_block_values_type out_ptr;
+
+    falloc_sample_block(out, "resamplev__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* fetch g until we have points to interpolate */
+        while (susp->phase_in_g >= 1.0) {
+            susp->prev_g = susp->next_g;
+            if (susp->g_cnt == 0) {
+                susp_get_samples(g, g_ptr, g_cnt);
+                if (susp->g->logical_stop_cnt == susp->g->current - susp->g_cnt) {
+                    if (susp->susp.log_stop_cnt == UNKNOWN) {
+                        susp->susp.log_stop_cnt = susp->susp.current + cnt;
+                    }
+                }
+                if (susp->g_ptr == zero_block->samples &&
+                    susp->terminate_cnt == UNKNOWN) {
+                    susp->terminate_cnt = susp->susp.current + cnt;
+                }
+            }
+            susp->next_g = susp_fetch_sample(g, g_ptr, g_cnt);
+            susp->phase_in_g -= 1.0;
+
+            if (susp->next_g < susp->prev_g) {
+                susp->next_g = susp->prev_g; // prevent time from going backward
+            }
+            /* factor_inverse = 1/factor = how many samples of f per
+             * output sample = change-in-g / output-samples-per-g-sample
+             * = change-in-g * phase_in_g_increment
+             */
+            susp->factor_inverse = susp->phase_in_g_increment *
+                                   (susp->next_g - susp->prev_g);
+            if (susp->factor_inverse > MAX_FACTOR_INVERSE)
+                susp->factor_inverse = MAX_FACTOR_INVERSE;
+
+            /* update Xoff, which depends upon factor_inverse: */
+            susp->Xoff = (int) (((susp->Nmult + 1) / 2.0) *
+                         MAX(1.0, susp->factor_inverse)) + 10;
+            if (susp->Xoff * 2 > susp->Xsize) {
+                /* bad because X is not big enough for filter, so we'll
+                 * raise the cutoff frequency as necessary
+                 */
+                susp->factor_inverse = ((susp->Xsize / 2) - 10 ) /
+                  ((susp->Nmult + 1) / 2.0);
+                susp->Xoff = (susp->Xsize / 2) - 2 /* fudge factor */;
+            }
+        }
+        susp->g_of_now = susp->prev_g +
+          susp->phase_in_g * (susp->next_g - susp->prev_g);
+        susp->Time = susp->g_of_now - susp->shift_sum;
+        susp->phase_in_g += susp->phase_in_g_increment;
+
+        /* now we have a position (g_of_now) and a factor */
+        /* See if enough of f is in X */
+        if (susp->Xoff > susp->Time) {
+            /* there are not enough samples before Time in X, so
+             * modify factor_inverse to fix it
+             */
+            susp->factor_inverse = (susp->Time - 10.0) /
+                                   ((susp->Nmult + 1) / 2.0);
+                           
+        } else if ((susp->Xsize - susp->Xoff) < susp->Time) {
+            /* Time is too close to the end of the buffer, slide the samples
+               down. If there's room, leave 2*Xoff samples at beginning of
+             * buffer. Otherwise leave as little as Xoff: */
+            int i, dist, ntime;
+            ntime = susp->Xoff * 2; /* shift Time near to this index in X */
+            dist = ((int) susp->Time) - ntime;
+            if (dist < 1 && (ntime * 2 < susp->Xsize)) {
+                /* not enough room, so leave at least Xoff. */
+                ntime = susp->Xoff;
+                if (susp->Xsize / 2 - ntime > 2) {
+                    /* There is some extra space. Use half to extend ntime, allowing
+                       for a possible increase in Xoff that will require more history;
+                       the other half reduces the amount of buffer copying needed. */
+                    ntime += (susp->Xsize / 2 - ntime) / 2;
+                }
+                dist = ((int) susp->Time) - ntime;
+            }
+            /* shift everything in X by dist, adjust Time etc. */
+            for (i = 0; i < susp->Xsize - dist; i++) { 
+                susp->X[i] = susp->X[i + dist];
+            }
+            susp->Xp -= dist;
+            resampv_refill(susp);
+            susp->shift_sum += dist;
+            susp->Time = susp->g_of_now - susp->shift_sum;
+        }
+
+        /* second, compute a sample to output */
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt == susp->susp.current + cnt) {
+            snd_list->block_len = cnt;
+            if (cnt > 0) {
+                susp->susp.current += cnt;
+                snd_list = snd_list->u.next;
+                snd_list->u.next = snd_list_create(&susp->susp);
+                snd_list->block = internal_zero_block;
+                snd_list_terminate(snd_list);
+            } else {
+                snd_list_terminate(snd_list);
+            }
+            return;
+        } else {
+            double scale = susp->LpScl;
+            float tmp;
+            if (susp->factor_inverse > 1) scale /= susp->factor_inverse;
+            tmp = SrcUD(susp->X, susp->factor_inverse,
+                         susp->Time, susp->Nwing, scale, susp->Imp,
+                         susp->ImpD, susp->interpFilt);
+            *out_ptr++ = tmp;
+        }
+        cnt++;
+    }
+    snd_list->block_len = cnt;
+    susp->susp.current += cnt;
+    assert(cnt > 0);
+} /* resamplev__fetch */
+
+
+void resampv_refill(resamplev_susp_type susp) {
+    int togo, n;
+    register sample_type *f_ptr_reg;
+    register sample_type *X_ptr_reg;
+    
+    while (susp->Xp < susp->Xsize) { /* outer loop */
+
+        /* read samples from susp->f into X */
+        togo = susp->Xsize - susp->Xp;
+
+        /* don't run past the f input sample block: */
+        susp_check_samples(f, f_ptr, f_cnt);
+        togo = MIN(togo, susp->f_cnt);
+
+        n = togo;
+        f_ptr_reg = susp->f_ptr;
+        X_ptr_reg = &(susp->X[susp->Xp]);
+        if (n) do { /* the inner sample computation loop */
+            *X_ptr_reg++ = *f_ptr_reg++;
+        } while (--n); /* inner loop */
+
+        /* using f_ptr_reg is a bad idea on RS/6000: */
+        susp->f_ptr += togo;
+        susp_took(f_cnt, togo);
+        susp->Xp += togo;
+    } /* outer loop */
+}
+
+
+
+void resamplev_mark(resamplev_susp_type susp)
+{
+    sound_xlmark(susp->f);
+    sound_xlmark(susp->g);
+}
+
+
+void resamplev_free(resamplev_susp_type susp)
+{
+    sound_unref(susp->f);
+    sound_unref(susp->g);
+    free(susp->X);
+    ffree_generic(susp, sizeof(resamplev_susp_node), "resamplev_free");
+}
+
+
+void resamplev_print_tree(resamplev_susp_type susp, int n)
+{
+    indent(n);
+    nyquist_printf("f:");
+    sound_print_tree_1(susp->f, n);
+
+    indent(n);
+    nyquist_printf("g:");
+    sound_print_tree_1(susp->g, n);
+}
+
+
+sound_type snd_make_resamplev(sound_type f, rate_type sr, sound_type g)
+{
+    register resamplev_susp_type susp;
+    int i;
+
+    falloc_generic(susp, resamplev_susp_node, "snd_make_resamplev");
+    susp->susp.fetch = resamplev__fetch;
+
+    susp->Nmult = SMALL_FILTER_NMULT;
+    susp->Imp = SMALL_FILTER_IMP;
+    susp->ImpD = SMALL_FILTER_IMPD;
+    susp->LpScl = SMALL_FILTER_SCALE / 32768.0;
+    susp->LpScl /= 16384.0;
+    /* this is just a fudge factor, is SMALL_FILTER_SCALE wrong? */
+    susp->LpScl /= 1.0011;
+    susp->Nwing = SMALL_FILTER_NWING;
+
+    susp->terminate_cnt = UNKNOWN;
+    /* initialize susp state */
+    susp->susp.free = resamplev_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = f->t0;
+    susp->susp.mark = resamplev_mark;
+    susp->susp.print_tree = resamplev_print_tree;
+    susp->susp.name = "resamplev";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(f);
+    susp->susp.current = 0;
+    susp->f = f;
+    susp->f_cnt = 0;
+    susp->g = g;
+    susp->g_cnt = 0;
+    susp->next_g = 0;
+    susp->phase_in_g_increment = g->sr / sr;
+    susp->phase_in_g = 2.0;
+    /* can't use susp->factor because it is unknown and variable */
+    /* assume at most a down-sample by a factor of 2.0 and compute Xoff accordingly */
+    susp->Xoff = (int) (((susp->Nmult + 1) / 2.0) * 2.0) /* MAX(1.0, 1.0 / susp->factor) */ + 10;
+    /* this size is not critical unless it is too small */
+    /* allow the block size plus a buffer of 2*Xoff at both ends for the tails of the filter */
+    susp->Xsize = max_sample_block_len + 4 * susp->Xoff;
+    susp->X = calloc(susp->Xsize, sizeof(sample_type));
+    susp->Xp = susp->Xsize;
+    susp->shift_sum = -susp->Xsize;
+    susp->interpFilt = true;
+    for (i = 0; i < susp->Xoff; i++) susp->X[i] = 0.0F;
+    susp->LpScl *= 0.95; /* reduce probability of clipping */
+    
+    return sound_create((snd_susp_type)susp, susp->susp.t0, susp->susp.sr, 
+                        1.0 /* scale factor */);
+}
+
+
+sound_type snd_resamplev(sound_type f, rate_type sr, sound_type g)
+{
+    sound_type f_copy = sound_copy(f);
+    sound_type g_copy = sound_copy(g);
+    g_copy->scale *= (float) sr;	/* put g_copy in units of samples */
+    return snd_make_resamplev(f_copy, sr, g_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/resampv.h b/lib-src/libnyquist/nyquist/nyqsrc/resampv.h
new file mode 100644
index 0000000..ceec942
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/resampv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_resamplev(sound_type f, rate_type sr, sound_type g);
+sound_type snd_resamplev(sound_type f, rate_type sr, sound_type g);
+    /* LISP: (snd-resamplev SOUND ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/rfftw.h b/lib-src/libnyquist/nyquist/nyqsrc/rfftw.h
new file mode 100644
index 0000000..1d71ec7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/rfftw.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 1997-1999 Massachusetts Institute of Technology
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+/* rfftw.h -- system-wide definitions for rfftw */
+#ifndef RFFTW_H
+#define RFFTW_H
+
+#include <fftw.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif				/* __cplusplus */
+
+/****************************************************************************/
+
+#define RFFTW_V2
+
+typedef fftw_plan rfftw_plan;
+typedef fftwnd_plan rfftwnd_plan;
+
+#define FFTW_REAL_TO_COMPLEX FFTW_FORWARD
+#define FFTW_COMPLEX_TO_REAL FFTW_BACKWARD
+
+extern void rfftw(rfftw_plan plan, int howmany, fftw_real *in, int istride,
+                  int idist, fftw_real *out, int ostride, int odist);
+extern void rfftw_one(rfftw_plan plan, fftw_real *in, fftw_real *out);
+     
+extern rfftw_plan rfftw_create_plan_specific(int n, fftw_direction dir,
+                                            int flags,
+                                            fftw_real *in, int istride,
+                                            fftw_real *out, int ostride);
+
+extern rfftw_plan rfftw_create_plan(int n, fftw_direction dir, int flags);
+extern void rfftw_destroy_plan(rfftw_plan plan);
+
+extern void rfftw_fprint_plan(FILE *f, rfftw_plan p);
+extern void rfftw_print_plan(rfftw_plan p);
+
+extern void rfftw_executor_simple(int n, fftw_real *in,
+                                  fftw_real *out,
+                                  fftw_plan_node *p,
+                                  int istride,
+                                  int ostride);
+
+extern rfftwnd_plan rfftwnd_create_plan_specific(int rank, const int *n,
+                                                fftw_direction dir, int flags,
+                                                fftw_real *in, int istride,
+                                                fftw_real *out, int ostride);
+extern rfftwnd_plan rfftw2d_create_plan_specific(int nx, int ny,
+                                           fftw_direction dir, int flags,
+                                              fftw_real *in, int istride,
+                                            fftw_real *out, int ostride);
+extern rfftwnd_plan rfftw3d_create_plan_specific(int nx, int ny, int nz,
+                                           fftw_direction dir, int flags,
+                                              fftw_real *in, int istride,
+                                            fftw_real *out, int ostride);
+extern rfftwnd_plan rfftwnd_create_plan(int rank, const int *n,
+                                          fftw_direction dir, int flags);
+extern rfftwnd_plan rfftw2d_create_plan(int nx, int ny,
+                                          fftw_direction dir, int flags);
+extern rfftwnd_plan rfftw3d_create_plan(int nx, int ny, int nz,
+                                          fftw_direction dir, int flags);
+extern void rfftwnd_destroy_plan(rfftwnd_plan plan);
+extern void rfftwnd_fprint_plan(FILE *f, rfftwnd_plan plan);
+extern void rfftwnd_print_plan(rfftwnd_plan plan);
+extern void rfftwnd_real_to_complex(rfftwnd_plan p, int howmany,
+                                   fftw_real *in, int istride, int idist,
+                              fftw_complex *out, int ostride, int odist);
+extern void rfftwnd_complex_to_real(rfftwnd_plan p, int howmany,
+                                fftw_complex *in, int istride, int idist,
+                                 fftw_real *out, int ostride, int odist);
+extern void rfftwnd_one_real_to_complex(rfftwnd_plan p,
+                                        fftw_real *in, fftw_complex *out);
+extern void rfftwnd_one_complex_to_real(rfftwnd_plan p,
+                                        fftw_complex *in, fftw_real *out);
+
+/****************************************************************************/
+
+#ifdef __cplusplus
+}                               /* extern "C" */
+#endif                          /* __cplusplus */
+#endif                          /* RFFTW_H */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/samples.c b/lib-src/libnyquist/nyquist/nyqsrc/samples.c
new file mode 100644
index 0000000..4007d5c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/samples.c
@@ -0,0 +1,300 @@
+/* samples.c -- various functions for the Nyquist sound data type */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  min->MIN, max->MAX
+ */
+
+#include <stdio.h>
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "samples.h"
+
+
+LVAL s_next = NULL;
+LVAL s_send;
+
+void samples_symbols()
+{
+    s_next = xlenter(":NEXT");
+    s_send = xlenter("SEND");
+}
+
+/* snd_from_array -- convert lisp array to sound type */
+/**/
+sound_type snd_from_array(double t0, double sr, LVAL array)
+{
+    sound_type result;
+    snd_list_type snd_list;
+    long total = 0;
+
+    if (!vectorp(array)) xlerror("array expected", array);
+
+    result = sound_create(NULL, t0, sr, 1.0);
+    snd_list = result->list;
+    while (total < getsize(array)) {
+        long togo = MIN(getsize(array) - total, max_sample_block_len);
+        sample_block_type block;
+        int i;
+        falloc_sample_block(block, "snd_from_array");
+        snd_list->block = block;
+        for (i = 0; i < togo; i++) {
+            LVAL elem = getelement(array, total + i);
+            sample_type *ptr = block->samples + i;
+            if (fixp(elem)) *ptr = (sample_type) getfixnum(elem);
+            else if (floatp(elem)) *ptr = (sample_type) getflonum(elem);
+            else xlerror("expecting array elem to be number", elem);
+        }
+        total += togo;
+        snd_list->block_len = (short) togo;
+        snd_list->u.next = snd_list_create(NULL);
+        snd_list = snd_list->u.next;
+    }
+    snd_list->block_len = max_sample_block_len;
+    snd_list->block = zero_block;
+    snd_list->logically_stopped = true;
+    snd_list->u.next = zero_snd_list;
+    return result;
+}
+
+
+/* snd_length -- count how many samples are in a sound */
+/**/
+long snd_length(sound_type s, long len)
+{
+    long total = 0;
+    long blocklen;
+
+    s = sound_copy(s);
+    if (len > s->stop) len = s->stop;
+    while (total < len) {
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        if (sampblock == zero_block) break;
+        total += blocklen;
+    }
+    if (total > len) total = len;
+    sound_unref(s);
+    return total;
+}
+
+
+/* snd_maxsamp -- compute the maximum value of samples in s */
+/**/
+double snd_maxsamp(sound_type s)
+{
+    sample_type result = 0.0F;
+    long blocklen;
+    s = sound_copy(s);
+
+    while (true) {
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        long i;
+        sample_block_values_type sbufp = sampblock->samples;
+        if (sampblock == zero_block || blocklen == 0) {
+            break;
+        }
+        for (i = 0; i < blocklen; i++) {
+            register sample_type samp = *sbufp++;
+            if (result < samp) result = samp;
+            else if (result < -samp) result = -samp;
+        }
+    }
+    return (double) (s->scale * result);
+}
+
+
+/* snd_samples -- convert sound (prefix) to lisp array */
+/**/
+LVAL snd_samples(sound_type s, long len)
+{
+    LVAL v;
+    long vx = 0;
+    long blocklen;
+    register double scale_factor = s->scale;
+    len = snd_length(s, len);
+    s = sound_copy(s);
+
+    xlsave1(v);
+    v = newvector(len);
+
+    while (len > 0) {
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        long togo = MIN(blocklen, len);
+        long i;
+        sample_block_values_type sbufp = sampblock->samples;
+        for (i = 0; i < togo; i++) {
+            setelement(v, vx++, cvflonum(*sbufp++ * scale_factor));
+        }
+        len -= togo;
+    }
+    sound_unref(s);
+
+    /* restore the stack */
+    xlpop();
+    return v;
+}
+
+
+/* NOTE: this code does not properly handle start times that do not
+ * correspond to the time of the first actual sample
+ */
+
+/* NOTE: we need some addtional state to keep track of where we are.
+ *  We'll use the extra field of sound_type; first long is length,
+ *  so second field will be the count of how many samples we've read.
+ */
+#define CNT extra[1]
+#define INDEX extra[2]
+#define FIELDS 3
+#define SAMPLES list->block->samples
+
+LVAL snd_fetch(sound_type s)
+{
+    if (!s->extra) { /* this is the first call, so fix up s */
+        s->extra = (long *) malloc(sizeof(long) * FIELDS);
+        s->extra[0] = sizeof(long) * FIELDS;
+        s->CNT = s->INDEX = 0;
+    } else if (s->extra[0] != sizeof(long) * FIELDS) {
+        xlfail("sound in use by another iterator");
+    }
+    if (s->CNT == s->INDEX) {
+        sound_get_next(s, &(s->CNT));
+        s->INDEX = 0;
+    }
+    if (s->SAMPLES == zero_block->samples) {
+        return NULL;
+    }	
+
+    /* logical stop time is ignored by this code -- to fix this,
+     * you would need a way to return the logical stop time to 
+     * the caller.
+     */
+
+    return cvflonum(s->SAMPLES[s->INDEX++] * s->scale);
+} /* snd_fetch */
+
+
+/* snd_fetch_array -- fetch a lisp array of samples */
+/*
+ * storage layout: the extra field points to extra state that we'll use
+ * extra[0] -> length of extra storage
+ * extra[1] -> CNT (number of samples in current block)
+ * extra[2] -> INDEX (current sample index in current block)
+ * extra[3] -> FILLCNT (how many samples in buffer)
+ * extra[4] -> TERMCNT (how many samples until termination)
+ * extra[4 .. 4+len-1] -> samples (stored as floats)
+ * 
+ * Termination details:
+ *   Return NIL when the sound terminates.
+ *   Termination is defined as the point where all original
+ * signal samples have been shifted out of the samples buffer
+ * so that all that's left are zeros from beyond the termination
+ * point.
+ *   Implementation: when termination is discovered, set TERMCNT
+ * to the number of samples to be shifted out. TERMCNT is initially
+ * -1 as a flag that we haven't seen the termination yet. 
+ * Each time samples are shifted, decrement TERMCNT by the shift amount.
+ * When TERMCNT goes to zero, return NULL.
+ */
+/* these macros define entries in extra, more macros are defined above */
+#define FILLCNT extra[3]
+#define TERMCNT extra[4]
+#define OFFSET 5
+
+LVAL snd_fetch_array(sound_type s, long len, long step)
+{
+    long i, maxlen, skip, fillptr;
+    float *samples;
+    LVAL result;
+    
+    if (len < 1) xlfail("len < 1");
+
+    if (!s->extra) { /* this is the first call, so fix up s */
+        s->extra = (long *) malloc(sizeof(long) * (len + OFFSET));
+        s->extra[0] = sizeof(long) * (len + OFFSET);
+        s->CNT = s->INDEX = s->FILLCNT = 0;
+        s->TERMCNT = -1;
+        maxlen = len;
+    } else {
+        maxlen = (s->extra[0] / sizeof(long)) - OFFSET;
+        if (maxlen < 1) xlfail("sound in use by another iterator");
+        if (maxlen < len) xlfail("len grew");
+    }
+    samples = (float *) &(s->extra[OFFSET]);
+    
+    /* step 1: refill buffer with samples */
+    fillptr = s->FILLCNT;
+    while (fillptr < maxlen) {
+        if (s->INDEX == s->CNT) {
+            sound_get_next(s, &(s->CNT));
+            if (s->SAMPLES == zero_block->samples) {
+                if (s->TERMCNT < 0) s->TERMCNT = fillptr;
+            }	
+            s->INDEX = 0;
+        }
+        samples[fillptr++] = s->SAMPLES[s->INDEX++] * s->scale;
+    }
+    s->FILLCNT = fillptr;
+
+    /* it is important to test here AFTER filling the buffer, because
+     * if fillptr WAS 0 when we hit the zero_block, then filling the 
+     * buffer will set TERMCNT to 0.
+     */
+    if (s->TERMCNT == 0) return NULL;
+    
+    /* logical stop time is ignored by this code -- to fix this,
+     * you would need a way to return the logical stop time to 
+     * the caller.
+     */
+
+    /* step 2: construct an array and return it */
+    xlsave1(result);
+    result = newvector(len);
+
+    for (i = 0; i < len; i++) {
+        setelement(result, i, cvflonum(samples[i]));
+    }
+
+    /* step 3: shift samples by step */
+    if (step < 0) xlfail("step < 0");
+    s->FILLCNT -= step;
+    if (s->FILLCNT < 0) s->FILLCNT = 0;
+    for (i = 0; i < s->FILLCNT; i++) {
+        samples[i] = samples[i + step];
+    }
+    
+
+    if (s->TERMCNT >= 0) {
+        s->TERMCNT -= step;
+        if (s->TERMCNT < 0) s->TERMCNT = 0;
+    }
+
+
+    /* step 4: advance in sound to next sample we need
+     *   (only does work if step > size of buffer)
+     */
+    skip = step - maxlen;
+    while (skip > 0) {
+        long remaining = s->CNT - s->INDEX;
+        if (remaining >= skip) {
+            s->INDEX += skip;
+            skip = 0;
+        } else {
+            skip -= remaining;
+            sound_get_next(s, &(s->CNT));
+            s->INDEX = 0;
+        }
+    }
+    
+    /* restore the stack */
+    xlpop();
+    return result;
+} /* snd_fetch_array */
+
+
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/samples.h b/lib-src/libnyquist/nyquist/nyqsrc/samples.h
new file mode 100644
index 0000000..8907241
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/samples.h
@@ -0,0 +1,20 @@
+/* samples.h -- convert sound (prefix) to lisp array */
+
+/* these are used by snd_fromobject and snd_fromarraystream: */
+extern LVAL s_next;
+extern LVAL s_send;
+
+void samples_symbols();
+
+sound_type snd_from_array(double t0, double sr, LVAL array);
+  /* LISP: (SND-FROM-ARRAY ANYNUM ANYNUM ANY) */
+
+LVAL snd_samples(sound_type s, long len); /* LISP: (SND-SAMPLES SOUND FIXNUM) */
+long snd_length(sound_type s, long len); /* LISP: (SND-LENGTH SOUND FIXNUM) */
+
+double snd_maxsamp(sound_type s); /* LISP: (SND-MAXSAMP SOUND) */
+
+LVAL snd_fetch(sound_type s); /* LISP: (SND-FETCH SOUND) */
+
+LVAL snd_fetch_array(sound_type s, long len, long step); 
+  /* LISP: (SND-FETCH-ARRAY SOUND FIXNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqext.c b/lib-src/libnyquist/nyquist/nyqsrc/seqext.c
new file mode 100644
index 0000000..804641a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqext.c
@@ -0,0 +1,92 @@
+/* seqext.c -- seq extensions for xlisp */
+/*
+This file extends xlisp with the data type SEQ, including functions
+to print and free SEQ type objects.
+ */
+
+/* (c) Copyright Carnegie Mellon University 1991, 1994
+ * For a statement of limited permission to use, see Permission.doc
+ */
+
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  portability fix: use %p instead of %lx
+ */
+
+
+#include "stdio.h"
+#include "xlisp.h"
+#include "cext.h"
+#include "userio.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "seq.h"
+#include "moxc.h"
+#include "seqread.h"
+#include "seqext.h"
+#include "extern.h"
+
+LVAL s_seq;
+
+xtype_desc seq_desc;
+
+static void xlseq_print();
+
+void nop() {}
+
+boolean seqp(s)
+  LVAL s;
+{
+    return exttypep(s, s_seq);
+}
+
+
+/* xlseq_free gets called by xlisp when the GC frees a seq object.
+ * seq_free is a macro, so here we make it into a function pointer.
+ */
+static void xlseq_free(sequence)
+seq_type sequence;
+{
+   seq_free(sequence);
+}
+
+
+static void xlseq_print(fptr, sequence)
+  LVAL fptr;
+  seq_type sequence;
+{
+    char s[32];
+    sprintf(s, "#<SEQ:0x%p>", sequence);
+    xlputstr(fptr, s);
+}
+
+static void xlseq_save(fp, sequence)
+  FILE *fp;
+  seq_type sequence;
+{
+    errputstr("xlseq_save called\n");
+}
+
+
+static unsigned char *xlseq_restore(fp)
+  FILE *fp;
+{
+   errputstr("xlseq_restore called\n");
+   return 0;
+}
+
+
+void seqext_init()
+{
+/*    printf("localinit called\n"); */
+    seq_desc = create_desc("SEQ", xlseq_free, xlseq_print, xlseq_save, 
+                           xlseq_restore, NULL);
+    moxcinit(0, (char **) NULL);
+}
+
+
+void seqext_symbols()
+{
+        s_seq = xlenter("SEQ");
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqext.h b/lib-src/libnyquist/nyquist/nyqsrc/seqext.h
new file mode 100644
index 0000000..0727e77
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqext.h
@@ -0,0 +1,14 @@
+/* seqext.h -- header for seq extensions for xlisp */
+
+
+void seqext_init();
+void seqext_symbols();
+boolean seqp();
+
+extern xtype_desc seq_desc;
+extern LVAL s_seq;
+
+#define cvptrbool(v) ((LVAL) ((v) ? s_true : NIL))
+#define cvseq(v)  ((LVAL) ((v) ? cvextern(seq_desc, (void *)(v)) : NIL))
+#define xlgaseq() (testarg(typearg(seqp)))
+#define getseq(x) ((seq_type) getinst(x))
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfn.cl b/lib-src/libnyquist/nyquist/nyqsrc/seqfn.cl
new file mode 100644
index 0000000..2a22761
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfn.cl
@@ -0,0 +1,2 @@
+:nyqsrc:seqfnint :cmt:seqdecls.h :nyqsrc:seqext.h :cmt:seq.h :nyqsrc:seqinterf.h 
+:cmt:seqread.h :cmt:seqmread.h :cmt:seqwrite.h :cmt:seqmwrite.h 
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfn.wcl b/lib-src/libnyquist/nyquist/nyqsrc/seqfn.wcl
new file mode 100644
index 0000000..8f58d02
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfn.wcl
@@ -0,0 +1,2 @@
+nyqsrc\seqfnint cmt\seqdecls.h nyqsrc\seqext.h cmt\seq.h nyqsrc\seqinterf.h 
+cmt\seqread.h cmt\seqmread.h cmt\seqwrite.h cmt\seqmwrite.h 
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c
new file mode 100644
index 0000000..9424097
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c
@@ -0,0 +1,249 @@
+/* nyqsrc/seqfnint.c -- interface to  cmt/seqdecls.h, 
+ * nyqsrc/seqext.h, cmt/seq.h, nyqsrc/seqinterf.h, 
+ * cmt/seqread.h, cmt/seqmread.h, cmt/seqwrite.h, 
+ * cmt/seqmwrite.h */
+
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+
+extern LVAL s_true;
+#define cvboolean(i) ((i) ? s_true : NIL)
+#define testarg2(e) (moreargs() ? (e) : (getflonum(xltoofew())))
+#define xlgaanynum() (floatp(*xlargv) ? getflonum(nextarg()) : \
+    (fixp(*xlargv) ? (double) getfixnum(nextarg()) : \
+        getflonum(xlbadtype(*xlargv))))
+#define getboolean(lval) ((lval) != NIL)
+
+extern LVAL RSLT_sym;
+
+
+#include "seqdecls.h"
+
+#include "seqext.h"
+
+#include "seq.h"
+
+/* xlc_seq_reset -- interface to C routine seq_reset */
+/**/
+LVAL xlc_seq_reset(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+
+    xllastarg();
+    seq_reset(arg1);
+    return NIL;
+}
+
+
+/* xlc_seq_insert_ctrl -- interface to C routine insert_ctrl */
+/**/
+LVAL xlc_seq_insert_ctrl(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    insert_ctrl(arg1, arg2, arg3, arg4, arg5, arg6);
+    return NIL;
+}
+
+
+/* xlc_seq_insert_ramp -- interface to C routine insert_ctrlramp */
+/**/
+LVAL xlc_seq_insert_ramp(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+    long arg7 = getfixnum(xlgafixnum());
+    long arg8 = getfixnum(xlgafixnum());
+    long arg9 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    insert_ctrlramp(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+    return NIL;
+}
+
+
+/* xlc_seq_insert_macctrl -- interface to C routine insert_macctrl */
+/**/
+LVAL xlc_seq_insert_macctrl(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    insert_macctrl(arg1, arg2, arg3, arg4, arg5, arg6);
+    return NIL;
+}
+
+
+/* xlc_seq_insert_note -- interface to C routine insert_note */
+/**/
+LVAL xlc_seq_insert_note(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+    long arg7 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    insert_note(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+    return NIL;
+}
+
+
+/* xlc_seq_copy -- interface to C routine seq_copy */
+/**/
+LVAL xlc_seq_copy(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    seq_type result;
+
+    xllastarg();
+    result = seq_copy(arg1);
+    return cvseq(result);
+}
+
+
+/* xlc_seq_create -- interface to C routine seq_create */
+/**/
+LVAL xlc_seq_create(void)
+{
+    seq_type result;
+
+    xllastarg();
+    result = seq_create();
+    return cvseq(result);
+}
+
+
+#include "seqinterf.h"
+
+/* xlc_seq_next -- interface to C routine seq_next */
+/**/
+LVAL xlc_seq_next(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    boolean result;
+
+    xllastarg();
+    result = seq_next(arg1);
+    return cvboolean(result);
+}
+
+
+/* xlc_seq_get -- interface to C routine seq_get */
+/**/
+LVAL xlc_seq_get(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    long arg2 = 0;
+    long arg3 = 0;
+    long arg4 = 0;
+    long arg5 = 0;
+    long arg6 = 0;
+    long arg7 = 0;
+    long arg8 = 0;
+    LVAL result;
+
+    xllastarg();
+    seq_get(arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8);
+    {	LVAL *next = &getvalue(RSLT_sym);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg2);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg3);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg4);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg5);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg6);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg7);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg8);
+    }
+    result = getvalue(RSLT_sym);
+    return result;
+}
+
+
+#include "seqread.h"
+
+/* xlc_seq_read -- interface to C routine seq_read */
+/**/
+LVAL xlc_seq_read(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    FILE * arg2 = getfile(xlgastream());
+
+    xllastarg();
+    seq_read(arg1, arg2);
+    return NIL;
+}
+
+
+#include "seqmread.h"
+
+/* xlc_seq_read_smf -- interface to C routine seq_read_smf */
+/**/
+LVAL xlc_seq_read_smf(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    FILE * arg2 = getfile(xlgastream());
+
+    xllastarg();
+    seq_read_smf(arg1, arg2);
+    return NIL;
+}
+
+
+#include "seqwrite.h"
+
+/* xlc_seq_write -- interface to C routine seq_write */
+/**/
+LVAL xlc_seq_write(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    FILE * arg2 = getfile(xlgastream());
+    int arg3 = getboolean(xlgetarg());
+
+    xllastarg();
+    seq_write(arg1, arg2, arg3);
+    return NIL;
+}
+
+
+#include "seqmwrite.h"
+
+/* xlc_seq_write_smf -- interface to C routine seq_write_smf */
+/**/
+LVAL xlc_seq_write_smf(void)
+{
+    seq_type arg1 = getseq(xlgaseq());
+    FILE * arg2 = getfile(xlgastream());
+
+    xllastarg();
+    seq_write_smf(arg1, arg2);
+    return NIL;
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.lsp b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.lsp
new file mode 100644
index 0000000..1f7b01b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.lsp
@@ -0,0 +1,31 @@
+
+    (setfn seq-tag first)
+    (setfn seq-time second)
+    (setfn seq-line third)
+    (setfn seq-channel fourth)
+    (defun seq-value1 (e) (nth 4 e))
+    (setfn seq-pitch seq-value1) ; pitch of a note
+    (setfn seq-control seq-value1) ; control number of a control change
+    (setfn seq-program seq-value1) ; program number of a program change
+    (setfn seq-bend seq-value1) ; pitch bend amount
+    (setfn seq-touch seq-value1) ; aftertouch amount
+    (defun seq-value2 (e) (nth 5 e))
+    (setfn seq-velocity seq-value2) ; velocity of a note
+    (setfn seq-value seq-value2) ; value of a control change
+    (defun seq-duration (e) (nth 6 e))
+    
+
+ (setf seq-done-tag 0) 
+
+ (setf seq-other-tag 1) 
+
+ (setf seq-note-tag 2) 
+
+ (setf seq-ctrl-tag 3) 
+
+ (setf seq-prgm-tag 4) 
+
+ (setf seq-touch-tag 5) 
+
+ (setf seq-bend-tag 6) 
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h
new file mode 100644
index 0000000..ba09956
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h
@@ -0,0 +1,13 @@
+extern LVAL xlc_seq_reset(void);
+extern LVAL xlc_seq_insert_ctrl(void);
+extern LVAL xlc_seq_insert_ramp(void);
+extern LVAL xlc_seq_insert_macctrl(void);
+extern LVAL xlc_seq_insert_note(void);
+extern LVAL xlc_seq_copy(void);
+extern LVAL xlc_seq_create(void);
+extern LVAL xlc_seq_next(void);
+extern LVAL xlc_seq_get(void);
+extern LVAL xlc_seq_read(void);
+extern LVAL xlc_seq_read_smf(void);
+extern LVAL xlc_seq_write(void);
+extern LVAL xlc_seq_write_smf(void);
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h
new file mode 100644
index 0000000..9defce5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h
@@ -0,0 +1,13 @@
+  { "SEQ-RESET",  S, xlc_seq_reset}, 
+  { "SEQ-INSERT-CTRL",  S, xlc_seq_insert_ctrl}, 
+  { "SEQ-INSERT-RAMP",  S, xlc_seq_insert_ramp}, 
+  { "SEQ-INSERT-MACCTRL",  S, xlc_seq_insert_macctrl}, 
+  { "SEQ-INSERT-NOTE",  S, xlc_seq_insert_note}, 
+  { "SEQ-COPY",  S, xlc_seq_copy}, 
+  { "SEQ-CREATE",  S, xlc_seq_create}, 
+  { "SEQ-NEXT",  S, xlc_seq_next}, 
+  { "SEQ-GET",  S, xlc_seq_get}, 
+  { "SEQ-READ",  S, xlc_seq_read}, 
+  { "SEQ-READ-SMF",  S, xlc_seq_read_smf}, 
+  { "SEQ-WRITE",  S, xlc_seq_write}, 
+  { "SEQ-WRITE-SMF",  S, xlc_seq_write_smf}, 
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c
new file mode 100644
index 0000000..dc886a0
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c
@@ -0,0 +1,98 @@
+/* seqinterf.c -- interface to sequence data type for XLISP */
+
+#include "switches.h"
+#include "xlisp.h"
+#include "stdio.h"
+#include "cext.h"
+#include "userio.h"
+#include "midifns.h"
+#include "timebase.h"
+#include "moxc.h"
+#include "seq.h"
+#include "seqinterf.h"
+
+/* seq_next -- advance to the next event, return TRUE if found */
+/**/
+boolean seq_next(seq_type seq)
+{
+    if (seq->current) {
+    seq->current = seq->current->next;
+    }
+    return seq->current != NULL;
+}
+
+
+/* seq_get -- get event data for the current event */
+/**/
+void seq_get(seq_type seq, long *eventtype, long *ntime, long *line, long *chan, 
+    long *value1, long *value2, long *dur)
+{
+    event_type ev = seq->current;
+    if (!ev) *eventtype = SEQ_DONE;
+    else if (is_note(ev)) {
+        if (ev->value != NO_PITCH) {
+            *eventtype = SEQ_NOTE;
+            *ntime = ev->ntime;
+            *line = ev->nline;
+            *chan = vc_voice(ev->nvoice);
+            *value1 = ev->value;
+            *value2 = ev->u.note.ndur & 0xFF;
+            *dur = ev->u.note.ndur >> 8;
+        } else {
+            *eventtype = SEQ_OTHER;
+        }
+    } else {
+        *eventtype = SEQ_CTRL;
+        *ntime = ev->ntime;
+        *line = ev->nline;
+        *chan = vc_voice(ev->nvoice);
+        *value2 = ev->value;
+        
+        switch (vc_ctrl(ev->nvoice)) {
+          case PSWITCH_CTRL:
+            *value1 = PORTASWITCH;
+            break;
+          case MODWHEEL_CTRL:
+            *value1 = MODWHEEL;
+            break;
+          case TOUCH_CTRL:
+              *eventtype = SEQ_TOUCH;
+            *value1 = ev->value;
+            break;
+          case VOLUME_CTRL:
+            *value1 = VOLUME;
+            break;
+          case BEND_CTRL:
+              *eventtype = SEQ_BEND;
+            *value1 = ev->value << 6;
+            break;
+          case PROGRAM_CTRL:
+            *eventtype = SEQ_PRGM;
+            *value1 = ev->value + 1;
+            break;
+          case ESC_CTRL:
+            switch (ev->value) {
+              case CALL_VALUE:
+              case CLOCK_VALUE:
+              case MACRO_VALUE:
+              case CTRLRAMP_VALUE:
+              case DEFRAMP_VALUE:
+              case SETI_VALUE:
+                *eventtype = SEQ_OTHER;
+                break;
+              case MACCTRL_VALUE:
+                *value1 = ev->u.macctrl.ctrl_number;
+                *value2 = ev->u.macctrl.value;
+                break;
+              default:
+                xlabort("unexpected ESC_CTRL value\n");
+                break;
+            }
+            break;
+          default:
+            xlabort("unexpected seq data\n");
+            break;
+        }
+    }
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h
new file mode 100644
index 0000000..590ed84
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h
@@ -0,0 +1,37 @@
+/* seqinterf.h -- interface to sequence data type for XLISP */
+
+boolean seq_next(seq_type seq);	/* LISP: (SEQ-NEXT SEQ) */
+void seq_get(seq_type seq, long *eventtype, long *time, long *line, long *chan, 
+    long *value1, long *value2, long *dur);
+    /* LISP: (SEQ-GET SEQ FIXNUM^ FIXNUM^ FIXNUM^ FIXNUM^ FIXNUM^ FIXNUM^ FIXNUM^) */
+/* LISP-SRC:
+    (setfn seq-tag first)
+    (setfn seq-time second)
+    (setfn seq-line third)
+    (setfn seq-channel fourth)
+    (defun seq-value1 (e) (nth 4 e))
+    (setfn seq-pitch seq-value1) ; pitch of a note
+    (setfn seq-control seq-value1) ; control number of a control change
+    (setfn seq-program seq-value1) ; program number of a program change
+    (setfn seq-bend seq-value1) ; pitch bend amount
+    (setfn seq-touch seq-value1) ; aftertouch amount
+    (defun seq-value2 (e) (nth 5 e))
+    (setfn seq-velocity seq-value2) ; velocity of a note
+    (setfn seq-value seq-value2) ; value of a control change
+    (defun seq-duration (e) (nth 6 e))
+    */
+#define SEQ_DONE 0
+/* LISP-SRC: (setf seq-done-tag 0) */
+#define SEQ_OTHER 1
+/* LISP-SRC: (setf seq-other-tag 1) */
+#define SEQ_NOTE 2
+/* LISP-SRC: (setf seq-note-tag 2) */
+#define SEQ_CTRL 3
+/* LISP-SRC: (setf seq-ctrl-tag 3) */
+#define SEQ_PRGM 4
+/* LISP-SRC: (setf seq-prgm-tag 4) */
+#define SEQ_TOUCH 5
+/* LISP-SRC: (setf seq-touch-tag 5) */
+#define SEQ_BEND 6
+/* LISP-SRC: (setf seq-bend-tag 6) */
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sliders.c b/lib-src/libnyquist/nyquist/nyqsrc/sliders.c
new file mode 100644
index 0000000..9e07132
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sliders.c
@@ -0,0 +1,160 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "sliders.h"
+#include "sndsliders.h"
+
+float slider_array[SLIDERS_MAX];
+
+
+void set_slider(int index, float value)
+{
+    if (index >= 0 && index < SLIDERS_MAX) {
+        slider_array[index] = value;
+    }
+}
+
+
+LVAL xslider_read(void)
+{
+    LVAL arg = xlgafixnum();
+    int index = getfixnum(arg);
+    xllastarg();
+    if (index >= 0 && index < SLIDERS_MAX) {
+        return cvflonum(slider_array[index]);
+    }
+    return NIL;
+}
+
+LVAL xosc_enable(void)
+{
+    LVAL arg = xlgetarg();
+    xllastarg();
+#ifdef OSC
+    if (nosc_enabled == !null(arg)) {
+        return arg; /* no change */
+    } else if (null(arg)) { /* nosc_enabled must be true */
+        nosc_finish();
+	return s_true;
+    } else { /* nosc_enabled must be false */
+        nosc_init();
+	return NIL;
+    }
+#else
+    return xlenter("DISABLED");
+#endif    
+}
+
+
+void slider_free();
+
+
+typedef struct slider_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    int index;
+} slider_susp_node, *slider_susp_type;
+
+
+void slider__fetch(register slider_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type c_reg;
+    int limit = ((long) susp->susp.sr) / 50;
+    falloc_sample_block(out, "slider__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* compute no more than 20ms to preserve some interactivity */
+    if (limit < 1) limit = 1;
+    if (limit > max_sample_block_len) limit = max_sample_block_len;
+
+    while (cnt < limit) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block: */
+        togo = limit - cnt;
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo == 0) break;
+        }
+
+        n = togo;
+        c_reg = slider_array[susp->index];
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            *out_ptr_reg++ = c_reg;
+        } while (--n); /* inner loop */
+
+        out_ptr += togo;
+        cnt += togo;
+    } /* outer loop */
+    /* printf("slider %d cnt %d\n", susp->index, cnt); */
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+} /* slider__fetch */
+
+
+void slider_free(slider_susp_type susp)
+{
+    ffree_generic(susp, sizeof(slider_susp_node), "slider_free");
+}
+
+
+void slider_print_tree(slider_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_slider(int index, time_type t0, rate_type sr, time_type d)
+{
+    register slider_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    if (index < 0 || index >= SLIDERS_MAX) {
+        xlerror("slider index out of range", NIL);
+    }
+    falloc_generic(susp, slider_susp_node, "snd_make_slider");
+    susp->susp.fetch = slider__fetch;
+    susp->index = index;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = slider_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = slider_print_tree;
+    susp->susp.name = "slider";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_slider(int index, time_type t0, rate_type sr, time_type d)
+{
+    return snd_make_slider(index, t0, sr, d);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sliders.h b/lib-src/libnyquist/nyquist/nyqsrc/sliders.h
new file mode 100644
index 0000000..6628990
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sliders.h
@@ -0,0 +1,11 @@
+/* sliders.h -- support for graphical sliders in Nyquist IDE */
+
+/* probably these 3 should be elsewhere */
+int nosc_init();
+int nosc_poll();
+void nosc_finish();
+
+#define SLIDERS_MAX 1024
+extern float slider_array[SLIDERS_MAX];
+void set_slider(int index, float value);
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfail.c b/lib-src/libnyquist/nyquist/nyqsrc/sndfail.c
new file mode 100644
index 0000000..35b29cb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfail.c
@@ -0,0 +1,23 @@
+
+#include "stdio.h"
+#include "snd.h"
+#include "stdlib.h"
+#include "xlisp.h"
+#include "string.h"
+
+void snd_fail(char *msg)
+{
+    char *bigger = (char *) malloc(strlen(msg) + 16);
+    if (!bigger) xlfail("no memory");
+    strcpy(bigger, "(snd)");
+    strcat(bigger, msg);
+    xlfail(bigger);
+    // NOTE: there is a memory leak here
+}
+
+
+void snd_warn(char *msg)
+{
+    stdputstr(msg);
+    stdputstr("\n");
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfmt.h b/lib-src/libnyquist/nyquist/nyqsrc/sndfmt.h
new file mode 100644
index 0000000..2434005
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfmt.h
@@ -0,0 +1,118 @@
+/*
+ * sndfmt.h -- format constants for Nyquist programs
+ */
+/*
+ * converted by Roger Dannenberg from snd.h, Jul 08
+ */
+#ifdef SND_H
+error here
+#endif
+#define SND_H
+
+
+/* header formats */
+
+#define SND_HEAD_NONE 0
+/* LISP-SRC: (setf snd-head-none 0) */
+#define SND_HEAD_AIFF 1
+/* LISP-SRC: (setf snd-head-AIFF 1) */
+#define SND_HEAD_IRCAM 2
+/* LISP-SRC: (setf snd-head-IRCAM 2) */
+#define SND_HEAD_NEXT 3
+/* LISP-SRC: (setf snd-head-NeXT 3) */
+#define SND_HEAD_WAVE 4
+/* LISP-SRC: (setf snd-head-Wave 4) */
+#define SND_HEAD_PAF 5
+/* LISP-SRC: (setf snd-head-PAF 5) */
+#define SND_HEAD_SVX 6
+/* LISP-SRC: (setf snd-head-SVX 6) */
+#define SND_HEAD_NIST 7
+/* LISP-SRC: (setf snd-head-NIST 7) */
+#define SND_HEAD_VOC 8
+/* LISP-SRC: (setf snd-head-VOC 8) */
+#define SND_HEAD_W64 9
+/* LISP-SRC: (setf snd-head-W64 9) */
+#define SND_HEAD_MAT4 10
+/* LISP-SRC: (setf snd-head-MAT4 10) */
+#define SND_HEAD_MAT5 11
+/* LISP-SRC: (setf snd-head-MAT5 11) */
+#define SND_HEAD_PVF 12
+/* LISP-SRC: (setf snd-head-PVF 12) */
+#define SND_HEAD_XI 13
+/* LISP-SRC: (setf snd-head-XI 13) */
+#define SND_HEAD_HTK 14
+/* LISP-SRC: (setf snd-head-HTK 14) */
+#define SND_HEAD_SDS 15
+/* LISP-SRC: (setf snd-head-SDS 15) */
+#define SND_HEAD_AVR 16
+/* LISP-SRC: (setf snd-head-AVR 16) */
+#define SND_HEAD_SD2 17
+/* LISP-SRC: (setf snd-head-SD2 17) */
+#define SND_HEAD_FLAC 18
+/* LISP-SRC: (setf snd-head-FLAC 18) */
+#define SND_HEAD_CAF 19
+/* LISP-SRC: (setf snd-head-CAF 19) */
+#define SND_HEAD_RAW 20
+/* LISP-SRC: (setf snd-head-raw 20) */
+#define SND_NUM_HEADS 21
+
+/* bitfields for soundheaders */
+#define SND_HEAD_CHANNELS (1<<0)
+/* LISP-SRC: (setf snd-head-channels 1) */
+#define SND_HEAD_MODE (1<<1)
+/* LISP-SRC: (setf snd-head-mode 2) */
+#define SND_HEAD_BITS (1<<2)
+/* LISP-SRC: (setf snd-head-bits 4) */
+#define SND_HEAD_SRATE (1<<3)
+/* LISP-SRC: (setf snd-head-srate 8) */
+
+/* when returned from lisp, len (samples) is converted to time (seconds) */
+#define SND_HEAD_LEN (1<<4)
+/* LISP-SRC: (setf snd-head-dur 16) */
+
+#define SND_HEAD_LATENCY (1<<5)
+/* LISP-SRC: (setf snd-head-latency 32) */
+#define SND_HEAD_TYPE (1<<6)
+/* LISP-SRC: (setf snd-head-type 64) */
+
+/* modes */
+/* IMA ADPCM */
+#define SND_MODE_ADPCM 0
+/* LISP-SRC: (setf snd-mode-adpcm 0) */
+#define SND_MODE_PCM   1
+/* LISP-SRC: (setf snd-mode-pcm 1) */
+#define SND_MODE_ULAW 2
+/* LISP-SRC: (setf snd-mode-ulaw 2) */
+#define SND_MODE_ALAW  3
+/* LISP-SRC: (setf snd-mode-alaw 3) */
+#define SND_MODE_FLOAT 4
+/* LISP-SRC: (setf snd-mode-float 4) */
+/* unsigned pcm (e.g. Microsoft 8-bit wav format): */
+#define SND_MODE_UPCM 5
+/* LISP-SRC: (setf snd-mode-upcm 5) */
+#define SND_MODE_UNKNOWN 6
+/* LISP-SRC: (setf snd-mode-unknown 6) */
+#define SND_MODE_DOUBLE 7
+/* LISP-SRC: (setf snd-mode-double 7) */
+#define SND_MODE_GSM610 8
+/* LISP-SRC: (setf snd-mode-GSM610 8) */
+#define SND_MODE_DWVW 9
+/* LISP-SRC: (setf snd-mode-DWVW 9) */
+#define SND_MODE_DPCM 10
+/* LISP-SRC: (setf snd-mode-DPCM 10) */
+/* microsoft ADPCM */
+#define SND_MODE_MSADPCM 11
+/* LISP-SRC: (setf snd-mode-msadpcm 11) */
+#define SND_NUM_MODES 12
+
+
+#define SND_LOOP_NONE 0
+#define SND_LOOP_FORWARD 1
+#define SND_LOOP_FORWARD_BACKWARD 2
+
+typedef struct {
+    int mode;
+    long begin;
+    long end;
+} loop_node, *loop_type;
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfn.cl b/lib-src/libnyquist/nyquist/nyqsrc/sndfn.cl
new file mode 100644
index 0000000..f105267
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfn.cl
@@ -0,0 +1,27 @@
+nyqsrc/sndfnint sndfile.h nyqsrc/sndfmt.h nyqsrc/sound.h nyqsrc/add.h   
+	nyqsrc/avg.h nyqsrc/compose.h nyqsrc/convolve.h nyqsrc/downsample.h   
+        tran/fmfb.h tran/fmfbv.h
+	nyqsrc/fft.h nyqsrc/inverse.h nyqsrc/multiseq.h nyqsrc/resamp.h   
+	nyqsrc/resampv.h nyqsrc/samples.h nyqsrc/sndmax.h nyqsrc/sndread.h   
+	nyqsrc/sndseq.h nyqsrc/sndsliders.h nyqsrc/sndwrite.h nyqsrc/yin.h   
+	nyqsrc/trigger.h nyqsrc/lpanal.h tran/abs.h   
+	tran/allpoles.h tran/alpass.h tran/alpasscv.h tran/alpassvv.h   
+	tran/amosc.h tran/areson.h tran/aresonvc.h tran/aresoncv.h   
+	tran/aresonvv.h tran/atone.h tran/atonev.h tran/biquadfilt.h   
+	tran/buzz.h tran/chase.h tran/clip.h tran/congen.h   
+	tran/const.h tran/coterm.h tran/delaycc.h tran/delaycv.h   
+	tran/eqbandvvv.h tran/exp.h tran/follow.h tran/fmosc.h   
+	tran/fromobject.h tran/fromarraystream.h tran/gate.h tran/ifft.h   
+	tran/instrclar.h tran/instrclarall.h tran/instrclarfreq.h tran/instrsax.h   
+	tran/instrsaxall.h tran/instrsaxfreq.h tran/integrate.h tran/log.h   
+	tran/lpreson.h tran/maxv.h tran/offset.h tran/oneshot.h   
+	tran/osc.h tran/partial.h tran/pluck.h tran/prod.h   
+	tran/pwl.h tran/quantize.h tran/recip.h tran/reson.h   
+	tran/resonvc.h tran/resoncv.h tran/resonvv.h tran/sampler.h   
+	tran/scale.h tran/shape.h tran/sine.h tran/siosc.h   
+	tran/slope.h tran/sqrt.h tran/tapf.h tran/tapv.h   
+	tran/tone.h tran/tonev.h tran/upsample.h tran/white.h   
+	tran/stkrev.h tran/stkpitshift.h tran/stkchorus.h tran/instrbow.h   
+	tran/instrbowedfreq.h tran/instrbanded.h tran/instrmandolin.h tran/instrsitar.h   
+	tran/instrmodalbar.h tran/instrflute.h tran/instrflutefreq.h tran/instrfluteall.h 
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfn.wcl b/lib-src/libnyquist/nyquist/nyqsrc/sndfn.wcl
new file mode 100644
index 0000000..cf589f8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfn.wcl
@@ -0,0 +1,26 @@
+nyqsrc\sndfnint ~sndfile.h ~sndfmt.h nyqsrc\sound.h nyqsrc\add.h   
+	nyqsrc\avg.h nyqsrc\compose.h nyqsrc\convolve.h nyqsrc\downsample.h   
+	nyqsrc\fft.h nyqsrc\inverse.h nyqsrc\multiseq.h nyqsrc\resamp.h   
+	nyqsrc\resampv.h nyqsrc\samples.h nyqsrc\sndmax.h nyqsrc\sndread.h   
+	nyqsrc\sndseq.h nyqsrc\sndsliders.h nyqsrc\sndwrite.h nyqsrc\yin.h   
+	nyqsrc\trigger.h nyqsrc\lpanal.h ~nyqsrc\sndheader.h tran\abs.h   
+	tran\allpoles.h tran\alpass.h tran\alpasscv.h tran\alpassvv.h   
+	tran\amosc.h tran\areson.h tran\aresonvc.h tran\aresoncv.h   
+	tran\aresonvv.h tran\atone.h tran\atonev.h tran\biquad.h   
+	tran\buzz.h tran\chase.h tran\clip.h tran\congen.h   
+	tran\const.h tran\coterm.h tran\delaycc.h tran\delaycv.h   
+	tran\eqbandvvv.h tran\exp.h tran\follow.h tran\fmosc.h   
+	tran\fromobject.h tran\fromarraystream.h tran\gate.h tran\ifft.h   
+	tran\instrclar.h tran\instrclarall.h tran\instrclarfreq.h tran\instrsax.h   
+	tran\instrsaxall.h tran\instrsaxfreq.h tran\integrate.h tran\log.h   
+	tran\lpreson.h tran\maxv.h tran\offset.h tran\oneshot.h   
+	tran\osc.h tran\partial.h tran\pluck.h tran\prod.h   
+	tran\pwl.h tran\quantize.h tran\recip.h tran\reson.h   
+	tran\resonvc.h tran\resoncv.h tran\resonvv.h tran\sampler.h   
+	tran\scale.h tran\shape.h tran\sine.h tran\siosc.h   
+	tran\slope.h tran\sqrt.h tran\tapf.h tran\tapv.h   
+	tran\tone.h tran\tonev.h tran\upsample.h tran\white.h   
+	tran\stkrev.h tran\stkpitshift.h tran\stkchorus.h tran\instrbow.h   
+	tran\instrbowedfreq.h tran\instrbanded.h tran\instrmandolin.h tran\instrsitar.h   
+	tran\instrmodalbar.h tran\instrflute.h tran\instrflutefreq.h tran\instrfluteall.h 
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c
new file mode 100644
index 0000000..bc6b1df
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c
@@ -0,0 +1,2212 @@
+/* nyqsrc/sndfnint.c -- interface to  nyqsrc/sndfmt.h, 
+ * nylsf/sndfile.h, nyqsrc/sound.h, nyqsrc/add.h, 
+ * nyqsrc/avg.h, nyqsrc/compose.h, nyqsrc/convolve.h, 
+ * nyqsrc/downsample.h, nyqsrc/fft.h, nyqsrc/inverse.h, 
+ * nyqsrc/multiseq.h, nyqsrc/resamp.h, nyqsrc/resampv.h, 
+ * nyqsrc/samples.h, nyqsrc/sndmax.h, nyqsrc/sndread.h, 
+ * nyqsrc/sndseq.h, nyqsrc/sndsliders.h, nyqsrc/sndwrite.h, 
+ * nyqsrc/yin.h, nyqsrc/nyq-osc-server.h, nyqsrc/trigger.h, 
+ * nyqsrc/lpanal.h, tran/abs.h, tran/allpoles.h, 
+ * tran/alpass.h, tran/alpasscv.h, tran/alpassvv.h, 
+ * tran/amosc.h, tran/areson.h, tran/aresonvc.h, 
+ * tran/aresoncv.h, tran/aresonvv.h, tran/atone.h, 
+ * tran/atonev.h, tran/biquadfilt.h, tran/buzz.h, 
+ * tran/chase.h, tran/clip.h, tran/congen.h, 
+ * tran/const.h, tran/coterm.h, tran/delaycc.h, 
+ * tran/delaycv.h, tran/eqbandvvv.h, tran/exp.h, 
+ * tran/follow.h, tran/fmosc.h, tran/fromobject.h, 
+ * tran/fromarraystream.h, tran/gate.h, tran/ifft.h, 
+ * tran/instrclar.h, tran/instrclarall.h, 
+ * tran/instrclarfreq.h, tran/instrsax.h, 
+ * tran/instrsaxall.h, tran/instrsaxfreq.h, 
+ * tran/integrate.h, tran/log.h, tran/lpreson.h, 
+ * tran/maxv.h, tran/offset.h, tran/oneshot.h, 
+ * tran/osc.h, tran/partial.h, tran/pluck.h, tran/prod.h, 
+ * tran/pwl.h, tran/quantize.h, tran/recip.h, 
+ * tran/reson.h, tran/resonvc.h, tran/resoncv.h, 
+ * tran/resonvv.h, tran/sampler.h, tran/scale.h, 
+ * tran/shape.h, tran/sine.h, tran/siosc.h, tran/slope.h, 
+ * tran/sqrt.h, tran/tapf.h, tran/tapv.h, tran/tone.h, 
+ * tran/tonev.h, tran/upsample.h, tran/white.h, 
+ * tran/stkrev.h, tran/stkpitshift.h, tran/stkchorus.h, 
+ * tran/instrbow.h, tran/instrbowedfreq.h, 
+ * tran/instrbanded.h, tran/instrmandolin.h, 
+ * tran/instrsitar.h, tran/instrmodalbar.h, 
+ * tran/instrflute.h, tran/instrflutefreq.h, 
+ * tran/instrfluteall.h, tran/fmfb.h, tran/fmfbv.h */
+
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+
+extern LVAL s_true;
+#define cvboolean(i) ((i) ? s_true : NIL)
+#define testarg2(e) (moreargs() ? (e) : (getflonum(xltoofew())))
+#define xlgaanynum() (floatp(*xlargv) ? getflonum(nextarg()) : \
+    (fixp(*xlargv) ? (double) getfixnum(nextarg()) : \
+        getflonum(xlbadtype(*xlargv))))
+#define getboolean(lval) ((lval) != NIL)
+
+extern LVAL RSLT_sym;
+
+
+#include "sndfmt.h"
+
+#include "sndfile.h"
+
+#include "sound.h"
+
+/* xlc_snd_set_latency -- interface to C routine snd_set_latency */
+/**/
+LVAL xlc_snd_set_latency(void)
+{
+    double arg1 = getflonum(xlgaflonum());
+    double result;
+
+    xllastarg();
+    result = snd_set_latency(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_soundp -- interface to C routine soundp */
+/**/
+LVAL xlc_soundp(void)
+{
+    LVAL arg1 = xlgetarg();
+    boolean result;
+
+    xllastarg();
+    result = soundp(arg1);
+    return cvboolean(result);
+}
+
+
+/* xlc_hz_to_step -- interface to C routine hz_to_step */
+/**/
+LVAL xlc_hz_to_step(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double result;
+
+    xllastarg();
+    result = hz_to_step(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_set_logical_stop -- interface to C routine set_logical_stop_time */
+/**/
+LVAL xlc_snd_set_logical_stop(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+
+    xllastarg();
+    set_logical_stop_time(arg1, arg2);
+    return NIL;
+}
+
+
+/* xlc_log -- interface to C routine xlog */
+/**/
+LVAL xlc_log(void)
+{
+    double arg1 = getflonum(xlgaflonum());
+    double result;
+
+    xllastarg();
+    result = xlog(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_sref -- interface to C routine snd_sref */
+/**/
+LVAL xlc_snd_sref(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double result;
+
+    xllastarg();
+    result = snd_sref(arg1, arg2);
+    return cvflonum(result);
+}
+
+
+/* xlc_sref_inverse -- interface to C routine snd_sref_inverse */
+/**/
+LVAL xlc_sref_inverse(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double result;
+
+    xllastarg();
+    result = snd_sref_inverse(arg1, arg2);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_stop_time -- interface to C routine snd_stop_time */
+/**/
+LVAL xlc_snd_stop_time(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double result;
+
+    xllastarg();
+    result = snd_stop_time(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_time -- interface to C routine snd_time */
+/**/
+LVAL xlc_snd_time(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double result;
+
+    xllastarg();
+    result = snd_time(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_srate -- interface to C routine snd_srate */
+/**/
+LVAL xlc_snd_srate(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double result;
+
+    xllastarg();
+    result = snd_srate(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_t0 -- interface to C routine snd_t0 */
+/**/
+LVAL xlc_snd_t0(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double result;
+
+    xllastarg();
+    result = snd_t0(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_xform -- interface to C routine snd_xform */
+/**/
+LVAL xlc_snd_xform(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_xform(arg1, arg2, arg3, arg4, arg5, arg6);
+    return cvsound(result);
+}
+
+
+/* xlc_block_watch -- interface to C routine block_watch */
+/**/
+LVAL xlc_block_watch(void)
+{
+    long arg1 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    block_watch(arg1);
+    return NIL;
+}
+
+
+/* xlc_sound_nth_block -- interface to C routine sound_nth_block */
+/**/
+LVAL xlc_sound_nth_block(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    long result;
+
+    xllastarg();
+    result = sound_nth_block(arg1, arg2);
+    return cvfixnum(result);
+}
+
+
+/* xlc_snd_copy -- interface to C routine sound_copy */
+/**/
+LVAL xlc_snd_copy(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = sound_copy(arg1);
+    return cvsound(result);
+}
+
+
+/* xlc_snd_print -- interface to C routine sound_print */
+/**/
+LVAL xlc_snd_print(void)
+{
+    LVAL arg1 = xlgetarg();
+    long arg2 = getfixnum(xlgafixnum());
+
+    xllastarg();
+    sound_print(arg1, arg2);
+    return NIL;
+}
+
+
+/* xlc_snd_play -- interface to C routine sound_play */
+/**/
+LVAL xlc_snd_play(void)
+{
+    LVAL arg1 = xlgetarg();
+
+    xllastarg();
+    sound_play(arg1);
+    return NIL;
+}
+
+
+/* xlc_stats -- interface to C routine stats */
+/**/
+LVAL xlc_stats(void)
+{
+
+    xllastarg();
+    stats();
+    return NIL;
+}
+
+
+/* xlc_snd_print_tree -- interface to C routine sound_print_tree */
+/**/
+LVAL xlc_snd_print_tree(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+
+    xllastarg();
+    sound_print_tree(arg1);
+    return NIL;
+}
+
+
+/* xlc_snd_scale -- interface to C routine sound_scale */
+/**/
+LVAL xlc_snd_scale(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = sound_scale(arg1, arg2);
+    return cvsound(result);
+}
+
+
+/* xlc_snd_zero -- interface to C routine sound_zero */
+/**/
+LVAL xlc_snd_zero(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = sound_zero(arg1, arg2);
+    return cvsound(result);
+}
+
+
+/* xlc_step_to_hz -- interface to C routine step_to_hz */
+/**/
+LVAL xlc_step_to_hz(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double result;
+
+    xllastarg();
+    result = step_to_hz(arg1);
+    return cvflonum(result);
+}
+
+
+#include "add.h"
+
+/* xlc_snd_add -- interface to C routine snd_add */
+/**/
+LVAL xlc_snd_add(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_add(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "avg.h"
+
+/* xlc_snd_avg -- interface to C routine snd_avg */
+/**/
+LVAL xlc_snd_avg(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_avg(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "compose.h"
+
+/* xlc_snd_compose -- interface to C routine snd_compose */
+/**/
+LVAL xlc_snd_compose(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_compose(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "convolve.h"
+
+/* xlc_snd_convolve -- interface to C routine snd_convolve */
+/**/
+LVAL xlc_snd_convolve(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_convolve(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "downsample.h"
+
+/* xlc_snd_down -- interface to C routine snd_down */
+/**/
+LVAL xlc_snd_down(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_down(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "fft.h"
+
+/* xlc_snd_fft -- interface to C routine snd_fft */
+/**/
+LVAL xlc_snd_fft(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    LVAL arg4 = xlgetarg();
+    LVAL result;
+
+    xllastarg();
+    result = snd_fft(arg1, arg2, arg3, arg4);
+    return (result);
+}
+
+
+#include "inverse.h"
+
+/* xlc_snd_inverse -- interface to C routine snd_inverse */
+/**/
+LVAL xlc_snd_inverse(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_inverse(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "multiseq.h"
+
+/* xlc_snd_multiseq -- interface to C routine snd_make_multiseq */
+/**/
+LVAL xlc_snd_multiseq(void)
+{
+    LVAL arg1 = xlgetarg();
+    LVAL arg2 = xlgetarg();
+    LVAL result;
+
+    xllastarg();
+    result = snd_make_multiseq(arg1, arg2);
+    return (result);
+}
+
+
+#include "resamp.h"
+
+/* xlc_snd_resample -- interface to C routine snd_resample */
+/**/
+LVAL xlc_snd_resample(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_resample(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "resampv.h"
+
+/* xlc_snd_resamplev -- interface to C routine snd_resamplev */
+/**/
+LVAL xlc_snd_resamplev(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_resamplev(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "samples.h"
+
+/* xlc_snd_from_array -- interface to C routine snd_from_array */
+/**/
+LVAL xlc_snd_from_array(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    LVAL arg3 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_from_array(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+/* xlc_snd_samples -- interface to C routine snd_samples */
+/**/
+LVAL xlc_snd_samples(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    LVAL result;
+
+    xllastarg();
+    result = snd_samples(arg1, arg2);
+    return (result);
+}
+
+
+/* xlc_snd_length -- interface to C routine snd_length */
+/**/
+LVAL xlc_snd_length(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    long result;
+
+    xllastarg();
+    result = snd_length(arg1, arg2);
+    return cvfixnum(result);
+}
+
+
+/* xlc_snd_maxsamp -- interface to C routine snd_maxsamp */
+/**/
+LVAL xlc_snd_maxsamp(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double result;
+
+    xllastarg();
+    result = snd_maxsamp(arg1);
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_fetch -- interface to C routine snd_fetch */
+/**/
+LVAL xlc_snd_fetch(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    LVAL result;
+
+    xllastarg();
+    result = snd_fetch(arg1);
+    return (result);
+}
+
+
+/* xlc_snd_fetch_array -- interface to C routine snd_fetch_array */
+/**/
+LVAL xlc_snd_fetch_array(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    long arg3 = getfixnum(xlgafixnum());
+    LVAL result;
+
+    xllastarg();
+    result = snd_fetch_array(arg1, arg2, arg3);
+    return (result);
+}
+
+
+#include "sndmax.h"
+
+/* xlc_snd_max -- interface to C routine sound_max */
+/**/
+LVAL xlc_snd_max(void)
+{
+    LVAL arg1 = xlgetarg();
+    long arg2 = getfixnum(xlgafixnum());
+    double result;
+
+    xllastarg();
+    result = sound_max(arg1, arg2);
+    return cvflonum(result);
+}
+
+
+#include "sndread.h"
+
+/* xlc_snd_read -- interface to C routine snd_make_read */
+/**/
+LVAL xlc_snd_read(void)
+{
+    unsigned char * arg1 = getstring(xlgastring());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+    long arg7 = getfixnum(xlgafixnum());
+    long arg8 = getfixnum(xlgafixnum());
+    double arg9 = testarg2(xlgaanynum());
+    double arg10 = testarg2(xlgaanynum());
+    long arg11 = 0;
+    long arg12 = 0;
+    LVAL result;
+
+    xllastarg();
+    xlprot1(result);
+    result = snd_make_read(arg1, arg2, arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11, &arg12);
+    {	LVAL *next = &getvalue(RSLT_sym);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg4);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg5);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg6);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg7);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg8);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvflonum(arg9);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvflonum(arg10);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg11);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg12);
+    }
+    xlpop();
+    return (result);
+}
+
+
+#include "sndseq.h"
+
+/* xlc_snd_seq -- interface to C routine snd_sndseq */
+/**/
+LVAL xlc_snd_seq(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    LVAL arg2 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_sndseq(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "sndsliders.h"
+
+/* xlc_snd_slider -- interface to C routine snd_slider */
+/**/
+LVAL xlc_snd_slider(void)
+{
+    long arg1 = getfixnum(xlgafixnum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_slider(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "sndwrite.h"
+
+/* xlc_snd_save -- interface to C routine sound_save */
+/**/
+LVAL xlc_snd_save(void)
+{
+    LVAL arg1 = xlgetarg();
+    long arg2 = getfixnum(xlgafixnum());
+    unsigned char * arg3 = getstring(xlgastring());
+    long arg4 = getfixnum(xlgafixnum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+    long arg7 = getfixnum(xlgafixnum());
+    double arg8 = 0.0;
+    long arg9 = 0;
+    double arg10 = 0.0;
+    LVAL arg11 = xlgetarg();
+    double result;
+
+    xllastarg();
+    result = sound_save(arg1, arg2, arg3, arg4, arg5, arg6, arg7, &arg8, &arg9, &arg10, arg11);
+    {	LVAL *next = &getvalue(RSLT_sym);
+	*next = cons(NIL, NIL);
+	car(*next) = cvflonum(arg8);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvfixnum(arg9);	next = &cdr(*next);
+	*next = cons(NIL, NIL);
+	car(*next) = cvflonum(arg10);
+    }
+    return cvflonum(result);
+}
+
+
+/* xlc_snd_overwrite -- interface to C routine sound_overwrite */
+/**/
+LVAL xlc_snd_overwrite(void)
+{
+    LVAL arg1 = xlgetarg();
+    long arg2 = getfixnum(xlgafixnum());
+    unsigned char * arg3 = getstring(xlgastring());
+    double arg4 = testarg2(xlgaanynum());
+    long arg5 = getfixnum(xlgafixnum());
+    long arg6 = getfixnum(xlgafixnum());
+    long arg7 = getfixnum(xlgafixnum());
+    long arg8 = getfixnum(xlgafixnum());
+    double arg9 = 0.0;
+    double result;
+
+    xllastarg();
+    result = sound_overwrite(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, &arg9);
+    {	LVAL *next = &getvalue(RSLT_sym);
+	*next = cons(NIL, NIL);
+	car(*next) = cvflonum(arg9);
+    }
+    return cvflonum(result);
+}
+
+
+#include "yin.h"
+
+/* xlc_snd_yin -- interface to C routine snd_yin */
+/**/
+LVAL xlc_snd_yin(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    LVAL result;
+
+    xllastarg();
+    result = snd_yin(arg1, arg2, arg3, arg4);
+    return (result);
+}
+
+
+#include "nyq-osc-server.h"
+
+#include "trigger.h"
+
+/* xlc_snd_trigger -- interface to C routine snd_trigger */
+/**/
+LVAL xlc_snd_trigger(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    LVAL arg2 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_trigger(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "lpanal.h"
+
+/* xlc_snd_lpanal -- interface to C routine snd_lpanal */
+/**/
+LVAL xlc_snd_lpanal(void)
+{
+    LVAL arg1 = xlgetarg();
+    long arg2 = getfixnum(xlgafixnum());
+    LVAL result;
+
+    xllastarg();
+    result = snd_lpanal(arg1, arg2);
+    return (result);
+}
+
+
+#include "abs.h"
+
+/* xlc_snd_abs -- interface to C routine snd_abs */
+/**/
+LVAL xlc_snd_abs(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_abs(arg1);
+    return cvsound(result);
+}
+
+
+#include "allpoles.h"
+
+/* xlc_snd_allpoles -- interface to C routine snd_allpoles */
+/**/
+LVAL xlc_snd_allpoles(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    LVAL arg2 = xlgetarg();
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_allpoles(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "alpass.h"
+
+/* xlc_snd_alpass -- interface to C routine snd_alpass */
+/**/
+LVAL xlc_snd_alpass(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_alpass(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "alpasscv.h"
+
+/* xlc_snd_alpasscv -- interface to C routine snd_alpasscv */
+/**/
+LVAL xlc_snd_alpasscv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_alpasscv(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "alpassvv.h"
+
+/* xlc_snd_alpassvv -- interface to C routine snd_alpassvv */
+/**/
+LVAL xlc_snd_alpassvv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_alpassvv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "amosc.h"
+
+/* xlc_snd_amosc -- interface to C routine snd_amosc */
+/**/
+LVAL xlc_snd_amosc(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type arg6 = getsound(xlgasound());
+    double arg7 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_amosc(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+    return cvsound(result);
+}
+
+
+#include "areson.h"
+
+/* xlc_snd_areson -- interface to C routine snd_areson */
+/**/
+LVAL xlc_snd_areson(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_areson(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "aresonvc.h"
+
+/* xlc_snd_aresonvc -- interface to C routine snd_aresonvc */
+/**/
+LVAL xlc_snd_aresonvc(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_aresonvc(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "aresoncv.h"
+
+/* xlc_snd_aresoncv -- interface to C routine snd_aresoncv */
+/**/
+LVAL xlc_snd_aresoncv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_aresoncv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "aresonvv.h"
+
+/* xlc_snd_aresonvv -- interface to C routine snd_aresonvv */
+/**/
+LVAL xlc_snd_aresonvv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_aresonvv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "atone.h"
+
+/* xlc_snd_atone -- interface to C routine snd_atone */
+/**/
+LVAL xlc_snd_atone(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_atone(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "atonev.h"
+
+/* xlc_snd_atonev -- interface to C routine snd_atonev */
+/**/
+LVAL xlc_snd_atonev(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_atonev(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "biquadfilt.h"
+
+/* xlc_snd_biquad -- interface to C routine snd_biquadfilt */
+/**/
+LVAL xlc_snd_biquad(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    double arg7 = testarg2(xlgaanynum());
+    double arg8 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_biquadfilt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+    return cvsound(result);
+}
+
+
+#include "buzz.h"
+
+/* xlc_snd_buzz -- interface to C routine snd_buzz */
+/**/
+LVAL xlc_snd_buzz(void)
+{
+    long arg1 = getfixnum(xlgafixnum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type arg5 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_buzz(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "chase.h"
+
+/* xlc_snd_chase -- interface to C routine snd_chase */
+/**/
+LVAL xlc_snd_chase(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_chase(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "clip.h"
+
+/* xlc_snd_clip -- interface to C routine snd_clip */
+/**/
+LVAL xlc_snd_clip(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_clip(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "congen.h"
+
+/* xlc_snd_congen -- interface to C routine snd_congen */
+/**/
+LVAL xlc_snd_congen(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_congen(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "const.h"
+
+/* xlc_snd_const -- interface to C routine snd_const */
+/**/
+LVAL xlc_snd_const(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_const(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "coterm.h"
+
+/* xlc_snd_coterm -- interface to C routine snd_coterm */
+/**/
+LVAL xlc_snd_coterm(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_coterm(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "delaycc.h"
+
+/* xlc_snd_delay -- interface to C routine snd_delay */
+/**/
+LVAL xlc_snd_delay(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_delay(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "delaycv.h"
+
+/* xlc_snd_delaycv -- interface to C routine snd_delaycv */
+/**/
+LVAL xlc_snd_delaycv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_delaycv(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "eqbandvvv.h"
+
+/* xlc_snd_eqbandvvv -- interface to C routine snd_eqbandvvv */
+/**/
+LVAL xlc_snd_eqbandvvv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    sound_type arg4 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_eqbandvvv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "exp.h"
+
+/* xlc_snd_exp -- interface to C routine snd_exp */
+/**/
+LVAL xlc_snd_exp(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_exp(arg1);
+    return cvsound(result);
+}
+
+
+#include "follow.h"
+
+/* xlc_snd_follow -- interface to C routine snd_follow */
+/**/
+LVAL xlc_snd_follow(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    long arg5 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_follow(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "fmosc.h"
+
+/* xlc_snd_fmosc -- interface to C routine snd_fmosc */
+/**/
+LVAL xlc_snd_fmosc(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type arg6 = getsound(xlgasound());
+    double arg7 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_fmosc(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+    return cvsound(result);
+}
+
+
+#include "fromobject.h"
+
+/* xlc_snd_fromobject -- interface to C routine snd_fromobject */
+/**/
+LVAL xlc_snd_fromobject(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    LVAL arg3 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_fromobject(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "fromarraystream.h"
+
+/* xlc_snd_fromarraystream -- interface to C routine snd_fromarraystream */
+/**/
+LVAL xlc_snd_fromarraystream(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    LVAL arg3 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_fromarraystream(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "gate.h"
+
+/* xlc_snd_gate -- interface to C routine snd_gate */
+/**/
+LVAL xlc_snd_gate(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_gate(arg1, arg2, arg3, arg4, arg5, arg6);
+    return cvsound(result);
+}
+
+
+#include "ifft.h"
+
+/* xlc_snd_ifft -- interface to C routine snd_ifft */
+/**/
+LVAL xlc_snd_ifft(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    LVAL arg3 = xlgetarg();
+    long arg4 = getfixnum(xlgafixnum());
+    LVAL arg5 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_ifft(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "instrclar.h"
+
+/* xlc_snd_clarinet -- interface to C routine snd_clarinet */
+/**/
+LVAL xlc_snd_clarinet(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_clarinet(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "instrclarall.h"
+
+/* xlc_snd_clarinet_all -- interface to C routine snd_clarinet_all */
+/**/
+LVAL xlc_snd_clarinet_all(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type arg6 = getsound(xlgasound());
+    sound_type arg7 = getsound(xlgasound());
+    double arg8 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_clarinet_all(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+    return cvsound(result);
+}
+
+
+#include "instrclarfreq.h"
+
+/* xlc_snd_clarinet_freq -- interface to C routine snd_clarinet_freq */
+/**/
+LVAL xlc_snd_clarinet_freq(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_clarinet_freq(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "instrsax.h"
+
+/* xlc_snd_sax -- interface to C routine snd_sax */
+/**/
+LVAL xlc_snd_sax(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sax(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "instrsaxall.h"
+
+/* xlc_snd_sax_all -- interface to C routine snd_sax_all */
+/**/
+LVAL xlc_snd_sax_all(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type arg6 = getsound(xlgasound());
+    sound_type arg7 = getsound(xlgasound());
+    sound_type arg8 = getsound(xlgasound());
+    sound_type arg9 = getsound(xlgasound());
+    double arg10 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sax_all(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+    return cvsound(result);
+}
+
+
+#include "instrsaxfreq.h"
+
+/* xlc_snd_sax_freq -- interface to C routine snd_sax_freq */
+/**/
+LVAL xlc_snd_sax_freq(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sax_freq(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "integrate.h"
+
+/* xlc_snd_integrate -- interface to C routine snd_integrate */
+/**/
+LVAL xlc_snd_integrate(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_integrate(arg1);
+    return cvsound(result);
+}
+
+
+#include "log.h"
+
+/* xlc_snd_log -- interface to C routine snd_log */
+/**/
+LVAL xlc_snd_log(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_log(arg1);
+    return cvsound(result);
+}
+
+
+#include "lpreson.h"
+
+/* xlc_snd_lpreson -- interface to C routine snd_lpreson */
+/**/
+LVAL xlc_snd_lpreson(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    LVAL arg2 = xlgetarg();
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_lpreson(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "maxv.h"
+
+/* xlc_snd_maxv -- interface to C routine snd_maxv */
+/**/
+LVAL xlc_snd_maxv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_maxv(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "offset.h"
+
+/* xlc_snd_offset -- interface to C routine snd_offset */
+/**/
+LVAL xlc_snd_offset(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_offset(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "oneshot.h"
+
+/* xlc_snd_oneshot -- interface to C routine snd_oneshot */
+/**/
+LVAL xlc_snd_oneshot(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_oneshot(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "osc.h"
+
+/* xlc_snd_osc -- interface to C routine snd_osc */
+/**/
+LVAL xlc_snd_osc(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    double arg7 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_osc(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+    return cvsound(result);
+}
+
+
+#include "partial.h"
+
+/* xlc_snd_partial -- interface to C routine snd_partial */
+/**/
+LVAL xlc_snd_partial(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_partial(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "pluck.h"
+
+/* xlc_snd_pluck -- interface to C routine snd_pluck */
+/**/
+LVAL xlc_snd_pluck(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_pluck(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "prod.h"
+
+/* xlc_snd_prod -- interface to C routine snd_prod */
+/**/
+LVAL xlc_snd_prod(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_prod(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "pwl.h"
+
+/* xlc_snd_pwl -- interface to C routine snd_pwl */
+/**/
+LVAL xlc_snd_pwl(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    LVAL arg3 = xlgetarg();
+    sound_type result;
+
+    xllastarg();
+    result = snd_pwl(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "quantize.h"
+
+/* xlc_snd_quantize -- interface to C routine snd_quantize */
+/**/
+LVAL xlc_snd_quantize(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    long arg2 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_quantize(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "recip.h"
+
+/* xlc_snd_recip -- interface to C routine snd_recip */
+/**/
+LVAL xlc_snd_recip(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_recip(arg1);
+    return cvsound(result);
+}
+
+
+#include "reson.h"
+
+/* xlc_snd_reson -- interface to C routine snd_reson */
+/**/
+LVAL xlc_snd_reson(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_reson(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "resonvc.h"
+
+/* xlc_snd_resonvc -- interface to C routine snd_resonvc */
+/**/
+LVAL xlc_snd_resonvc(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_resonvc(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "resoncv.h"
+
+/* xlc_snd_resoncv -- interface to C routine snd_resoncv */
+/**/
+LVAL xlc_snd_resoncv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_resoncv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "resonvv.h"
+
+/* xlc_snd_resonvv -- interface to C routine snd_resonvv */
+/**/
+LVAL xlc_snd_resonvv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    long arg4 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_resonvv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "sampler.h"
+
+/* xlc_snd_sampler -- interface to C routine snd_sampler */
+/**/
+LVAL xlc_snd_sampler(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    sound_type arg7 = getsound(xlgasound());
+    long arg8 = getfixnum(xlgafixnum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sampler(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+    return cvsound(result);
+}
+
+
+#include "scale.h"
+
+/* xlc_snd_normalize -- interface to C routine snd_normalize */
+/**/
+LVAL xlc_snd_normalize(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_normalize(arg1);
+    return cvsound(result);
+}
+
+
+#include "shape.h"
+
+/* xlc_snd_shape -- interface to C routine snd_shape */
+/**/
+LVAL xlc_snd_shape(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_shape(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "sine.h"
+
+/* xlc_snd_sine -- interface to C routine snd_sine */
+/**/
+LVAL xlc_snd_sine(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sine(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "siosc.h"
+
+/* xlc_snd_siosc -- interface to C routine snd_siosc */
+/**/
+LVAL xlc_snd_siosc(void)
+{
+    LVAL arg1 = xlgetarg();
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type arg5 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_siosc(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "slope.h"
+
+/* xlc_snd_slope -- interface to C routine snd_slope */
+/**/
+LVAL xlc_snd_slope(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_slope(arg1);
+    return cvsound(result);
+}
+
+
+#include "sqrt.h"
+
+/* xlc_snd_sqrt -- interface to C routine snd_sqrt */
+/**/
+LVAL xlc_snd_sqrt(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sqrt(arg1);
+    return cvsound(result);
+}
+
+
+#include "tapf.h"
+
+/* xlc_snd_tapf -- interface to C routine snd_tapf */
+/**/
+LVAL xlc_snd_tapf(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_tapf(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "tapv.h"
+
+/* xlc_snd_tapv -- interface to C routine snd_tapv */
+/**/
+LVAL xlc_snd_tapv(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_tapv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "tone.h"
+
+/* xlc_snd_tone -- interface to C routine snd_tone */
+/**/
+LVAL xlc_snd_tone(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_tone(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "tonev.h"
+
+/* xlc_snd_tonev -- interface to C routine snd_tonev */
+/**/
+LVAL xlc_snd_tonev(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_tonev(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "upsample.h"
+
+/* xlc_snd_up -- interface to C routine snd_up */
+/**/
+LVAL xlc_snd_up(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_up(arg1, arg2);
+    return cvsound(result);
+}
+
+
+#include "white.h"
+
+/* xlc_snd_white -- interface to C routine snd_white */
+/**/
+LVAL xlc_snd_white(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_white(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "stkrev.h"
+
+/* xlc_snd_stkrev -- interface to C routine snd_stkrev */
+/**/
+LVAL xlc_snd_stkrev(void)
+{
+    long arg1 = getfixnum(xlgafixnum());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_stkrev(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "stkpitshift.h"
+
+/* xlc_snd_stkpitshift -- interface to C routine snd_stkpitshift */
+/**/
+LVAL xlc_snd_stkpitshift(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_stkpitshift(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "stkchorus.h"
+
+/* xlc_snd_stkchorus -- interface to C routine snd_stkchorus */
+/**/
+LVAL xlc_snd_stkchorus(void)
+{
+    sound_type arg1 = getsound(xlgasound());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_stkchorus(arg1, arg2, arg3, arg4, arg5, arg6);
+    return cvsound(result);
+}
+
+
+#include "instrbow.h"
+
+/* xlc_snd_bowed -- interface to C routine snd_bowed */
+/**/
+LVAL xlc_snd_bowed(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_bowed(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "instrbowedfreq.h"
+
+/* xlc_snd_bowed_freq -- interface to C routine snd_bowed_freq */
+/**/
+LVAL xlc_snd_bowed_freq(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_bowed_freq(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "instrbanded.h"
+
+/* xlc_snd_bandedwg -- interface to C routine snd_bandedwg */
+/**/
+LVAL xlc_snd_bandedwg(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    long arg3 = getfixnum(xlgafixnum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_bandedwg(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "instrmandolin.h"
+
+/* xlc_snd_mandolin -- interface to C routine snd_mandolin */
+/**/
+LVAL xlc_snd_mandolin(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    double arg6 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_mandolin(arg1, arg2, arg3, arg4, arg5, arg6);
+    return cvsound(result);
+}
+
+
+#include "instrsitar.h"
+
+/* xlc_snd_sitar -- interface to C routine snd_sitar */
+/**/
+LVAL xlc_snd_sitar(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_sitar(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "instrmodalbar.h"
+
+/* xlc_snd_modalbar -- interface to C routine snd_modalbar */
+/**/
+LVAL xlc_snd_modalbar(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    long arg3 = getfixnum(xlgafixnum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_modalbar(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "instrflute.h"
+
+/* xlc_snd_flute -- interface to C routine snd_flute */
+/**/
+LVAL xlc_snd_flute(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_flute(arg1, arg2, arg3);
+    return cvsound(result);
+}
+
+
+#include "instrflutefreq.h"
+
+/* xlc_snd_flute_freq -- interface to C routine snd_flute_freq */
+/**/
+LVAL xlc_snd_flute_freq(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_flute_freq(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
+#include "instrfluteall.h"
+
+/* xlc_snd_flute_all -- interface to C routine snd_flute_all */
+/**/
+LVAL xlc_snd_flute_all(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    sound_type arg2 = getsound(xlgasound());
+    sound_type arg3 = getsound(xlgasound());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type arg6 = getsound(xlgasound());
+    sound_type arg7 = getsound(xlgasound());
+    double arg8 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_flute_all(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+    return cvsound(result);
+}
+
+
+#include "fmfb.h"
+
+/* xlc_snd_fmfb -- interface to C routine snd_fmfb */
+/**/
+LVAL xlc_snd_fmfb(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    double arg4 = testarg2(xlgaanynum());
+    double arg5 = testarg2(xlgaanynum());
+    sound_type result;
+
+    xllastarg();
+    result = snd_fmfb(arg1, arg2, arg3, arg4, arg5);
+    return cvsound(result);
+}
+
+
+#include "fmfbv.h"
+
+/* xlc_snd_fmfbv -- interface to C routine snd_fmfbv */
+/**/
+LVAL xlc_snd_fmfbv(void)
+{
+    double arg1 = testarg2(xlgaanynum());
+    double arg2 = testarg2(xlgaanynum());
+    double arg3 = testarg2(xlgaanynum());
+    sound_type arg4 = getsound(xlgasound());
+    sound_type result;
+
+    xllastarg();
+    result = snd_fmfbv(arg1, arg2, arg3, arg4);
+    return cvsound(result);
+}
+
+
diff --git a/nyquist/sndfnint.lsp b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp
similarity index 100%
copy from nyquist/sndfnint.lsp
copy to lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h
new file mode 100644
index 0000000..007527e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h
@@ -0,0 +1,126 @@
+extern LVAL xlc_snd_set_latency(void);
+extern LVAL xlc_soundp(void);
+extern LVAL xlc_hz_to_step(void);
+extern LVAL xlc_snd_set_logical_stop(void);
+extern LVAL xlc_log(void);
+extern LVAL xlc_snd_sref(void);
+extern LVAL xlc_sref_inverse(void);
+extern LVAL xlc_snd_stop_time(void);
+extern LVAL xlc_snd_time(void);
+extern LVAL xlc_snd_srate(void);
+extern LVAL xlc_snd_t0(void);
+extern LVAL xlc_snd_xform(void);
+extern LVAL xlc_block_watch(void);
+extern LVAL xlc_sound_nth_block(void);
+extern LVAL xlc_snd_copy(void);
+extern LVAL xlc_snd_print(void);
+extern LVAL xlc_snd_play(void);
+extern LVAL xlc_stats(void);
+extern LVAL xlc_snd_print_tree(void);
+extern LVAL xlc_snd_scale(void);
+extern LVAL xlc_snd_zero(void);
+extern LVAL xlc_step_to_hz(void);
+extern LVAL xlc_snd_add(void);
+extern LVAL xlc_snd_avg(void);
+extern LVAL xlc_snd_compose(void);
+extern LVAL xlc_snd_convolve(void);
+extern LVAL xlc_snd_down(void);
+extern LVAL xlc_snd_fft(void);
+extern LVAL xlc_snd_inverse(void);
+extern LVAL xlc_snd_multiseq(void);
+extern LVAL xlc_snd_resample(void);
+extern LVAL xlc_snd_resamplev(void);
+extern LVAL xlc_snd_from_array(void);
+extern LVAL xlc_snd_samples(void);
+extern LVAL xlc_snd_length(void);
+extern LVAL xlc_snd_maxsamp(void);
+extern LVAL xlc_snd_fetch(void);
+extern LVAL xlc_snd_fetch_array(void);
+extern LVAL xlc_snd_max(void);
+extern LVAL xlc_snd_read(void);
+extern LVAL xlc_snd_seq(void);
+extern LVAL xlc_snd_slider(void);
+extern LVAL xlc_snd_save(void);
+extern LVAL xlc_snd_overwrite(void);
+extern LVAL xlc_snd_yin(void);
+extern LVAL xlc_snd_trigger(void);
+extern LVAL xlc_snd_lpanal(void);
+extern LVAL xlc_snd_abs(void);
+extern LVAL xlc_snd_allpoles(void);
+extern LVAL xlc_snd_alpass(void);
+extern LVAL xlc_snd_alpasscv(void);
+extern LVAL xlc_snd_alpassvv(void);
+extern LVAL xlc_snd_amosc(void);
+extern LVAL xlc_snd_areson(void);
+extern LVAL xlc_snd_aresonvc(void);
+extern LVAL xlc_snd_aresoncv(void);
+extern LVAL xlc_snd_aresonvv(void);
+extern LVAL xlc_snd_atone(void);
+extern LVAL xlc_snd_atonev(void);
+extern LVAL xlc_snd_biquad(void);
+extern LVAL xlc_snd_buzz(void);
+extern LVAL xlc_snd_chase(void);
+extern LVAL xlc_snd_clip(void);
+extern LVAL xlc_snd_congen(void);
+extern LVAL xlc_snd_const(void);
+extern LVAL xlc_snd_coterm(void);
+extern LVAL xlc_snd_delay(void);
+extern LVAL xlc_snd_delaycv(void);
+extern LVAL xlc_snd_eqbandvvv(void);
+extern LVAL xlc_snd_exp(void);
+extern LVAL xlc_snd_follow(void);
+extern LVAL xlc_snd_fmosc(void);
+extern LVAL xlc_snd_fromobject(void);
+extern LVAL xlc_snd_fromarraystream(void);
+extern LVAL xlc_snd_gate(void);
+extern LVAL xlc_snd_ifft(void);
+extern LVAL xlc_snd_clarinet(void);
+extern LVAL xlc_snd_clarinet_all(void);
+extern LVAL xlc_snd_clarinet_freq(void);
+extern LVAL xlc_snd_sax(void);
+extern LVAL xlc_snd_sax_all(void);
+extern LVAL xlc_snd_sax_freq(void);
+extern LVAL xlc_snd_integrate(void);
+extern LVAL xlc_snd_log(void);
+extern LVAL xlc_snd_lpreson(void);
+extern LVAL xlc_snd_maxv(void);
+extern LVAL xlc_snd_offset(void);
+extern LVAL xlc_snd_oneshot(void);
+extern LVAL xlc_snd_osc(void);
+extern LVAL xlc_snd_partial(void);
+extern LVAL xlc_snd_pluck(void);
+extern LVAL xlc_snd_prod(void);
+extern LVAL xlc_snd_pwl(void);
+extern LVAL xlc_snd_quantize(void);
+extern LVAL xlc_snd_recip(void);
+extern LVAL xlc_snd_reson(void);
+extern LVAL xlc_snd_resonvc(void);
+extern LVAL xlc_snd_resoncv(void);
+extern LVAL xlc_snd_resonvv(void);
+extern LVAL xlc_snd_sampler(void);
+extern LVAL xlc_snd_normalize(void);
+extern LVAL xlc_snd_shape(void);
+extern LVAL xlc_snd_sine(void);
+extern LVAL xlc_snd_siosc(void);
+extern LVAL xlc_snd_slope(void);
+extern LVAL xlc_snd_sqrt(void);
+extern LVAL xlc_snd_tapf(void);
+extern LVAL xlc_snd_tapv(void);
+extern LVAL xlc_snd_tone(void);
+extern LVAL xlc_snd_tonev(void);
+extern LVAL xlc_snd_up(void);
+extern LVAL xlc_snd_white(void);
+extern LVAL xlc_snd_stkrev(void);
+extern LVAL xlc_snd_stkpitshift(void);
+extern LVAL xlc_snd_stkchorus(void);
+extern LVAL xlc_snd_bowed(void);
+extern LVAL xlc_snd_bowed_freq(void);
+extern LVAL xlc_snd_bandedwg(void);
+extern LVAL xlc_snd_mandolin(void);
+extern LVAL xlc_snd_sitar(void);
+extern LVAL xlc_snd_modalbar(void);
+extern LVAL xlc_snd_flute(void);
+extern LVAL xlc_snd_flute_freq(void);
+extern LVAL xlc_snd_flute_all(void);
+extern LVAL xlc_snd_fmfb(void);
+extern LVAL xlc_snd_fmfbv(void);
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h
new file mode 100644
index 0000000..81b966f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h
@@ -0,0 +1,126 @@
+  { "SND-SET-LATENCY",  S, xlc_snd_set_latency}, 
+  { "SOUNDP",  S, xlc_soundp}, 
+  { "HZ-TO-STEP",  S, xlc_hz_to_step}, 
+  { "SND-SET-LOGICAL-STOP",  S, xlc_snd_set_logical_stop}, 
+  { "LOG",  S, xlc_log}, 
+  { "SND-SREF",  S, xlc_snd_sref}, 
+  { "SREF-INVERSE",  S, xlc_sref_inverse}, 
+  { "SND-STOP-TIME",  S, xlc_snd_stop_time}, 
+  { "SND-TIME",  S, xlc_snd_time}, 
+  { "SND-SRATE",  S, xlc_snd_srate}, 
+  { "SND-T0",  S, xlc_snd_t0}, 
+  { "SND-XFORM",  S, xlc_snd_xform}, 
+  { "BLOCK-WATCH",  S, xlc_block_watch}, 
+  { "SOUND-NTH-BLOCK",  S, xlc_sound_nth_block}, 
+  { "SND-COPY",  S, xlc_snd_copy}, 
+  { "SND-PRINT",  S, xlc_snd_print}, 
+  { "SND-PLAY",  S, xlc_snd_play}, 
+  { "STATS",  S, xlc_stats}, 
+  { "SND-PRINT-TREE",  S, xlc_snd_print_tree}, 
+  { "SND-SCALE",  S, xlc_snd_scale}, 
+  { "SND-ZERO",  S, xlc_snd_zero}, 
+  { "STEP-TO-HZ",  S, xlc_step_to_hz}, 
+  { "SND-ADD",  S, xlc_snd_add}, 
+  { "SND-AVG",  S, xlc_snd_avg}, 
+  { "SND-COMPOSE",  S, xlc_snd_compose}, 
+  { "SND-CONVOLVE",  S, xlc_snd_convolve}, 
+  { "SND-DOWN",  S, xlc_snd_down}, 
+  { "SND-FFT",  S, xlc_snd_fft}, 
+  { "SND-INVERSE",  S, xlc_snd_inverse}, 
+  { "SND-MULTISEQ",  S, xlc_snd_multiseq}, 
+  { "SND-RESAMPLE",  S, xlc_snd_resample}, 
+  { "SND-RESAMPLEV",  S, xlc_snd_resamplev}, 
+  { "SND-FROM-ARRAY",  S, xlc_snd_from_array}, 
+  { "SND-SAMPLES",  S, xlc_snd_samples}, 
+  { "SND-LENGTH",  S, xlc_snd_length}, 
+  { "SND-MAXSAMP",  S, xlc_snd_maxsamp}, 
+  { "SND-FETCH",  S, xlc_snd_fetch}, 
+  { "SND-FETCH-ARRAY",  S, xlc_snd_fetch_array}, 
+  { "SND-MAX",  S, xlc_snd_max}, 
+  { "SND-READ",  S, xlc_snd_read}, 
+  { "SND-SEQ",  S, xlc_snd_seq}, 
+  { "SND-SLIDER",  S, xlc_snd_slider}, 
+  { "SND-SAVE",  S, xlc_snd_save}, 
+  { "SND-OVERWRITE",  S, xlc_snd_overwrite}, 
+  { "SND-YIN",  S, xlc_snd_yin}, 
+  { "SND-TRIGGER",  S, xlc_snd_trigger}, 
+  { "SND-LPANAL",  S, xlc_snd_lpanal}, 
+  { "SND-ABS",  S, xlc_snd_abs}, 
+  { "SND-ALLPOLES",  S, xlc_snd_allpoles}, 
+  { "SND-ALPASS",  S, xlc_snd_alpass}, 
+  { "SND-ALPASSCV",  S, xlc_snd_alpasscv}, 
+  { "SND-ALPASSVV",  S, xlc_snd_alpassvv}, 
+  { "SND-AMOSC",  S, xlc_snd_amosc}, 
+  { "SND-ARESON",  S, xlc_snd_areson}, 
+  { "SND-ARESONVC",  S, xlc_snd_aresonvc}, 
+  { "SND-ARESONCV",  S, xlc_snd_aresoncv}, 
+  { "SND-ARESONVV",  S, xlc_snd_aresonvv}, 
+  { "SND-ATONE",  S, xlc_snd_atone}, 
+  { "SND-ATONEV",  S, xlc_snd_atonev}, 
+  { "SND-BIQUAD",  S, xlc_snd_biquad}, 
+  { "SND-BUZZ",  S, xlc_snd_buzz}, 
+  { "SND-CHASE",  S, xlc_snd_chase}, 
+  { "SND-CLIP",  S, xlc_snd_clip}, 
+  { "SND-CONGEN",  S, xlc_snd_congen}, 
+  { "SND-CONST",  S, xlc_snd_const}, 
+  { "SND-COTERM",  S, xlc_snd_coterm}, 
+  { "SND-DELAY",  S, xlc_snd_delay}, 
+  { "SND-DELAYCV",  S, xlc_snd_delaycv}, 
+  { "SND-EQBANDVVV",  S, xlc_snd_eqbandvvv}, 
+  { "SND-EXP",  S, xlc_snd_exp}, 
+  { "SND-FOLLOW",  S, xlc_snd_follow}, 
+  { "SND-FMOSC",  S, xlc_snd_fmosc}, 
+  { "SND-FROMOBJECT",  S, xlc_snd_fromobject}, 
+  { "SND-FROMARRAYSTREAM",  S, xlc_snd_fromarraystream}, 
+  { "SND-GATE",  S, xlc_snd_gate}, 
+  { "SND-IFFT",  S, xlc_snd_ifft}, 
+  { "SND-CLARINET",  S, xlc_snd_clarinet}, 
+  { "SND-CLARINET_ALL",  S, xlc_snd_clarinet_all}, 
+  { "SND-CLARINET_FREQ",  S, xlc_snd_clarinet_freq}, 
+  { "SND-SAX",  S, xlc_snd_sax}, 
+  { "SND-SAX_ALL",  S, xlc_snd_sax_all}, 
+  { "SND-SAX_FREQ",  S, xlc_snd_sax_freq}, 
+  { "SND-INTEGRATE",  S, xlc_snd_integrate}, 
+  { "SND-LOG",  S, xlc_snd_log}, 
+  { "SND-LPRESON",  S, xlc_snd_lpreson}, 
+  { "SND-MAXV",  S, xlc_snd_maxv}, 
+  { "SND-OFFSET",  S, xlc_snd_offset}, 
+  { "SND-ONESHOT",  S, xlc_snd_oneshot}, 
+  { "SND-OSC",  S, xlc_snd_osc}, 
+  { "SND-PARTIAL",  S, xlc_snd_partial}, 
+  { "SND-PLUCK",  S, xlc_snd_pluck}, 
+  { "SND-PROD",  S, xlc_snd_prod}, 
+  { "SND-PWL",  S, xlc_snd_pwl}, 
+  { "SND-QUANTIZE",  S, xlc_snd_quantize}, 
+  { "SND-RECIP",  S, xlc_snd_recip}, 
+  { "SND-RESON",  S, xlc_snd_reson}, 
+  { "SND-RESONVC",  S, xlc_snd_resonvc}, 
+  { "SND-RESONCV",  S, xlc_snd_resoncv}, 
+  { "SND-RESONVV",  S, xlc_snd_resonvv}, 
+  { "SND-SAMPLER",  S, xlc_snd_sampler}, 
+  { "SND-NORMALIZE",  S, xlc_snd_normalize}, 
+  { "SND-SHAPE",  S, xlc_snd_shape}, 
+  { "SND-SINE",  S, xlc_snd_sine}, 
+  { "SND-SIOSC",  S, xlc_snd_siosc}, 
+  { "SND-SLOPE",  S, xlc_snd_slope}, 
+  { "SND-SQRT",  S, xlc_snd_sqrt}, 
+  { "SND-TAPF",  S, xlc_snd_tapf}, 
+  { "SND-TAPV",  S, xlc_snd_tapv}, 
+  { "SND-TONE",  S, xlc_snd_tone}, 
+  { "SND-TONEV",  S, xlc_snd_tonev}, 
+  { "SND-UP",  S, xlc_snd_up}, 
+  { "SND-WHITE",  S, xlc_snd_white}, 
+  { "SND-STKREV",  S, xlc_snd_stkrev}, 
+  { "SND-STKPITSHIFT",  S, xlc_snd_stkpitshift}, 
+  { "SND-STKCHORUS",  S, xlc_snd_stkchorus}, 
+  { "SND-BOWED",  S, xlc_snd_bowed}, 
+  { "SND-BOWED_FREQ",  S, xlc_snd_bowed_freq}, 
+  { "SND-BANDEDWG",  S, xlc_snd_bandedwg}, 
+  { "SND-MANDOLIN",  S, xlc_snd_mandolin}, 
+  { "SND-SITAR",  S, xlc_snd_sitar}, 
+  { "SND-MODALBAR",  S, xlc_snd_modalbar}, 
+  { "SND-FLUTE",  S, xlc_snd_flute}, 
+  { "SND-FLUTE_FREQ",  S, xlc_snd_flute_freq}, 
+  { "SND-FLUTE_ALL",  S, xlc_snd_flute_all}, 
+  { "SND-FMFB",  S, xlc_snd_fmfb}, 
+  { "SND-FMFBV",  S, xlc_snd_fmfbv}, 
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndmax.c b/lib-src/libnyquist/nyquist/nyqsrc/sndmax.c
new file mode 100644
index 0000000..a91297b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndmax.c
@@ -0,0 +1,73 @@
+/* sndmax.c -- computes the maximum amplitude in a sound */
+
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  min->MIN; fix compiler warning
+ * 31Jan07 rbd  handle negative scale factors
+ */
+
+#ifdef UNIX
+#include "sys/types.h"
+#endif	
+#include <stdio.h>
+/* #include "snd.h" */
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "sndmax.h"
+#include "extern.h"
+
+double sound_max(LVAL snd_expr, long n)
+{
+    LVAL s_as_lval;
+    sound_type s = NULL;
+    long blocklen;
+    sample_block_values_type sbufp;
+    register double maximum = 0;
+
+    s_as_lval = xleval(snd_expr);
+    /* BE CAREFUL - DO NOT ALLOW GC TO RUN WHILE LVAL IS UNPROTECTED */
+    if (exttypep(s_as_lval, a_sound)) {
+        /* if snd_expr was simply a symbol, then s now points to
+        a shared sound_node.  If we read samples from it, then
+        the sound bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound_node.  We need to make the new
+        sound reachable by the garbage collector to that any
+        lisp data reachable from the sound do not get collected.
+        To make the sound reachable, we need to allocate a node,
+        and the GC might run, so we need to protect the OLD s
+        but then make it unreachable.
+        We will let the GC collect the sound in the end.
+        */
+        xlprot1(s_as_lval);
+        s = sound_copy(getsound(s_as_lval));
+        s_as_lval = cvsound(s);	/* destroys only ref. to original */
+        /* printf("sound_max: copy is %x, lval %x\n", s, s_as_lval); */
+        while (n > 0) {
+            long togo, j;
+            sample_block_type sampblock = 
+              sound_get_next(s, &blocklen);
+            if (sampblock == zero_block || blocklen == 0) {
+                break;
+            }
+            togo = MIN(blocklen, n);
+            sbufp = sampblock->samples;
+            for (j = 0; j < togo; j++) {
+                register double samp = *sbufp++;
+                if (samp > maximum) maximum = samp;
+                else if (-samp > maximum) maximum = -samp;
+            }
+            n -= togo;
+        }
+        xlpop();
+    } else {
+        xlerror("sound_max: expression did not return a sound",
+                 s_as_lval);
+    }
+    return fabs(maximum * s->scale);
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndmax.h b/lib-src/libnyquist/nyquist/nyqsrc/sndmax.h
new file mode 100644
index 0000000..b18f294
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndmax.h
@@ -0,0 +1,4 @@
+/* sndmax.h -- header to write sounds to files */
+
+double sound_max(LVAL snd_expr, long n);
+/* LISP: (SND-MAX ANY FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndread.c b/lib-src/libnyquist/nyquist/nyqsrc/sndread.c
new file mode 100644
index 0000000..5087abb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndread.c
@@ -0,0 +1,297 @@
+/* sndread.c -- read sound files */
+
+/* CHANGELOG
+ *
+ * 29Jun95  RBD  ULAW fixed problems with signed chars
+ * 28Apr03  dm   explicitly declare sndread_file_open_count as int
+ * 24Jul08  RBD & Judy Hawkins -- replace snd with PortAudio and libsndfile
+ */
+
+#include "switches.h"
+#include "stdio.h"
+#include "string.h"
+#ifdef UNIX
+#include "sys/file.h"
+#else
+/* #include <unistd.h> */
+#ifdef WINDOWS
+#include <sys/stat.h>
+#include "io.h"
+#else
+#include <stat.h>
+#endif
+#define L_SET SEEK_SET
+#define L_INCR SEEK_CUR
+#define PROTECTION 
+#endif
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "sndfile.h"
+#include "xlisp.h"
+#include "sound.h"
+#include "sndfmt.h"
+#include "falloc.h"
+#include "sndread.h"
+#include "multiread.h"
+
+/* file.h doesn't define O_RDONLY under RS6K AIX */
+#ifndef O_RDONLY
+#define O_RDONLY 0
+#endif
+
+static int sndread_file_open_count = 0;
+
+void read__fetch(susp, snd_list)
+  register read_susp_type susp;
+  snd_list_type snd_list;
+{
+    long n; /* jlh Changed type to long, trying to make move_samples_... work */
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+    /* allow up to 4 bytes/sample:  jlh -- does this need to be 8? */
+    /* FIX -- why 8? for doubles? Maybe it should be sizeof(sample). I think
+       this buffer was here to allow you to input any format and convert to
+       float. The assumption was no sample would be longer than 4 bytes and
+       after conversion, samples would be 4 byte floats. 
+    */
+    long in_count; /* jlh Trying to make move_samples_... work */
+
+    falloc_sample_block(out, "read__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    in_count = sf_readf_float(susp->sndfile, out_ptr, max_sample_block_len);
+
+    n = in_count;
+
+    /* don't read too many */
+    if (n > (susp->cnt - susp->susp.current)) {
+        n = susp->cnt - susp->susp.current;
+    }
+
+    snd_list->block_len = n;
+    susp->susp.current += n;
+
+    if (n == 0) {
+        /* we didn't read anything, but can't return length zero, so
+           convert snd_list to pointer to zero block */
+        snd_list_terminate(snd_list);
+    } else if (n < max_sample_block_len) {
+        /* this should close file and free susp */
+        snd_list_unref(snd_list->u.next);
+        /* if something is in buffer, terminate by pointing to zero block */
+        snd_list->u.next = zero_snd_list;
+    }
+} /* read__fetch */
+
+
+void read_free(read_susp_type susp)
+{
+    sf_close(susp->sndfile);
+    sndread_file_open_count--;
+    ffree_generic(susp, sizeof(read_susp_node), "read_free");
+}
+
+
+void read_print_tree(read_susp_type susp, int n)
+{
+}
+
+
+LVAL snd_make_read(
+  unsigned char *filename, 	/* file to read */
+  time_type offset, 	/* offset to skip (in seconds) */
+  time_type t0,		/* start time of resulting sound */
+  long *format,		/* AIFF, IRCAM, NeXT, etc. */
+  long *channels,	/* number of channels */
+  long *mode, 		/* sample format: PCM, ALAW, etc. */
+  long *bits,		/* BPS: bits per sample */
+  long *swap,           /* swap bytes */
+  double *srate,	/* srate: sample rate */
+  double *dur,		/* duration (in seconds) to read */
+  long *flags,		/* which parameters have been set */
+  long *byte_offset)	/* byte offset in file of first sample */
+{
+    register read_susp_type susp;
+    /* srate specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    sf_count_t frames;
+    double actual_dur;
+
+    falloc_generic(susp, read_susp_node, "snd_make_read");
+    memset(&(susp->sf_info), 0, sizeof(SF_INFO));
+
+    susp->sf_info.samplerate = ROUND(*srate);
+    susp->sf_info.channels = *channels;
+
+    switch (*mode) {
+    case SND_MODE_ADPCM:
+        susp->sf_info.format = SF_FORMAT_IMA_ADPCM;
+        break;
+    case SND_MODE_PCM:
+        if (*bits == 8) susp->sf_info.format = SF_FORMAT_PCM_S8;
+        else if (*bits == 16) susp->sf_info.format = SF_FORMAT_PCM_16;
+        else if (*bits == 24) susp->sf_info.format = SF_FORMAT_PCM_24;
+        else if (*bits == 32) susp->sf_info.format = SF_FORMAT_PCM_32;
+        else {
+            susp->sf_info.format = SF_FORMAT_PCM_16;
+            *bits = 16;
+        }
+        break;
+    case SND_MODE_ULAW:
+        susp->sf_info.format = SF_FORMAT_ULAW;
+        break;
+    case SND_MODE_ALAW:
+        susp->sf_info.format = SF_FORMAT_ALAW;
+        break;
+    case SND_MODE_FLOAT:
+        susp->sf_info.format = SF_FORMAT_FLOAT;
+        break;
+    case SND_MODE_UPCM:
+        susp->sf_info.format = SF_FORMAT_PCM_U8;
+        *bits = 8;
+        break;
+    }
+
+    if (*format == SND_HEAD_RAW) susp->sf_info.format |= SF_FORMAT_RAW;
+
+    if (*swap) {
+        /* set format to perform a byte swap (change from cpu endian-ness) */
+        /* write the code so it will only compile if one and only one 
+           ENDIAN setting is defined */
+#ifdef XL_LITTLE_ENDIAN
+        long format = SF_ENDIAN_BIG;
+#endif
+#ifdef XL_BIG_ENDIAN
+        long format = SF_ENDIAN_LITTLE;
+#endif
+        susp->sf_info.format |= format;
+    }
+
+    susp->sndfile = sf_open((const char *) filename, SFM_READ, 
+                            &(susp->sf_info));
+
+    if (!susp->sndfile) {
+        char error[240];
+        sprintf(error, "SND-READ: Cannot open file '%s'", filename);
+        xlfail(error);
+    }
+    if (susp->sf_info.channels < 1) {
+        sf_close(susp->sndfile);
+        xlfail("Must specify 1 or more channels");
+    }
+
+    /* report samplerate from file, but if user provided a double
+     * as sample rate, don't replace it with an integer.
+     */
+    if ((susp->sf_info.format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) {
+        *srate = susp->sf_info.samplerate;
+    }
+    /* compute dur */
+    frames = sf_seek(susp->sndfile, 0, SEEK_END);
+    actual_dur = ((double) frames) / *srate;
+    if (offset < 0) offset = 0;
+    /* round offset to an integer frame count */
+    frames = (sf_count_t) (offset * *srate + 0.5);
+    offset = ((double) frames) / *srate;
+    actual_dur -= offset;
+    if (actual_dur < 0) {
+        sf_close(susp->sndfile);
+        xlfail("SND-READ: offset is beyond end of file");
+    }
+    if (actual_dur < *dur) *dur = actual_dur;
+
+    sf_seek(susp->sndfile, frames, SEEK_SET); /* return to read loc in file */
+
+    /* initialize susp state */
+    susp->susp.sr = *srate;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = read_print_tree; /*jlh empty function... */
+    susp->susp.current = 0;
+    susp->susp.log_stop_cnt = UNKNOWN;
+    /* watch for overflow */
+    if (*dur * *srate + 0.5 > (unsigned long) 0xFFFFFFFF) {
+        susp->cnt = 0x7FFFFFFF;
+    } else {
+        susp->cnt = ROUND((*dur) * *srate);
+    }
+
+    switch (susp->sf_info.format & SF_FORMAT_TYPEMASK) {
+    case SF_FORMAT_WAV: *format = SND_HEAD_WAVE; break;
+    case SF_FORMAT_AIFF: *format = SND_HEAD_AIFF; break;
+    case SF_FORMAT_AU: *format = SND_HEAD_NEXT; break;
+    case SF_FORMAT_RAW: *format = SND_HEAD_RAW; break;
+    case SF_FORMAT_PAF: *format = SND_HEAD_PAF; break;
+    case SF_FORMAT_SVX: *format = SND_HEAD_SVX; break;
+    case SF_FORMAT_NIST: *format = SND_HEAD_NIST; break;
+    case SF_FORMAT_VOC: *format = SND_HEAD_VOC; break;
+    case SF_FORMAT_W64: *format = SND_HEAD_W64; break;
+    case SF_FORMAT_MAT4: *format = SND_HEAD_MAT4; break;
+    case SF_FORMAT_MAT5: *format = SND_HEAD_MAT5; break;
+    case SF_FORMAT_PVF: *format = SND_HEAD_PVF; break;
+    case SF_FORMAT_XI: *format = SND_HEAD_XI; break;
+    case SF_FORMAT_HTK: *mode = SND_HEAD_HTK; break;
+    case SF_FORMAT_SDS: *mode = SND_HEAD_SDS; break;
+    case SF_FORMAT_AVR: *mode = SND_HEAD_AVR; break;
+    case SF_FORMAT_WAVEX: *format = SND_HEAD_WAVE; break;
+    case SF_FORMAT_SD2: *format = SND_HEAD_SD2; break;
+    case SF_FORMAT_FLAC: *format = SND_HEAD_FLAC; break;
+    case SF_FORMAT_CAF: *format = SND_HEAD_CAF; break;
+    default: *format = SND_HEAD_NONE; break;
+    }
+    *channels = susp->sf_info.channels;
+    switch (susp->sf_info.format & SF_FORMAT_SUBMASK) {
+    case SF_FORMAT_PCM_S8: *bits = 8; *mode = SND_MODE_PCM; break;
+    case SF_FORMAT_PCM_16: *bits = 16; *mode = SND_MODE_PCM; break;
+    case SF_FORMAT_PCM_24: *bits = 24; *mode = SND_MODE_PCM; break;
+    case SF_FORMAT_PCM_32: *bits = 32; *mode = SND_MODE_PCM; break;
+    case SF_FORMAT_PCM_U8: *bits = 8; *mode = SND_MODE_UPCM; break;
+    case SF_FORMAT_FLOAT: *bits = 32; *mode = SND_MODE_FLOAT; break;
+    case SF_FORMAT_DOUBLE: *bits = 64; *mode = SND_MODE_DOUBLE; break;
+    case SF_FORMAT_ULAW: *bits = 8; *mode = SND_MODE_ULAW; break;
+    case SF_FORMAT_ALAW: *bits = 8; *mode = SND_MODE_ALAW; break;
+    case SF_FORMAT_IMA_ADPCM: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_MS_ADPCM: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_GSM610: *bits = 16; *mode = SND_MODE_GSM610; break;
+    case SF_FORMAT_VOX_ADPCM: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_G721_32: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_G723_24: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_G723_40: *bits = 16; *mode = SND_MODE_ADPCM; break;
+    case SF_FORMAT_DWVW_12: *bits = 12; *mode = SND_MODE_DWVW; break;
+    case SF_FORMAT_DWVW_16: *bits = 16; *mode = SND_MODE_DWVW; break;
+    case SF_FORMAT_DWVW_24: *bits = 24; *mode = SND_MODE_DWVW; break;
+    case SF_FORMAT_DWVW_N: *bits = 32; *mode = SND_MODE_DWVW; break;
+    case SF_FORMAT_DPCM_8: *bits = 8; *mode = SND_MODE_DPCM; break;
+    case SF_FORMAT_DPCM_16: *bits = 16; *mode = SND_MODE_DPCM; break;
+    default: *mode = SND_MODE_UNKNOWN; break;
+    }
+    sndread_file_open_count++;
+#ifdef MACINTOSH
+    if (sndread_file_open_count > 24) {
+        nyquist_printf("Warning: more than 24 sound files are now open\n");
+    }
+#endif
+    /* report info back to caller */
+    if ((susp->sf_info.format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) {
+        *flags = SND_HEAD_CHANNELS | SND_HEAD_MODE | SND_HEAD_BITS |
+                 SND_HEAD_SRATE | SND_HEAD_LEN | SND_HEAD_TYPE;
+    }    
+    if (susp->sf_info.channels == 1) {
+        susp->susp.fetch = read__fetch;
+        susp->susp.free = read_free;
+        susp->susp.name = "read";
+        return cvsound(sound_create((snd_susp_type)susp, t0, *srate, 
+                                    scale_factor));
+    } else {
+        susp->susp.fetch = multiread_fetch;
+        susp->susp.free = multiread_free;
+        susp->susp.name = "multiread";
+        return multiread_create(susp);
+    }
+}
+
+
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndread.h b/lib-src/libnyquist/nyquist/nyqsrc/sndread.h
new file mode 100644
index 0000000..73dd7fd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndread.h
@@ -0,0 +1,20 @@
+/* fileio.h -- Nyquist code to read sound files */
+
+/* for multiple channel files, one susp is shared by all sounds */
+/* the susp in turn must point back to all sound list tails */
+
+typedef struct read_susp_struct {
+    snd_susp_node susp;
+    SNDFILE *sndfile;
+    SF_INFO sf_info;
+    snd_list_type *chan;	/* array of back pointers */
+    long cnt;	/* how many sample frames to read */
+} read_susp_node, *read_susp_type;
+
+
+LVAL snd_make_read(unsigned char *filename, time_type offset, time_type t0,
+        long *format, long *channels, long *mode, long *bits, long *swap,
+        double *srate, double *dur, long *flags, long *byte_offset);
+/* LISP: (SND-READ STRING ANYNUM ANYNUM FIXNUM* FIXNUM* FIXNUM* FIXNUM* FIXNUM* ANYNUM* ANYNUM* FIXNUM^ FIXNUM^) */
+
+void read_free();
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c
new file mode 100644
index 0000000..edeb8b2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c
@@ -0,0 +1,349 @@
+/* sndseq.c -- return a signal until its logical stop, then
+   evaluate a closure to get a signal and convert to an add
+   of two signals */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "scale.h"
+#include "add.h"
+#include "extern.h"
+#include "cext.h"
+#include "assert.h"
+
+#define SNDSEQDBG 0
+#define D if (SNDSEQDBG) 
+
+/* Note: this structure is identical to an add_susp structure up
+   to the field output_per_s2 so that we can convert this into
+   an add after eval'ing the closure.  Since this struct is bigger
+   than an add, make sure not to clobber the "free" routine 
+   (sndseq_free) or else we'll leak memory.
+ */
+typedef struct sndseq_susp_struct {
+    snd_susp_node		susp;
+    boolean			started;
+    int                         terminate_bits;
+    long			terminate_cnt;
+    int                         logical_stop_bits;
+    boolean			logically_stopped;
+    sound_type			s1;
+    long			s1_cnt;
+    sample_block_type		s1_bptr;	/* block pointer */
+    sample_block_values_type	s1_ptr;
+    sound_type			s2;
+    long			s2_cnt;
+    sample_block_type		s2_bptr;	/* block pointer */
+    sample_block_values_type	s2_ptr;
+
+    /* support for interpolation of s2 */
+    sample_type s2_x1_sample;
+    double s2_phase;
+    double s2_phase_incr;
+
+    /* support for ramp between samples of s2 */
+    double output_per_s2;
+
+    /* sndseq-specific data starts here */
+    LVAL closure;
+
+} sndseq_susp_node, *sndseq_susp_type;
+
+
+void sndseq_fetch(sndseq_susp_type, snd_list_type);
+void sndseq_zero_fill_fetch(sndseq_susp_type, snd_list_type);
+void sndseq_free();
+
+extern LVAL s_stdout;
+
+void sndseq_mark(sndseq_susp_type susp)
+{
+/*    nyquist_printf("sndseq_mark(%x)\n", susp);*/
+/*    nyquist_printf("marking s1@%x in sndseq@%x\n", susp->s1, susp); */
+    sound_xlmark(susp->s1);
+    if (susp->closure) mark(susp->closure);
+}
+
+
+
+/* sndseq_fetch returns blocks of s1 until the logical stop time of s1 */
+/**/
+void sndseq_fetch(susp, snd_list)
+  register sndseq_susp_type susp;
+  snd_list_type snd_list;
+{
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+/*    nyquist_printf("sndseq_fetch called: s1_cnt %d\n", susp->s1_cnt); */
+    /*
+     * first compute how many samples to copy (or transfer)
+     */
+
+    /* get next samples; in add, the call is:
+     *   susp_check_term_log_block_samples(s1, s1_bptr, s1_ptr, s1_cnt, 1, 3);
+     *
+     * the plan here is tricky: if s1 has logically stopped, then evaluate
+     * the closure to get signal s2.  Then convert sndseq into an add.
+     */
+    if (susp->s1_cnt == 0) {
+        susp_get_block_samples(s1, s1_bptr, s1_ptr, s1_cnt);
+        if (susp->s1_ptr == zero_block->samples) {
+            susp->terminate_bits = 1;   /* mark s1 as terminated */
+        }
+/*	nyquist_printf("sndseq_fetch: s1-lsc %d, current %d cnt %d\n",
+               susp->s1->logical_stop_cnt, susp->s1->current, susp->s1_cnt); */
+    }
+
+    if (susp->s1->logical_stop_cnt != UNKNOWN &&
+        susp->s1->logical_stop_cnt == susp->s1->current - susp->s1_cnt) {
+        time_type now = susp->susp.t0 + susp->susp.current / susp->susp.sr;
+        /* note: cons args are protected from GC: */
+        LVAL result;
+        long delay;	/* sample delay to s2 */
+/*	stats();gc();stats();*/
+
+        xlsave1(result);
+
+D      nyquist_printf("sndseq_fetch: about to eval closure at %g, "
+                      "susp->susp.t0 %g, susp.current %d:\n",
+                      now, susp->susp.t0, (int)susp->susp.current);
+        result = xleval(cons(susp->closure, consa(cvflonum(now))));
+
+        susp->logical_stop_bits = 1;   /* mark s1 as logically stopped */
+        if (exttypep(result, a_sound)) {
+            susp->s2 = sound_copy(getsound(result));
+D           nyquist_printf("sndseq: copied result from closure is %p\n",
+                           susp->s2);
+        } else xlerror("closure did not return a (monophonic) sound", result);
+D        nyquist_printf("in sndseq: logically stopped; "
+                        "%p returned from evform\n",
+                        susp->s2);
+        susp->closure = NULL;   /* allow garbage collection now */
+        result = NIL;
+
+        /**** Now convert to add ****/
+        susp->susp.mark = add_mark;
+        susp->susp.log_stop_cnt = UNKNOWN; /* will be recomputed by add */
+        susp->susp.print_tree = add_print_tree;
+
+        /* assume sample rates are the same */
+        if (susp->s1->sr != susp->s2->sr) 
+            xlfail("in sndseq: sample rates must match");
+
+        /* take care of scale factor, if any */
+        if (susp->s2->scale != 1.0) {
+            // stdputstr("normalizing next sound in a seq\n");
+            susp->s2 = snd_make_normalize(susp->s2);
+        }
+
+        /* figure out which add fetch routine to use */
+        delay = ROUND((susp->s2->t0 - now) * susp->s1->sr);
+        if (susp->terminate_bits) {     /* s1 is done, just get s2 now */
+            sound_unref(susp->s1);
+            susp->s1 = NULL;
+            if (delay > 0) {   /* need to fill zeros */
+                susp->susp.fetch = add_zero_fill_nn_fetch;
+                susp->susp.name = "sndseq:add_zero_fill_nn_fetch";
+            } else {
+                susp->susp.fetch = add_s2_nn_fetch;
+                susp->susp.name = "sndseq:add_s2_nn_fetch";
+            }		
+        } else if (delay > 0) {    /* fill hole between s1 and s2 */
+D	    stdputstr("using add_s1_nn_fetch\n");
+            susp->susp.fetch = add_s1_nn_fetch;
+            susp->susp.name = "sndseq:add_s1_nn_fetch";
+        } else {
+            susp->susp.fetch = add_s1_s2_nn_fetch;
+            susp->susp.name = "sndseq:add_s1_s2_nn_fetch";
+        }
+
+        susp->s2_phase_incr = susp->s2->sr / susp->susp.sr;
+        susp->output_per_s2 = susp->susp.sr / susp->s2->sr;
+
+D        stdputstr("in sndseq: calling add's fetch\n");
+        (*(susp->susp.fetch))(susp, snd_list);
+D        stdputstr("in sndseq: returned from add's fetch\n");
+/*	gc();*/
+        xlpop();
+        return;
+    }
+
+    /* don't run past the s1 input sample block: */
+    togo = susp->s1_cnt;
+/*    nyquist_printf("sndseq_fetch: togo initially %d then ", togo); */
+    
+    /* don't run past terminate time */
+    if (susp->terminate_cnt != UNKNOWN &&
+        susp->terminate_cnt <= susp->susp.current + togo) {
+        togo = susp->terminate_cnt - susp->susp.current;
+    }
+    
+    /* don't run past logical stop time */
+    if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+        int to_stop = susp->susp.log_stop_cnt - susp->susp.current;
+        togo = MIN(togo, to_stop);
+    }
+    assert(togo >= 0);
+
+/*    nyquist_printf("%d\n", togo);*/
+    /*
+     * two cases: copy a partial block or manipulate pointers for copyless
+     * transfer of whole block (may not be full block):
+     *
+     * copy partial block when:
+     *   o samples begin in middle of block
+     *   o stopping time is before end of block (when other signal splits
+     *     the block for this signal).  This happens if the logical
+     *     stop time was externally dictated and falls mid-block.
+     * transfer (copyless) block when:
+     *   o the block is of maximum size
+     *   o the block is small due to logical stop time or termination time
+     */
+    if (susp->s1_ptr == susp->s1_bptr->samples && susp->s1_cnt == togo) {
+        /*
+         * we want to copy this whole block (starting at the beginning
+         * and going to the rest of the block) -- just do pointers.
+         */
+
+        /* just fetch and pass blocks on */
+/*	nyquist_printf("sndseq (s1_nn) %x starting uncopy, togo %d\n", susp, togo); */
+        snd_list->block = susp->s1_bptr;
+        /* the zero_block indicates termination, don't copy it! Use
+         * internal_zero_block instead.  It is also filled with zeros,
+         * but does not indicate termination.  We must check for zero_block
+         * because the signal may have a logical stop time specified that
+         * extends beyond its termination time.
+         */
+        if (snd_list->block == zero_block)
+            snd_list->block = internal_zero_block;
+        (snd_list->block->refcnt)++;
+/*	nyquist_printf("sndseq (s1_nn) %x shared block %x\n", susp, susp->s1_bptr);*/
+
+        susp_took(s1_cnt, togo);
+        snd_list->block_len = togo;
+    } else {
+        /*
+         * we want to copy a partial block
+         */
+
+        /* snd_list is the one with a null block */
+        /* put a fresh, clean block in the snd_list (get new snd_list later) */
+        falloc_sample_block(out, "sndseq_fetch");
+        snd_list->block = out;
+        out_ptr = out->samples;
+        /* nyquist_printf("sndseq (s1_nn) %x new block %x\n", susp, out); */
+
+        n = togo;
+        /* nyquist_printf("sndseq (s1_nn) %x starting copy loop, togo %d\n", susp, togo); */
+        while (n--) { /* the inner sample computation loop */
+            /* scale? */
+            *out_ptr++ = *(susp->s1_ptr++);
+        } /* inner loop */
+
+        susp_took(s1_cnt, togo);
+        snd_list->block_len = togo;
+    }
+
+    /* add a new snd_list for the susp */
+    susp->susp.current += togo;
+
+} /* sndseq_fetch */
+
+
+void sndseq_free(sndseq_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(sndseq_susp_node), "sndseq_free");
+}
+
+
+void sndseq_print_tree(sndseq_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("closure:");
+    stdprint(susp->closure);
+
+    indent(n);
+    stdputstr("s2:");
+    sound_print_tree_1(susp->s2, n);
+}
+
+
+
+
+sound_type snd_make_sndseq(s1, closure)
+  sound_type s1;
+  LVAL closure;
+{
+    register sndseq_susp_type susp;
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    sound_type result;
+
+    xlprot1(closure);
+    falloc_generic(susp, sndseq_susp_node, "snd_make_sndseq");
+
+    if (s1->scale != 1.0) {
+        /* stdputstr("normalizing first sound in a seq\n"); */
+        s1 = snd_make_normalize(s1);
+    }
+
+    susp->susp.fetch = sndseq_fetch;
+
+    susp->terminate_cnt = UNKNOWN;
+    susp->terminate_bits = 0;   /* bits for s1 and s2 termination */
+    susp->logical_stop_bits = 0;    /* bits for s1 and s2 logical stop */
+
+    /* initialize susp state */
+    susp->susp.free = sndseq_free;
+    susp->susp.sr = s1->sr;
+    susp->susp.t0 = s1->t0;
+    susp->susp.mark = sndseq_mark;
+    susp->susp.print_tree = sndseq_print_tree;
+    susp->susp.name = "sndseq";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = s1->logical_stop_cnt;
+    if (!(susp->susp.log_stop_cnt >= 0 || susp->susp.log_stop_cnt == UNKNOWN)) {
+        xlerror("Behaviors in SEQ must appear in chronological order", closure);
+    }
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = NULL;
+    susp->s2_cnt = 0;
+    susp->s2_phase = 0.0;
+/*  susp->s2_phase_incr = ??
+    susp->output_per_s2 = ?? */
+    susp->closure = closure;
+    result = sound_create((snd_susp_type)susp, susp->susp.t0, susp->susp.sr, scale_factor);
+    xlpopn(1);
+    return result;
+}
+
+
+sound_type snd_sndseq(s1, closure)
+  sound_type s1;
+  LVAL closure;
+{
+    sound_type s1_copy;
+    s1_copy = sound_copy(s1);
+    return snd_make_sndseq(s1_copy, closure);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndseq.h b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.h
new file mode 100644
index 0000000..03fdd11
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.h
@@ -0,0 +1,3 @@
+sound_type snd_make_sndseq();
+sound_type snd_sndseq();
+    /* LISP: (SND-SEQ SOUND ANY) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.h b/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.h
new file mode 100644
index 0000000..ade86ba
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.h
@@ -0,0 +1,5 @@
+/* sndsliders.h -- support for graphical sliders in Nyquist IDE */
+
+sound_type snd_make_slider(int index, time_type t0, rate_type sr, time_type d);
+sound_type snd_slider(int index, time_type t0, rate_type sr, time_type d);
+    /* LISP: (SND-SLIDER FIXNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c
new file mode 100644
index 0000000..653ce37
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c
@@ -0,0 +1,640 @@
+/* sndwrite.c -- write sounds to files */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+#include "stdlib.h"
+#include "switches.h"
+#include "string.h"
+#ifdef UNIX
+#include "sys/types.h"
+#endif
+#ifdef WINDOWS
+#include <io.h>
+#endif
+#include <stdio.h>
+/* include sound.h first because it includes math.h 
+ * which declares abs(). cext.h #defines abs()!
+ * sound.h depends on xlisp.h
+ */
+#include "xlisp.h"
+#include "sound.h"
+#include "cext.h"
+#include "userio.h"
+#include "falloc.h"
+#include "sndwrite.h"
+#include "extern.h"
+#include "snd.h"
+#ifdef UNIX
+#include "sys/file.h"
+/* #include <sys/stat.h>*/
+/* #include <netinet/in.h> */
+#else
+#ifdef MACINTOSH
+#include <unistd.h>
+#include <stat.h>
+#define L_SET SEEK_SET
+#define L_INCR SEEK_CUR
+#endif
+#endif
+
+#define D if (0) 
+
+int sndwrite_trace = 0;	/* debugging */
+
+sample_type sound_save_sound(LVAL s_as_lval, long n, snd_type snd,
+                             char *buf, long *ntotal, snd_type player);
+
+sample_type sound_save_array(LVAL sa, long n, snd_type snd, 
+                             char *buf, long *ntotal, snd_type player);
+
+unsigned char st_linear_to_ulaw(int sample);
+
+
+typedef struct {
+    sound_type sound;
+    long cnt;
+    sample_block_values_type ptr;
+    double scale;
+    int terminated;
+} sound_state_node, *sound_state_type;
+
+
+LVAL prepare_audio(LVAL play, snd_type snd, snd_type player)
+{
+    long flags;
+    if (play == NIL) return NIL;
+    player->format = snd->format;
+    player->u.audio.devicename[0] = 0;
+    player->u.audio.interfacename[0] = 0;
+    if (snd_open(player, &flags) != SND_SUCCESS) {
+        xlabort("snd_save -- could not open audio output");
+    }
+    /* make sure player and snd are compatible -- if not, set player to NULL
+     * and print a warning message
+     */
+    if (player->format.channels == snd->format.channels &&
+        player->format.mode == snd->format.mode &&
+        player->format.bits == snd->format.bits) {
+        /* ok so far, check out the sample rate */
+        if (player->format.srate != snd->format.srate) {
+            char msg[100];
+            sprintf(msg, "%s(%g)%s(%g).\n",
+                    "Warning: file sample rate ", snd->format.srate,
+                    " differs from audio playback sample rate ",
+                    player->format.srate);
+            stdputstr(msg);
+        }
+    } else {
+        stdputstr("File format not supported by audio output.\n");
+        return NIL;
+    }
+    return play;
+}
+
+
+/* finish_audio -- flush the remaining samples, then close */
+/**/
+void finish_audio(snd_type player)
+{
+    /* note that this is a busy loop! */
+    while (snd_flush(player) != SND_SUCCESS) ;
+    snd_close(player);
+}
+
+
+/* write_to_audio -- handle audio output from buffer */
+/*
+ * We want to write as soon as space is available so that
+ * a full sound buffer can be queued up for output. This
+ * may require transferring only part of buf, so we keep
+ * track of progress and output whenever space is available.
+ */
+void write_to_audio(snd_type player, void *buf, long buflen)
+{
+    long rslt;
+    while (buflen) {
+            /* this loop is a busy-wait loop! */
+        rslt = snd_poll(player); /* wait for buffer space */
+        rslt = min(rslt, buflen);
+        if (rslt) {
+            snd_write(player, buf, rslt);
+            buf = (void *) ((char *) buf + 
+                            (rslt * snd_bytes_per_frame(player)));
+            buflen -= rslt;
+        }
+    }    
+}
+
+
+double sound_save(
+  LVAL snd_expr,
+  long n,
+  unsigned char *filename,
+  long format,
+  long mode,
+  long bits,
+  long swap,
+  double *sr,
+  long *nchans,
+  double *duration,
+  LVAL play)
+{
+    LVAL result;
+    char *buf;
+    long ntotal;
+    double max_sample;
+    snd_node snd;
+    snd_node player;
+    long flags;
+
+    snd.device = SND_DEVICE_FILE;
+    snd.write_flag = SND_WRITE;
+    strcpy(snd.u.file.filename, (char *) filename);
+    snd.u.file.file = -1;	/* this is a marker that snd is unopened */
+    snd.u.file.header = format;
+    snd.format.mode = mode;
+    snd.format.bits = bits;
+    snd.u.file.swap = swap;
+
+    player.device = SND_DEVICE_AUDIO;
+    player.write_flag = SND_WRITE;
+    player.u.audio.devicename[0] = '\0';
+    player.u.audio.descriptor = NULL;
+    player.u.audio.protocol = SND_COMPUTEAHEAD;
+    player.u.audio.latency = 1.0;
+    player.u.audio.granularity = 0.0;
+
+    if ((buf = (char *) malloc(max_sample_block_len * MAX_SND_CHANNELS *
+                                  sizeof(float))) == NULL) {
+        xlabort("snd_save -- couldn't allocate memory");
+    }
+
+    result = xleval(snd_expr);
+    /* BE CAREFUL - DO NOT ALLOW GC TO RUN WHILE RESULT IS UNPROTECTED */
+    if (vectorp(result)) {
+        /* make sure all elements are of type a_sound */
+        long i = getsize(result);
+        *nchans = snd.format.channels = i;
+        while (i > 0) {
+            i--;
+            if (!exttypep(getelement(result, i), a_sound)) {
+                xlerror("sound_save: array has non-sound element",
+                         result);
+            }
+        }
+        /* assume all are the same: */
+        *sr = snd.format.srate = getsound(getelement(result, 0))->sr; 
+
+        /* note: if filename is "", then don't write file; therefore,
+         * write the file if (filename[0])
+         */ 
+        if (filename[0] && snd_open(&snd, &flags) != SND_SUCCESS) {
+            xlabort("snd_save -- could not open sound file");
+        }
+        
+        play = prepare_audio(play, &snd, &player);
+
+        max_sample = sound_save_array(result, n, &snd,
+                         buf, &ntotal, (play == NIL ? NULL : &player));
+        *duration = ntotal / *sr;
+        if (filename[0]) snd_close(&snd);
+        if (play != NIL) finish_audio(&player);
+    } else if (exttypep(result, a_sound)) {
+        *nchans = snd.format.channels = 1;
+        *sr = snd.format.srate = (getsound(result))->sr;
+        if (filename[0] && snd_open(&snd, &flags) != SND_SUCCESS) {
+            xlabort("snd_save -- could not open sound file");
+        }
+
+        play = prepare_audio(play, &snd, &player);
+
+        max_sample = sound_save_sound(result, n, &snd,
+                        buf, &ntotal, (play == NIL ? NULL : &player));
+        *duration = ntotal / *sr;
+        if (filename[0]) snd_close(&snd);
+        if (play != NIL) finish_audio(&player);
+    } else {
+        xlerror("sound_save: expression did not return a sound",
+                 result);
+        max_sample = 0.0;
+    }
+    free(buf);
+    return max_sample;
+}
+
+
+double sound_overwrite(
+  LVAL snd_expr,
+  long n,
+  unsigned char *filename,
+  long byte_offset,
+  long header,
+  long mode,
+  long bits,
+  long swap,
+  double sr,
+  long nchans,
+  double *duration)
+{
+    LVAL result;
+    char *buf;
+    char error[140];
+    long ntotal;
+    double max_sample;
+    snd_node snd;
+    long flags;
+
+    snd.device = SND_DEVICE_FILE;
+    snd.write_flag = SND_OVERWRITE;
+    strcpy(snd.u.file.filename, (char *) filename);
+    snd.u.file.header = header;
+    snd.u.file.byte_offset = byte_offset;
+    snd.format.channels = nchans;
+    snd.format.mode = mode;
+    snd.format.bits = bits;
+    snd.u.file.swap = swap;
+    snd.format.srate = sr;
+
+    if ((buf = (char *) malloc(max_sample_block_len * MAX_SND_CHANNELS *
+                                  sizeof(float))) == NULL) {
+        xlabort("snd_overwrite: couldn't allocate memory");
+    }
+
+    if (snd_open(&snd, &flags) != SND_SUCCESS) {
+        sprintf(error,
+                "snd_overwrite: cannot open file %s and seek to %d", 
+                filename, (int)byte_offset);
+        free(buf);
+        xlabort(error);
+    }
+
+    result = xleval(snd_expr);
+    /* BE CAREFUL - DO NOT ALLOW GC TO RUN WHILE RESULT IS UNPROTECTED */
+    if (vectorp(result)) {
+        /* make sure all elements are of type a_sound */
+        long i = getsize(result);
+        if (nchans != i) {
+            sprintf(error, "%s%d%s%d%s", 
+                    "snd_overwrite: number of channels in sound (",
+                    (int)i,
+                    ") does not match\n    number of channels in file (",
+                    (int)nchans,
+                    ")");
+            free(buf);
+            snd_close(&snd);
+            xlabort(error);
+        }
+        while (i > 0) {
+            i--;
+            if (!exttypep(getelement(result, i), a_sound)) {
+                free(buf);
+                snd_close(&snd);
+                xlerror("sound_save: array has non-sound element",
+                         result);
+            }
+        }
+        /* assume all are the same: */
+        if (sr != getsound(getelement(result, 0))->sr) {
+            sprintf(error, "%s%g%s%g%s",
+                    "snd_overwrite: sample rate in sound (",
+                    getsound(getelement(result, 0))->sr,
+                    ") does not match\n    sample rate in file (",
+                    sr,
+                    ")"); 
+            free(buf);
+            snd_close(&snd);
+            xlabort(error);
+        }
+        
+        max_sample = sound_save_array(result, n, &snd, buf, &ntotal, NULL);
+        *duration = ntotal / sr;
+    } else if (exttypep(result, a_sound)) {
+        if (nchans != 1) {
+            sprintf(error, "%s%s%d%s", 
+                    "snd_overwrite: number of channels in sound (1",
+                    ") does not match\n    number of channels in file (",
+                    (int)nchans,
+                    ")");
+            free(buf);
+            snd_close(&snd);
+            xlabort(error);
+        }
+            
+        if (sr != getsound(result)->sr) {
+            sprintf(error, "%s%g%s%g%s",
+                    "snd_overwrite: sample rate in sound (",
+                    getsound(result)->sr,
+                    ") does not match\n    sample rate in file (",
+                    sr,
+                    ")"); 
+            free(buf);
+            snd_close(&snd);
+            xlabort(error);
+        }
+        
+        max_sample = sound_save_sound(result, n, &snd, buf, &ntotal, NULL);
+        *duration = ntotal / sr;
+    } else {
+        free(buf);
+        snd_close(&snd);
+        xlerror("sound_save: expression did not return a sound",
+                 result);
+        max_sample = 0.0;
+    }
+    free(buf);
+    snd_close(&snd);
+    return max_sample;
+}
+
+
+cvtfn_type find_cvt_to_fn(snd_type snd, char *buf)
+{
+    cvtfn_type cvtfn;
+    /* find the conversion function */
+    if (snd->format.bits == 8) cvtfn = cvt_to_8[snd->format.mode];
+    else if (snd->format.bits == 16) cvtfn = cvt_to_16[snd->format.mode];
+    else if (snd->format.bits == 24) cvtfn = cvt_to_24[snd->format.mode];
+    else if (snd->format.bits == 32) cvtfn = cvt_to_32[snd->format.mode];
+    else cvtfn = cvt_to_unknown;
+
+    if (cvtfn == cvt_to_unknown) {
+        char error[50];
+        sprintf(error, "Cannot write %d-bit samples in mode %s",
+                (int)snd->format.bits, snd_mode_to_string(snd->format.mode));
+        free(buf);
+        snd_close(snd);
+        xlabort(error);
+    }
+    return cvtfn;
+}
+
+
+sample_type sound_save_sound(LVAL s_as_lval, long n, snd_type snd,
+                             char *buf, long *ntotal, snd_type player)
+{
+    long blocklen;
+    long buflen;
+    sound_type s;
+    long debug_unit;    /* print messages at intervals of this many samples */
+    long debug_count;   /* next point at which to print a message */
+    sample_type max_sample = 0.0F;
+    cvtfn_type cvtfn;
+    *ntotal = 0;
+
+    /* if snd_expr was simply a symbol, then s now points to
+        a shared sound_node.  If we read samples from it, then
+        the sound bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound_node.  We need to make the new
+        sound reachable by the garbage collector to that any
+        lisp data reachable from the sound do not get collected.
+        To make the sound reachable, we need to allocate a node,
+        and the GC might run, so we need to protect the OLD s
+        but then make it unreachable.
+        We will let the GC collect the sound in the end.
+    */
+    xlprot1(s_as_lval);
+    s = sound_copy(getsound(s_as_lval));
+    s_as_lval = cvsound(s);	/* destroys only ref. to original */
+
+    /* for debugging */
+/*    printing_this_sound = s;*/
+
+
+    debug_unit = debug_count = (long) max(snd->format.srate, 10000.0);
+
+    cvtfn = find_cvt_to_fn(snd, buf);
+
+#ifdef MACINTOSH
+    if (player) {
+        gprintf(TRANS, "Playing audio: Click and hold mouse button to stop playback.\n");
+    }
+#endif
+
+    while (n > 0) {
+        long togo;
+        float peak;
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        oscheck();
+#ifdef SNAPSHOTS
+        stdputstr(".");
+        if (sound_created_flag) {
+            stdputstr("SNAPSHOT: ");
+            sound_print_tree(printing_this_sound);
+            sound_created_flag = false;
+        }
+        fflush(stdout);
+#endif
+        if (sampblock == zero_block || blocklen == 0) {
+            break;
+        }
+        togo = min(blocklen, n);
+
+        buflen = (*cvtfn)((void *) buf, (void *) sampblock->samples,
+                          togo, s->scale, &peak);
+        if (peak > max_sample) max_sample = peak;
+
+#ifdef MACINTOSH
+        if (Button()) {
+            if (player) {
+                snd_reset(player);
+            }
+            gprintf(TRANS, "\n\nStopping playback...\n\n\n");
+            break;
+        }
+#endif
+
+        if (snd->u.file.file != -1) snd_write(snd, (void *) buf, buflen);
+        if (player) write_to_audio(player, (void *) buf, buflen);
+
+        n -= togo;
+        *ntotal += togo;
+        if (*ntotal > debug_count) {
+            gprintf(TRANS, " %d ", *ntotal);
+            fflush(stdout);
+            debug_count += debug_unit;
+        }
+    }
+    gprintf(TRANS, "\ntotal samples: %d\n", *ntotal);
+    xlpop();
+    return max_sample;
+}
+
+
+sample_type sound_save_array(LVAL sa, long n, snd_type snd, 
+                             char *buf, long *ntotal, snd_type player)
+{
+    long i, chans;
+    long buflen;
+    sound_state_type state;
+    double start_time = HUGE_VAL;
+    float *float_bufp;
+    LVAL sa_copy;
+    long debug_unit;    /* print messages at intervals of this many samples */
+    long debug_count;   /* next point at which to print a message */
+    sample_type max_sample = 0.0F;
+    cvtfn_type cvtfn;
+
+    *ntotal = 0;
+
+    /* THE ALGORITHM: first merge floating point samples from N channels
+     * into consecutive multi-channel frames in buf.  Then, treat buf
+     * as just one channel and use one of the cvt_to_* functions to
+     * convert the data IN PLACE in the buffer (this is ok because the
+     * converted data will never take more space than the original 32-bit
+     * floats, so the converted data will not overwrite any floats before
+     * the floats are converted
+     */
+
+    /* if snd_expr was simply a symbol, then sa now points to
+        a shared sound_node.  If we read samples from it, then
+        the sounds bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound array.  See also sound_save_sound()
+    */
+    chans = getsize(sa);
+    if (chans > MAX_SND_CHANNELS) {
+        xlerror("sound_save: too many channels", sa);
+        free(buf);
+        snd_close(snd);
+    }
+    xlprot1(sa);
+    sa_copy = newvector(chans);
+    xlprot1(sa_copy);
+
+    /* Why do we copy the array into an xlisp array instead of just
+     * the state[i] array? Because some of these sounds may reference
+     * the lisp heap. We must put the sounds in an xlisp array so that
+     * the gc will find and mark them. xlprot1(sa_copy) makes the array
+     * visible to gc.
+     */
+    for (i = 0; i < chans; i++) {
+        sound_type s = getsound(getelement(sa, i));
+        setelement(sa_copy, i, cvsound(sound_copy(s)));
+    }
+    sa = sa_copy;	/* destroy original reference to allow GC */
+
+    state = (sound_state_type) malloc(sizeof(sound_state_node) * chans);
+    for (i = 0; i < chans; i++) {
+        state[i].sound = getsound(getelement(sa, i));
+        state[i].scale = state[i].sound->scale;
+D       nyquist_printf("save scale factor %d = %g\n", (int)i, state[i].scale);
+        state[i].terminated = false;
+        state[i].cnt = 0;   /* force a fetch */
+        start_time = min(start_time, state[i].sound->t0);
+    }
+
+    for (i = 0; i < chans; i++) {
+        if (state[i].sound->t0 > start_time)
+            sound_prepend_zeros(state[i].sound, start_time);
+    }
+
+    /* for debugging */
+/*    printing_this_sound = s;*/
+
+    cvtfn = find_cvt_to_fn(snd, buf);
+
+#ifdef MACINTOSH
+    if (player) {
+        gprintf(TRANS, "Playing audio: Click and hold mouse button to stop playback.\n");
+    }
+#endif
+
+    debug_unit = debug_count = (long) max(snd->format.srate, 10000.0);
+
+    while (n > 0) {
+        /* keep the following information for each sound:
+            has it terminated?
+            pointer to samples
+            number of samples remaining in block
+           scan to find the minimum remaining samples and
+           output that many in an inner loop.  Stop outer
+           loop if all sounds have terminated
+         */
+        int terminated = true;
+        int togo = n;
+        int j;
+        float peak;
+
+        oscheck();
+
+        for (i = 0; i < chans; i++) {
+            if (state[i].cnt == 0) {
+                if (sndwrite_trace) {
+                    nyquist_printf("CALLING SOUND_GET_NEXT "
+                                   "ON CHANNEL %d (%p)\n",
+                                   (int)i, state[i].sound);
+                    sound_print_tree(state[i].sound);
+                }
+                state[i].ptr = sound_get_next(state[i].sound,
+                                   &(state[i].cnt))->samples;
+                if (sndwrite_trace) {
+                    nyquist_printf("RETURNED FROM CALL TO SOUND_GET_NEXT "
+                                   "ON CHANNEL %d\n", (int)i);
+                }
+                if (state[i].ptr == zero_block->samples) {
+                    state[i].terminated = true;
+                }
+            }
+            if (!state[i].terminated) terminated = false;
+            togo = min(togo, state[i].cnt);
+        }
+
+        if (terminated) break;
+
+        float_bufp = (float *) buf;
+        for (j = 0; j < togo; j++) {
+            for (i = 0; i < chans; i++) {
+                double s = *(state[i].ptr++) * state[i].scale; 
+                *float_bufp++ = (float) s;
+            }
+        }
+        // we're treating sound as mono for the conversion, so multiply
+        // togo by chans to get proper number of samples, and divide by
+        // chans to convert back to frame count required by snd_write
+        buflen = (*cvtfn)((void *) buf, (void *) buf, togo * chans, 1.0F, 
+                          &peak) / chans;
+        if (peak > max_sample) max_sample = peak;
+#ifdef MACINTOSH
+        if (Button()) {
+            if (player) {
+                snd_reset(player);
+            }
+            gprintf(TRANS, "\n\nStopping playback...\n\n\n");
+            break;
+        }
+#endif
+
+        if (snd->u.file.file != -1) snd_write(snd, (void *) buf, buflen);
+        if (player) write_to_audio(player, (void *) buf, buflen);
+
+        n -= togo;
+        for (i = 0; i < chans; i++) {
+            state[i].cnt -= togo;
+        }
+        *ntotal += togo;
+        if (*ntotal > debug_count) {
+            gprintf(TRANS, " %d ", *ntotal);
+            fflush(stdout);
+            debug_count += debug_unit;
+        }
+    }
+    gprintf(TRANS, "total samples: %d x %d channels\n",
+           *ntotal, chans);
+
+    /* references to sounds are shared by sa_copy and state[].
+     * here, we dispose of state[], allowing GC to do the
+     * sound_unref call that frees the sounds. (Freeing them now
+     * would be a bug.)
+     */
+    free(state);
+    xlpop();
+    return max_sample;
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.h b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.h
new file mode 100644
index 0000000..192317e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.h
@@ -0,0 +1,12 @@
+/* sndwrite.h -- header to write sounds to files */
+
+double sound_save(LVAL snd_expr, long n,
+          unsigned char *filename, long format,
+          long mode, long bits, long swap, double *sr, long *nchans,
+          double *duration, LVAL play);
+/* LISP: (SND-SAVE ANY FIXNUM STRING FIXNUM FIXNUM FIXNUM FIXNUM ANYNUM^ FIXNUM^ ANYNUM^ ANY) */
+
+double sound_overwrite(LVAL snd_expr, long n,
+               unsigned char *filename, double offset_secs, long format,
+               long mode, long bits, long swap, double *duration);
+/* LISP: (SND-OVERWRITE ANY FIXNUM STRING ANYNUM FIXNUM FIXNUM FIXNUM FIXNUM ANYNUM^) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c b/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c
new file mode 100644
index 0000000..a0591cc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c
@@ -0,0 +1,821 @@
+/* sndwrite.c -- write sounds to files */
+
+#include "stdlib.h"
+#include "switches.h"
+#include "string.h"
+#ifdef UNIX
+#include "sys/types.h"
+#endif
+#ifdef WINDOWS
+#include <io.h>
+#endif
+#include <stdio.h>
+/* include sound.h first because it includes math.h 
+ * which declares abs(). cext.h #defines abs()!
+ * sound.h depends on xlisp.h
+ */
+#include "xlisp.h"
+#include "sound.h"
+#include "cext.h"
+#include "userio.h"
+#include "falloc.h"
+#include "sndfmt.h"
+#include "sndwrite.h"
+#include "extern.h"
+#include "sndfile.h"
+
+#ifdef UNIX
+#include "sys/file.h"
+/* #include <sys/stat.h>*/
+#include <netinet/in.h>
+#else
+#ifdef MACINTOSH
+#include <unistd.h>
+#include <stat.h>
+#define L_SET SEEK_SET
+#define L_INCR SEEK_CUR
+#endif
+#endif
+
+/* Previously, Nyquist would wrap samples that 
+ * overflowed -- this produces horrible output, 
+ * but makes it really easy to detect clipping,
+ * which I found helpful in my own work and good 
+ * for students too since the effect is impossible
+ * to ignore. Now that Nyquist is doing IO to
+ * libraries that clip, we're going to artificially
+ * generate the wrapping here. This is floating point
+ * wrapping, so +1.0 does not wrap (it would if it
+ * were an integer since the maximum sample value for
+ * 16-bit data is a bit less than 1.) Since this is extra
+ * overhead, I'm trying to be a bit clever by using
+ * the compare to max_sample to eliminate compares
+ * for clipping in the common case.
+ * 
+ * INPUTS: max_sample -- initially 0.0
+ *         threshold -- initially 0.0
+ *         s -- the value of the current sample
+ *         x -- if s has to be wrapped, put the value here
+ */
+#define COMPUTE_MAXIMUM_AND_WRAP(x) \
+    if (s > threshold) { \
+        if (s > max_sample) { \
+            max_sample = s; \
+            threshold = min(1.0, s); \
+        } \
+        if (s > 1.0) { \
+            s = fmod(s + 1.0, 2.0) - 1.0; \
+            (x) = s; \
+        } \
+    } else if (s < -threshold) { \
+        if (s < -max_sample) { \
+            max_sample = -s; \
+            threshold = min(1.0, -s); \
+        } \
+        if (s < -1.0) { \
+            s = -(fmod(-s + 1.0, 2.0) - 1.0); \
+            (x) = s; \
+        } \
+    }
+// the s < -threshold case is tricky: 
+//    flip the signal, do the wrap, flip again
+//    in order to pass positive values to fmod
+
+
+/* When not using PCM encodings, we do not wrap
+ * samples -- therefore float sample formats do 
+ * not wrap or clip when written to sound files
+ */
+#define COMPUTE_MAXIMUM() \
+        if (s > max_sample) { \
+            max_sample = s; \
+        } else if (s < -max_sample) { \
+            max_sample = -s; \
+        }
+
+
+/* jlh Changed these to the <> format, so it will be sought for in the
+   include path */
+#include <portaudio.h>
+/* #include "exitpa.h" jlh obsolete? or windows only? PortAudio 2007
+                       has no such thing.  Is it PA 19 or PA 2.0??? */
+
+long flush_count = 0; /* how many samples to write to finish */
+
+#define D if (0) 
+
+int sndwrite_trace = 0;	/* debugging */
+
+static int portaudio_initialized = false; /* is PortAudio initialized? */
+
+void portaudio_exit()
+{
+    if (portaudio_initialized) {
+        Pa_Terminate();
+    }
+}
+
+
+sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, SNDFILE *snd_file,
+                             float *buf, long *ntotal, PaStream *audio_stream);
+
+sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, SNDFILE *snd_file,
+                             float *buf, long *ntotal, PaStream *audio_stream);
+
+unsigned char st_linear_to_ulaw(int sample);/* jlh not used anywhere */
+
+
+typedef struct {
+    sound_type sound;
+    long cnt;
+    sample_block_values_type ptr;
+    double scale;
+    int terminated;
+} sound_state_node, *sound_state_type;
+
+
+static int portaudio_error(PaError err, char *problem)
+{
+    char msgbuffer[256];
+    if (err != paNoError) {
+        sprintf(msgbuffer, "%s, error %ld, %s.", problem, err, 
+                            Pa_GetErrorText(err));
+        xlerrprint("warning", NULL, msgbuffer, s_unbound);
+        return true;
+    }
+    return false;
+}
+
+
+LVAL prepare_audio(LVAL play, SF_INFO *sf_info, PaStream **audio_stream)
+{
+    PaStreamParameters output_parameters;
+    int i;
+    int num_devices;
+    const PaDeviceInfo *device_info;
+    const PaHostApiInfo *host_info;
+
+    if (!portaudio_initialized) {
+        if (portaudio_error(Pa_Initialize(), 
+                            "could not initialize portaudio")) {
+            return NIL;
+        }
+        portaudio_initialized = TRUE;
+    }
+        
+    output_parameters.device = Pa_GetDefaultOutputDevice(); 
+    output_parameters.channelCount = sf_info->channels;
+    output_parameters.sampleFormat = paFloat32;
+    output_parameters.hostApiSpecificStreamInfo = NULL;
+    /* remember that Nyquist has to do GC */
+    output_parameters.suggestedLatency = sound_latency;
+
+    // Initialize the audio stream for output
+    // If this is Linux, prefer to open ALSA device
+    num_devices = Pa_GetDeviceCount();
+    for (i = 0; i < num_devices; i++) {
+        device_info = Pa_GetDeviceInfo(i);
+        host_info = Pa_GetHostApiInfo(device_info->hostApi);
+        if (host_info->type == paALSA) {
+            output_parameters.device = i;
+            break;
+        }
+    }
+
+    if (portaudio_error(
+         Pa_OpenStream(audio_stream, NULL /* input */, &output_parameters,
+                   sf_info->samplerate, max_sample_block_len, 
+                   paClipOff, NULL /* callback */, NULL /* userdata */),
+         "could not open audio")) {
+        return NIL;
+    }
+    flush_count = (long) (sf_info->samplerate * (sound_latency + 0.2));
+
+    if (portaudio_error(Pa_StartStream(*audio_stream), 
+                        "could not start audio")) {
+        return NIL;
+    }
+
+    return play;
+}
+
+
+/* finish_audio -- flush the remaining samples, then close */
+/**/
+void finish_audio(PaStream *audio_stream)
+{
+    /* portaudio_error(Pa_StopStream(audio_stream), "could not stop stream"); */
+    /* write Latency frames of audio to make sure all samples are played */
+    float zero[MAX_SND_CHANNELS * 16];
+    int i;
+    for (i = 0; i < MAX_SND_CHANNELS * 16; i++) zero[i] = 0.0F;
+    while (flush_count > 0) {
+        Pa_WriteStream(audio_stream, zero, 16);
+        flush_count -= 16;
+    }
+    portaudio_error(Pa_CloseStream(audio_stream), "could not close audio");
+}
+
+long lookup_format(long format, long mode, long bits, long swap)
+{
+    long sf_mode;
+    long sf_format;
+
+    switch (format) {
+    case SND_HEAD_NONE: return 0; break; // get info from file
+    case SND_HEAD_AIFF: sf_format = SF_FORMAT_AIFF; break;
+    case SND_HEAD_IRCAM: sf_format = SF_FORMAT_IRCAM; break;
+    case SND_HEAD_NEXT: sf_format = SF_FORMAT_AU; break;
+    case SND_HEAD_WAVE: sf_format = SF_FORMAT_WAV; break;
+    case SND_HEAD_PAF: sf_format = SF_FORMAT_PAF; break;
+    case SND_HEAD_SVX: sf_format = SF_FORMAT_SVX; break;
+    case SND_HEAD_NIST: sf_format = SF_FORMAT_NIST; break;
+    case SND_HEAD_VOC: sf_format = SF_FORMAT_VOC; break;
+    case SND_HEAD_W64: sf_format = SF_FORMAT_W64; break;
+    case SND_HEAD_MAT4: sf_format = SF_FORMAT_MAT4; break;
+    case SND_HEAD_MAT5: sf_format = SF_FORMAT_MAT5; break;
+    case SND_HEAD_PVF: sf_format = SF_FORMAT_PVF; break;
+    case SND_HEAD_XI: sf_format = SF_FORMAT_XI; break;
+    case SND_HEAD_HTK: sf_format = SF_FORMAT_HTK; break;
+    case SND_HEAD_SDS: sf_format = SF_FORMAT_SDS; break;
+    case SND_HEAD_AVR: sf_format = SF_FORMAT_AVR; break;
+    case SND_HEAD_SD2: sf_format = SF_FORMAT_SD2; break;
+    case SND_HEAD_FLAC: sf_format = SF_FORMAT_FLAC; break;
+    case SND_HEAD_CAF: sf_format = SF_FORMAT_CAF; break;
+    case SND_HEAD_RAW: 
+        sf_format = SF_FORMAT_RAW; 
+#ifdef XL_BIG_ENDIAN
+        sf_format |= (swap ? SF_ENDIAN_LITTLE : SF_ENDIAN_BIG);
+#endif
+#ifdef XL_LITTLE_ENDIAN
+        sf_format |= (swap ? SF_ENDIAN_LITTLE : SF_ENDIAN_LITTLE);
+#endif        
+        break;
+    default: 
+        sf_format = SF_FORMAT_WAV; 
+        nyquist_printf("s-save: unrecognized format, using SND_HEAD_WAVE\n");
+        break;
+    }
+
+    switch (mode) {
+    case SND_MODE_ADPCM: sf_mode = SF_FORMAT_IMA_ADPCM; break;
+    case SND_MODE_UPCM: 
+        if (bits <= 8) {
+            sf_mode = SF_FORMAT_PCM_U8; break;
+        } else {
+            nyquist_printf("s-save: SND_MODE_UPCM is for 8-bit samples only, "
+                           "using PCM instead\n");
+        } /* no break here, fall through to SND_MODE_PCM... */
+    default:
+        nyquist_printf("s-save: unrecognized mode (%d), using PCM\n",
+                       mode);
+        /* no break, fall through as SND_MODE_PCM */
+    case SND_MODE_PCM: 
+        if (bits <= 8) sf_mode = SF_FORMAT_PCM_S8;
+        else if (bits <= 16) sf_mode = SF_FORMAT_PCM_16;
+        else if (bits <= 24) sf_mode = SF_FORMAT_PCM_24;
+        else if (bits <= 32) sf_mode = SF_FORMAT_PCM_32;
+        else {
+            sf_mode = SF_FORMAT_PCM_16;
+            nyquist_printf(
+                    "s-save: bad bits parameter (%d), using 16-bit PCM\n",
+                    bits);
+        }
+        break;
+    case SND_MODE_ULAW: sf_mode = SF_FORMAT_ULAW; break;
+    case SND_MODE_ALAW: sf_mode = SF_FORMAT_ALAW; break;
+    case SND_MODE_FLOAT: sf_mode = SF_FORMAT_FLOAT; break;
+    case SND_MODE_DOUBLE: sf_mode = SF_FORMAT_DOUBLE; break;
+    case SND_MODE_UNKNOWN: sf_mode = SF_FORMAT_PCM_16; break;
+    case SND_MODE_GSM610: sf_mode = SF_FORMAT_GSM610; break;
+    case SND_MODE_DWVW: 
+        if (bits <= 12) sf_mode = SF_FORMAT_DWVW_12;
+        else if (bits <= 16) sf_mode = SF_FORMAT_DWVW_16;
+        else if (bits <= 24) sf_mode = SF_FORMAT_DWVW_24;
+        else sf_mode = SF_FORMAT_DWVW_N;
+        break;
+    case SND_MODE_DPCM:
+        if (bits <= 8) sf_mode = SF_FORMAT_DPCM_8;
+        else if (bits <= 16) sf_mode = SF_FORMAT_DPCM_16;
+        else {
+            sf_mode = SF_FORMAT_DPCM_16;
+            nyquist_printf(
+                    "s-save: bad bits parameter (%d), using 16-bit DPCM\n",
+                    bits);
+        }
+        break;
+    case SND_MODE_MSADPCM: sf_mode = SF_FORMAT_MS_ADPCM; break;
+    }
+    return sf_format | sf_mode;
+}
+
+
+double sound_save(
+  LVAL snd_expr,
+  long n,
+  unsigned char *filename,
+  long format,
+  long mode,
+  long bits,
+  long swap,
+  double *sr,
+  long *nchans,
+  double *duration,
+  LVAL play)
+{
+    LVAL result;
+    float *buf;
+    long ntotal;
+    double max_sample;
+    SNDFILE *sndfile = NULL;
+    SF_INFO sf_info;
+    PaStream *audio_stream = NULL;
+    
+    gc();
+    
+    memset(&sf_info, 0, sizeof(sf_info));
+    sf_info.format = lookup_format(format, mode, bits, swap);
+
+    result = xleval(snd_expr);
+    /* BE CAREFUL - DO NOT ALLOW GC TO RUN WHILE RESULT IS UNPROTECTED */
+    if (vectorp(result)) {
+        /* make sure all elements are of type a_sound */
+        long i = getsize(result);
+        *nchans = sf_info.channels = i;
+        while (i > 0) {
+            i--;
+            if (!exttypep(getelement(result, i), a_sound)) {
+                xlerror("sound_save: array has non-sound element",
+                         result);
+            }
+        }
+        /* assume all are the same: */
+        *sr = sf_info.samplerate = ROUND(getsound(getelement(result, 0))->sr); 
+
+        /* note: if filename is "", then don't write file; therefore,
+         * write the file if (filename[0])
+         */ 
+        if (filename[0]) {
+            sndfile = sf_open((char *) filename, SFM_WRITE, &sf_info);
+            if (sndfile) {
+                /* use proper scale factor: 8000 vs 7FFF */
+                sf_command(sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE);
+            }
+        }
+        
+        if (play) 
+            play = prepare_audio(play, &sf_info, &audio_stream);
+
+        if ((buf = (float *) malloc(max_sample_block_len * sf_info.channels *
+                                    sizeof(float))) == NULL) {
+            xlabort("snd_save -- couldn't allocate memory");
+        }
+
+        max_sample = sound_save_array(result, n, &sf_info, sndfile, 
+                                      buf, &ntotal, audio_stream);
+        *duration = ntotal / *sr;
+        if (sndfile) sf_close(sndfile);
+        if (play != NIL) finish_audio(audio_stream);
+    } else if (exttypep(result, a_sound)) {
+        *nchans = sf_info.channels = 1;
+        sf_info.samplerate = ROUND((getsound(result))->sr);
+        *sr = sf_info.samplerate;
+        if (filename[0]) {
+            sndfile = sf_open((char *) filename, SFM_WRITE, &sf_info);
+            if (sndfile) {
+                /* use proper scale factor: 8000 vs 7FFF */
+                sf_command(sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE);
+            }
+        }
+        if (play)
+            play = prepare_audio(play, &sf_info, &audio_stream);
+
+        if ((buf = (float *) malloc(max_sample_block_len * 
+                                    sizeof(float))) == NULL) {
+            xlabort("snd_save -- couldn't allocate memory");
+        }
+
+        max_sample = sound_save_sound(result, n, &sf_info, sndfile,
+                                      buf, &ntotal, audio_stream);
+        *duration = ntotal / *sr;
+        if (sndfile) sf_close(sndfile);
+        if (play != NIL) finish_audio(audio_stream);
+    } else {
+        xlerror("sound_save: expression did not return a sound",
+                 result);
+        max_sample = 0.0;
+    }
+    free(buf);
+    return max_sample;
+}
+
+
+/* open_for_write -- helper function for sound_overwrite */
+/*
+ * if the format is RAW, then fill in sf_info according to 
+ * sound sample rate and channels. Otherwise, open the file
+ * and see if the sample rate and channele match.
+ */
+SNDFILE *open_for_write(unsigned char *filename, long direction,
+                        long format, SF_INFO *sf_info, int channels,
+                        long srate, double offset, float **buf)
+/* channels and srate are based on the sound we're writing to the file */
+{
+    SNDFILE *sndfile;
+    sf_count_t frames; // frame count passed into sf_seek
+    char error[140];   // error messages are formatted here
+    sf_count_t rslt;   // frame count returned from sf_seek
+
+    if (format == SND_HEAD_RAW) {
+        sf_info->channels = channels;
+        sf_info->samplerate = srate;
+    } else {
+        sf_info->format = 0;
+    }
+    sndfile = sf_open((const char *) filename, direction, sf_info); 
+
+    if (!sndfile) {
+        sprintf(error, "snd_overwrite: cannot open file %s", filename);
+        xlabort(error);
+    }
+    /* use proper scale factor: 8000 vs 7FFF */
+    sf_command(sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE);
+    
+    frames = round(offset * sf_info->samplerate);
+    rslt = sf_seek(sndfile, frames, SEEK_SET);
+    if (rslt < 0) {
+        sprintf(error, "snd_overwrite: cannot seek to frame %lld of %s",
+                frames, filename);
+        xlabort(error);
+    }
+    if (sf_info->channels != channels) {
+        sprintf(error, "%s%ld%s%ld%s", 
+                "snd_overwrite: number of channels in sound (",
+                channels,
+                ") does not match\n    number of channels in file (",
+                sf_info->channels, ")");
+        sf_close(sndfile);
+        xlabort(error);
+    }
+
+    if (sf_info->samplerate != srate) {
+        sprintf(error, "%s%g%s%ld%s",
+                "snd_overwrite: sample rate in sound (",
+                srate,
+                ") does not match\n    sample rate in file (",
+                sf_info->samplerate,
+                ")"); 
+        sf_close(sndfile);
+        xlabort(error);
+    }
+        
+    if ((*buf = (float *) malloc(max_sample_block_len * channels *
+                                 sizeof(float))) == NULL) {
+        xlabort("snd_overwrite: couldn't allocate memory");
+    }
+    return sndfile;
+}
+
+
+double sound_overwrite(
+  LVAL snd_expr,
+  long n,
+  unsigned char *filename,
+  double offset_secs,
+  long format,
+  long mode,
+  long bits,
+  long swap,
+  double *duration)
+{
+    LVAL result;       // the SOUND to be evaluated
+    SF_INFO sf_info;   // info about the sound file
+    double max_sample; // return value
+    long ntotal;       // how many samples were overwritten
+    /*
+    long flags;
+    */
+    // first check if sound file exists, do not create new file
+    FILE *file = fopen((char *) filename, "rb");
+    // if not then fail
+    if (!file) {
+        *duration = 0;
+        return 0.0;
+    } else {
+        fclose(file);
+    }
+    memset(&sf_info, 0, sizeof(sf_info));
+    sf_info.format = lookup_format(format, mode, bits, swap);
+    result = xleval(snd_expr);
+    /* BE CAREFUL - DO NOT ALLOW GC TO RUN WHILE RESULT IS UNPROTECTED */
+    if (vectorp(result)) {
+        SNDFILE *sndfile;  // opened sound file 
+        float *buf; // buffer for samples read in from sound file
+        /* make sure all elements are of type a_sound */
+        long i = getsize(result);
+        while (i > 0) {
+            i--;
+            if (!exttypep(getelement(result, i), a_sound)) {
+                xlerror("sound_save: array has non-sound element",
+                         result);
+            }
+        }
+        sndfile = open_for_write(filename, SFM_RDWR, format, &sf_info, i,
+                                 ROUND(getsound(getelement(result, 0))->sr),
+                                 offset_secs, &buf);
+
+        max_sample = sound_save_array(result, n, &sf_info, sndfile, 
+                                      buf, &ntotal, NULL);
+        *duration = ntotal / (double) sf_info.samplerate;
+        free(buf);
+        sf_close(sndfile);
+    } else if (exttypep(result, a_sound)) {
+        SNDFILE *sndfile;  // opened sound file 
+        float *buf; // buffer for samples read in from sound file
+        sndfile = open_for_write(filename, SFM_RDWR, format, &sf_info, 1, 
+                                 ROUND(getsound(result)->sr), 
+                                 offset_secs, &buf);
+        max_sample = sound_save_sound(result, n, &sf_info, sndfile, buf, 
+                                      &ntotal, NULL);
+        *duration = ntotal / (double) sf_info.samplerate;
+        free(buf);
+        sf_close(sndfile);
+    } else {
+        xlerror("sound_save: expression did not return a sound",
+                 result);
+        max_sample = 0.0;
+    }
+    return max_sample;
+}
+
+int is_pcm(SF_INFO *sf_info)
+{
+    long subtype = sf_info->format & SF_FORMAT_SUBMASK;
+    return (subtype == SF_FORMAT_PCM_S8 || subtype == SF_FORMAT_PCM_16 ||
+            subtype == SF_FORMAT_PCM_24 || subtype == SF_FORMAT_PCM_32);
+}
+
+
+sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, 
+        SNDFILE *sndfile, float *buf, long *ntotal, PaStream *audio_stream)
+{
+    long blocklen;
+    sound_type s;
+    int i;
+    sample_type *samps;
+    long debug_unit;    /* print messages at intervals of this many samples */
+    long debug_count;   /* next point at which to print a message */
+    sample_type max_sample = 0.0F;
+    sample_type threshold = 0.0F;
+    /* jlh    cvtfn_type cvtfn; */
+    *ntotal = 0;
+
+    /* if snd_expr was simply a symbol, then s now points to
+        a shared sound_node.  If we read samples from it, then
+        the sound bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound_node.  We need to make the new
+        sound reachable by the garbage collector to that any
+        lisp data reachable from the sound do not get collected.
+        To make the sound reachable, we need to allocate a node,
+        and the GC might run, so we need to protect the OLD s
+        but then make it unreachable.
+        We will let the GC collect the sound in the end.
+    */
+    xlprot1(s_as_lval);
+    s = sound_copy(getsound(s_as_lval));
+    s_as_lval = cvsound(s);	/* destroys only ref. to original */
+
+    /* for debugging */
+/*    printing_this_sound = s;*/
+
+
+    debug_unit = debug_count = (long) max(sf_info->samplerate, 10000.0);
+
+    sound_frames = 0;
+    sound_srate = sf_info->samplerate;
+
+    while (n > 0) {
+        long togo;
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        oscheck();
+#ifdef SNAPSHOTS
+        stdputstr(".");
+        if (sound_created_flag) {
+            stdputstr("SNAPSHOT: ");
+            sound_print_tree(printing_this_sound);
+            sound_created_flag = false;
+        }
+        fflush(stdout);
+#endif
+        if (sampblock == zero_block || blocklen == 0) {
+            break;
+        }
+        togo = min(blocklen, n);
+        if (s->scale != 1) { /* copy/scale samples into buf */
+            for (i = 0; i < togo; i++) {
+                buf[i] = s->scale * sampblock->samples[i];
+            }
+            samps = buf;
+        } else {
+            samps = sampblock->samples;
+        }
+        if (is_pcm(sf_info)) {
+            for (i = 0; i < togo; i++) {
+                sample_type s = samps[i];
+                COMPUTE_MAXIMUM_AND_WRAP(samps[i]);
+            }
+        } else {
+            for (i = 0; i < togo; i++) {
+                sample_type s = samps[i];
+                COMPUTE_MAXIMUM();
+            }
+        }
+        if (sndfile) {
+            sf_writef_float(sndfile, samps, togo);
+        }
+        if (audio_stream) {
+            Pa_WriteStream(audio_stream, samps, togo);
+            sound_frames += togo;
+        }
+
+        n -= togo;
+        *ntotal += togo;
+        if (*ntotal > debug_count) {
+            gprintf(TRANS, " %ld ", *ntotal);
+            fflush(stdout);
+            debug_count += debug_unit;
+        }
+    }
+    gprintf(TRANS, "\ntotal samples: %ld\n", *ntotal);
+    xlpop();
+    return max_sample;
+}
+
+
+sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, 
+        SNDFILE *sndfile, float *buf, long *ntotal, PaStream *audio_stream)
+{
+    long i, chans;
+    float *float_bufp;
+    sound_state_type state;
+    double start_time = HUGE_VAL;
+    LVAL sa_copy;
+    long debug_unit;    /* print messages at intervals of this many samples */
+    long debug_count;   /* next point at which to print a message */
+    sample_type max_sample = 0.0F;
+    sample_type threshold = 0.0F;
+    /*    cvtfn_type cvtfn; jlh */
+
+    *ntotal = 0;
+
+    /* THE ALGORITHM: first merge floating point samples from N channels
+     * into consecutive multi-channel frames in buf.  Then, treat buf
+     * as just one channel and use one of the cvt_to_* functions to
+     * convert the data IN PLACE in the buffer (this is ok because the
+     * converted data will never take more space than the original 32-bit
+     * floats, so the converted data will not overwrite any floats before
+     * the floats are converted
+     */
+
+    /* if snd_expr was simply a symbol, then sa now points to
+        a shared sound_node.  If we read samples from it, then
+        the sounds bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound array.  See also sound_save_sound()
+    */
+
+    chans = getsize(sa);
+    if (chans > MAX_SND_CHANNELS) {
+        xlerror("sound_save: too many channels", sa);
+        free(buf);
+        sf_close(sndfile);
+    }
+    xlprot1(sa);
+    sa_copy = newvector(chans);
+    xlprot1(sa_copy);
+
+    /* Why do we copy the array into an xlisp array instead of just
+     * the state[i] array? Because some of these sounds may reference
+     * the lisp heap. We must put the sounds in an xlisp array so that
+     * the gc will find and mark them. xlprot1(sa_copy) makes the array
+     * visible to gc.
+     */
+    for (i = 0; i < chans; i++) {
+        sound_type s = getsound(getelement(sa, i));
+        setelement(sa_copy, i, cvsound(sound_copy(s)));
+    }
+    sa = sa_copy;	/* destroy original reference to allow GC */
+
+    state = (sound_state_type) malloc(sizeof(sound_state_node) * chans);
+    for (i = 0; i < chans; i++) {
+        state[i].sound = getsound(getelement(sa, i));
+        state[i].scale = state[i].sound->scale;
+D       nyquist_printf("save scale factor %ld = %g\n", i, state[i].scale);
+        state[i].terminated = false;
+        state[i].cnt = 0;   /* force a fetch */
+        start_time = min(start_time, state[i].sound->t0);
+    }
+
+    for (i = 0; i < chans; i++) {
+        if (state[i].sound->t0 > start_time)
+            sound_prepend_zeros(state[i].sound, start_time);
+    }
+
+    debug_unit = debug_count = (long) max(sf_info->samplerate, 10000.0);
+
+    sound_frames = 0;
+    sound_srate = sf_info->samplerate;
+    while (n > 0) {
+        /* keep the following information for each sound:
+            has it terminated?
+            pointer to samples
+            number of samples remaining in block
+           scan to find the minimum remaining samples and
+           output that many in an inner loop.  Stop outer
+           loop if all sounds have terminated
+         */
+        int terminated = true;
+        int togo = n;
+        int j;
+
+        oscheck();
+
+        for (i = 0; i < chans; i++) {
+            if (state[i].cnt == 0) {
+                if (sndwrite_trace) {
+                    nyquist_printf("CALLING SOUND_GET_NEXT ON CHANNEL %ld (%x)\n",
+				   i, (unsigned long) state[i].sound); /* jlh 64 bit issue */
+                    sound_print_tree(state[i].sound);
+                }
+                state[i].ptr = sound_get_next(state[i].sound,
+                                   &(state[i].cnt))->samples;
+                if (sndwrite_trace) {
+                    nyquist_printf("RETURNED FROM CALL TO SOUND_GET_NEXT ON CHANNEL %ld\n", i);
+                }
+                if (state[i].ptr == zero_block->samples) {
+                    state[i].terminated = true;
+                }
+            }
+            if (!state[i].terminated) terminated = false;
+            togo = min(togo, state[i].cnt);
+        }
+
+        if (terminated) break;
+
+        float_bufp = (float *) buf;
+        if (is_pcm(sf_info)) {
+            for (j = 0; j < togo; j++) {
+                for (i = 0; i < chans; i++) {
+                    float s = (float) (*(state[i].ptr++) * (float) state[i].scale);
+                    COMPUTE_MAXIMUM_AND_WRAP(s);
+                    *float_bufp++ = s;
+                }
+            }
+        } else {
+            for (j = 0; j < togo; j++) {
+                for (i = 0; i < chans; i++) {
+                    float s = (float) (*(state[i].ptr++) * (float) state[i].scale);
+                    COMPUTE_MAXIMUM();
+                    *float_bufp++ = s;
+                }
+            }
+        }
+        /* Here we have interleaved floats. Before converting to the sound
+           file format, call PortAudio to play them. */
+        if (audio_stream) {
+            PaError err = Pa_WriteStream(audio_stream, buf, togo);
+            if (err) {
+                printf("Pa_WriteStream error %d\n", err);
+            }
+            sound_frames += togo;
+        }
+        if (sndfile) sf_writef_float(sndfile, buf, togo);
+
+        n -= togo;
+        for (i = 0; i < chans; i++) {
+            state[i].cnt -= togo;
+        }
+        *ntotal += togo;
+        if (*ntotal > debug_count) {
+            gprintf(TRANS, " %ld ", *ntotal);
+            fflush(stdout);
+            debug_count += debug_unit;
+        }
+    }
+    gprintf(TRANS, "total samples: %ld x %ld channels\n",
+           *ntotal, chans);
+
+    /* references to sounds are shared by sa_copy and state[].
+     * here, we dispose of state[], allowing GC to do the
+     * sound_unref call that frees the sounds. (Freeing them now
+     * would be a bug.)
+     */
+    free(state);
+    xlpop();
+    return max_sample;
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sound.c b/lib-src/libnyquist/nyquist/nyqsrc/sound.c
new file mode 100644
index 0000000..2cbc07b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sound.c
@@ -0,0 +1,1708 @@
+/* sound.c -- nyquist sound data type */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability and fix compiler warnings
+ */
+
+/* define size_t: */
+#ifdef UNIX
+#include "sys/types.h"
+#endif  
+#include <stdio.h>
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "samples.h"
+#include "extern.h"
+#include "debug.h"
+#include "assert.h"
+#ifdef OSC
+#include "nyq-osc-server.h"
+#endif
+#include "cext.h"
+#include "userio.h"
+
+/* #define GC_DEBUG */
+#ifdef GC_DEBUG
+extern sound_type sound_to_watch;
+#endif
+
+snd_list_type list_watch; //DBY
+
+/* #define SNAPSHOTS */
+
+long table_memory;
+
+sample_block_type zero_block;
+sample_block_type internal_zero_block;
+
+snd_list_type zero_snd_list;
+
+xtype_desc sound_desc;
+LVAL a_sound;
+LVAL s_audio_markers;
+
+static void sound_xlfree();
+static void sound_xlprint();
+static void sound_xlsave();
+static unsigned char *sound_xlrestore();
+
+void sound_print_array(LVAL sa, long n);
+void sound_print_sound(sound_type s, long n);
+void sample_block_unref(sample_block_type sam);
+
+#ifdef SNAPSHOTS
+boolean sound_created_flag = false;
+#endif
+
+#ifdef OSC
+int nosc_enabled = false;
+#endif
+
+double sound_latency = 0.3; /* default value */
+/* these are used so get times for *AUDIO-MARKERS* */
+double sound_srate = 44100.0;
+long sound_frames = 0;
+
+double snd_set_latency(double latency)
+{
+    double r = sound_latency;
+	sound_latency = latency;
+	return r;
+}
+
+
+/* xlbadsr - report a "bad combination of sample rates" error */
+LVAL snd_badsr(void)
+{
+    xlfail("bad combination of sample rates");
+    return NIL; /* never happens */
+}
+
+
+/* compute-phase -  given a phase in radians, a wavetable specified as
+ *  the nominal pitch (in half steps), the table length, and the sample
+ *  rate, compute the sample number corresponding to the phase.  This
+ *  routine makes it easy to initialize the table pointer at the beginning
+ *  of various oscillator implementations in Nyquist.  Note that the table
+ *  may represent several periods, in which case phase 360 is not the same
+ *  as 0.  Also note that the phase increment is also computed and returned
+ *  through incr_ptr.
+ */
+double compute_phase(phase, key, n, srate, new_srate, freq, incr_ptr)
+  double phase;  /* phase in degrees (depends on ANGLEBASE) */
+  double key;    /* the semitone number of the table played at srate */
+  long n;        /* number of samples */
+  double srate;  /* the sample rate of the table */
+  double new_srate;  /* sample rate of the result */
+  double freq;   /* the desired frequency */
+  double *incr_ptr; /* the sample increment */
+{
+    double period = 1.0 / step_to_hz(key);
+
+    /* convert phase to sample units */
+    phase = srate * period * (phase / (double) ANGLEBASE);
+    /* phase is now in sample units; if phase is less than zero, then increase
+       it by some number of sLength's to make it positive:
+     */
+    if (phase < 0)
+        phase += (((int) ((-phase) / n)) + 1) * n;
+
+    /* if phase is longer than the sample length, wrap it by subtracting the
+       integer part of the division by sLength:
+     */
+    if (phase > n)
+        phase -= ((int) (phase / n)) * n;
+
+    /* Now figure the phase increment: to reproduce original pitch
+       required incr = srate / new_srate.  To get the new frequency,
+       scale by freq / nominal_freq = freq * period:
+     */
+    *incr_ptr = (srate / new_srate) * freq * period;
+    return phase;
+}
+#ifndef GCBUG
+snd_list_type gcbug_snd_list = 0;
+long blocks_to_watch_len = 0;
+sample_block_type blocks_to_watch[blocks_to_watch_max];
+
+void block_watch(long sample_block)
+{
+    if (blocks_to_watch_len >= blocks_to_watch_max) {
+        stdputstr("block_watch - no more space to save pointers\n");
+        return;
+    }
+    blocks_to_watch[blocks_to_watch_len++] = (sample_block_type) sample_block;
+    nyquist_printf("block_watch - added %d = %x\n",
+                   (int)sample_block, (int)sample_block);
+}
+
+
+/* fetch_zeros -- the fetch function for appended zeros */
+/*
+ * zeros are appended when the logical stop time exceeds the 
+ * (physical) terminate time.  This fetch function is installed
+ * by snd_list_terminate().  When appending zeros, we just return
+ * a pointer to the internal_zero_block and increment current until
+ * it reaches log_stop_cnt.  Then we call snd_list_terminate() to
+ * finish off the sound list.
+ */
+
+void fetch_zeros(snd_susp_type susp, snd_list_type snd_list)
+{
+    int len = MIN(susp->log_stop_cnt - susp->current,
+                   max_sample_block_len);
+/*    nyquist_printf("fetch_zeros, lsc %d current %d len %d\n", 
+            susp->log_stop_cnt, susp->current, len); */
+    if (len < 0) {
+        char error[80];
+        sprintf(error, "fetch_zeros susp %p (%s) len %d", susp, susp->name, len);
+        xlabort(error);
+    }
+    if (len == 0) { /* we've reached the logical stop time */
+        /* nyquist_printf("fetch_zeros: reached the logical stop in %s cnt %d\n",
+               susp->name, susp->log_stop_cnt); */
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = len;
+        susp->current += len;
+    }
+}
+
+
+/* sound_nth_block - fetch the address of the nth sample block of a sound */
+/*
+ * NOTE: intended to be called from lisp.  Lisp can then call block_watch
+ * to keep an eye on the block.
+ */
+long sound_nth_block(sound_type snd, long n)
+{
+    long i;
+    snd_list_type snd_list = snd->list;
+    for (i = 0; i < n; i++) {
+        if (i == 1) {
+            gcbug_snd_list = snd_list;
+            nyquist_printf("gcbug_snd_list = 0x%p\n", gcbug_snd_list);
+        }
+        if (!snd_list->block) return 0;
+        snd_list = snd_list->u.next;
+    }
+    if (snd_list->block) return (long) snd_list->block;
+    else return 0;
+}
+
+#endif
+
+
+/****************************************************************************
+*                               snd_list_create
+* Inputs:
+*       snd_susp_type susp: A reference to the suspension
+* Result: snd_list_type
+*       A newly-created sound list type
+* Effect: 
+*       Allocates and initializes a snd_list node:
+*         block    refcnt  block_len susp  logically_stopped
+*       +--------+--------+-------+-------+---+
+*       |////////|   1    |   0   | susp  | F |
+*       +--------+--------+-------+-------+---+
+****************************************************************************/
+
+/* snd_list_create -- alloc and initialize a snd_list node */
+/**/
+snd_list_type snd_list_create(snd_susp_type susp)
+{
+    snd_list_type snd_list;
+
+    falloc_snd_list(snd_list, "snd_list_create");
+
+    snd_list->block = NULL;             /* no block of samples */
+    snd_list->u.susp = susp;            /* point to suspension */
+    snd_list->refcnt = 1;               /* one ref */
+    snd_list->block_len = 0;            /* no samples */
+    snd_list->logically_stopped = false;/* not stopped */
+/*    nyquist_printf("snd_list_create => %p\n", snd_list);*/
+    return snd_list;
+}
+
+
+/****************************************************************************
+*                                sound_create
+* Inputs:
+*       snd_susp_type susp: The suspension block to be used for this sound
+*       time_type t0: The initial time for this sound
+*       rate_type sr: The sampling rate for this sound
+*       sample_type scale: The scaling factor for this sound
+*       sample_block_type (*proc)(...): The get_next_sound method
+* Result: sound_type
+*       
+* Effect: 
+*       Creates and initializes a sound type
+* Notes:
+*       The MSDOS conditional is actually a test for ANSI headers; the
+*       presence of float parameters means that an ANSI prototype and
+*       a non-ANSI header are incompatible.  Better solution would be
+*       to ANSIfy source.
+****************************************************************************/
+
+sound_type last_sound = NULL;
+
+sound_type sound_create(
+  snd_susp_type susp,
+  time_type t0,
+  rate_type sr,
+  promoted_sample_type scale)
+{
+    sound_type sound;
+    falloc_sound(sound, "sound_create");
+    if (((long) sound) & 3) errputstr("sound not word aligned\n");
+    last_sound = sound; /* debug */
+    if (t0 < 0) xlerror("attempt to create a sound with negative starting time", s_unbound); 
+    /* nyquist_printf("sound_create %p gets %g\n", sound, t0); */
+    sound->t0 = sound->true_t0 = sound->time = t0;
+    sound->stop = MAX_STOP;
+    sound->sr = sr;
+    sound->current = 0;
+    sound->scale = (float) scale;
+    sound->list = snd_list_create(susp);
+    sound->get_next = SND_get_first;
+    sound->logical_stop_cnt = UNKNOWN;
+    sound->table = NULL;
+    sound->extra = NULL;
+    /* nyquist_printf("sound_create susp %p snd_list %p\n", susp, sound->list);
+       nyquist_printf("sound_create'd %p\n", sound); */
+#ifdef SNAPSHOTS
+    sound_created_flag = true;
+#endif
+#ifdef GC_DEBUG
+    if (sound == sound_to_watch) {
+        nyquist_printf("Created watched sound\n");
+        watch_snd_list(sound->list);
+    }
+#endif
+    return sound;
+}
+
+
+/* sound_prepend_zeros -- modify sound_type so that it starts at t0 */
+/*
+ * assumes t0 is earlier than snd->t0, so the sound should return zeros
+ * until snd->t0 is reached, after which we revert to normal computation.
+ * When we return, the new snd->t0 will be t0, meaning that the first
+ * sample returned will be at time t0.
+ * NOTE: t0 may not be an exact multiple of samples earlier than snd->t0,
+ * but Nyquist allows any sound to be shifted by +/- 0.5 samples in 
+ * order to achieve alignment.  Since sound_prepend_zeros can be called
+ * many times on the same sound_type, there is a chance that rounding 
+ * errors could accumulate.  My first solution was to return with 
+ * snd->t0 computed exactly and not reflecting any fractional sample 
+ * shift of the signal, but this caused problems for the caller: a 
+ * fractional sample shift at a low sample rate could correspond to 
+ * many client samples,fooling the client into thinking that some 
+ * initial samples should be discarded (or else requiring the client
+ * to be pretty smart).  The solution used here is to return to the
+ * client with snd->t0 exactly equal to t0, but to save snd->true_t0
+ * equal to the time of the first sample with no sound shifting.  This
+ * time is used for any future sound_prepend_zeros operations so that
+ * any accumulated rounding errors are due only to floating point 
+ * precision and not to accumulated fractional sample shifts of snd.
+ */
+void sound_prepend_zeros(sound_type snd, time_type t0)
+{
+    long n;
+
+    /* first, see if we're already prepending some zeros */
+    if (snd->get_next != SND_get_zeros) {
+/*        nyquist_printf("sound_prepend_zeros 1: snd->t0 %g t0 %g\n", snd->t0,  t0); */
+
+        /* if not, then initialize some fields that support prepending */
+        snd->prepend_cnt = 0;
+        snd->true_t0 = snd->t0;
+
+        /* save old get_next and plug in special get_next function */
+        snd->after_prepend = snd->get_next;
+        snd->get_next = SND_get_zeros;
+    }
+
+    n = (long) (((snd->true_t0 - t0) * snd->sr) + 0.5); /* how many samples to prepend */
+
+    /* add to prepend_cnt so first sample will correspond to new t0 */
+    snd->prepend_cnt += n;
+    /* compute the true t0 which corresponds to the time of first sample */
+    snd->true_t0 -= (n / snd->sr);
+    /* make caller happy by claiming the sound now starts at exactly t0;
+     * this is always true within 0.5 samples as allowed by Nyquist. */
+    snd->t0 = t0;
+/*    nyquist_printf("sound_prepend_zeros: snd %p true_t0 %g sr %g n %d\n", 
+           snd, snd->true_t0, snd->sr, n);*/
+}
+
+
+/* sound_array_copy -- copy an array of sounds */
+/*
+ * NOTE: be sure to protect the result from gc!
+ */
+LVAL sound_array_copy(LVAL sa)
+{
+    long i = getsize(sa);
+    LVAL new_sa = newvector(i);
+    xlprot1(new_sa);
+
+    while (i > 0) {
+        i--;
+        setelement(new_sa, i, 
+                   cvsound(sound_copy(getsound(getelement(sa, i)))));
+    }
+
+    xlpop();
+    return new_sa;
+}
+
+
+/* sound_copy - copy a sound structure, do reference counts */
+/**/
+sound_type sound_copy(sound_type snd)
+{
+    sound_type sndcopy;
+    falloc_sound(sndcopy, "sound_copy");
+    *sndcopy = *snd;    /* copy the whole structure */
+    sndcopy->extra = NULL; /* except for the (private) extra data */
+    snd_list_ref(snd->list);    /* copied a reference so fix the count */
+/*    nyquist_printf("sound_copy'd %p to %p\n", snd, sndcopy); */
+    if (snd->table) snd->table->refcount++;
+#ifdef GC_DEBUG
+    if (sndcopy == sound_to_watch) 
+		printf("sndcopy->table %x\n", sndcopy->table);
+#endif
+    return sndcopy;
+}
+
+
+/* convert a sound to a wavetable, set length */
+/**/
+table_type sound_to_table(sound_type s)
+{
+    long len = snd_length(s, max_table_len);
+    long tx = 0;        /* table index */
+    long blocklen;
+    register double scale_factor = s->scale;
+    sound_type original_s = s;
+    table_type table; /* the new table */
+    long table_bytes; /* how big is the table */
+
+    if (s->table) {
+        s->table->refcount++;
+        return s->table;
+    }
+
+    if (len >= max_table_len) {
+        char emsg[100];
+        sprintf(emsg, "maximum table size (%d) exceeded", max_table_len);
+        xlcerror("use truncated sound for table", emsg, NIL);
+    } else if (len == 0) {
+        xlabort("table size must be greater than 0");
+    }
+
+
+    len++;      /* allocate extra sample at end of table */
+    s = sound_copy(s);
+
+    /* nyquist_printf("sound_to_table: allocating table of size %d\n", len); */
+    table_bytes = table_size_in_bytes(len);
+    table = (table_type) malloc(table_bytes);
+    if (!table) xlfail("osc_init couldn't allocate memory for table");
+    table_memory += table_bytes;
+
+    table->length = (double) (len - 1);
+
+    while (len > 1) {
+        sample_block_type sampblock = sound_get_next(s, &blocklen);
+        long togo = MIN(blocklen, len);
+        long i;
+        sample_block_values_type sbufp = sampblock->samples;
+/*      nyquist_printf("in sound_to_table, sampblock = %d\n", sampblock);*/
+        for (i = 0; i < togo; i++) {
+            table->samples[tx++] = (float) (*sbufp++ * scale_factor);
+        }
+        len -= togo;
+    }
+    /* for interpolation, duplicate first sample at end of table */
+    table->samples[tx] = table->samples[0];
+    table->refcount = 2;    /* one for the user, one from original_s */
+
+    sound_unref(s);
+    s = NULL;
+    original_s->table = table;
+    return table;
+}
+
+
+void table_free(table_type table)
+{
+    long len = (long) (table->length) + 1;
+    long bytes = table_size_in_bytes(len);
+    free(table);
+    table_memory -= bytes;
+}
+
+
+void table_unref(table_type table)
+{
+    if (!table) return;
+    table->refcount--;
+    if (table->refcount <= 0) {
+        /* nyquist_printf("table refcount went to zero\n"); */
+        table_free(table);
+    }
+}
+
+
+void sound_unref(sound_type snd)
+/* note that sounds do not have ref counts, so sound_unref
+ * always frees the sound object
+ */
+{
+    if (!snd) return;
+    snd_list_unref(snd->list);
+    table_unref(snd->table);
+/*    nyquist_printf("\t\t\t\t\tfreeing sound@%p\n", snd);*/
+    if (snd->extra) free(snd->extra);
+    ffree_sound(snd, "sound_unref");
+}
+
+
+void snd_list_ref(snd_list_type list)
+{
+    list->refcnt++;
+}
+
+
+void snd_list_terminate(snd_list)
+  snd_list_type snd_list;
+{
+    snd_susp_type susp = snd_list->u.next->u.susp;
+    long lsc = susp->log_stop_cnt;
+    long current = susp->current;
+    /* unreference the empty sample block that was allocated: */
+    sample_block_unref(snd_list->block);
+    /* use zero_block instead */
+    snd_list->block = zero_block;
+    /* either fetch more zeros or terminate now */
+    if (lsc != UNKNOWN && lsc > current) {
+        /* nyquist_printf("snd_list_terminate: lsc %d current %d\n", 
+                lsc, current); */
+        susp->fetch = fetch_zeros;
+        fetch_zeros(susp, snd_list);
+    } else {
+        snd_list->block_len = max_sample_block_len;
+        snd_list->logically_stopped = true;
+        snd_list_unref(snd_list->u.next);
+        snd_list->u.next = zero_snd_list;       /* be zero forever */
+    }
+}
+
+
+void snd_list_unref(snd_list_type list)
+{
+    void (*freefunc)();
+
+    if (list == NULL || list == zero_snd_list) {
+        if (list == NULL)
+           nyquist_printf("why did snd_list_unref get %p?\n", list);
+        return;
+    }
+    list->refcnt--;
+/*    nyquist_printf("snd_list_unref "); print_snd_list_type(list); stdputstr("\n"); */
+    if (list->refcnt == 0) {
+        if (list->block && list->block != zero_block) {
+            /* there is a next snd_list */
+/*          stdputstr("["); */
+            sample_block_unref(list->block);
+/*          stdputstr("]"); */
+            snd_list_unref(list->u.next);
+        }
+        else if (list->block == NULL) { /* the next thing is the susp */
+            /* free suspension structure */
+            /* nyquist_printf("freeing susp@%p\n", list->u.susp); */
+            freefunc = list->u.susp->free;
+            (*freefunc)(list->u.susp);
+        }
+        /* nyquist_printf("freeing snd_list@%p\n", list); */
+        //DBY
+        if (list == list_watch) printf("freeing watched snd_list %p\n", list);
+        //DBY
+        ffree_snd_list(list, "snd_list_unref");
+    }
+}
+
+
+void sample_block_ref(sample_block_type sam)
+{
+    sam->refcnt++;
+}
+
+
+void sample_block_test(sample_block_type sam, char *s)
+{
+    /* see if this block is being watched */
+    int i;
+    for (i = 0; i < blocks_to_watch_len; i++) {
+        if ((sam > (blocks_to_watch[i] - 1)) &&
+            (sam < (blocks_to_watch[i] + 1))) {
+            nyquist_printf(
+    "WOOPS! %s(0x%p) refers to a block 0x%p on the watch list!\n",
+                    s, sam, blocks_to_watch[i]);
+        }
+    }
+}
+
+
+void sample_block_unref(sample_block_type sam)
+{
+    sam->refcnt--;
+    if (sam->refcnt == 0) {
+#ifndef GCBUG
+    sample_block_test(sam, "sample_block_unref");
+#endif        
+/*      nyquist_printf("freeing sample block %p\n", sam); */
+        ffree_sample_block(sam, "sample_block_unref");
+    }
+}
+
+
+
+/****************************************************************************
+*                                interp_style
+* Inputs:
+*       sound_type s: The sound we are using
+*       rate_type sr: The sampling rate
+* Result: int
+*       A small integer which is one of the symbolic values:
+*       The values are ordered, smallest to largest, as
+*               INTERP_n - none
+*               INTERP_s - scale
+*               INTERP_i - interpolated
+*               INTERP_r - ramp
+*
+* Notes: 
+*       The sampling rate s->sr and scale factor s->scale are compared
+*       with other values exactly (no fuzz).  
+****************************************************************************/
+
+int interp_style(sound_type s, rate_type sr)
+{
+    if (s->sr == sr) 
+       { /* same sample rate */
+        return ((s->scale == 1.0) ? INTERP_n : INTERP_s);
+       } /* same sample rate */
+    else 
+    if (s->sr * 10.0 > sr) 
+       { /* 10x sample rate */
+        return INTERP_i;
+       } /* 10x sample rate */
+    else 
+       return INTERP_r;
+}
+
+
+/****************************************************************************
+*                                 snd_sort_2
+* Inputs:
+*       sound_type * s1_ptr:
+*       sound_type * s2_ptr:
+*       rate_type sr:
+* Result: void
+*       
+* Effect: 
+*       If the interp_style of s1 dominates the interp_style of s2,
+*       the sound_types input are interchanged.
+****************************************************************************/
+
+/* snd_sort_2 -- sort 2 arguments by interpolation method */
+void snd_sort_2(sound_type *s1_ptr, sound_type *s2_ptr, rate_type sr)
+{
+    if (interp_style(*s1_ptr, sr) > interp_style(*s2_ptr, sr)) {
+        sound_type s = *s1_ptr;
+        *s1_ptr = *s2_ptr;
+        *s2_ptr = s;
+    }
+}
+
+
+/* snd_sref -- access a sound at a given time point */
+/**/
+double snd_sref(sound_type s, time_type t)
+{
+    double exact_cnt;      /* how many fractional samples to scan */
+    int cnt;               /* how many samples to flush */
+    sample_block_type sampblock = NULL;
+    long blocklen;
+    sample_type x1, x2;    /* interpolate between these samples */
+
+        /* changed true_t0 to just t0 based on comment that true_t0 is only
+         * for use by snd_prepend_zeros -RBD
+         */
+    exact_cnt = (t - s->t0) * s->sr;
+    if (exact_cnt < 0.0) return 0.0;
+
+    s = sound_copy(s);     /* don't modify s, create new reader */
+    cnt = (long) exact_cnt;       /* rounds down */
+    exact_cnt -= cnt;      /* remember fractional remainder */
+
+    /* now flush cnt samples */
+    while (cnt >= 0) {
+        sampblock = sound_get_next(s, &blocklen);
+        cnt -= blocklen;
+        if (sampblock == zero_block) {
+            sound_unref(s);
+            return 0.0;
+        }
+    }
+    /* -blocklen <= cnt <= -1 */
+
+    /* get next 2 samples and interpolate */
+    x1 = sampblock->samples[blocklen + cnt];
+    if (cnt == -1) {
+        sampblock = sound_get_next(s, &blocklen);
+        cnt -= blocklen;
+    }
+    x2 = sampblock->samples[blocklen + cnt + 1];
+    sound_unref(s);        /* free the reader */
+
+    return (x1 + exact_cnt * (x2 - x1)) * s->scale;
+}
+
+
+/* snd_sref_inverse -- find time point corresponding to some value */
+/**/
+double snd_sref_inverse(sound_type s, double val)
+{
+    double exact_cnt;      /* how many fractional samples to scan */
+    int i;
+    sample_block_type sampblock;
+    long blocklen;
+    sample_type x1, x2;    /* interpolate between these samples */
+
+    if (val < 0) {
+        xlcerror("return 0", "negative value", cvflonum(val));
+        return 0.0;
+    }
+    s = sound_copy(s);     /* don't modify s, create new reader */
+
+    x1 = 0.0F;
+    /* now flush cnt samples */
+    while (true) {
+        sampblock = sound_get_next(s, &blocklen);
+        x2 = sampblock->samples[blocklen - 1];
+        if (x2 >= val) break;
+        x1 = x2;
+        if (sampblock == zero_block) {
+            xlcerror("return 0", "too large, no inverse", cvflonum(val));
+            sound_unref(s);
+            return 0.0;
+        }
+    }
+    /* x1 = last sample of previous block,
+       sampblock contains a value larger than val
+       blocklen is the length of sampblock */
+
+    /* search for first element exceeding val - could
+     * use binary search, but maximum block size places
+     * an upper bound on how bad this can get and we
+     * search for the right block linearly anyway.
+     */
+    for (i = 0; i < blocklen && sampblock->samples[i] <= val; i++) ;
+
+    /* now i is index of element exceeding val */
+    if (i > 1) x1 = sampblock->samples[i - 1];
+    x2 = sampblock->samples[i];
+
+    /* now interpolate to get fractional part */
+    if (x2 == x1) exact_cnt = 0;
+    else exact_cnt = (val - x1) / (x2 - x1);
+
+    /* and add the sample count of x1 */
+    exact_cnt += (s->current - blocklen) + (i - 1);
+
+    /* negative counts are possible because the first x1 is at
+     * sample -1, so force the location to be at least 0
+     */
+    if (exact_cnt < 0) exact_cnt = 0;
+
+    /* compute time = t0 + count / samplerate; */
+    exact_cnt = s->t0 + exact_cnt / s->sr;
+
+    sound_unref(s);        /* free the reader */
+    return exact_cnt;
+}
+
+
+time_type snd_stop_time(sound_type s)
+{
+    if (s->stop == MAX_STOP) return MAX_STOP_TIME;
+    else return s->t0 + (s->stop + 0.5) / s->sr;
+}
+
+
+/* snd_xform -- return a sound with transformations applied */
+/*
+ * The "logical" sound starts at snd->time and runs until some
+ * as yet unknown termination time.  (There is also a possibly
+ * as yet unknown logical stop time that is irrelevant here.)
+ * The sound is clipped (zero) until snd->t0 and after snd->stop,
+ * the latter being a sample count, not a time_type.
+ * So, the "physical" sound starts at snd->t0 and runs for up to
+ * snd->stop samples (or less if the sound terminates beforehand).
+ *
+ * The snd_xform procedure operates at the "logical" level, shifting
+ * the sound from its snd->time to time.  The sound is stretched as
+ * a result of setting the sample rate to sr.  It is then (further) 
+ * clipped between start_time and stop_time.  If initial samples
+ * are clipped, the sound is shifted again so that it still starts
+ * at time.  The sound is then scaled by scale.
+ *
+ * To support clipping of initial samples, the "physical" start time
+ * t0 is set to when the first unclipped sample will be returned, but
+ * the number of samples to clip is saved as a negative count.  The
+ * fetch routine SND_flush is installed to flush the clipped samples
+ * at the time of the first fetch.  SND_get_first is then installed
+ * for future fetches.
+ *
+ * An empty (zero) sound will be returned if all samples are clipped.
+ *
+ */
+sound_type snd_xform(sound_type snd,
+                      rate_type sr,
+                      time_type time,
+                      time_type start_time,
+                      time_type stop_time,
+                      promoted_sample_type scale)
+{
+    long start_cnt, stop_cnt; /* clipping samples (sample 0 at new t0) */
+
+    /* start_cnt should reflect max of where the sound starts (t0)
+     * and the new start_time.
+     */
+    if (start_time == MIN_START_TIME) {
+        start_cnt = 0;
+    } else {
+        double new_start_cnt = ((start_time - time) * sr) + 0.5;
+        start_cnt = ((new_start_cnt > 0) ? (long) new_start_cnt : 0);
+    }
+    /* if (start_cnt < -(snd->current)) start_cnt = -(snd->current); */
+
+    /* stop_cnt should reflect min of the new stop_time and the previous
+     * snd->stop.
+     */
+    if (stop_time == MAX_STOP_TIME) {
+        stop_cnt = MAX_STOP;
+    } else {
+        double new_stop_cnt = ((stop_time - time) * sr) + 0.5;
+        if (new_stop_cnt < MAX_STOP) {
+            stop_cnt = (long) new_stop_cnt;
+        } else {
+            errputstr("Warning: stop count overflow in snd_xform\n");
+            stop_cnt = MAX_STOP;
+        }
+    }
+
+    if (stop_cnt > snd->stop) {
+        stop_cnt = snd->stop;
+    }
+
+    if (stop_cnt < 0 || start_cnt >= stop_cnt) {
+        snd = sound_create(NULL, time, sr, 1.0);
+        /* sound_create goes ahead and allocates a snd_list node, so
+         * we need to free it.  
+         * Calling snd_list_unref here seems like the right thing, but 
+         * it assumes too much structure is in place.  ffree_snd_list
+         * is simpler and more direct:
+         */
+        ffree_snd_list(snd->list, "snd_xform");
+        snd->list = zero_snd_list;
+        nyquist_printf("snd_xform: (stop_time < t0 or start >= stop) "
+                       "-> zero sound = %p\n", snd);
+        
+    } else {
+        snd = sound_copy(snd);
+        snd->t0 = time;
+        if (start_cnt) {
+            snd->current -= start_cnt; /* indicate flush with negative num. */
+            /* the following code assumes that SND_get_first is the
+              routine to be called to get the first samples from this 
+              sound.  We're going to replace it with SND_flush.  First,
+              make sure that the assumption is correct:
+            */
+            if ((snd->get_next != SND_get_first) &&
+                (snd->get_next != SND_flush)) {
+                errputstr("snd_xform: SND_get_first expected\n");
+                EXIT(1);
+            }
+            /* this will flush -current samples and revert to SND_get_first */
+            snd->get_next = SND_flush;
+            stop_cnt -= start_cnt;
+        }
+        snd->stop = stop_cnt;
+        snd->sr = sr;
+        snd->scale *= (float) scale;
+    }
+    return snd;
+}
+
+
+/* SND_flush -- the get_next function for flushing clipped samples */
+/*
+ * this only gets called once: it flushes -current samples (a 
+ * non-real-time operation) and installs SND_get_next to return
+ * blocks normally from then on.
+ */
+sample_block_type SND_flush(sound_type snd, long * cnt)
+{
+    long mycnt;
+    sample_block_type block = SND_get_first(snd, &mycnt);
+    while (snd->current < 0) {
+        block = SND_get_next(snd, &mycnt);
+    }
+    /* at this point, we've read to and including the block with
+     * the first samples we want to return.  If the block boundary
+     * is in the right place, we can do a minimal fixup and return:
+     */
+    if (snd->current == snd->list->block_len) {
+        *cnt = snd->current; /* == snd->list->block_len */
+        /* snd->get_next = SND_get_next; -- done by SND_get_first */
+        return block;
+    } else /* snd->current < snd->list->block_len */ {
+        long i;
+        sample_block_values_type from_ptr;
+        /* we have to return a partial block */
+        /* NOTE: if we had been smart, we would have had SND_get_next
+         * return a pointer to samples rather than a pointer to the
+         * block, which has a reference count.  Since the caller
+         * expects a pointer to a reference count, we have to copy
+         * snd->current samples to a new block
+         */
+        snd_list_type snd_list = snd_list_create((snd_susp_type) snd->list->u.next);
+        snd_list->u.next->refcnt++;
+        falloc_sample_block(snd_list->block, "SND_flush");
+        /* now copy samples */
+        from_ptr = block->samples + snd->list->block_len - snd->current;
+        for (i = 0; i < snd->current; i++) {
+            snd_list->block->samples[i] = from_ptr[i];
+        }
+        snd_list_unref(snd->list);
+        snd->list = snd_list;
+        *cnt = snd->current;
+        return snd_list->block;
+    }
+}
+
+
+/* SND_get_zeros -- the get_next function for prepended zeros */
+/*
+ * when prepending zeros, we just return a pointer to the internal_zero_block
+ * and decrement the prepend_cnt until it goes to zero.  Then we revert to 
+ * the normal (original) get_next function.
+ *
+ */
+sample_block_type SND_get_zeros(sound_type snd, long * cnt)
+{
+    int len = MIN(snd->prepend_cnt, max_sample_block_len);
+    /* stdputstr("SND_get_zeros: "); */
+    if (len < 0) {
+        char error[80];
+        sprintf(error, "SND_get_zeros snd %p len %d", snd, len);
+        xlabort(error);
+    }
+    if (len == 0) { /* we've finished prepending zeros */
+        snd->get_next = snd->after_prepend;
+        /* stdputstr("done, calling sound_get_next\n"); fflush(stdout); */
+        return sound_get_next(snd, cnt);
+    } else {
+        *cnt = len;
+        snd->current += len;
+        snd->prepend_cnt -= len;
+/*        nyquist_printf("returning internal_zero_block@%p\n", internal_zero_block);
+        fflush(stdout); */
+        return internal_zero_block;
+    }
+}
+
+
+/****************************************************************************
+*                                SND_get_next
+* Inputs:
+*       sound_type snd: The iterator whose next block is to be computed
+*       int * cnt: Place to put count of samples returned
+* Result: snd_list_type
+*       Pointer to the sample block computed ---------------------------+
+* Effect:                                                               |
+*       force suspension to compute next block of samples               |
+*                                                                       |
+*  Here's the protocol for using this and related functions:            |
+*  Every client (sample reader) has a private sound_type (an iterator), |
+*  and the sound_type's 'list' field points to a header (of type        |
+*  snd_list_type).  The header in turn points to a block of samples.    |
+*                                                                       |
+*                               +---------------------------------------+
+*                               |
+*                               |
+*                               |            sample_block_type
+*       (snd)                   V            +---+--+--+--+--+--+--+-...-+--+
+*       sound_type:        snd_list_type +-->|ref|  |  |  |  |//|//|     |//|
+*       +---------+        +----------+  |   +---+--+--+--+--+--+--+-...-+--+
+*       | list    +------->| block    +--+                 ^
+*       +---------+        +----------+                    :
+*       |  t0     |        | block_len|....................:
+*       +---------+        +----------+
+*       |  sr     |        | refcnt   |
+*       +---------+        +-+--------+
+*       | current |        | next   +---->...         Note: the union u
+*       +---------+        |u|........| snd_list_type    points to only one
+*       | rate    |        | | susp   +---->...          of the indicated
+*       +---------+        +-+--------+ susp_type        types
+*       | scalse  |        |log_stop  |
+*       +---------+        +----------+
+*       | lsc     |
+*       +---------+
+*       |get_next +-----> SND_get_next()
+*       +---------+
+*
+*  The sound_type keeps track of where the next sample block will 
+*  come from.  The field 'current' is the number of the first sample of
+*  the next block to be returned, where sample numbers start
+*  at zero.  The normal fetch procedure is this one, although special
+*  cases may generate special block generators, e.g., CONST does not need
+*  to allocate and refill a block and can reuse the same block over and
+*  over again, so it may have its own fetch procedure.  This is the
+*  general fetch procedure, which assumes that the generator function
+*  actually produces a slightly different value for each sample.
+*
+*  The distinguishing characteristic of whether the 'u' field is to be
+*  interpreted as 'next', a link to the next list element, or 'susp', a
+*  reference to the suspension for generating a new sample block, is
+*  whether the 'block' parameter is NULL or not.  If it is NULL, then
+*  u.susp tells how to generate the block; if it is not NULL, u.next is
+*  a pointer to the next sound block in the list.
+*
+*  When the 'block' pointer is NULL, we create a block of samples, and
+*  create a new sound list element which follows it which has a NULL
+*  'block' pointer; the 'u' field of the current list element is now
+*  interpreted as 'u.next'.
+*
+*      The client calls SND_get_next to get a pointer to a block of samples.
+*      The count of samples generated is returned via a ref parameter, and
+*      SND_get_next will not be called again until this set is exhausted.
+*
+*      The next time SND_get_next is called, it knows that the sample block
+*      has been exhausted.  It releases its reference to the block (and if
+*      that was the last reference, frees the block to the block allocation
+*      pool), allocates a new block from the block pool, and proceeds to
+*      fill it with samples.
+*
+*      Note that as an optimization, if the refcnt field goes to 0 it
+*      could immediately re-use the block without freeing back to the block
+*      pool and reallocating it.
+*
+*  Because of the way we handle sound sample blocks, the sound sample blocks
+*  themselves are ref-counted, so freeing the snd_list_type may not free
+*  the sample block it references.  At the level of this procedure, that
+*  is transparently handled by the snd_list_unref function.
+*
+*  Logical stop:
+*
+*  Logical stop is handled by several mechanisms.  The /intrinsic/ logical
+*  stop is an immutable property of the signal, and is determined by the
+*  specification in the algorithm description file.  When it is encountered,
+*  the 'logically_stopped' flag of the snd_list_node is set.
+*  The generators guarantee that the first time this is encountered, it
+*  will always be constructed so that the first sample of the block it
+*  references is the logical stop time.
+*
+*  In addition, the client may have set the /explicit logical stop time/ of
+*  the iterator (e.g., in nyquist, the (set-logical-stop sound time) call copies
+*  the sound, altering its logical stop).  The logical stop time, when set
+*  in this way, causes the logical_stop_cnt ('lsc' in the above diagram)
+*  to be set to the count of the last sample to be generated before the
+*  <logical stop time.  This will guarantee that the sound will indicate that
+*  it has reached its logical stop time when the indicated sample is 
+*  generated.
+****************************************************************************/
+
+void add_s1_s2_nn_fetch(); /* for debugging */
+
+/* SND_get_first -- the standard fn to get a block, after returning 
+ *    the first block, plug in SND_get_next for successive blocks
+ */
+sample_block_type SND_get_first(sound_type snd, long * cnt)
+{
+    register snd_list_type snd_list = snd->list;
+    /*
+     * If there is not a block of samples, we need to generate one.
+     */
+    if (snd_list->block == NULL) {
+        /*
+         * Call the 'fetch' method for this sound_type to generate 
+         * a new block of samples.
+         */
+        snd_susp_type susp = snd_list->u.susp;
+
+        snd_list->u.next = snd_list_create(susp);
+        snd_list->block = internal_zero_block;
+        /* nyquist_printf("SND_get_first: susp->fetch %p\n",
+                susp->fetch); */
+        assert(susp->log_stop_cnt == UNKNOWN || susp->log_stop_cnt >= 0);
+        (*(susp->fetch))(susp, snd_list);
+#ifdef GC_DEBUG
+        snd_list_debug(snd_list, "SND_get_first");
+#endif
+        /* nyquist_printf("SND_get_first: snd_list %p, block %p, length %d\n",
+               snd_list, snd_list->block, snd_list->block_len); */
+    }
+    if ((snd->logical_stop_cnt == UNKNOWN) && snd_list->logically_stopped) {
+        /* nyquist_printf("SND_get_first/next: snd %p logically stopped at %d\n",
+                snd, snd->current); */
+        snd->logical_stop_cnt = snd->current;
+    }
+
+    /* see if clipping needs to be applied */
+    if (snd->current + snd_list->block_len > snd->stop) {
+        /* need to clip: is clip on a block boundary? */
+        if (snd->current == snd->stop) {
+            /* block boundary: replace with zero sound */
+            snd->list = zero_snd_list;
+            snd_list_unref(snd_list);
+        } else {
+            /* not a block boundary: build new list */
+            snd->list = snd_list_create((snd_susp_type) zero_snd_list);
+            snd->list->block_len = (short) (snd->stop - snd->current);
+            snd->list->block = snd_list->block;
+            snd->list->block->refcnt++;
+            snd_list_unref(snd_list);
+        }
+        snd_list = snd->list; /* used below to return block ptr */
+    }
+
+    *cnt = snd_list->block_len;
+    /* this should never happen */
+    if (*cnt == 0) {
+        stdputstr("SND_get_first returned 0 samples\n");
+#if DEBUG_MEM
+        dbg_mem_print("snd_list info:", snd_list);
+        dbg_mem_print("block info:", snd_list->block);
+#endif
+        sound_print_tree(snd);
+        stdputstr("It is possible that you created a recursive sound\n");
+        stdputstr("using something like: (SETF X (SEQ (SOUND X) ...))\n");
+        stdputstr("Nyquist aborts from non-recoverable error\n");
+        abort();
+    }
+    snd->current += snd_list->block_len;    /* count how many we read */
+    snd->get_next = SND_get_next;
+    return snd_list->block;
+}
+
+
+sample_block_type SND_get_next(sound_type snd, long * cnt)
+{
+    register snd_list_type snd_list = snd->list;
+    /*
+     * SND_get_next is installed by SND_get_first, so we know
+     * when we are called that we are done with the current block
+     * of samples, so free it now.
+     */
+    snd_list_type cur = snd_list;
+    snd->list = snd_list = cur->u.next;
+    snd_list_ref(snd_list);
+    snd_list_unref(cur);  /* release the reference to the current block */
+
+    /* now that we've deallocated, we can use SND_get_first to finish the job */
+    return SND_get_first(snd, cnt);
+}
+
+
+
+/****************************************************************************
+*                               make_zero_block
+* Inputs:
+*       
+* Result: 
+*       
+* Effect: 
+*       
+****************************************************************************/
+
+sample_block_type make_zero_block(void)
+    {
+     sample_block_type zb;
+     int i;
+
+     falloc_sample_block(zb, "make_zero_block");
+     /* leave room for lots more references before overflow, 
+        but set the count high so that even a large number of
+        dereferences will not lead to a deallocation */
+     zb->refcnt = 0x6FFFFFFF;
+
+     for (i = 0; i < max_sample_block_len; i++) 
+        { /* fill with zeros */
+         zb->samples[i] = 0.0F;
+        } /* fill with zeros */
+     return zb;
+    }
+
+
+/* min_cnt -- help compute the logical stop or terminate as minimum */
+/*
+ * take the sound (which has just logically stopped or terminated at
+ * current sample) and
+ * convert the stop sample into the equivalent sample count as produced by
+ * susp (which may have a different sample rate).  If the count is less than
+ * the current *cnt_ptr, overwrite cnt_ptr with a new minimum.  By calling
+ * this when each of S1, S2, ... Sn reach their logical stop or termiate
+ * points, *cnt_ptr will end up with the minimum stop count, which is what
+ * we want.  NOTE: the logical stop time and terminate for signal addition 
+ * should be the MAX of logical stop times of arguments, so this routine 
+ * would not be used.
+ */
+void min_cnt(long *cnt_ptr, sound_type sound, snd_susp_type susp, long cnt)
+{
+    long c = (long) ((((sound->current - cnt) / sound->sr + sound->t0) - susp->t0) *
+      susp->sr + 0.5);
+    /* if *cnt_ptr is uninitialized, just plug in c, otherwise compute min */
+    if ((*cnt_ptr == UNKNOWN) || (*cnt_ptr > c)) {
+/*        nyquist_printf("min_cnt %p: new count is %d\n", susp, c);*/
+/*        if (c == 0) sound_print_tree(printing_this_sound);*/
+        *cnt_ptr = c;
+    }
+}
+
+
+
+/****************************************************************************
+*                                 sound_init
+* Result: void
+*       
+* Effect: 
+*       Module initialization
+*       Allocates the 'zero block', the infinitely linked block of
+*       0-valued sounds.  This is referenced by a list element which
+*       refers to itself.
+****************************************************************************/
+
+void sound_init(void)
+{
+    zero_block = make_zero_block();
+    internal_zero_block = make_zero_block();
+
+    falloc_snd_list(zero_snd_list, "sound_init");
+
+    zero_snd_list->block = zero_block;
+    zero_snd_list->u.next = zero_snd_list;
+    zero_snd_list->refcnt = 2;
+    zero_snd_list->block_len = max_sample_block_len;
+    zero_snd_list->logically_stopped = true;
+#ifdef GC_DEBUG
+    { long s;
+      stdputstr("sound_to_watch: ");
+      scanf("%p", &s);
+      watch_sound((sound_type) s);
+    }
+#endif
+   sound_desc = create_desc("SOUND", sound_xlfree, sound_xlprint,
+                            sound_xlsave, sound_xlrestore, sound_xlmark);
+}
+
+
+/* sound_scale -- copy and change scale factor of a sound */
+/**/
+sound_type sound_scale(double factor, sound_type snd)
+{
+    sound_type sndcopy = sound_copy(snd);
+    sndcopy->scale *= (float) factor;
+    return sndcopy;
+}
+
+
+
+
+/****************************************************************************
+*                            set_logical_stop_time
+* Inputs:
+*       sound_type sound: The sound for which the logical stop time is
+*                         being set
+*       time_type  when:  The logical stop time, expressed as an absolute
+*                         time.
+* Result: void
+*       
+* Effect: 
+*       Converts the time 'when' into a count of samples.
+****************************************************************************/
+
+void set_logical_stop_time(sound_type sound, time_type when)
+{
+    /*
+       'when' is an absolute time.  The number of samples to
+       be generated is the number of samples between 't0' and
+       'when'.
+
+       -----------+---+---+---+---+---+---+---+---+---+
+                  |                                |
+                  t0                               when
+     */
+    long n = (long) ((when - sound->t0) * sound->sr + 0.5);
+    if (n < 0) {
+        xlcerror("retain the current logical stop", 
+                 "logical stop sample count is negative", NIL);
+    } else {
+        sound->logical_stop_cnt = n;
+    }
+}
+
+
+
+
+/* for debugging */
+sound_type printing_this_sound = NULL;
+void ((**watch_me)()) = NULL;
+
+void set_watch(where)
+  void ((**where)());
+{
+    if (watch_me == NULL) {
+        watch_me = where;
+        nyquist_printf("set_watch: watch_me = %p\n", watch_me);
+    }
+}
+
+
+/*
+ * additional routines
+ */
+void sound_print(snd_expr, n)
+  LVAL snd_expr;
+  long n;
+{
+    LVAL result;
+
+    xlsave1(result);
+    result = xleval(snd_expr);
+    if (vectorp(result)) {
+        /* make sure all elements are of type a_sound */
+        long i = getsize(result);
+        while (i > 0) {
+            i--;
+            if (!exttypep(getelement(result, i), a_sound)) {
+                xlerror("sound_print: array has non-sound element",
+                         result);
+            }
+        }
+        sound_print_array(result, n);
+    } else if (exttypep(result, a_sound)) {
+        sound_print_sound(getsound(result), n);
+    } else {
+        xlerror("sound_print: expression did not return a sound",
+                 result);
+    }
+    xlpop();
+}
+
+
+void sound_print_sound(sound_type s, long n)
+{
+    int ntotal = 0;
+    long blocklen;
+    sample_block_type sampblock;
+
+    /* for debugging */
+    printing_this_sound = s;
+
+    nyquist_printf("sound_print: start at time %g\n", s->t0);
+
+    while (ntotal < n) {
+        if (s->logical_stop_cnt != UNKNOWN)
+            nyquist_printf("LST=%d ", (int)s->logical_stop_cnt);
+        sound_print_tree(s);
+        sampblock = sound_get_next(s, &blocklen);
+        if (sampblock == zero_block || blocklen == 0) {
+            break;
+        }
+        print_sample_block_type("sound_print", sampblock,
+                                MIN(blocklen, n - ntotal));
+        ntotal += blocklen;
+    }
+    nyquist_printf("total samples: %d\n", ntotal);
+}
+
+
+void sound_print_array(LVAL sa, long n)
+{
+    long blocklen;
+    long i, len;
+    long upper = 0;
+    sample_block_type sampblock;
+    time_type t0, tmax;
+
+    len = getsize(sa);
+    if (len == 0) {
+        stdputstr("sound_print: 0 channels!\n");
+        return;
+    }
+
+    /* take care of prepending zeros if necessary */
+    t0 = tmax = (getsound(getelement(sa, 0)))->t0;
+    for (i = 1; i < len; i++) {
+        sound_type s = getsound(getelement(sa, i));
+        t0 = MIN(s->t0, t0);
+        tmax = MAX(s->t0, tmax);
+    }
+
+    /* if necessary, prepend zeros */
+    if (t0 != tmax) {
+        stdputstr("prepending zeros to channels: ");
+        for (i = 0; i < len; i++) {
+            sound_type s = getsound(getelement(sa, i));
+            if (t0 < s->t0) {
+                nyquist_printf(" %d ", (int)i);
+                sound_prepend_zeros(s, t0);
+            }
+        }
+        stdputstr("\n");
+    }
+
+    nyquist_printf("sound_print: start at time %g\n", t0);
+
+    while (upper < n) {
+        int i;
+        boolean done = true;
+        for (i = 0; i < len; i++) {
+            sound_type s = getsound(getelement(sa, i));
+            long current = -1;  /* always get first block */
+            while (current < upper) {
+                sampblock = sound_get_next(s, &blocklen);
+                if (sampblock != zero_block && blocklen != 0) {
+                      done = false;
+                }
+                current = s->current - blocklen;
+                nyquist_printf("chan %d current %d:\n", i, (int)current);
+                 print_sample_block_type("sound_print", sampblock,
+                                        MIN(blocklen, n - current));
+                current = s->current;
+                upper = MAX(upper, current);
+            }
+        }
+        if (done) break;
+    }
+    nyquist_printf("total: %d samples x %d channels\n",
+                   (int)upper, (int)len);
+}
+
+
+/* sound_play -- compute sound, do not retain samples */
+/*
+ * NOTE: we want the capability of computing a sound without
+ * retaining samples.  This requires that no references to
+ * the sound exist, but if the sound is passed as an argument,
+ * the argument stack will have a reference.  So, we pass in
+ * an expression that evaluates to the sound we want.  The
+ * expression is eval'd, the result copied (in case the
+ * expression was a sound or a global variable and we really
+ * want to preserve the sound), and then a GC is run to 
+ * get rid of the original if there really are no other 
+ * references.  Finally, the copy is used to play the
+ * sounds.
+ */
+
+void sound_play(snd_expr)
+  LVAL snd_expr;
+{
+    int ntotal;
+    long blocklen;
+    sample_block_type sampblock;
+    LVAL result;
+    sound_type s;
+
+    xlsave1(result);
+    result = xleval(snd_expr);
+    if (!exttypep(result, a_sound)) {
+        xlerror("sound_play: expression did not return a sound",
+                 result);
+    }
+
+    ntotal = 0;
+    s = getsound(result);
+    /* if snd_expr was simply a symbol, then s now points to
+        a shared sound_node.  If we read samples from it, then
+        the sound bound to the symbol will be destroyed, so
+        copy it first.  If snd_expr was a real expression that
+        computed a new value, then the next garbage collection
+        will reclaim the sound_node.  We need to explicitly 
+        free the copy since the garbage collector cannot find
+        it.
+    */
+    s = sound_copy(s);
+    while (1) {
+#ifdef OSC
+        if (nosc_enabled) nosc_poll();
+#endif
+        sampblock = sound_get_next(s, &blocklen);
+        if (sampblock == zero_block || blocklen == 0) {
+            break;
+        }
+        /* print_sample_block_type("sound_play", sampblock, blocklen); */
+        ntotal += blocklen;
+    }
+    nyquist_printf("total samples: %d\n", ntotal);
+    sound_unref(s);
+    xlpop();
+}
+
+
+/* sound_print_tree -- print a tree version of sound structure */
+/**/
+void sound_print_tree(snd)
+  sound_type snd;
+{
+/*    nyquist_printf("sample_block_free %p\n", sample_block_free);*/
+    nyquist_printf("SOUND PRINT TREE of %p\n", snd);
+    sound_print_tree_1(snd, 0);
+}
+
+
+void indent(int n)
+{
+    while (n-- > 0) stdputstr(" ");
+}
+
+
+void sound_print_tree_1(snd, n)
+  sound_type snd;
+  int n;
+{
+    int i;
+    snd_list_type snd_list;
+    if (n > 100) {
+        stdputstr("... (skipping remainder of sound)\n");
+        return;
+    }
+    if (!snd) {
+        stdputstr("\n");
+        return;
+    }
+    nyquist_printf("sound_type@%p(%s@%p)t0 "
+                   "%g stop %d sr %g lsc %d scale %g pc %d",
+                   snd, 
+                   (snd->get_next == SND_get_next ? "SND_get_next" :
+                    (snd->get_next == SND_get_first ? "SND_get_first" : "?")),
+                   snd->get_next, snd->t0, (int)snd->stop, snd->sr, 
+                   (int)snd->logical_stop_cnt, snd->scale,
+                   (int)snd->prepend_cnt);
+    snd_list = snd->list;
+    nyquist_printf("->snd_list@%p", snd_list);
+    if (snd_list == zero_snd_list) {
+        stdputstr(" = zero_snd_list\n");
+        return;
+    }
+    for (i = 0; ; i++) {
+        if (snd_list == zero_snd_list) {
+            if (i > 1) nyquist_printf(" (skipping %d) ", i-1);
+            stdputstr("->zero_snd_list\n");
+            return;
+        }
+        if (!snd_list->block) {
+            if (i > 0) nyquist_printf(" (skipping %d) ", i);
+            stdputstr("->\n");
+            indent(n + 2);
+
+            nyquist_printf("susp@%p(%s)toss_cnt %d "
+                           "current %d lsc %d sr %g t0 %g %p\n",
+                           snd_list->u.susp, snd_list->u.susp->name,
+                           (int)snd_list->u.susp->toss_cnt,
+                           (int)snd_list->u.susp->current,
+                           (int)snd_list->u.susp->log_stop_cnt,
+                           snd_list->u.susp->sr,
+                           snd_list->u.susp->t0, snd_list);
+/*            stdputstr("HI THERE AGAIN\n");*/
+            susp_print_tree(snd_list->u.susp, n + 4);
+            return;
+        }
+        snd_list = snd_list->u.next;
+    }
+}
+
+
+/* mark_audio_time -- record the current playback time
+ *
+ * The global variable *audio-markers* is treated as a list.
+ * When the user types ^Q, this function pushes the current
+ * playback time onto the list
+ */
+void mark_audio_time()
+{
+    double playback_time = sound_frames / sound_srate - sound_latency;
+    LVAL time_node = cvflonum(playback_time);
+    setvalue(s_audio_markers, cons(time_node, getvalue(s_audio_markers)));
+    gprintf(TRANS, " %g ", playback_time); 
+    fflush(stdout);
+}
+
+
+/* compute constants p1 and p2:
+  pitchconvert(0) * 2 = pitchconvert(12)  - octaves
+          exp(p2) * 2 = exp(12 * p1 + p2)
+                    2 = exp(12 * p1)
+               log(2) = 12 * p1
+
+         p1 = log(2.0)/12;
+
+  pitchconvert(69) gives 440Hz
+          exp(69 * p1 + p2) = 440
+               69 * p1 + p2 = log(440)
+
+        p2 = log(440.0) - (69 * p1);
+*/
+
+#define p1 0.0577622650466621
+#define p2 2.1011784386926213
+
+
+double hz_to_step(double hz)
+{
+    return (log(hz) - p2) / p1;
+}
+
+
+double step_to_hz(steps)
+  double steps;
+{
+    return exp(steps * p1 + p2);
+}
+
+
+/*
+ * from old stuff...
+ */
+
+static void sound_xlfree(s)
+sound_type s;
+{
+/*    nyquist_printf("sound_xlfree(%p)\n", s);*/
+    sound_unref(s);
+}
+
+
+static void sound_xlprint(LVAL fptr, sound_type s)
+{
+        /* the type cast from s to LVAL is OK because
+         * putatm does not dereference the 3rd parameter */
+    putatm(fptr, "Sound", (LVAL) s);
+}
+
+
+static void sound_xlsave(fp, s)
+FILE *fp;
+sound_type s;
+{
+    stdputstr("sound_save called\n");
+}
+
+
+static unsigned char *sound_xlrestore(FILE *fp)
+{
+   stdputstr("sound_restore called\n");
+   return NULL;
+}
+
+
+/* sound_xlmark -- mark LVAL nodes reachable from this sound */
+/**/
+void sound_xlmark(s)
+sound_type s;
+{
+    snd_list_type snd_list;
+    long counter = 0;
+#ifdef TRACESNDGC
+    nyquist_printf("sound_xlmark(%p)\n", s);
+#endif
+    if (!s) return; /* pointers to sounds are sometimes NULL */
+    snd_list = s->list;
+    while (snd_list->block != NULL) {
+        if (snd_list == zero_snd_list) {
+#ifdef TRACESNDGC
+            stdputstr(" terminates at zero_snd_list\n");
+#endif
+            return;
+        } else if (counter > 1000000) {
+            stdputstr("You created a recursive sound! This is a Nyquist bug.\n");
+            stdputstr("The only known way to do this is by a SETF on a\n");
+            stdputstr("local variable or parameter that is being passed to SEQ\n");
+            stdputstr("or SEQREP. The garbage collector assumes that sounds are\n");
+            stdputstr("not recursive or circular, and follows sounds to their\n");
+            stdputstr("end. After following a million nodes, I'm pretty sure\n");
+            stdputstr("that there is a cycle here, but since this is a bug,\n");
+            stdputstr("I cannot promise to recover. Prepare to crash. If you\n");
+            stdputstr("cannot locate the cause of this, contact the author -RBD.\n");
+        } 
+        snd_list = snd_list->u.next;
+        counter++;
+    }
+    if (snd_list->u.susp->mark) {
+#ifdef TRACESNDGC
+        nyquist_printf(" found susp (%s) at %p with mark method\n",
+               snd_list->u.susp->name, snd_list->u.susp);
+#endif
+        (*(snd_list->u.susp->mark))(snd_list->u.susp);
+    } else {
+#ifdef TRACESNDGC
+        nyquist_printf(" no mark method on susp %p (%s)\n",
+               snd_list->u.susp, snd_list->u.susp->name);
+#endif
+    }
+}
+
+
+void sound_symbols()
+{
+   a_sound = xlenter("SOUND");
+   s_audio_markers = xlenter("*AUDIO-MARKERS*");
+   setvalue(s_audio_markers, NIL);
+}
+
+
+/* The SOUND Type: */
+
+
+boolean soundp(s)
+LVAL s;
+{
+   return (exttypep(s, a_sound));
+}
+
+
+/* sound_zero - create and return a zero that terminates now */
+/**/
+sound_type sound_zero(time_type t0,rate_type sr)
+{
+    sound_type sound;
+    falloc_sound(sound, "sound_zero");
+
+    sound->get_next = SND_get_first;
+    sound->list = zero_snd_list;
+    sound->logical_stop_cnt = sound->current = 0;
+    sound->true_t0 = sound->t0 = sound->time = t0;
+    sound->stop = MAX_STOP;
+    sound->sr = sr;
+    sound->scale = 1.0F;
+    sound->table = NULL;
+    sound->extra = NULL;
+
+    return sound;
+}
+
+
+LVAL cvsound(s)
+sound_type s;
+{
+/*   nyquist_printf("cvsound(%p)\n", s);*/
+   return (cvextern(sound_desc, (unsigned char *) s));
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sound.h b/lib-src/libnyquist/nyquist/nyqsrc/sound.h
new file mode 100644
index 0000000..9cdd95a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/sound.h
@@ -0,0 +1,533 @@
+/* sound.h -- new nyquist sound data type */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  changes for portability: moved some defns out of here
+ */
+
+#include <math.h>
+#include "stdefs.h"
+
+/* used for *AUDIO-MARKERS* */
+extern long sound_frames;
+extern double sound_srate;
+
+#if OSC
+extern int nosc_enabled; /* enable polling for OSC messages */
+#endif
+
+#if USE_PRINTF
+#define nyquist_printf printf
+#endif
+
+#define PERMS            0644           /* -rw-r--r-- */
+
+/* default stop sample count (for clipping) */
+#define MAX_STOP 0x7FFFFFFF
+
+/* default stop time (for clipping) */
+#define MAX_STOP_TIME 10E20
+/* LISP-SRC: (SETF MAX-STOP-TIME 10E20) */
+#define MIN_START_TIME -10E20
+/* LISP-SRC: (SETF MIN-START-TIME -10E20) */
+
+/* conversion from float to integer */
+#define SCALE_FACTOR_TO_BYTE 127
+#define SCALE_FACTOR_TO_SHORT 32767
+#define SCALE_FACTOR_TO_24BIT 0x7FFFFF
+#define SCALE_FACTOR_TO_LONG 2147483647
+
+/* Note that the values assigned here are not arbitrary, but represent
+   a dominance relationship among the interpolation types.
+*/
+#define INTERP_n 0
+#define INTERP_s 1
+#define INTERP_i 2
+#define INTERP_r 3
+
+#define INTERP_nn 0
+#define INTERP_ns 1
+#define INTERP_ni 2
+#define INTERP_nr 3
+#define INTERP_sn 4
+#define INTERP_ss 5
+#define INTERP_si 6
+#define INTERP_sr 7
+
+#define INTERP_nnn 0
+#define INTERP_nns 1
+#define INTERP_nni 2
+#define INTERP_nnr 3
+#define INTERP_nsn 4
+#define INTERP_nss 5
+#define INTERP_nsi 6
+#define INTERP_nsr 7
+#define INTERP_nin 8
+#define INTERP_nis 9
+#define INTERP_nii 10
+#define INTERP_nir 11
+#define INTERP_nrn 12
+#define INTERP_nrs 13
+#define INTERP_nri 14
+#define INTERP_nrr 15
+#define INTERP_snn 16
+#define INTERP_sns 17
+#define INTERP_sni 18
+#define INTERP_snr 19
+#define INTERP_ssn 20
+#define INTERP_sss 21
+#define INTERP_ssi 22
+#define INTERP_ssr 23
+#define INTERP_sin 24
+#define INTERP_sis 25
+#define INTERP_sii 26
+#define INTERP_sir 27
+#define INTERP_srn 28
+#define INTERP_srs 29
+#define INTERP_sri 30
+#define INTERP_srr 31
+
+#define INTERP_nnnn 0
+#define INTERP_nnns 1
+#define INTERP_nnsn 4
+#define INTERP_nnss 5
+#define INTERP_nsnn 16
+#define INTERP_nsns 17
+#define INTERP_nssn 20
+#define INTERP_nsss 21
+#define INTERP_snnn 64
+#define INTERP_snns 65
+#define INTERP_snsn 68
+#define INTERP_snss 69
+#define INTERP_ssnn 80
+#define INTERP_ssns 81
+#define INTERP_sssn 84
+#define INTERP_ssss 85
+#define INTERP_niii 42
+#define INTERP_siii 106
+#define INTERP_nrrr 63
+#define INTERP_srrr 127
+
+#define INTERP_nnnnnn 0 
+#define INTERP_ssssss 1365
+
+#define INTERP_nnnnnnnn 0
+#define INTERP_ssssssss 21845
+
+
+#define INTERP_MASK 3
+#define INTERP_SHIFT 2
+
+LVAL snd_badsr(void);
+
+typedef double time_type;
+typedef double rate_type;
+typedef float sample_type;
+typedef double promoted_sample_type;
+
+/* use radians or degrees for phase? */
+#define ANGLEBASE 360.0
+
+/* used by sndwrite.c for output buffers.  This should be
+ * eliminated:
+ */
+#define MAX_SND_CHANNELS 24
+
+#define max_table_len 100000
+/* Set to 4 for debugging block allocation stuff, 1012? for
+   production
+*/
+/* leave a few words short of 1024 in case we allocate powers of 2 */
+#define max_sample_block_len 1020
+/* #define max_sample_block_len 4 */
+
+/* Defines needed for xlisp */
+#define getsound(x)     ((sound_type) getinst(x))
+#define xlgasound()     (testarg(typearg(soundp)))
+
+typedef short SFDataType, *SFDataPtr;
+
+typedef sample_type  sample_block_values[max_sample_block_len], 
+                    *sample_block_values_type;
+
+typedef struct {
+    long                refcnt;                          /* reference count */
+    sample_block_values samples;
+} sample_block_node, *sample_block_type;
+ 
+
+typedef struct snd_susp_struct {
+    void                (*fetch)();
+    void                (*keep_fetch)();
+    void                (*free)();
+    void                (*mark)();  /* marks LVAL nodes for GC */
+    void                (*print_tree)();    /* debugging */
+    char *              name;       /* string name for debugging */
+    long                toss_cnt;   /* return this many zeros, then compute */
+    long                current;    /* current sample number */
+    double              sr;         /* sample rate */
+    time_type           t0;         /* starting time */
+    long                log_stop_cnt;   /* logical stop count */
+    /* other susp dependent stuff will be here... */
+} snd_susp_node, *snd_susp_type;
+
+
+typedef struct snd_list_struct {
+    sample_block_type   block;  /* pointer to block of samples */
+    union {
+        struct snd_list_struct  *next;
+        snd_susp_type           susp;
+    }                   u;
+    short               refcnt;
+    short               block_len;
+    boolean             logically_stopped;
+} snd_list_node, *snd_list_type;
+
+extern snd_list_type list_watch; //DBY
+
+
+typedef struct table_struct {
+    long refcount;  /* reference count */
+    double length;  /* number of samples in table 
+                       (double allows fractional length)*/
+    sample_type samples[1]; /* arbitrary length array of sample */
+} table_node, *table_type;
+
+
+/* some counts are biased by -max_sample_block_len, so UNKNOWN can't be -1
+ * Any number less than -max_sample_block should do
+ */
+#define UNKNOWN (-10-max_sample_block_len)
+
+typedef struct sound_struct {
+    sample_block_type   (*get_next)(/* struct sound_struct *snd, long *cnt */);
+    time_type           time;   /* logical starting time */
+    time_type           t0;     /* quantized time of first sample */
+    long                stop;  /* stop (clipping) sample no. */
+    time_type           true_t0;    /* exact time of first sample */
+    rate_type           sr;     /* sample rate */
+    long                current;        /* current sample number,
+                                         if negative, then the first 
+                                         -current samples must be dropped
+                                         in order to find the first sample */
+    long                logical_stop_cnt; /* log stop sample no, -1=unknwn */
+    snd_list_type       list;   /* sample block list, starting at curr. samp */
+    sample_type         scale;  /* scale factor for the result */
+    long                prepend_cnt;    /* how many zeros to prepend */
+    /* function to use as get_next after prepended zeros are generated: */
+    sample_block_type   (*after_prepend)
+                        (/* struct sound_struct * snd, long * cnt */);
+    table_type table;   /* pointer to table-ized version of this sound */
+    long *extra;        /* used for extra state information, first word of extra
+			   state should be the length of the extra state 
+			   (see sound_unref())
+                         */
+} sound_node, *sound_type;
+
+/* convert number of samples to memory size: */
+#define table_size_in_bytes(n) \
+    (sizeof(table_node) + sizeof(sample_type) * ((n) - 1))
+
+extern sample_block_type zero_block;
+extern sample_block_type internal_zero_block;
+
+extern snd_list_type zero_snd_list;
+
+extern sound_type printing_this_sound;  /* debugging global */
+
+extern double sound_latency; /* controls output latency */
+double snd_set_latency(double latency); 
+/* LISP: (SND-SET-LATENCY FLONUM) */
+
+double compute_phase(double phase, double key, long n, double srate,
+                     double new_srate, double freq, double *incr_ptr);
+
+boolean soundp();
+/* LISP: (SOUNDP ANY) */
+
+void snd_list_ref(snd_list_type list);
+void sound_unref(sound_type snd);
+void snd_list_unref(snd_list_type list);
+
+LVAL cvsound();
+extern LVAL a_sound;
+
+sample_block_type SND_get_next(sound_type snd, long * cnt);
+sample_block_type SND_get_first(sound_type snd, long * cnt);
+sample_block_type SND_get_zeros(sound_type snd, long * cnt);
+sample_block_type SND_flush(sound_type snd, long * cnt);
+
+double hz_to_step();    /* LISP: (HZ-TO-STEP ANYNUM) */
+int interp_style(sound_type s, rate_type sr);
+void set_logical_stop_time(); /* LISP: (SND-SET-LOGICAL-STOP SOUND ANYNUM) */
+
+#define xlog(x) log(x)
+/* LISP: double (LOG FLONUM) */
+snd_list_type snd_list_create(snd_susp_type susp);
+void snd_list_terminate(snd_list_type snd_list);
+void snd_sort_2(sound_type * s1_ptr, sound_type * s2_ptr, rate_type sr);
+
+double snd_sref(sound_type s, time_type t); 
+    /* LISP: (SND-SREF SOUND ANYNUM) */
+
+double snd_sref_inverse(sound_type s, double val);
+    /* LISP: (SREF-INVERSE SOUND ANYNUM) */
+
+double snd_stop_time(sound_type s); /* LISP: (SND-STOP-TIME SOUND) */
+#define snd_time(s) (s)->time
+    /* LISP: double (SND-TIME SOUND) */
+
+#define snd_srate(s) (s)->sr
+    /* LISP: double (SND-SRATE SOUND) */
+#define snd_t0(s) (s)->t0
+    /* LISP: double (SND-T0 SOUND) */
+
+sound_type snd_xform(sound_type snd, rate_type sr, time_type time, 
+        time_type start_time, time_type stop_time, promoted_sample_type scale);
+    /* LISP: (SND-XFORM SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
+sound_type sound_create(snd_susp_type susp, time_type t0, rate_type sr,
+        promoted_sample_type scale);
+
+void min_cnt(long *cnt_ptr, sound_type sound, snd_susp_type susp, long cnt);
+void indent(int n);
+void sound_prepend_zeros(sound_type snd, time_type t0);
+
+
+
+#ifndef GCBUG
+#define blocks_to_watch_max 50
+extern long blocks_to_watch_len;
+extern sample_block_type blocks_to_watch[blocks_to_watch_max];
+
+void block_watch(long sample_block);
+    /* LISP: (BLOCK-WATCH FIXNUM) */
+long sound_nth_block(sound_type snd, long n);
+    /* LISP: (SOUND-NTH-BLOCK SOUND FIXNUM) */
+#endif
+
+sound_type sound_copy(sound_type snd); 
+    /* LISP: (SND-COPY SOUND) */
+void sound_xlmark(sound_type s);
+void sound_print(LVAL snd_expr, long n);
+    /* LISP: (SND-PRINT ANY FIXNUM) */
+void sound_play(LVAL snd_expr);
+    /* LISP: (SND-PLAY ANY) */
+void stats();
+    /* LISP: (STATS) */
+void sound_print_tree(sound_type snd);
+    /* LISP: (SND-PRINT-TREE SOUND) */
+    
+void mark_audio_time();
+
+void sound_print_tree_1(sound_type snd, int n);
+
+sound_type sound_scale(double factor, sound_type snd);
+    /* LISP: (SND-SCALE ANYNUM SOUND) */
+void sound_init(void);
+
+void sound_symbols(void);
+
+table_type sound_to_table(sound_type s);
+
+void table_unref(table_type table);
+
+sound_type sound_zero(time_type t0, rate_type sr);
+    /* LISP: (SND-ZERO ANYNUM ANYNUM) */
+
+#define sound_get_next(s, n) ((*(s->get_next))(s, n))
+
+#define susp_print_tree(s, n) (*((s)->print_tree))(s, n)
+
+double step_to_hz();
+    /* LISP: (STEP-TO-HZ ANYNUM) */
+
+/* macros for access to samples within a suspension */
+/* NOTE: assume suspension structure is named "susp" */
+
+/* susp_check_samples points sample_ptr to a new sample block if necessary */
+#define susp_check_samples(sound, sample_ptr, sample_cnt) \
+    if (susp->sample_cnt == 0) \
+        susp_get_samples(sound, sample_ptr, sample_cnt)
+
+/* susp_check_samples_break is similar to susp_check_samples - "_break"
+ *   normally means that this code will break out of the inner loop, but in
+ *   this case, there is no reason (neither log nor term) to break.
+ *   x2_sample is taken from sound
+ */
+#define susp_check_samples_break(sound, sample_ptr, sample_cnt, x2_sample) \
+    if (susp->sample_cnt == 0) { \
+        susp_get_samples(sound, sample_ptr, sample_cnt); \
+        x2_sample = susp_current_sample(sound, sample_ptr); }
+
+
+/* susp_get_samples always gets next block (useful only in initialization code) */
+#define susp_get_samples(sound, sample_ptr, sample_cnt) \
+        susp->sample_ptr = sound_get_next(susp->sound, &(susp->sample_cnt))->samples
+
+/* susp_get_block_samples always gets next block (useful only in initialization code) */
+#define susp_get_block_samples(sound, sample_block_ptr, sample_ptr, sample_cnt) \
+    susp->sample_block_ptr = sound_get_next(susp->sound, &susp->sample_cnt); \
+    susp->sample_ptr = susp->sample_block_ptr->samples
+
+/* susp_took is called after you've taken n samples */
+#define susp_took(sample_cnt, n) susp->sample_cnt -= n
+
+/* susp_fetch_sample is used to grab just one sample, doesn't check for samples!,
+ *    but applies scale factor:  */
+#define susp_fetch_sample(sound, sample_ptr, sample_cnt) \
+          (susp->sound->scale * (susp->sample_cnt--, *(susp->sample_ptr++)))
+
+/* susp_current_sample grabs sample without advancing to next, applies scale
+ *     factor: */
+#define susp_current_sample(sound, sample_ptr) \
+          (susp->sound->scale * (*(susp->sample_ptr)))
+
+/* susp_check_term_samples checks for samples; if new ones are fetched, then
+ * run termination test on signal and record result.
+ */
+#define susp_check_term_samples(sound, sample_ptr, sample_cnt) \
+    if (susp->sample_cnt == 0) { \
+        susp_get_samples(sound, sample_ptr, sample_cnt); \
+        terminate_test(sample_ptr, sound, susp->sample_cnt); }
+
+/* susp_check_term_log_samples checks for samples
+ * if new ones are fetched, then run termination test and logical stop
+ * test on signal and record results.
+ */
+#define susp_check_term_log_samples(sound, sample_ptr, sample_cnt) \
+    if (susp->sample_cnt == 0) { \
+        susp_get_samples(sound, sample_ptr, sample_cnt); \
+        logical_stop_test(sound, susp->sample_cnt); \
+        terminate_test(sample_ptr, sound, susp->sample_cnt); }
+
+/* susp_check_term_log_block_samples checks for samples
+ * if new ones are fetched, then run termination test and logical stop
+ * test on signal and record results.  In this case, termination and logical
+ * stop happen at the MAXIMUM of termination and logical stop times, resp.
+ *
+ * Originally, this code assumed that logical stops occurred on block boundaries,
+ * but because of the SET-LOGICAL-STOP function, which just writes a stop time
+ * into the sound_struct, the logical stop can be anywhere. As soon as the 
+ * logical stop is known, we want to propagate the value from the sound being
+ * read into the sound being computed. The propagation should set the logical
+ * stop of the computed sound to the MAX of any current value and the new 
+ * value. When the bit fields indicate that all logical stop times have been
+ * encountered, then the sound being computed will make the logical stop happen
+ * on a block boundary and set the flag on the block of samples where the stop
+ * occurs.
+ */
+#define susp_check_term_log_block_samples(sound, sample_block_ptr, sample_ptr, sample_cnt, bit, all) \
+    if (susp->sample_cnt == 0) { \
+        susp_get_block_samples(sound, sample_block_ptr, sample_ptr, sample_cnt); \
+/*OLD   if (susp->sound->logical_stop_cnt ==                  \
+            susp->sound->current - susp->sample_cnt) { \
+*/ \
+        if (susp->sound->logical_stop_cnt != UNKNOWN && \
+            !(susp->logical_stop_bits & bit)) { \
+            susp->logical_stop_bits |= bit; \
+/*OLD \
+            if (susp->logical_stop_bits == all) { \
+                susp->susp.log_stop_cnt = (long) \
+                 ((((susp->sound->current - susp->sample_cnt) / \
+                   susp->sound->sr + susp->sound->t0) - \
+                   susp->susp.t0) * susp->susp.sr + 0.5); \
+                assert(susp->susp.log_stop_cnt >= 0); } } \
+*/ \
+            susp->susp.log_stop_cnt = max(susp->susp.log_stop_cnt, \
+                    (((susp->sound->logical_stop_cnt / \
+                       susp->sound->sr + susp->sound->t0) - \
+                      susp->susp.t0) * susp->susp.sr + 0.5)); } \
+        if (susp->sample_ptr == zero_block->samples) { \
+            susp->terminate_bits |= bit; \
+            if (susp->terminate_bits == all) { \
+                susp->terminate_cnt = (long) \
+                 ((((susp->sound->current - susp->sample_cnt) / \
+                   susp->sound->sr + susp->sound->t0) - \
+                   susp->susp.t0) * susp->susp.sr + 0.5); \
+    } } }
+
+
+/* logical_stop_cnt_cvt is used to convert from the logical stop count
+ * at one sample rate to that of another sample rate -- this macro is
+ * used by the snd_make_<op> routine in every <op>.c file, and assumes
+ * the target sample rate is susp->susp.sr.
+ *
+ * NOTE: this macro does not take into account the possibility of different
+ * start times - maybe it should.
+ */
+#define logical_stop_cnt_cvt(sound) \
+    (sound->logical_stop_cnt == UNKNOWN ? UNKNOWN : \
+     ROUND((sound->logical_stop_cnt / sound->sr) * susp->susp.sr))
+
+
+/* logical_stop_test tests to see if sound has logically stopped; if so,
+ * sets susp->susp.log_stop_cnt.  The resulting logical_stop_cnt will reflect
+ * the minimum logical_stop time of all sounds to which this test is applied.
+ */
+#define logical_stop_test(sound, cnt) \
+    if (susp->sound->logical_stop_cnt == susp->sound->current - (cnt)) {\
+        min_cnt(&susp->susp.log_stop_cnt, susp->sound, (snd_susp_type) susp, cnt); }
+
+/* terminate_test checks to see if sound has terminated; if so, 
+ * sets susp->terminate_cnt.  The resulting terminate_cnt will reflect
+ * the minimum termination time of all sounds to which this test is applied.
+ */
+#define terminate_test(sample_ptr, sound, cnt) \
+    if (susp->sample_ptr == zero_block->samples) { \
+            min_cnt(&susp->terminate_cnt, susp->sound, (snd_susp_type) susp, cnt); }
+
+
+/* susp_check_log_samples checks for new samples then checks for
+ * termination and logical stop conditions
+ */
+#define susp_check_log_samples(sound, sample_ptr, sample_cnt) \
+    if (susp->sample_cnt == 0) { \
+      susp_get_samples(sound, sample_ptr, sample_cnt); \
+      logical_stop_test(sound, susp->sample_cnt); }
+
+/* susp_check_term_samples_break checks for new samples then checks for
+ * termination condition; breaks from inner loop
+ */
+#define susp_check_term_samples_break( \
+  sound, sample_ptr, sample_cnt, x2_sample) \
+    if (susp->sample_cnt == 0) { \
+      susp_get_samples(sound, sample_ptr, sample_cnt); \
+      x2_sample = susp_current_sample(sound, sample_ptr); \
+      terminate_test(sample_ptr, sound, susp->sample_cnt); \
+      if (susp->terminate_cnt < susp->susp.current + cnt + togo) { \
+          break; }} \
+    else x2_sample = susp_current_sample(sound, sample_ptr); 
+
+/* susp_check_log_samples_break checks for new samples then checks for
+ * logical stop conditions; breaks from inner loop
+ */
+#define susp_check_log_samples_break( \
+  sound, sample_ptr, sample_cnt, x2_sample) \
+    if (susp->sample_cnt == 0) { \
+      susp_get_samples(sound, sample_ptr, sample_cnt); \
+      x2_sample = susp_current_sample(sound, sample_ptr); \
+      logical_stop_test(sound, susp->sample_cnt); \
+      if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN && \
+          (susp->susp.log_stop_cnt < susp->susp.current + cnt + togo)) { \
+          break; }} \
+    else x2_sample = susp_current_sample(sound, sample_ptr);
+
+
+/* susp_check_term_log_samples_break checks for new samples then checks for
+ * termination and logical stop conditions; breaks from inner loop
+ */
+#define susp_check_term_log_samples_break( \
+  sound, sample_ptr, sample_cnt, x2_sample) \
+    if (susp->sample_cnt == 0) { \
+      susp_get_samples(sound, sample_ptr, sample_cnt); \
+      x2_sample = susp_current_sample(sound, sample_ptr); \
+      terminate_test(sample_ptr, sound, susp->sample_cnt); \
+      logical_stop_test(sound, susp->sample_cnt); \
+      if ((susp->terminate_cnt != UNKNOWN && \
+           susp->terminate_cnt < susp->susp.current + cnt + togo) || \
+          (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN && \
+           susp->susp.log_stop_cnt < susp->susp.current + cnt + togo)) { \
+          break; }} \
+    else x2_sample = susp_current_sample(sound, sample_ptr);
+        
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/stats.c b/lib-src/libnyquist/nyquist/nyqsrc/stats.c
new file mode 100644
index 0000000..7f21612
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/stats.c
@@ -0,0 +1,27 @@
+/*
+ * stats.c
+ *
+ * produce statistics.
+ */
+#include "switches.h"
+#include <stdio.h>
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+
+
+void stats()
+{
+    nyquist_printf("\n\nNyquist statistics:\n\n");
+    nyquist_printf("Memory usage:\n");
+    nyquist_printf("\tconsumed %d pools of size %d\n", npools, MAXPOOLSIZE);
+    nyquist_printf("\tdata structure usage:\n");
+    nyquist_printf("\t\tsounds\t%d\n", sound_used);
+    nyquist_printf("\t\tsnd lists\t%d\n", snd_list_used);
+    nyquist_printf("\t\tsample blocks\t%d\n", sample_block_used);
+    nyquist_printf("\t\ttable space in bytes\t%ld\n", table_memory);
+    nyquist_printf("\n");
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/stdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/stdefs.h
new file mode 100644
index 0000000..9eba22c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/stdefs.h
@@ -0,0 +1,49 @@
+/* stdefs.h */
+
+#ifndef TRUE
+#define TRUE  1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef PI
+#define PI  (3.14159265358979323846)
+#endif
+
+#ifndef PI2
+#define PI2 (6.28318530717958647693)
+#endif
+
+#define D2R (0.01745329348)          /* (2*pi)/360 */
+#define R2D (57.29577951)            /* 360/(2*pi) */
+
+#ifndef MAX
+#define MAX(x,y) ((x)>(y) ?(x):(y))
+#endif
+#ifndef MIN
+#define MIN(x,y) ((x)<(y) ?(x):(y))
+#endif
+
+#ifndef ABS
+#define ABS(x)   ((x)<0   ?(-(x)):(x))
+#endif
+
+#ifndef SGN
+#define SGN(x)   ((x)<0   ?(-1):((x)==0?(0):(1)))
+#endif
+
+typedef float mem_float;
+typedef double fast_float;
+
+/* I took out this typedef because the same thing
+ * exists in cext.h which causes a conflict:  -RBD
+typedef unsigned char boolean; */
+
+#include "cext.h"
+
+#define true 1
+#define false 0
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/trigger.c b/lib-src/libnyquist/nyquist/nyqsrc/trigger.c
new file mode 100644
index 0000000..f55ba95
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/trigger.c
@@ -0,0 +1,326 @@
+/* trigger.c -- return zero until input transitions from <=0 to >0, then
+   evaluate a closure to get a signal and convert to an add
+   of the new signal and a copy of this trigger object. 
+   The sample rate of the output is the sample rate of the input, and 
+   sounds returned by the closure must also have a matching sample rate.
+   The trigger will take place on the first input sample (zero delay) if the
+   first sample of the input is >0.
+   The input scale factor is assumed to be 1, so caller should force scaling
+   especially if the scale factor is negative (!)
+   The trigger terminates when the input signal terminates (but any adds
+   continue to run until all their inputs terminate).
+
+Some implementation notes:
+
+The closure gets evaluated at the time of the positive sample.
+When the positive sample is encountered, first close off the
+current output block. 
+
+Next, evaluate the closure, clone the trigger, and convert 
+the current trigger to an add. The next fetch will therefore
+go to the add susp and it will add the closure result to the
+zeros that continue to be generated by (a clone of) the trigger.
+It would be simple if we could back the clone up one sample:
+on the first call to the add, it will ask for samples from the
+trigger clone and the closure, but the trigger clone has already
+processed the positive sample, so it is one sample ahead of 
+everyone else. Since we've just read a sample, we CAN back up
+just by carefully updating the input pointer to one less than
+we actually read, forcing a reread later. (We'll still store
+the previous value so re-reading will not re-trigger.)
+*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 13Dec06  rbd  created from sndseq.c
+ */
+
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "scale.h"
+#include "add.h"
+#include "extern.h"
+#include "cext.h"
+#include "assert.h"
+
+#define TRIGGERDBG 0
+#define D if (TRIGGERDBG) 
+
+/* Note: this structure is identical to an add_susp structure up
+   to the field output_per_s2 so that we can convert this into
+   an add after eval'ing the closure.  Since this struct is bigger
+   than an add, make sure not to clobber the "free" routine 
+   (trigger_free) or else we'll leak memory.
+ */
+typedef struct trigger_susp_struct {
+    snd_susp_node               susp;
+    boolean                     started;
+    int                         terminate_bits;
+    long                        terminate_cnt;
+    int                         logical_stop_bits;
+    boolean                     logically_stopped;
+    sound_type                  s1;
+    long                        s1_cnt;
+    sample_block_type           s1_bptr;        /* block pointer */
+    sample_block_values_type    s1_ptr;
+    sound_type                  s2;
+    long                        s2_cnt;
+    sample_block_type           s2_bptr;        /* block pointer */
+    sample_block_values_type    s2_ptr;
+
+    /* trigger-specific data starts here */
+    sample_type                 previous;
+    LVAL                        closure;
+
+} trigger_susp_node, *trigger_susp_type;
+
+
+void trigger_fetch(trigger_susp_type, snd_list_type);
+void trigger_free();
+
+extern LVAL s_stdout;
+
+void trigger_mark(trigger_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    if (susp->closure) mark(susp->closure);
+}
+
+
+
+/* trigger_fetch returns zero blocks until s1 goes from <=0 to >0 */
+/**/
+void trigger_fetch(trigger_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+    register sample_block_values_type out_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "trigger_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block */
+        togo = max_sample_block_len - cnt;
+
+        /* don't run past the input sample block: */
+        susp_check_term_samples(s1, s1_ptr, s1_cnt);
+        togo = min(togo, susp->s1_cnt);
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+            togo = susp->terminate_cnt - (susp->susp.current + cnt);
+            if (togo == 0) break;
+        }
+
+        n = togo;
+        input_ptr_reg = susp->s1_ptr;
+        out_ptr_reg = out_ptr;
+        if (n) do { /* the inner sample computation loop */
+            sample_type s = *input_ptr_reg++;
+            if (susp->previous <= 0 && s > 0) {
+                trigger_susp_type new_trigger;
+                sound_type new_trigger_snd;
+                LVAL result;
+                long delay; /* sample delay to s2 */
+                time_type now;
+
+                susp->previous = s; /* don't retrigger */
+
+                /**** close off block ****/
+                togo = togo - n;
+                susp->s1_ptr += togo;
+                susp_took(s1_cnt, togo);
+                cnt += togo;
+                snd_list->block_len = cnt;
+                susp->susp.current += cnt;
+                now = susp->susp.t0 + susp->susp.current / susp->susp.sr;
+
+                /**** eval closure and add result ****/
+D               nyquist_printf("trigger_fetch: about to eval closure at %g, "
+                               "susp->susp.t0 %g, susp.current %d:\n",
+                               now, susp->susp.t0, (int)susp->susp.current);
+                xlsave1(result);
+                result = xleval(cons(susp->closure, consa(cvflonum(now))));
+                if (exttypep(result, a_sound)) {
+                    susp->s2 = sound_copy(getsound(result));
+D                   nyquist_printf("trigger: copied result from closure is %p\n",
+                                   susp->s2);
+                } else xlerror("closure did not return a (monophonic) sound", 
+                               result);
+D               nyquist_printf("in trigger: after evaluation; "
+                               "%p returned from evform\n",
+                               susp->s2);
+                result = NIL;
+
+                /**** cloan this trigger to become s1 ****/
+                falloc_generic(new_trigger, trigger_susp_node, 
+                               "new_trigger");
+                memcpy(new_trigger, susp, sizeof(trigger_susp_node));
+                /* don't copy s2 -- it should only be referenced by add */
+                new_trigger->s2 = NULL;
+                new_trigger_snd = sound_create((snd_susp_type) new_trigger,
+                                               now, susp->susp.sr, 1.0F);
+                susp->s1 = new_trigger_snd;
+                /* add will have to ask new_trigger for samples, new_trigger
+                 * will continue reading samples from s1 (the original input)
+                 */
+                susp->s1_cnt = 0;
+                susp->s1_ptr = NULL;
+
+                /**** convert to add ****/
+                susp->susp.mark = add_mark;
+                /* logical stop will be recomputed by add: */
+                susp->susp.log_stop_cnt = UNKNOWN; 
+                susp->susp.print_tree = add_print_tree;
+
+                /* assume sample rates are the same */
+                if (susp->s1->sr != susp->s2->sr) 
+                    xlfail("in trigger: sample rates must match");
+
+                /* take care of scale factor, if any */
+                if (susp->s2->scale != 1.0) {
+                    // stdputstr("normalizing next sound in a seq\n");
+                    susp->s2 = snd_make_normalize(susp->s2);
+                }
+
+                /* figure out which add fetch routine to use */
+                delay = ROUND((susp->s2->t0 - now) * susp->s1->sr);
+                if (delay > 0) {    /* fill hole between s1 and s2 */
+                    D stdputstr("using add_s1_nn_fetch\n");
+                    susp->susp.fetch = add_s1_nn_fetch;
+                    susp->susp.name = "trigger:add_s1_nn_fetch";
+                } else {
+                    susp->susp.fetch = add_s1_s2_nn_fetch;
+                    susp->susp.name = "trigger:add_s1_s2_nn_fetch";
+                }
+
+D               stdputstr("in trigger: calling add's fetch\n");
+                /* fetch will get called later ..
+                   (*(susp->susp.fetch))(susp, snd_list); */
+D               stdputstr("in trigger: returned from add's fetch\n");
+                xlpop();
+
+                susp->closure = NULL;   /* allow garbage collection now */
+                /**** calculation tree modified, time to exit ****/
+                /* but if cnt == 0, then we haven't computed any samples */
+                /* call on new fetch routine to get some samples */
+                if (cnt == 0) {
+                    ffree_sample_block(out, "trigger-pre-adder"); // because adder will reallocate
+                    (*susp->susp.fetch)(susp, snd_list);
+                }
+                return;
+            } else {
+                susp->previous = s;
+                /* output zero until ready to add in closure */
+                *out_ptr_reg++ = 0; 
+            }
+        } while (--n); /* inner loop */
+
+        /* using input_ptr_reg is a bad idea on RS/6000: */
+        susp->s1_ptr += togo;
+        out_ptr += togo;
+        susp_took(s1_cnt, togo);
+        cnt += togo;
+    } /* outer loop */
+
+    if (togo == 0 && cnt == 0) {
+        snd_list_terminate(snd_list);
+    } else {
+        snd_list->block_len = cnt;
+        susp->susp.current += cnt;
+    }
+} /* trigger_fetch */
+
+
+void trigger_free(trigger_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(trigger_susp_node), "trigger_free");
+}
+
+
+void trigger_print_tree(trigger_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("closure:");
+    stdprint(susp->closure);
+
+    indent(n);
+    stdputstr("s2:");
+    sound_print_tree_1(susp->s2, n);
+}
+
+
+
+
+sound_type snd_make_trigger(s1, closure)
+  sound_type s1;
+  LVAL closure;
+{
+    register trigger_susp_type susp;
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    sound_type result;
+
+    xlprot1(closure);
+    falloc_generic(susp, trigger_susp_node, "snd_make_trigger");
+
+    if (s1->scale != 1.0) {
+        /* stdputstr("normalizing first sound in a seq\n"); */
+        s1 = snd_make_normalize(s1);
+    }
+
+    susp->susp.fetch = trigger_fetch;
+
+    susp->terminate_cnt = UNKNOWN;
+    susp->terminate_bits = 0;   /* bits for s1 and s2 termination */
+    susp->logical_stop_bits = 0;    /* bits for s1 and s2 logical stop */
+
+    /* initialize susp state */
+    susp->susp.free = trigger_free;
+    susp->susp.sr = s1->sr;
+    susp->susp.t0 = s1->t0;
+    susp->susp.mark = trigger_mark;
+    susp->susp.print_tree = trigger_print_tree;
+    susp->susp.name = "trigger";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = s1->logical_stop_cnt;
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = NULL;
+    susp->s2_cnt = 0;
+    susp->closure = closure;
+    susp->previous = 0;
+    result = sound_create((snd_susp_type)susp, susp->susp.t0, susp->susp.sr, scale_factor);
+    xlpopn(1);
+    return result;
+}
+
+
+sound_type snd_trigger(s1, closure)
+  sound_type s1;
+  LVAL closure;
+{
+    sound_type s1_copy;
+    s1_copy = sound_copy(s1);
+    return snd_make_trigger(s1_copy, closure);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/trigger.h b/lib-src/libnyquist/nyquist/nyqsrc/trigger.h
new file mode 100644
index 0000000..d300e92
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/trigger.h
@@ -0,0 +1,3 @@
+sound_type snd_make_trigger();
+sound_type snd_trigger();
+    /* LISP: (SND-TRIGGER SOUND ANY) */
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/yin.c b/lib-src/libnyquist/nyquist/nyqsrc/yin.c
new file mode 100644
index 0000000..b034c4d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/yin.c
@@ -0,0 +1,579 @@
+#include "stdio.h"
+#ifdef UNIX
+#include "sys/file.h"
+#endif
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "sndfmt.h"
+#include "xlisp.h"
+#include "sound.h"
+#include "falloc.h"
+#include "yin.h"
+
+
+void yin_free();
+
+/* for multiple channel results, one susp is shared by all sounds */
+/* the susp in turn must point back to all sound list tails */
+
+typedef struct yin_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    long blocksize;
+    long stepsize;
+    sample_type *block;
+    float *temp;
+    sample_type *fillptr;
+    sample_type *endptr;
+    snd_list_type chan[2];      /* array of back pointers */
+    long cnt;   /* how many sample frames to read */
+    long m;
+    long middle;
+} yin_susp_node, *yin_susp_type;
+
+/* DEBUG CODE: 
+ *   use this to print the sound created by yin
+
+sound_type ysnd[2];
+
+void print_ysnds(char *label, yin_susp_type susp)
+{
+    int i;
+    printf("At %s:\n", label);
+    for (i = 0; i < 2; i++) {
+        snd_list_type snd_list;
+        if (!susp->chan[i]) continue;
+        snd_list = ysnd[i]->list;
+        printf("  ysnd[%d]:\n", i, label);
+        while (true) {
+            printf("    snd_list %p  block %p\n", snd_list, snd_list->block);
+            if (snd_list == zero_snd_list) {
+                printf("      (zero_snd_list)\n");
+                break;
+            } else if (!snd_list->block) {
+                printf("    susp %p (%s)\n", snd_list->u.susp,
+                       snd_list->u.susp->name);
+                break;
+            }
+            snd_list = snd_list->u.next;
+        }
+    }
+    printf("  susp->chan[0] = %p, susp->chan[1] = %p\n", 
+           susp->chan[0], susp->chan[1]);
+
+}
+ * END OF DEBUG CODE
+ */
+
+// Uses cubic interpolation to return the value of x such
+// that the function defined by f(0), f(1), f(2), and f(3)
+// is maximized.
+//
+float CubicMaximize(float y0, float y1, float y2, float y3)
+{
+  // Find coefficients of cubic
+
+  float a, b, c, d;
+  float da, db, dc;
+  float discriminant;
+  float x1, x2;
+  float dda, ddb;
+  
+  a = (float) (y0/-6.0 + y1/2.0 - y2/2.0 + y3/6.0);
+  b = (float) (y0 - 5.0*y1/2.0 + 2.0*y2 - y3/2.0);
+  c = (float) (-11.0*y0/6.0 + 3.0*y1 - 3.0*y2/2.0 + y3/3.0);
+  d = y0;
+
+  // Take derivative
+
+  da = 3*a;
+  db = 2*b;
+  dc = c;
+
+  // Find zeroes of derivative using quadratic equation
+  
+  discriminant = db*db - 4*da*dc;
+  if (discriminant < 0.0)
+    return -1.0; // error
+  
+  x1 = (float) ((-db + sqrt(discriminant)) / (2 * da));
+  x2 = (float) ((-db - sqrt(discriminant)) / (2 * da));
+  
+  // The one which corresponds to a local _maximum_ in the
+  // cubic is the one we want - the one with a negative
+  // second derivative
+  
+  dda = 2*da;
+  ddb = db;
+  
+  if (dda*x1 + ddb < 0)
+    return x1;
+  else
+    return x2;
+}
+
+
+float parabolic_interp(float x1, float x2, float x3, float y1, float y2, 
+                       float y3, float *min)
+{
+    float a, b, c;
+    float pos;
+
+    //  y1=a*x1^2+b*x1+c
+    //  y2=a*x2^2+b*x2+c
+    //  y3=a*x3^2+b*x3+c
+
+    //  y1-y2=a*(x1^2-x2^2)+b*(x1-x2)
+    //  y2-y3=a*(x2^2-x3^2)+b*(x2-x3)
+
+    //  (y1-y2)/(x1-x2)=a*(x1+x2)+b
+    //  (y2-y3)/(x2-x3)=a*(x2+x3)+b
+
+    a = ((y1 - y2) / (x1 - x2) - (y2 - y3) / (x2 - x3)) / (x1 - x3);
+    b = (y1 - y2) / (x1 - x2) - a * (x1 + x2);
+    c = y1 - a * x1 * x1 - b * x1;
+
+    // dy/dx = 2a*x + b = 0
+  
+    pos = (float) (-b / (a + a));
+    *min = /* ax^2 + bx + c */ (a * pos + b) * pos + c;
+    return pos;
+}
+
+
+void yin_compute(yin_susp_type susp, float *pitch, float *harmonicity)
+    // samples is a buffer of samples
+    // n is the number of samples, equals twice longest period, must be even
+    // m is the shortest period in samples
+    // results is an array of size n/2 - m + 1, the number of different lags
+{
+
+    float *samples = susp->block;
+    int middle = susp->middle;
+    int m = susp->m;
+    float threshold = 0.1F;
+    float *results = susp->temp;
+
+    // work from the middle of the buffer:
+    int i, j; // loop counters
+    // how many different lags do we compute?
+    float left_energy = 0;
+    float right_energy = 0;
+    float left, right, non_periodic;
+    float auto_corr=0;
+    float cum_sum=0.0;
+    float period;
+    int min_i;
+
+    // for each window, we keep the energy so we can compute the next one 
+    // incrementally. First, we need to compute the energies for lag m-1:
+    for (i = 0; i < m - 1; i++) {
+        left = samples[middle - 1 - i];
+        left_energy += left * left;
+        right = samples[middle + i];
+        right_energy += right * right;
+    }
+
+    for (i = m; i <= middle; i++) {
+        // i is the lag and the length of the window
+        // compute the energy for left and right
+        left = samples[middle - i];
+        left_energy += left * left;
+        right = samples[middle - 1 + i];
+ 
+        right_energy += right * right;
+        //  compute the autocorrelation
+        auto_corr = 0;
+        for (j = 0; j < i; j++) {
+            auto_corr += samples[middle - i + j] * samples[middle + j];
+        }
+         non_periodic = (left_energy + right_energy - 2 * auto_corr);// / i;
+        results[i - m] = non_periodic;
+
+    }
+
+    // normalize by the cumulative sum
+    for (i = m; i <= middle; i++) {
+        cum_sum += results[i - m];
+        results[i - m]=results[i - m] / (cum_sum / (i - m + 1));
+    }
+
+    min_i = m;  // value of initial estimate
+    for (i = m; i <= middle; i++) {
+        if (results[i - m] < threshold) {
+            min_i=i;
+            break;
+        } else if (results[i - m] < results[min_i - m])
+            min_i=i;
+    }
+
+    // This step is not part of the published algorithm. Just because we
+    // found a point below the threshold does not mean we are at a local
+    // minimum. E.g. a sine input will go way below threshold, so the 
+    // period estimate at the threshold crossing will be too low. In this
+    // step, we continue to scan forward until we reach a local minimum.
+    while (min_i < middle && results[min_i + 1 - m] < results[min_i - m]) {
+        min_i++;
+    }
+
+    // use parabolic interpolation to improve estimate
+    if (i>m && i<middle) {
+        period = parabolic_interp((float)(min_i - 1), (float)(min_i), 
+                                  (float)(min_i + 1), 
+                                  results[min_i - 1 - m], results[min_i - m], 
+                                  results[min_i + 1 - m], harmonicity);
+    } else {
+        period = (float) min_i;
+    }
+    *harmonicity = results[min_i - m];
+    *pitch = (float) hz_to_step((float) (susp->susp.sr * susp->stepsize) / period);
+}
+
+
+/* yin_fetch - compute F0 and harmonicity using YIN approach.  */
+/*
+ * The pitch (F0) is determined by finding two periods whose
+ * inner product accounts for almost all of the energy. Let X and Y
+ * be adjacent vectors of length N in the sample stream. Then, 
+ *    if 2X*Y > threshold * (X*X + Y*Y)
+ *    then the period is given by N
+ * In the algorithm, we compute different sizes until we find a
+ * peak above threshold. Then, we use cubic interpolation to get
+ * a precise value. If no peak above threshold is found, we return
+ * the first peak. The second channel returns the value 2X*Y/(X*X+Y*Y)
+ * which is refered to as the "harmonicity" -- the amount of energy
+ * accounted for by periodicity.
+ *
+ * Low sample rates are advised because of the high cost of computing
+ * inner products (fast autocorrelation is not used).
+ *
+ * The result is a 2-channel signal running at the requested rate.
+ * The first channel is the estimated pitch, and the second channel
+ * is the harmonicity.
+ *
+ * This code is adopted from multiread, currently the only other
+ * multichannel suspension in Nyquist. Comments from multiread include:
+ * The susp is shared by all channels.  The susp has backpointers
+ * to the tail-most snd_list node of each channel, and it is by
+ * extending the list at these nodes that sounds are read in.
+ * To avoid a circularity, the reference counts on snd_list nodes
+ * do not include the backpointers from this susp.  When a snd_list
+ * node refcount goes to zero, the yin susp's free routine
+ * is called.  This must scan the backpointers to find the node that
+ * has a zero refcount (the free routine is called before the node
+ * is deallocated, so this is safe).  The backpointer is then set
+ * to NULL.  When all backpointers are NULL, the susp itself is
+ * deallocated, because it can only be referenced through the
+ * snd_list nodes to which there are backpointers.
+ */
+void yin_fetch(yin_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    int i; 
+    sample_block_type f0;
+    sample_block_values_type f0_ptr = NULL;
+    sample_block_type harmonicity;
+    sample_block_values_type harmonicity_ptr = NULL;
+
+    register sample_block_values_type s_ptr_reg;
+    register sample_type *fillptr_reg;
+    register sample_type *endptr_reg = susp->endptr;
+
+    /* DEBUG: print_ysnds("top of yin_fetch", susp); */
+    if (susp->chan[0]) {
+        falloc_sample_block(f0, "yin_fetch");
+        f0_ptr = f0->samples;
+        /* Since susp->chan[i] exists, we want to append a block of samples.
+         * The block, out, has been allocated.  Before we insert the block,
+         * we must figure out whether to insert a new snd_list_type node for
+         * the block.  Recall that before SND_get_next is called, the last
+         * snd_list_type in the list will have a null block pointer, and the
+         * snd_list_type's susp field points to the suspension (in this case,
+         * susp).  When SND_get_next (in sound.c) is called, it appends a new
+         * snd_list_type and points the previous one to internal_zero_block 
+         * before calling this fetch routine.  On the other hand, since 
+         * SND_get_next is only going to be called on one of the channels, the
+         * other channels will not have had a snd_list_type appended.
+         * SND_get_next does not tell us directly which channel it wants (it
+         * doesn't know), but we can test by looking for a non-null block in the
+         * snd_list_type pointed to by our back-pointers in susp->chan[].  If
+         * the block is null, the channel was untouched by SND_get_next, and
+         * we should append a snd_list_type.  If it is non-null, then it
+         * points to internal_zero_block (the block inserted by SND_get_next)
+         * and a new snd_list_type has already been appended.
+         */
+        /* Before proceeding, it may be that garbage collection ran when we
+         * allocated out, so check again to see if susp->chan[j] is Null:
+         */
+        if (!susp->chan[0]) {
+            ffree_sample_block(f0, "yin_fetch");
+            f0 = NULL; /* make sure we don't free it again */
+            f0_ptr = NULL; /* make sure we don't output f0 samples */
+        } else if (!susp->chan[0]->block) {
+            snd_list_type snd_list = snd_list_create((snd_susp_type) susp);
+            /* printf("created snd_list %x for chan 0 with susp %x\n", 
+                   snd_list, snd_list->u.susp); */
+            /* Now we have a snd_list to append to the channel, but a very
+             * interesting thing can happen here.  snd_list_create, which
+             * we just called, MAY have invoked the garbage collector, and
+             * the GC MAY have freed all references to this channel, in which
+             * case yin_free(susp) will have been called, and susp->chan[0]
+             * will now be NULL!
+             */
+            if (!susp->chan[0]) {
+                ffree_snd_list(snd_list, "yin_fetch");
+            } else {
+                susp->chan[0]->u.next = snd_list;
+            }
+        }
+        /* see the note above: we don't know if susp->chan still exists */
+        /* Note: We DO know that susp still exists because even if we lost
+         * some channels in a GC, someone is still calling SND_get_next on
+         * some channel.  I suppose that there might be some very pathological
+         * code that could free a global reference to a sound that is in the
+         * midst of being computed, perhaps by doing something bizarre in the
+         * closure that snd_seq activates at the logical stop time of its first
+         * sound, but I haven't thought that one through.
+         */
+        if (susp->chan[0]) {
+            susp->chan[0]->block = f0;
+            /* check some assertions */
+            if (susp->chan[0]->u.next->u.susp != (snd_susp_type) susp) {
+                nyquist_printf("didn't find susp at end of list for chan 0\n");
+            }
+        } else if (f0) { /* we allocated f0, but don't need it anymore due to GC */
+            ffree_sample_block(f0, "yin_fetch");
+            f0_ptr = NULL;
+        }
+    }
+
+    /* Now, repeat for channel 1 (comments omitted) */
+    if (susp->chan[1]) {
+        falloc_sample_block(harmonicity, "yin_fetch");
+        harmonicity_ptr = harmonicity->samples;
+        if (!susp->chan[1]) {
+            ffree_sample_block(harmonicity, "yin_fetch");
+            harmonicity = NULL; /* make sure we don't free it again */
+            harmonicity_ptr = NULL;
+        } else if (!susp->chan[1]->block) {
+            snd_list_type snd_list = snd_list_create((snd_susp_type) susp);
+            /* printf("created snd_list %x for chan 1 with susp %x\n", 
+                   snd_list, snd_list->u.susp); */
+            if (!susp->chan[1]) {
+                ffree_snd_list(snd_list, "yin_fetch");
+            } else {
+                susp->chan[1]->u.next = snd_list;
+            }
+        }
+        if (susp->chan[1]) {
+            susp->chan[1]->block = harmonicity;
+            if (susp->chan[1]->u.next->u.susp != (snd_susp_type) susp) {
+                nyquist_printf("didn't find susp at end of list for chan 1\n");
+            }
+        } else if (harmonicity) { /* we allocated harmonicity, but don't need it anymore due to GC */
+            ffree_sample_block(harmonicity, "yin_fetch");
+            harmonicity_ptr = NULL;
+        }
+    }
+
+    /* DEBUG: print_ysnds("yin_fetch before outer loop", susp); */
+    while (cnt < max_sample_block_len) { /* outer loop */
+        /* first, compute how many samples to generate in inner loop: */
+        /* don't overflow the output sample block */
+        togo = (max_sample_block_len - cnt) * susp->stepsize;
+
+        /* don't run past the s input sample block */
+        susp_check_term_log_samples(s, s_ptr, s_cnt);
+        togo = min(togo, susp->s_cnt);
+
+        /* don't run past terminate time */
+        if (susp->terminate_cnt != UNKNOWN &&
+            susp->terminate_cnt <= susp->susp.current + cnt + togo/susp->stepsize) {
+            togo = (susp->terminate_cnt - (susp->susp.current + cnt)) * susp->stepsize;
+            if (togo == 0) break;
+        }
+
+        /* don't run past logical stop time */
+        if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+            int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+            /* break if to_stop = 0 (we're at the logical stop)
+             * AND cnt > 0 (we're not at the beginning of the output block)
+             */
+            if (to_stop < togo/susp->stepsize) {
+                if (to_stop == 0) {
+                    if (cnt) {
+                        togo = 0;
+                        break;
+                    } else /* keep togo as is: since cnt == 0, we can set
+                            * the logical stop flag on this output block
+                            */
+                        susp->logically_stopped = true;
+                } else /* limit togo so we can start a new block a the LST */
+                    togo = to_stop * susp->stepsize;
+            }
+        }
+        n = togo;
+        s_ptr_reg = susp->s_ptr;
+        fillptr_reg = susp->fillptr;
+        if (n) do { /* the inner sample computation loop */
+            *fillptr_reg++ = *s_ptr_reg++;
+            if (fillptr_reg >= endptr_reg) {
+                float f0;
+                float harmonicity;
+                yin_compute(susp, &f0, &harmonicity);
+                if (f0_ptr) *f0_ptr++ = f0;
+                if (harmonicity_ptr) *harmonicity_ptr++ = harmonicity;
+                cnt++;
+                // shift block by stepsize
+                memmove(susp->block, susp->block + susp->stepsize,
+                        sizeof(sample_type) * (susp->blocksize - susp->stepsize));
+                fillptr_reg -= susp->stepsize;
+            }
+        } while (--n); /* inner loop */
+
+        /* using s_ptr_reg is a bad idea on RS/6000: */
+        susp->s_ptr += togo;
+        susp->fillptr = fillptr_reg;
+        susp_took(s_cnt, togo);
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+        /* single channels code: snd_list_terminate(snd_list); */
+        for (i = 0; i < 2; i++) {
+            if (susp->chan[i]) {
+                snd_list_type the_snd_list = susp->chan[i];
+                susp->chan[i] = the_snd_list->u.next;
+                snd_list_terminate(the_snd_list);
+            }
+        }
+    } else {
+        /* single channel code:
+             snd_list->block_len = cnt;
+         */
+        susp->susp.current += cnt;
+        for (i = 0; i < 2; i++) {
+            if (susp->chan[i]) {
+                susp->chan[i]->block_len = cnt;
+                susp->chan[i] = susp->chan[i]->u.next;
+            }
+        }
+    }
+
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+        /* single channel code: snd_list->logically_stopped = true; */
+        if (susp->chan[0]) susp->chan[0]->logically_stopped = true;
+        if (susp->chan[1]) susp->chan[1]->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+        susp->logically_stopped = true;
+    }
+} /* yin_fetch */
+
+  
+void yin_mark(yin_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void yin_free(yin_susp_type susp)
+{
+    int j;
+    boolean active = false;
+/*    stdputstr("yin_free: "); */
+
+    for (j = 0; j < 2; j++) {
+        if (susp->chan[j]) {
+            if (susp->chan[j]->refcnt) active = true;
+            else {
+                susp->chan[j] = NULL;
+                /* nyquist_printf("deactivating channel %d\n", j); */
+            }
+        }
+    }
+    if (!active) {
+/*      stdputstr("all channels freed, freeing susp now\n"); */
+        ffree_generic(susp, sizeof(yin_susp_node), "yin_free");
+        sound_unref(susp->s);
+        free(susp->block);
+        free(susp->temp);
+    }
+}
+
+
+void yin_print_tree(yin_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+LVAL snd_make_yin(sound_type s, double low_step, double high_step, long stepsize)
+{
+    LVAL result;
+    int j;
+    register yin_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+
+    falloc_generic(susp, yin_susp_node, "snd_make_yin");
+    susp->susp.fetch = yin_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    
+    /* initialize susp state */
+    susp->susp.free = yin_free;
+    susp->susp.sr = sr / stepsize;
+    susp->susp.t0 = t0;
+    susp->susp.mark = yin_mark;
+    susp->susp.print_tree = yin_print_tree;
+    susp->susp.name = "yin";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->m = (long) (sr / step_to_hz(high_step));
+    if (susp->m < 2) susp->m = 2;
+    /* add 1 to make sure we round up */
+    susp->middle = (long) (sr / step_to_hz(low_step)) + 1;
+    susp->blocksize = susp->middle * 2;
+    susp->stepsize = stepsize;
+    /* blocksize must be at least step size to implement stepping */
+    if (susp->stepsize > susp->blocksize) susp->blocksize = susp->stepsize;
+    susp->block = (sample_type *) malloc(susp->blocksize * sizeof(sample_type));
+    susp->temp = (float *) malloc((susp->middle - susp->m + 1) * sizeof(float));
+    susp->fillptr = susp->block;
+    susp->endptr = susp->block + susp->blocksize;
+
+    xlsave1(result);
+
+    result = newvector(2);      /* create array for F0 and harmonicity */
+    /* create sounds to return */
+    for (j = 0; j < 2; j++) {
+        sound_type snd = sound_create((snd_susp_type)susp, 
+                                      susp->susp.t0, susp->susp.sr, 1.0);
+        LVAL snd_lval = cvsound(snd);
+/*      nyquist_printf("yin_create: sound %d is %x, LVAL %x\n", j, snd, snd_lval); */
+        setelement(result, j, snd_lval);
+        susp->chan[j] = snd->list;
+        /* DEBUG: ysnd[j] = snd; */
+    }
+    xlpop();
+    return result;
+}
+
+
+LVAL snd_yin(sound_type s, double low_step, double high_step, long stepsize)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_yin(s_copy, low_step, high_step, stepsize);
+}
diff --git a/lib-src/libnyquist/nyquist/nyqsrc/yin.h b/lib-src/libnyquist/nyquist/nyqsrc/yin.h
new file mode 100644
index 0000000..656aa81
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqsrc/yin.h
@@ -0,0 +1,6 @@
+/* yin.h -- Nyquist code for F0 estimation using YIN approach */
+
+
+LVAL snd_yin(sound_type s, double low_step, double high_step, long stepsize);
+/* LISP: (SND-YIN SOUND ANYNUM ANYNUM FIXNUM) */
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/globals.h b/lib-src/libnyquist/nyquist/nyqstk/globals.h
new file mode 100644
index 0000000..9c64170
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/globals.h
@@ -0,0 +1,8 @@
+#ifndef _GLOBALS_H
+#define _GLOBALS_H
+
+typedef double MY_FLOAT;
+
+#endif
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/ADSR.h b/lib-src/libnyquist/nyquist/nyqstk/include/ADSR.h
new file mode 100644
index 0000000..521514d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/ADSR.h
@@ -0,0 +1,90 @@
+/***************************************************/
+/*! \class ADSR
+    \brief STK ADSR envelope class.
+
+    This Envelope subclass implements a
+    traditional ADSR (Attack, Decay,
+    Sustain, Release) envelope.  It
+    responds to simple keyOn and keyOff
+    messages, keeping track of its state.
+    The \e state = ADSR::DONE after the
+    envelope value reaches 0.0 in the
+    ADSR::RELEASE state.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_ADSR_H
+#define STK_ADSR_H
+
+#include "Envelope.h"
+
+namespace Nyq
+{
+
+class ADSR : public Envelope
+{
+ public:
+
+  //! Envelope states.
+  enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE };
+
+  //! Default constructor.
+  ADSR(void);
+
+  //! Class destructor.
+  ~ADSR(void);
+
+  //! Set target = 1, state = \e ADSR::ATTACK.
+  void keyOn(void);
+
+  //! Set target = 0, state = \e ADSR::RELEASE.
+  void keyOff(void);
+
+  //! Set the attack rate.
+  void setAttackRate(StkFloat rate);
+
+  //! Set the decay rate.
+  void setDecayRate(StkFloat rate);
+
+  //! Set the sustain level.
+  void setSustainLevel(StkFloat level);
+
+  //! Set the release rate.
+  void setReleaseRate(StkFloat rate);
+
+  //! Set the attack rate based on a time duration.
+  void setAttackTime(StkFloat time);
+
+  //! Set the decay rate based on a time duration.
+  void setDecayTime(StkFloat time);
+
+  //! Set the release rate based on a time duration.
+  void setReleaseTime(StkFloat time);
+
+  //! Set sustain level and attack, decay, and release time durations.
+  void setAllTimes(StkFloat aTime, StkFloat dTime, StkFloat sLevel, StkFloat rTime);
+
+  //! Set the target value.
+  void setTarget(StkFloat target);
+
+  //! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE).
+  int getState(void) const;
+
+  //! Set to state = ADSR::SUSTAIN with current and target values of \e aValue.
+  void setValue(StkFloat value);
+
+ protected:  
+
+  StkFloat computeSample( void );
+
+  StkFloat attackRate_;
+  StkFloat decayRate_;
+  StkFloat sustainLevel_;
+  StkFloat releaseRate_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/BandedWG.h b/lib-src/libnyquist/nyquist/nyqstk/include/BandedWG.h
new file mode 100644
index 0000000..9323a3e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/BandedWG.h
@@ -0,0 +1,121 @@
+/***************************************************/
+/*! \class BandedWG
+    \brief Banded waveguide modeling class.
+
+    This class uses banded waveguide techniques to
+    model a variety of sounds, including bowed
+    bars, glasses, and bowls.  For more
+    information, see Essl, G. and Cook, P. "Banded
+    Waveguides: Towards Physical Modelling of Bar
+    Percussion Instruments", Proceedings of the
+    1999 International Computer Music Conference.
+
+    Control Change Numbers: 
+       - Bow Pressure = 2
+       - Bow Motion = 4
+       - Strike Position = 8 (not implemented)
+       - Vibrato Frequency = 11
+       - Gain = 1
+       - Bow Velocity = 128
+       - Set Striking = 64
+       - Instrument Presets = 16
+         - Uniform Bar = 0
+         - Tuned Bar = 1
+         - Glass Harmonica = 2
+         - Tibetan Bowl = 3
+
+    by Georg Essl, 1999 - 2004.
+    Modified for Stk 4.0 by Gary Scavone.
+*/
+/***************************************************/
+
+#ifndef STK_BANDEDWG_H
+#define STK_BANDEDWG_H
+
+namespace Nyq
+{
+
+const int MAX_BANDED_MODES = 20;
+
+} // namespace Nyq
+
+#include "Instrmnt.h"
+#include "DelayL.h"
+#include "BowTable.h"
+#include "ADSR.h"
+#include "BiQuad.h"
+
+namespace Nyq
+{
+
+class BandedWG : public Instrmnt
+{
+ public:
+  //! Class constructor.
+  BandedWG();
+
+  //! Class destructor.
+  ~BandedWG();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set strike position (0.0 - 1.0).
+  void setStrikePosition(StkFloat position);
+
+  //! Select a preset.
+  void setPreset(int preset);
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Apply bow velocity/pressure to instrument with given amplitude and rate of increase.
+  void startBowing(StkFloat amplitude, StkFloat rate);
+
+  //! Decrease bow velocity/breath pressure with given rate of decrease.
+  void stopBowing(StkFloat rate);
+
+  //! Pluck the instrument with given amplitude.
+  void pluck(StkFloat amp);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  bool doPluck_;
+  bool trackVelocity_;
+  int nModes_;
+  int presetModes_;
+  BowTable bowTable_;
+  ADSR     adsr_;
+  BiQuad   bandpass_[MAX_BANDED_MODES];
+  DelayL   delay_[MAX_BANDED_MODES];
+  StkFloat maxVelocity_;
+  StkFloat modes_[MAX_BANDED_MODES];
+  StkFloat frequency_;
+  StkFloat baseGain_;
+  StkFloat gains_[MAX_BANDED_MODES];
+  StkFloat basegains_[MAX_BANDED_MODES];
+  StkFloat excitation_[MAX_BANDED_MODES];
+  StkFloat integrationConstant_;
+  StkFloat velocityInput_;
+  StkFloat bowVelocity_;
+  StkFloat bowTarget_;
+  StkFloat bowPosition_;
+  StkFloat strikeAmp_;
+  int strikePosition_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/BiQuad.h b/lib-src/libnyquist/nyquist/nyqstk/include/BiQuad.h
new file mode 100644
index 0000000..d4e6cc8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/BiQuad.h
@@ -0,0 +1,117 @@
+/***************************************************/
+/*! \class BiQuad
+    \brief STK biquad (two-pole, two-zero) filter class.
+
+    This protected Filter subclass implements a
+    two-pole, two-zero digital filter.  A method
+    is provided for creating a resonance in the
+    frequency response while maintaining a constant
+    filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_BIQUAD_H
+#define STK_BIQUAD_H
+
+#include "Filter.h"
+
+namespace Nyq
+{
+
+class BiQuad : protected Filter
+{
+public:
+
+  //! Default constructor creates a second-order pass-through filter.
+  BiQuad();
+
+  //! Class destructor.
+  virtual ~BiQuad();
+
+  //! Clears all internal states of the filter.
+  void clear(void);
+
+  //! Set the b[0] coefficient value.
+  void setB0(StkFloat b0);
+
+  //! Set the b[1] coefficient value.
+  void setB1(StkFloat b1);
+
+  //! Set the b[2] coefficient value.
+  void setB2(StkFloat b2);
+
+  //! Set the a[1] coefficient value.
+  void setA1(StkFloat a1);
+
+  //! Set the a[2] coefficient value.
+  void setA2(StkFloat a2);
+
+  //! Sets the filter coefficients for a resonance at \e frequency (in Hz).
+  /*!
+    This method determines the filter coefficients corresponding to
+    two complex-conjugate poles with the given \e frequency (in Hz)
+    and \e radius from the z-plane origin.  If \e normalize is true,
+    the filter zeros are placed at z = 1, z = -1, and the coefficients
+    are then normalized to produce a constant unity peak gain
+    (independent of the filter \e gain parameter).  The resulting
+    filter frequency response has a resonance at the given \e
+    frequency.  The closer the poles are to the unit-circle (\e radius
+    close to one), the narrower the resulting resonance width.
+  */
+  void setResonance(StkFloat frequency, StkFloat radius, bool normalize = false);
+
+  //! Set the filter coefficients for a notch at \e frequency (in Hz).
+  /*!
+    This method determines the filter coefficients corresponding to
+    two complex-conjugate zeros with the given \e frequency (in Hz)
+    and \e radius from the z-plane origin.  No filter normalization
+    is attempted.
+  */
+  void setNotch(StkFloat frequency, StkFloat radius);
+
+  //! Sets the filter zeroes for equal resonance gain.
+  /*!
+    When using the filter as a resonator, zeroes places at z = 1, z
+    = -1 will result in a constant gain at resonance of 1 / (1 - R),
+    where R is the pole radius setting.
+
+  */
+  void setEqualGainZeroes();
+
+  //! Set the filter gain.
+  /*!
+    The gain is applied at the filter input and does not affect the
+    coefficient values.  The default gain value is 1.0.
+   */
+  void setGain(StkFloat gain);
+
+  //! Return the current filter gain.
+  StkFloat getGain(void) const;
+
+  //! Return the last computed output value.
+  StkFloat lastOut(void) const;
+
+  //! Input one sample to the filter and return one output.
+  virtual StkFloat tick(StkFloat sample);
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+ protected:
+
+  // This function must be implemented in all subclasses. It is used
+  // to get around a C++ problem with overloaded virtual functions.
+  virtual StkFloat computeSample( StkFloat input );
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/BowTable.h b/lib-src/libnyquist/nyquist/nyqstk/include/BowTable.h
new file mode 100644
index 0000000..6604176
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/BowTable.h
@@ -0,0 +1,56 @@
+/***************************************************/
+/*! \class BowTable
+    \brief STK bowed string table class.
+
+    This class implements a simple bowed string
+    non-linear function, as described by Smith (1986).
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_BOWTABL_H
+#define STK_BOWTABL_H
+
+#include "Function.h"
+
+namespace Nyq
+{
+
+class BowTable : public Function
+{
+public:
+  //! Default constructor.
+  BowTable();
+
+  //! Class destructor.
+  ~BowTable();
+
+  //! Set the table offset value.
+  /*!
+    The table offset is a bias which controls the
+    symmetry of the friction.  If you want the
+    friction to vary with direction, use a non-zero
+    value for the offset.  The default value is zero.
+  */
+  void setOffset(StkFloat offset);
+
+  //! Set the table slope value.
+  /*!
+   The table slope controls the width of the friction
+   pulse, which is related to bow force.
+  */
+  void setSlope(StkFloat slope);
+
+protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  StkFloat offset_;
+  StkFloat slope_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Bowed.h b/lib-src/libnyquist/nyquist/nyqstk/include/Bowed.h
new file mode 100644
index 0000000..a4551f7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Bowed.h
@@ -0,0 +1,91 @@
+/***************************************************/
+/*! \class Bowed
+    \brief STK bowed string instrument class.
+
+    This class implements a bowed string model, a
+    la Smith (1986), after McIntyre, Schumacher,
+    Woodhouse (1983).
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Bow Pressure = 2
+       - Bow Position = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Volume = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_BOWED_H
+#define STK_BOWED_H
+
+#include "Instrmnt.h"
+#include "DelayL.h"
+#include "BowTable.h"
+#include "OnePole.h"
+#include "BiQuad.h"
+#include "SineWave.h"
+#include "ADSR.h"
+
+namespace Nyq
+{
+
+class Bowed : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  Bowed(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  ~Bowed();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Set vibrato gain.
+  void setVibrato(StkFloat gain);
+
+  //! Apply breath pressure to instrument with given amplitude and rate of increase.
+  void startBowing(StkFloat amplitude, StkFloat rate);
+
+  //! Decrease breath pressure with given rate of decrease.
+  void stopBowing(StkFloat rate);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  DelayL   neckDelay_;
+  DelayL   bridgeDelay_;
+  BowTable bowTable_;
+  OnePole  stringFilter_;
+  BiQuad   bodyFilter_;
+  SineWave vibrato_;
+  ADSR     adsr_;
+  StkFloat maxVelocity_;
+  StkFloat baseDelay_;
+  StkFloat vibratoGain_;
+  StkFloat betaRatio_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Chorus.h b/lib-src/libnyquist/nyquist/nyqstk/include/Chorus.h
new file mode 100644
index 0000000..5da10e1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Chorus.h
@@ -0,0 +1,56 @@
+/***************************************************/
+/*! \class Chorus
+    \brief STK chorus effect class.
+
+    This class implements a chorus effect.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_CHORUS_H
+#define STK_CHORUS_H
+
+#include "Effect.h" 
+#include "DelayL.h" 
+#include "SineWave.h" 
+
+namespace Nyq
+{
+
+class Chorus : public Effect
+{
+ public:
+  //! Class constructor, taking the median desired delay length.
+  /*!
+    An StkError can be thrown if the rawwave path is incorrect.
+  */
+  Chorus( StkFloat baseDelay = 6000 );
+
+  //! Class destructor.
+  ~Chorus();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set modulation depth.
+  void setModDepth(StkFloat depth);
+
+  //! Set modulation frequency.
+  void setModFrequency(StkFloat frequency);
+
+ protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  DelayL delayLine_[2];
+  SineWave mods_[2];
+  StkFloat baseLength_;
+  StkFloat modDepth_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Clarinet.h b/lib-src/libnyquist/nyquist/nyqstk/include/Clarinet.h
new file mode 100644
index 0000000..fb7d43d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Clarinet.h
@@ -0,0 +1,91 @@
+/***************************************************/
+/*! \class Clarinet
+    \brief STK clarinet physical model class.
+
+    This class implements a simple clarinet
+    physical model, as discussed by Smith (1986),
+    McIntyre, Schumacher, Woodhouse (1983), and
+    others.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Reed Stiffness = 2
+       - Noise Gain = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_CLARINET_H
+#define STK_CLARINET_H
+
+#include "Instrmnt.h"
+#include "DelayL.h"
+#include "ReedTable.h"
+#include "OneZero.h"
+#include "Envelope.h"
+#include "Noise.h"
+#include "SineWave.h"
+
+namespace Nyq
+{
+
+class Clarinet : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  /*!
+    An StkError will be thrown if the rawwave path is incorrectly set.
+  */
+  Clarinet(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  ~Clarinet();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Apply breath pressure to instrument with given amplitude and rate of increase.
+  void startBlowing(StkFloat amplitude, StkFloat rate);
+
+  //! Decrease breath pressure with given rate of decrease.
+  void stopBlowing(StkFloat rate);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  DelayL delayLine_;
+  ReedTable reedTable_;
+  OneZero filter_;
+  Envelope envelope_;
+  Noise noise_;
+  SineWave vibrato_;
+  long length_;
+  StkFloat outputGain_;
+  StkFloat noiseGain_;
+  StkFloat vibratoGain_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Delay.h b/lib-src/libnyquist/nyquist/nyqstk/include/Delay.h
new file mode 100644
index 0000000..413944c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Delay.h
@@ -0,0 +1,115 @@
+/***************************************************/
+/*! \class Delay
+    \brief STK non-interpolating delay line class.
+
+    This protected Filter subclass implements
+    a non-interpolating digital delay-line.
+    A fixed maximum length of 4095 and a delay
+    of zero is set using the default constructor.
+    Alternatively, the delay and maximum length
+    can be set during instantiation with an
+    overloaded constructor.
+    
+    A non-interpolating delay line is typically
+    used in fixed delay-length applications, such
+    as for reverberation.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_DELAY_H
+#define STK_DELAY_H
+
+#include "Filter.h"
+
+namespace Nyq
+{
+
+class Delay : protected Filter
+{
+public:
+
+  //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
+  Delay();
+
+  //! Overloaded constructor which specifies the current and maximum delay-line lengths.
+  /*!
+    An StkError will be thrown if the delay parameter is less than
+    zero, the maximum delay parameter is less than one, or the delay
+    parameter is greater than the maxDelay value.
+   */
+  Delay(unsigned long delay, unsigned long maxDelay);
+
+  //! Class destructor.
+  virtual ~Delay();
+
+  //! Clears the internal state of the delay line.
+  void clear();
+
+  //! Set the maximum delay-line length.
+  /*!
+    This method should generally only be used during initial setup
+    of the delay line.  If it is used between calls to the tick()
+    function, without a call to clear(), a signal discontinuity will
+    likely occur.  If the current maximum length is greater than the
+    new length, no change will be made.
+  */
+  void setMaximumDelay(unsigned long delay);
+
+  //! Set the delay-line length.
+  /*!
+    The valid range for \e theDelay is from 0 to the maximum delay-line length.
+  */
+  void setDelay(unsigned long delay);
+
+  //! Return the current delay-line length.
+  unsigned long getDelay(void) const;
+
+  //! Calculate and return the signal energy in the delay-line.
+  StkFloat energy(void) const;
+
+  //! Return the value at \e tapDelay samples from the delay-line input.
+  /*!
+    The tap point is determined modulo the delay-line length and is
+    relative to the last input value (i.e., a tapDelay of zero returns
+    the last input value).
+  */
+  StkFloat contentsAt(unsigned long tapDelay);
+
+  //! Return the last computed output value.
+  StkFloat lastOut(void) const;
+
+  //! Return the value which will be output by the next call to tick().
+  /*!
+    This method is valid only for delay settings greater than zero!
+   */
+  virtual StkFloat nextOut(void);
+
+  //! Input one sample to the filter and return one output.
+  virtual StkFloat tick(StkFloat sample);
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+protected:
+
+  // This function must be implemented in all subclasses. It is used
+  // to get around a C++ problem with overloaded virtual functions.
+  virtual StkFloat computeSample( StkFloat input );
+
+  unsigned long inPoint_;
+  unsigned long outPoint_;
+  StkFloat delay_;
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/DelayA.h b/lib-src/libnyquist/nyquist/nyqstk/include/DelayA.h
new file mode 100644
index 0000000..4f17527
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/DelayA.h
@@ -0,0 +1,79 @@
+/***************************************************/
+/*! \class DelayA
+    \brief STK allpass interpolating delay line class.
+
+    This Delay subclass implements a fractional-length digital
+    delay-line using a first-order allpass filter.  A fixed maximum
+    length of 4095 and a delay of 0.5 is set using the default
+    constructor.  Alternatively, the delay and maximum length can be
+    set during instantiation with an overloaded constructor.
+
+    An allpass filter has unity magnitude gain but variable phase
+    delay properties, making it useful in achieving fractional delays
+    without affecting a signal's frequency magnitude response.  In
+    order to achieve a maximally flat phase delay response, the
+    minimum delay possible in this implementation is limited to a
+    value of 0.5.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_DELAYA_H
+#define STK_DELAYA_H
+
+#include "Delay.h"
+
+namespace Nyq
+{
+
+class DelayA : public Delay
+{
+public:
+
+  //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
+  DelayA();
+
+  //! Overloaded constructor which specifies the current and maximum delay-line lengths.
+  /*!
+    An StkError will be thrown if the delay parameter is less than
+    zero, the maximum delay parameter is less than one, or the delay
+    parameter is greater than the maxDelay value.
+   */  
+  DelayA(StkFloat delay, unsigned long maxDelay);
+
+  //! Class destructor.
+  ~DelayA();
+
+  //! Clears the internal state of the delay line.
+  void clear();
+
+  //! Set the delay-line length
+  /*!
+    The valid range for \e theDelay is from 0.5 to the maximum delay-line length.
+  */
+  void setDelay(StkFloat delay);
+
+  //! Return the current delay-line length.
+  StkFloat getDelay(void) const;
+
+  //! Return the value which will be output by the next call to tick().
+  /*!
+    This method is valid only for delay settings greater than zero!
+   */
+  StkFloat nextOut(void);
+
+protected:  
+
+  StkFloat computeSample( StkFloat input );
+
+  StkFloat alpha_;
+  StkFloat coeff_;
+  StkFloat apInput_;
+  StkFloat nextOutput_;
+  bool doNextOut_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/DelayL.h b/lib-src/libnyquist/nyquist/nyqstk/include/DelayL.h
new file mode 100644
index 0000000..fa97581
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/DelayL.h
@@ -0,0 +1,78 @@
+/***************************************************/
+/*! \class DelayL
+    \brief STK linear interpolating delay line class.
+
+    This Delay subclass implements a fractional-
+    length digital delay-line using first-order
+    linear interpolation.  A fixed maximum length
+    of 4095 and a delay of zero is set using the
+    default constructor.  Alternatively, the
+    delay and maximum length can be set during
+    instantiation with an overloaded constructor.
+
+    Linear interpolation is an efficient technique
+    for achieving fractional delay lengths, though
+    it does introduce high-frequency signal
+    attenuation to varying degrees depending on the
+    fractional delay setting.  The use of higher
+    order Lagrange interpolators can typically
+    improve (minimize) this attenuation characteristic.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_DELAYL_H
+#define STK_DELAYL_H
+
+#include "Delay.h"
+
+namespace Nyq
+{
+
+class DelayL : public Delay
+{
+public:
+
+  //! Default constructor creates a delay-line with maximum length of 4095 samples and zero delay.
+  DelayL();
+
+  //! Overloaded constructor which specifies the current and maximum delay-line lengths.
+  /*!
+    An StkError will be thrown if the delay parameter is less than
+    zero, the maximum delay parameter is less than one, or the delay
+    parameter is greater than the maxDelay value.
+   */  
+  DelayL(StkFloat delay, unsigned long maxDelay);
+
+  //! Class destructor.
+  ~DelayL();
+
+  //! Set the delay-line length.
+  /*!
+    The valid range for \e theDelay is from 0 to the maximum delay-line length.
+  */
+  void setDelay(StkFloat delay);
+
+  //! Return the current delay-line length.
+  StkFloat getDelay(void) const;
+
+  //! Return the value which will be output by the next call to tick().
+  /*!
+    This method is valid only for delay settings greater than zero!
+   */
+  StkFloat nextOut(void);
+
+ protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  StkFloat alpha_;
+  StkFloat omAlpha_;
+  StkFloat nextOutput_;
+  bool doNextOut_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Effect.h b/lib-src/libnyquist/nyquist/nyqstk/include/Effect.h
new file mode 100644
index 0000000..812e50a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Effect.h
@@ -0,0 +1,74 @@
+/***************************************************/
+/*! \class Effect
+    \brief STK abstract effects parent class.
+
+    This class provides common functionality for
+    STK effects subclasses.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Stk.h"
+
+#ifndef STK_EFFECT_H
+#define STK_EFFECT_H
+
+namespace Nyq
+{
+
+class Effect : public Stk
+{
+ public:
+  //! Class constructor.
+  Effect();
+
+  //! Class destructor.
+  virtual ~Effect();
+
+  //! Reset and clear all internal state.
+  virtual void clear() = 0;
+
+  //! Set the mixture of input and "effected" levels in the output (0.0 = input only, 1.0 = reverb only). 
+  void setEffectMix(StkFloat mix);
+
+  //! Return the last output value.
+  StkFloat lastOut() const;
+
+  //! Return the last left output value.
+  StkFloat lastOutLeft() const;
+
+  //! Return the last right output value.
+  StkFloat lastOutRight() const;
+
+  //! Take one sample input and compute one sample of output.
+  StkFloat tick( StkFloat input );
+
+  //! Take a channel of the StkFrames object as inputs to the effect and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+ protected:
+
+  // This abstract function must be implemented in all subclasses.
+  // It is used to get around a C++ problem with overloaded virtual
+  // functions.
+  virtual StkFloat computeSample( StkFloat input ) = 0;
+
+  // Returns true if argument value is prime.
+  bool isPrime( int number );
+
+  StkFloat lastOutput_[2];
+  StkFloat effectMix_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Envelope.h b/lib-src/libnyquist/nyquist/nyqstk/include/Envelope.h
new file mode 100644
index 0000000..a005768
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Envelope.h
@@ -0,0 +1,73 @@
+/***************************************************/
+/*! \class Envelope
+    \brief STK envelope base class.
+
+    This class implements a simple envelope
+    generator which is capable of ramping to
+    a target value by a specified \e rate.
+    It also responds to simple \e keyOn and
+    \e keyOff messages, ramping to 1.0 on
+    keyOn and to 0.0 on keyOff.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_ENVELOPE_H
+#define STK_ENVELOPE_H
+
+#include "Generator.h"
+
+namespace Nyq
+{
+
+class Envelope : public Generator
+{
+ public:
+
+  //! Default constructor.
+  Envelope(void);
+
+  //! Copy constructor.
+  Envelope( const Envelope& e );
+
+  //! Class destructor.
+  virtual ~Envelope(void);
+
+  //! Assignment operator.
+  Envelope& operator= ( const Envelope& e );
+
+  //! Set target = 1.
+  virtual void keyOn(void);
+
+  //! Set target = 0.
+  virtual void keyOff(void);
+
+  //! Set the \e rate.
+  void setRate(StkFloat rate);
+
+  //! Set the \e rate based on a time duration.
+  void setTime(StkFloat time);
+
+  //! Set the target value.
+  virtual void setTarget(StkFloat target);
+
+  //! Set current and target values to \e aValue.
+  virtual void setValue(StkFloat value);
+
+  //! Return the current envelope \e state (0 = at target, 1 otherwise).
+  virtual int getState(void) const;
+
+ protected:
+
+  virtual StkFloat computeSample( void );
+
+  StkFloat value_;
+  StkFloat target_;
+  StkFloat rate_;
+  int state_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/FileRead.h b/lib-src/libnyquist/nyquist/nyqstk/include/FileRead.h
new file mode 100644
index 0000000..6ecc7ae
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/FileRead.h
@@ -0,0 +1,129 @@
+/***************************************************/
+/*! \class FileRead
+    \brief STK audio file input class.
+
+    This class provides input support for various
+    audio file formats.  Multi-channel (>2)
+    soundfiles are supported.  The file data is
+    returned via an external StkFrames object
+    passed to the read() function.  This class
+    does not store its own copy of the file data,
+    rather the data is read directly from disk.
+
+    FileRead currently supports uncompressed WAV,
+    AIFF/AIFC, SND (AU), MAT-file (Matlab), and
+    STK RAW file formats.  Signed integer (8-,
+    16-, and 32-bit) and floating-point (32- and
+    64-bit) data types are supported.  Compressed
+    data types are not supported.
+
+    STK RAW files have no header and are assumed
+    to contain a monophonic stream of 16-bit
+    signed integers in big-endian byte order at a
+    sample rate of 22050 Hz.  MAT-file data should
+    be saved in an array with each data channel
+    filling a matrix row.  The sample rate for
+    MAT-files is assumed to be 44100 Hz.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_FILEREAD_H
+#define STK_FILEREAD_H
+
+#include "Stk.h"
+
+namespace Nyq
+{
+
+class FileRead : public Stk
+{
+public:
+  //! Default constructor.
+  FileRead();
+
+  //! Overloaded constructor that opens a file during instantiation.
+  /*!
+    An StkError will be thrown if the file is not found or its
+    format is unknown or unsupported.
+  */
+  FileRead( std::string fileName, bool typeRaw = false );
+
+  //! Class destructor.
+  ~FileRead();
+
+  //! Open the specified file and determine its formatting.
+  /*!
+    An StkError will be thrown if the file is not found or its
+    format is unknown or unsupported.  An optional parameter is
+    provided to specify whether the input file is of type STK RAW
+    (default = false).
+  */
+  void open( std::string fileName, bool typeRaw = false );
+
+  //! If a file is open, close it.
+  void close( void );
+
+  //! Returns \e true if a file is currently open.
+  bool isOpen( void );
+
+  //! Return the file size in sample frames.
+  unsigned long fileSize( void ) const { return fileSize_; };
+
+  //! Return the number of audio channels in the file.
+  unsigned int channels( void ) const { return channels_; };
+
+  //! Return the file sample rate in Hz.
+  /*!
+    WAV, SND, and AIF formatted files specify a sample rate in
+    their headers.  By definition, STK RAW files have a sample rate of
+    22050 Hz.  MAT-files are assumed to have a rate of 44100 Hz.
+  */
+  StkFloat fileRate( void ) const { return fileRate_; };
+
+  //! Read sample frames from the file into an StkFrames object.
+  /*!
+    The number of sample frames to read will be determined from the
+    number of frames of the StkFrames argument.  If this size is
+    larger than the available data in the file (given the file size
+    and starting frame index), the extra frames will be unaffected
+    (the StkFrames object will not be resized).  Optional parameters
+    are provided to specify the starting sample frame within the file
+    (default = 0) and whether to normalize the data with respect to
+    fixed-point limits (default = true).  An StkError will be thrown
+    if a file error occurs or if the number of channels in the
+    StkFrames argument is not equal to that in the file.
+   */
+  void read( StkFrames& buffer, unsigned long startFrame = 0, bool doNormalize = true );
+
+protected:
+
+  // Get STK RAW file information.
+  bool getRawInfo( const char *fileName );
+
+  // Get WAV file header information.
+  bool getWavInfo( const char *fileName );
+
+  // Get SND (AU) file header information.
+  bool getSndInfo( const char *fileName );
+
+  // Get AIFF file header information.
+  bool getAifInfo( const char *fileName );
+
+  // Get MAT-file header information.
+  bool getMatInfo( const char *fileName );
+
+  FILE *fd_;
+  bool byteswap_;
+  bool wavFile_;
+  unsigned long fileSize_;
+  unsigned long dataOffset_;
+  unsigned int channels_;
+  StkFormat dataType_;
+  StkFloat fileRate_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/FileWvIn.h b/lib-src/libnyquist/nyquist/nyqstk/include/FileWvIn.h
new file mode 100644
index 0000000..31e0b41
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/FileWvIn.h
@@ -0,0 +1,148 @@
+/***************************************************/
+/*! \class FileWvIn
+    \brief STK audio file input class.
+
+    This class inherits from WvIn.  It provides a "tick-level"
+    interface to the FileRead class.  It also provides variable-rate
+    "playback" functionality.  Audio file support is provided by the
+    FileRead class.  Linear interpolation is used for fractional "read
+    rates".
+
+    FileWvIn supports multi-channel data.  It is important to distinguish
+    the tick() methods, which return samples produced by averaging
+    across sample frames, from the tickFrame() methods, which return
+    references to multi-channel sample frames.
+
+    FileWvIn will either load the entire content of an audio file into
+    local memory or incrementally read file data from disk in chunks.
+    This behavior is controlled by the optional constructor arguments
+    \e chunkThreshold and \e chunkSize.  File sizes greater than \e
+    chunkThreshold (in sample frames) will be read incrementally in
+    chunks of \e chunkSize each (also in sample frames).
+
+    When the file end is reached, subsequent calls to the tick()
+    functions return zero-valued data and isFinished() returns \e
+    true.
+
+    See the FileRead class for a description of the supported audio
+    file formats.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_FILEWVIN_H
+#define STK_FILEWVIN_H
+
+#include "WvIn.h"
+#include "FileRead.h"
+
+namespace Nyq
+{
+
+class FileWvIn : public WvIn
+{
+public:
+  //! Default constructor.
+  FileWvIn( unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
+
+  //! Overloaded constructor for file input.
+  /*!
+    An StkError will be thrown if the file is not found, its format is
+    unknown, or a read error occurs.
+  */
+  FileWvIn( std::string fileName, bool raw = false, bool doNormalize = true,
+            unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
+
+  //! Class destructor.
+  virtual ~FileWvIn();
+
+  //! Open the specified file and load its data.
+  /*!
+    Data from a previously opened file will be overwritten by this
+    function.  An StkError will be thrown if the file is not found,
+    its format is unknown, or a read error occurs.  If the file data
+    is to be loaded incrementally from disk and normalization is
+    specified, a scaling will be applied with respect to fixed-point
+    limits.  If the data format is floating-point, no scaling is
+    performed.
+  */
+  void openFile( std::string fileName, bool raw = false, bool doNormalize = true );
+
+  //! Close a file if one is open.
+  void closeFile( void );
+
+  //! Clear outputs and reset time (file) pointer to zero.
+  void reset( void );
+
+  //! Normalize data to a maximum of +-1.0.
+  /*!
+    This function has no effect when data is incrementally loaded
+    from disk.
+  */
+  void normalize( void );
+
+  //! Normalize data to a maximum of \e +-peak.
+  /*!
+    This function has no effect when data is incrementally loaded
+    from disk.
+  */
+  void normalize( StkFloat peak );
+
+  //! Return the file size in sample frames.
+  unsigned long getSize( void ) const { return data_.frames(); };
+
+  //! Return the input file sample rate in Hz (not the data read rate).
+  /*!
+    WAV, SND, and AIF formatted files specify a sample rate in
+    their headers.  STK RAW files have a sample rate of 22050 Hz
+    by definition.  MAT-files are assumed to have a rate of 44100 Hz.
+  */
+  StkFloat getFileRate( void ) const { return data_.dataRate(); };
+
+  //! Query whether reading is complete.
+  bool isFinished( void ) const { return finished_; };
+
+  //! Set the data read rate in samples.  The rate can be negative.
+  /*!
+    If the rate value is negative, the data is read in reverse order.
+  */
+  void setRate( StkFloat rate );
+
+  //! Increment the read pointer by \e time samples.
+  /*!
+    Note that this function will not modify the interpolation flag status.
+   */
+  virtual void addTime( StkFloat time );
+
+  //! Turn linear interpolation on/off.
+  /*!
+    Interpolation is automatically off when the read rate is
+    an integer value.  If interpolation is turned off for a
+    fractional rate, the time index is truncated to an integer
+    value.
+  */
+  void setInterpolate( bool doInterpolate ) { interpolate_ = doInterpolate; };
+
+  StkFloat lastOut( void ) const;
+
+protected:
+
+  virtual void computeFrame( void );
+
+  FileRead file_;
+  bool finished_;
+  bool interpolate_;
+  bool normalizing_;
+  bool chunking_;
+  StkFloat time_;
+  StkFloat rate_;
+  unsigned long chunkThreshold_;
+  unsigned long chunkSize_;
+  long chunkPointer_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Filter.h b/lib-src/libnyquist/nyquist/nyqstk/include/Filter.h
new file mode 100644
index 0000000..b7c8abd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Filter.h
@@ -0,0 +1,127 @@
+/***************************************************/
+/*! \class Filter
+    \brief STK filter class.
+
+    This class implements a generic structure that
+    can be used to create a wide range of filters.
+    It can function independently or be subclassed
+    to provide more specific controls based on a
+    particular filter type.
+
+    In particular, this class implements the standard
+    difference equation:
+
+    a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] -
+                a[1]*y[n-1] - ... - a[na]*y[n-na]
+
+    If a[0] is not equal to 1, the filter coeffcients
+    are normalized by a[0].
+
+    The \e gain parameter is applied at the filter
+    input and does not affect the coefficient values.
+    The default gain value is 1.0.  This structure
+    results in one extra multiply per computed sample,
+    but allows easy control of the overall filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_FILTER_H
+#define STK_FILTER_H
+
+#include "Stk.h"
+#include <vector>
+
+namespace Nyq
+{
+
+class Filter : public Stk
+{
+public:
+  //! Default constructor creates a zero-order pass-through "filter".
+  Filter(void);
+
+  //! Overloaded constructor which takes filter coefficients.
+  /*!
+    An StkError can be thrown if either of the coefficient vector
+    sizes is zero, or if the a[0] coefficient is equal to zero.
+  */
+  Filter( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients );
+
+  //! Class destructor.
+  virtual ~Filter(void);
+
+  //! Sets all internal states of the filter to zero.
+  void clear(void);
+
+  //! Set filter coefficients.
+  /*!
+    An StkError can be thrown if either of the coefficient vector
+    sizes is zero, or if the a[0] coefficient is equal to zero.  If
+    a[0] is not equal to 1, the filter coeffcients are normalized by
+    a[0].  The internal state of the filter is not cleared unless the
+    \e clearState flag is \c true.
+  */
+  void setCoefficients( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients, bool clearState = false );
+
+  //! Set numerator coefficients.
+  /*!
+    An StkError can be thrown if coefficient vector is empty.  Any
+    previously set denominator coefficients are left unaffected.  Note
+    that the default constructor sets the single denominator
+    coefficient a[0] to 1.0.  The internal state of the filter is not
+    cleared unless the \e clearState flag is \c true.
+  */
+  void setNumerator( std::vector<StkFloat> &bCoefficients, bool clearState = false );
+
+  //! Set denominator coefficients.
+  /*!
+    An StkError can be thrown if the coefficient vector is empty or
+    if the a[0] coefficient is equal to zero.  Previously set
+    numerator coefficients are unaffected unless a[0] is not equal to
+    1, in which case all coeffcients are normalized by a[0].  Note
+    that the default constructor sets the single numerator coefficient
+    b[0] to 1.0.  The internal state of the filter is not cleared
+    unless the \e clearState flag is \c true.
+  */
+  void setDenominator( std::vector<StkFloat> &aCoefficients, bool clearState = false );
+
+  //! Set the filter gain.
+  /*!
+    The gain is applied at the filter input and does not affect the
+    coefficient values.  The default gain value is 1.0.
+   */
+  virtual void setGain(StkFloat gain);
+
+  //! Return the current filter gain.
+  virtual StkFloat getGain(void) const;
+
+  //! Return the last computed output value.
+  virtual StkFloat lastOut(void) const;
+
+  //! Input one sample to the filter and return one output.
+  virtual StkFloat tick( StkFloat input );
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+protected:
+
+  StkFloat gain_;
+  std::vector<StkFloat> b_;
+  std::vector<StkFloat> a_;
+  std::vector<StkFloat> outputs_;
+  std::vector<StkFloat> inputs_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Flute.h b/lib-src/libnyquist/nyquist/nyqstk/include/Flute.h
new file mode 100644
index 0000000..5b6f3bd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Flute.h
@@ -0,0 +1,108 @@
+/***************************************************/
+/*! \class Flute
+    \brief STK flute physical model class.
+
+    This class implements a simple flute
+    physical model, as discussed by Karjalainen,
+    Smith, Waryznyk, etc.  The jet model uses
+    a polynomial, a la Cook.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Jet Delay = 2
+       - Noise Gain = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_FLUTE_H
+#define STK_FLUTE_H
+
+#include "Instrmnt.h"
+#include "JetTable.h"
+#include "DelayL.h"
+#include "OnePole.h"
+#include "PoleZero.h"
+#include "Noise.h"
+#include "ADSR.h"
+#include "SineWave.h"
+
+namespace Nyq
+{
+
+class Flute : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  /*!
+    An StkError will be thrown if the rawwave path is incorrectly set.
+  */
+  Flute(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  ~Flute();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Set the reflection coefficient for the jet delay (-1.0 - 1.0).
+  void setJetReflection(StkFloat coefficient);
+
+  //! Set the reflection coefficient for the air column delay (-1.0 - 1.0).
+  void setEndReflection(StkFloat coefficient);
+
+  //! Set the length of the jet delay in terms of a ratio of jet delay to air column delay lengths.
+  void setJetDelay(StkFloat aRatio);
+
+  //! Apply breath velocity to instrument with given amplitude and rate of increase.
+  void startBlowing(StkFloat amplitude, StkFloat rate);
+
+  //! Decrease breath velocity with given rate of decrease.
+  void stopBlowing(StkFloat rate);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  DelayL   jetDelay_;
+  DelayL   boreDelay_;
+  JetTable jetTable_;
+  OnePole  filter_;
+  PoleZero dcBlock_;
+  Noise    noise_;
+  ADSR     adsr_;
+  SineWave vibrato_;
+  unsigned long length_;
+  StkFloat lastFrequency_;
+  StkFloat maxPressure_;
+  StkFloat jetReflection_;
+  StkFloat endReflection_;
+  StkFloat noiseGain_;
+  StkFloat vibratoGain_;
+  StkFloat outputGain_;
+  StkFloat jetRatio_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Function.h b/lib-src/libnyquist/nyquist/nyqstk/include/Function.h
new file mode 100644
index 0000000..2b773c6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Function.h
@@ -0,0 +1,59 @@
+/***************************************************/
+/*! \class Function
+    \brief STK abstract function parent class.
+
+    This class provides common functionality for STK classes which
+    implement tables or other types of input to output function
+    mappings.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Stk.h"
+
+#ifndef STK_FUNCTION_H
+#define STK_FUNCTION_H
+
+namespace Nyq
+{
+
+class Function : public Stk
+{
+ public:
+  //! Class constructor.
+  Function();
+
+  //! Class destructor.
+  virtual ~Function();
+
+  //! Return the last output value.
+  virtual StkFloat lastOut() const { return lastOutput_; };
+
+  //! Take one sample input and compute one sample of output.
+  StkFloat tick( StkFloat input );
+
+  //! Take a channel of the StkFrames object as inputs to the function and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+ protected:
+
+  // This abstract function must be implemented in all subclasses.
+  // It is used to get around a C++ problem with overloaded virtual
+  // functions.
+  virtual StkFloat computeSample( StkFloat input ) = 0;
+
+  StkFloat lastOutput_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Generator.h b/lib-src/libnyquist/nyquist/nyqstk/include/Generator.h
new file mode 100644
index 0000000..9b91ea6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Generator.h
@@ -0,0 +1,58 @@
+/***************************************************/
+/*! \class Generator
+    \brief STK abstract unit generator parent class.
+
+    This class provides common functionality for
+    STK unit generator sample-source subclasses.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_GENERATOR_H
+#define STK_GENERATOR_H
+
+#include "Stk.h"
+
+namespace Nyq
+{
+
+class Generator : public Stk
+{
+ public:
+  //! Class constructor.
+  Generator( void );
+
+  //! Class destructor.
+  virtual ~Generator( void );
+
+  //! Return the last output value.
+  virtual StkFloat lastOut( void ) const { return lastOutput_; };
+
+  //! Compute one sample and output.
+  StkFloat tick( void );
+
+  //! Fill a channel of the StkFrames object with computed outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+ protected:
+
+  // This abstract function must be implemented in all subclasses.
+  // It is used to get around a C++ problem with overloaded virtual
+  // functions.
+  virtual StkFloat computeSample( void ) = 0;
+
+  StkFloat lastOutput_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Instrmnt.h b/lib-src/libnyquist/nyquist/nyqstk/include/Instrmnt.h
new file mode 100644
index 0000000..0bc9585
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Instrmnt.h
@@ -0,0 +1,75 @@
+/***************************************************/
+/*! \class Instrmnt
+    \brief STK instrument abstract base class.
+
+    This class provides a common interface for
+    all STK instruments.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_INSTRMNT_H
+#define STK_INSTRMNT_H
+
+#include "Stk.h"
+
+namespace Nyq
+{
+
+class Instrmnt : public Stk
+{
+ public:
+  //! Default constructor.
+  Instrmnt();
+
+  //! Class destructor.
+  virtual ~Instrmnt();
+
+  //! Start a note with the given frequency and amplitude.
+  virtual void noteOn(StkFloat frequency, StkFloat amplitude) = 0;
+
+  //! Stop a note with the given amplitude (speed of decay).
+  virtual void noteOff(StkFloat amplitude) = 0;
+
+  //! Set instrument parameters for a particular frequency.
+  virtual void setFrequency(StkFloat frequency);
+
+  //! Return the last output value.
+  StkFloat lastOut() const;
+
+  //! Return the last left output value.
+  StkFloat lastOutLeft() const;
+
+  //! Return the last right output value.
+  StkFloat lastOutRight() const;
+
+  //! Compute one sample and output.
+  StkFloat tick( void );
+
+  //! Fill a channel of the StkFrames object with computed outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  virtual void controlChange(int number, StkFloat value);
+
+ protected:
+
+  // This abstract function must be implemented in all subclasses.
+  // It is used to get around a C++ problem with overloaded virtual
+  // functions.
+  virtual StkFloat computeSample( void ) = 0;
+
+  StkFloat lastOutput_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/JCRev.h b/lib-src/libnyquist/nyquist/nyqstk/include/JCRev.h
new file mode 100644
index 0000000..92848cf
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/JCRev.h
@@ -0,0 +1,57 @@
+/***************************************************/
+/*! \class JCRev
+    \brief John Chowning's reverberator class.
+
+    This class is derived from the CLM JCRev
+    function, which is based on the use of
+    networks of simple allpass and comb delay
+    filters.  This class implements three series
+    allpass units, followed by four parallel comb
+    filters, and two decorrelation delay lines in
+    parallel at the output.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_JCREV_H
+#define STK_JCREV_H
+
+#include "Effect.h"
+#include "Delay.h" 
+
+namespace Nyq
+{
+
+class JCRev : public Effect
+{
+ public:
+  //! Class constructor taking a T60 decay time argument (one second default value).
+  JCRev( StkFloat T60 = 1.0 );
+
+  //! Class destructor.
+  ~JCRev();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set the reverberation T60 decay time.
+  void setT60( StkFloat T60 );
+
+ protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  Delay allpassDelays_[3];
+  Delay combDelays_[4];
+  Delay outLeftDelay_;
+  Delay outRightDelay_;
+  StkFloat allpassCoefficient_;
+  StkFloat combCoefficient_[4];
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/JetTable.h b/lib-src/libnyquist/nyquist/nyqstk/include/JetTable.h
new file mode 100644
index 0000000..003a758
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/JetTable.h
@@ -0,0 +1,41 @@
+/***************************************************/
+/*! \class JetTable
+    \brief STK jet table class.
+
+    This class implements a flue jet non-linear
+    function, computed by a polynomial calculation.
+    Contrary to the name, this is not a "table".
+
+    Consult Fletcher and Rossing, Karjalainen,
+    Cook, and others for more information.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_JETTABL_H
+#define STK_JETTABL_H
+
+#include "Function.h"
+
+namespace Nyq
+{
+
+class JetTable : public Function
+{
+public:
+  //! Default constructor.
+  JetTable();
+
+  //! Class destructor.
+  ~JetTable();
+
+protected:
+
+  StkFloat computeSample( StkFloat input );
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Mandolin.h b/lib-src/libnyquist/nyquist/nyqstk/include/Mandolin.h
new file mode 100644
index 0000000..e619cf9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Mandolin.h
@@ -0,0 +1,75 @@
+/***************************************************/
+/*! \class Mandolin
+    \brief STK mandolin instrument model class.
+
+    This class inherits from PluckTwo and uses
+    "commuted synthesis" techniques to model a
+    mandolin instrument.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+    Commuted Synthesis, in particular, is covered
+    by patents, granted, pending, and/or
+    applied-for.  All are assigned to the Board of
+    Trustees, Stanford University.  For
+    information, contact the Office of Technology
+    Licensing, Stanford University.
+
+    Control Change Numbers: 
+       - Body Size = 2
+       - Pluck Position = 4
+       - String Sustain = 11
+       - String Detuning = 1
+       - Microphone Position = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_MANDOLIN_H
+#define STK_MANDOLIN_H
+
+#include "PluckTwo.h"
+#include "FileWvIn.h"
+
+namespace Nyq
+{
+
+class Mandolin : public PluckTwo
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  Mandolin(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  ~Mandolin();
+
+  //! Pluck the strings with the given amplitude (0.0 - 1.0) using the current frequency.
+  void pluck(StkFloat amplitude);
+
+  //! Pluck the strings with the given amplitude (0.0 - 1.0) and position (0.0 - 1.0).
+  void pluck(StkFloat amplitude,StkFloat position);
+
+  //! Start a note with the given frequency and amplitude (0.0 - 1.0).
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Set the body size (a value of 1.0 produces the "default" size).
+  void setBodySize(StkFloat size);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+  protected:
+
+  StkFloat computeSample( void );
+
+  FileWvIn *soundfile_[12];
+  int mic_;
+  long dampTime_;
+  bool waveDone_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Modal.h b/lib-src/libnyquist/nyquist/nyqstk/include/Modal.h
new file mode 100644
index 0000000..1b5443a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Modal.h
@@ -0,0 +1,96 @@
+/***************************************************/
+/*! \class Modal
+    \brief STK resonance model instrument.
+
+    This class contains an excitation wavetable,
+    an envelope, an oscillator, and N resonances
+    (non-sweeping BiQuad filters), where N is set
+    during instantiation.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_MODAL_H
+#define STK_MODAL_H
+
+#include "Instrmnt.h"
+#include "Envelope.h"
+#include "WaveLoop.h"
+#include "SineWave.h"
+#include "BiQuad.h"
+#include "OnePole.h"
+
+namespace Nyq
+{
+
+class Modal : public Instrmnt
+{
+public:
+  //! Class constructor, taking the desired number of modes to create.
+  /*!
+    An StkError will be thrown if the rawwave path is incorrectly set.
+  */
+  Modal( unsigned int modes = 4 );
+
+  //! Class destructor.
+  virtual ~Modal();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  virtual void setFrequency(StkFloat frequency);
+
+  //! Set the ratio and radius for a specified mode filter.
+  void setRatioAndRadius(unsigned int modeIndex, StkFloat ratio, StkFloat radius);
+
+  //! Set the master gain.
+  void setMasterGain(StkFloat aGain);
+
+  //! Set the direct gain.
+  void setDirectGain(StkFloat aGain);
+
+  //! Set the gain for a specified mode filter.
+  void setModeGain(unsigned int modeIndex, StkFloat gain);
+
+  //! Initiate a strike with the given amplitude (0.0 - 1.0).
+  virtual void strike(StkFloat amplitude);
+
+  //! Damp modes with a given decay factor (0.0 - 1.0).
+  void damp(StkFloat amplitude);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  virtual void controlChange(int number, StkFloat value) = 0;
+
+protected:
+
+  StkFloat computeSample( void );
+
+  Envelope envelope_; 
+  FileWvIn *wave_;
+  BiQuad **filters_;
+  OnePole  onepole_;
+  SineWave vibrato_;
+
+  unsigned int nModes_;
+  std::vector<StkFloat> ratios_;
+  std::vector<StkFloat> radii_;
+
+  StkFloat vibratoGain_;
+  StkFloat masterGain_;
+  StkFloat directGain_;
+  StkFloat stickHardness_;
+  StkFloat strikePosition_;
+  StkFloat baseFrequency_;
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/ModalBar.h b/lib-src/libnyquist/nyquist/nyqstk/include/ModalBar.h
new file mode 100644
index 0000000..2336b29
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/ModalBar.h
@@ -0,0 +1,66 @@
+/***************************************************/
+/*! \class ModalBar
+    \brief STK resonant bar instrument class.
+
+    This class implements a number of different
+    struck bar instruments.  It inherits from the
+    Modal class.
+
+    Control Change Numbers: 
+       - Stick Hardness = 2
+       - Stick Position = 4
+       - Vibrato Gain = 1
+       - Vibrato Frequency = 11
+       - Direct Stick Mix = 8
+       - Volume = 128
+       - Modal Presets = 16
+         - Marimba = 0
+         - Vibraphone = 1
+         - Agogo = 2
+         - Wood1 = 3
+         - Reso = 4
+         - Wood2 = 5
+         - Beats = 6
+         - Two Fixed = 7
+         - Clump = 8
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_MODALBAR_H
+#define STK_MODALBAR_H
+
+#include "Modal.h"
+
+namespace Nyq
+{
+
+class ModalBar : public Modal
+{
+public:
+  //! Class constructor.
+  ModalBar();
+
+  //! Class destructor.
+  ~ModalBar();
+
+  //! Set stick hardness (0.0 - 1.0).
+  void setStickHardness(StkFloat hardness);
+
+  //! Set stick position (0.0 - 1.0).
+  void setStrikePosition(StkFloat position);
+
+  //! Select a bar preset (currently modulo 9).
+  void setPreset(int preset);
+
+  //! Set the modulation (vibrato) depth.
+  void setModulationDepth(StkFloat mDepth);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/NRev.h b/lib-src/libnyquist/nyquist/nyqstk/include/NRev.h
new file mode 100644
index 0000000..28031cf
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/NRev.h
@@ -0,0 +1,58 @@
+/***************************************************/
+/*! \class NRev
+    \brief CCRMA's NRev reverberator class.
+
+    This class is derived from the CLM NRev
+    function, which is based on the use of
+    networks of simple allpass and comb delay
+    filters.  This particular arrangement consists
+    of 6 comb filters in parallel, followed by 3
+    allpass filters, a lowpass filter, and another
+    allpass in series, followed by two allpass
+    filters in parallel with corresponding right
+    and left outputs.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_NREV_H
+#define STK_NREV_H
+
+#include "Effect.h" 
+#include "Delay.h" 
+
+namespace Nyq
+{
+
+class NRev : public Effect
+{
+ public:
+  //! Class constructor taking a T60 decay time argument (one second default value).
+  NRev( StkFloat T60 = 1.0 );
+
+  //! Class destructor.
+  ~NRev();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set the reverberation T60 decay time.
+  void setT60( StkFloat T60 );
+
+ protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  Delay allpassDelays_[8];
+  Delay combDelays_[6];
+  StkFloat allpassCoefficient_;
+  StkFloat combCoefficient_[6];
+	StkFloat lowpassState_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Noise.h b/lib-src/libnyquist/nyquist/nyqstk/include/Noise.h
new file mode 100644
index 0000000..0cbd409
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Noise.h
@@ -0,0 +1,53 @@
+/***************************************************/
+/*! \class Noise
+    \brief STK noise generator.
+
+    Generic random number generation using the
+    C rand() function.  The quality of the rand()
+    function varies from one OS to another.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_NOISE_H
+#define STK_NOISE_H
+
+#include "Generator.h"
+
+namespace Nyq
+{
+
+class Noise : public Generator
+{
+public:
+
+  //! Default constructor which seeds the random number generator with the system time.
+  Noise();
+
+  //! Constructor which seeds the random number generator with a given seed.
+  /*!
+    If the seed value is zero, the random number generator is
+    seeded with the system time.
+  */
+  Noise( unsigned int seed );
+
+  //! Class destructor.
+  virtual ~Noise();
+
+  //! Seed the random number generator with a specific seed value.
+  /*!
+    If no seed is provided or the seed value is zero, the random
+    number generator is seeded with the current system time.
+  */
+  void setSeed( unsigned int seed = 0 );
+
+protected:
+
+  virtual StkFloat computeSample( void );
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/OnePole.h b/lib-src/libnyquist/nyquist/nyqstk/include/OnePole.h
new file mode 100644
index 0000000..a141452
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/OnePole.h
@@ -0,0 +1,84 @@
+/***************************************************/
+/*! \class OnePole
+    \brief STK one-pole filter class.
+
+    This protected Filter subclass implements
+    a one-pole digital filter.  A method is
+    provided for setting the pole position along
+    the real axis of the z-plane while maintaining
+    a constant peak filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_ONEPOLE_H
+#define STK_ONEPOLE_H
+
+#include "Filter.h"
+
+namespace Nyq
+{
+
+class OnePole : protected Filter
+{
+public:
+
+  //! Default constructor creates a first-order low-pass filter.
+  OnePole();
+
+  //! Overloaded constructor which sets the pole position during instantiation.
+  OnePole( StkFloat thePole );
+
+  //! Class destructor.
+  ~OnePole();
+
+  //! Clears the internal state of the filter.
+  void clear(void);
+
+  //! Set the b[0] coefficient value.
+  void setB0(StkFloat b0);
+
+  //! Set the a[1] coefficient value.
+  void setA1(StkFloat a1);
+
+  //! Set the pole position in the z-plane.
+  /*!
+    This method sets the pole position along the real-axis of the
+    z-plane and normalizes the coefficients for a maximum gain of one.
+    A positive pole value produces a low-pass filter, while a negative
+    pole value produces a high-pass filter.  This method does not
+    affect the filter \e gain value.
+  */
+  void setPole(StkFloat thePole);
+
+  //! Set the filter gain.
+  /*!
+    The gain is applied at the filter input and does not affect the
+    coefficient values.  The default gain value is 1.0.
+   */
+  void setGain(StkFloat gain);
+
+  //! Return the current filter gain.
+  StkFloat getGain(void) const;
+
+  //! Return the last computed output value.
+  StkFloat lastOut(void) const;
+
+  //! Input one sample to the filter and return one output.
+  StkFloat tick(StkFloat sample);
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/OneZero.h b/lib-src/libnyquist/nyquist/nyqstk/include/OneZero.h
new file mode 100644
index 0000000..19da171
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/OneZero.h
@@ -0,0 +1,84 @@
+/***************************************************/
+/*! \class OneZero
+    \brief STK one-zero filter class.
+
+    This protected Filter subclass implements
+    a one-zero digital filter.  A method is
+    provided for setting the zero position
+    along the real axis of the z-plane while
+    maintaining a constant filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_ONEZERO_H
+#define STK_ONEZERO_H
+
+#include "Filter.h"
+
+namespace Nyq
+{
+
+class OneZero : protected Filter
+{
+ public:
+
+  //! Default constructor creates a first-order low-pass filter.
+  OneZero();
+
+  //! Overloaded constructor which sets the zero position during instantiation.
+  OneZero(StkFloat theZero);
+
+  //! Class destructor.
+  ~OneZero();
+
+  //! Clears the internal state of the filter.
+  void clear(void);
+
+  //! Set the b[0] coefficient value.
+  void setB0(StkFloat b0);
+
+  //! Set the b[1] coefficient value.
+  void setB1(StkFloat b1);
+
+  //! Set the zero position in the z-plane.
+  /*!
+    This method sets the zero position along the real-axis of the
+    z-plane and normalizes the coefficients for a maximum gain of one.
+    A positive zero value produces a high-pass filter, while a
+    negative zero value produces a low-pass filter.  This method does
+    not affect the filter \e gain value.
+  */
+  void setZero(StkFloat theZero);
+
+  //! Set the filter gain.
+  /*!
+    The gain is applied at the filter input and does not affect the
+    coefficient values.  The default gain value is 1.0.
+   */
+  void setGain(StkFloat gain);
+
+  //! Return the current filter gain.
+  StkFloat getGain(void) const;
+
+  //! Return the last computed output value.
+  StkFloat lastOut(void) const;
+
+  //! Input one sample to the filter and return one output.
+  StkFloat tick(StkFloat sample);
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/PRCRev.h b/lib-src/libnyquist/nyquist/nyqstk/include/PRCRev.h
new file mode 100644
index 0000000..5ee5c76
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/PRCRev.h
@@ -0,0 +1,55 @@
+/***************************************************/
+/*! \class PRCRev
+    \brief Perry's simple reverberator class.
+
+    This class is based on some of the famous
+    Stanford/CCRMA reverbs (NRev, KipRev), which
+    were based on the Chowning/Moorer/Schroeder
+    reverberators using networks of simple allpass
+    and comb delay filters.  This class implements
+    two series allpass units and two parallel comb
+    filters.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_PRCREV_H
+#define STK_PRCREV_H
+
+#include "Effect.h" 
+#include "Delay.h" 
+
+namespace Nyq
+{
+
+class PRCRev : public Effect
+{
+public:
+  //! Class constructor taking a T60 decay time argument (one second default value).
+  PRCRev( StkFloat T60 = 1.0 );
+
+  //! Class destructor.
+  ~PRCRev();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set the reverberation T60 decay time.
+  void setT60( StkFloat T60 );
+
+protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  Delay allpassDelays_[2];
+  Delay combDelays_[2];
+  StkFloat allpassCoefficient_;
+  StkFloat combCoefficient_[2];
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/PitShift.h b/lib-src/libnyquist/nyquist/nyqstk/include/PitShift.h
new file mode 100644
index 0000000..775b8e2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/PitShift.h
@@ -0,0 +1,52 @@
+/***************************************************/
+/*! \class PitShift
+    \brief STK simple pitch shifter effect class.
+
+    This class implements a simple pitch shifter
+    using delay lines.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_PITSHIFT_H
+#define STK_PITSHIFT_H
+
+#include "Effect.h" 
+#include "DelayL.h" 
+
+namespace Nyq
+{
+
+class PitShift : public Effect
+{
+ public:
+  //! Class constructor.
+  PitShift();
+
+  //! Class destructor.
+  ~PitShift();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set the pitch shift factor (1.0 produces no shift).
+  void setShift(StkFloat shift);
+
+ protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  DelayL delayLine_[2];
+  StkFloat delay_[2];
+  StkFloat env_[2];
+  StkFloat rate_;
+  unsigned long delayLength;
+  unsigned long halfLength;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/PluckTwo.h b/lib-src/libnyquist/nyquist/nyqstk/include/PluckTwo.h
new file mode 100644
index 0000000..eabb74d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/PluckTwo.h
@@ -0,0 +1,90 @@
+/***************************************************/
+/*! \class PluckTwo
+    \brief STK enhanced plucked string model class.
+
+    This class implements an enhanced two-string,
+    plucked physical model, a la Jaffe-Smith,
+    Smith, and others.
+
+    PluckTwo is an abstract class, with no excitation
+    specified.  Therefore, it can't be directly
+    instantiated.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_PLUCKTWO_H
+#define STK_PLUCKTWO_H
+
+#include "Instrmnt.h"
+#include "DelayL.h"
+#include "DelayA.h"
+#include "OneZero.h"
+
+namespace Nyq
+{
+
+class PluckTwo : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  PluckTwo(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  virtual ~PluckTwo();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  virtual void setFrequency(StkFloat frequency);
+
+  //! Detune the two strings by the given factor.  A value of 1.0 produces unison strings.
+  void setDetune(StkFloat detune);
+
+  //! Efficient combined setting of frequency and detuning.
+  void setFreqAndDetune(StkFloat frequency, StkFloat detune);
+
+  //! Set the pluck or "excitation" position along the string (0.0 - 1.0).
+  void setPluckPosition(StkFloat position);
+
+  //! Set the base loop gain.
+  /*!
+    The actual loop gain is set according to the frequency.
+    Because of high-frequency loop filter roll-off, higher
+    frequency settings have greater loop gains.
+  */
+  void setBaseLoopGain(StkFloat aGain);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  virtual void noteOff(StkFloat amplitude);
+
+ protected:
+
+  virtual StkFloat computeSample( void ) = 0;
+
+  DelayA  delayLine_;
+  DelayA  delayLine2_;
+  DelayL  combDelay_;
+  OneZero filter_;
+  OneZero filter2_;
+
+  unsigned long length_;
+  StkFloat loopGain_;
+  StkFloat baseLoopGain_;
+  StkFloat lastFrequency_;
+  StkFloat lastLength_;
+  StkFloat detuning_;
+  StkFloat pluckAmplitude_;
+  StkFloat pluckPosition_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/PoleZero.h b/lib-src/libnyquist/nyquist/nyqstk/include/PoleZero.h
new file mode 100644
index 0000000..5ee5d10
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/PoleZero.h
@@ -0,0 +1,91 @@
+/***************************************************/
+/*! \class PoleZero
+    \brief STK one-pole, one-zero filter class.
+
+    This protected Filter subclass implements
+    a one-pole, one-zero digital filter.  A
+    method is provided for creating an allpass
+    filter with a given coefficient.  Another
+    method is provided to create a DC blocking filter.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_POLEZERO_H
+#define STK_POLEZERO_H
+
+#include "Filter.h"
+
+namespace Nyq
+{
+
+class PoleZero : protected Filter
+{
+ public:
+
+  //! Default constructor creates a first-order pass-through filter.
+  PoleZero();
+
+  //! Class destructor.
+  ~PoleZero();
+
+  //! Clears the internal states of the filter.
+  void clear(void);
+
+  //! Set the b[0] coefficient value.
+  void setB0(StkFloat b0);
+
+  //! Set the b[1] coefficient value.
+  void setB1(StkFloat b1);
+
+  //! Set the a[1] coefficient value.
+  void setA1(StkFloat a1);
+
+  //! Set the filter for allpass behavior using \e coefficient.
+  /*!
+    This method uses \e coefficient to create an allpass filter,
+    which has unity gain at all frequencies.  Note that the \e
+    coefficient magnitude must be less than one to maintain stability.
+  */
+  void setAllpass(StkFloat coefficient);
+
+  //! Create a DC blocking filter with the given pole position in the z-plane.
+  /*!
+    This method sets the given pole position, together with a zero
+    at z=1, to create a DC blocking filter.  \e thePole should be
+    close to one to minimize low-frequency attenuation.
+
+  */
+  void setBlockZero(StkFloat thePole = 0.99);
+
+  //! Set the filter gain.
+  /*!
+    The gain is applied at the filter input and does not affect the
+    coefficient values.  The default gain value is 1.0.
+   */
+  void setGain( StkFloat gain );
+
+  //! Return the current filter gain.
+  StkFloat getGain( void ) const;
+
+  //! Return the last computed output value.
+  StkFloat lastOut( void ) const;
+
+  //! Input one sample to the filter and return one output.
+  StkFloat tick( StkFloat sample );
+
+  //! Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is equal to or greater than the number of
+    channels in the StkFrames object.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/ReedTable.h b/lib-src/libnyquist/nyquist/nyqstk/include/ReedTable.h
new file mode 100644
index 0000000..c7e8744
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/ReedTable.h
@@ -0,0 +1,64 @@
+/***************************************************/
+/*! \class ReedTable
+    \brief STK reed table class.
+
+    This class implements a simple one breakpoint,
+    non-linear reed function, as described by
+    Smith (1986).  This function is based on a
+    memoryless non-linear spring model of the reed
+    (the reed mass is ignored) which saturates when
+    the reed collides with the mouthpiece facing.
+
+    See McIntyre, Schumacher, & Woodhouse (1983),
+    Smith (1986), Hirschman, Cook, Scavone, and
+    others for more information.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_REEDTABLE_H
+#define STK_REEDTABLE_H
+
+#include "Function.h"
+
+namespace Nyq
+{
+
+class ReedTable : public Function
+{
+public:
+  //! Default constructor.
+  ReedTable();
+
+  //! Class destructor.
+  ~ReedTable();
+
+  //! Set the table offset value.
+  /*!
+    The table offset roughly corresponds to the size
+    of the initial reed tip opening (a greater offset
+    represents a smaller opening).
+  */
+  void setOffset(StkFloat offset);
+
+  //! Set the table slope value.
+  /*!
+   The table slope roughly corresponds to the reed
+   stiffness (a greater slope represents a harder
+   reed).
+  */
+  void setSlope(StkFloat slope);
+
+protected:
+
+  StkFloat computeSample( StkFloat input );
+
+  StkFloat offset_;
+  StkFloat slope_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/SKINI.msg b/lib-src/libnyquist/nyquist/nyqstk/include/SKINI.msg
new file mode 100644
index 0000000..5e5fdca
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/SKINI.msg
@@ -0,0 +1,127 @@
+/*********************************************************/
+/*
+  Definition of SKINI Message Types and Special Symbols
+     Synthesis toolKit Instrument Network Interface
+
+  These symbols should have the form __SK_<name>_
+
+  Where <name> is the string used in the SKINI stream.
+
+  by Perry R. Cook, 1995 - 2002.
+*/
+/*********************************************************/
+
+namespace Nyq
+{
+
+/***** MIDI COMPATIBLE MESSAGES *****/
+/***** Status Bytes Have Channel=0 **/
+
+#define NOPE    -32767
+#define YEP     1
+#define SK_DBL  -32766
+#define SK_INT  -32765
+#define SK_STR  -32764
+
+#define __SK_NoteOff_                128
+#define __SK_NoteOn_                 144
+#define __SK_PolyPressure_           160
+#define __SK_ControlChange_          176
+#define __SK_ProgramChange_          192
+#define __SK_AfterTouch_             208
+#define __SK_ChannelPressure_        __SK_AfterTouch_
+#define __SK_PitchWheel_             224
+#define __SK_PitchBend_              __SK_PitchWheel_
+#define __SK_PitchChange_            249
+
+#define __SK_Clock_                  248
+#define __SK_SongStart_              250
+#define __SK_Continue_               251
+#define __SK_SongStop_               252
+#define __SK_ActiveSensing_          254
+#define __SK_SystemReset_            255
+
+#define __SK_Volume_                 7
+#define __SK_ModWheel_               1
+#define __SK_Modulation_             __SK_ModWheel_
+#define __SK_Breath_                 2
+#define __SK_FootControl_            4
+#define __SK_Portamento_             65
+#define __SK_Balance_                8
+#define __SK_Pan_                    10
+#define __SK_Sustain_                64
+#define __SK_Damper_                 __SK_Sustain_
+#define __SK_Expression_             11 
+
+#define __SK_AfterTouch_Cont_        128
+#define __SK_ModFrequency_           __SK_Expression_
+
+#define __SK_ProphesyRibbon_         16
+#define __SK_ProphesyWheelUp_        2
+#define __SK_ProphesyWheelDown_      3
+#define __SK_ProphesyPedal_          18
+#define __SK_ProphesyKnob1_          21
+#define __SK_ProphesyKnob2_          22
+
+/***  Instrument Family Specific ***/
+
+#define __SK_NoiseLevel_             __SK_FootControl_
+
+#define __SK_PickPosition_           __SK_FootControl_
+#define __SK_StringDamping_          __SK_Expression_
+#define __SK_StringDetune_           __SK_ModWheel_
+#define __SK_BodySize_               __SK_Breath_
+#define __SK_BowPressure_            __SK_Breath_
+#define __SK_BowPosition_            __SK_PickPosition_
+#define __SK_BowBeta_                __SK_BowPosition_
+
+#define __SK_ReedStiffness_          __SK_Breath_
+#define __SK_ReedRestPos_            __SK_FootControl_
+
+#define __SK_FluteEmbouchure_        __SK_Breath_
+#define __SK_JetDelay_               __SK_FluteEmbouchure_
+
+#define __SK_LipTension_             __SK_Breath_
+#define __SK_SlideLength_            __SK_FootControl_
+
+#define __SK_StrikePosition_         __SK_PickPosition_
+#define __SK_StickHardness_          __SK_Breath_
+
+#define __SK_TrillDepth_             1051
+#define __SK_TrillSpeed_             1052
+#define __SK_StrumSpeed_             __SK_TrillSpeed_
+#define __SK_RollSpeed_              __SK_TrillSpeed_
+
+#define __SK_FilterQ_                __SK_Breath_
+#define __SK_FilterFreq_             1062
+#define __SK_FilterSweepRate_        __SK_FootControl_
+
+#define __SK_ShakerInst_             1071 
+#define __SK_ShakerEnergy_           __SK_Breath_
+#define __SK_ShakerDamping_          __SK_ModFrequency_
+#define __SK_ShakerNumObjects_       __SK_FootControl_
+
+#define __SK_Strumming_              1090
+#define __SK_NotStrumming_           1091
+#define __SK_Trilling_               1092
+#define __SK_NotTrilling_            1093
+#define __SK_Rolling_                __SK_Strumming_
+#define __SK_NotRolling_             __SK_NotStrumming_
+
+#define __SK_PlayerSkill_            2001
+#define __SK_Chord_                  2002
+#define __SK_ChordOff_               2003
+
+#define __SK_SINGER_FilePath_        3000
+#define __SK_SINGER_Frequency_       3001
+#define __SK_SINGER_NoteName_        3002
+#define __SK_SINGER_Shape_           3003
+#define __SK_SINGER_Glot_            3004
+#define __SK_SINGER_VoicedUnVoiced_  3005
+#define __SK_SINGER_Synthesize_      3006
+#define __SK_SINGER_Silence_         3007
+#define __SK_SINGER_VibratoAmt_      __SK_ModWheel_
+#define __SK_SINGER_RndVibAmt_       3008
+#define __SK_SINGER_VibFreq_         __SK_Expression_
+
+} // namespace Nyq
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Saxofony.h b/lib-src/libnyquist/nyquist/nyqstk/include/Saxofony.h
new file mode 100644
index 0000000..7609d4a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Saxofony.h
@@ -0,0 +1,108 @@
+/***************************************************/
+/*! \class Saxofony
+    \brief STK faux conical bore reed instrument class.
+
+    This class implements a "hybrid" digital
+    waveguide instrument that can generate a
+    variety of wind-like sounds.  It has also been
+    referred to as the "blowed string" model.  The
+    waveguide section is essentially that of a
+    string, with one rigid and one lossy
+    termination.  The non-linear function is a
+    reed table.  The string can be "blown" at any
+    point between the terminations, though just as
+    with strings, it is impossible to excite the
+    system at either end.  If the excitation is
+    placed at the string mid-point, the sound is
+    that of a clarinet.  At points closer to the
+    "bridge", the sound is closer to that of a
+    saxophone.  See Scavone (2002) for more details.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Reed Stiffness = 2
+       - Reed Aperture = 26
+       - Noise Gain = 4
+       - Blow Position = 11
+       - Vibrato Frequency = 29
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_SAXOFONY_H
+#define STK_SAXOFONY_H
+
+#include "Instrmnt.h"
+#include "DelayL.h"
+#include "ReedTable.h"
+#include "OneZero.h"
+#include "Envelope.h"
+#include "Noise.h"
+#include "SineWave.h"
+
+namespace Nyq
+{
+
+class Saxofony : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  /*!
+    An StkError will be thrown if the rawwave path is incorrectly set.
+  */
+  Saxofony(StkFloat lowestFrequency);
+
+  //! Class destructor.
+  ~Saxofony();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Set the "blowing" position between the air column terminations (0.0 - 1.0).
+  void setBlowPosition(StkFloat aPosition);
+
+  //! Apply breath pressure to instrument with given amplitude and rate of increase.
+  void startBlowing(StkFloat amplitude, StkFloat rate);
+
+  //! Decrease breath pressure with given rate of decrease.
+  void stopBlowing(StkFloat rate);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+  //! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+  void controlChange(int number, StkFloat value);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  DelayL    delays_[2];
+  ReedTable reedTable_;
+  OneZero   filter_;
+  Envelope  envelope_;
+  Noise     noise_;
+  SineWave vibrato_;
+  unsigned long length_;
+  StkFloat outputGain_;
+  StkFloat noiseGain_;
+  StkFloat vibratoGain_;
+  StkFloat position_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/SineWave.h b/lib-src/libnyquist/nyquist/nyqstk/include/SineWave.h
new file mode 100644
index 0000000..756570d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/SineWave.h
@@ -0,0 +1,90 @@
+/***************************************************/
+/*! \class SineWave
+    \brief STK sinusoid oscillator class.
+
+    This class computes and saves a static sine "table" that can be
+    shared by multiple instances.  It has an interface similar to the
+    WaveLoop class but inherits from the Generator class.  Output
+    values are computed using linear interpolation.
+
+    The "table" length, set in SineWave.h, is 2048 samples by default.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_SINEWAVE_H
+#define STK_SINEWAVE_H
+
+namespace Nyq
+{
+
+const unsigned long TABLE_SIZE = 2048;
+
+} // namespace Nyq
+
+#include "Generator.h"
+
+namespace Nyq
+{
+
+class SineWave : public Generator
+{
+public:
+  //! Default constructor.
+  SineWave( void );
+
+  //! Class destructor.
+  virtual ~SineWave( void );
+
+  //! Clear output and reset time pointer to zero.
+  void reset( void );
+
+  //! Set the data read rate in samples.  The rate can be negative.
+  /*!
+    If the rate value is negative, the data is read in reverse order.
+  */
+  void setRate( StkFloat rate ) { rate_ = rate; };
+
+  //! Set the data interpolation rate based on a looping frequency.
+  /*!
+    This function determines the interpolation rate based on the file
+    size and the current Stk::sampleRate.  The \e frequency value
+    corresponds to file cycles per second.  The frequency can be
+    negative, in which case the loop is read in reverse order.
+   */
+  void setFrequency( StkFloat frequency );
+
+  //! Increment the read pointer by \e time samples, modulo file size.
+  void addTime( StkFloat time );
+
+  //! Increment current read pointer by \e angle, relative to a looping frequency.
+  /*!
+    This function increments the read pointer based on the file
+    size and the current Stk::sampleRate.  The \e anAngle value
+    is a multiple of file size.
+   */
+  void addPhase( StkFloat angle );
+
+  //! Add a phase offset to the current read pointer.
+  /*!
+    This function determines a time offset based on the file
+    size and the current Stk::sampleRate.  The \e angle value
+    is a multiple of file size.
+   */
+  void addPhaseOffset( StkFloat angle );
+
+protected:
+
+  StkFloat computeSample( void );
+
+  static StkFrames table_;
+  StkFloat time_;
+  StkFloat rate_;
+  StkFloat phaseOffset_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Sitar.h b/lib-src/libnyquist/nyquist/nyqstk/include/Sitar.h
new file mode 100644
index 0000000..d2b0bcd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Sitar.h
@@ -0,0 +1,75 @@
+/***************************************************/
+/*! \class Sitar
+    \brief STK sitar string model class.
+
+    This class implements a sitar plucked string
+    physical model based on the Karplus-Strong
+    algorithm.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+    There exist at least two patents, assigned to
+    Stanford, bearing the names of Karplus and/or
+    Strong.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_SITAR_H
+#define STK_SITAR_H
+
+#include "Instrmnt.h"
+#include "DelayA.h"
+#include "OneZero.h"
+#include "Noise.h"
+#include "ADSR.h"
+
+namespace Nyq
+{
+
+class Sitar : public Instrmnt
+{
+ public:
+  //! Class constructor, taking the lowest desired playing frequency.
+  Sitar( StkFloat lowestFrequency = 20 );
+
+  //! Class destructor.
+  ~Sitar();
+
+  //! Reset and clear all internal state.
+  void clear();
+
+  //! Set instrument parameters for a particular frequency.
+  void setFrequency(StkFloat frequency);
+
+  //! Pluck the string with the given amplitude using the current frequency.
+  void pluck(StkFloat amplitude);
+
+  //! Start a note with the given frequency and amplitude.
+  void noteOn(StkFloat frequency, StkFloat amplitude);
+
+  //! Stop a note with the given amplitude (speed of decay).
+  void noteOff(StkFloat amplitude);
+
+ protected:
+
+  StkFloat computeSample( void );
+
+  DelayA  delayLine_;
+  OneZero loopFilter_;
+  Noise   noise_;
+  ADSR    envelope_;
+
+  StkFloat loopGain_;
+  StkFloat amGain_;
+  StkFloat delay_;
+  StkFloat targetDelay_;
+
+};
+
+} // namespace Nyq
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h b/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h
new file mode 100644
index 0000000..e81a46c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h
@@ -0,0 +1,369 @@
+/***************************************************/
+/*! \class Stk
+    \brief STK base class
+
+    Nearly all STK classes inherit from this class.
+    The global sample rate and rawwave path variables
+    can be queried and modified via Stk.  In addition,
+    this class provides error handling and
+    byte-swapping functions.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_STK_H
+#define STK_STK_H
+
+#include <string>
+#include <iostream>
+#include <sstream>
+
+namespace Nyq
+{
+
+// Most data in STK is passed and calculated with the
+// following user-definable floating-point type.  You
+// can change this to "float" if you prefer or perhaps
+// a "long double" in the future.
+typedef double StkFloat;
+
+// The "MY_FLOAT" type was deprecated in STK
+// versions higher than 4.1.3 and replaced with the variable
+// "StkFloat".  
+#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
+  typedef StkFloat MY_FLOAT;
+  #pragma deprecated(MY_FLOAT)
+#elif defined(__GXX__) 
+  typedef StkFloat MY_FLOAT __attribute__ ((deprecated));
+#else
+  typedef StkFloat MY_FLOAT; // temporary
+#endif
+
+
+//! STK error handling class.
+/*!
+  This is a fairly abstract exception handling class.  There could
+  be sub-classes to take care of more specific error conditions ... or
+  not.
+*/
+class StkError
+{
+public:
+  enum Type {
+    STATUS,
+    WARNING,
+    DEBUG_WARNING,
+    MEMORY_ALLOCATION,
+    MEMORY_ACCESS,
+    FUNCTION_ARGUMENT,
+    FILE_NOT_FOUND,
+    FILE_UNKNOWN_FORMAT,
+    FILE_ERROR,
+    PROCESS_THREAD,
+    PROCESS_SOCKET,
+    PROCESS_SOCKET_IPADDR,
+    AUDIO_SYSTEM,
+    MIDI_SYSTEM,
+    UNSPECIFIED
+  };
+
+protected:
+  std::string message_;
+  Type type_;
+
+public:
+  //! The constructor.
+  StkError(const std::string& message, Type type = StkError::UNSPECIFIED)
+    : message_(message), type_(type) {}
+
+  //! The destructor.
+  virtual ~StkError(void) {};
+
+  //! Prints thrown error message to stderr.
+  virtual void printMessage(void) { std::cerr << '\n' << message_ << "\n\n"; }
+
+  //! Returns the thrown error message type.
+  virtual const Type& getType(void) { return type_; }
+
+  //! Returns the thrown error message string.
+  virtual const std::string& getMessage(void) { return message_; }
+
+  //! Returns the thrown error message as a C string.
+  virtual const char *getMessageCString(void) { return message_.c_str(); }
+};
+
+
+class Stk
+{
+public:
+
+  typedef unsigned long StkFormat;
+  static const StkFormat STK_SINT8;   /*!< -128 to +127 */
+  static const StkFormat STK_SINT16;  /*!< -32768 to +32767 */
+  static const StkFormat STK_SINT24;  /*!< Upper 3 bytes of 32-bit signed integer. */
+  static const StkFormat STK_SINT32;  /*!< -2147483648 to +2147483647. */
+  static const StkFormat STK_FLOAT32; /*!< Normalized between plus/minus 1.0. */
+  static const StkFormat STK_FLOAT64; /*!< Normalized between plus/minus 1.0. */
+
+  //! Static method which returns the current STK sample rate.
+  static StkFloat sampleRate(void) { return srate_; }
+
+  //! Static method which sets the STK sample rate.
+  /*!
+    The sample rate set using this method is queried by all STK
+    classes which depend on its value.  It is initialized to the
+    default SRATE set in Stk.h.  Many STK classes use the sample rate
+    during instantiation.  Therefore, if you wish to use a rate which
+    is different from the default rate, it is imperative that it be
+    set \e BEFORE STK objects are instantiated.
+  */
+  static void setSampleRate(StkFloat rate) { if (rate > 0.0) srate_ = rate; }
+
+  //! Static method which returns the current rawwave path.
+  static std::string rawwavePath(void) { return rawwavepath_; }
+
+  //! Static method which sets the STK rawwave path.
+  static void setRawwavePath(std::string path);
+
+  //! Static method which byte-swaps a 16-bit data type.
+  static void swap16(unsigned char *ptr);
+
+  //! Static method which byte-swaps a 32-bit data type.
+  static void swap32(unsigned char *ptr);
+
+  //! Static method which byte-swaps a 64-bit data type.
+  static void swap64(unsigned char *ptr);
+
+  //! Static cross-platform method to sleep for a number of milliseconds.
+  static void sleep(unsigned long milliseconds);
+
+  //! Static function for error reporting and handling using c-strings.
+  static void handleError( const char *message, StkError::Type type );
+
+  //! Static function for error reporting and handling using c++ strings.
+  static void handleError( std::string message, StkError::Type type );
+
+  //! Toggle display of WARNING and STATUS messages.
+  static void showWarnings( bool status ) { showWarnings_ = status; }
+
+  //! Toggle display of error messages before throwing exceptions.
+  static void printErrors( bool status ) { printErrors_ = status; }
+
+private:
+  static StkFloat srate_;
+  static std::string rawwavepath_;
+  static bool showWarnings_;
+  static bool printErrors_;
+
+protected:
+
+  std::ostringstream errorString_;
+
+  //! Default constructor.
+  Stk(void);
+
+  //! Class destructor.
+  virtual ~Stk(void);
+
+  //! Internal function for error reporting which assumes message in \c errorString_ variable.
+  void handleError( StkError::Type type );
+};
+
+
+/***************************************************/
+/*! \class StkFrames
+    \brief An STK class to handle vectorized audio data.
+
+    This class can hold single- or multi-channel audio data in either
+    interleaved or non-interleaved formats.  The data type is always
+    StkFloat.  In an effort to maintain efficiency, no out-of-bounds
+    checks are performed in this class.
+
+    Possible future improvements in this class could include functions
+    to inter- or de-interleave the data and to convert to and return
+    other data types.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+class StkFrames
+{
+public:
+
+  //! The default constructor initializes the frame data structure to size zero.
+  StkFrames( unsigned int nFrames = 0, unsigned int nChannels = 0, bool interleaved = true );
+
+  //! Overloaded constructor that initializes the frame data to the specified size with \c value.
+  StkFrames( const StkFloat& value, unsigned int nFrames, unsigned int nChannels, bool interleaved = true );
+
+  //! The destructor.
+  ~StkFrames();
+
+  //! Subscript operator which returns a reference to element \c n of self.
+  /*!
+    The result can be used as an lvalue . This reference is valid
+    until the resize function is called or the array is destroyed. The
+    index \c n must be between 0 and size less one.  No range checking
+    is performed unless _STK_DEBUG_ is defined.
+  */
+  StkFloat& operator[] ( size_t n );
+
+  //! Subscript operator that returns the value at element \c n of self.
+  /*!
+    The index \c n must be between 0 and size less one.  No range
+    checking is performed unless _STK_DEBUG_ is defined.
+  */
+  StkFloat operator[] ( size_t n ) const;
+
+  //! Channel / frame subscript operator that returns a reference.
+  /*!
+    The result can be used as an lvalue. This reference is valid
+    until the resize function is called or the array is destroyed. The
+    \c frame index must be between 0 and frames() - 1.  The \c channel
+    index must be between 0 and channels() - 1.  No range checking is
+    performed unless _STK_DEBUG_ is defined.
+  */
+  StkFloat& operator() ( size_t frame, unsigned int channel );
+
+  //! Channel / frame subscript operator that returns a value.
+  /*!
+    The \c frame index must be between 0 and frames() - 1.  The \c
+    channel index must be between 0 and channels() - 1.  No range checking
+    is performed unless _STK_DEBUG_ is defined.
+  */
+  StkFloat operator() ( size_t frame, unsigned int channel ) const;
+
+  //! Return an interpolated value at the fractional frame index and channel.
+  /*!
+    This function performs linear interpolation.  The \c frame
+    index must be between 0.0 and frames() - 1.  The \c channel index
+    must be between 0 and channels() - 1.  No range checking is
+    performed unless _STK_DEBUG_ is defined.
+  */
+  StkFloat interpolate( StkFloat frame, unsigned int channel = 0 ) const;
+
+  //! Returns the total number of audio samples represented by the object.
+  size_t size() const { return size_; }; 
+
+  //! Returns \e true if the object size is zero and \e false otherwise.
+  bool empty() const;
+
+  //! Resize self to represent the specified number of channels and frames.
+  /*!
+    Changes the size of self based on the number of frames and
+    channels.  No element assignment is performed.  No memory
+    deallocation occurs if the new size is smaller than the previous
+    size.  Further, no new memory is allocated when the new size is
+    smaller or equal to a previously allocated size.
+  */
+  void resize( size_t nFrames, unsigned int nChannels = 1 );
+
+  //! Resize self to represent the specified number of channels and frames and perform element initialization.
+  /*!
+    Changes the size of self based on the number of frames and
+    channels, and assigns \c value to every element.  No memory
+    deallocation occurs if the new size is smaller than the previous
+    size.  Further, no new memory is allocated when the new size is
+    smaller or equal to a previously allocated size.
+  */
+  void resize( size_t nFrames, unsigned int nChannels, StkFloat value );
+
+  //! Return the number of channels represented by the data.
+  unsigned int channels( void ) const { return nChannels_; };
+
+  //! Return the number of sample frames represented by the data.
+  unsigned int frames( void ) const { return nFrames_; };
+
+  //! Set the sample rate associated with the StkFrames data.
+  /*!
+    By default, this value is set equal to the current STK sample
+    rate at the time of instantiation.
+   */
+  void setDataRate( StkFloat rate ) { dataRate_ = rate; };
+
+  //! Return the sample rate associated with the StkFrames data.
+  /*!
+    By default, this value is set equal to the current STK sample
+    rate at the time of instantiation.
+   */
+  StkFloat dataRate( void ) const { return dataRate_; };
+
+  //! Returns \c true if the data is in interleaved format, \c false if the data is non-interleaved.
+  bool interleaved( void ) const { return interleaved_; };
+
+  //! Set the flag to indicate whether the internal data is in interleaved (\c true) or non-interleaved (\c false) format.
+  /*!
+    Note that this function does not modify the internal data order
+    with respect to the argument value.  It simply changes the
+    indicator flag value.
+   */
+  void setInterleaved( bool isInterleaved ) { interleaved_ = isInterleaved; };
+
+private:
+
+  StkFloat *data_;
+  StkFloat dataRate_;
+  size_t nFrames_;
+  unsigned int nChannels_;
+  size_t size_;
+  size_t bufferSize_;
+  bool interleaved_;
+
+};
+
+
+// Here are a few other useful typedefs.
+typedef unsigned short UINT16;
+typedef unsigned int UINT32;
+typedef signed short SINT16;
+typedef signed int SINT32;
+typedef float FLOAT32;
+typedef double FLOAT64;
+
+// The default sampling rate.
+const StkFloat SRATE = 44100.0;
+
+// The default real-time audio input and output buffer size.  If
+// clicks are occuring in the input and/or output sound stream, a
+// larger buffer size may help.  Larger buffer sizes, however, produce
+// more latency.
+const unsigned int RT_BUFFER_SIZE = 512;
+
+// The default rawwave path value is set with the preprocessor
+// definition RAWWAVE_PATH.  This can be specified as an argument to
+// the configure script, in an integrated development environment, or
+// below.  The global STK rawwave path variable can be dynamically set
+// with the Stk::setRawwavePath() function.  This value is
+// concatenated to the beginning of all references to rawwave files in
+// the various STK core classes (ex. Clarinet.cpp).  If you wish to
+// move the rawwaves directory to a different location in your file
+// system, you will need to set this path definition appropriately.
+#if !defined(RAWWAVE_PATH)
+  #define RAWWAVE_PATH "../../rawwaves/"
+#endif
+
+const StkFloat PI           = 3.14159265358979;
+const StkFloat TWO_PI       = 2 * PI;
+const StkFloat ONE_OVER_128 = 0.0078125;
+
+#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) || defined(__WINDOWS_MM__)
+  #define __OS_WINDOWS__
+  #define __STK_REALTIME__
+#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) || defined(__LINUX_JACK__)
+  #define __OS_LINUX__
+  #define __STK_REALTIME__
+#elif defined(__IRIX_AL__)
+  #define __OS_IRIX__
+  #define __STK_REALTIME__
+#elif defined(__MACOSX_CORE__)
+  #define __OS_MACOSX__
+  #define __STK_REALTIME__
+#endif
+
+//#define _STK_DEBUG_
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/WaveLoop.h b/lib-src/libnyquist/nyquist/nyqstk/include/WaveLoop.h
new file mode 100644
index 0000000..67d345a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/WaveLoop.h
@@ -0,0 +1,97 @@
+/***************************************************/
+/*! \class WaveLoop
+    \brief STK waveform oscillator class.
+
+    This class inherits from FileWvIn and provides audio file looping
+    functionality.  Any audio file that can be loaded by FileRead can
+    be looped using this class.
+
+    WaveLoop supports multi-channel data.  It is important to
+    distinguish the tick() methods, which return samples produced by
+    averaging across sample frames, from the tickFrame() methods,
+    which return references or pointers to multi-channel sample
+    frames.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_WAVELOOP_H
+#define STK_WAVELOOP_H
+
+#include "FileWvIn.h"
+
+namespace Nyq
+{
+
+class WaveLoop : public FileWvIn
+{
+public:
+  //! Default constructor.
+  WaveLoop( unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
+
+  //! Class constructor that opens a specified file.
+  WaveLoop( std::string fileName, bool raw = false, bool doNormalize = true,
+            unsigned long chunkThreshold = 1000000, unsigned long chunkSize = 1024 );
+
+  //! Class destructor.
+  virtual ~WaveLoop();
+
+  //! Open the specified file and load its data.
+  /*!
+    Data from a previously opened file will be overwritten by this
+    function.  An StkError will be thrown if the file is not found,
+    its format is unknown, or a read error occurs.  If the file data
+    is to be loaded incrementally from disk and normalization is
+    specified, a scaling will be applied with respect to fixed-point
+    limits.  If the data format is floating-point, no scaling is
+    performed.
+  */
+  void openFile( std::string fileName, bool raw = false, bool doNormalize = true );
+
+  //! Set the data read rate in samples.  The rate can be negative.
+  /*!
+    If the rate value is negative, the data is read in reverse order.
+  */
+  void setRate( StkFloat rate );
+
+  //! Set the data interpolation rate based on a looping frequency.
+  /*!
+    This function determines the interpolation rate based on the file
+    size and the current Stk::sampleRate.  The \e frequency value
+    corresponds to file cycles per second.  The frequency can be
+    negative, in which case the loop is read in reverse order.
+   */
+  void setFrequency( StkFloat frequency );
+
+  //! Increment the read pointer by \e time samples, modulo file size.
+  void addTime( StkFloat time );
+
+  //! Increment current read pointer by \e angle, relative to a looping frequency.
+  /*!
+    This function increments the read pointer based on the file
+    size and the current Stk::sampleRate.  The \e anAngle value
+    is a multiple of file size.
+   */
+  void addPhase( StkFloat angle );
+
+  //! Add a phase offset to the current read pointer.
+  /*!
+    This function determines a time offset based on the file
+    size and the current Stk::sampleRate.  The \e angle value
+    is a multiple of file size.
+   */
+  void addPhaseOffset( StkFloat angle );
+
+protected:
+
+  virtual void computeFrame( void );
+
+  StkFrames firstFrame_;
+  StkFloat phaseOffset_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/WvIn.h b/lib-src/libnyquist/nyquist/nyqstk/include/WvIn.h
new file mode 100644
index 0000000..a4ee60b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/include/WvIn.h
@@ -0,0 +1,92 @@
+/***************************************************/
+/*! \class WvIn
+    \brief STK audio input abstract base class.
+
+    This class provides common functionality for a variety of audio
+    data input subclasses.
+
+    WvIn supports multi-channel data.  It is important to distinguish
+    the tick() methods, which return samples produced by averaging
+    across sample frames, from the tickFrame() methods, which return
+    references or pointers to multi-channel sample frames.
+
+    Both interleaved and non-interleaved data is supported via the use
+    of StkFrames objects.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#ifndef STK_WVIN_H
+#define STK_WVIN_H
+
+#include "Stk.h"
+#include <vector>
+
+namespace Nyq
+{
+
+class WvIn : public Stk
+{
+public:
+  //! Default constructor.
+  WvIn();
+
+  //! Class destructor.
+  virtual ~WvIn();
+
+  //! Return the number of audio channels in the data.
+  unsigned int getChannels( void ) const { return data_.channels(); };
+
+  //! Return the average across the last output sample frame.
+  /*!
+    If no file data is loaded, the returned value is 0.0.
+  */
+  StkFloat lastOut( void ) const;
+
+  //! Return an StkFrames reference to the last output sample frame.
+  /*!
+    If no file data is loaded, an empty container is returned.
+   */
+  const StkFrames& lastFrame( void ) const { return lastOutputs_; };
+
+  //! Read out the average across one sample frame of data.
+  /*!
+    If no file data is loaded, the returned value is 0.0.
+  */
+  StkFloat tick( void );
+
+  //! Fill a channel of the StkFrames object with averaged sample frames.
+  /*!
+    The \c channel argument should be zero or greater (the first
+    channel is specified by 0).  An StkError will be thrown if the \c
+    channel argument is greater than or equal to the number of
+    channels in the StkFrames object.  If no file data is loaded, the
+    container is filled with zeroes.
+  */
+  StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
+
+  //! Fill the StkFrames argument with data and return the same reference.
+  /*!
+    An StkError will be thrown if there is an incompatability
+    between the number of channels in the loaded data and that in the
+    StkFrames argument.  If no file data is loaded, the container is
+    filled with zeroes.
+  */
+  StkFrames& tickFrame( StkFrames& frames );
+
+protected:
+
+  // This abstract function must be implemented in all subclasses.
+  // It is used to get around a C++ problem with overloaded virtual
+  // functions.
+  virtual void computeFrame( void ) = 0;
+
+  StkFrames data_;
+  StkFrames lastOutputs_;
+
+};
+
+} // namespace Nyq
+
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/instr.cpp b/lib-src/libnyquist/nyquist/nyqstk/instr.cpp
new file mode 100644
index 0000000..e39567a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/instr.cpp
@@ -0,0 +1,104 @@
+#include "instr.h"
+#include "Instrmnt.h"
+#include "Clarinet.h"
+#include "Saxofony.h"
+#include "Bowed.h"
+#include "BandedWG.h"
+#include "Mandolin.h" 
+#include "Sitar.h"
+#include "ModalBar.h"
+#include "Flute.h"
+#include "stdlib.h"
+#include "string.h"
+
+using namespace Nyq;
+
+/* C interface to Instrmnt */
+
+struct instr {
+	Instrmnt *instrObjPtr;
+};
+
+
+
+struct instr *initInstrument(int instr_type, int sample_rate) {
+	struct instr *in = (struct instr *) malloc(sizeof(struct instr));
+        Stk::setSampleRate(sample_rate);
+	switch(instr_type) {
+		case CLARINET: 
+			in->instrObjPtr = new Clarinet(10.0);
+			break;
+		case SAXOFONY:
+			in->instrObjPtr = new Saxofony(10.0);
+			break;
+	        case BOWED:
+		  in->instrObjPtr = new Bowed(10.0);
+		  break;
+	        case BANDEDWG:
+		  in->instrObjPtr = new BandedWG();
+		  break;
+		case MANDOLIN:
+		  in->instrObjPtr = new Mandolin(10.0);
+		  break;
+        	case SITAR:
+		  in->instrObjPtr = new Sitar(10.0);
+		  break;
+	        case MODALBAR:
+		  in->instrObjPtr = new ModalBar();
+		  break;
+	        case FLUTE:
+		  in->instrObjPtr = new Flute(10.0);
+		  break;
+		default:
+			return NULL;
+	}
+	return in;
+}
+
+int deleteInstrument(struct instr* in) {
+	delete(in->instrObjPtr);
+	free(in);
+	return 0;
+}
+
+//! Start a note with the given frequency and amplitude.
+int noteOn(struct instr* in, ::MY_FLOAT frequency, ::MY_FLOAT amplitude) {
+	in->instrObjPtr->noteOn(frequency, amplitude);
+	return 0;
+}
+
+//! Stop a note with the given amplitude (speed of decay).
+int noteOff(struct instr* in, ::MY_FLOAT amplitude) {
+	in->instrObjPtr->noteOff(amplitude);
+	return 0;
+}
+
+//! Set instrument parameters for a particular frequency.
+int setFrequency(struct instr* in, ::MY_FLOAT frequency) {
+	in->instrObjPtr->setFrequency(frequency);
+	return 0;
+}
+
+//! Return the last output value.
+/*
+MY_FLOAT lastOut(struct instr* in) {
+	return in->instrObjPtr->lastOut();
+}
+*/
+
+//! Compute one output sample.
+::MY_FLOAT tick(struct instr* in) {
+	return in->instrObjPtr->tick();
+}
+
+// DELETED THIS. PJM
+//! Computer \e vectorSize outputs and return them in \e vector.
+//MY_FLOAT *multTicks(struct instr* in, MY_FLOAT *vector, unsigned int vectorSize) {
+//	return in->instrObjPtr->tick(vector, vectorSize);
+//}
+
+//! Perform the control change specified by \e number and \e value (0.0 - 128.0).
+int controlChange(struct instr* in, int number, ::MY_FLOAT value) {
+	in->instrObjPtr->controlChange(number, value);
+	return 0;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/instr.h b/lib-src/libnyquist/nyquist/nyqstk/instr.h
new file mode 100644
index 0000000..71df55c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/instr.h
@@ -0,0 +1,54 @@
+#ifndef _INSTR_H
+#define _INSTR_H
+
+#include "globals.h"
+
+/* C interface to Instrmnt */
+
+/* Instrument types */
+#define CLARINET	0
+#define SAXOFONY	1
+#define BOWED           2
+#define BANDEDWG        3
+#define MANDOLIN        4
+#define SITAR           5
+#define MODALBAR        6
+#define FLUTE           7
+
+
+
+struct instr;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct stkgen *initStkGen();
+int deleteStkGen(struct stkgen *);
+MY_FLOAT gentick(struct stkgen *);
+
+void setrawwavepath(char *);
+struct instr *initInstrument(int instr_type, int sample_rate);
+
+int deleteInstrument(struct instr* in);
+
+int noteOn(struct instr* in, MY_FLOAT frequency, MY_FLOAT amplitude);
+
+int noteOff(struct instr* in, MY_FLOAT amplitude);
+
+int setFrequency(struct instr* in, MY_FLOAT frequency);
+
+//MY_FLOAT lastOut(struct instr* in);
+
+MY_FLOAT tick(struct instr* in);
+
+//MY_FLOAT *multTicks(struct instr* in, MY_FLOAT *vector, unsigned int vectorSize);
+
+int controlChange(struct instr* in, int number, MY_FLOAT value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/ADSR.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/ADSR.cpp
new file mode 100644
index 0000000..2b7dd92
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/ADSR.cpp
@@ -0,0 +1,191 @@
+/***************************************************/
+/*! \class ADSR
+    \brief STK ADSR envelope class.
+
+    This Envelope subclass implements a
+    traditional ADSR (Attack, Decay,
+    Sustain, Release) envelope.  It
+    responds to simple keyOn and keyOff
+    messages, keeping track of its state.
+    The \e state = ADSR::DONE after the
+    envelope value reaches 0.0 in the
+    ADSR::RELEASE state.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "ADSR.h"
+
+using namespace Nyq;
+
+ADSR :: ADSR() : Envelope()
+{
+  target_ = 0.0;
+  value_ = 0.0;
+  attackRate_ = 0.001;
+  decayRate_ = 0.001;
+  sustainLevel_ = 0.5;
+  releaseRate_ = 0.01;
+  state_ = ATTACK;
+}
+
+ADSR :: ~ADSR()
+{
+}
+
+void ADSR :: keyOn()
+{
+  target_ = 1.0;
+  rate_ = attackRate_;
+  state_ = ATTACK;
+}
+
+void ADSR :: keyOff()
+{
+  target_ = 0.0;
+  rate_ = releaseRate_;
+  state_ = RELEASE;
+}
+
+void ADSR :: setAttackRate(StkFloat rate)
+{
+  if (rate < 0.0) {
+    errorString_ << "ADSR::setAttackRate: negative rates not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    attackRate_ = -rate;
+  }
+  else attackRate_ = rate;
+}
+
+void ADSR :: setDecayRate(StkFloat rate)
+{
+  if (rate < 0.0) {
+    errorString_ << "ADSR::setDecayRate: negative rates not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    decayRate_ = -rate;
+  }
+  else decayRate_ = rate;
+}
+
+void ADSR :: setSustainLevel(StkFloat level)
+{
+  if (level < 0.0 ) {
+    errorString_ << "ADSR::setSustainLevel: level out of range ... correcting!";
+    handleError( StkError::WARNING );
+    sustainLevel_ = 0.0;
+  }
+  else sustainLevel_ = level;
+}
+
+void ADSR :: setReleaseRate(StkFloat rate)
+{
+  if (rate < 0.0) {
+    errorString_ << "ADSR::setReleaseRate: negative rates not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    releaseRate_ = -rate;
+  }
+  else releaseRate_ = rate;
+}
+
+void ADSR :: setAttackTime(StkFloat time)
+{
+  if (time < 0.0) {
+    errorString_ << "ADSR::setAttackTime: negative times not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    attackRate_ = 1.0 / ( -time * Stk::sampleRate() );
+  }
+  else attackRate_ = 1.0 / ( time * Stk::sampleRate() );
+}
+
+void ADSR :: setDecayTime(StkFloat time)
+{
+  if (time < 0.0) {
+    errorString_ << "ADSR::setDecayTime: negative times not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    decayRate_ = 1.0 / ( -time * Stk::sampleRate() );
+  }
+  else decayRate_ = 1.0 / ( time * Stk::sampleRate() );
+}
+
+void ADSR :: setReleaseTime(StkFloat time)
+{
+  if (time < 0.0) {
+    errorString_ << "ADSR::setReleaseTime: negative times not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    releaseRate_ = sustainLevel_ / ( -time * Stk::sampleRate() );
+  }
+  else releaseRate_ = sustainLevel_ / ( time * Stk::sampleRate() );
+}
+
+void ADSR :: setAllTimes(StkFloat aTime, StkFloat dTime, StkFloat sLevel, StkFloat rTime)
+{
+  this->setAttackTime(aTime);
+  this->setDecayTime(dTime);
+  this->setSustainLevel(sLevel);
+  this->setReleaseTime(rTime);
+}
+
+void ADSR :: setTarget(StkFloat target)
+{
+  target_ = target;
+  if (value_ < target_) {
+    state_ = ATTACK;
+    this->setSustainLevel(target_);
+    rate_ = attackRate_;
+  }
+  if (value_ > target_) {
+    this->setSustainLevel(target_);
+    state_ = DECAY;
+    rate_ = decayRate_;
+  }
+}
+
+void ADSR :: setValue(StkFloat value)
+{
+  state_ = SUSTAIN;
+  target_ = value;
+  value_ = value;
+  this->setSustainLevel(value);
+  rate_ = (StkFloat)  0.0;
+}
+
+int ADSR :: getState(void) const
+{
+  return state_;
+}
+
+StkFloat ADSR :: computeSample()
+{
+  switch (state_) {
+
+  case ATTACK:
+    value_ += rate_;
+    if (value_ >= target_) {
+      value_ = target_;
+      rate_ = decayRate_;
+      target_ = sustainLevel_;
+	    state_ = DECAY;
+    }
+    break;
+
+  case DECAY:
+    value_ -= decayRate_;
+    if (value_ <= sustainLevel_) {
+      value_ = sustainLevel_;
+      rate_ = (StkFloat) 0.0;
+      state_ = SUSTAIN;
+    }
+    break;
+
+  case RELEASE:
+    value_ -= releaseRate_;
+    if (value_ <= 0.0)       {
+      value_ = (StkFloat) 0.0;
+      state_ = DONE;
+    }
+  }
+
+  lastOutput_ = value_;
+  return value_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/BandedWG.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/BandedWG.cpp
new file mode 100644
index 0000000..05a72fa
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/BandedWG.cpp
@@ -0,0 +1,380 @@
+/***************************************************/
+/*! \class BandedWG
+    \brief Banded waveguide modeling class.
+
+    This class uses banded waveguide techniques to
+    model a variety of sounds, including bowed
+    bars, glasses, and bowls.  For more
+    information, see Essl, G. and Cook, P. "Banded
+    Waveguides: Towards Physical Modelling of Bar
+    Percussion Instruments", Proceedings of the
+    1999 International Computer Music Conference.
+
+    Control Change Numbers: 
+       - Bow Pressure = 2
+       - Bow Motion = 4
+       - Strike Position = 8 (not implemented)
+       - Vibrato Frequency = 11
+       - Gain = 1
+       - Bow Velocity = 128
+       - Set Striking = 64
+       - Instrument Presets = 16
+         - Uniform Bar = 0
+         - Tuned Bar = 1
+         - Glass Harmonica = 2
+         - Tibetan Bowl = 3
+
+    by Georg Essl, 1999 - 2004.
+    Modified for Stk 4.0 by Gary Scavone.
+*/
+/***************************************************/
+
+#include "BandedWG.h"
+#include "SKINI.msg"
+#include <cmath>
+
+using namespace Nyq;
+
+BandedWG :: BandedWG()
+{
+  doPluck_ = true;
+
+  bowTable_.setSlope( 3.0 );
+  adsr_.setAllTimes( 0.02, 0.005, 0.9, 0.01);
+
+  frequency_ = 220.0;
+  this->setPreset(0);
+
+  bowPosition_ = 0;
+  baseGain_ = (StkFloat) 0.999;
+  
+  integrationConstant_ = 0.0;
+  trackVelocity_ = false;
+
+  bowVelocity_ = 0.0;
+  bowTarget_ = 0.0;
+
+  strikeAmp_ = 0.0;
+}
+
+BandedWG :: ~BandedWG()
+{
+}
+
+void BandedWG :: clear()
+{
+  for (int i=0; i<nModes_; i++) {
+    delay_[i].clear();
+    bandpass_[i].clear();
+  }
+}
+
+void BandedWG :: setPreset(int preset)
+{
+  int i;
+  switch (preset){
+
+  case 1: // Tuned Bar
+    presetModes_ = 4;
+    modes_[0] = (StkFloat) 1.0;
+    modes_[1] = (StkFloat) 4.0198391420;
+    modes_[2] = (StkFloat) 10.7184986595;
+    modes_[3] = (StkFloat) 18.0697050938;
+
+    for (i=0; i<presetModes_; i++) {
+      basegains_[i] = (StkFloat) pow(0.999,(double) i+1);
+      excitation_[i] = 1.0;
+    }
+
+    break;
+
+  case 2: // Glass Harmonica
+    presetModes_ = 5;
+    modes_[0] = (StkFloat) 1.0;
+    modes_[1] = (StkFloat) 2.32;
+    modes_[2] = (StkFloat) 4.25;
+    modes_[3] = (StkFloat) 6.63;
+    modes_[4] = (StkFloat) 9.38;
+    // modes_[5] = (StkFloat) 12.22;
+
+    for (i=0; i<presetModes_; i++) {
+      basegains_[i] = (StkFloat) pow(0.999,(double) i+1);
+      excitation_[i] = 1.0;
+    }
+    /*
+      baseGain_ = (StkFloat) 0.99999;
+      for (i=0; i<presetModes_; i++) 
+      gains_[i]= (StkFloat) pow(baseGain_, delay_[i].getDelay()+i);
+    */
+
+    break;
+   
+  case 3: // Tibetan Prayer Bowl (ICMC'02)
+    presetModes_ = 12;
+    modes_[0]=0.996108344;
+    basegains_[0]=0.999925960128219;
+    excitation_[0]=11.900357/10.0;
+    modes_[1]=1.0038916562;
+    basegains_[1]=0.999925960128219;
+    excitation_[1]=11.900357/10.;
+    modes_[2]=2.979178;
+    basegains_[2]=0.999982774366897;
+    excitation_[2]=10.914886/10.;
+    modes_[3]=2.99329767;
+    basegains_[3]=0.999982774366897;
+    excitation_[3]=10.914886/10.;
+    modes_[4]=5.704452;
+    basegains_[4]=1.0; //0.999999999999999999987356406352;
+    excitation_[4]=42.995041/10.;
+    modes_[5]=5.704452;
+    basegains_[5]=1.0; //0.999999999999999999987356406352;
+    excitation_[5]=42.995041/10.;
+    modes_[6]=8.9982;
+    basegains_[6]=1.0; //0.999999999999999999996995497558225;
+    excitation_[6]=40.063034/10.;
+    modes_[7]=9.01549726;
+    basegains_[7]=1.0; //0.999999999999999999996995497558225;
+    excitation_[7]=40.063034/10.;
+    modes_[8]=12.83303;
+    basegains_[8]=0.999965497558225;
+    excitation_[8]=7.063034/10.;
+    modes_[9]=12.807382;
+    basegains_[9]=0.999965497558225;
+    excitation_[9]=7.063034/10.;
+    modes_[10]=17.2808219;
+    basegains_[10]=0.9999999999999999999965497558225;
+    excitation_[10]=57.063034/10.;
+    modes_[11]=21.97602739726;
+    basegains_[11]=0.999999999999999965497558225;
+    excitation_[11]=57.063034/10.;
+
+    break;	
+
+  default: // Uniform Bar
+    presetModes_ = 4;
+    modes_[0] = (StkFloat) 1.0;
+    modes_[1] = (StkFloat) 2.756;
+    modes_[2] = (StkFloat) 5.404;
+    modes_[3] = (StkFloat) 8.933;
+
+    for (i=0; i<presetModes_; i++) {
+      basegains_[i] = (StkFloat) pow(0.9,(double) i+1);
+      excitation_[i] = 1.0;
+    }
+
+    break;
+  }
+
+  nModes_ = presetModes_;
+  setFrequency( frequency_ );
+}
+
+void BandedWG :: setFrequency(StkFloat frequency)
+{
+  frequency_ = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "BandedWG::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    frequency_ = 220.0;
+  }
+  if (frequency_ > 1568.0) frequency_ = 1568.0;
+
+  StkFloat radius;
+  StkFloat base = Stk::sampleRate() / frequency_;
+  StkFloat length;
+  for (int i=0; i<presetModes_; i++) {
+    // Calculate the delay line lengths for each mode.
+    length = (int)(base / modes_[i]);
+    if ( length > 2.0) {
+      delay_[i].setDelay( length );
+      gains_[i]=basegains_[i];
+      //	  gains_[i]=(StkFloat) pow(basegains_[i], 1/((StkFloat)delay_[i].getDelay()));
+      //	  std::cerr << gains_[i];
+    }
+    else	{
+      nModes_ = i;
+      break;
+    }
+    //	std::cerr << std::endl;
+
+    // Set the bandpass filter resonances
+    radius = 1.0 - PI * 32 / Stk::sampleRate(); //frequency_ * modes_[i] / Stk::sampleRate()/32;
+    if ( radius < 0.0 ) radius = 0.0;
+    bandpass_[i].setResonance(frequency_ * modes_[i], radius, true);
+
+    delay_[i].clear();
+    bandpass_[i].clear();
+  }
+
+  //int olen = (int)(delay_[0].getDelay());
+  //strikePosition_ = (int)(strikePosition_*(length/modes_[0])/olen);
+}
+
+void BandedWG :: setStrikePosition(StkFloat position)
+{
+  strikePosition_ = (int)(delay_[0].getDelay() * position / 2.0);
+}
+
+void BandedWG :: startBowing(StkFloat amplitude, StkFloat rate)
+{
+  adsr_.setRate(rate);
+  adsr_.keyOn();
+  maxVelocity_ = 0.03 + (0.1 * amplitude); 
+}
+
+void BandedWG :: stopBowing(StkFloat rate)
+{
+  adsr_.setRate(rate);
+  adsr_.keyOff();
+}
+
+void BandedWG :: pluck(StkFloat amplitude)
+{
+  int j;
+  StkFloat min_len = delay_[nModes_-1].getDelay();
+  for (int i=0; i<nModes_; i++)
+    for(j=0; j<(int)(delay_[i].getDelay()/min_len); j++)
+      delay_[i].tick( excitation_[i]*amplitude / nModes_ );
+
+  //	strikeAmp_ += amplitude;
+}
+
+void BandedWG :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency(frequency);
+
+  if ( doPluck_ )
+    this->pluck(amplitude);
+  else
+    this->startBowing(amplitude, amplitude * 0.001);
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "BandedWG::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void BandedWG :: noteOff(StkFloat amplitude)
+{
+  if ( !doPluck_ )
+    this->stopBowing((1.0 - amplitude) * 0.005);
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "BandedWG::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+StkFloat BandedWG :: computeSample()
+{
+  int k;
+
+  StkFloat input = 0.0;
+  if ( doPluck_ ) {
+    input = 0.0;
+    //  input = strikeAmp_/nModes_;
+    //  strikeAmp_ = 0.0;
+  }
+  else {
+    if (integrationConstant_ == 0.0)
+      velocityInput_ = 0.0;
+    else
+      velocityInput_ = integrationConstant_ * velocityInput_;
+
+    for (k=0; k<nModes_; k++)
+      velocityInput_ += baseGain_ * delay_[k].lastOut();
+      
+    if ( trackVelocity_ )  {
+      bowVelocity_ *= 0.9995;
+      bowVelocity_ += bowTarget_;
+      bowTarget_ *= 0.995;
+    }
+    else
+      bowVelocity_ = adsr_.tick() * maxVelocity_;
+
+    input = bowVelocity_ - velocityInput_;
+    input = input * bowTable_.tick(input);
+    input = input/(StkFloat)nModes_;
+  }
+
+  StkFloat data = 0.0;  
+  for (k=0; k<nModes_; k++) {
+    bandpass_[k].tick(input + gains_[k] * delay_[k].lastOut());
+    delay_[k].tick(bandpass_[k].lastOut());
+    data += bandpass_[k].lastOut();
+  }
+  
+  //lastOutput = data * nModes_;
+  lastOutput_ = data * 4;
+  return lastOutput_;
+}
+
+void BandedWG :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "BandedWG::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "BandedWG::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_BowPressure_) { // 2
+    if ( norm == 0.0 )
+      doPluck_ = true;
+    else {
+      doPluck_ = false;
+      bowTable_.setSlope( 10.0 - (9.0 * norm));
+    }
+  }
+  else if (number == 4)	{ // 4
+    if ( !trackVelocity_ ) trackVelocity_ = true;
+    bowTarget_ += 0.005 * (norm - bowPosition_);
+    bowPosition_ = norm;
+    //adsr_.setTarget(bowPosition_);
+  }
+  else if (number == 8) // 8
+    this->setStrikePosition( norm );
+  else if (number == __SK_AfterTouch_Cont_) { // 128
+    //bowTarget_ += 0.02 * (norm - bowPosition_);
+    //bowPosition_ = norm;
+    if ( trackVelocity_ ) trackVelocity_ = false;
+    maxVelocity_ = 0.13 * norm; 
+    adsr_.setTarget(norm);
+  }      
+  else if (number == __SK_ModWheel_) { // 1
+    //    baseGain_ = 0.9989999999 + (0.001 * norm );
+	  baseGain_ = 0.8999999999999999 + (0.1 * norm);
+    //	std::cerr << "Yuck!" << std::endl;
+    for (int i=0; i<nModes_; i++)
+      gains_[i]=(StkFloat) basegains_[i]*baseGain_;
+    //      gains_[i]=(StkFloat) pow(baseGain_, (int)((StkFloat)delay_[i].getDelay()+i));
+  }
+  else if (number == __SK_ModFrequency_) // 11
+    integrationConstant_ = norm;
+  else if (number == __SK_Sustain_)	{ // 64
+    if (value < 65) doPluck_ = true;
+    else doPluck_ = false;
+  }
+  else if (number == __SK_Portamento_)	{ // 65
+    if (value < 65) trackVelocity_ = false;
+    else trackVelocity_ = true;
+  }
+  else if (number == __SK_ProphesyRibbon_) // 16
+    this->setPreset((int) value);  
+  else {
+    errorString_ << "BandedWG::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "BandedWG::controlChange: number = " << number << ", value = " << value << ".";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/BiQuad.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/BiQuad.cpp
new file mode 100644
index 0000000..7434f4b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/BiQuad.cpp
@@ -0,0 +1,126 @@
+/***************************************************/
+/*! \class BiQuad
+    \brief STK biquad (two-pole, two-zero) filter class.
+
+    This protected Filter subclass implements a
+    two-pole, two-zero digital filter.  A method
+    is provided for creating a resonance in the
+    frequency response while maintaining a constant
+    filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "BiQuad.h"
+#include <cmath>
+
+using namespace Nyq;
+
+BiQuad :: BiQuad() : Filter()
+{
+  std::vector<StkFloat> b(3, 0.0);
+  std::vector<StkFloat> a(3, 0.0);
+  b[0] = 1.0;
+  a[0] = 1.0;
+  Filter::setCoefficients( b, a );
+}
+
+BiQuad :: ~BiQuad()
+{
+}
+
+void BiQuad :: clear(void)
+{
+  Filter::clear();
+}
+
+void BiQuad :: setB0(StkFloat b0)
+{
+  b_[0] = b0;
+}
+
+void BiQuad :: setB1(StkFloat b1)
+{
+  b_[1] = b1;
+}
+
+void BiQuad :: setB2(StkFloat b2)
+{
+  b_[2] = b2;
+}
+
+void BiQuad :: setA1(StkFloat a1)
+{
+  a_[1] = a1;
+}
+
+void BiQuad :: setA2(StkFloat a2)
+{
+  a_[2] = a2;
+}
+
+void BiQuad :: setResonance(StkFloat frequency, StkFloat radius, bool normalize)
+{
+  a_[2] = radius * radius;
+  a_[1] = -2.0 * radius * cos(TWO_PI * frequency / Stk::sampleRate());
+
+  if ( normalize ) {
+    // Use zeros at +- 1 and normalize the filter peak gain.
+    b_[0] = 0.5 - 0.5 * a_[2];
+    b_[1] = 0.0;
+    b_[2] = -b_[0];
+  }
+}
+
+void BiQuad :: setNotch(StkFloat frequency, StkFloat radius)
+{
+  // This method does not attempt to normalize the filter gain.
+  b_[2] = radius * radius;
+  b_[1] = (StkFloat) -2.0 * radius * cos(TWO_PI * (double) frequency / Stk::sampleRate());
+}
+
+void BiQuad :: setEqualGainZeroes()
+{
+  b_[0] = 1.0;
+  b_[1] = 0.0;
+  b_[2] = -1.0;
+}
+
+void BiQuad :: setGain(StkFloat gain)
+{
+  Filter::setGain(gain);
+}
+
+StkFloat BiQuad :: getGain(void) const
+{
+  return Filter::getGain();
+}
+
+StkFloat BiQuad :: lastOut(void) const
+{
+  return Filter::lastOut();
+}
+
+StkFloat BiQuad :: computeSample( StkFloat input )
+{
+  inputs_[0] = gain_ * input;
+  outputs_[0] = b_[0] * inputs_[0] + b_[1] * inputs_[1] + b_[2] * inputs_[2];
+  outputs_[0] -= a_[2] * outputs_[2] + a_[1] * outputs_[1];
+  inputs_[2] = inputs_[1];
+  inputs_[1] = inputs_[0];
+  outputs_[2] = outputs_[1];
+  outputs_[1] = outputs_[0];
+
+  return outputs_[0];
+}
+
+StkFloat BiQuad :: tick( StkFloat input )
+{
+  return this->computeSample( input );
+}
+
+StkFrames& BiQuad :: tick( StkFrames& frames, unsigned int channel )
+{
+  return Filter::tick( frames, channel );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/BowTable.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/BowTable.cpp
new file mode 100644
index 0000000..69069a4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/BowTable.cpp
@@ -0,0 +1,53 @@
+/***************************************************/
+/*! \class BowTable
+    \brief STK bowed string table class.
+
+    This class implements a simple bowed string
+    non-linear function, as described by Smith (1986).
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "BowTable.h"
+#include <math.h>
+
+using namespace Nyq;
+
+BowTable :: BowTable()
+{
+  offset_ = (StkFloat) 0.0;
+  slope_ = (StkFloat) 0.1;
+}
+
+BowTable :: ~BowTable()
+{
+}
+
+void BowTable :: setOffset(StkFloat offset)
+{
+  offset_ = offset;
+}
+
+void BowTable :: setSlope(StkFloat slope)
+{
+  slope_ = slope;
+}
+
+StkFloat BowTable :: computeSample(StkFloat input)
+{
+  // The input represents differential string vs. bow velocity.
+  StkFloat sample;
+  sample = input + offset_;  // add bias to input
+  sample *= slope_;          // then scale it
+  lastOutput_ = (StkFloat) fabs( (double) sample ) + (StkFloat) 0.75;
+  lastOutput_ = (StkFloat) pow( lastOutput_, (StkFloat) -4.0 );
+
+  // Set minimum friction to 0.0
+  // if (lastOutput < 0.0 ) lastOutput = 0.0;
+  // Set maximum friction to 1.0.
+  if (lastOutput_ > 1.0 ) lastOutput_ = (StkFloat) 1.0;
+
+  return lastOutput_;
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Bowed.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Bowed.cpp
new file mode 100644
index 0000000..29b9c59
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Bowed.cpp
@@ -0,0 +1,189 @@
+/***************************************************/
+/*! \class Bowed
+    \brief STK bowed string instrument class.
+
+    This class implements a bowed string model, a
+    la Smith (1986), after McIntyre, Schumacher,
+    Woodhouse (1983).
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Bow Pressure = 2
+       - Bow Position = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Volume = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Bowed.h"
+#include "SKINI.msg"
+
+using namespace Nyq;
+
+Bowed :: Bowed(StkFloat lowestFrequency)
+{
+  unsigned long length;
+  length = (long) ( Stk::sampleRate() / lowestFrequency + 1 );
+  neckDelay_.setMaximumDelay( length );
+  neckDelay_.setDelay( 100.0 );
+
+  length >>= 1;
+  bridgeDelay_.setMaximumDelay( length );
+  bridgeDelay_.setDelay( 29.0 );
+
+  bowTable_.setSlope(3.0 );
+
+  vibrato_.setFrequency( 6.12723 );
+  vibratoGain_ = 0.0;
+
+  stringFilter_.setPole( 0.6 - (0.1 * 22050.0 / Stk::sampleRate()) );
+  stringFilter_.setGain( 0.95 );
+
+  bodyFilter_.setResonance( 500.0, 0.85, true );
+  bodyFilter_.setGain( 0.2 );
+
+  adsr_.setAllTimes( 0.02, 0.005, 0.9, 0.01 );
+    
+  betaRatio_ = 0.127236;
+
+  // Necessary to initialize internal variables.
+  this->setFrequency( 220.0 );
+}
+
+Bowed :: ~Bowed()
+{
+}
+
+void Bowed :: clear()
+{
+  neckDelay_.clear();
+  bridgeDelay_.clear();
+}
+
+void Bowed :: setFrequency(StkFloat frequency)
+{
+  StkFloat freakency = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "Bowed::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    freakency = 220.0;
+  }
+
+  // Delay = length - approximate filter delay.
+  baseDelay_ = Stk::sampleRate() / freakency - 4.0;
+  if ( baseDelay_ <= 0.0 ) baseDelay_ = 0.3;
+  bridgeDelay_.setDelay( baseDelay_ * betaRatio_ ); 	     // bow to bridge length
+  neckDelay_.setDelay( baseDelay_ * (1.0 - betaRatio_) );  // bow to nut (finger) length
+}
+
+void Bowed :: startBowing(StkFloat amplitude, StkFloat rate)
+{
+  adsr_.setRate( rate );
+  adsr_.keyOn();
+  maxVelocity_ = 0.03 + ( 0.2 * amplitude ); 
+}
+
+void Bowed :: stopBowing(StkFloat rate)
+{
+  adsr_.setRate( rate );
+  adsr_.keyOff();
+}
+
+void Bowed :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->startBowing( amplitude, amplitude * 0.001 );
+  this->setFrequency( frequency );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Bowed::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Bowed :: noteOff(StkFloat amplitude)
+{
+  this->stopBowing( (1.0 - amplitude) * 0.005 );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Bowed::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Bowed :: setVibrato(StkFloat gain)
+{
+  vibratoGain_ = gain;
+}
+
+StkFloat Bowed :: computeSample()
+{
+  StkFloat bowVelocity;
+  StkFloat bridgeRefl;
+  StkFloat nutRefl;
+  StkFloat newVel;
+  StkFloat velDiff;
+  StkFloat stringVel;
+    
+  bowVelocity = maxVelocity_ * adsr_.tick();
+
+  bridgeRefl = -stringFilter_.tick( bridgeDelay_.lastOut() );
+  nutRefl = -neckDelay_.lastOut();
+  stringVel = bridgeRefl + nutRefl;               // Sum is String Velocity
+  velDiff = bowVelocity - stringVel;              // Differential Velocity
+  newVel = velDiff * bowTable_.tick( velDiff );   // Non-Linear Bow Function
+  neckDelay_.tick(bridgeRefl + newVel);           // Do string propagations
+  bridgeDelay_.tick(nutRefl + newVel);
+    
+  if ( vibratoGain_ > 0.0 )  {
+    neckDelay_.setDelay( (baseDelay_ * (1.0 - betaRatio_) ) + 
+                         (baseDelay_ * vibratoGain_ * vibrato_.tick()) );
+  }
+
+  lastOutput_ = bodyFilter_.tick( bridgeDelay_.lastOut() );
+
+  return lastOutput_;
+}
+
+void Bowed :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "Bowed::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "Bowed::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_BowPressure_) // 2
+		bowTable_.setSlope( 5.0 - (4.0 * norm) );
+  else if (number == __SK_BowPosition_) { // 4
+		betaRatio_ = 0.027236 + (0.2 * norm);
+    bridgeDelay_.setDelay( baseDelay_ * betaRatio_ );
+    neckDelay_.setDelay( baseDelay_ * (1.0 - betaRatio_) );
+  }
+  else if (number == __SK_ModFrequency_) // 11
+    vibrato_.setFrequency( norm * 12.0 );
+  else if (number == __SK_ModWheel_) // 1
+    vibratoGain_ = ( norm * 0.4 );
+  else if (number == __SK_AfterTouch_Cont_) // 128
+    adsr_.setTarget(norm);
+  else {
+    errorString_ << "Bowed::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "Bowed::controlChange: number = " << number << ", value = " << value << ".";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Chorus.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Chorus.cpp
new file mode 100644
index 0000000..79929ba
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Chorus.cpp
@@ -0,0 +1,63 @@
+/***************************************************/
+/*! \class Chorus
+    \brief STK chorus effect class.
+
+    This class implements a chorus effect.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Chorus.h"
+#include <iostream>
+
+using namespace Nyq;
+
+Chorus :: Chorus(StkFloat baseDelay)
+{
+  delayLine_[0].setMaximumDelay( (unsigned long) (baseDelay * 1.414) + 2);
+  delayLine_[0].setDelay( baseDelay );
+  delayLine_[1].setMaximumDelay( (unsigned long) (baseDelay * 1.414) + 2);
+  delayLine_[1].setDelay( baseDelay );
+  baseLength_ = baseDelay;
+
+  mods_[0].setFrequency(0.2);
+  mods_[1].setFrequency(0.222222);
+  modDepth_ = 0.05;
+  effectMix_ = 0.5;
+  this->clear();
+}
+
+Chorus :: ~Chorus()
+{
+}
+
+void Chorus :: clear()
+{
+  delayLine_[0].clear();
+  delayLine_[1].clear();
+  lastOutput_[0] = 0.0;
+  lastOutput_[1] = 0.0;
+}
+
+void Chorus :: setModDepth(StkFloat depth)
+{
+  modDepth_ = depth;
+}
+
+void Chorus :: setModFrequency(StkFloat frequency)
+{
+  mods_[0].setFrequency(frequency);
+  mods_[1].setFrequency(frequency * 1.1111);
+}
+
+StkFloat Chorus :: computeSample(StkFloat input)
+{
+  delayLine_[0].setDelay( baseLength_ * 0.707 * (1.0 + modDepth_ * mods_[0].tick()) );
+  delayLine_[1].setDelay( baseLength_  * 0.5 *  (1.0 - modDepth_ * mods_[1].tick()) );
+  lastOutput_[0] = input * (1.0 - effectMix_);
+  lastOutput_[0] += effectMix_ * delayLine_[0].tick(input);
+  lastOutput_[1] = input * (1.0 - effectMix_);
+  lastOutput_[1] += effectMix_ * delayLine_[1].tick(input);
+  return Effect::lastOut();
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Clarinet.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Clarinet.cpp
new file mode 100644
index 0000000..7d910cd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Clarinet.cpp
@@ -0,0 +1,162 @@
+/***************************************************/
+/*! \class Clarinet
+    \brief STK clarinet physical model class.
+
+    This class implements a simple clarinet
+    physical model, as discussed by Smith (1986),
+    McIntyre, Schumacher, Woodhouse (1983), and
+    others.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Reed Stiffness = 2
+       - Noise Gain = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Clarinet.h"
+#include "SKINI.msg"
+
+using namespace Nyq;
+
+Clarinet :: Clarinet(StkFloat lowestFrequency)
+{
+  length_ = (long) (Stk::sampleRate() / lowestFrequency + 1);
+  delayLine_.setMaximumDelay( length_ );
+  delayLine_.setDelay( length_ / 2.0 );
+  reedTable_.setOffset((StkFloat) 0.7);
+  reedTable_.setSlope((StkFloat) -0.3);
+
+  vibrato_.setFrequency((StkFloat) 5.735);
+  outputGain_ = (StkFloat) 1.0;
+  noiseGain_ = (StkFloat) 0.2;
+  vibratoGain_ = (StkFloat) 0.1;
+}
+
+Clarinet :: ~Clarinet()
+{
+}
+
+void Clarinet :: clear()
+{
+  delayLine_.clear();
+  filter_.tick((StkFloat) 0.0);
+}
+
+void Clarinet :: setFrequency(StkFloat frequency)
+{
+  StkFloat freakency = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "Clarinet::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    freakency = 220.0;
+  }
+
+  // Delay = length - approximate filter delay.
+  StkFloat delay = (Stk::sampleRate() / freakency) * 0.5 - 1.5;
+  if (delay <= 0.0) delay = 0.3;
+  else if (delay > length_) delay = length_;
+  delayLine_.setDelay(delay);
+}
+
+void Clarinet :: startBlowing(StkFloat amplitude, StkFloat rate)
+{
+  envelope_.setRate(rate);
+  envelope_.setTarget(amplitude); 
+}
+
+void Clarinet :: stopBlowing(StkFloat rate)
+{
+  envelope_.setRate(rate);
+  envelope_.setTarget((StkFloat) 0.0); 
+}
+
+void Clarinet :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency(frequency);
+  this->startBlowing((StkFloat) 0.55 + (amplitude * (StkFloat) 0.30), amplitude * (StkFloat) 0.005);
+  outputGain_ = amplitude + (StkFloat) 0.001;
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Clarinet::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << '.';
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Clarinet :: noteOff(StkFloat amplitude)
+{
+  this->stopBlowing( amplitude * 0.01 );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Clarinet::NoteOff: amplitude = " << amplitude << '.';
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+StkFloat Clarinet :: computeSample()
+{
+  StkFloat pressureDiff;
+  StkFloat breathPressure;
+
+  // Calculate the breath pressure (envelope + noise + vibrato)
+  breathPressure = envelope_.tick(); 
+  breathPressure += breathPressure * noiseGain_ * noise_.tick();
+  breathPressure += breathPressure * vibratoGain_ * vibrato_.tick();
+
+  // Perform commuted loss filtering.
+  pressureDiff = -0.95 * filter_.tick(delayLine_.lastOut());
+
+  // Calculate pressure difference of reflected and mouthpiece pressures.
+  pressureDiff = pressureDiff - breathPressure;
+
+  // Perform non-linear scattering using pressure difference in reed function.
+  lastOutput_ = delayLine_.tick(breathPressure + pressureDiff * reedTable_.tick(pressureDiff));
+
+  // Apply output gain.
+  lastOutput_ *= outputGain_;
+
+  return lastOutput_;
+}
+
+void Clarinet :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "Clarinet::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "Clarinet::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_ReedStiffness_) // 2
+    reedTable_.setSlope((StkFloat) -0.44 + ( (StkFloat) 0.26 * norm ));
+  else if (number == __SK_NoiseLevel_) // 4
+    noiseGain_ = (norm * (StkFloat) 0.4);
+  else if (number == __SK_ModFrequency_) // 11
+    vibrato_.setFrequency((norm * (StkFloat) 12.0));
+  else if (number == __SK_ModWheel_) // 1
+    vibratoGain_ = (norm * (StkFloat) 0.5);
+  else if (number == __SK_AfterTouch_Cont_) // 128
+    envelope_.setValue(norm);
+  else {
+    errorString_ << "Clarinet::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "Clarinet::controlChange: number = " << number << ", value = " << value << '.';
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp
new file mode 100644
index 0000000..b5e3a3f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp
@@ -0,0 +1,197 @@
+/***************************************************/
+/*! \class Delay
+    \brief STK non-interpolating delay line class.
+
+    This protected Filter subclass implements
+    a non-interpolating digital delay-line.
+    A fixed maximum length of 4095 and a delay
+    of zero is set using the default constructor.
+    Alternatively, the delay and maximum length
+    can be set during instantiation with an
+    overloaded constructor.
+    
+    A non-interpolating delay line is typically
+    used in fixed delay-length applications, such
+    as for reverberation.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Delay.h"
+
+using namespace Nyq;
+
+Delay :: Delay() : Filter()
+{
+  // Default maximum delay length set to 4095.
+  inputs_.resize( 4096 );
+  this->clear();
+
+  inPoint_ = 0;
+  outPoint_ = 0;
+  delay_ = 0;
+}
+
+Delay :: Delay(unsigned long delay, unsigned long maxDelay)
+{
+  // Writing before reading allows delays from 0 to length-1. 
+  // If we want to allow a delay of maxDelay, we need a
+  // delay-line of length = maxDelay+1.
+  if ( maxDelay < 1 ) {
+    errorString_ << "Delay::Delay: maxDelay must be > 0!\n";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( delay > maxDelay ) {
+    errorString_ << "Delay::Delay: maxDelay must be > than delay argument!\n";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( maxDelay > inputs_.size()-1 ) {
+    inputs_.resize( maxDelay+1 );
+    this->clear();
+  }
+
+  inPoint_ = 0;
+  this->setDelay( delay );
+}
+
+Delay :: ~Delay()
+{
+}
+
+void Delay :: clear(void)
+{
+  for (unsigned int i=0; i<inputs_.size(); i++)
+    inputs_[i] = 0.0;
+  outputs_[0] = 0.0;
+}
+
+void Delay :: setMaximumDelay(unsigned long delay)
+{
+  if ( delay < inputs_.size() ) return;
+
+  if ( delay < 0 ) {
+    errorString_ << "Delay::setMaximumDelay: argument (" << delay << ") less than zero!\n";
+    handleError( StkError::WARNING );
+    return;
+  }
+  else if (delay < delay_ ) {
+    errorString_ << "Delay::setMaximumDelay: argument (" << delay << ") less than current delay setting (" << delay_ << ")!\n";
+    handleError( StkError::WARNING );
+    return;
+  }
+
+  inputs_.resize( delay + 1 );
+}
+
+void Delay :: setDelay(unsigned long delay)
+{
+  if ( delay > inputs_.size() - 1 ) { // The value is too big.
+    errorString_ << "Delay::setDelay: argument (" << delay << ") too big ... setting to maximum!\n";
+    handleError( StkError::WARNING );
+
+    // Force delay to maximum length.
+    outPoint_ = inPoint_ + 1;
+    if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
+    delay_ = inputs_.size() - 1;
+  }
+  else if ( delay < 0 ) {
+    errorString_ << "Delay::setDelay: argument (" << delay << ") less than zero ... setting to zero!\n";
+    handleError( StkError::WARNING );
+
+    outPoint_ = inPoint_;
+    delay_ = 0;
+  }
+  else { // read chases write
+    if ( inPoint_ >= delay ) outPoint_ = inPoint_ - delay;
+    else outPoint_ = inputs_.size() + inPoint_ - delay;
+    delay_ = delay;
+  }
+}
+
+unsigned long Delay :: getDelay(void) const
+{
+  return (unsigned long) delay_;
+}
+
+StkFloat Delay :: energy(void) const
+{
+  unsigned long i;
+  register StkFloat e = 0;
+  if (inPoint_ >= outPoint_) {
+    for (i=outPoint_; i<inPoint_; i++) {
+      register StkFloat t = inputs_[i];
+      e += t*t;
+    }
+  } else {
+    for (i=outPoint_; i<inputs_.size(); i++) {
+      register StkFloat t = inputs_[i];
+      e += t*t;
+    }
+    for (i=0; i<inPoint_; i++) {
+      register StkFloat t = inputs_[i];
+      e += t*t;
+    }
+  }
+  return e;
+}
+
+StkFloat Delay :: contentsAt(unsigned long tapDelay)
+{
+  unsigned long i = tapDelay;
+  if (i < 1) {
+    errorString_ << "Delay::contentsAt: argument (" << tapDelay << ") too small!";
+    handleError( StkError::WARNING );
+    return 0.0;
+  }
+  else if (i > delay_) {
+    errorString_ << "Delay::contentsAt: argument (" << tapDelay << ") too big!";
+    handleError( StkError::WARNING );
+    return 0.0;
+  }
+
+  long tap = inPoint_ - i;
+  if (tap < 0) // Check for wraparound.
+    tap += inputs_.size();
+
+  return inputs_[tap];
+}
+
+StkFloat Delay :: lastOut(void) const
+{
+  return Filter::lastOut();
+}
+
+StkFloat Delay :: nextOut(void)
+{
+  return inputs_[outPoint_];
+}
+
+StkFloat Delay :: computeSample( StkFloat input )
+{
+  inputs_[inPoint_++] = input;
+
+  // Check for end condition
+  if (inPoint_ == inputs_.size())
+    inPoint_ = 0;
+
+  // Read out next value
+  outputs_[0] = inputs_[outPoint_++];
+
+  if (outPoint_ == inputs_.size())
+    outPoint_ = 0;
+
+  return outputs_[0];
+}
+
+StkFloat Delay :: tick( StkFloat input )
+{
+  return computeSample( input );
+}
+
+StkFrames& Delay :: tick( StkFrames& frames, unsigned int channel )
+{
+  return Filter::tick( frames, channel );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/DelayA.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/DelayA.cpp
new file mode 100644
index 0000000..4bfefa1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/DelayA.cpp
@@ -0,0 +1,145 @@
+/***************************************************/
+/*! \class DelayA
+    \brief STK allpass interpolating delay line class.
+
+    This Delay subclass implements a fractional-length digital
+    delay-line using a first-order allpass filter.  A fixed maximum
+    length of 4095 and a delay of 0.5 is set using the default
+    constructor.  Alternatively, the delay and maximum length can be
+    set during instantiation with an overloaded constructor.
+
+    An allpass filter has unity magnitude gain but variable phase
+    delay properties, making it useful in achieving fractional delays
+    without affecting a signal's frequency magnitude response.  In
+    order to achieve a maximally flat phase delay response, the
+    minimum delay possible in this implementation is limited to a
+    value of 0.5.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "DelayA.h"
+
+using namespace Nyq;
+
+DelayA :: DelayA() : Delay()
+{
+  this->setDelay( 0.5 );
+  apInput_ = 0.0;
+  doNextOut_ = true;
+}
+
+DelayA :: DelayA(StkFloat delay, unsigned long maxDelay)
+{
+  if ( delay < 0.0 || maxDelay < 1 ) {
+    errorString_ << "DelayA::DelayA: delay must be >= 0.0, maxDelay must be > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( delay > (StkFloat) maxDelay ) {
+    errorString_ << "DelayA::DelayA: maxDelay must be > than delay argument!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  // Writing before reading allows delays from 0 to length-1. 
+  if ( maxDelay > inputs_.size()-1 ) {
+    inputs_.resize( maxDelay+1 );
+    this->clear();
+  }
+
+  inPoint_ = 0;
+  this->setDelay(delay);
+  apInput_ = 0.0;
+  doNextOut_ = true;
+}
+
+DelayA :: ~DelayA()
+{
+}
+
+void DelayA :: clear()
+{
+  Delay::clear();
+  apInput_ = 0.0;
+}
+
+void DelayA :: setDelay(StkFloat delay)  
+{
+  StkFloat outPointer;
+  unsigned long length = inputs_.size();
+
+  if ( delay > inputs_.size() - 1 ) { // The value is too big.
+    errorString_ << "DelayA::setDelay: argument (" << delay << ") too big ... setting to maximum!";
+    handleError( StkError::WARNING );
+
+    // Force delay to maxLength
+    outPointer = inPoint_ + 1.0;
+    delay_ = length - 1;
+  }
+  else if (delay < 0.5) {
+    errorString_ << "DelayA::setDelay: argument (" << delay << ") less than 0.5 not possible!";
+    handleError( StkError::WARNING );
+
+    outPointer = inPoint_ + 0.4999999999;
+    delay_ = 0.5;
+  }
+  else {
+    outPointer = inPoint_ - delay + 1.0;     // outPoint chases inpoint
+    delay_ = delay;
+  }
+
+  if (outPointer < 0)
+    outPointer += length;  // modulo maximum length
+
+  outPoint_ = (long) outPointer;         // integer part
+  if ( outPoint_ == length ) outPoint_ = 0;
+  alpha_ = 1.0 + outPoint_ - outPointer; // fractional part
+
+  if (alpha_ < 0.5) {
+    // The optimal range for alpha is about 0.5 - 1.5 in order to
+    // achieve the flattest phase delay response.
+    outPoint_ += 1;
+    if (outPoint_ >= length) outPoint_ -= length;
+    alpha_ += (StkFloat) 1.0;
+  }
+
+  coeff_ = ((StkFloat) 1.0 - alpha_) / 
+    ((StkFloat) 1.0 + alpha_);         // coefficient for all pass
+}
+
+StkFloat DelayA :: getDelay(void) const
+{
+  return delay_;
+}
+
+StkFloat DelayA :: nextOut(void)
+{
+  if ( doNextOut_ ) {
+    // Do allpass interpolation delay.
+    nextOutput_ = -coeff_ * outputs_[0];
+    nextOutput_ += apInput_ + (coeff_ * inputs_[outPoint_]);
+    doNextOut_ = false;
+  }
+
+  return nextOutput_;
+}
+
+StkFloat DelayA :: computeSample( StkFloat input )
+{
+  inputs_[inPoint_++] = input;
+
+  // Increment input pointer modulo length.
+  if (inPoint_ == inputs_.size())
+    inPoint_ = 0;
+
+  outputs_[0] = nextOut();
+  doNextOut_ = true;
+
+  // Save the allpass input and increment modulo length.
+  apInput_ = inputs_[outPoint_++];
+  if (outPoint_ == inputs_.size())
+    outPoint_ = 0;
+
+  return outputs_[0];
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/DelayL.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/DelayL.cpp
new file mode 100644
index 0000000..823526b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/DelayL.cpp
@@ -0,0 +1,132 @@
+/***************************************************/
+/*! \class DelayL
+    \brief STK linear interpolating delay line class.
+
+    This Delay subclass implements a fractional-
+    length digital delay-line using first-order
+    linear interpolation.  A fixed maximum length
+    of 4095 and a delay of zero is set using the
+    default constructor.  Alternatively, the
+    delay and maximum length can be set during
+    instantiation with an overloaded constructor.
+
+    Linear interpolation is an efficient technique
+    for achieving fractional delay lengths, though
+    it does introduce high-frequency signal
+    attenuation to varying degrees depending on the
+    fractional delay setting.  The use of higher
+    order Lagrange interpolators can typically
+    improve (minimize) this attenuation characteristic.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "DelayL.h"
+
+using namespace Nyq;
+
+DelayL :: DelayL() : Delay()
+{
+  doNextOut_ = true;
+}
+
+DelayL :: DelayL(StkFloat delay, unsigned long maxDelay)
+{
+  if ( delay < 0.0 || maxDelay < 1 ) {
+    errorString_ << "DelayL::DelayL: delay must be >= 0.0, maxDelay must be > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( delay > (StkFloat) maxDelay ) {
+    errorString_ << "DelayL::DelayL: maxDelay must be > than delay argument!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  // Writing before reading allows delays from 0 to length-1. 
+  if ( maxDelay > inputs_.size()-1 ) {
+    inputs_.resize( maxDelay+1 );
+    this->clear();
+  }
+
+  inPoint_ = 0;
+  this->setDelay(delay);
+  doNextOut_ = true;
+}
+
+DelayL :: ~DelayL()
+{
+}
+
+void DelayL :: setDelay(StkFloat delay)
+{
+  StkFloat outPointer;
+
+  if ( delay > inputs_.size() - 1 ) { // The value is too big.
+    errorString_ << "DelayL::setDelay: argument (" << delay << ") too big ... setting to maximum!";
+    handleError( StkError::WARNING );
+
+    // Force delay to maxLength
+    outPointer = inPoint_ + 1.0;
+    delay_ = inputs_.size() - 1;
+  }
+  else if (delay < 0 ) {
+    errorString_ << "DelayL::setDelay: argument (" << delay << ") less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+
+    outPointer = inPoint_;
+    delay_ = 0;
+  }
+  else {
+    outPointer = inPoint_ - delay;  // read chases write
+    delay_ = delay;
+  }
+
+  while (outPointer < 0)
+    outPointer += inputs_.size(); // modulo maximum length
+
+  outPoint_ = (long) outPointer;   // integer part
+  if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
+  alpha_ = outPointer - outPoint_; // fractional part
+  omAlpha_ = (StkFloat) 1.0 - alpha_;
+}
+
+StkFloat DelayL :: getDelay(void) const
+{
+  return delay_;
+}
+
+StkFloat DelayL :: nextOut(void)
+{
+  if ( doNextOut_ ) {
+    // First 1/2 of interpolation
+    nextOutput_ = inputs_[outPoint_] * omAlpha_;
+    // Second 1/2 of interpolation
+    if (outPoint_+1 < inputs_.size())
+      nextOutput_ += inputs_[outPoint_+1] * alpha_;
+    else
+      nextOutput_ += inputs_[0] * alpha_;
+    doNextOut_ = false;
+  }
+
+  return nextOutput_;
+}
+
+StkFloat DelayL :: computeSample( StkFloat input )
+{
+  inputs_[inPoint_++] = input;
+
+  // Increment input pointer modulo length.
+  if (inPoint_ == inputs_.size())
+    inPoint_ = 0;
+
+  outputs_[0] = nextOut();
+  doNextOut_ = true;
+
+  // Increment output pointer modulo length.
+  if (++outPoint_ == inputs_.size())
+    outPoint_ = 0;
+
+  return outputs_[0];
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Effect.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Effect.cpp
new file mode 100644
index 0000000..3a109a8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Effect.cpp
@@ -0,0 +1,98 @@
+/***************************************************/
+/*! \class Effect
+    \brief STK abstract effects parent class.
+
+    This class provides common functionality for
+    STK effects subclasses.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Effect.h"
+#include <math.h>
+
+using namespace Nyq;
+
+Effect :: Effect()
+{
+}
+
+Effect :: ~Effect()
+{
+}
+
+void Effect :: setEffectMix(StkFloat mix)
+{
+  if ( mix < 0.0 ) {
+    errorString_ << "Effect::setEffectMix: mix parameter is less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+    effectMix_ = 0.0;
+  }
+  else if ( mix > 1.0 ) {
+    errorString_ << "Effect::setEffectMix: mix parameter is greater than 1.0 ... setting to one!";
+    handleError( StkError::WARNING );
+    effectMix_ = 1.0;
+  }
+  else
+    effectMix_ = mix;
+}
+
+StkFloat Effect :: lastOut() const
+{
+  return (lastOutput_[0] + lastOutput_[1]) * 0.5;
+}
+
+StkFloat Effect :: lastOutLeft() const
+{
+  return lastOutput_[0];
+}
+
+StkFloat Effect :: lastOutRight() const
+{
+  return lastOutput_[1];
+}
+
+StkFloat Effect :: tick( StkFloat input )
+{
+  return computeSample( input );
+}
+
+StkFrames& Effect :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "Effect::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = computeSample( frames[i] );
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = computeSample( frames[index] );
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
+      frames[iStart] = computeSample( frames[iStart] );
+  }
+
+  return frames;
+}
+
+bool Effect :: isPrime(int number)
+{
+  if (number == 2) return true;
+  if (number & 1)	{
+	  for (int i=3; i<(int)sqrt((double)number)+1; i+=2)
+		  if ( (number % i) == 0) return false;
+	  return true; // prime
+	}
+  else return false; // even
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Envelope.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Envelope.cpp
new file mode 100644
index 0000000..6fe6698
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Envelope.cpp
@@ -0,0 +1,125 @@
+/***************************************************/
+/*! \class Envelope
+    \brief STK envelope base class.
+
+    This class implements a simple envelope
+    generator which is capable of ramping to
+    a target value by a specified \e rate.
+    It also responds to simple \e keyOn and
+    \e keyOff messages, ramping to 1.0 on
+    keyOn and to 0.0 on keyOff.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Envelope.h"
+
+using namespace Nyq;
+
+Envelope :: Envelope(void) : Generator()
+{    
+  target_ = 0.0;
+  value_ = 0.0;
+  rate_ = 0.001;
+  state_ = 0;
+}
+
+Envelope :: Envelope ( const Envelope& e )
+{
+  target_ = 0.0;
+  value_ = 0.0;
+  rate_ = 0.001;
+  state_ = 0;
+}
+
+Envelope :: ~Envelope(void)
+{
+}
+
+Envelope& Envelope :: operator= ( const Envelope& e )
+{
+  if ( this != &e ) {
+    target_ = e.target_;
+    value_ = e.value_;
+    rate_ = e.rate_;
+    state_ = e.state_;
+  }
+
+  return *this;
+}
+
+void Envelope :: keyOn(void)
+{
+  target_ = 1.0;
+  if (value_ != target_) state_ = 1;
+}
+
+void Envelope :: keyOff(void)
+{
+  target_ = 0.0;
+  if (value_ != target_) state_ = 1;
+}
+
+void Envelope :: setRate(StkFloat rate)
+{
+  if (rate < 0.0) {
+    errorString_ << "Envelope::setRate: negative rates not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    rate_ = -rate;
+  }
+  else
+    rate_ = rate;
+}
+
+void Envelope :: setTime(StkFloat time)
+{
+  if (time < 0.0) {
+    errorString_ << "Envelope::setTime: negative times not allowed ... correcting!";
+    handleError( StkError::WARNING );
+    rate_ = 1.0 / (-time * Stk::sampleRate());
+  }
+  else
+    rate_ = 1.0 / (time * Stk::sampleRate());
+}
+
+void Envelope :: setTarget(StkFloat target)
+{
+  target_ = target;
+  if (value_ != target_) state_ = 1;
+}
+
+void Envelope :: setValue(StkFloat value)
+{
+  state_ = 0;
+  target_ = value;
+  value_ = value;
+}
+
+int Envelope :: getState(void) const
+{
+  return state_;
+}
+
+StkFloat Envelope :: computeSample(void )
+{
+  if (state_) {
+    if (target_ > value_) {
+      value_ += rate_;
+      if (value_ >= target_) {
+        value_ = target_;
+        state_ = 0;
+      }
+    }
+    else {
+      value_ -= rate_;
+      if (value_ <= target_) {
+        value_ = target_;
+        state_ = 0;
+      }
+    }
+  }
+
+  lastOutput_ = value_;
+  return value_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/FileRead.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/FileRead.cpp
new file mode 100644
index 0000000..79034be
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/FileRead.cpp
@@ -0,0 +1,726 @@
+/***************************************************/
+/*! \class FileRead
+    \brief STK audio file input class.
+
+    This class provides input support for various
+    audio file formats.  Multi-channel (>2)
+    soundfiles are supported.  The file data is
+    returned via an external StkFrames object
+    passed to the read() function.  This class
+    does not store its own copy of the file data,
+    rather the data is read directly from disk.
+
+    FileRead currently supports uncompressed WAV,
+    AIFF/AIFC, SND (AU), MAT-file (Matlab), and
+    STK RAW file formats.  Signed integer (8-,
+    16-, and 32-bit) and floating-point (32- and
+    64-bit) data types are supported.  Compressed
+    data types are not supported.
+
+    STK RAW files have no header and are assumed
+    to contain a monophonic stream of 16-bit
+    signed integers in big-endian byte order at a
+    sample rate of 22050 Hz.  MAT-file data should
+    be saved in an array with each data channel
+    filling a matrix row.  The sample rate for
+    MAT-files is assumed to be 44100 Hz.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "string.h"
+#include "FileRead.h"
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <string.h>
+#include <cmath>
+
+using namespace Nyq;
+
+FileRead :: FileRead()
+  : fd_(0)
+{
+}
+
+FileRead :: FileRead( std::string fileName, bool typeRaw )
+  : fd_(0)
+{
+  open( fileName, typeRaw );
+}
+
+FileRead :: ~FileRead()
+{
+  if ( fd_ )
+    fclose( fd_ );
+}
+
+void FileRead :: close( void )
+{
+  if ( fd_ ) fclose( fd_ );
+  fd_ = 0;
+  wavFile_ = false;
+}
+
+bool FileRead :: isOpen( void )
+{
+  if ( fd_ ) return true;
+  else return false;
+}
+
+void FileRead :: open( std::string fileName, bool typeRaw )
+{
+  // If another file is open, close it.
+  close();
+
+  // Try to open the file.
+  fd_ = fopen( fileName.c_str(), "rb" );
+  if ( !fd_ ) {
+    errorString_ << "FileRead::open: could not open or find file (" << fileName << ")!";
+    handleError( StkError::FILE_NOT_FOUND );
+  }
+
+  // Attempt to determine file type from header (unless RAW).
+  bool result = false;
+  if ( typeRaw )
+    result = getRawInfo( fileName.c_str() );
+  else {
+    char header[12];
+    if ( fread( &header, 4, 3, fd_ ) != 3 ) goto error;
+    if ( !strncmp( header, "RIFF", 4 ) &&
+         !strncmp( &header[8], "WAVE", 4 ) )
+      result = getWavInfo( fileName.c_str() );
+    else if ( !strncmp( header, ".snd", 4 ) )
+      result = getSndInfo( fileName.c_str() );
+    else if ( !strncmp( header, "FORM", 4 ) &&
+              ( !strncmp( &header[8], "AIFF", 4 ) || !strncmp(&header[8], "AIFC", 4) ) )
+      result = getAifInfo( fileName.c_str() );
+    else {
+      if ( fseek( fd_, 126, SEEK_SET ) == -1 ) goto error;
+      if ( fread( &header, 2, 1, fd_ ) != 1 ) goto error;
+      if ( !strncmp( header, "MI", 2 ) ||
+           !strncmp( header, "IM", 2 ) )
+        result = getMatInfo( fileName.c_str() );
+      else {
+        errorString_ << "FileRead::open: file (" << fileName << ") format unknown.";
+        handleError( StkError::FILE_UNKNOWN_FORMAT );
+      }
+    }
+  }
+
+  // If here, we had a file type candidate but something else went wrong.
+  if ( result == false )
+    handleError( StkError::FILE_ERROR );
+
+  // Check for empty files.
+  if ( fileSize_ == 0 ) {
+    errorString_ << "FileRead::open: file (" << fileName << ") data size is zero!";
+    handleError( StkError::FILE_ERROR );
+  }
+
+  return;
+
+ error:
+  errorString_ << "FileRead::open: error reading file (" << fileName << ")!";
+  handleError( StkError::FILE_ERROR );
+}
+
+bool FileRead :: getRawInfo( const char *fileName )
+{
+  // Use the system call "stat" to determine the file length.
+  struct stat filestat;
+  if ( stat(fileName, &filestat) == -1 ) {
+    errorString_ << "FileRead: Could not stat RAW file (" << fileName << ").";
+    return false;
+  }
+
+  // STK rawwave files have no header and are assumed to contain a
+  // monophonic stream of 16-bit signed integers in big-endian byte
+  // order at a sample rate of 22050 Hz.
+  channels_ = 1;
+  fileSize_ = (long) filestat.st_size / 2;  // length in 2-byte samples
+  dataOffset_ = 0;
+  fileRate_ = 22050.0;
+  dataType_ = STK_SINT16;
+  byteswap_ = false;
+#ifdef __LITTLE_ENDIAN__
+  byteswap_ = true;
+#endif
+
+  return true;
+}
+
+bool FileRead :: getWavInfo( const char *fileName )
+{
+  // Find "format" chunk ... it must come before the "data" chunk.
+  char id[4];
+  SINT32 chunkSize;
+  if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  while ( strncmp(id, "fmt ", 4) ) {
+    if ( fread(&chunkSize, 4, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+    swap32((unsigned char *)&chunkSize);
+#endif
+    if ( fseek(fd_, chunkSize, SEEK_CUR) == -1 ) goto error;
+    if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  }
+
+  // Check that the data is not compressed.
+  unsigned short format_tag;
+  if ( fread(&chunkSize, 4, 1, fd_) != 1 ) goto error; // Read fmt chunk size.
+  if ( fread(&format_tag, 2, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+  swap16((unsigned char *)&format_tag);
+  swap32((unsigned char *)&chunkSize);
+#endif
+  if ( format_tag == 0xFFFE ) { // WAVE_FORMAT_EXTENSIBLE
+    dataOffset_ = ftell(fd_);
+    if ( fseek(fd_, 14, SEEK_CUR) == -1 ) goto error;
+    unsigned short extSize;
+    if ( fread(&extSize, 2, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+    swap16((unsigned char *)&extSize);
+#endif
+    if ( extSize == 0 ) goto error;
+    if ( fseek(fd_, 6, SEEK_CUR) == -1 ) goto error;
+    if ( fread(&format_tag, 2, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+    swap16((unsigned char *)&format_tag);
+#endif
+    if ( fseek(fd_, dataOffset_, SEEK_SET) == -1 ) goto error;
+  }
+  if (format_tag != 1 && format_tag != 3 ) { // PCM = 1, FLOAT = 3
+    errorString_ << "FileRead: "<< fileName << " contains an unsupported data format type (" << format_tag << ").";
+    return false;
+  }
+
+  // Get number of channels from the header.
+  SINT16 temp;
+  if ( fread(&temp, 2, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+  swap16((unsigned char *)&temp);
+#endif
+  channels_ = (unsigned int ) temp;
+
+  // Get file sample rate from the header.
+  SINT32 srate;
+  if ( fread(&srate, 4, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&srate);
+#endif
+  fileRate_ = (StkFloat) srate;
+
+  // Determine the data type.
+  dataType_ = 0;
+  if ( fseek(fd_, 6, SEEK_CUR) == -1 ) goto error;   // Locate bits_per_sample info.
+  if ( fread(&temp, 2, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+  swap16((unsigned char *)&temp);
+#endif
+  if ( format_tag == 1 ) {
+    if (temp == 8)
+      dataType_ = STK_SINT8;
+    else if (temp == 16)
+      dataType_ = STK_SINT16;
+    else if (temp == 32)
+      dataType_ = STK_SINT32;
+  }
+  else if ( format_tag == 3 ) {
+    if (temp == 32)
+      dataType_ = STK_FLOAT32;
+    else if (temp == 64)
+      dataType_ = STK_FLOAT64;
+  }
+  if ( dataType_ == 0 ) {
+    errorString_ << "FileRead: " << temp << " bits per sample with data format " << format_tag << " are not supported (" << fileName << ").";
+    return false;
+  }
+
+  // Jump over any remaining part of the "fmt" chunk.
+  if ( fseek(fd_, chunkSize-16, SEEK_CUR) == -1 ) goto error;
+
+  // Find "data" chunk ... it must come after the "fmt" chunk.
+  if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+
+  while ( strncmp(id, "data", 4) ) {
+    if ( fread(&chunkSize, 4, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+    swap32((unsigned char *)&chunkSize);
+#endif
+    chunkSize += chunkSize % 2; // chunk sizes must be even
+    if ( fseek(fd_, chunkSize, SEEK_CUR) == -1 ) goto error;
+    if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  }
+
+  // Get length of data from the header.
+  SINT32 bytes;
+  if ( fread(&bytes, 4, 1, fd_) != 1 ) goto error;
+#ifndef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&bytes);
+#endif
+  fileSize_ = 8 * bytes / temp / channels_;  // sample frames
+
+  dataOffset_ = ftell(fd_);
+  byteswap_ = false;
+#ifndef __LITTLE_ENDIAN__
+  byteswap_ = true;
+#endif
+
+  wavFile_ = true;
+  return true;
+
+ error:
+  errorString_ << "FileRead: error reading WAV file (" << fileName << ").";
+  return false;
+}
+
+bool FileRead :: getSndInfo( const char *fileName )
+{
+  // Determine the data type.
+  UINT32 format;
+  if ( fseek(fd_, 12, SEEK_SET) == -1 ) goto error;   // Locate format
+  if ( fread(&format, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+    swap32((unsigned char *)&format);
+#endif
+  if (format == 2) dataType_ = STK_SINT8;
+  else if (format == 3) dataType_ = STK_SINT16;
+  else if (format == 4) dataType_ = STK_SINT24;
+  else if (format == 5) dataType_ = STK_SINT32;
+  else if (format == 6) dataType_ = STK_FLOAT32;
+  else if (format == 7) dataType_ = STK_FLOAT64;
+  else {
+    errorString_ << "FileRead: data format in file " << fileName << " is not supported.";
+    return false;
+  }
+
+  // Get file sample rate from the header.
+  UINT32 srate;
+  if ( fread(&srate, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&srate);
+#endif
+  fileRate_ = (StkFloat) srate;
+
+  // Get number of channels from the header.
+  UINT32 chans;
+  if ( fread(&chans, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&chans);
+#endif
+  channels_ = chans;
+
+  if ( fseek(fd_, 4, SEEK_SET) == -1 ) goto error;
+  if ( fread(&dataOffset_, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&dataOffset_);
+#endif
+
+  // Get length of data from the header.
+  if ( fread(&fileSize_, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&fileSize_);
+#endif
+  // Convert to sample frames.
+  if ( dataType_ == STK_SINT8 )
+    fileSize_ /= channels_;
+  if ( dataType_ == STK_SINT16 )
+    fileSize_ /= 2 * channels_;
+  else if ( dataType_ == STK_SINT24 )
+    fileSize_ /= 3 * channels_;
+  else if ( dataType_ == STK_SINT32 || dataType_ == STK_FLOAT32 )
+    fileSize_ /= 4 * channels_;
+  else if ( dataType_ == STK_FLOAT64 )
+    fileSize_ /= 8 * channels_;
+
+  byteswap_ = false;
+#ifdef __LITTLE_ENDIAN__
+  byteswap_ = true;
+#endif
+
+  return true;
+
+ error:
+  errorString_ << "FileRead: Error reading SND file (" << fileName << ").";
+  return false;
+}
+
+bool FileRead :: getAifInfo( const char *fileName )
+{
+  bool aifc = false;
+  char id[4];
+
+  // Determine whether this is AIFF or AIFC.
+  if ( fseek(fd_, 8, SEEK_SET) == -1 ) goto error;
+  if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  if ( !strncmp(id, "AIFC", 4) ) aifc = true;
+
+  // Find "common" chunk
+  SINT32 chunkSize;
+  if ( fread(&id, 4, 1, fd_) != 1) goto error;
+  while ( strncmp(id, "COMM", 4) ) {
+    if ( fread(&chunkSize, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+    swap32((unsigned char *)&chunkSize);
+#endif
+    chunkSize += chunkSize % 2; // chunk sizes must be even
+    if ( fseek(fd_, chunkSize, SEEK_CUR) == -1 ) goto error;
+    if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  }
+
+  // Get number of channels from the header.
+  SINT16 temp;
+  if ( fseek(fd_, 4, SEEK_CUR) == -1 ) goto error; // Jump over chunk size
+  if ( fread(&temp, 2, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap16((unsigned char *)&temp);
+#endif
+  channels_ = temp;
+
+  // Get length of data from the header.
+  SINT32 frames;
+  if ( fread(&frames, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&frames);
+#endif
+  fileSize_ = frames; // sample frames
+
+  // Read the number of bits per sample.
+  if ( fread(&temp, 2, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+  swap16((unsigned char *)&temp);
+#endif
+
+  // Get file sample rate from the header.  For AIFF files, this value
+  // is stored in a 10-byte, IEEE Standard 754 floating point number,
+  // so we need to convert it first.
+  unsigned char srate[10];
+  unsigned char exp;
+  unsigned long mantissa;
+  unsigned long last;
+  if ( fread(&srate, 10, 1, fd_) != 1 ) goto error;
+  mantissa = (unsigned long) *(unsigned long *)(srate+2);
+#ifdef __LITTLE_ENDIAN__
+  swap32((unsigned char *)&mantissa);
+#endif
+  exp = 30 - *(srate+1);
+  last = 0;
+  while (exp--) {
+    last = mantissa;
+    mantissa >>= 1;
+  }
+  if (last & 0x00000001) mantissa++;
+  fileRate_ = (StkFloat) mantissa;
+
+  // Determine the data format.
+  dataType_ = 0;
+  if ( aifc == false ) {
+    if ( temp <= 8 ) dataType_ = STK_SINT8;
+    else if ( temp <= 16 ) dataType_ = STK_SINT16;
+    else if ( temp <= 24 ) dataType_ = STK_SINT24;
+    else if ( temp <= 32 ) dataType_ = STK_SINT32;
+  }
+  else {
+    if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+    if ( !strncmp(id, "NONE", 4) ) {
+      if ( temp <= 8 ) dataType_ = STK_SINT8;
+      else if ( temp <= 16 ) dataType_ = STK_SINT16;
+      else if ( temp <= 24 ) dataType_ = STK_SINT24;
+      else if ( temp <= 32 ) dataType_ = STK_SINT32;
+    }
+    else if ( (!strncmp(id, "fl32", 4) || !strncmp(id, "FL32", 4)) && temp == 32 ) dataType_ = STK_FLOAT32;
+    else if ( (!strncmp(id, "fl64", 4) || !strncmp(id, "FL64", 4)) && temp == 64 ) dataType_ = STK_FLOAT64;
+  }
+  if ( dataType_ == 0 ) {
+    errorString_ << "FileRead: AIFF/AIFC file (" << fileName << ") has unsupported data type (" << id << ").";
+    return false;
+  }
+
+  // Start at top to find data (SSND) chunk ... chunk order is undefined.
+  if ( fseek(fd_, 12, SEEK_SET) == -1 ) goto error;
+
+  // Find data (SSND) chunk
+  if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  while ( strncmp(id, "SSND", 4) ) {
+    if ( fread(&chunkSize, 4, 1, fd_) != 1 ) goto error;
+#ifdef __LITTLE_ENDIAN__
+    swap32((unsigned char *)&chunkSize);
+#endif
+    chunkSize += chunkSize % 2; // chunk sizes must be even
+    if ( fseek(fd_, chunkSize, SEEK_CUR) == -1 ) goto error;
+    if ( fread(&id, 4, 1, fd_) != 1 ) goto error;
+  }
+
+  // Skip over chunk size, offset, and blocksize fields
+  if ( fseek(fd_, 12, SEEK_CUR) == -1 ) goto error;
+
+  dataOffset_ = ftell(fd_);
+  byteswap_ = false;
+#ifdef __LITTLE_ENDIAN__
+  byteswap_ = true;
+#endif
+
+  return true;
+
+ error:
+  errorString_ << "FileRead: Error reading AIFF file (" << fileName << ").";
+  return false;
+}
+
+bool FileRead :: getMatInfo( const char *fileName )
+{
+  // MAT-file formatting information is available at:
+  // http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
+
+  // Verify this is a version 5 MAT-file format.
+  char head[4];
+  if ( fseek(fd_, 0, SEEK_SET) == -1 ) goto error;
+  if ( fread(&head, 4, 1, fd_) != 1 ) goto error;
+  // If any of the first 4 characters of the header = 0, then this is
+  // a Version 4 MAT-file.
+  if ( strstr(head, "0") ) {
+    errorString_ << "FileRead: " << fileName << " appears to be a Version 4 MAT-file, which is not currently supported.";
+    return false;
+  }
+
+  // Determine the endian-ness of the file.
+  char mi[2];
+  byteswap_ = false;
+  // Locate "M" and "I" characters in header.
+  if ( fseek(fd_, 126, SEEK_SET) == -1 ) goto error;
+  if ( fread(&mi, 2, 1, fd_) != 1) goto error;
+#ifdef __LITTLE_ENDIAN__
+  if ( !strncmp(mi, "MI", 2) )
+    byteswap_ = true;
+  else if ( strncmp(mi, "IM", 2) ) goto error;
+#else
+  if ( !strncmp(mi, "IM", 2))
+    byteswap_ = true;
+  else if ( strncmp(mi, "MI", 2) ) goto error;
+#endif
+
+  // Check the data element type
+  SINT32 datatype;
+  if ( fread(&datatype, 4, 1, fd_) != 1 ) goto error;
+  if ( byteswap_ ) swap32((unsigned char *)&datatype);
+  if (datatype != 14) {
+    errorString_ << "FileRead: The file does not contain a single Matlab array (or matrix) data element.";
+    return false;
+  }
+
+  // Determine the array data type.
+  SINT32 tmp;
+  SINT32 size;
+  if ( fseek(fd_, 168, SEEK_SET) == -1 ) goto error;
+  if ( fread(&tmp, 4, 1, fd_) != 1 ) goto error;
+  if (byteswap_) swap32((unsigned char *)&tmp);
+  if (tmp == 1) {  // array name > 4 characters
+    if ( fread(&tmp, 4, 1, fd_) != 1 ) goto error;  // get array name length
+    if (byteswap_) swap32((unsigned char *)&tmp);
+    size = (SINT32) ceil((float)tmp / 8);
+    if ( fseek(fd_, size*8, SEEK_CUR) == -1 ) goto error;  // jump over array name
+  }
+  else { // array name <= 4 characters, compressed data element
+    if ( fseek(fd_, 4, SEEK_CUR) == -1 ) goto error;
+  }
+  if ( fread(&tmp, 4, 1, fd_) != 1 ) goto error;
+  if (byteswap_) swap32((unsigned char *)&tmp);
+  if ( tmp == 1 ) dataType_ = STK_SINT8;
+  else if ( tmp == 3 ) dataType_ = STK_SINT16;
+  else if ( tmp == 5 ) dataType_ = STK_SINT32;
+  else if ( tmp == 7 ) dataType_ = STK_FLOAT32;
+  else if ( tmp == 9 ) dataType_ = STK_FLOAT64;
+  else {
+    errorString_ << "FileRead: The MAT-file array data format (" << tmp << ") is not supported.";
+    return false;
+  }
+
+  // Get number of rows from the header.
+  SINT32 rows;
+  if ( fseek(fd_, 160, SEEK_SET) == -1 ) goto error;
+  if ( fread(&rows, 4, 1, fd_) != 1 ) goto error;
+  if (byteswap_) swap32((unsigned char *)&rows);
+
+  // Get number of columns from the header.
+  SINT32 columns;
+  if ( fread(&columns, 4, 1, fd_) != 1 ) goto error;
+  if (byteswap_) swap32((unsigned char *)&columns);
+
+  // Assume channels = smaller of rows or columns.
+  if (rows < columns) {
+    channels_ = rows;
+    fileSize_ = columns;
+  }
+  else {
+    errorString_ << "FileRead: Transpose the MAT-file array so that audio channels fill matrix rows (not columns).";
+    return false;
+  }
+
+  // Move read pointer to the data in the file.
+  SINT32 headsize;
+  if ( fseek(fd_, 132, SEEK_SET) == -1 ) goto error;
+  if ( fread(&headsize, 4, 1, fd_) != 1 ) goto error; // file size from 132nd byte
+  if (byteswap_) swap32((unsigned char *)&headsize);
+  headsize -= fileSize_ * 8 * channels_;
+  if ( fseek(fd_, headsize, SEEK_CUR) == -1 ) goto error;
+  dataOffset_ = ftell(fd_);
+
+  // Assume MAT-files have 44100 Hz sample rate.
+  fileRate_ = 44100.0;
+
+  return true;
+
+ error:
+  errorString_ << "FileRead: Error reading MAT-file (" << fileName << ").";
+  return false;
+}
+
+void FileRead :: read( StkFrames& buffer, unsigned long startFrame, bool doNormalize )
+{
+  // Make sure we have an open file.
+  if ( fd_ == 0 ) {
+    errorString_ << "FileRead::read: a file is not open!";
+    Stk::handleError( StkError::WARNING );
+    return;
+  }
+
+  // Check the buffer size.
+  unsigned int nFrames = buffer.frames();
+  if ( nFrames == 0 ) {
+    errorString_ << "FileRead::read: StkFrames buffer size is zero ... no data read!";
+    Stk::handleError( StkError::WARNING );
+    return;
+  }
+
+  if ( buffer.channels() != channels_ ) {
+    errorString_ << "FileRead::read: StkFrames argument has incompatible number of channels!";
+    Stk::handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  // Check for file end.
+  if ( startFrame + nFrames >= fileSize_ )
+    nFrames = fileSize_ - startFrame;
+
+  long i, nSamples = (long) ( nFrames * channels_ );
+  unsigned long offset = startFrame * channels_;
+
+  // Read samples into StkFrames data buffer.
+  if ( dataType_ == STK_SINT16 ) {
+    SINT16 *buf = (SINT16 *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+(offset*2), SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples * 2, 1, fd_ ) != 1 ) goto error;
+    if ( byteswap_ ) {
+      SINT16 *ptr = buf;
+      for ( i=nSamples-1; i>=0; i-- )
+        swap16( (unsigned char *) ptr++ );
+    }
+    if ( doNormalize ) {
+      StkFloat gain = 1.0 / 32768.0;
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i] * gain;
+    }
+    else {
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i];
+    }
+  }
+  else if ( dataType_ == STK_SINT32 ) {
+    SINT32 *buf = (SINT32 *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+(offset*4 ), SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples * 4, 1, fd_ ) != 1 ) goto error;
+    if ( byteswap_ ) {
+      SINT32 *ptr = buf;
+      for ( i=nSamples-1; i>=0; i-- )
+        swap32( (unsigned char *) ptr++ );
+    }
+    if ( doNormalize ) {
+      StkFloat gain = 1.0 / 2147483648.0;
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i] * gain;
+    }
+    else {
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i];
+    }
+  }
+  else if ( dataType_ == STK_FLOAT32 ) {
+    FLOAT32 *buf = (FLOAT32 *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+(offset*4), SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples * 4, 1, fd_ ) != 1 ) goto error;
+    if ( byteswap_ ) {
+      FLOAT32 *ptr = buf;
+      for ( i=nSamples-1; i>=0; i-- )
+        swap32( (unsigned char *) ptr++ );
+    }
+    for ( i=nSamples-1; i>=0; i-- )
+      buffer[i] = buf[i];
+  }
+  else if ( dataType_ == STK_FLOAT64 ) {
+    FLOAT64 *buf = (FLOAT64 *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+(offset*8), SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples * 8, 1, fd_ ) != 1 ) goto error;
+    if ( byteswap_ ) {
+      FLOAT64 *ptr = buf;
+      for ( i=nSamples-1; i>=0; i-- )
+        swap64( (unsigned char *) ptr++ );
+    }
+    for ( i=nSamples-1; i>=0; i-- )
+      buffer[i] = buf[i];
+  }
+  else if ( dataType_ == STK_SINT8 && wavFile_ ) { // 8-bit WAV data is unsigned!
+    unsigned char *buf = (unsigned char *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+offset, SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples, 1, fd_) != 1 ) goto error;
+    if ( doNormalize ) {
+      StkFloat gain = 1.0 / 128.0;
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = ( buf[i] - 128 ) * gain;
+    }
+    else {
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i] - 128.0;
+    }
+  }
+  else if ( dataType_ == STK_SINT8 ) { // signed 8-bit data
+    char *buf = (char *) &buffer[0];
+    if ( fseek( fd_, dataOffset_+offset, SEEK_SET ) == -1 ) goto error;
+    if ( fread( buf, nSamples, 1, fd_ ) != 1 ) goto error;
+    if ( doNormalize ) {
+      StkFloat gain = 1.0 / 128.0;
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i] * gain;
+    }
+    else {
+      for ( i=nSamples-1; i>=0; i-- )
+        buffer[i] = buf[i];
+    }
+  }
+  else if ( dataType_ == STK_SINT24 ) {
+    // 24-bit values are harder to import efficiently since there is
+    // no native 24-bit type.  The following routine works but is much
+    // less efficient that that used for the other data types.
+    SINT32 buf;
+    StkFloat gain = 1.0 / 8388608.0;
+    if ( fseek(fd_, dataOffset_+(offset*3), SEEK_SET ) == -1 ) goto error;
+    for ( i=0; i<nSamples; i++ ) {
+      if ( fread( &buf, 3, 1, fd_ ) != 1 ) goto error;
+      buf >>= 8;
+      if ( byteswap_ )
+        swap32( (unsigned char *) &buf );
+      if ( doNormalize )
+        buffer[i] = buf * gain;
+      else
+        buffer[i] = buf;
+    }
+  }
+
+  buffer.setDataRate( fileRate_ );
+
+  return;
+
+ error:
+  errorString_ << "FileRead: Error reading file data.";
+  handleError( StkError::FILE_ERROR);
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/FileWvIn.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/FileWvIn.cpp
new file mode 100644
index 0000000..57a5f09
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/FileWvIn.cpp
@@ -0,0 +1,213 @@
+/***************************************************/
+/*! \class FileWvIn
+    \brief STK audio file input class.
+
+    This class inherits from WvIn.  It provides a "tick-level"
+    interface to the FileRead class.  It also provides variable-rate
+    "playback" functionality.  Audio file support is provided by the
+    FileRead class.  Linear interpolation is used for fractional "read
+    rates".
+
+    FileWvIn supports multi-channel data.  It is important to distinguish
+    the tick() methods, which return samples produced by averaging
+    across sample frames, from the tickFrame() methods, which return
+    references to multi-channel sample frames.
+
+    FileWvIn will either load the entire content of an audio file into
+    local memory or incrementally read file data from disk in chunks.
+    This behavior is controlled by the optional constructor arguments
+    \e chunkThreshold and \e chunkSize.  File sizes greater than \e
+    chunkThreshold (in sample frames) will be read incrementally in
+    chunks of \e chunkSize each (also in sample frames).
+
+    When the end of a file is reached, subsequent calls to the tick()
+    functions return zero-valued data.
+
+    See the FileRead class for a description of the supported audio
+    file formats.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "FileWvIn.h"
+#include <cmath>
+
+using namespace Nyq;
+
+FileWvIn :: FileWvIn( unsigned long chunkThreshold, unsigned long chunkSize )
+  : finished_(true), interpolate_(false), time_(0.0),
+    chunkThreshold_(chunkThreshold), chunkSize_(chunkSize)
+{
+}
+
+FileWvIn :: FileWvIn( std::string fileName, bool raw, bool doNormalize,
+                      unsigned long chunkThreshold, unsigned long chunkSize )
+  : finished_(true), interpolate_(false), time_(0.0),
+    chunkThreshold_(chunkThreshold), chunkSize_(chunkSize)
+{
+  openFile( fileName, raw, doNormalize );
+}
+
+FileWvIn :: ~FileWvIn()
+{
+  this->closeFile();
+}
+
+void FileWvIn :: closeFile( void )
+{
+  if ( file_.isOpen() ) file_.close();
+  finished_ = true;
+}
+
+void FileWvIn :: openFile( std::string fileName, bool raw, bool doNormalize )
+{
+  // Call close() in case another file is already open.
+  this->closeFile();
+
+  // Attempt to open the file ... an error might be thrown here.
+  file_.open( fileName, raw );
+
+  // Determine whether chunking or not.
+  if ( file_.fileSize() > chunkThreshold_ ) {
+    chunking_ = true;
+    chunkPointer_ = 0;
+    data_.resize( chunkSize_, file_.channels() );
+    if ( doNormalize ) normalizing_ = true;
+    else normalizing_ = false;
+  }
+  else {
+    chunking_ = false;
+    data_.resize( (size_t) file_.fileSize(), file_.channels() );
+  }
+
+  // Load all or part of the data.
+  file_.read( data_, 0, doNormalize );
+
+  // Resize our lastOutputs container.
+  lastOutputs_.resize( 1, file_.channels() );
+
+  // Set default rate based on file sampling rate.
+  this->setRate( data_.dataRate() / Stk::sampleRate() );
+
+  if ( doNormalize & !chunking_ ) this->normalize();
+
+  this->reset();
+}
+
+void FileWvIn :: reset(void)
+{
+  time_ = (StkFloat) 0.0;
+  for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+    lastOutputs_[i] = 0.0;
+  finished_ = false;
+}
+
+void FileWvIn :: normalize(void)
+{
+  this->normalize( 1.0 );
+}
+
+// Normalize all channels equally by the greatest magnitude in all of the data.
+void FileWvIn :: normalize( StkFloat peak )
+{
+  // When chunking, the "normalization" scaling is performed by FileRead.
+  if ( chunking_ ) return;
+
+  size_t i;
+  StkFloat max = 0.0;
+
+  for ( i=0; i<data_.size(); i++ ) {
+    if ( fabs( data_[i] ) > max )
+      max = (StkFloat) fabs((double) data_[i]);
+  }
+
+  if (max > 0.0) {
+    max = 1.0 / max;
+    max *= peak;
+    for ( i=0; i<data_.size(); i++ )
+	    data_[i] *= max;
+  }
+}
+
+void FileWvIn :: setRate( StkFloat rate )
+{
+  rate_ = rate;
+
+  // If negative rate and at beginning of sound, move pointer to end
+  // of sound.
+  if ( (rate_ < 0) && (time_ == 0.0) ) time_ = file_.fileSize() - 1.0;
+
+  if ( fmod( rate_, 1.0 ) != 0.0 ) interpolate_ = true;
+  else interpolate_ = false;
+}
+
+void FileWvIn :: addTime( StkFloat time )   
+{
+  // Add an absolute time in samples 
+  time_ += time;
+
+  if ( time_ < 0.0 ) time_ = 0.0;
+  if ( time_ > file_.fileSize() - 1.0 ) {
+    time_ = file_.fileSize() - 1.0;
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+      lastOutputs_[i] = 0.0;
+    finished_ = true;
+  }
+}
+
+StkFloat FileWvIn :: lastOut( void ) const
+{
+  if ( finished_ ) return 0.0;
+  return WvIn :: lastOut();
+}
+
+void FileWvIn :: computeFrame( void )
+{
+  if ( finished_ ) return;
+
+  if ( time_ < 0.0 || time_ > (StkFloat) ( file_.fileSize() - 1.0 ) ) {
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+      lastOutputs_[i] = 0.0;
+    finished_ = true;
+    return;
+  }
+
+  StkFloat tyme = time_;
+  if ( chunking_ ) {
+
+    // Check the time address vs. our current buffer limits.
+    if ( ( time_ < (StkFloat) chunkPointer_ ) ||
+         ( time_ > (StkFloat) ( chunkPointer_ + chunkSize_ - 1 ) ) ) {
+
+      while ( time_ < (StkFloat) chunkPointer_ ) { // negative rate
+        chunkPointer_ -= chunkSize_ - 1; // overlap chunks by one frame
+        if ( chunkPointer_ < 0 ) chunkPointer_ = 0;
+      }
+      while ( time_ > (StkFloat) ( chunkPointer_ + chunkSize_ - 1 ) ) { // positive rate
+        chunkPointer_ += chunkSize_ - 1; // overlap chunks by one frame
+        if ( chunkPointer_ + chunkSize_ > file_.fileSize() ) // at end of file
+          chunkPointer_ = file_.fileSize() - chunkSize_;
+      }
+
+      // Load more data.
+      file_.read( data_, chunkPointer_, normalizing_ );
+    }
+
+    // Adjust index for the current buffer.
+    tyme -= chunkPointer_;
+  }
+
+  if ( interpolate_ ) {
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+    lastOutputs_[i] = data_.interpolate( tyme, i );
+  }
+  else {
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+      lastOutputs_[i] = data_( (size_t) tyme, i );
+  }
+
+  // Increment time, which can be negative.
+  time_ += rate_;
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Filter.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Filter.cpp
new file mode 100644
index 0000000..59cabbe
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Filter.cpp
@@ -0,0 +1,236 @@
+/***************************************************/
+/*! \class Filter
+    \brief STK filter class.
+
+    This class implements a generic structure that
+    can be used to create a wide range of filters.
+    It can function independently or be subclassed
+    to provide more specific controls based on a
+    particular filter type.
+
+    In particular, this class implements the standard
+    difference equation:
+
+    a[0]*y[n] = b[0]*x[n] + ... + b[nb]*x[n-nb] -
+                a[1]*y[n-1] - ... - a[na]*y[n-na]
+
+    If a[0] is not equal to 1, the filter coefficients
+    are normalized by a[0].
+
+    The \e gain parameter is applied at the filter
+    input and does not affect the coefficient values.
+    The default gain value is 1.0.  This structure
+    results in one extra multiply per computed sample,
+    but allows easy control of the overall filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Filter.h"
+#include <stdio.h>
+
+using namespace Nyq;
+
+Filter :: Filter()
+{
+  // The default constructor should setup for pass-through.
+  gain_ = 1.0;
+  b_.push_back( 1.0 );
+  a_.push_back( 1.0 );
+
+  inputs_.push_back( 0.0 );
+  outputs_.push_back( 0.0 );
+}
+
+Filter :: Filter( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients )
+{
+  // Check the arguments.
+  if ( bCoefficients.size() == 0 || aCoefficients.size() == 0 ) {
+    errorString_ << "Filter: a and b coefficient vectors must both have size > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( aCoefficients[0] == 0.0 ) {
+    errorString_ << "Filter: a[0] coefficient cannot == 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  gain_ = 1.0;
+  b_ = bCoefficients;
+  a_ = aCoefficients;
+
+  inputs_ = std::vector<StkFloat> ( b_.size() );
+  outputs_ = std::vector<StkFloat> ( a_.size() );
+  this->clear();
+}
+
+Filter :: ~Filter()
+{
+}
+
+void Filter :: clear(void)
+{
+  unsigned int i;
+  for (i=0; i<inputs_.size(); i++)
+    inputs_[i] = 0.0;
+  for (i=0; i<outputs_.size(); i++)
+    outputs_[i] = 0.0;
+}
+
+void Filter :: setCoefficients( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients, bool clearState )
+{
+  // Check the arguments.
+  if ( bCoefficients.size() == 0 || aCoefficients.size() == 0 ) {
+    errorString_ << "Filter::setCoefficients: a and b coefficient vectors must both have size > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( aCoefficients[0] == 0.0 ) {
+    errorString_ << "Filter::setCoefficients: a[0] coefficient cannot == 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( b_.size() != bCoefficients.size() ) {
+    b_ = bCoefficients;
+    inputs_.clear();
+    inputs_ = std::vector<StkFloat> ( b_.size() );
+  }
+  else {
+    for ( unsigned int i=0; i<b_.size(); i++ ) b_[i] = bCoefficients[i];
+  }
+
+  if ( a_.size() != aCoefficients.size() ) {
+    a_ = aCoefficients;
+    outputs_.clear();
+    outputs_ = std::vector<StkFloat> ( a_.size() );
+  }
+  else {
+    for ( unsigned int i=0; i<a_.size(); i++ ) a_[i] = aCoefficients[i];
+  }
+
+  if ( clearState ) this->clear();
+
+  // Scale coefficients by a[0] if necessary
+  if ( a_[0] != 1.0 ) {
+    unsigned int i;
+    for ( i=0; i<b_.size(); i++ ) b_[i] /= a_[0];
+    for ( i=1; i<a_.size(); i++ )  a_[i] /= a_[0];
+  }
+}
+
+void Filter :: setNumerator( std::vector<StkFloat> &bCoefficients, bool clearState )
+{
+  // Check the argument.
+  if ( bCoefficients.size() == 0 ) {
+    errorString_ << "Filter::setNumerator: coefficient vector must have size > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( b_.size() != bCoefficients.size() ) {
+    b_ = bCoefficients;
+    inputs_.clear();
+    inputs_ = std::vector<StkFloat> ( b_.size() );
+  }
+  else {
+    for ( unsigned int i=0; i<b_.size(); i++ ) b_[i] = bCoefficients[i];
+  }
+
+  if ( clearState ) this->clear();
+}
+
+void Filter :: setDenominator( std::vector<StkFloat> &aCoefficients, bool clearState )
+{
+  // Check the argument.
+  if ( aCoefficients.size() == 0 ) {
+    errorString_ << "Filter::setDenominator: coefficient vector must have size > 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( aCoefficients[0] == 0.0 ) {
+    errorString_ << "Filter::setDenominator: a[0] coefficient cannot == 0!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( a_.size() != aCoefficients.size() ) {
+    a_ = aCoefficients;
+    outputs_.clear();
+    outputs_ = std::vector<StkFloat> ( a_.size() );
+  }
+  else {
+    for ( unsigned int i=0; i<a_.size(); i++ ) a_[i] = aCoefficients[i];
+  }
+
+  if ( clearState ) this->clear();
+
+  // Scale coefficients by a[0] if necessary
+  if ( a_[0] != 1.0 ) {
+    unsigned int i;
+    for ( i=0; i<b_.size(); i++ ) b_[i] /= a_[0];
+    for ( i=1; i<a_.size(); i++ )  a_[i] /= a_[0];
+  }
+}
+
+void Filter :: setGain(StkFloat gain)
+{
+  gain_ = gain;
+}
+
+StkFloat Filter :: getGain(void) const
+{
+  return gain_;
+}
+
+StkFloat Filter :: lastOut(void) const
+{
+  return outputs_[0];
+}
+
+StkFloat Filter :: tick( StkFloat input )
+{
+  unsigned int i;
+
+  outputs_[0] = 0.0;
+  inputs_[0] = gain_ * input;
+  for (i=b_.size()-1; i>0; i--) {
+    outputs_[0] += b_[i] * inputs_[i];
+    inputs_[i] = inputs_[i-1];
+  }
+  outputs_[0] += b_[0] * inputs_[0];
+
+  for (i=a_.size()-1; i>0; i--) {
+    outputs_[0] += -a_[i] * outputs_[i];
+    outputs_[i] = outputs_[i-1];
+  }
+
+  return outputs_[0];
+}
+
+
+StkFrames& Filter :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "Filter::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = tick( frames[i] );
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = tick( frames[index] );
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
+      frames[iStart] = tick( frames[iStart] );
+  }
+
+  return frames;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Flute.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Flute.cpp
new file mode 100644
index 0000000..ecc1193
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Flute.cpp
@@ -0,0 +1,201 @@
+/***************************************************/
+/*! \class Flute
+    \brief STK flute physical model class.
+
+    This class implements a simple flute
+    physical model, as discussed by Karjalainen,
+    Smith, Waryznyk, etc.  The jet model uses
+    a polynomial, a la Cook.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Jet Delay = 2
+       - Noise Gain = 4
+       - Vibrato Frequency = 11
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Flute.h"
+#include "SKINI.msg"
+
+using namespace Nyq;
+
+Flute :: Flute(StkFloat lowestFrequency)
+{
+  length_ = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1);
+  boreDelay_.setMaximumDelay( length_ );
+  boreDelay_.setDelay( 100.0 );
+
+  length_ >>= 1;
+  jetDelay_.setMaximumDelay( length_ );
+  jetDelay_.setDelay( 49.0 );
+
+  vibrato_.setFrequency( 5.925 );
+
+  this->clear();
+
+  filter_.setPole( 0.7 - ((StkFloat) 0.1 * 22050.0 / Stk::sampleRate() ) );
+  filter_.setGain( -1.0 );
+
+  dcBlock_.setBlockZero();
+
+  adsr_.setAllTimes( 0.005, 0.01, 0.8, 0.010);
+  endReflection_ = 0.5;
+  jetReflection_ = 0.5;
+  noiseGain_     = 0.15;    // Breath pressure random component.
+  vibratoGain_   = 0.05;    // Breath periodic vibrato component.
+  jetRatio_      = 0.32;
+
+	maxPressure_ = 0.0;
+  lastFrequency_ = 220.0;
+}
+
+Flute :: ~Flute()
+{
+}
+
+void Flute :: clear()
+{
+  jetDelay_.clear();
+  boreDelay_.clear();
+  filter_.clear();
+  dcBlock_.clear();
+}
+
+void Flute :: setFrequency(StkFloat frequency)
+{
+  lastFrequency_ = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "Flute::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    lastFrequency_ = 220.0;
+  }
+
+  // We're overblowing here.
+  lastFrequency_ *= 0.66666;
+
+  // delay = length - approximate filter delay.
+  StkFloat delay = Stk::sampleRate() / lastFrequency_ - (StkFloat) 2.0;
+  if ( delay <= 0.0 ) delay = 0.3;
+  else if ( delay > length_ ) delay = length_;
+
+  boreDelay_.setDelay(delay);
+  jetDelay_.setDelay(delay * jetRatio_);
+}
+
+void Flute :: startBlowing(StkFloat amplitude, StkFloat rate)
+{
+  adsr_.setAttackRate( rate );
+  maxPressure_ = amplitude / (StkFloat) 0.8;
+  adsr_.keyOn();
+}
+
+void Flute :: stopBlowing(StkFloat rate)
+{
+  adsr_.setReleaseRate( rate );
+  adsr_.keyOff();
+}
+
+void Flute :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency( frequency );
+  this->startBlowing( 1.1 + (amplitude * 0.20), amplitude * 0.02 );
+  outputGain_ = amplitude + 0.001;
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Flute::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Flute :: noteOff(StkFloat amplitude)
+{
+  this->stopBlowing( amplitude * 0.02 );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Flute::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Flute :: setJetReflection(StkFloat coefficient)
+{
+  jetReflection_ = coefficient;
+}
+
+void Flute :: setEndReflection(StkFloat coefficient)
+{         
+  endReflection_ = coefficient;
+}               
+
+void Flute :: setJetDelay(StkFloat aRatio)
+{
+  // Delay = length - approximate filter delay.
+  StkFloat temp = Stk::sampleRate() / lastFrequency_ - (StkFloat) 2.0;
+  jetRatio_ = aRatio;
+  jetDelay_.setDelay(temp * aRatio); // Scaled by ratio.
+}
+
+StkFloat Flute :: computeSample()
+{
+  StkFloat pressureDiff;
+  StkFloat breathPressure;
+
+  // Calculate the breath pressure (envelope + noise + vibrato)
+  breathPressure = maxPressure_ * adsr_.tick();
+  breathPressure += breathPressure * ( noiseGain_ * noise_.tick() + vibratoGain_ * vibrato_.tick() );
+  //breathPressure += breathPressure * vibratoGain_ * vibrato_.tick();
+
+  StkFloat temp = filter_.tick( boreDelay_.lastOut() );
+  temp = dcBlock_.tick( temp ); // Block DC on reflection.
+
+  pressureDiff = breathPressure - (jetReflection_ * temp);
+  pressureDiff = jetDelay_.tick( pressureDiff );
+  pressureDiff = jetTable_.tick( pressureDiff ) + (endReflection_ * temp);
+  lastOutput_ = (StkFloat) 0.3 * boreDelay_.tick( pressureDiff );
+
+  lastOutput_ *= outputGain_;
+  return lastOutput_;
+}
+
+void Flute :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "Flute::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "Flute::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_JetDelay_) // 2
+    this->setJetDelay( (StkFloat) (0.08 + (0.48 * norm)) );
+  else if (number == __SK_NoiseLevel_) // 4
+    noiseGain_ = ( norm * 0.4);
+  else if (number == __SK_ModFrequency_) // 11
+    vibrato_.setFrequency( norm * 12.0);
+  else if (number == __SK_ModWheel_) // 1
+    vibratoGain_ = ( norm * 0.4 );
+  else if (number == __SK_AfterTouch_Cont_) // 128
+    adsr_.setTarget( norm );
+  else {
+    errorString_ << "Flute::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "Flute::controlChange: number = " << number << ", value = " << value << ".";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Function.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Function.cpp
new file mode 100644
index 0000000..51fadce
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Function.cpp
@@ -0,0 +1,57 @@
+/***************************************************/
+/*! \class Function
+    \brief STK abstract function parent class.
+
+    This class provides common functionality for STK classes which
+    implement tables or other types of input to output function
+    mappings.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Function.h"
+
+using namespace Nyq;
+
+Function :: Function() : Stk()
+{
+  lastOutput_ = (StkFloat) 0.0;
+}
+
+Function :: ~Function()
+{
+}
+
+StkFloat Function :: tick( StkFloat input )
+{
+  return computeSample( input );
+}
+
+StkFrames& Function :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "Function::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = computeSample( frames[i] );
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = computeSample( frames[index] );
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
+      frames[iStart] = computeSample( frames[iStart] );
+  }
+
+  return frames;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Generator.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Generator.cpp
new file mode 100644
index 0000000..9b703d6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Generator.cpp
@@ -0,0 +1,56 @@
+/***************************************************/
+/*! \class Generator
+    \brief STK abstract unit generator parent class.
+
+    This class provides common functionality for
+    STK unit generator sample-source subclasses.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Generator.h"
+
+using namespace Nyq;
+
+Generator :: Generator() : Stk()
+{
+  lastOutput_ = 0.0;
+}
+
+Generator :: ~Generator()
+{
+}
+
+StkFloat Generator :: tick( void )
+{
+  return computeSample();
+}
+
+StkFrames& Generator :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "Generator::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = computeSample();
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = computeSample();
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
+      frames[iStart] = computeSample();
+  }
+
+  return frames;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Instrmnt.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Instrmnt.cpp
new file mode 100644
index 0000000..35127a7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Instrmnt.cpp
@@ -0,0 +1,83 @@
+/***************************************************/
+/*! \class Instrmnt
+    \brief STK instrument abstract base class.
+
+    This class provides a common interface for
+    all STK instruments.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Instrmnt.h"
+
+using namespace Nyq;
+
+Instrmnt :: Instrmnt()
+{
+}
+
+Instrmnt :: ~Instrmnt()
+{
+}
+
+void Instrmnt :: setFrequency(StkFloat frequency)
+{
+  errorString_ << "Instrmnt::setFrequency: virtual setFrequency function call!";
+  handleError( StkError::WARNING );
+}
+
+StkFloat Instrmnt :: lastOut() const
+{
+  return lastOutput_;
+}
+
+// Support for stereo output:
+StkFloat Instrmnt :: lastOutLeft(void) const
+{
+  return 0.5 * lastOutput_;
+}
+                                                                                
+StkFloat Instrmnt :: lastOutRight(void) const
+{
+  return 0.5 * lastOutput_;
+}
+
+StkFloat Instrmnt :: tick( void )
+{
+  return computeSample();
+}
+
+StkFrames& Instrmnt :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "Instrmnt::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = tick();
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = tick();
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++, iStart++ )
+      frames[iStart] = tick();
+  }
+
+  return frames;
+}
+
+void Instrmnt :: controlChange(int number, StkFloat value)
+{
+  errorString_ << "Instrmnt::controlChange: virtual function call!";
+  handleError( StkError::WARNING );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/JCRev.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/JCRev.cpp
new file mode 100644
index 0000000..10dffc6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/JCRev.cpp
@@ -0,0 +1,125 @@
+/***************************************************/
+/*! \class JCRev
+    \brief John Chowning's reverberator class.
+
+    This class is derived from the CLM JCRev
+    function, which is based on the use of
+    networks of simple allpass and comb delay
+    filters.  This class implements three series
+    allpass units, followed by four parallel comb
+    filters, and two decorrelation delay lines in
+    parallel at the output.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "JCRev.h"
+#include <math.h>
+
+using namespace Nyq;
+
+JCRev :: JCRev(StkFloat T60)
+{
+  // Delay lengths for 44100 Hz sample rate.
+  int lengths[9] = {1777, 1847, 1993, 2137, 389, 127, 43, 211, 179};
+  double scaler = Stk::sampleRate() / 44100.0;
+
+  int delay, i;
+  if ( scaler != 1.0 ) {
+    for (i=0; i<9; i++) {
+      delay = (int) floor(scaler * lengths[i]);
+      if ( (delay & 1) == 0) delay++;
+      while ( !this->isPrime(delay) ) delay += 2;
+      lengths[i] = delay;
+    }
+  }
+
+  for (i=0; i<3; i++) {
+	  allpassDelays_[i].setMaximumDelay( lengths[i+4] );
+	  allpassDelays_[i].setDelay( lengths[i+4] );
+  }
+
+  for ( i=0; i<4; i++ ) {
+    combDelays_[i].setMaximumDelay( lengths[i] );
+    combDelays_[i].setDelay( lengths[i] );
+  }
+
+  this->setT60( T60 );
+  outLeftDelay_.setMaximumDelay( lengths[7] );
+  outLeftDelay_.setDelay( lengths[7] );
+  outRightDelay_.setMaximumDelay( lengths[8] );
+  outRightDelay_.setDelay( lengths[8] );
+  allpassCoefficient_ = 0.7;
+  effectMix_ = 0.3;
+  this->clear();
+}
+
+JCRev :: ~JCRev()
+{
+}
+
+void JCRev :: clear()
+{
+  allpassDelays_[0].clear();
+  allpassDelays_[1].clear();
+  allpassDelays_[2].clear();
+  combDelays_[0].clear();
+  combDelays_[1].clear();
+  combDelays_[2].clear();
+  combDelays_[3].clear();
+  outRightDelay_.clear();
+  outLeftDelay_.clear();
+  lastOutput_[0] = 0.0;
+  lastOutput_[1] = 0.0;
+}
+
+void JCRev :: setT60( StkFloat T60 )
+{
+  for ( int i=0; i<4; i++ )
+    combCoefficient_[i] = pow(10.0, (-3.0 * combDelays_[i].getDelay() / (T60 * Stk::sampleRate())));
+}
+
+StkFloat JCRev :: computeSample(StkFloat input)
+{
+  StkFloat temp, temp0, temp1, temp2, temp3, temp4, temp5, temp6;
+  StkFloat filtout;
+
+  temp = allpassDelays_[0].lastOut();
+  temp0 = allpassCoefficient_ * temp;
+  temp0 += input;
+  allpassDelays_[0].tick(temp0);
+  temp0 = -(allpassCoefficient_ * temp0) + temp;
+    
+  temp = allpassDelays_[1].lastOut();
+  temp1 = allpassCoefficient_ * temp;
+  temp1 += temp0;
+  allpassDelays_[1].tick(temp1);
+  temp1 = -(allpassCoefficient_ * temp1) + temp;
+    
+  temp = allpassDelays_[2].lastOut();
+  temp2 = allpassCoefficient_ * temp;
+  temp2 += temp1;
+  allpassDelays_[2].tick(temp2);
+  temp2 = -(allpassCoefficient_ * temp2) + temp;
+    
+  temp3 = temp2 + (combCoefficient_[0] * combDelays_[0].lastOut());
+  temp4 = temp2 + (combCoefficient_[1] * combDelays_[1].lastOut());
+  temp5 = temp2 + (combCoefficient_[2] * combDelays_[2].lastOut());
+  temp6 = temp2 + (combCoefficient_[3] * combDelays_[3].lastOut());
+
+  combDelays_[0].tick(temp3);
+  combDelays_[1].tick(temp4);
+  combDelays_[2].tick(temp5);
+  combDelays_[3].tick(temp6);
+
+  filtout = temp3 + temp4 + temp5 + temp6;
+
+  lastOutput_[0] = effectMix_ * (outLeftDelay_.tick(filtout));
+  lastOutput_[1] = effectMix_ * (outRightDelay_.tick(filtout));
+  temp = (1.0 - effectMix_) * input;
+  lastOutput_[0] += temp;
+  lastOutput_[1] += temp;
+    
+  return Effect::lastOut();
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/JetTable.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/JetTable.cpp
new file mode 100644
index 0000000..0049a79
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/JetTable.cpp
@@ -0,0 +1,41 @@
+/***************************************************/
+/*! \class JetTable
+    \brief STK jet table class.
+
+    This class implements a flue jet non-linear
+    function, computed by a polynomial calculation.
+    Contrary to the name, this is not a "table".
+
+    Consult Fletcher and Rossing, Karjalainen,
+    Cook, and others for more information.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "JetTable.h"
+
+using namespace Nyq;
+
+JetTable :: JetTable() : Function()
+{
+}
+
+JetTable :: ~JetTable()
+{
+}
+
+StkFloat JetTable :: computeSample( StkFloat input )
+{
+  // Perform "table lookup" using a polynomial
+  // calculation (x^3 - x), which approximates
+  // the jet sigmoid behavior.
+  lastOutput_ = input * (input * input - (StkFloat)  1.0);
+
+  // Saturate at +/- 1.0.
+  if (lastOutput_ > 1.0) 
+    lastOutput_ = (StkFloat) 1.0;
+  if (lastOutput_ < -1.0)
+    lastOutput_ = (StkFloat) -1.0; 
+  return lastOutput_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Mandolin.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Mandolin.cpp
new file mode 100644
index 0000000..a1d5cf2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Mandolin.cpp
@@ -0,0 +1,188 @@
+/***************************************************/
+/*! \class Mandolin
+    \brief STK mandolin instrument model class.
+
+    This class inherits from PluckTwo and uses
+    "commuted synthesis" techniques to model a
+    mandolin instrument.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+    Commuted Synthesis, in particular, is covered
+    by patents, granted, pending, and/or
+    applied-for.  All are assigned to the Board of
+    Trustees, Stanford University.  For
+    information, contact the Office of Technology
+    Licensing, Stanford University.
+
+    Control Change Numbers: 
+       - Body Size = 2
+       - Pluck Position = 4
+       - String Sustain = 11
+       - String Detuning = 1
+       - Microphone Position = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Mandolin.h"
+#include "SKINI.msg"
+
+using namespace Nyq;
+
+Mandolin :: Mandolin(StkFloat lowestFrequency)
+  : PluckTwo(lowestFrequency)
+{
+  // Concatenate the STK rawwave path to the rawwave files
+  soundfile_[0] = new FileWvIn( (Stk::rawwavePath() + "mand1.raw").c_str(), true );
+  soundfile_[1] = new FileWvIn( (Stk::rawwavePath() + "mand2.raw").c_str(), true );
+  soundfile_[2] = new FileWvIn( (Stk::rawwavePath() + "mand3.raw").c_str(), true );
+  soundfile_[3] = new FileWvIn( (Stk::rawwavePath() + "mand4.raw").c_str(), true );
+  soundfile_[4] = new FileWvIn( (Stk::rawwavePath() + "mand5.raw").c_str(), true );
+  soundfile_[5] = new FileWvIn( (Stk::rawwavePath() + "mand6.raw").c_str(), true );
+  soundfile_[6] = new FileWvIn( (Stk::rawwavePath() + "mand7.raw").c_str(), true );
+  soundfile_[7] = new FileWvIn( (Stk::rawwavePath() + "mand8.raw").c_str(), true );
+  soundfile_[8] = new FileWvIn( (Stk::rawwavePath() + "mand9.raw").c_str(), true );
+  soundfile_[9] = new FileWvIn( (Stk::rawwavePath() + "mand10.raw").c_str(), true );
+  soundfile_[10] = new FileWvIn( (Stk::rawwavePath() + "mand11.raw").c_str(), true );
+  soundfile_[11] = new FileWvIn( (Stk::rawwavePath() + "mand12.raw").c_str(), true );
+
+  mic_ = 0;
+  dampTime_ = 0;
+  waveDone_ = soundfile_[mic_]->isFinished();
+}
+
+Mandolin :: ~Mandolin()
+{
+  for ( int i=0; i<12; i++ )
+    delete soundfile_[i];
+}
+
+void Mandolin :: pluck(StkFloat amplitude)
+{
+  // This function gets interesting, because pluck
+  // may be longer than string length, so we just
+  // reset the soundfile and add in the pluck in
+  // the tick method.
+  soundfile_[mic_]->reset();
+  waveDone_ = false;
+  pluckAmplitude_ = amplitude;
+  if ( amplitude < 0.0 ) {
+    errorString_ << "Mandolin::pluck: amplitude parameter less than zero ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    pluckAmplitude_ = 0.0;
+  }
+  else if ( amplitude > 1.0 ) {
+    errorString_ << "Mandolin::pluck: amplitude parameter greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    pluckAmplitude_ = 1.0;
+  }
+
+  // Set the pick position, which puts zeroes at position * length.
+  combDelay_.setDelay( 0.5 * pluckPosition_ * lastLength_ ); 
+  dampTime_ = (long) lastLength_;   // See tick method below.
+}
+
+void Mandolin :: pluck(StkFloat amplitude, StkFloat position)
+{
+  // Pluck position puts zeroes at position * length.
+  pluckPosition_ = position;
+  if ( position < 0.0 ) {
+    std::cerr << "Mandolin::pluck: position parameter less than zero ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    pluckPosition_ = 0.0;
+  }
+  else if ( position > 1.0 ) {
+    errorString_ << "Mandolin::pluck: amplitude parameter greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    pluckPosition_ = 1.0;
+  }
+
+  this->pluck( amplitude );
+}
+
+void Mandolin :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency( frequency );
+  this->pluck( amplitude );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Mandolin::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Mandolin :: setBodySize(StkFloat size)
+{
+  // Scale the commuted body response by its sample rate (22050).
+  StkFloat rate = size * 22050.0 / Stk::sampleRate();
+  for ( int i=0; i<12; i++ )
+    soundfile_[i]->setRate( rate );
+}
+
+StkFloat Mandolin :: computeSample()
+{
+  StkFloat temp = 0.0;
+  if ( !waveDone_ ) {
+    // Scale the pluck excitation with comb
+    // filtering for the duration of the file.
+    temp = soundfile_[mic_]->tick() * pluckAmplitude_;
+    temp = temp - combDelay_.tick(temp);
+    waveDone_ = soundfile_[mic_]->isFinished();
+  }
+
+  // Damping hack to help avoid overflow on re-plucking.
+  if ( dampTime_ >=0 ) {
+    dampTime_ -= 1;
+    // Calculate 1st delay filtered reflection plus pluck excitation.
+    lastOutput_ = delayLine_.tick( filter_.tick( temp + (delayLine_.lastOut() * 0.7) ) );
+    // Calculate 2nd delay just like the 1st.
+    lastOutput_ += delayLine2_.tick( filter2_.tick( temp + (delayLine2_.lastOut() * 0.7) ) );
+  }
+  else { // No damping hack after 1 period.
+    // Calculate 1st delay filtered reflection plus pluck excitation.
+    lastOutput_ = delayLine_.tick( filter_.tick( temp + (delayLine_.lastOut() * loopGain_) ) );
+    // Calculate 2nd delay just like the 1st.
+    lastOutput_ += delayLine2_.tick( filter2_.tick( temp + (delayLine2_.lastOut() * loopGain_) ) );
+  }
+
+  lastOutput_ *= 0.3;
+  return lastOutput_;
+}
+
+void Mandolin :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "Mandolin::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "Mandolin::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_BodySize_) // 2
+    this->setBodySize( norm * 2.0 );
+  else if (number == __SK_PickPosition_) // 4
+    this->setPluckPosition( norm );
+  else if (number == __SK_StringDamping_) // 11
+    this->setBaseLoopGain( 0.97 + (norm * 0.03));
+  else if (number == __SK_StringDetune_) // 1
+    this->setDetune( 1.0 - (norm * 0.1) );
+  else if (number == __SK_AfterTouch_Cont_) // 128
+    mic_ = (int) (norm * 11.0);
+  else {
+    errorString_ << "Mandolin::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "Mandolin::controlChange: number = " << number << ", value = " << value << ".";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Modal.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Modal.cpp
new file mode 100644
index 0000000..da00f25
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Modal.cpp
@@ -0,0 +1,210 @@
+/***************************************************/
+/*! \class Modal
+    \brief STK resonance model instrument.
+
+    This class contains an excitation wavetable,
+    an envelope, an oscillator, and N resonances
+    (non-sweeping BiQuad filters), where N is set
+    during instantiation.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Modal.h"
+#include <stdlib.h>
+
+using namespace Nyq;
+
+Modal :: Modal(unsigned int modes)
+  : nModes_(modes)
+{
+  if ( nModes_ == 0 ) {
+    errorString_ << "Modal: 'modes' argument to constructor is zero!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  // We don't make the excitation wave here yet, because we don't know
+  // what it's going to be.
+
+  ratios_.resize( nModes_ );
+  radii_.resize( nModes_ );
+  filters_ = (BiQuad **) calloc( nModes_, sizeof(BiQuad *) );
+  for (unsigned int i=0; i<nModes_; i++ ) {
+    filters_[i] = new BiQuad;
+    filters_[i]->setEqualGainZeroes();
+  }
+
+  // Set some default values.
+  vibrato_.setFrequency( 6.0 );
+  vibratoGain_ = 0.0;
+  directGain_ = 0.0;
+  masterGain_ = 1.0;
+  baseFrequency_ = 440.0;
+
+  this->clear();
+
+  stickHardness_ =  0.5;
+  strikePosition_ = 0.561;
+}  
+
+Modal :: ~Modal()
+{
+  for (unsigned int i=0; i<nModes_; i++ ) {
+    delete filters_[i];
+  }
+  free(filters_);
+}
+
+void Modal :: clear()
+{    
+  onepole_.clear();
+  for (unsigned int i=0; i<nModes_; i++ )
+    filters_[i]->clear();
+}
+
+void Modal :: setFrequency(StkFloat frequency)
+{
+  baseFrequency_ = frequency;
+  for (unsigned int i=0; i<nModes_; i++ )
+    this->setRatioAndRadius( i, ratios_[i], radii_[i] );
+}
+
+void Modal :: setRatioAndRadius(unsigned int modeIndex, StkFloat ratio, StkFloat radius)
+{
+  if ( modeIndex >= nModes_ ) {
+    errorString_ << "Modal::setRatioAndRadius: modeIndex parameter is greater than number of modes!";
+    handleError( StkError::WARNING );
+    return;
+  }
+
+  StkFloat nyquist = Stk::sampleRate() / 2.0;
+  StkFloat temp;
+
+  if ( ratio * baseFrequency_ < nyquist ) {
+    ratios_[modeIndex] = ratio;
+  }
+  else {
+    temp = ratio;
+    while (temp * baseFrequency_ > nyquist) temp *= 0.5;
+    ratios_[modeIndex] = temp;
+#if defined(_STK_DEBUG_)
+    errorString_ << "Modal::setRatioAndRadius: aliasing would occur here ... correcting.";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+  }
+  radii_[modeIndex] = radius;
+  if (ratio < 0) 
+    temp = -ratio;
+  else
+    temp = ratio * baseFrequency_;
+
+  filters_[modeIndex]->setResonance(temp, radius);
+}
+
+void Modal :: setMasterGain(StkFloat aGain)
+{
+  masterGain_ = aGain;
+}
+
+void Modal :: setDirectGain(StkFloat aGain)
+{
+  directGain_ = aGain;
+}
+
+void Modal :: setModeGain(unsigned int modeIndex, StkFloat gain)
+{
+  if ( modeIndex >= nModes_ ) {
+    errorString_ << "Modal::setModeGain: modeIndex parameter is greater than number of modes!";
+    handleError( StkError::WARNING );
+    return;
+  }
+
+  filters_[modeIndex]->setGain(gain);
+}
+
+void Modal :: strike(StkFloat amplitude)
+{
+  StkFloat gain = amplitude;
+  if ( amplitude < 0.0 ) {
+    errorString_ << "Modal::strike: amplitude is less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+    gain = 0.0;
+  }
+  else if ( amplitude > 1.0 ) {
+    errorString_ << "Modal::strike: amplitude is greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    gain = 1.0;
+  }
+
+  envelope_.setRate( 1.0 );
+  envelope_.setTarget( gain );
+  onepole_.setPole( 1.0 - gain );
+  envelope_.tick();
+  wave_->reset();
+
+  StkFloat temp;
+  for (unsigned int i=0; i<nModes_; i++) {
+    if (ratios_[i] < 0)
+      temp = -ratios_[i];
+    else
+      temp = ratios_[i] * baseFrequency_;
+    filters_[i]->setResonance(temp, radii_[i]);
+  }
+}
+
+void Modal :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->strike(amplitude);
+  this->setFrequency(frequency);
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Modal::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << '.';
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Modal :: noteOff(StkFloat amplitude)
+{
+  // This calls damp, but inverts the meaning of amplitude (high
+  // amplitude means fast damping).
+  this->damp( 1.0 - (amplitude * 0.03) );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Modal::NoteOff: amplitude = " << amplitude << '.';
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Modal :: damp(StkFloat amplitude)
+{
+  StkFloat temp;
+  for (unsigned int i=0; i<nModes_; i++) {
+    if (ratios_[i] < 0)
+      temp = -ratios_[i];
+    else
+      temp = ratios_[i] * baseFrequency_;
+    filters_[i]->setResonance(temp, radii_[i]*amplitude);
+  }
+}
+
+StkFloat Modal :: computeSample()
+{
+  StkFloat temp = masterGain_ * onepole_.tick( wave_->tick() * envelope_.tick() );
+
+  StkFloat temp2 = 0.0;
+  for (unsigned int i=0; i<nModes_; i++)
+    temp2 += filters_[i]->tick(temp);
+
+  temp2  -= temp2 * directGain_;
+  temp2 += directGain_ * temp;
+
+  if (vibratoGain_ != 0.0)	{
+    // Calculate AM and apply to master out
+    temp = 1.0 + (vibrato_.tick() * vibratoGain_);
+    temp2 = temp * temp2;
+  }
+    
+  lastOutput_ = temp2;
+  return lastOutput_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/ModalBar.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/ModalBar.cpp
new file mode 100644
index 0000000..38e2165
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/ModalBar.cpp
@@ -0,0 +1,198 @@
+/***************************************************/
+/*! \class ModalBar
+    \brief STK resonant bar instrument class.
+
+    This class implements a number of different
+    struck bar instruments.  It inherits from the
+    Modal class.
+
+    Control Change Numbers: 
+       - Stick Hardness = 2
+       - Stick Position = 4
+       - Vibrato Gain = 8
+       - Vibrato Frequency = 11
+       - Direct Stick Mix = 1
+       - Volume = 128
+       - Modal Presets = 16
+         - Marimba = 0
+         - Vibraphone = 1
+         - Agogo = 2
+         - Wood1 = 3
+         - Reso = 4
+         - Wood2 = 5
+         - Beats = 6
+         - Two Fixed = 7
+         - Clump = 8
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "ModalBar.h"
+#include "SKINI.msg"
+#include <cmath>
+
+using namespace Nyq;
+
+ModalBar :: ModalBar()
+  : Modal()
+{
+  // Concatenate the STK rawwave path to the rawwave file
+  wave_ = new FileWvIn( (Stk::rawwavePath() + "marmstk1.raw").c_str(), true );
+  wave_->setRate( 0.5 * 22050.0 / Stk::sampleRate() );
+
+  // Set the resonances for preset 0 (marimba).
+  this->setPreset( 0 );
+}
+
+ModalBar :: ~ModalBar()
+{
+  delete wave_;
+}
+
+void ModalBar :: setStickHardness(StkFloat hardness)
+{
+  stickHardness_ = hardness;
+  if ( hardness < 0.0 ) {
+    errorString_ << "ModalBar::setStickHardness: parameter is less than zero ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    stickHardness_ = 0.0;
+  }
+  else if ( hardness > 1.0 ) {
+    errorString_ << "ModalBar::setStickHarness: parameter is greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    stickHardness_ = 1.0;
+  }
+
+  wave_->setRate( (0.25 * pow(4.0, stickHardness_) ) );
+  masterGain_ = 0.1 + (1.8 * stickHardness_);
+}
+
+void ModalBar :: setStrikePosition(StkFloat position)
+{
+  strikePosition_ = position;
+  if ( position < 0.0 ) {
+    errorString_ << "ModalBar::setStrikePosition: parameter is less than zero ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    strikePosition_ = 0.0;
+  }
+  else if ( position > 1.0 ) {
+    errorString_ << "ModalBar::setStrikePosition: parameter is greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    strikePosition_ = 1.0;
+  }
+
+  // Hack only first three modes.
+  StkFloat temp2 = position * PI;
+  StkFloat temp = sin(temp2);                                       
+  this->setModeGain(0, 0.12 * temp);
+
+  temp = sin(0.05 + (3.9 * temp2));
+  this->setModeGain(1, -0.03 * temp);
+
+  temp = sin(-0.05 + (11 * temp2));
+  this->setModeGain(2, 0.11 * temp);
+}
+
+void ModalBar :: setPreset(int preset)
+{
+  // Presets:
+  //     First line:  relative modal frequencies (negative number is
+  //                  a fixed mode that doesn't scale with frequency
+  //     Second line: resonances of the modes
+  //     Third line:  mode volumes
+  //     Fourth line: stickHardness, strikePosition, and direct stick
+  //                  gain (mixed directly into the output
+  static StkFloat presets[9][4][4] = { 
+    {{1.0, 3.99, 10.65, -2443},		// Marimba
+     {0.9996, 0.9994, 0.9994, 0.999},
+     {0.04, 0.01, 0.01, 0.008},
+     {0.429688, 0.445312, 0.093750}},
+    {{1.0, 2.01, 3.9, 14.37}, 		// Vibraphone
+     {0.99995, 0.99991, 0.99992, 0.9999},	
+     {0.025, 0.015, 0.015, 0.015 },
+     {0.390625,0.570312,0.078125}},
+    {{1.0, 4.08, 6.669, -3725.0},		// Agogo 
+     {0.999, 0.999, 0.999, 0.999},	
+     {0.06, 0.05, 0.03, 0.02},
+     {0.609375,0.359375,0.140625}},
+    {{1.0, 2.777, 7.378, 15.377},		// Wood1
+     {0.996, 0.994, 0.994, 0.99},	
+     {0.04, 0.01, 0.01, 0.008},
+     {0.460938,0.375000,0.046875}},
+    {{1.0, 2.777, 7.378, 15.377},		// Reso
+     {0.99996, 0.99994, 0.99994, 0.9999},	
+     {0.02, 0.005, 0.005, 0.004},
+     {0.453125,0.250000,0.101562}},
+    {{1.0, 1.777, 2.378, 3.377},		// Wood2
+     {0.996, 0.994, 0.994, 0.99},	
+     {0.04, 0.01, 0.01, 0.008},
+     {0.312500,0.445312,0.109375}},
+    {{1.0, 1.004, 1.013, 2.377},		// Beats
+     {0.9999, 0.9999, 0.9999, 0.999},	
+     {0.02, 0.005, 0.005, 0.004},
+     {0.398438,0.296875,0.070312}},
+    {{1.0, 4.0, -1320.0, -3960.0},		// 2Fix
+     {0.9996, 0.999, 0.9994, 0.999},	
+     {0.04, 0.01, 0.01, 0.008},
+     {0.453125,0.453125,0.070312}},
+    {{1.0, 1.217, 1.475, 1.729},		// Clump
+     {0.999, 0.999, 0.999, 0.999},	
+     {0.03, 0.03, 0.03, 0.03 },
+     {0.390625,0.570312,0.078125}},
+  };
+
+  int temp = (preset % 9);
+  for (unsigned int i=0; i<nModes_; i++) {
+    this->setRatioAndRadius(i, presets[temp][0][i], presets[temp][1][i]);
+    this->setModeGain(i, presets[temp][2][i]);
+  }
+
+  this->setStickHardness(presets[temp][3][0]);
+  this->setStrikePosition(presets[temp][3][1]);
+  directGain_ = presets[temp][3][2];
+
+  if (temp == 1) // vibraphone
+    vibratoGain_ = 0.2;
+  else
+    vibratoGain_ = 0.0;
+}
+
+void ModalBar :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "ModalBar::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "ModalBar::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_StickHardness_) // 2
+    this->setStickHardness( norm );
+  else if (number == __SK_StrikePosition_) // 4
+    this->setStrikePosition( norm );
+  else if (number == __SK_ProphesyRibbon_) // 16
+		this->setPreset((int) value);
+  else if (number == __SK_Balance_) // 8
+    vibratoGain_ = norm * 0.3;
+  else if (number == __SK_ModWheel_) // 1
+    directGain_ = norm;
+  else if (number == __SK_ModFrequency_) // 11
+    vibrato_.setFrequency( norm * 12.0 );
+  else if (number == __SK_AfterTouch_Cont_)	// 128
+    envelope_.setTarget( norm );
+  else {
+    errorString_ << "ModalBar::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "ModalBar::controlChange: number = " << number << ", value = " << value << '.';
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/NRev.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/NRev.cpp
new file mode 100644
index 0000000..55f2b96
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/NRev.cpp
@@ -0,0 +1,117 @@
+/***************************************************/
+/*! \class NRev
+    \brief CCRMA's NRev reverberator class.
+
+    This class is derived from the CLM NRev
+    function, which is based on the use of
+    networks of simple allpass and comb delay
+    filters.  This particular arrangement consists
+    of 6 comb filters in parallel, followed by 3
+    allpass filters, a lowpass filter, and another
+    allpass in series, followed by two allpass
+    filters in parallel with corresponding right
+    and left outputs.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "NRev.h"
+#include <math.h>
+
+using namespace Nyq;
+
+NRev :: NRev(StkFloat T60)
+{
+  int lengths[15] = {1433, 1601, 1867, 2053, 2251, 2399, 347, 113, 37, 59, 53, 43, 37, 29, 19};
+  double scaler = Stk::sampleRate() / 25641.0;
+
+  int delay, i;
+  for (i=0; i<15; i++) {
+    delay = (int) floor(scaler * lengths[i]);
+    if ( (delay & 1) == 0) delay++;
+    while ( !this->isPrime(delay) ) delay += 2;
+    lengths[i] = delay;
+  }
+
+  for (i=0; i<6; i++) {
+    combDelays_[i].setMaximumDelay( lengths[i] );
+    combDelays_[i].setDelay( lengths[i] );
+    combCoefficient_[i] = pow(10.0, (-3 * lengths[i] / (T60 * Stk::sampleRate())));
+  }
+
+  for (i=0; i<8; i++) {
+	  allpassDelays_[i].setMaximumDelay( lengths[i+6] );
+	  allpassDelays_[i].setDelay( lengths[i+6] );
+  }
+
+  this->setT60( T60 );
+  allpassCoefficient_ = 0.7;
+  effectMix_ = 0.3;
+  this->clear();
+}
+
+NRev :: ~NRev()
+{
+}
+
+void NRev :: clear()
+{
+  int i;
+  for (i=0; i<6; i++) combDelays_[i].clear();
+  for (i=0; i<8; i++) allpassDelays_[i].clear();
+  lastOutput_[0] = 0.0;
+  lastOutput_[1] = 0.0;
+  lowpassState_ = 0.0;
+}
+
+void NRev :: setT60( StkFloat T60 )
+{
+  for ( int i=0; i<6; i++ )
+    combCoefficient_[i] = pow(10.0, (-3.0 * combDelays_[i].getDelay() / (T60 * Stk::sampleRate())));
+}
+
+StkFloat NRev :: computeSample(StkFloat input)
+{
+  StkFloat temp, temp0, temp1, temp2, temp3;
+  int i;
+
+  temp0 = 0.0;
+  for (i=0; i<6; i++) {
+    temp = input + (combCoefficient_[i] * combDelays_[i].lastOut());
+    temp0 += combDelays_[i].tick(temp);
+  }
+  for (i=0; i<3; i++)	{
+    temp = allpassDelays_[i].lastOut();
+    temp1 = allpassCoefficient_ * temp;
+    temp1 += temp0;
+    allpassDelays_[i].tick(temp1);
+    temp0 = -(allpassCoefficient_ * temp1) + temp;
+  }
+
+	// One-pole lowpass filter.
+  lowpassState_ = 0.7*lowpassState_ + 0.3*temp0;
+  temp = allpassDelays_[3].lastOut();
+  temp1 = allpassCoefficient_ * temp;
+  temp1 += lowpassState_;
+  allpassDelays_[3].tick(temp1);
+  temp1 = -(allpassCoefficient_ * temp1) + temp;
+    
+  temp = allpassDelays_[4].lastOut();
+  temp2 = allpassCoefficient_ * temp;
+  temp2 += temp1;
+  allpassDelays_[4].tick(temp2);
+  lastOutput_[0] = effectMix_*(-(allpassCoefficient_ * temp2) + temp);
+    
+  temp = allpassDelays_[5].lastOut();
+  temp3 = allpassCoefficient_ * temp;
+  temp3 += temp1;
+  allpassDelays_[5].tick(temp3);
+  lastOutput_[1] = effectMix_*(-(allpassCoefficient_ * temp3) + temp);
+
+  temp = (1.0 - effectMix_) * input;
+  lastOutput_[0] += temp;
+  lastOutput_[1] += temp;
+    
+  return Effect::lastOut();
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Noise.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Noise.cpp
new file mode 100644
index 0000000..d982e02
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Noise.cpp
@@ -0,0 +1,51 @@
+/***************************************************/
+/*! \class Noise
+    \brief STK noise generator.
+
+    Generic random number generation using the
+    C rand() function.  The quality of the rand()
+    function varies from one OS to another.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Noise.h"
+#include <stdlib.h>
+#include <time.h>
+
+using namespace Nyq;
+
+Noise :: Noise() : Generator()
+{
+  // Seed the random number generator with system time.
+  this->setSeed( 0 );
+  lastOutput_ = (StkFloat) 0.0;
+}
+
+Noise :: Noise( unsigned int seed ) : Generator()
+{
+  // Seed the random number generator
+  this->setSeed( seed );
+  lastOutput_ = (StkFloat) 0.0;
+}
+
+Noise :: ~Noise()
+{
+}
+
+void Noise :: setSeed( unsigned int seed )
+{
+  if ( seed == 0 )
+    srand( (unsigned int) time(NULL) );
+  else
+    srand( seed );
+}
+
+StkFloat Noise :: computeSample()
+{
+  lastOutput_ = (StkFloat) (2.0 * rand() / (RAND_MAX + 1.0) );
+  lastOutput_ -= 1.0;
+  return lastOutput_;
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/OnePole.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/OnePole.cpp
new file mode 100644
index 0000000..97eee7b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/OnePole.cpp
@@ -0,0 +1,99 @@
+/***************************************************/
+/*! \class OnePole
+    \brief STK one-pole filter class.
+
+    This protected Filter subclass implements
+    a one-pole digital filter.  A method is
+    provided for setting the pole position along
+    the real axis of the z-plane while maintaining
+    a constant peak filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "OnePole.h"
+
+using namespace Nyq;
+
+OnePole :: OnePole() : Filter()
+{
+  std::vector<StkFloat> b(1, 0.1);
+  std::vector<StkFloat> a(2, 1.0);
+  a[1] = -0.9;
+  Filter::setCoefficients( b, a );
+}
+
+OnePole :: OnePole(StkFloat thePole) : Filter()
+{
+  std::vector<StkFloat> b(1);
+  std::vector<StkFloat> a(2, 1.0);
+  a[1] = -thePole;
+
+  // Normalize coefficients for peak unity gain.
+  if (thePole > 0.0)
+    b[0] = (StkFloat) (1.0 - thePole);
+  else
+    b[0] = (StkFloat) (1.0 + thePole);
+
+  Filter::setCoefficients( b, a );
+}
+
+OnePole :: ~OnePole()    
+{
+}
+
+void OnePole :: clear(void)
+{
+  Filter::clear();
+}
+
+void OnePole :: setB0(StkFloat b0)
+{
+  b_[0] = b0;
+}
+
+void OnePole :: setA1(StkFloat a1)
+{
+  a_[1] = a1;
+}
+
+void OnePole :: setPole(StkFloat thePole)
+{
+  // Normalize coefficients for peak unity gain.
+  if (thePole > 0.0)
+    b_[0] = (StkFloat) (1.0 - thePole);
+  else
+    b_[0] = (StkFloat) (1.0 + thePole);
+
+  a_[1] = -thePole;
+}
+
+void OnePole :: setGain(StkFloat gain)
+{
+  Filter::setGain(gain);
+}
+
+StkFloat OnePole :: getGain(void) const
+{
+  return Filter::getGain();
+}
+
+StkFloat OnePole :: lastOut(void) const
+{
+  return Filter::lastOut();
+}
+
+StkFloat OnePole :: tick( StkFloat input )
+{
+  inputs_[0] = gain_ * input;
+  outputs_[0] = b_[0] * inputs_[0] - a_[1] * outputs_[1];
+  outputs_[1] = outputs_[0];
+
+  return outputs_[0];
+}
+
+StkFrames& OnePole :: tick( StkFrames& frames, unsigned int channel )
+{
+  return Filter::tick( frames, channel );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/OneZero.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/OneZero.cpp
new file mode 100644
index 0000000..2aed1c1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/OneZero.cpp
@@ -0,0 +1,98 @@
+/***************************************************/
+/*! \class OneZero
+    \brief STK one-zero filter class.
+
+    This protected Filter subclass implements
+    a one-zero digital filter.  A method is
+    provided for setting the zero position
+    along the real axis of the z-plane while
+    maintaining a constant filter gain.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "OneZero.h"
+
+using namespace Nyq;
+
+OneZero :: OneZero() : Filter()
+{
+  std::vector<StkFloat> b(2, 0.5);
+  std::vector<StkFloat> a(1, 1.0);
+  Filter::setCoefficients( b, a );
+}
+
+OneZero :: OneZero(StkFloat theZero) : Filter()
+{
+  std::vector<StkFloat> b(2);
+  std::vector<StkFloat> a(1, 1.0);
+
+  // Normalize coefficients for unity gain.
+  if (theZero > 0.0)
+    b[0] = 1.0 / ((StkFloat) 1.0 + theZero);
+  else
+    b[0] = 1.0 / ((StkFloat) 1.0 - theZero);
+
+  b[1] = -theZero * b[0];
+  Filter::setCoefficients( b, a );
+}
+
+OneZero :: ~OneZero(void)
+{
+}
+
+void OneZero :: clear(void)
+{
+  Filter::clear();
+}
+
+void OneZero :: setB0(StkFloat b0)
+{
+  b_[0] = b0;
+}
+
+void OneZero :: setB1(StkFloat b1)
+{
+  b_[1] = b1;
+}
+
+void OneZero :: setZero(StkFloat theZero)
+{
+  // Normalize coefficients for unity gain.
+  if (theZero > 0.0)
+    b_[0] = 1.0 / ((StkFloat) 1.0 + theZero);
+  else
+    b_[0] = 1.0 / ((StkFloat) 1.0 - theZero);
+
+  b_[1] = -theZero * b_[0];
+}
+
+void OneZero :: setGain(StkFloat gain)
+{
+  Filter::setGain(gain);
+}
+
+StkFloat OneZero :: getGain(void) const
+{
+  return Filter::getGain();
+}
+
+StkFloat OneZero :: lastOut(void) const
+{
+  return Filter::lastOut();
+}
+
+StkFloat OneZero :: tick( StkFloat input )
+{
+  inputs_[0] = gain_ * input;
+  outputs_[0] = b_[1] * inputs_[1] + b_[0] * inputs_[0];
+  inputs_[1] = inputs_[0];
+
+  return outputs_[0];
+}
+
+StkFrames& OneZero :: tick( StkFrames& frames, unsigned int channel )
+{
+  return Filter::tick( frames, channel );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/PRCRev.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/PRCRev.cpp
new file mode 100644
index 0000000..c357b38
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/PRCRev.cpp
@@ -0,0 +1,100 @@
+/***************************************************/
+/*! \class PRCRev
+    \brief Perry's simple reverberator class.
+
+    This class is based on some of the famous
+    Stanford/CCRMA reverbs (NRev, KipRev), which
+    were based on the Chowning/Moorer/Schroeder
+    reverberators using networks of simple allpass
+    and comb delay filters.  This class implements
+    two series allpass units and two parallel comb
+    filters.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "PRCRev.h"
+#include <math.h>
+
+using namespace Nyq;
+
+PRCRev :: PRCRev(StkFloat T60)
+{
+  // Delay lengths for 44100 Hz sample rate.
+  int lengths[4]= {353, 1097, 1777, 2137};
+  double scaler = Stk::sampleRate() / 44100.0;
+
+  // Scale the delay lengths if necessary.
+  int delay, i;
+  if ( scaler != 1.0 ) {
+    for (i=0; i<4; i++)	{
+      delay = (int) floor(scaler * lengths[i]);
+      if ( (delay & 1) == 0) delay++;
+      while ( !this->isPrime(delay) ) delay += 2;
+      lengths[i] = delay;
+    }
+  }
+
+  for (i=0; i<2; i++)	{
+	  allpassDelays_[i].setMaximumDelay( lengths[i] );
+	  allpassDelays_[i].setDelay( lengths[i] );
+
+    combDelays_[i].setMaximumDelay( lengths[i+2] );
+    combDelays_[i].setDelay( lengths[i+2] );
+  }
+
+  this->setT60( T60 );
+  allpassCoefficient_ = 0.7;
+  effectMix_ = 0.5;
+  this->clear();
+}
+
+PRCRev :: ~PRCRev()
+{
+}
+
+void PRCRev :: clear()
+{
+  allpassDelays_[0].clear();
+  allpassDelays_[1].clear();
+  combDelays_[0].clear();
+  combDelays_[1].clear();
+  lastOutput_[0] = 0.0;
+  lastOutput_[1] = 0.0;
+}
+
+void PRCRev :: setT60( StkFloat T60 )
+{
+  combCoefficient_[0] = pow(10.0, (-3.0 * combDelays_[0].getDelay() / (T60 * Stk::sampleRate())));
+  combCoefficient_[1] = pow(10.0, (-3.0 * combDelays_[1].getDelay() / (T60 * Stk::sampleRate())));
+}
+
+StkFloat PRCRev :: computeSample(StkFloat input)
+{
+  StkFloat temp, temp0, temp1, temp2, temp3;
+
+  temp = allpassDelays_[0].lastOut();
+  temp0 = allpassCoefficient_ * temp;
+  temp0 += input;
+  allpassDelays_[0].tick(temp0);
+  temp0 = -(allpassCoefficient_ * temp0) + temp;
+    
+  temp = allpassDelays_[1].lastOut();
+  temp1 = allpassCoefficient_ * temp;
+  temp1 += temp0;
+  allpassDelays_[1].tick(temp1);
+  temp1 = -(allpassCoefficient_ * temp1) + temp;
+    
+  temp2 = temp1 + (combCoefficient_[0] * combDelays_[0].lastOut());
+  temp3 = temp1 + (combCoefficient_[1] * combDelays_[1].lastOut());
+
+  lastOutput_[0] = effectMix_ * (combDelays_[0].tick(temp2));
+  lastOutput_[1] = effectMix_ * (combDelays_[1].tick(temp3));
+  temp = (1.0 - effectMix_) * input;
+  lastOutput_[0] += temp;
+  lastOutput_[1] += temp;
+    
+  return Effect::lastOut();
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/PitShift.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/PitShift.cpp
new file mode 100644
index 0000000..97fd986
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/PitShift.cpp
@@ -0,0 +1,90 @@
+/***************************************************/
+/*! \class PitShift
+    \brief STK simple pitch shifter effect class.
+
+    This class implements a simple pitch shifter
+    using delay lines.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "PitShift.h"
+#include <cmath>
+
+using namespace Nyq;
+
+const int maxDelay = 5024;
+
+PitShift :: PitShift()
+{
+  delayLength = maxDelay - 24;
+  halfLength = delayLength / 2;
+  delay_[0] = 12;
+  delay_[1] = maxDelay / 2;
+
+  delayLine_[0].setMaximumDelay( maxDelay );
+  delayLine_[0].setDelay( delay_[0] );
+  delayLine_[1].setMaximumDelay( maxDelay );
+  delayLine_[1].setDelay( delay_[1] );
+  effectMix_ = 0.5;
+  rate_ = 1.0;
+}
+
+PitShift :: ~PitShift()
+{
+}
+
+void PitShift :: clear()
+{
+  delayLine_[0].clear();
+  delayLine_[1].clear();
+  lastOutput_[0] = 0.0;
+  lastOutput_[1] = 0.0;
+}
+
+void PitShift :: setShift(StkFloat shift)
+{
+  if (shift < 1.0) {
+    rate_ = 1.0 - shift; 
+  }
+  else if (shift > 1.0) {
+    rate_ = 1.0 - shift;
+  }
+  else {
+    rate_ = 0.0;
+    delay_[0] = halfLength+12;
+  }
+}
+
+StkFloat PitShift :: computeSample(StkFloat input)
+{
+  // Calculate the two delay length values, keeping them within the
+  // range 12 to maxDelay-12.
+  delay_[0] += rate_;
+  while (delay_[0] > maxDelay-12) delay_[0] -= delayLength;
+  while (delay_[0] < 12) delay_[0] += delayLength;
+
+  delay_[1] = delay_[0] + halfLength;
+  while (delay_[1] > maxDelay-12) delay_[1] -= delayLength;
+  while (delay_[1] < 12) delay_[1] += delayLength;
+
+  // Set the new delay line lengths.
+  delayLine_[0].setDelay((long)delay_[0]);
+  delayLine_[1].setDelay((long)delay_[1]);
+
+  // Calculate a triangular envelope.
+  env_[1] = fabs( (delay_[0] - halfLength + 12) * (1.0 / (halfLength+12) ) );
+  env_[0] = 1.0 - env_[1];
+
+  // Delay input and apply envelope.
+  lastOutput_[0] =  env_[0] * delayLine_[0].tick(input);
+  lastOutput_[0] += env_[1] * delayLine_[1].tick(input);
+
+  // Compute effect mix and output.
+  lastOutput_[0] *= effectMix_;
+  lastOutput_[0] += (1.0 - effectMix_) * input;
+  lastOutput_[1] = lastOutput_[0];
+
+  return lastOutput_[0];
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/PluckTwo.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/PluckTwo.cpp
new file mode 100644
index 0000000..2d8ad4e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/PluckTwo.cpp
@@ -0,0 +1,132 @@
+/***************************************************/
+/*! \class PluckTwo
+    \brief STK enhanced plucked string model class.
+
+    This class implements an enhanced two-string,
+    plucked physical model, a la Jaffe-Smith,
+    Smith, and others.
+
+    PluckTwo is an abstract class, with no excitation
+    specified.  Therefore, it can't be directly
+    instantiated.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "PluckTwo.h"
+
+using namespace Nyq;
+
+PluckTwo :: PluckTwo(StkFloat lowestFrequency)
+{
+  length_ = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1);
+  lastLength_ = length_ * 0.5;
+  delayLine_.setMaximumDelay( length_ );
+  delayLine_.setDelay( lastLength_ );
+  delayLine2_.setMaximumDelay( length_ );
+  delayLine2_.setDelay( lastLength_ );
+  combDelay_.setMaximumDelay( length_ );
+  combDelay_.setDelay( lastLength_ );
+
+  baseLoopGain_ = 0.995;
+  loopGain_ = 0.999;
+  pluckAmplitude_ = 0.3;
+  pluckPosition_ = 0.4;
+  detuning_ = 0.995;
+  lastFrequency_ = lowestFrequency * 2.0;
+
+}
+
+PluckTwo :: ~PluckTwo()
+{
+}
+
+void PluckTwo :: clear()
+{
+  delayLine_.clear();
+  delayLine2_.clear();
+  combDelay_.clear();
+  filter_.clear();
+  filter2_.clear();
+}
+
+void PluckTwo :: setFrequency(StkFloat frequency)
+{
+  lastFrequency_ = frequency;
+  if ( lastFrequency_ <= 0.0 ) {
+    errorString_ << "Clarinet::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    lastFrequency_ = 220.0;
+  }
+
+  // Delay = length - approximate filter delay.
+  lastLength_ = Stk::sampleRate() / lastFrequency_;
+  StkFloat delay = (lastLength_ / detuning_) - 0.5;
+  if ( delay <= 0.0 ) delay = 0.3;
+  else if ( delay > length_ ) delay = length_;
+  delayLine_.setDelay( delay );
+
+  delay = (lastLength_ * detuning_) - 0.5;
+  if ( delay <= 0.0 ) delay = 0.3;
+  else if ( delay > length_ ) delay = length_;
+  delayLine2_.setDelay( delay );
+
+  loopGain_ = baseLoopGain_ + (frequency * 0.000005);
+  if ( loopGain_ > 1.0 ) loopGain_ = 0.99999;
+}
+
+void PluckTwo :: setDetune(StkFloat detune)
+{
+  detuning_ = detune;
+  if ( detuning_ <= 0.0 ) {
+    errorString_ << "Clarinet::setDeturn: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    detuning_ = 0.1;
+  }
+  delayLine_.setDelay(( lastLength_ / detuning_) - 0.5);
+  delayLine2_.setDelay( (lastLength_ * detuning_) - 0.5);
+}
+
+void PluckTwo :: setFreqAndDetune(StkFloat frequency, StkFloat detune)
+{
+  detuning_ = detune;
+  this->setFrequency( frequency );
+}
+
+void PluckTwo :: setPluckPosition(StkFloat position)
+{
+  pluckPosition_ = position;
+  if ( position < 0.0 ) {
+    errorString_ << "PluckTwo::setPluckPosition: parameter is less than zero ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    pluckPosition_ = 0.0;
+  }
+  else if ( position > 1.0 ) {
+    errorString_ << "PluckTwo::setPluckPosition: parameter is greater than one ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    pluckPosition_ = 1.0;
+  }
+}
+
+void PluckTwo :: setBaseLoopGain(StkFloat aGain)
+{
+  baseLoopGain_ = aGain;
+  loopGain_ = baseLoopGain_ + (lastFrequency_ * 0.000005);
+  if ( loopGain_ > 0.99999 ) loopGain_ = 0.99999;
+}
+
+void PluckTwo :: noteOff(StkFloat amplitude)
+{
+  loopGain_ =  (1.0 - amplitude) * 0.5;
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "PluckTwo::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/PoleZero.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/PoleZero.cpp
new file mode 100644
index 0000000..66ed574
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/PoleZero.cpp
@@ -0,0 +1,97 @@
+/***************************************************/
+/*! \class PoleZero
+    \brief STK one-pole, one-zero filter class.
+
+    This protected Filter subclass implements
+    a one-pole, one-zero digital filter.  A
+    method is provided for creating an allpass
+    filter with a given coefficient.  Another
+    method is provided to create a DC blocking filter.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "PoleZero.h"
+
+using namespace Nyq;
+
+PoleZero :: PoleZero() : Filter()
+{
+  // Default setting for pass-through.
+  std::vector<StkFloat> b(2, 0.0);
+  std::vector<StkFloat> a(2, 0.0);
+  b[0] = 1.0;
+  a[0] = 1.0;
+  Filter::setCoefficients( b, a );
+}
+
+PoleZero :: ~PoleZero()
+{
+}
+
+void PoleZero :: clear(void)
+{
+  Filter::clear();
+}
+
+void PoleZero :: setB0(StkFloat b0)
+{
+  b_[0] = b0;
+}
+
+void PoleZero :: setB1(StkFloat b1)
+{
+  b_[1] = b1;
+}
+
+void PoleZero :: setA1(StkFloat a1)
+{
+  a_[1] = a1;
+}
+
+void PoleZero :: setAllpass(StkFloat coefficient)
+{
+  b_[0] = coefficient;
+  b_[1] = 1.0;
+  a_[0] = 1.0; // just in case
+  a_[1] = coefficient;
+}
+
+void PoleZero :: setBlockZero(StkFloat thePole)
+{
+  b_[0] = 1.0;
+  b_[1] = -1.0;
+  a_[0] = 1.0; // just in case
+  a_[1] = -thePole;
+}
+
+void PoleZero :: setGain(StkFloat gain)
+{
+  Filter::setGain(gain);
+}
+
+StkFloat PoleZero :: getGain(void) const
+{
+  return Filter::getGain();
+}
+
+StkFloat PoleZero :: lastOut(void) const
+{
+  return Filter::lastOut();
+}
+
+StkFloat PoleZero :: tick( StkFloat input )
+{
+  inputs_[0] = gain_ * input;
+  outputs_[0] = b_[0] * inputs_[0] + b_[1] * inputs_[1] - a_[1] * outputs_[1];
+  inputs_[1] = inputs_[0];
+  outputs_[1] = outputs_[0];
+
+  return outputs_[0];
+}
+
+StkFrames& PoleZero :: tick( StkFrames& frames, unsigned int channel )
+{
+  return Filter::tick( frames, channel );
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/ReedTable.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/ReedTable.cpp
new file mode 100644
index 0000000..ed39a4c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/ReedTable.cpp
@@ -0,0 +1,59 @@
+/***************************************************/
+/*! \class ReedTable
+    \brief STK reed table class.
+
+    This class implements a simple one breakpoint,
+    non-linear reed function, as described by
+    Smith (1986).  This function is based on a
+    memoryless non-linear spring model of the reed
+    (the reed mass is ignored) which saturates when
+    the reed collides with the mouthpiece facing.
+
+    See McIntyre, Schumacher, & Woodhouse (1983),
+    Smith (1986), Hirschman, Cook, Scavone, and
+    others for more information.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "ReedTable.h"
+
+using namespace Nyq;
+
+ReedTable :: ReedTable()
+{
+  offset_ = (StkFloat) 0.6;  // Offset is a bias, related to reed rest position.
+  slope_ = (StkFloat) -0.8;  // Slope corresponds loosely to reed stiffness.
+}
+
+ReedTable :: ~ReedTable()
+{
+}
+
+void ReedTable :: setOffset(StkFloat offset)
+{
+  offset_ = offset;
+}
+
+void ReedTable :: setSlope(StkFloat slope)
+{
+  slope_ = slope;
+}
+
+StkFloat ReedTable :: computeSample(StkFloat input)    
+{
+  // The input is differential pressure across the reed.
+  lastOutput_ = offset_ + (slope_ * input);
+
+  // If output is > 1, the reed has slammed shut and the
+  // reflection function value saturates at 1.0.
+  if (lastOutput_ > 1.0) lastOutput_ = (StkFloat) 1.0;
+
+  // This is nearly impossible in a physical system, but
+  // a reflection function value of -1.0 corresponds to
+  // an open end (and no discontinuity in bore profile).
+  if (lastOutput_ < -1.0) lastOutput_ = (StkFloat) -1.0;
+  return lastOutput_;
+}
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Saxofony.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Saxofony.cpp
new file mode 100644
index 0000000..ae4fb5a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Saxofony.cpp
@@ -0,0 +1,198 @@
+/***************************************************/
+/*! \class Saxofony
+    \brief STK faux conical bore reed instrument class.
+
+    This class implements a "hybrid" digital
+    waveguide instrument that can generate a
+    variety of wind-like sounds.  It has also been
+    referred to as the "blowed string" model.  The
+    waveguide section is essentially that of a
+    string, with one rigid and one lossy
+    termination.  The non-linear function is a
+    reed table.  The string can be "blown" at any
+    point between the terminations, though just as
+    with strings, it is impossible to excite the
+    system at either end.  If the excitation is
+    placed at the string mid-point, the sound is
+    that of a clarinet.  At points closer to the
+    "bridge", the sound is closer to that of a
+    saxophone.  See Scavone (2002) for more details.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by Stanford
+    University, Yamaha, and others.
+
+    Control Change Numbers: 
+       - Reed Stiffness = 2
+       - Reed Aperture = 26
+       - Noise Gain = 4
+       - Blow Position = 11
+       - Vibrato Frequency = 29
+       - Vibrato Gain = 1
+       - Breath Pressure = 128
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Saxofony.h"
+#include "SKINI.msg"
+
+using namespace Nyq;
+
+Saxofony :: Saxofony(StkFloat lowestFrequency)
+{
+  length_ = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1);
+  // Initialize blowing position to 0.2 of length / 2.
+  position_ = 0.2;
+  delays_[0].setMaximumDelay( length_ );
+  delays_[0].setDelay( (1.0-position_) * (length_ >> 1) );
+  delays_[1].setMaximumDelay( length_ );
+  delays_[1].setDelay( (1.0-position_) * (length_ >> 1) );
+
+  reedTable_.setOffset( 0.7 );
+  reedTable_.setSlope( 0.3 );
+
+  vibrato_.setFrequency((StkFloat) 5.735);
+
+  outputGain_ = 0.3;
+  noiseGain_ = 0.2;
+  vibratoGain_ = 0.1;
+}
+
+Saxofony :: ~Saxofony()
+{
+}
+
+void Saxofony :: clear()
+{
+  delays_[0].clear();
+  delays_[1].clear();
+  filter_.clear();
+}
+
+void Saxofony :: setFrequency(StkFloat frequency)
+{
+  StkFloat freakency = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "Saxofony::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    freakency = 220.0;
+  }
+
+  StkFloat delay = (Stk::sampleRate() / freakency) - (StkFloat) 3.0;
+  if (delay <= 0.0) delay = 0.3;
+  else if (delay > length_) delay = length_;
+
+  delays_[0].setDelay( (1.0-position_) * delay );
+  delays_[1].setDelay( position_ * delay );
+}
+
+void Saxofony :: setBlowPosition(StkFloat position)
+{
+  if ( position_ == position ) return;
+
+  if ( position < 0.0 ) position_ = 0.0;
+  else if ( position > 1.0 ) position_ = 1.0;
+  else position_ = position;
+
+  StkFloat totalDelay = delays_[0].getDelay();
+  totalDelay += delays_[1].getDelay();
+
+  delays_[0].setDelay( (1.0-position_) * totalDelay );
+  delays_[1].setDelay( position_ * totalDelay );
+}
+
+void Saxofony :: startBlowing(StkFloat amplitude, StkFloat rate)
+{
+  envelope_.setRate( rate );
+  envelope_.setTarget( amplitude );
+}
+
+void Saxofony :: stopBlowing(StkFloat rate)
+{
+  envelope_.setRate( rate );
+  envelope_.setTarget( 0.0 );
+}
+
+void Saxofony :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency( frequency );
+  this->startBlowing( 0.55 + (amplitude * 0.30), amplitude * 0.005 );
+  outputGain_ = amplitude + 0.001;
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Saxofony::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Saxofony :: noteOff(StkFloat amplitude)
+{
+  this->stopBlowing( amplitude * 0.01 );
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Saxofony::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+StkFloat Saxofony :: computeSample()
+{
+  StkFloat pressureDiff;
+  StkFloat breathPressure;
+  StkFloat temp;
+
+  // Calculate the breath pressure (envelope + noise + vibrato)
+  breathPressure = envelope_.tick(); 
+  breathPressure += breathPressure * noiseGain_ * noise_.tick();
+  breathPressure += breathPressure * vibratoGain_ * vibrato_.tick();
+
+  temp = -0.95 * filter_.tick( delays_[0].lastOut() );
+  lastOutput_ = temp - delays_[1].lastOut();
+  pressureDiff = breathPressure - lastOutput_;
+  delays_[1].tick( temp );
+  delays_[0].tick( breathPressure - (pressureDiff * reedTable_.tick(pressureDiff)) - temp );
+
+  lastOutput_ *= outputGain_;
+  return lastOutput_;
+}
+
+void Saxofony :: controlChange(int number, StkFloat value)
+{
+  StkFloat norm = value * ONE_OVER_128;
+  if ( norm < 0 ) {
+    norm = 0.0;
+    errorString_ << "Saxofony::controlChange: control value less than zero ... setting to zero!";
+    handleError( StkError::WARNING );
+  }
+  else if ( norm > 1.0 ) {
+    norm = 1.0;
+    errorString_ << "Saxofony::controlChange: control value greater than 128.0 ... setting to 128.0!";
+    handleError( StkError::WARNING );
+  }
+
+  if (number == __SK_ReedStiffness_) // 2
+    reedTable_.setSlope( 0.1 + (0.4 * norm) );
+  else if (number == __SK_NoiseLevel_) // 4
+    noiseGain_ = ( norm * 0.4 );
+  else if (number == 29) // 29
+    vibrato_.setFrequency( norm * 12.0 );
+  else if (number == __SK_ModWheel_) // 1
+    vibratoGain_ = ( norm * 0.5 );
+  else if (number == __SK_AfterTouch_Cont_) // 128
+    envelope_.setValue( norm );
+  else if (number == 11) // 11
+    this->setBlowPosition( norm );
+  else if (number == 26) // reed table offset
+    reedTable_.setOffset(0.4 + ( norm * 0.6));
+  else {
+    errorString_ << "Saxofony::controlChange: undefined control number (" << number << ")!";
+    handleError( StkError::WARNING );
+  }
+
+#if defined(_STK_DEBUG_)
+    errorString_ << "Saxofony::controlChange: number = " << number << ", value = " << value << ".";
+    handleError( StkError::DEBUG_WARNING );
+#endif
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/SineWave.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/SineWave.cpp
new file mode 100644
index 0000000..0a823c2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/SineWave.cpp
@@ -0,0 +1,105 @@
+/***************************************************/
+/*! \class SineWave
+    \brief STK sinusoid oscillator class.
+
+    This class computes and saves a static sine "table" that can be
+    shared by multiple instances.  It has an interface similar to the
+    WaveLoop class but inherits from the Generator class.  Output
+    values are computed using linear interpolation.
+
+    The "table" length, set in SineWave.h, is 2048 samples by default.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "SineWave.h"
+#include <cmath>
+
+using namespace Nyq;
+
+StkFrames SineWave :: table_;
+
+SineWave :: SineWave( void )
+  : time_(0.0), rate_(1.0), phaseOffset_(0.0)
+{
+  if ( table_.empty() ) {
+    table_.resize( TABLE_SIZE + 1, 1 );
+    StkFloat temp = 1.0 / TABLE_SIZE;
+    for ( unsigned long i=0; i<=TABLE_SIZE; i++ )
+      table_[i] = sin( TWO_PI * i * temp );
+  }
+}
+
+SineWave :: ~SineWave()
+{
+}
+
+void SineWave :: reset(void)
+{
+  time_ = 0.0;
+  lastOutput_ = 0;
+}
+
+void SineWave :: setFrequency( StkFloat frequency )
+{
+  // This is a looping frequency.
+  this->setRate( TABLE_SIZE * frequency / Stk::sampleRate() );
+}
+
+void SineWave :: addTime( StkFloat time )
+{
+  // Add an absolute time in samples.
+  time_ += time;
+
+  while ( time_ < 0.0 )
+    time_ += TABLE_SIZE;
+  while ( time_ >= TABLE_SIZE )
+    time_ -= TABLE_SIZE;
+}
+
+void SineWave :: addPhase( StkFloat angle )
+{
+  // Add a time in cycles (one cycle = TABLE_SIZE).
+  time_ += TABLE_SIZE * angle;
+
+  while ( time_ < 0.0 )
+    time_ += TABLE_SIZE;
+  while ( time_ >= TABLE_SIZE )
+    time_ -= TABLE_SIZE;
+}
+
+void SineWave :: addPhaseOffset( StkFloat angle )
+{
+  // Add a phase offset in cycles, where 1.0 = TABLE_SIZE.
+  phaseOffset_ = TABLE_SIZE * angle;
+}
+
+StkFloat SineWave :: computeSample( void )
+{
+  // Check limits of time address ... if necessary, recalculate modulo
+  // TABLE_SIZE.
+  while ( time_ < 0.0 )
+    time_ += TABLE_SIZE;
+  while ( time_ >= TABLE_SIZE )
+    time_ -= TABLE_SIZE;
+
+  StkFloat tyme;
+  if ( phaseOffset_ ) {
+    tyme = time_ + phaseOffset_;
+    while ( tyme < 0.0 )
+      tyme += TABLE_SIZE;
+    while ( tyme >= TABLE_SIZE )
+      tyme -= TABLE_SIZE;
+  }
+  else {
+    tyme = time_;
+  }
+
+  lastOutput_ = table_.interpolate( tyme );
+
+  // Increment time, which can be negative.
+  time_ += rate_;
+
+  return lastOutput_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Sitar.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Sitar.cpp
new file mode 100644
index 0000000..4ba0acb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Sitar.cpp
@@ -0,0 +1,117 @@
+/***************************************************/
+/*! \class Sitar
+    \brief STK sitar string model class.
+
+    This class implements a sitar plucked string
+    physical model based on the Karplus-Strong
+    algorithm.
+
+    This is a digital waveguide model, making its
+    use possibly subject to patents held by
+    Stanford University, Yamaha, and others.
+    There exist at least two patents, assigned to
+    Stanford, bearing the names of Karplus and/or
+    Strong.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Sitar.h"
+#include <math.h>
+
+using namespace Nyq;
+
+Sitar :: Sitar(StkFloat lowestFrequency)
+{
+  unsigned long length = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1);
+  delayLine_.setMaximumDelay( length );
+  delay_ = 0.5 * length;
+  delayLine_.setDelay( delay_ );
+  targetDelay_ = delay_;
+
+  loopFilter_.setZero(0.01);
+  loopGain_ = 0.999;
+
+  envelope_.setAllTimes(0.001, 0.04, 0.0, 0.5);
+  this->clear();
+}
+
+Sitar :: ~Sitar()
+{
+}
+
+void Sitar :: clear()
+{
+  delayLine_.clear();
+  loopFilter_.clear();
+}
+
+void Sitar :: setFrequency(StkFloat frequency)
+{
+  StkFloat freakency = frequency;
+  if ( frequency <= 0.0 ) {
+    errorString_ << "Sitar::setFrequency: parameter is less than or equal to zero!";
+    handleError( StkError::WARNING );
+    freakency = 220.0;
+  }
+
+  targetDelay_ = (Stk::sampleRate() / freakency);
+  delay_ = targetDelay_ * (1.0 + (0.05 * noise_.tick()));
+  delayLine_.setDelay( delay_ );
+  loopGain_ = 0.995 + (freakency * 0.0000005);
+  if ( loopGain_ > 0.9995 ) loopGain_ = 0.9995;
+}
+
+void Sitar :: pluck(StkFloat amplitude)
+{
+  envelope_.keyOn();
+}
+
+void Sitar :: noteOn(StkFloat frequency, StkFloat amplitude)
+{
+  this->setFrequency( frequency );
+  this->pluck( amplitude );
+  amGain_ = 0.1 * amplitude;
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Sitar::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+void Sitar :: noteOff(StkFloat amplitude)
+{
+  loopGain_ = (StkFloat) 1.0 - amplitude;
+  if ( loopGain_ < 0.0 ) {
+    errorString_ << "Sitar::noteOff: amplitude is greater than 1.0 ... setting to 1.0!";
+    handleError( StkError::WARNING );
+    loopGain_ = 0.0;
+  }
+  else if ( loopGain_ > 1.0 ) {
+    errorString_ << "Sitar::noteOff: amplitude is < 0.0  ... setting to 0.0!";
+    handleError( StkError::WARNING );
+    loopGain_ = 0.99999;
+  }
+
+#if defined(_STK_DEBUG_)
+  errorString_ << "Sitar::NoteOff: amplitude = " << amplitude << ".";
+  handleError( StkError::DEBUG_WARNING );
+#endif
+}
+
+StkFloat Sitar :: computeSample()
+{
+  if ( fabs(targetDelay_ - delay_) > 0.001 ) {
+    if ( targetDelay_ < delay_ )
+      delay_ *= 0.99999;
+    else
+      delay_ *= 1.00001;
+    delayLine_.setDelay( delay_ );
+  }
+
+  lastOutput_ = delayLine_.tick( loopFilter_.tick( delayLine_.lastOut() * loopGain_ ) + 
+                                (amGain_ * envelope_.tick() * noise_.tick()));
+  
+  return lastOutput_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Stk.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Stk.cpp
new file mode 100644
index 0000000..6040237
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/Stk.cpp
@@ -0,0 +1,314 @@
+/***************************************************/
+/*! \class Stk
+    \brief STK base class
+
+    Nearly all STK classes inherit from this class.
+    The global sample rate can be queried and
+    modified via Stk.  In addition, this class
+    provides error handling and byte-swapping
+    functions.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "Stk.h"
+#include <stdlib.h>
+
+using namespace Nyq;
+
+StkFloat Stk :: srate_ = (StkFloat) SRATE;
+std::string Stk :: rawwavepath_ = RAWWAVE_PATH;
+const Stk::StkFormat Stk :: STK_SINT8   = 0x1;
+const Stk::StkFormat Stk :: STK_SINT16  = 0x2;
+const Stk::StkFormat Stk :: STK_SINT24  = 0x4;
+const Stk::StkFormat Stk :: STK_SINT32  = 0x8;
+const Stk::StkFormat Stk :: STK_FLOAT32 = 0x10;
+const Stk::StkFormat Stk :: STK_FLOAT64 = 0x20;
+bool Stk :: showWarnings_ = false;
+bool Stk :: printErrors_ = true;
+
+Stk :: Stk(void)
+{
+}
+
+Stk :: ~Stk(void)
+{
+}
+
+void Stk :: setRawwavePath( std::string path )
+{
+  if ( !path.empty() )
+    rawwavepath_ = path;
+
+  // Make sure the path includes a "/"
+  if ( rawwavepath_[rawwavepath_.length()-1] != '/' )
+    rawwavepath_ += "/";
+}
+
+void Stk :: swap16(unsigned char *ptr)
+{
+  register unsigned char val;
+
+  // Swap 1st and 2nd bytes
+  val = *(ptr);
+  *(ptr) = *(ptr+1);
+  *(ptr+1) = val;
+}
+
+void Stk :: swap32(unsigned char *ptr)
+{
+  register unsigned char val;
+
+  // Swap 1st and 4th bytes
+  val = *(ptr);
+  *(ptr) = *(ptr+3);
+  *(ptr+3) = val;
+
+  //Swap 2nd and 3rd bytes
+  ptr += 1;
+  val = *(ptr);
+  *(ptr) = *(ptr+1);
+  *(ptr+1) = val;
+}
+
+void Stk :: swap64(unsigned char *ptr)
+{
+  register unsigned char val;
+
+  // Swap 1st and 8th bytes
+  val = *(ptr);
+  *(ptr) = *(ptr+7);
+  *(ptr+7) = val;
+
+  // Swap 2nd and 7th bytes
+  ptr += 1;
+  val = *(ptr);
+  *(ptr) = *(ptr+5);
+  *(ptr+5) = val;
+
+  // Swap 3rd and 6th bytes
+  ptr += 1;
+  val = *(ptr);
+  *(ptr) = *(ptr+3);
+  *(ptr+3) = val;
+
+  // Swap 4th and 5th bytes
+  ptr += 1;
+  val = *(ptr);
+  *(ptr) = *(ptr+1);
+  *(ptr+1) = val;
+}
+
+#if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
+  #include <unistd.h>
+#elif defined(__OS_WINDOWS__)
+  #include <windows.h>
+#endif
+
+void Stk :: sleep(unsigned long milliseconds)
+{
+#if defined(__OS_WINDOWS__)
+  Sleep((DWORD) milliseconds);
+#elif (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
+  usleep( (unsigned long) (milliseconds * 1000.0) );
+#endif
+}
+
+void Stk :: handleError( StkError::Type type )
+{
+  handleError( errorString_.str(), type );
+  errorString_.str( std::string() ); // reset the ostringstream buffer
+}
+
+void Stk :: handleError( const char *message, StkError::Type type )
+{
+  std::string msg( message );
+  handleError( msg, type );
+}
+
+void Stk :: handleError( std::string message, StkError::Type type )
+{
+  if ( type == StkError::WARNING || type == StkError::STATUS ) {
+    if ( !showWarnings_ ) return;
+    std::cerr << '\n' << message << '\n' << std::endl;
+  }
+  else if (type == StkError::DEBUG_WARNING) {
+#if defined(_STK_DEBUG_)
+    std::cerr << '\n' << message << '\n' << std::endl;
+#endif
+  }
+  else {
+    if ( printErrors_ ) {
+      // Print error message before throwing.
+      std::cerr << '\n' << message << '\n' << std::endl;
+    }
+    throw StkError(message, type);
+  }
+}
+
+//
+// StkFrames definitions
+//
+
+StkFrames :: StkFrames( unsigned int nFrames, unsigned int nChannels, bool interleaved )
+  : nFrames_( nFrames ), nChannels_( nChannels ), interleaved_( interleaved )
+{
+  size_ = nFrames_ * nChannels_;
+  bufferSize_ = size_;
+
+  if ( size_ > 0 ) {
+    data_ = (StkFloat *) calloc( size_, sizeof( StkFloat ) );
+#if defined(_STK_DEBUG_)
+    if ( data_ == NULL ) {
+      std::string error = "StkFrames: memory allocation error in constructor!";
+      Stk::handleError( error, StkError::MEMORY_ALLOCATION );
+    }
+#endif
+  }
+  else data_ = 0;
+
+  dataRate_ = Stk::sampleRate();
+}
+
+StkFrames :: StkFrames( const StkFloat& value, unsigned int nFrames, unsigned int nChannels, bool interleaved )
+  : nFrames_( nFrames ), nChannels_( nChannels ), interleaved_( interleaved )
+{
+  size_ = nFrames_ * nChannels_;
+  bufferSize_ = size_;
+  if ( size_ > 0 ) {
+    data_ = (StkFloat *) malloc( size_ * sizeof( StkFloat ) );
+#if defined(_STK_DEBUG_)
+    if ( data_ == NULL ) {
+      std::string error = "StkFrames: memory allocation error in constructor!";
+      Stk::handleError( error, StkError::MEMORY_ALLOCATION );
+    }
+#endif
+    for ( long i=0; i<(long)size_; i++ ) data_[i] = value;
+  }
+  else data_ = 0;
+
+  dataRate_ = Stk::sampleRate();
+}
+
+StkFrames :: ~StkFrames()
+{
+  if ( data_ ) free( data_ );
+}
+
+bool StkFrames :: empty() const
+{
+  if ( size_ > 0 ) return false;
+  else return true;
+}
+
+void StkFrames :: resize( size_t nFrames, unsigned int nChannels )
+{
+  nFrames_ = nFrames;
+  nChannels_ = nChannels;
+
+  size_ = nFrames_ * nChannels_;
+  if ( size_ > bufferSize_ ) {
+    if ( data_ ) free( data_ );
+    data_ = (StkFloat *) malloc( size_ * sizeof( StkFloat ) );
+#if defined(_STK_DEBUG_)
+    if ( data_ == NULL ) {
+      std::string error = "StkFrames::resize: memory allocation error!";
+      Stk::handleError( error, StkError::MEMORY_ALLOCATION );
+    }
+#endif
+    bufferSize_ = size_;
+  }
+}
+
+void StkFrames :: resize( size_t nFrames, unsigned int nChannels, StkFloat value )
+{
+  this->resize( nFrames, nChannels );
+
+  for ( size_t i=0; i<size_; i++ ) data_[i] = value;
+}
+
+StkFloat& StkFrames :: operator[] ( size_t n )
+{
+#if defined(_STK_DEBUG_)
+    if ( n >= size_ ) {
+      std::ostringstream error;
+      error << "StkFrames::operator[]: invalid index (" << n << ") value!";
+      Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
+    }
+#endif
+
+  return data_[n];
+}
+
+StkFloat StkFrames :: operator[] ( size_t n ) const
+{
+#if defined(_STK_DEBUG_)
+    if ( n >= size_ ) {
+      std::ostringstream error;
+      error << "StkFrames::operator[]: invalid index (" << n << ") value!";
+      Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
+    }
+#endif
+
+  return data_[n];
+}
+
+StkFloat& StkFrames :: operator() ( size_t frame, unsigned int channel )
+{
+#if defined(_STK_DEBUG_)
+    if ( frame >= nFrames_ || channel >= nChannels_ ) {
+      std::ostringstream error;
+      error << "StkFrames::operator(): invalid frame (" << frame << ") or channel (" << channel << ") value!";
+      Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
+    }
+#endif
+
+  if ( interleaved_ )
+    return data_[ frame * nChannels_ + channel ];
+  else
+    return data_[ channel * nFrames_ + frame ];
+}
+
+StkFloat StkFrames :: operator() ( size_t frame, unsigned int channel ) const
+{
+#if defined(_STK_DEBUG_)
+    if ( frame >= nFrames_ || channel >= nChannels_ ) {
+      std::ostringstream error;
+      error << "StkFrames::operator(): invalid frame (" << frame << ") or channel (" << channel << ") value!";
+      Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
+    }
+#endif
+
+  if ( interleaved_ )
+    return data_[ frame * nChannels_ + channel ];
+  else
+    return data_[ channel * nFrames_ + frame ];
+}
+
+StkFloat StkFrames :: interpolate( StkFloat frame, unsigned int channel ) const
+{
+#if defined(_STK_DEBUG_)
+    if ( frame >= (StkFloat) nFrames_ || channel >= nChannels_ ) {
+      std::ostringstream error;
+      error << "StkFrames::interpolate: invalid frame (" << frame << ") or channel (" << channel << ") value!";
+      Stk::handleError( error.str(), StkError::MEMORY_ACCESS );
+    }
+#endif
+
+  size_t iIndex = ( size_t ) frame;                    // integer part of index
+  StkFloat output, alpha = frame - (StkFloat) iIndex;  // fractional part of index
+
+  if ( interleaved_ ) {
+    iIndex = iIndex * nChannels_ + channel;
+    output = data_[ iIndex ];
+    output += ( alpha * ( data_[ iIndex + nChannels_ ] - output ) );
+  }
+  else {
+    iIndex += channel * nFrames_;
+    output = data_[ iIndex ];
+    output += ( alpha * ( data_[ iIndex++ ] - output ) );
+  }
+
+  return output;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/WaveLoop.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/WaveLoop.cpp
new file mode 100644
index 0000000..80dc5aa
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/WaveLoop.cpp
@@ -0,0 +1,190 @@
+/***************************************************/
+/*! \class WaveLoop
+    \brief STK waveform oscillator class.
+
+    This class inherits from FileWvIn and provides audio file looping
+    functionality.  Any audio file that can be loaded by FileRead can
+    be looped using this class.
+
+    WaveLoop supports multi-channel data.  It is important to
+    distinguish the tick() methods, which return samples produced by
+    averaging across sample frames, from the tickFrame() methods,
+    which return references or pointers to multi-channel sample
+    frames.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "WaveLoop.h"
+#include <cmath>
+
+using namespace Nyq;
+
+WaveLoop :: WaveLoop( unsigned long chunkThreshold, unsigned long chunkSize )
+  : FileWvIn( chunkThreshold, chunkSize ), phaseOffset_(0.0)
+{
+}
+
+WaveLoop :: WaveLoop( std::string fileName, bool raw, bool doNormalize,
+                      unsigned long chunkThreshold, unsigned long chunkSize )
+  : FileWvIn( chunkThreshold, chunkSize ), phaseOffset_(0.0)
+{
+  this->openFile( fileName, raw, doNormalize );
+}
+
+WaveLoop :: ~WaveLoop()
+{
+}
+
+void WaveLoop :: openFile( std::string fileName, bool raw, bool doNormalize )
+{
+  // Call close() in case another file is already open.
+  this->closeFile();
+
+  // Attempt to open the file ... an error might be thrown here.
+  file_.open( fileName, raw );
+
+  // Determine whether chunking or not.
+  if ( file_.fileSize() > chunkThreshold_ ) {
+    chunking_ = true;
+    chunkPointer_ = 0;
+    data_.resize( chunkSize_, file_.channels() );
+    if ( doNormalize ) normalizing_ = true;
+    else normalizing_ = false;
+  }
+  else {
+    chunking_ = false;
+    data_.resize( file_.fileSize() + 1, file_.channels() );
+  }
+
+  // Load all or part of the data.
+  file_.read( data_, 0, doNormalize );
+
+  if ( chunking_ ) { // If chunking, save the first sample frame for later.
+    firstFrame_.resize( 1, data_.channels() );
+    for ( unsigned int i=0; i<data_.channels(); i++ )
+      firstFrame_[i] = data_[i];
+  }
+  else {  // If not chunking, copy the first sample frame to the last.
+    for ( unsigned int i=0; i<data_.channels(); i++ )
+      data_( data_.frames() - 1, i ) = data_[i];
+  }
+
+  // Resize our lastOutputs container.
+  lastOutputs_.resize( 1, file_.channels() );
+
+  // Set default rate based on file sampling rate.
+  this->setRate( data_.dataRate() / Stk::sampleRate() );
+
+  if ( doNormalize & !chunking_ ) this->normalize();
+
+  this->reset();
+}
+
+void WaveLoop :: setRate( StkFloat rate )
+{
+  rate_ = rate;
+
+  if ( fmod( rate_, 1.0 ) != 0.0 ) interpolate_ = true;
+  else interpolate_ = false;
+}
+
+void WaveLoop :: setFrequency( StkFloat frequency )
+{
+  // This is a looping frequency.
+  this->setRate( file_.fileSize() * frequency / Stk::sampleRate() );
+}
+
+void WaveLoop :: addTime( StkFloat time )
+{
+  // Add an absolute time in samples.
+  time_ += time;
+
+  StkFloat fileSize = file_.fileSize();
+  while ( time_ < 0.0 )
+    time_ += fileSize;
+  while ( time_ >= fileSize )
+    time_ -= fileSize;
+}
+
+void WaveLoop :: addPhase( StkFloat angle )
+{
+  // Add a time in cycles (one cycle = fileSize).
+  StkFloat fileSize = file_.fileSize();
+  time_ += fileSize * angle;
+
+  while ( time_ < 0.0 )
+    time_ += fileSize;
+  while ( time_ >= fileSize )
+    time_ -= fileSize;
+}
+
+void WaveLoop :: addPhaseOffset( StkFloat angle )
+{
+  // Add a phase offset in cycles, where 1.0 = fileSize.
+  phaseOffset_ = file_.fileSize() * angle;
+}
+
+void WaveLoop :: computeFrame( void )
+{
+  // Check limits of time address ... if necessary, recalculate modulo
+  // fileSize.
+  StkFloat fileSize = file_.fileSize();
+  while ( time_ < 0.0 )
+    time_ += fileSize;
+  while ( time_ >= fileSize )
+    time_ -= fileSize;
+
+  StkFloat tyme;
+  if ( phaseOffset_ ) {
+    tyme = time_ + phaseOffset_;
+    while ( tyme < 0.0 )
+      tyme += fileSize;
+    while ( tyme >= fileSize )
+      tyme -= fileSize;
+  }
+  else {
+    tyme = time_;
+  }
+
+  if (chunking_) {
+
+    // Check the time address vs. our current buffer limits.
+    if ( ( time_ < (StkFloat) chunkPointer_ ) ||
+         ( time_ > (StkFloat) ( chunkPointer_ + chunkSize_ - 1 ) ) ) {
+
+      while ( time_ < (StkFloat) chunkPointer_ ) { // negative rate
+        chunkPointer_ -= chunkSize_ - 1; // overlap chunks by one frame
+        if ( chunkPointer_ < 0 ) chunkPointer_ = 0;
+      }
+      while ( time_ > (StkFloat) ( chunkPointer_ + chunkSize_ - 1 ) ) { // positive rate
+        chunkPointer_ += chunkSize_ - 1; // overlap chunks by one frame
+        if ( chunkPointer_ + chunkSize_ > file_.fileSize() ) { // at end of file
+          chunkPointer_ = file_.fileSize() - chunkSize_ + 1; // leave extra frame at end of buffer
+          // Now fill extra frame with first frame data.
+          for ( unsigned int j=0; j<firstFrame_.channels(); j++ )
+            data_( data_.frames() - 1, j ) = firstFrame_[j];
+        }
+      }
+
+      // Load more data.
+      file_.read( data_, chunkPointer_, normalizing_ );
+    }
+
+    // Adjust index for the current buffer.
+    tyme -= chunkPointer_;
+  }
+
+  if ( interpolate_ ) {
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+    lastOutputs_[i] = data_.interpolate( tyme, i );
+  }
+  else {
+    for ( unsigned int i=0; i<lastOutputs_.size(); i++ )
+      lastOutputs_[i] = data_( (size_t) tyme, i );
+  }
+
+  // Increment time, which can be negative.
+  time_ += rate_;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/WvIn.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/WvIn.cpp
new file mode 100644
index 0000000..ecb24db
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/src/WvIn.cpp
@@ -0,0 +1,118 @@
+/***************************************************/
+/*! \class WvIn
+    \brief STK audio input abstract base class.
+
+    This class provides common functionality for a variety of audio
+    data input subclasses.
+
+    WvIn supports multi-channel data.  It is important to distinguish
+    the tick() methods, which return samples produced by averaging
+    across sample frames, from the tickFrame() methods, which return
+    references or pointers to multi-channel sample frames.
+
+    Both interleaved and non-interleaved data is supported via the use
+    of StkFrames objects.
+
+    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
+*/
+/***************************************************/
+
+#include "WvIn.h"
+#include <cmath>
+
+using namespace Nyq;
+
+WvIn :: WvIn()
+{
+}
+
+WvIn :: ~WvIn()
+{
+}
+
+StkFloat WvIn :: lastOut( void ) const
+{
+  if ( lastOutputs_.empty() ) return 0.0;
+
+  if ( lastOutputs_.size() == 1 )
+    return lastOutputs_[0];
+
+  StkFloat output = 0.0;
+  for ( unsigned int i=0; i<lastOutputs_.size(); i++ ) {
+    output += lastOutputs_[i];
+  }
+  return output / lastOutputs_.size();
+}
+
+StkFloat WvIn :: tick( void )
+{
+  computeFrame();
+  return lastOut();
+}
+
+StkFrames& WvIn :: tick( StkFrames& frames, unsigned int channel )
+{
+  if ( channel >= frames.channels() ) {
+    errorString_ << "WvIn::tick(): channel and StkFrames arguments are incompatible!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  if ( frames.channels() == 1 ) {
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[i] = tick();
+  }
+  else if ( frames.interleaved() ) {
+    unsigned int hop = frames.channels();
+    unsigned int index = channel;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      frames[index] = tick();
+      index += hop;
+    }
+  }
+  else {
+    unsigned int iStart = channel * frames.frames();
+    for ( unsigned int i=0; i<frames.frames(); i++ )
+      frames[iStart++] = tick();
+  }
+
+  return frames;
+}
+
+StkFrames& WvIn :: tickFrame( StkFrames& frames )
+{
+  unsigned int nChannels = lastOutputs_.channels();
+  if ( nChannels == 0 ) {
+    errorString_ << "WvIn::tickFrame(): no data has been loaded!";
+    handleError( StkError::WARNING );
+    return frames;
+  }
+
+  if ( nChannels != frames.channels() ) {
+    errorString_ << "WvIn::tickFrame(): incompatible channel value in StkFrames argument!";
+    handleError( StkError::FUNCTION_ARGUMENT );
+  }
+
+  unsigned int j;
+  if ( nChannels == 1 || frames.interleaved() ) {
+    unsigned int counter = 0;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      this->computeFrame();
+      for ( j=0; j<nChannels; j++ )
+        frames[counter++] = lastOutputs_[j];
+    }
+  }
+  else { // non-interleaved data
+    unsigned int hop = frames.frames();
+    unsigned int index;
+    for ( unsigned int i=0; i<frames.frames(); i++ ) {
+      this->computeFrame();
+      index = i;
+      for ( j=0; j<nChannels; j++ ) {
+        frames[index] = lastOutputs_[j];
+        index += hop;
+      }
+    }
+  }
+
+  return frames;
+}
diff --git a/lib-src/libnyquist/nyquist/nyqstk/stkinit.cpp b/lib-src/libnyquist/nyquist/nyqstk/stkinit.cpp
new file mode 100644
index 0000000..adb5e06
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/stkinit.cpp
@@ -0,0 +1,50 @@
+/* stk path initialization */
+
+#include "stdlib.h"
+#include "string.h"
+// #include "instr.h"
+#include "Stk.h"
+#include "stkinit.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "xlisp.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+using namespace Nyq;
+
+const char *rawwave_path = NULL;
+
+extern "C" void stk_init()
+{
+    /* wherever the sinewave.raw file is, that will become 
+     * the rawwave_path for STK 
+     */
+    char filename[32];
+    strcpy(filename, "rawwaves");
+    filename[8] = os_pathchar;
+    filename[9] = '\0';
+    strcat(filename, "sinewave.raw");
+    /* find_in_xlisp_path returns const char *, but we're going to
+     * alter it to get just the path, so we have to coerce out the
+     * const attribute
+     */
+    char *path = (char *) find_in_xlisp_path(filename);
+    if (!path) {
+        errputstr("\nERROR: Could not find sinewave.raw in rawwaves. Something is wrong with the installation or configuration.\n\n");
+        rawwave_path = "";
+        return;
+    }
+    /* remove sinewave.raw to get just the path */
+    path[strlen(path) - 12] = '\0'; 
+    rawwave_path = strcpy((char *) malloc(strlen(path) + 1), path); /* keep a copy */
+    /* note: rawwave_path is allocated but never freed */
+   Stk::setRawwavePath(path); // PJM
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/stkinit.h b/lib-src/libnyquist/nyquist/nyqstk/stkinit.h
new file mode 100644
index 0000000..5d25b60
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/stkinit.h
@@ -0,0 +1,11 @@
+/* stkinit.h -- set up stk path */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void stk_init();
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/nyqstk/stkint.cpp b/lib-src/libnyquist/nyquist/nyqstk/stkint.cpp
new file mode 100644
index 0000000..c2a1e94
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/stkint.cpp
@@ -0,0 +1,80 @@
+// interface for STK Effects
+
+#include <stdlib.h>
+
+#include "stkint.h"
+
+#include "NRev.h"
+#include "JCRev.h"
+#include "PRCRev.h"
+
+using namespace Nyq;
+
+// Reverb Effects ==========================================================
+
+struct stkEffect {
+  Effect * effectPtr;
+};
+
+struct stkEffect *initStkEffect(int eff_type, ::StkFloat trev, int sample_rate) {
+  struct stkEffect * eff = (struct stkEffect *) malloc(sizeof(struct stkEffect));
+  Stk::setSampleRate(sample_rate);
+  switch(eff_type) {
+  case NREV:
+    eff->effectPtr = new NRev(trev);
+    break;
+  case JCREV:
+    eff->effectPtr = new JCRev(trev);
+    break;
+  case PRCREV:
+    eff->effectPtr = new PRCRev(trev);
+    break;
+  default:
+    return NULL;
+  }
+  return eff;
+}
+
+int deleteStkEffect(struct stkEffect * eff) {
+  delete(eff->effectPtr);
+  free(eff);
+  return 0;
+}
+
+::StkFloat stkEffectTick(struct stkEffect * eff, ::StkFloat s) {
+  return eff->effectPtr->tick(s);
+}
+
+void stkEffectSetMix (struct stkEffect * eff, ::StkFloat mix) {
+  eff->effectPtr->setEffectMix(mix);
+}
+
+// PitShift ===================================================
+
+#include "PitShift.h"
+
+struct stkEffect *initStkPitShift(::StkFloat shift, int sample_rate) {
+  PitShift * ps;
+  ps = new PitShift();
+  ps->setShift(shift);
+  struct stkEffect * eff  = (struct stkEffect *) malloc(sizeof(struct stkEffect));
+  Stk::setSampleRate(sample_rate);
+  eff->effectPtr = ps;
+  return eff;
+} 
+
+// Chorus =====================================================
+
+#include "Chorus.h"
+
+struct stkEffect *initStkChorus(::StkFloat baseDelay, ::StkFloat depth, ::StkFloat freq, int sample_rate) {
+  Chorus * ch;
+  ch = new Chorus(baseDelay);
+  ch->setModDepth(depth);
+  ch->setModFrequency(freq);
+  struct stkEffect * eff  = (struct stkEffect *) malloc(sizeof(struct stkEffect));
+  Stk::setSampleRate(sample_rate);
+  eff->effectPtr = ch;
+  return eff;
+} 
+
diff --git a/lib-src/libnyquist/nyquist/nyqstk/stkint.h b/lib-src/libnyquist/nyquist/nyqstk/stkint.h
new file mode 100644
index 0000000..20b4c94
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/nyqstk/stkint.h
@@ -0,0 +1,22 @@
+typedef double StkFloat;
+
+#define NREV 0
+#define JCREV 1
+#define PRCREV 2
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  struct stkEffect;
+  struct stkEffect * initStkEffect (int, StkFloat, int);
+  int deleteStkEffect(struct stkEffect *);
+  StkFloat  stkEffectTick(struct stkEffect *, StkFloat);
+  void stkEffectSetMix (struct stkEffect *, StkFloat);
+
+  struct stkEffect * initStkPitShift(StkFloat, int);
+  struct stkEffect * initStkChorus(StkFloat, StkFloat, StkFloat, int);
+  
+#ifdef __cplusplus
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/sys/unix/switches.h b/lib-src/libnyquist/nyquist/sys/unix/switches.h
new file mode 100644
index 0000000..976650f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/unix/switches.h
@@ -0,0 +1,197 @@
+/* see sys/switches.h.template */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  major reorganization of conditional compilation in Nyquist
+ */
+
+#define HAS_STDLIB_H 1
+#define HAS_SYS_TYPES_H 1
+#define HAS_SYS_STAT_H 1
+#undef HAS_STAT_H
+#undef HAS_MALLOC_H
+
+#define HAS_GETTIMEOFDAY 1
+
+// I think that READ_LINE prevents user from typing control characters to
+// get info during lisp execution. This needs to be tested. Using READ_LINE
+// is preventing any character echoing now, maybe due to new "improved"
+// command line handling added recently. -RBD
+
+// #define READ_LINE 1
+
+/* this is defined in xlisp.h - RBD
+#if i386
+#define XL_LITTLE_ENDIAN 1
+#elif __i386__
+#define XL_LITTLE_ENDIAN 1
+#else
+#define XL_BIG_ENDIAN 1
+#endif
+*/
+
+#undef USE_RANDOM
+#define USE_RAND 1
+
+/* define this to be printf, or define your own fn of the form
+     void nyquist_printf(char *format, ...);
+   (for a GUI)
+*/
+#define nyquist_printf printf
+
+#if __APPLE__ && __GNUC__ /* Mac OS X */
+#define NEED_ULONG 1
+#else
+#include <sys/types.h>
+#undef NEED_ULONG
+#endif
+
+#undef NEED_USHORT
+#define NEED_BYTE 1
+
+#define NEED_ROUND 1
+
+#undef NEED_DEFINE_MALLOC
+
+/* definitions for libsndfile */
+
+/* Target processor clips on negative float to int conversion */
+/* (true on i386 and PPC) */
+#define CPU_CLIPS_NEGATIVE 1
+
+/* Target processor clips on positive float to int conversion */
+/* (true on i386 and PPC) */
+#define CPU_CLIPS_POSITIVE 1
+
+#ifdef __APPLE__
+ #if defined (__LITTLE_ENDIAN__)
+  /* Target processor is little endian. */
+  #define CPU_IS_LITTLE_ENDIAN 1
+  /* Target processor is big endian. */
+  #define CPU_IS_BIG_ENDIAN 0
+ #else
+  /* Target processor is little endian. */
+  #define CPU_IS_LITTLE_ENDIAN 0
+  /* Target processor is big endian. */
+  #define CPU_IS_BIG_ENDIAN 1
+ #endif
+#else
+ #ifdef __linux__
+  #include <endian.h>
+  #if __BYTE_ORDER == __LITTLE_ENDIAN
+   /* Target processor is little endian. */
+   #define CPU_IS_LITTLE_ENDIAN 1
+   /* Target processor is big endian. */
+   #define CPU_IS_BIG_ENDIAN 0
+  #else
+   /* Target processor is little endian. */
+   #define CPU_IS_LITTLE_ENDIAN 0
+   /* Target processor is big endian. */
+   #define CPU_IS_BIG_ENDIAN 1
+  #endif
+ #else /* default is little endian */
+   /* Target processor is little endian. */
+   #define CPU_IS_LITTLE_ENDIAN 1
+   /* Target processor is big endian. */
+   #define CPU_IS_BIG_ENDIAN 0
+ #endif
+#endif
+
+/* Set to 1 if S_IRGRP is defined */
+#define HAVE_DECL_S_IRGRP 1
+
+/* Set to 1 if the compiler supports the struct hack. */
+#define HAVE_FLEXIBLE_ARRAY 1
+
+/* Define to 1 if you have the `fsync' function. */
+#define HAVE_FSYNC 1
+
+/* Define to 1 if you have the `gmtime' function. */
+#define HAVE_GMTIME 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if you have C99's lrint function. */
+#define HAVE_LRINT 1
+
+/* Define if you have C99's lrintf function. */
+#define HAVE_LRINTF 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if the system has the type `ssize_t'. */
+#define HAVE_SSIZE_T 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Set to 1 if compiling for MacOSX */
+#ifdef __APPLE__
+ #define OS_IS_MACOSX 1
+#else
+ #define OS_IS_MACOSX 0
+#endif
+
+/* Set to 1 if compiling for Win32 */
+#define OS_IS_WIN32 0
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Set to 1 to use the native windows API */
+#define USE_WINDOWS_API 0
+
+#ifdef __GNUC__
+ #define SIZEOF_LONG_LONG 8
+#endif
+
+/* The size of `int64_t', as computed by sizeof. */
+#define SIZEOF_INT64_T 8
+
+/* The size of long as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* Set to long if unknown */
+#define SIZEOF_SF_COUNT_T 8
+
+/* explicitly choose a platform */
+#define UNIX 1
+#undef WINDOWS
+#undef MICROSOFT
+#undef DOS
+#undef MACINTOSH
+
+#define BUFFERED_SYNCHRONOUS_INPUT 1
+#define SPACE_FOR_PLAY 10000
+#define MAX_CHANNELS 16
+
+/* this will enable code to read midi files, etc. */
+#define CMTSTUFF 1
+
+/* NYQUIST tells some CMT code that we're really in
+ * XLISP and NYQUIST
+ */
+#define NYQUIST 1
+
+#include "swlogic.h"
+
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/sndsystem.h b/lib-src/libnyquist/nyquist/sys/win/msvc/sndsystem.h
new file mode 100644
index 0000000..3cd5fa2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/sndsystem.h
@@ -0,0 +1 @@
+#include "sndwin32.h"
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h b/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h
new file mode 100644
index 0000000..9e21c6e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h
@@ -0,0 +1,175 @@
+/* switches.h -- conditional compilation features for WIN32 systems */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  major reorganization of conditional compilation in Nyquist
+ */
+
+#ifdef SWITCHES
+Error: switches.h included more than once.
+#endif
+
+#define HAS_STDLIB_H 1
+#define HAS_SYS_TYPES_H 1
+#define HAS_SYS_STAT_H 1
+#undef HAS_STAT_H
+#undef HAS_MALLOC_H
+
+/* define one of HAS_GETTIMEOFDAY, HAS_FTIME, */
+#undef HAS_GETTIMEOFDAY
+#undef HAS_FTIME
+
+#undef READ_LINE
+
+#undef USE_RANDOM
+#define USE_RAND 1
+
+
+/* since there are 2 versions Nyquist for windows: nyquist and nyqwin, 
+   we use WINGUI to decide which to compile 
+ */
+#ifndef WINGUI
+/* use C library printf as nyquist_printf() */
+#define USE_PRINTF 1
+#endif
+
+/* define this to be printf, or define your own fn of the form
+     void nyquist_printf(char *format, ...);
+   (for a GUI)
+*/
+void nyquist_printf(char *format, ...);
+
+#define NEED_ULONG 1
+#define NEED_USHORT 1
+#define NEED_BYTE 1
+
+#define NEED_ROUND 1
+
+#undef NEED_DEFINE_MALLOC
+
+/* definitions for libsndfile */
+
+/* Target processor clips on negative float to int conversion */
+/* (true on i386) */
+#define CPU_CLIPS_NEGATIVE 1
+
+/* Target processor clips on positive float to int conversion */
+/* (true on i386) */
+#define CPU_CLIPS_POSITIVE 1
+
+/* Target processor is little endian. */
+#define CPU_IS_LITTLE_ENDIAN 1
+/* Target processor is big endian. */
+#define CPU_IS_BIG_ENDIAN 0
+
+/* Set to 1 if S_IRGRP is defined */
+#define HAVE_DECL_S_IRGRP 0
+
+/* Set to 1 if the compiler supports the struct hack. */
+#define HAVE_FLEXIBLE_ARRAY 1
+
+/* Define to 1 if you have the `fsync' function. */
+#define HAVE_FSYNC 1
+
+/* Define to 1 if you have the `gmtime' function. */
+#define HAVE_GMTIME 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 0
+
+/* Define if you have C99's lrint function. */
+#define HAVE_LRINT 0
+
+/* Define if you have C99's lrintf function. */
+#define HAVE_LRINTF 0
+
+/* Define to 1 if you have the `snprintf' function. */
+#define snprintf _snprintf
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if the system has the type `ssize_t'. */
+#define ssize_t SSIZE_T
+#define HAVE_SSIZE_T 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 0
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 0
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Set to 1 if compiling for MacOSX */
+#define OS_IS_MACOSX 0
+
+/* Set to 1 if compiling for Win32 */
+#define OS_IS_WIN32 1
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Set to 1 to use the native windows API */
+#define USE_WINDOWS_API 1
+
+/* The size of `int64_t', as computed by sizeof. */
+/* Omit this if int64_t is not a type */
+#undef SIZEOF_INT64_T
+
+/* The size of long as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* Set to long if unknown */
+#define SIZEOF_SF_COUNT_T 8
+
+/* explicitly choose a platform */
+#undef UNIX
+
+#ifndef WINDOWS
+#define WINDOWS 1
+#endif
+
+#ifndef WIN32
+#define WIN32 1
+#endif
+
+#ifndef MICROSOFT
+#define MICROSOFT 1
+#endif
+
+#ifndef DOS
+#define DOS 1
+#endif
+
+#undef MACINTOSH
+
+// Under Windows, we do not want synchronous input because then we do not
+// get the break character (^G) while XLISP is busy. Actually, there is a
+// way to send a message to the process, but the Java IDE cannot send
+// Windows messages, so we have to check for console character input
+// using the _kbhit function.
+//#define BUFFERED_SYNCHRONOUS_INPUT 1
+#define SPACE_FOR_PLAY 10000
+#define MAX_CHANNELS 16
+
+/* this will enable code to read midi files, etc. */
+#define CMTSTUFF 1
+
+/* NYQUIST tells some CMT code that we're really in
+ * XLISP and NYQUIST
+ */
+#define NYQUIST 1
+
+#include "swlogic.h"
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/system.lsp b/lib-src/libnyquist/nyquist/sys/win/msvc/system.lsp
new file mode 100644
index 0000000..b750fe6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/system.lsp
@@ -0,0 +1,131 @@
+; machine.lsp -- machine/system-dependent definitions
+;       Windows
+
+;; default behavior is to call SETUP-CONSOLE to get large white typescript
+;;
+;; set *setup-console* to nil in your personal init.lsp to override this behavior 
+;; (this may be necessary to work with emacs)
+;;
+(if (not (boundp '*setup-console*)) (setf *setup-console* t))
+(if *setup-console* (setup-console))
+
+(if (not (boundp '*default-sf-format*))
+    (setf *default-sf-format* snd-head-Wave))
+
+(if (not (boundp '*default-sound-file*))
+    (compute-default-sound-file))
+
+(if (not (boundp '*default-sf-dir*))
+    (setf *default-sf-dir* ""))
+
+(if (not (boundp '*default-sf-mode*))
+    (setf *default-sf-mode* snd-mode-pcm))
+
+(if (not (boundp '*default-sf-bits*))
+    (setf *default-sf-bits* 16))
+
+(if (not (boundp '*default-plot-file*))
+    (setf *default-plot-file* "points.dat"))
+
+;(if (not (boundp '*plotscript-file*))
+;    (setf *plotscript-file* "sys/unix/rs6k/plotscript"))
+
+; local definition for play
+(defmacro play (expr)
+  `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*))
+
+
+(defun r ()
+  (s-save (s-read *default-sound-file*) NY:ALL "" :play t)
+)
+
+
+; PLAY-FILE -- play a file
+(defun play-file (name)
+  (s-save (s-read name) NY:ALL "" :play t))
+
+
+; FULL-NAME-P -- test if file name is a full path or relative path
+;
+; (otherwise the *default-sf-dir* will be prepended
+;
+(defun full-name-p (filename)
+  (or (eq (char filename 0) #\\)
+      (eq (char filename 0) #\/)
+      (eq (char filename 0) #\.)
+      (and (> (length filename) 2)
+           (both-case-p (char filename 0))
+           (equal (char filename 1) #\:))))
+
+; RELATIVE-PATH-P -- test if filename or path is a relative path
+;
+; note that properly converting a Windows path from relative to
+;  absolute is complicated by paths like: E:MYFILE.LSP
+;  Nyquist assumes that if there is a drive letter, the path is
+;  absolute, e.g. E:\TMP\MYFILE.LSP and if there is no drive,
+;  the path is relative, e.g. you cannot have \TMP\MYFILE.LSP
+;
+(defun relative-path-p (filename)
+  (or (< (length filename) 2)
+      (not (both-case-p (char filename 0)))
+      (not (equal (char filename 1) #\:))))
+
+
+(setf *file-separator* #\\)
+
+(defun ny:load-file () (load "*.*"))
+(defun ny:reload-file () (load "*"))
+
+
+; save the standard function to write points to a file
+;
+;(setfn s-plot-points s-plot)
+
+;(defun array-max-abs (points)
+;  (let ((m 0.0))
+;        (dotimes (i (length points))
+;          (setf m (max m (abs (aref points i)))))
+;        m))
+
+;(setf graph-width 600)
+;(setf graph-height 220)
+
+;(defun s-plot (snd &optional (n 600))
+;  (show-graphics)
+;  (clear-graphics)
+;  (cond ((soundp snd)
+;               (s-plot-2 snd n (/ graph-height 2) graph-height))
+;              (t
+;               (let ((gh (/ graph-height (length snd)))
+;                     hs)
+;                 (dotimes (i (length snd))
+;                   (setf hs (s-plot-2 (aref snd i) n (+ (/ gh 2) (* i gh)) gh hs)))))))
+;
+;
+;(defun s-plot-2 (snd n y-offset graph-height horizontal-scale)
+;  (prog ((points (snd-samples snd n))
+;                   maxpoint horizontal-scale vertical-scale)
+;    (setf maxpoint (array-max-abs points))
+;    (moveto 0 y-offset)
+;    (lineto graph-width y-offset)
+;    (moveto 0 y-offset)
+;    (cond ((null horizontal-scale)
+;               (setf horizontal-scale (/ (float graph-width) (length points)))))
+;    (setf vertical-scale (- (/ (float graph-height) 2 maxpoint)))
+;    (dotimes (i (length points))
+;      (lineto (truncate (* horizontal-scale i))
+;              (+ y-offset (truncate (* vertical-scale (aref points i))))))
+;    (format t "X Axis: ~A to ~A (seconds)\n" (snd-t0 snd) (/ (length points) (snd-srate snd)))
+;    (format t "Y Axis: ~A to ~A\n" (- maxpoint) maxpoint)
+;    (format t "~A samples plotted.\n" (length points))
+;    (return horizontal-scale)
+;    ))
+;
+; S-EDIT - run the audio editor on a sound
+;
+;(defmacro s-edit (&optional expr)
+;  `(prog ()
+;         (if ,expr (s-save ,expr 1000000000 *default-sound-file*))
+;         (system (format nil "audio_editor ~A &" 
+;                         (soundfilename *default-sound-file*)))))
+
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c
new file mode 100644
index 0000000..5360e65
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c
@@ -0,0 +1,272 @@
+/* winfun.c - windows user interface functions for xlisp */
+/* Written by Brian Kendig. */
+/*Windows Console and DirectSound code added by Morgan Green and Chris Tchou*/
+
+//#include <Quickdraw.h>
+//#include <Windows.h>
+//#include <Memory.h>
+#include <windows.h>
+#include <switches.h>
+#include "xlisp.h"
+#include "sound.h"
+
+/* Added by Ning Hu		May.2001 
+xsetdir - set current directory of the process */
+LVAL xsetdir() {
+    TCHAR ssCurDir[MAX_PATH], szCurDir[MAX_PATH];
+
+    strcpy(ssCurDir, getstring(xlgastring()));
+    xllastarg();
+    if (SetCurrentDirectory(ssCurDir)) {
+        if (GetCurrentDirectory(
+            sizeof(szCurDir)/sizeof(TCHAR), szCurDir)) {
+            return cvstring(szCurDir);
+        /* create the result string
+            stdputstr("Current Directory: ");
+            stdputstr(szCurDir);
+            stdputstr("\n"); */
+        }	
+    }
+    stdputstr("Directory Setting Error\n");
+
+    /* return nil on error*/
+    return NIL;
+}
+
+/* xget_temp_path -- get a path to create temp files */
+LVAL xget_temp_path()
+{
+    char *p;
+    char szDir[MAX_PATH];
+    char szDirLC[MAX_PATH];
+    int rslt = GetTempPath(MAX_PATH, szDir);
+    if (rslt > MAX_PATH || rslt <= 0) {
+        return cvstring("");
+    } else {
+        /* Vista apparently treats c:\windows with
+         * special semantics, so just don't allow
+         * GetTempPath to put us in c:\windows...
+         */
+        strcpy(szDirLC, szDir); /* convert to lower case */
+        for (p = szDirLC; *p; p++) { 
+            *p = tolower(*p);
+        }
+        if (strstr(szDirLC, "c:\\windows")) {
+            /* c:\windows is bad. */
+            return cvstring("");
+        }
+        return cvstring(szDir);
+    }
+}
+
+//Updated End
+
+
+/* osbgetc - get a character from a binary file ======  added for console*/
+/* int osbgetc(fp) FILE *fp; {return (getc(fp));} */
+int osbgetc(FILE *fp) 
+{ 
+  int c; c = (getc(fp));
+/*  if (dbgflg) printf("osbgetc: got %d from FILE %x\n", c, fp); */
+  return c;
+}
+
+
+
+LVAL xsystem (V) { return NIL; }
+LVAL xgetkey (V) { return NIL; }
+
+
+void ossymbols() 
+{
+    HWND mywin;
+#ifdef WIN32_SNAZZY_CONSOLE
+    HANDLE myhandle;
+    COORD winsize, origin;
+    WORD textattrib;
+    DWORD n;
+#endif
+    mywin = GetForegroundWindow();
+    SetConsoleTitle("Nyquist");
+
+#ifdef WIN32_SNAZZY_CONSOLE     // -eub
+    myhandle = GetStdHandle(STD_OUTPUT_HANDLE);
+    origin.X = 0;
+    origin.Y = 0;
+    winsize.X = 100;
+    winsize.Y = 40;
+    textattrib = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY;
+
+    FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n);
+    SetConsoleScreenBufferSize(myhandle, winsize);
+    FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n);
+    SetConsoleTextAttribute(myhandle, textattrib); 
+#endif
+
+    setvbuf(stdout, NULL, _IONBF, 0);   // makes it work under NT emacs 20.3   -eub
+
+}
+
+
+LVAL xsetupconsole()
+{
+    HWND mywin;
+    HANDLE myhandle;
+    COORD winsize, origin;
+    WORD textattrib;
+    DWORD n;
+    mywin = GetForegroundWindow();
+    SetConsoleTitle("Nyquist");
+
+    myhandle = GetStdHandle(STD_OUTPUT_HANDLE);
+    origin.X = 0;
+    origin.Y = 0;
+    winsize.X = 100;
+    winsize.Y = 40;
+    textattrib = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY;
+
+    FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n);
+    SetConsoleScreenBufferSize(myhandle, winsize);
+    FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n);
+    SetConsoleTextAttribute(myhandle, textattrib);
+    return NIL;
+}
+
+void get_xlisp_path(char *p, long p_max)
+{
+    HKEY hkey;
+    DWORD dwType;
+    LVAL lval;
+    extern LVAL s_search_path;
+
+    *p = 0; /* for simplicity, we assume if !*p that path was not found */
+    /* therefore, no path is equivalent to an empty string path */
+
+    /* first, look for path in global variable *SEARCH-PATH* */
+    lval = getvalue(s_search_path);
+    if (lval && stringp(lval)) {
+        strncpy(p, getstring(lval), p_max);
+        p[p_max - 1] = 0; /* make sure string is terminated, even if truncated */
+    }
+    if (*p) return; /* we got search path, so don't look in registry */
+
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return;
+    }
+    if (RegOpenKeyEx(hkey, "CMU", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return;
+    }
+    if (RegOpenKeyEx(hkey, "Nyquist", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return;
+    }
+    if (RegQueryValueEx(hkey, "XLISPPATH", NULL, &dwType, p, &p_max) !=
+           ERROR_SUCCESS) {
+        *p = 0;	
+        return;
+    }
+}
+
+LVAL xget_user()
+{
+    // not implemented for Windows, just use "nyquist"
+    return cvstring("nyquist");
+}
+
+
+#ifdef WINGUI
+/* NOTE: define WINGUI in the Project Settings for the NyqWin projects.
+ * Do not define WINGUI for console versions of Nyquist
+ */
+
+/****************************************************************************
+*               fileopen
+* Inputs:
+*    char *deflt: the default file name (e.g. from command line)
+*    char *extension: default extension
+*    char *mode: read ("r") or write ("w")
+*    char *prompt: prompt for user
+* Returns:
+*    opened file pointer
+* Effect: 
+*    opens file, prompts for user input if necessary and warns about
+*    possible confusion.  If deflt is a null string or NULL, the user will
+*    be prompted for a name.     The routine loops until a file is opened.
+*    If the mode is "r", a check is made to see if the file exists
+*    with and without the extension.     If both exist a warning is given.
+*    For mode "w", a check is made to see if the file will be overwritten.
+*    The extension is automatically added if the default or user-typed
+*    file has no "."     At the bottom of the loop body, if no file has
+*    been opened, the user is prompted for another file name.
+****************************************************************************/
+
+char fileopen_name[100];        /* name of the opened file */
+
+HINSTANCE hInst;            /* current instance */
+HWND hMainWindow;           /* main window handle */
+
+
+char *getfilename(char *deflt, char *extension, char *mode, char *prompt)
+{
+    char filter[64];
+    char *filter_ptr = NULL;
+    OPENFILENAME open_file_name;
+
+    if (extension && extension[0] == 0) extension = NULL;
+    if (strcmp(extension, "lsp") == 0) {
+        strcpy(filter, "Lisp files");
+    } else if (extension) {
+        sprintf(filter, "%s files", extension);
+    }
+    if (extension) {
+        sprintf(filter + strlen(filter), "%c*.%s%cAll files%c*.*%c",
+                0, extension, 0, 0, 0);
+        filter_ptr = filter;
+    }
+    if (!deflt) deflt = "";     /* treat NULL as the empty string */
+    strcpy(fileopen_name, deflt);
+
+    open_file_name.lStructSize = sizeof(OPENFILENAME);
+    open_file_name.hwndOwner = hMainWindow;
+
+    open_file_name.hInstance = hInst;
+    open_file_name.lpstrFilter = filter_ptr; 
+    open_file_name.lpstrCustomFilter = NULL; 
+    open_file_name.nMaxCustFilter = 0; 
+    open_file_name.nFilterIndex = 0; 
+    open_file_name.lpstrFile = fileopen_name; 
+    open_file_name.nMaxFile = 100; 
+    open_file_name.lpstrFileTitle = NULL;
+    open_file_name.nMaxFileTitle = 0; 
+    open_file_name.lpstrInitialDir = NULL; 
+    open_file_name.lpstrTitle = prompt;
+    open_file_name.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; 
+    open_file_name.nFileOffset = 0; 
+    open_file_name.nFileExtension = 0; 
+    open_file_name.lpstrDefExt = extension; 
+    open_file_name.lCustData = 0; 
+    open_file_name.lpfnHook = 0; 
+    open_file_name.lpTemplateName = 0;
+    if (((*mode == 'r') && GetOpenFileName(&open_file_name)) ||
+        ((*mode == 'w') && GetSaveFileName(&open_file_name))) {
+        return open_file_name.lpstrFile;
+    }
+    return NULL;
+}
+
+
+
+FILE *fileopen(char *deflt, char *extension, char *mode, char *prompt)
+{
+    FILE *fp = NULL;            /* file corresponding to filename */
+    if (getfilename(deflt, extension, mode, prompt)) {
+        fp = fopen(fileopen_name, mode);
+    }
+    return fp;
+}
+
+#endif
+
+
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.h b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.h
new file mode 100644
index 0000000..ba88071
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.h
@@ -0,0 +1,11 @@
+#ifdef __cplusplus 
+extern "C" {
+#endif
+
+void get_xlisp_path(char *p, long p_max);
+char *getfilename(char *deflt, char *extension, char *mode, char *prompt);
+FILE *fileopen(char *deflt, char *extension, char *mode, char *prompt);
+
+#ifdef __cplusplus 
+}
+#endif
diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c b/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c
new file mode 100644
index 0000000..88498ec
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c
@@ -0,0 +1,398 @@
+/* winstuff.c - windows interface routines for xlisp */
+/* Written by Chris Tchou. */
+/* This file contains the stuff that the other xlisp files call directly. */
+
+/* Changes by Roger Dannenberg, Jan 2006:
+Previously, the input thread would block on input, so if a command line
+instantiation of Nyquist called (EXIT), the process would still block
+in getchar() until the user typed a newline. Now, I only start the 
+input thread if ostgetc is called (input is really needed). This will
+still read ahead and block, but only in cases where you are already
+interactive.
+
+/* Changes by Roger Dannenberg, April 2004:
+To support interrupts to Lisp processing, XLISP call oscheck frequently to
+test for an abort or break condition. This condition can be activated by
+special handlers, e.g. if a software interrupt is generated by Ctrl-C.
+Alternatively, the application can read ahead and look for break characters
+in the input stream. A third approach, implemented by Ning Hu for her
+Delphi-based IDE, is to send a Windows message to the process. Unfortunately,
+the Java IDE does not support sending a Windows message, nor can console
+IO be used to read ahead (console IO does not work because, when started by
+Java, Nyquist standard IO is redirected through pipes). The two solutions
+to enable break character prcessing seem to be:
+  1) extend Java with C code to find the process and send Windows messages
+  2) add a thread to perform read ahead and break character processing
+Option 2 contains the ugliness to Nyquist IO, which is already big and ugly,
+and leaves Java alone, which is something I don't know much about anyway,
+so I have chosen option 2: create a thread and read ahead. This uses only
+about 50 lines of code.
+
+A shortcoming of this approach is that, except for Ctrl-C, break characters
+like ^P, ^B, and ^U require the user to type RETURN to end the input line
+and allow the character to be processed.
+
+The thread will set a signal whenever a line of input is delivered so that
+Nyquist can block waiting for input. The signal will also be set when a
+^C or ^G is detected.
+
+For flexibility, compatibility with the Delphi IDE (NyqIDE) is retained by
+continuing to check for Windows process messages.
+*/
+
+#include <windows.h>  /* Added by Ning Hu	Apr.2001 */
+#include <process.h>  /* Added by Dannenberg Apr 2004 */
+#include <signal.h>   /* Added by Dannneberg, Apr 2004 */
+#include "exitpa.h"   /* Added by Dannneberg, Apr 2004 */
+
+
+const char os_pathchar = '\\';
+const char os_sepchar = ',';
+
+
+#undef ERROR
+#include <stdio.h>
+//#include <QuickDraw.h>	/* for Random */
+#include <memory.h>		/* for DisposPtr */
+#include <string.h>
+//#include <SegLoad.h>	/* for ExitToShell */
+#include "xlisp.h"
+#include "cext.h"
+#include "userio.h"
+#include "sliders.h"
+#include "sound.h" /* define nosc_enabled */
+
+/* externals */
+extern FILE *tfp;  /* transcript file pointer */
+extern int cursorPos;
+extern char *macgets (void);
+//Added by Ning Hu	Apr.2001
+extern int _isatty(int);					
+extern int redirect_flag;
+//Add end
+
+/* local variables */
+int lposition;
+static char *linebuf = NULL, *lineptr;
+static int numChars;
+
+/* input thread */
+unsigned long input_thread_handle = -1;
+#define NEED_INPUT if (input_thread_handle == -1) start_input_thread();
+#define input_buffer_max 1024
+#define input_buffer_mask (input_buffer_max - 1)
+char input_buffer[1024];
+volatile int input_buffer_head = 0;
+volatile int input_buffer_tail = 0;
+volatile int buffer_eof = 0;
+HANDLE input_buffer_ready = NULL;
+
+BOOL WINAPI ctrl_c_handler(DWORD dwCtrlType)
+{
+    if (dwCtrlType == CTRL_C_EVENT) {
+        abort_flag = ABORT_LEVEL;
+        return TRUE;
+    }
+    return FALSE;
+}
+
+#ifdef DEBUG_INPUT
+extern FILE *to_input_buffer;
+#endif
+
+void input_thread_run(void *args)
+{
+    int c;
+    /* this gets called, possible later, in io_init() in userio.c, but
+     * that doesn't seem to prevent this thread from being killed by
+     * CTRL-C, so call it here to be safe.
+     */
+    SetConsoleCtrlHandler(ctrl_c_handler, TRUE);
+    /* printf("input_thread_run\n"); */
+
+    while (!buffer_eof) {
+        int head;
+        c = getchar();
+        if (c == EOF && abort_flag) {
+            // when user types ^C, an EOF is generated for some reason. 
+			// Ignore it...
+            if (abort_flag == ABORT_LEVEL) c = ABORT_CHAR;
+            else c = BREAK_CHAR;
+        } else if (c == ABORT_CHAR) {
+            abort_flag = ABORT_LEVEL;
+        } else if (!abort_flag && c == BREAK_CHAR) {
+            // notice that a break will be ignored until XLISP
+            // handles the ABORT_LEVEL
+            abort_flag = BREAK_LEVEL;
+        } else if (c == BREAK_CHAR) {
+            ; // ignore this because abort_flag is set to ABORT_LEVEL
+		} else if (c == '\005' || c == '\006') { // control-e or control-f
+		  ; // ignore these. IDE will send control-f to turn off echo, but
+			  // under Windows, echo is already turned off. We filter control-f
+			  // here to avoid generating an error message. Maybe the IDE should
+		  // not send control-f in the first place, but the IDE is cross-platform
+		  // and does not know it's running under Windows, whereas this file
+		  // is platform dependent.
+        } else if (c == '\016') { // begin hidden message
+#define MSGBUF_MAX 64
+            char msgbuf[MSGBUF_MAX];
+            int msgbufx = 0;
+            char type_char = getchar(); // read message type character
+            printf("begin hidden message: %c\n", type_char);
+            if (type_char == EOF) buffer_eof = TRUE;
+            else {
+                // message is terminated by '\021'
+                while ((c = getchar()) != '\021' && 
+                       c != EOF &&
+                       msgbufx < MSGBUF_MAX - 1) {
+                    msgbuf[msgbufx++] = c;
+                }
+                msgbuf[msgbufx++] = 0;
+                printf("message: %s\n", msgbuf);
+                if (c == EOF) buffer_eof = TRUE;
+                else if (msgbufx < MSGBUF_MAX) {
+                    if (type_char == 'S') {  // slider change message
+                        // message format is index<space>value
+                        int index;
+                        float value;
+                        if (sscanf(msgbuf, "%d %g", &index, &value) == 2) {
+                            set_slider(index, value);
+                            printf("set_slider %d %g\n", index, value);
+                        }
+                    }
+                }
+            }
+		} else if (c == EOF) {
+			buffer_eof = TRUE;
+        } else {
+            // insert character into the FIFO
+            head = (input_buffer_head + 1) & input_buffer_mask;
+            while (head == input_buffer_tail) Sleep(100);
+            input_buffer[input_buffer_head] = c;
+#ifdef DEBUG_INPUT
+			if (to_input_buffer) putc(c, to_input_buffer);
+#endif
+            input_buffer_head = head;
+        }
+        if (c == '\n' || abort_flag || buffer_eof) {
+            SetEvent(input_buffer_ready);
+            // wake up Nyquist if it is waiting for input
+        }
+    } 
+    // printf("Input thread exiting\n");
+}
+
+//int isascii (char c) { return 1; }  /* every char is an ascii char, isn't it? */
+
+void start_input_thread()
+{
+    // create thread to process input
+    input_thread_handle = _beginthread(input_thread_run, 0, NULL);
+    if (input_thread_handle == -1) {
+        printf("Unable to create input thread, errno = %d\n", errno);
+        EXIT(1);
+    }
+}
+
+void osinit (char *banner) 
+{
+    printf(banner);
+    if (_isatty( _fileno( stdin ) ) ){
+        redirect_flag = 0;
+#ifdef DEBUG
+        printf( "stdout has not been redirected to a file\n" );		//for debugging use
+#endif
+    } else {
+        redirect_flag = 1;
+#ifdef DEBUG
+        printf( "stdout has been redirected to a file\n");			//for debugging use
+#endif
+    }
+    // signal when input is ready
+    input_buffer_ready = CreateEvent(NULL, FALSE, FALSE, NULL);
+    if (input_buffer_ready == NULL) {
+        printf("Unable to create Event object\n");
+        EXIT(1);
+    }
+}
+
+FILE *osaopen (char *name, char *mode) {
+    return fopen (name, mode);
+}
+
+FILE *osbopen (char *name, char *mode) {
+    char nmode[4];
+    strcpy (nmode, mode); strcat (nmode, "b");
+    return (fopen (name, nmode));
+}
+
+int osclose (FILE *fp) { return (fclose (fp)); }
+int osaputc (int ch, FILE *fp) { return (putc (ch, fp)); }
+int osbputc (int ch, FILE *fp) { return (putc (ch, fp)); }
+void osoutflush(FILE *fp) { fflush(fp); }
+
+/* osagetc - get a character from an ascii file */
+int osagetc(fp)
+  FILE *fp;
+{
+    return (getc(fp));
+}
+
+extern int abort_flag;
+extern int redirect_flag;			//Added by Ning Hu	Apr.2001
+int ostgetc (void) 
+{
+    int c;
+	NEED_INPUT;
+    while (!buffer_eof && (input_buffer_tail == input_buffer_head)) {
+        oscheck();
+        WaitForSingleObject(input_buffer_ready, INFINITE);
+    }
+	if (buffer_eof) c = EOF;
+	else {
+        c = input_buffer[input_buffer_tail];
+	    input_buffer_tail = (input_buffer_tail + 1) & input_buffer_mask;
+	}
+    if (c == '\025') { // control-u
+        xlcleanup();
+    } else if (c == '\020') { // control-p
+        xlcontinue();
+    } else if (c == '\024') { // control-t
+        xinfo();
+    }
+    return c;
+}
+
+
+void ostputc (int ch) {
+//	macputc (ch);
+    putchar(ch);			// console
+
+    if (tfp) osaputc (ch, tfp);
+}
+
+void ostoutflush()
+{
+    if (tfp) fflush(tfp);
+    fflush(stdout);
+}
+
+
+void osflush (void) {
+    lineptr = linebuf;
+    numChars = 0;
+    lposition = 0;
+}
+
+
+void oscheck (void) {				
+    MSG lpMsg;
+
+#if OSC
+    if (nosc_enabled) nosc_poll();
+#endif
+
+    // check_aborted();	-- call to userio.c superceded by code here in winstuff.c
+//	printf("Current Thread: %d\n", GetCurrentThreadId());		//for debugging use
+	// look for Windows messages from NyqIDE (a Delphi program)
+    if ((redirect_flag) && (PeekMessage(&lpMsg, NULL, 0, 0, PM_REMOVE)!=0)) { 
+        if (lpMsg.message == WM_CHAR) {
+            switch (lpMsg.wParam) {
+                case ABORT_CHAR: abort_flag = ABORT_LEVEL;
+                                break;
+                case BREAK_CHAR: // for nyquist, defined to be 2
+                case 7:          // NyqIDE sends 7 (BEL) as break character
+                    abort_flag = BREAK_LEVEL;
+                    break;
+            }
+            // printf("Get message: %d %d %d\n", lpMsg.wParam, BREAK_CHAR, abort_flag);				//for debugging use
+        }
+    }	
+    if (abort_flag == ABORT_LEVEL) {	
+        abort_flag = 0;
+        osflush();
+        xltoplevel();
+    } else if (abort_flag == BREAK_LEVEL) {
+        abort_flag = 0;
+        osflush();
+        xlbreak("BREAK", s_unbound);
+    }
+}
+//Update end
+
+void oserror (char *msg) {
+    char line[100], *p;
+    sprintf (line,"error: %s\n",msg);
+    for (p = line; *p != '\0'; ++p) ostputc (*p);
+}
+
+void osfinish(void) {
+    portaudio_exit();
+    /* dispose of everything... */
+//	if (linebuf) DisposPtr (linebuf);
+//	MacWrapUp ();
+//	ExitToShell ();
+}
+
+int renamebackup (char *filename) { return 0; }
+
+
+
+
+static WIN32_FIND_DATA FindFileData;
+static HANDLE hFind = INVALID_HANDLE_VALUE;
+#define OSDIR_LIST_READY 0
+#define OSDIR_LIST_STARTED 1
+#define OSDIR_LIST_DONE 2
+static int osdir_list_status = OSDIR_LIST_READY;
+#define OSDIR_MAX_PATH 256
+static char osdir_path[OSDIR_MAX_PATH];
+
+// osdir_list_start -- prepare to list a directory
+int osdir_list_start(char *path)
+{
+    if (strlen(path) >= OSDIR_MAX_PATH - 2) {
+        xlcerror("LISTDIR path too big", "return nil", NULL);
+        return FALSE;
+    }
+    strcpy(osdir_path, path);
+    strcat(osdir_path, "/*"); // make a pattern to match all files
+    if (osdir_list_status != OSDIR_LIST_READY) {
+        osdir_list_finish(); // close previously interrupted listing
+    }
+    hFind = FindFirstFile(osdir_path, &FindFileData); // get the "."
+    if (hFind == INVALID_HANDLE_VALUE) return FALSE;
+    if (FindNextFile(hFind, &FindFileData) == 0) return FALSE; // get the ".."
+    osdir_list_status = OSDIR_LIST_STARTED;
+    return TRUE;
+}
+
+
+char *osdir_list_next()
+{
+    if (FindNextFile(hFind, &FindFileData) == 0) {
+        osdir_list_status = OSDIR_LIST_DONE;
+        return NULL;
+    }
+    return FindFileData.cFileName;
+}
+
+void osdir_list_finish()
+{
+    if (osdir_list_status != OSDIR_LIST_READY) {
+        FindClose(hFind);
+    }
+    osdir_list_status = OSDIR_LIST_READY;
+}
+
+
+/* xechoenabled -- set/clear echo_enabled flag (unix only) */
+LVAL xechoenabled()
+{
+	int flag = (xlgetarg() != NULL);
+    xllastarg();
+	// echo_enabled = flag; -- do nothing in Windows
+	return NULL;
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/tran/abs.alg b/lib-src/libnyquist/nyquist/tran/abs.alg
new file mode 100644
index 0000000..2c139e6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/abs.alg
@@ -0,0 +1,9 @@
+(ABS-ALG
+  (NAME "abs")
+  (ARGUMENTS ("sound_type" "input"))
+  (ALWAYS-SCALE input)
+  (START (MIN input))
+  (INNER-LOOP "{ sample_type s = input; sample_type o = s; if (o < 0.0) o = -o; output = o; }")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/abs.c b/lib-src/libnyquist/nyquist/tran/abs.c
new file mode 100644
index 0000000..130d185
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/abs.c
@@ -0,0 +1,198 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "abs.h"
+
+void abs_free();
+
+
+typedef struct abs_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+} abs_susp_node, *abs_susp_type;
+
+
+void abs_s_fetch(register abs_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "abs_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ sample_type s = (input_scale_reg * *input_ptr_reg++); sample_type o = s; if (o < 0.0) o = -o; *out_ptr_reg++ = o; };
+	} while (--n); /* inner loop */
+
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* abs_s_fetch */
+
+
+void abs_toss_fetch(susp, snd_list)
+  register abs_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void abs_mark(abs_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void abs_free(abs_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(abs_susp_node), "abs_free");
+}
+
+
+void abs_print_tree(abs_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_abs(sound_type input)
+{
+    register abs_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, abs_susp_node, "snd_make_abs");
+    susp->susp.fetch = abs_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = abs_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = abs_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = abs_mark;
+    susp->susp.print_tree = abs_print_tree;
+    susp->susp.name = "abs";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_abs(sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_abs(input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/abs.h b/lib-src/libnyquist/nyquist/tran/abs.h
new file mode 100644
index 0000000..04b8d78
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/abs.h
@@ -0,0 +1,3 @@
+sound_type snd_make_abs(sound_type input);
+sound_type snd_abs(sound_type input);
+    /* LISP: (snd-abs SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/allpoles.alg b/lib-src/libnyquist/nyquist/tran/allpoles.alg
new file mode 100644
index 0000000..ab29850
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/allpoles.alg
@@ -0,0 +1,70 @@
+(ALLPOLES-ALG
+(NAME "allpoles")
+(ARGUMENTS ("sound_type" "x_snd")("LVAL" "ak_array")("double" "gain"))
+(START (MIN x_snd))
+(NOT-IN-INNER-LOOP "ak_array")
+(ALWAYS-SCALE x_snd)
+(TERMINATE (MIN x_snd))
+(LOGICAL-STOP (MIN x_snd))
+
+(STATE
+      ("long" "ak_len" "0") ; length of coefs ak array
+      ("LVAL" "ak_array" "ak_array")
+      ("double" "gain" "gain")
+      ("double *" "ak_coefs" "NULL") ; coefs array
+      ("double *" "zk_buf" "NULL")   ; last values of output
+      ("long" "index" "0")
+)
+
+(OUTER-LOOP "
+      if (susp->ak_array == NULL) {
+             togo = 0; /* indicate termination */
+             break;    /* we're done */
+      }
+      else if (!vectorp(susp->ak_array))
+           xlerror(\"array expected\", susp->ak_array);
+      else if (susp->ak_coefs == NULL)
+           {
+               long i;
+               susp->ak_len = getsize(susp->ak_array);
+               if (susp->ak_len < 1) xlerror(\"array has not elements\", susp->ak_array);
+               susp->ak_coefs = (double *) calloc(susp->ak_len, sizeof(double));
+               susp->zk_buf   = (double *) calloc(susp->ak_len, sizeof(double));
+ 
+              /* at this point we have a new array and a place to put ak coefs */
+              for(i=0; i < susp->ak_len; i++) {
+                 LVAL elem = getelement(susp->ak_array,i);
+                 if (ntype(elem) != FLONUM) {
+                      xlerror(\"flonum expected\", elem);
+                 }
+                 susp->ak_coefs[i] = getflonum(elem);
+              }
+
+            }
+")
+
+
+(CONSTANT "ak_array" "ak_coefs" "ak_len" "gain")
+(SAMPLE-RATE "x_snd->sr")
+(INNER-LOOP-LOCALS "double z0; long xi; long xj;")
+
+(INNER-LOOP "
+               z0 = x_snd*gain;
+               for (xi=0; xi < ak_len ; xi++)
+                   {
+                     xj = index + xi; if (xj >= ak_len) xj -= ak_len;
+                     z0 +=  ak_coefs[xi] * zk_buf[xj];
+                   }
+               zk_buf[index] = z0;
+               index++; if (index == ak_len) index = 0;
+               output = (sample_type) z0;
+")
+
+(FINALIZATION "
+     free(susp->zk_buf);
+     free(susp->ak_coefs);
+     susp->ak_array = NULL;  /* free array */
+")
+)
+
+
diff --git a/lib-src/libnyquist/nyquist/tran/allpoles.c b/lib-src/libnyquist/nyquist/tran/allpoles.c
new file mode 100644
index 0000000..39e47a5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/allpoles.c
@@ -0,0 +1,264 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "allpoles.h"
+
+void allpoles_free();
+
+
+typedef struct allpoles_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type x_snd;
+    long x_snd_cnt;
+    sample_block_values_type x_snd_ptr;
+
+    long ak_len;
+    LVAL ak_array;
+    double gain;
+    double *ak_coefs;
+    double *zk_buf;
+    long index;
+} allpoles_susp_node, *allpoles_susp_type;
+
+
+void allpoles_s_fetch(register allpoles_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long ak_len_reg;
+    register double gain_reg;
+    register double * ak_coefs_reg;
+    register double * zk_buf_reg;
+    register long index_reg;
+    register sample_type x_snd_scale_reg = susp->x_snd->scale;
+    register sample_block_values_type x_snd_ptr_reg;
+    falloc_sample_block(out, "allpoles_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the x_snd input sample block: */
+	susp_check_term_log_samples(x_snd, x_snd_ptr, x_snd_cnt);
+	togo = min(togo, susp->x_snd_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+
+      if (susp->ak_array == NULL) {
+             togo = 0; /* indicate termination */
+             break;    /* we're done */
+      }
+      else if (!vectorp(susp->ak_array))
+           xlerror("array expected", susp->ak_array);
+      else if (susp->ak_coefs == NULL)
+           {
+               long i;
+               susp->ak_len = getsize(susp->ak_array);
+               if (susp->ak_len < 1) xlerror("array has not elements", susp->ak_array);
+               susp->ak_coefs = (double *) calloc(susp->ak_len, sizeof(double));
+               susp->zk_buf   = (double *) calloc(susp->ak_len, sizeof(double));
+ 
+              /* at this point we have a new array and a place to put ak coefs */
+              for(i=0; i < susp->ak_len; i++) {
+                 LVAL elem = getelement(susp->ak_array,i);
+                 if (ntype(elem) != FLONUM) {
+                      xlerror("flonum expected", elem);
+                 }
+                 susp->ak_coefs[i] = getflonum(elem);
+              }
+
+            }
+
+	n = togo;
+	ak_len_reg = susp->ak_len;
+	gain_reg = susp->gain;
+	ak_coefs_reg = susp->ak_coefs;
+	zk_buf_reg = susp->zk_buf;
+	index_reg = susp->index;
+	x_snd_ptr_reg = susp->x_snd_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double z0; long xi; long xj;
+               z0 = (x_snd_scale_reg * *x_snd_ptr_reg++)*gain_reg;
+               for (xi=0; xi < ak_len_reg ; xi++)
+                   {
+                     xj = index_reg + xi; if (xj >= ak_len_reg) xj -= ak_len_reg;
+                     z0 +=  ak_coefs_reg[xi] * zk_buf_reg[xj];
+                   }
+               zk_buf_reg[index_reg] = z0;
+               index_reg++; if (index_reg == ak_len_reg) index_reg = 0;
+               *out_ptr_reg++ = (sample_type) z0;
+;
+	} while (--n); /* inner loop */
+
+	susp->zk_buf = zk_buf_reg;
+	susp->index = index_reg;
+	/* using x_snd_ptr_reg is a bad idea on RS/6000: */
+	susp->x_snd_ptr += togo;
+	out_ptr += togo;
+	susp_took(x_snd_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* allpoles_s_fetch */
+
+
+void allpoles_toss_fetch(susp, snd_list)
+  register allpoles_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from x_snd up to final_time for this block of zeros */
+    while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >=
+	   susp->x_snd->current)
+	susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr -
+         (susp->x_snd->current - susp->x_snd_cnt));
+    susp->x_snd_ptr += n;
+    susp_took(x_snd_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void allpoles_mark(allpoles_susp_type susp)
+{
+    if (susp->ak_array) mark(susp->ak_array);
+    sound_xlmark(susp->x_snd);
+}
+
+
+void allpoles_free(allpoles_susp_type susp)
+{
+
+     free(susp->zk_buf);
+     free(susp->ak_coefs);
+     susp->ak_array = NULL;  /* free array */
+    sound_unref(susp->x_snd);
+    ffree_generic(susp, sizeof(allpoles_susp_node), "allpoles_free");
+}
+
+
+void allpoles_print_tree(allpoles_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("x_snd:");
+    sound_print_tree_1(susp->x_snd, n);
+}
+
+
+sound_type snd_make_allpoles(sound_type x_snd, LVAL ak_array, double gain)
+{
+    register allpoles_susp_type susp;
+    rate_type sr = x_snd->sr;
+    time_type t0 = x_snd->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, allpoles_susp_node, "snd_make_allpoles");
+    susp->ak_len = 0;
+    susp->ak_array = ak_array;
+    susp->gain = gain;
+    susp->ak_coefs = NULL;
+    susp->zk_buf = NULL;
+    susp->index = 0;
+    susp->susp.fetch = allpoles_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < x_snd->t0) sound_prepend_zeros(x_snd, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(x_snd->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = allpoles_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = allpoles_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = allpoles_mark;
+    susp->susp.print_tree = allpoles_print_tree;
+    susp->susp.name = "allpoles";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(x_snd);
+    susp->susp.current = 0;
+    susp->x_snd = x_snd;
+    susp->x_snd_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_allpoles(sound_type x_snd, LVAL ak_array, double gain)
+{
+    sound_type x_snd_copy = sound_copy(x_snd);
+    return snd_make_allpoles(x_snd_copy, ak_array, gain);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/allpoles.h b/lib-src/libnyquist/nyquist/tran/allpoles.h
new file mode 100644
index 0000000..aadcc65
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/allpoles.h
@@ -0,0 +1,3 @@
+sound_type snd_make_allpoles(sound_type x_snd, LVAL ak_array, double gain);
+sound_type snd_allpoles(sound_type x_snd, LVAL ak_array, double gain);
+    /* LISP: (snd-allpoles SOUND ANY ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/alpass.alg b/lib-src/libnyquist/nyquist/tran/alpass.alg
new file mode 100644
index 0000000..99d8eb9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpass.alg
@@ -0,0 +1,22 @@
+(ALPASS-ALG
+(NAME "alpass")
+(ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("double" "feedback"))
+(START (MIN input))
+(STATE ("double" "feedback" "feedback")
+       ("long" "delaylen" "max(1, round(input->sr * delay))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "endptr" "susp->delaybuf + susp->delaylen"))
+(CONSTANT "feedback" "delaylen" "endptr")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP-LOCALS "register sample_type y, z;\n")
+(INNER-LOOP "	    y = *delayptr;
+        *delayptr++ = z = (sample_type) (feedback * y + input);
+        output = (sample_type) (y - feedback * z);
+        if (delayptr >= endptr) delayptr = susp->delaybuf;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/alpass.c b/lib-src/libnyquist/nyquist/tran/alpass.c
new file mode 100644
index 0000000..cad43ef
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpass.c
@@ -0,0 +1,193 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "alpass.h"
+
+void alpass_free();
+
+
+typedef struct alpass_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double feedback;
+    long delaylen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} alpass_susp_node, *alpass_susp_type;
+
+
+void alpass_n_fetch(register alpass_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double feedback_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpass_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	feedback_reg = susp->feedback;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+register sample_type y, z;
+	    y = *delayptr_reg;
+        *delayptr_reg++ = z = (sample_type) (feedback_reg * y + *input_ptr_reg++);
+        *out_ptr_reg++ = (sample_type) (y - feedback_reg * z);
+        if (delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpass_n_fetch */
+
+
+void alpass_toss_fetch(susp, snd_list)
+  register alpass_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void alpass_mark(alpass_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void alpass_free(alpass_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(alpass_susp_node), "alpass_free");
+}
+
+
+void alpass_print_tree(alpass_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_alpass(sound_type input, time_type delay, double feedback)
+{
+    register alpass_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, alpass_susp_node, "snd_make_alpass");
+    susp->feedback = feedback;
+    susp->delaylen = max(1, round(input->sr * delay));
+    susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type));
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->delaylen;
+    susp->susp.fetch = alpass_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = alpass_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = alpass_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = alpass_mark;
+    susp->susp.print_tree = alpass_print_tree;
+    susp->susp.name = "alpass";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_alpass(sound_type input, time_type delay, double feedback)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_alpass(input_copy, delay, feedback);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/alpass.h b/lib-src/libnyquist/nyquist/tran/alpass.h
new file mode 100644
index 0000000..a526d1f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpass.h
@@ -0,0 +1,3 @@
+sound_type snd_make_alpass(sound_type input, time_type delay, double feedback);
+sound_type snd_alpass(sound_type input, time_type delay, double feedback);
+    /* LISP: (snd-alpass SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/alpasscv.alg b/lib-src/libnyquist/nyquist/tran/alpasscv.alg
new file mode 100644
index 0000000..ba1602a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpasscv.alg
@@ -0,0 +1,21 @@
+(ALPASSCV-ALG
+(NAME "alpasscv")
+(ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("sound_type" "feedback"))
+(START (MAX input feedback))
+(STATE ("long" "delaylen" "max(1, round(input->sr * delay))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "endptr" "susp->delaybuf + susp->delaylen"))
+(CONSTANT "delaylen" "endptr")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP-LOCALS "register sample_type y, z, fb;\n")
+(INNER-LOOP "	    y = *delayptr;
+        *delayptr++ = z = (sample_type) ((fb = feedback) * y + input);
+        output = (sample_type) (y - fb * z);
+        if (delayptr >= endptr) delayptr = susp->delaybuf;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/alpasscv.c b/lib-src/libnyquist/nyquist/tran/alpasscv.c
new file mode 100644
index 0000000..99c4855
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpasscv.c
@@ -0,0 +1,302 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "alpasscv.h"
+
+void alpasscv_free();
+
+
+typedef struct alpasscv_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+    sound_type feedback;
+    long feedback_cnt;
+    sample_block_values_type feedback_ptr;
+
+    long delaylen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} alpasscv_susp_node, *alpasscv_susp_type;
+
+
+void alpasscv_nn_fetch(register alpasscv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpasscv_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+register sample_type y, z, fb;
+	    y = *delayptr_reg;
+        *delayptr_reg++ = z = (sample_type) ((fb = *feedback_ptr_reg++) * y + *input_ptr_reg++);
+        *out_ptr_reg++ = (sample_type) (y - fb * z);
+        if (delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpasscv_nn_fetch */
+
+
+void alpasscv_ns_fetch(register alpasscv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_type feedback_scale_reg = susp->feedback->scale;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpasscv_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+register sample_type y, z, fb;
+	    y = *delayptr_reg;
+        *delayptr_reg++ = z = (sample_type) ((fb = (feedback_scale_reg * *feedback_ptr_reg++)) * y + *input_ptr_reg++);
+        *out_ptr_reg++ = (sample_type) (y - fb * z);
+        if (delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpasscv_ns_fetch */
+
+
+void alpasscv_toss_fetch(susp, snd_list)
+  register alpasscv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* fetch samples from feedback up to final_time for this block of zeros */
+    while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >=
+	   susp->feedback->current)
+	susp_get_samples(feedback, feedback_ptr, feedback_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    n = round((final_time - susp->feedback->t0) * susp->feedback->sr -
+         (susp->feedback->current - susp->feedback_cnt));
+    susp->feedback_ptr += n;
+    susp_took(feedback_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void alpasscv_mark(alpasscv_susp_type susp)
+{
+    sound_xlmark(susp->input);
+    sound_xlmark(susp->feedback);
+}
+
+
+void alpasscv_free(alpasscv_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->input);
+    sound_unref(susp->feedback);
+    ffree_generic(susp, sizeof(alpasscv_susp_node), "alpasscv_free");
+}
+
+
+void alpasscv_print_tree(alpasscv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+
+    indent(n);
+    stdputstr("feedback:");
+    sound_print_tree_1(susp->feedback, n);
+}
+
+
+sound_type snd_make_alpasscv(sound_type input, time_type delay, sound_type feedback)
+{
+    register alpasscv_susp_type susp;
+    rate_type sr = max(input->sr, feedback->sr);
+    time_type t0 = max(input->t0, feedback->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, alpasscv_susp_node, "snd_make_alpasscv");
+    susp->delaylen = max(1, round(input->sr * delay));
+    susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type));
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->delaylen;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    interp_desc = (interp_desc << 2) + interp_style(feedback, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = alpasscv_nn_fetch; break;
+      case INTERP_ns: susp->susp.fetch = alpasscv_ns_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    if (t0 < feedback->t0) sound_prepend_zeros(feedback, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, min(feedback->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = alpasscv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = alpasscv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = alpasscv_mark;
+    susp->susp.print_tree = alpasscv_print_tree;
+    susp->susp.name = "alpasscv";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    susp->feedback = feedback;
+    susp->feedback_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_alpasscv(sound_type input, time_type delay, sound_type feedback)
+{
+    sound_type input_copy = sound_copy(input);
+    sound_type feedback_copy = sound_copy(feedback);
+    return snd_make_alpasscv(input_copy, delay, feedback_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/alpasscv.h b/lib-src/libnyquist/nyquist/tran/alpasscv.h
new file mode 100644
index 0000000..5d2ec0a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpasscv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_alpasscv(sound_type input, time_type delay, sound_type feedback);
+sound_type snd_alpasscv(sound_type input, time_type delay, sound_type feedback);
+    /* LISP: (snd-alpasscv SOUND ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvc.alg b/lib-src/libnyquist/nyquist/tran/alpassvc.alg
new file mode 100644
index 0000000..c3c13db
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvc.alg
@@ -0,0 +1,59 @@
+(ALPASSVC-ALG
+;;
+;; delay is variable -- but we don't want to reallocate the delay buffer, so
+;; use an additional parameter for the maximum allowable delay. The sound will
+;; be written into the buffer every sample, but read using linear 
+;; interpolation. As in tapv, duplicate the sample at the first and last 
+;; locations in the buffer.
+;;
+(NAME "alpassvc")
+(ARGUMENTS ("sound_type" "input") ("sound_type" "delaysnd") ("double" "feedback") 
+           ("double" "maxdelay"))
+(START (MAX input delaysnd))
+(STATE ("float" "delay_scale_factor" "(float) (input->sr * delaysnd->scale)")
+       ("double" "feedback" "feedback")
+       ("long" "buflen" "max(2, (long) (input->sr * maxdelay + 2.5))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->buflen + 1, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+;; since we allocate one extra sample, endptr points to the last sample
+       ("sample_type *" "endptr" "susp->delaybuf + susp->buflen"))
+(CONSTANT "feedback" "delaylen" "endptr" "delay_scale_factor")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP-LOCALS "        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;\n")
+(INNER-LOOP "
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        delaysamp = delaysnd * delay_scale_factor;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr + buflen - (delayi + 1);
+        if (yptr >= endptr) yptr -= buflen;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr++ = z = (sample_type) (feedback * y + input);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr > endptr) {
+            delayptr = susp->delaybuf;
+            *delayptr++ = *endptr;
+        }
+        output = (sample_type) (y - feedback * z);")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvc.c b/lib-src/libnyquist/nyquist/tran/alpassvc.c
new file mode 100644
index 0000000..e5bdf4b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvc.c
@@ -0,0 +1,374 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "alpassvc.h"
+
+void alpassvc_free();
+
+
+typedef struct alpassvc_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+    sound_type delaysnd;
+    long delaysnd_cnt;
+    sample_block_values_type delaysnd_ptr;
+
+    float delay_scale_factor;
+    double feedback;
+    long buflen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} alpassvc_susp_node, *alpassvc_susp_type;
+
+
+void alpassvc_nn_fetch(register alpassvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register double feedback_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvc_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	feedback_reg = susp->feedback;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        delaysamp = *delaysnd_ptr_reg++ * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (feedback_reg * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - feedback_reg * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvc_nn_fetch */
+
+
+void alpassvc_ns_fetch(register alpassvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register double feedback_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_type delaysnd_scale_reg = susp->delaysnd->scale;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvc_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	feedback_reg = susp->feedback;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        delaysamp = (delaysnd_scale_reg * *delaysnd_ptr_reg++) * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (feedback_reg * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - feedback_reg * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvc_ns_fetch */
+
+
+void alpassvc_toss_fetch(susp, snd_list)
+  register alpassvc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* fetch samples from delaysnd up to final_time for this block of zeros */
+    while ((round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >=
+	   susp->delaysnd->current)
+	susp_get_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    n = round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr -
+         (susp->delaysnd->current - susp->delaysnd_cnt));
+    susp->delaysnd_ptr += n;
+    susp_took(delaysnd_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void alpassvc_mark(alpassvc_susp_type susp)
+{
+    sound_xlmark(susp->input);
+    sound_xlmark(susp->delaysnd);
+}
+
+
+void alpassvc_free(alpassvc_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->input);
+    sound_unref(susp->delaysnd);
+    ffree_generic(susp, sizeof(alpassvc_susp_node), "alpassvc_free");
+}
+
+
+void alpassvc_print_tree(alpassvc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+
+    indent(n);
+    stdputstr("delaysnd:");
+    sound_print_tree_1(susp->delaysnd, n);
+}
+
+
+sound_type snd_make_alpassvc(sound_type input, sound_type delaysnd, double feedback, double maxdelay)
+{
+    register alpassvc_susp_type susp;
+    rate_type sr = max(input->sr, delaysnd->sr);
+    time_type t0 = max(input->t0, delaysnd->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, alpassvc_susp_node, "snd_make_alpassvc");
+    susp->delay_scale_factor = (float) (input->sr * delaysnd->scale);
+    susp->feedback = feedback;
+    susp->buflen = max(2, (long) (input->sr * maxdelay + 2.5));
+    susp->delaybuf = (sample_type *) calloc (susp->buflen + 1, sizeof(sample_type));
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->buflen;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    interp_desc = (interp_desc << 2) + interp_style(delaysnd, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = alpassvc_nn_fetch; break;
+      case INTERP_ns: susp->susp.fetch = alpassvc_ns_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    if (t0 < delaysnd->t0) sound_prepend_zeros(delaysnd, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, min(delaysnd->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = alpassvc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = alpassvc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = alpassvc_mark;
+    susp->susp.print_tree = alpassvc_print_tree;
+    susp->susp.name = "alpassvc";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    susp->delaysnd = delaysnd;
+    susp->delaysnd_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_alpassvc(sound_type input, sound_type delaysnd, double feedback, double maxdelay)
+{
+    sound_type input_copy = sound_copy(input);
+    sound_type delaysnd_copy = sound_copy(delaysnd);
+    return snd_make_alpassvc(input_copy, delaysnd_copy, feedback, maxdelay);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvc.h b/lib-src/libnyquist/nyquist/tran/alpassvc.h
new file mode 100644
index 0000000..127f299
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_alpassvc(sound_type input, sound_type delaysnd, double feedback, double maxdelay);
+sound_type snd_alpassvc(sound_type input, sound_type delaysnd, double feedback, double maxdelay);
+    /* LISP: (snd-alpassvc SOUND SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvv.alg b/lib-src/libnyquist/nyquist/tran/alpassvv.alg
new file mode 100644
index 0000000..cb4416c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvv.alg
@@ -0,0 +1,59 @@
+(ALPASSVC-ALG
+;;
+;; delay is variable -- but we don't want to reallocate the delay buffer, so
+;; use an additional parameter for the maximum allowable delay. The sound will
+;; be written into the buffer every sample, but read using linear 
+;; interpolation. As in tapv, duplicate the sample at the first and last 
+;; locations in the buffer.
+;;
+(NAME "alpassvv")
+(ARGUMENTS ("sound_type" "input") ("sound_type" "delaysnd") ("sound_type" "feedback") 
+           ("double" "maxdelay"))
+(START (MAX input delaysnd))
+(STATE ("float" "delay_scale_factor" "(float) (input->sr * delaysnd->scale)")
+       ("long" "buflen" "max(2, (long) (input->sr * maxdelay + 2.5))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->buflen + 1, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+;; since we allocate one extra sample, endptr points to the last sample
+       ("sample_type *" "endptr" "susp->delaybuf + susp->buflen"))
+(CONSTANT "delaylen" "endptr" "delay_scale_factor")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP-LOCALS "        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;\n")
+(INNER-LOOP "
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        register sample_type fb = feedback;
+        delaysamp = delaysnd * delay_scale_factor;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr + buflen - (delayi + 1);
+        if (yptr >= endptr) yptr -= buflen;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr++ = z = (sample_type) (fb * y + input);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr > endptr) {
+            delayptr = susp->delaybuf;
+            *delayptr++ = *endptr;
+        }
+        output = (sample_type) (y - fb * z);")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvv.c b/lib-src/libnyquist/nyquist/tran/alpassvv.c
new file mode 100644
index 0000000..308e6de
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvv.c
@@ -0,0 +1,645 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "alpassvv.h"
+
+void alpassvv_free();
+
+
+typedef struct alpassvv_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+    sound_type delaysnd;
+    long delaysnd_cnt;
+    sample_block_values_type delaysnd_ptr;
+    sound_type feedback;
+    long feedback_cnt;
+    sample_block_values_type feedback_ptr;
+
+    float delay_scale_factor;
+    long buflen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} alpassvv_susp_node, *alpassvv_susp_type;
+
+
+void alpassvv_nnn_fetch(register alpassvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvv_nnn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        register sample_type fb = *feedback_ptr_reg++;
+        delaysamp = *delaysnd_ptr_reg++ * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (fb * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - fb * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvv_nnn_fetch */
+
+
+void alpassvv_nns_fetch(register alpassvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_type feedback_scale_reg = susp->feedback->scale;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvv_nns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        register sample_type fb = (feedback_scale_reg * *feedback_ptr_reg++);
+        delaysamp = *delaysnd_ptr_reg++ * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (fb * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - fb * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvv_nns_fetch */
+
+
+void alpassvv_nsn_fetch(register alpassvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_type delaysnd_scale_reg = susp->delaysnd->scale;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvv_nsn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        register sample_type fb = *feedback_ptr_reg++;
+        delaysamp = (delaysnd_scale_reg * *delaysnd_ptr_reg++) * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (fb * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - fb * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvv_nsn_fetch */
+
+
+void alpassvv_nss_fetch(register alpassvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register float delay_scale_factor_reg;
+    register long buflen_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_type feedback_scale_reg = susp->feedback->scale;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_type delaysnd_scale_reg = susp->delaysnd->scale;
+    register sample_block_values_type delaysnd_ptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "alpassvv_nss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the delaysnd input sample block: */
+	susp_check_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+	togo = min(togo, susp->delaysnd_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delay_scale_factor_reg = susp->delay_scale_factor;
+	buflen_reg = susp->buflen;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	delaysnd_ptr_reg = susp->delaysnd_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        register sample_type y, z, delaysamp;
+        register int delayi;
+        register sample_type *yptr;
+
+        /* compute where to read y, we want y to be delay_snd samples
+         * after delay_ptr, where we write the new sample. First, 
+         * conver from seconds to samples. Note: don't use actual sound_type
+         * names in comments! The translator isn't smart enough.
+         */
+        register sample_type fb = (feedback_scale_reg * *feedback_ptr_reg++);
+        delaysamp = (delaysnd_scale_reg * *delaysnd_ptr_reg++) * delay_scale_factor_reg;
+        delayi = (int) delaysamp; /* get integer part */
+        delaysamp = delaysamp - delayi; /* get phase */
+        yptr = delayptr_reg + buflen_reg - (delayi + 1);
+        if (yptr >= endptr_reg) yptr -= buflen_reg;
+        /* now get y, the out-put of the delay, using interpolation */
+        /* note that as phase increases, we use more of yptr[0] because
+           positive phase means longer buffer means read earlier sample */
+        y = (float) ((yptr[0] * delaysamp) + (yptr[1] * (1.0 - delaysamp)));
+        /* WARNING: no check to keep delaysamp in range, so do this in LISP */
+
+        *delayptr_reg++ = z = (sample_type) (fb * y + *input_ptr_reg++);
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */
+        if (delayptr_reg > endptr_reg) {
+            delayptr_reg = susp->delaybuf;
+            *delayptr_reg++ = *endptr_reg;
+        }
+        *out_ptr_reg++ = (sample_type) (y - fb * z);;
+	} while (--n); /* inner loop */
+
+	susp->buflen = buflen_reg;
+	susp->delayptr = delayptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using delaysnd_ptr_reg is a bad idea on RS/6000: */
+	susp->delaysnd_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(delaysnd_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* alpassvv_nss_fetch */
+
+
+void alpassvv_toss_fetch(susp, snd_list)
+  register alpassvv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* fetch samples from delaysnd up to final_time for this block of zeros */
+    while ((round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >=
+	   susp->delaysnd->current)
+	susp_get_samples(delaysnd, delaysnd_ptr, delaysnd_cnt);
+    /* fetch samples from feedback up to final_time for this block of zeros */
+    while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >=
+	   susp->feedback->current)
+	susp_get_samples(feedback, feedback_ptr, feedback_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    n = round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr -
+         (susp->delaysnd->current - susp->delaysnd_cnt));
+    susp->delaysnd_ptr += n;
+    susp_took(delaysnd_cnt, n);
+    n = round((final_time - susp->feedback->t0) * susp->feedback->sr -
+         (susp->feedback->current - susp->feedback_cnt));
+    susp->feedback_ptr += n;
+    susp_took(feedback_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void alpassvv_mark(alpassvv_susp_type susp)
+{
+    sound_xlmark(susp->input);
+    sound_xlmark(susp->delaysnd);
+    sound_xlmark(susp->feedback);
+}
+
+
+void alpassvv_free(alpassvv_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->input);
+    sound_unref(susp->delaysnd);
+    sound_unref(susp->feedback);
+    ffree_generic(susp, sizeof(alpassvv_susp_node), "alpassvv_free");
+}
+
+
+void alpassvv_print_tree(alpassvv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+
+    indent(n);
+    stdputstr("delaysnd:");
+    sound_print_tree_1(susp->delaysnd, n);
+
+    indent(n);
+    stdputstr("feedback:");
+    sound_print_tree_1(susp->feedback, n);
+}
+
+
+sound_type snd_make_alpassvv(sound_type input, sound_type delaysnd, sound_type feedback, double maxdelay)
+{
+    register alpassvv_susp_type susp;
+    rate_type sr = max(max(input->sr, delaysnd->sr), feedback->sr);
+    time_type t0 = max(input->t0, delaysnd->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, alpassvv_susp_node, "snd_make_alpassvv");
+    susp->delay_scale_factor = (float) (input->sr * delaysnd->scale);
+    susp->buflen = max(2, (long) (input->sr * maxdelay + 2.5));
+    susp->delaybuf = (sample_type *) calloc (susp->buflen + 1, sizeof(sample_type));
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->buflen;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    interp_desc = (interp_desc << 2) + interp_style(delaysnd, sr);
+    interp_desc = (interp_desc << 2) + interp_style(feedback, sr);
+    switch (interp_desc) {
+      case INTERP_nnn: susp->susp.fetch = alpassvv_nnn_fetch; break;
+      case INTERP_nns: susp->susp.fetch = alpassvv_nns_fetch; break;
+      case INTERP_nsn: susp->susp.fetch = alpassvv_nsn_fetch; break;
+      case INTERP_nss: susp->susp.fetch = alpassvv_nss_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    if (t0 < delaysnd->t0) sound_prepend_zeros(delaysnd, t0);
+    if (t0 < feedback->t0) sound_prepend_zeros(feedback, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, min(delaysnd->t0, min(feedback->t0, t0)));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = alpassvv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = alpassvv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = alpassvv_mark;
+    susp->susp.print_tree = alpassvv_print_tree;
+    susp->susp.name = "alpassvv";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    susp->delaysnd = delaysnd;
+    susp->delaysnd_cnt = 0;
+    susp->feedback = feedback;
+    susp->feedback_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_alpassvv(sound_type input, sound_type delaysnd, sound_type feedback, double maxdelay)
+{
+    sound_type input_copy = sound_copy(input);
+    sound_type delaysnd_copy = sound_copy(delaysnd);
+    sound_type feedback_copy = sound_copy(feedback);
+    return snd_make_alpassvv(input_copy, delaysnd_copy, feedback_copy, maxdelay);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/alpassvv.h b/lib-src/libnyquist/nyquist/tran/alpassvv.h
new file mode 100644
index 0000000..efbc345
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/alpassvv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_alpassvv(sound_type input, sound_type delaysnd, sound_type feedback, double maxdelay);
+sound_type snd_alpassvv(sound_type input, sound_type delaysnd, sound_type feedback, double maxdelay);
+    /* LISP: (snd-alpassvv SOUND SOUND SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/amosc.alg b/lib-src/libnyquist/nyquist/tran/amosc.alg
new file mode 100644
index 0000000..0103202
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/amosc.alg
@@ -0,0 +1,33 @@
+(AMOSC-ALG
+(NAME "amosc")
+(ARGUMENTS ("sound_type" "input") ("double" "step") ("rate_type" "sr")
+           ("double" "hz") ("time_type" "t0") ("sound_type" "amod")
+           ("double" "phase"))
+(TABLE "input")
+(NOT-IN-INNER-LOOP "input")
+(START (MIN input))
+(STATE 
+       ("double" "ph_incr" "0")
+       ("table_type" "the_table" "sound_to_table(input)")
+       ("sample_type *" "table_ptr" "susp->the_table->samples")
+       ("double" "table_len" "susp->the_table->length")
+       ("double" "phase" "compute_phase(phase, step, (long) susp->table_len,
+        input->sr, sr, hz, &susp->ph_incr)") )
+(ALWAYS-SCALE amod)
+(TERMINATE (MIN amod))
+(LOGICAL-STOP (MIN amod))
+(INNER-LOOP "
+            long table_index = (long) phase;
+            double x1 = (double) (table_ptr[table_index]);
+            output = (sample_type) (x1 + (phase - table_index) * 
+                          (table_ptr[table_index + 1] - x1)) * amod;
+            phase += ph_incr;
+            while (phase > table_len) phase -= table_len;
+")
+(CONSTANT "ph_incr" "table_len" "table_ptr" "the_table")
+
+(SAMPLE-RATE "sr")
+(FINALIZATION "    table_unref(susp->the_table);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/amosc.c b/lib-src/libnyquist/nyquist/tran/amosc.c
new file mode 100644
index 0000000..16e45b4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/amosc.c
@@ -0,0 +1,227 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "amosc.h"
+
+void amosc_free();
+
+
+typedef struct amosc_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type amod;
+    long amod_cnt;
+    sample_block_values_type amod_ptr;
+
+    double ph_incr;
+    table_type the_table;
+    sample_type *table_ptr;
+    double table_len;
+    double phase;
+} amosc_susp_node, *amosc_susp_type;
+
+
+void amosc_s_fetch(register amosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double ph_incr_reg;
+    register sample_type * table_ptr_reg;
+    register double table_len_reg;
+    register double phase_reg;
+    register sample_type amod_scale_reg = susp->amod->scale;
+    register sample_block_values_type amod_ptr_reg;
+    falloc_sample_block(out, "amosc_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the amod input sample block: */
+	susp_check_term_log_samples(amod, amod_ptr, amod_cnt);
+	togo = min(togo, susp->amod_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	ph_incr_reg = susp->ph_incr;
+	table_ptr_reg = susp->table_ptr;
+	table_len_reg = susp->table_len;
+	phase_reg = susp->phase;
+	amod_ptr_reg = susp->amod_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+            long table_index = (long) phase_reg;
+            double x1 = (double) (table_ptr_reg[table_index]);
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1)) * (amod_scale_reg * *amod_ptr_reg++);
+            phase_reg += ph_incr_reg;
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	/* using amod_ptr_reg is a bad idea on RS/6000: */
+	susp->amod_ptr += togo;
+	out_ptr += togo;
+	susp_took(amod_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* amosc_s_fetch */
+
+
+void amosc_toss_fetch(susp, snd_list)
+  register amosc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from amod up to final_time for this block of zeros */
+    while ((round((final_time - susp->amod->t0) * susp->amod->sr)) >=
+	   susp->amod->current)
+	susp_get_samples(amod, amod_ptr, amod_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->amod->t0) * susp->amod->sr -
+         (susp->amod->current - susp->amod_cnt));
+    susp->amod_ptr += n;
+    susp_took(amod_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void amosc_mark(amosc_susp_type susp)
+{
+    sound_xlmark(susp->amod);
+}
+
+
+void amosc_free(amosc_susp_type susp)
+{
+    table_unref(susp->the_table);
+    sound_unref(susp->amod);
+    ffree_generic(susp, sizeof(amosc_susp_node), "amosc_free");
+}
+
+
+void amosc_print_tree(amosc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("amod:");
+    sound_print_tree_1(susp->amod, n);
+}
+
+
+sound_type snd_make_amosc(sound_type input, double step, rate_type sr, double hz, time_type t0, sound_type amod, double phase)
+{
+    register amosc_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, amosc_susp_node, "snd_make_amosc");
+    susp->ph_incr = 0;
+    susp->the_table = sound_to_table(input);
+    susp->table_ptr = susp->the_table->samples;
+    susp->table_len = susp->the_table->length;
+    susp->phase = compute_phase(phase, step, (long) susp->table_len,
+        input->sr, sr, hz, &susp->ph_incr);
+    susp->susp.fetch = amosc_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < amod->t0) sound_prepend_zeros(amod, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(amod->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = amosc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = amosc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = amosc_mark;
+    susp->susp.print_tree = amosc_print_tree;
+    susp->susp.name = "amosc";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(amod);
+    susp->susp.current = 0;
+    susp->amod = amod;
+    susp->amod_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_amosc(sound_type input, double step, rate_type sr, double hz, time_type t0, sound_type amod, double phase)
+{
+    sound_type amod_copy = sound_copy(amod);
+    return snd_make_amosc(input, step, sr, hz, t0, amod_copy, phase);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/amosc.h b/lib-src/libnyquist/nyquist/tran/amosc.h
new file mode 100644
index 0000000..cc798f9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/amosc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_amosc(sound_type input, double step, rate_type sr, double hz, time_type t0, sound_type amod, double phase);
+sound_type snd_amosc(sound_type input, double step, rate_type sr, double hz, time_type t0, sound_type amod, double phase);
+    /* LISP: (snd-amosc SOUND ANYNUM ANYNUM ANYNUM ANYNUM SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/areson.alg b/lib-src/libnyquist/nyquist/tran/areson.alg
new file mode 100644
index 0000000..a26287e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/areson.alg
@@ -0,0 +1,24 @@
+(ARESON-ALG
+(NAME "areson")
+(ARGUMENTS ("sound_type" "input") ("double" "hz") ("double" "bw")
+           ("int" "normalization"))
+(START (MIN input))
+(TERMINATE (MIN input))
+(LOGICAL-STOP (MIN input))
+(LINEAR input)
+(STATE ("double" "c3" "exp(bw * -PI2 / input->sr)")
+       ("double" "c3p1" "susp->c3 + 1.0" TEMP)
+       ("double" "c3t4" "susp->c3 * 4.0" TEMP)
+       ("double" "omc3" "1.0 - susp->c3" TEMP)
+       ("double" "c2" "c3t4 * cos(hz * PI2 / input->sr) / c3p1")
+       ("double" "c1" "(normalization == 0 ? 0.0 :
+        (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - susp->c2 * susp->c2 / c3t4) :
+            1.0 - sqrt(c3p1 * c3p1 - susp->c2 * susp->c2) * omc3 / c3p1))")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0"))
+(CONSTANT "c1" "c2" "c3")
+(INNER-LOOP-LOCALS "            register double y0, current;")
+(INNER-LOOP "current = input;
+            output = (sample_type) (y0 = c1 * current + c2 * y1 - c3 * y2);
+            y2 = y1; y1 = y0 - current")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/areson.c b/lib-src/libnyquist/nyquist/tran/areson.c
new file mode 100644
index 0000000..6fb04e2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/areson.c
@@ -0,0 +1,237 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "areson.h"
+
+void areson_free();
+
+
+typedef struct areson_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double c3;
+    double c2;
+    double c1;
+    double y1;
+    double y2;
+} areson_susp_node, *areson_susp_type;
+
+
+void areson_n_fetch(register areson_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "areson_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3_reg = susp->c3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;current = *input_ptr_reg++;
+            *out_ptr_reg++ = (sample_type) (y0 = c1_reg * current + c2_reg * y1_reg - c3_reg * y2_reg);
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* areson_n_fetch */
+
+
+void areson_toss_fetch(susp, snd_list)
+  register areson_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void areson_mark(areson_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void areson_free(areson_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(areson_susp_node), "areson_free");
+}
+
+
+void areson_print_tree(areson_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_areson(sound_type input, double hz, double bw, int normalization)
+{
+    register areson_susp_type susp;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, areson_susp_node, "snd_make_areson");
+    susp->c3 = exp(bw * -PI2 / input->sr);
+    c3p1 = susp->c3 + 1.0;
+    c3t4 = susp->c3 * 4.0;
+    omc3 = 1.0 - susp->c3;
+    susp->c2 = c3t4 * cos(hz * PI2 / input->sr) / c3p1;
+    susp->c1 = (normalization == 0 ? 0.0 :
+        (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - susp->c2 * susp->c2 / c3t4) :
+            1.0 - sqrt(c3p1 * c3p1 - susp->c2 * susp->c2) * omc3 / c3p1));
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    susp->susp.fetch = areson_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = areson_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = areson_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = areson_mark;
+    susp->susp.print_tree = areson_print_tree;
+    susp->susp.name = "areson";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_areson(sound_type input, double hz, double bw, int normalization)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_areson(input_copy, hz, bw, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/areson.h b/lib-src/libnyquist/nyquist/tran/areson.h
new file mode 100644
index 0000000..fa7c94f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/areson.h
@@ -0,0 +1,3 @@
+sound_type snd_make_areson(sound_type input, double hz, double bw, int normalization);
+sound_type snd_areson(sound_type input, double hz, double bw, int normalization);
+    /* LISP: (snd-areson SOUND ANYNUM ANYNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/aresoncv.alg b/lib-src/libnyquist/nyquist/tran/aresoncv.alg
new file mode 100644
index 0000000..f439867
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresoncv.alg
@@ -0,0 +1,36 @@
+(ARESONCV-ALG
+(NAME "aresoncv")
+(ARGUMENTS ("sound_type" "s1") ("double" "hz") ("sound_type" "bw")
+           ("int" "normalization"))
+(INLINE-INTERPOLATION T)
+(LINEAR s1)
+(ALWAYS-SCALE bw)
+(START (MAX s1 bw))
+(TERMINATE (MIN s1 bw))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION bw)
+(STATE ("double" "c3co" "0.0")
+       ("double" "coshz" "cos(hz * PI2 / s1->sr)")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    bw->scale = (float) (bw->scale * (-PI2 / s1->sr))"))
+(DEPENDS ("c3co" "hz" "exp(bw)")
+         ("c3p1" "hz" "c3co + 1.0" TEMP "double")
+         ("c3t4" "hz" "c3co * 4.0" TEMP "double")
+         ("omc3" "hz" "1.0 - c3co" TEMP "double")
+         ("c2"   "hz" "c3t4 * coshz / c3p1")
+         ("c1"   "hz" "(normalization == 0 ? 0.0 :
+          (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - c2 * c2 / c3t4) :
+              1.0 - sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1))"))
+(CONSTANT "c1" "c2" "c3co" "coshz" "normalization")
+(FORCE-INTO-REGISTER normalization coshz scale1)
+(INNER-LOOP-LOCALS "            register double y0, current;")
+(INNER-LOOP "
+            current = s1;
+            output = (float) (y0 = c1 * current + c2 * y1 - c3co * y2);
+            y2 = y1; y1 = y0 - current")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/aresoncv.c b/lib-src/libnyquist/nyquist/tran/aresoncv.c
new file mode 100644
index 0000000..d29e599
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresoncv.c
@@ -0,0 +1,554 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "aresoncv.h"
+
+void aresoncv_free();
+
+
+typedef struct aresoncv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type bw;
+    long bw_cnt;
+    sample_block_values_type bw_ptr;
+
+    /* support for interpolation of bw */
+    sample_type bw_x1_sample;
+    double bw_pHaSe;
+    double bw_pHaSe_iNcR;
+
+    /* support for ramp between samples of bw */
+    double output_per_bw;
+    long bw_n;
+
+    double c3co;
+    double coshz;
+    double c2;
+    double c1;
+    int normalization;
+    double y1;
+    double y2;
+} aresoncv_susp_node, *aresoncv_susp_type;
+
+
+void aresoncv_ns_fetch(register aresoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresoncv_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;
+            current = *s1_ptr_reg++;
+            *out_ptr_reg++ = (float) (y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg);
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresoncv_ns_fetch */
+
+
+void aresoncv_ni_fetch(register aresoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresoncv_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+	    }
+
+            current = *s1_ptr_reg++;
+            *out_ptr_reg++ = (float) (y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg);
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresoncv_ni_fetch */
+
+
+void aresoncv_nr_fetch(register aresoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresoncv_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;
+            current = *s1_ptr_reg++;
+            *out_ptr_reg++ = (float) (y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg);
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresoncv_nr_fetch */
+
+
+void aresoncv_toss_fetch(susp, snd_list)
+  register aresoncv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from bw up to final_time for this block of zeros */
+    while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >=
+	   susp->bw->current)
+	susp_get_samples(bw, bw_ptr, bw_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->bw->t0) * susp->bw->sr -
+         (susp->bw->current - susp->bw_cnt));
+    susp->bw_ptr += n;
+    susp_took(bw_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void aresoncv_mark(aresoncv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->bw);
+}
+
+
+void aresoncv_free(aresoncv_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->bw);
+    ffree_generic(susp, sizeof(aresoncv_susp_node), "aresoncv_free");
+}
+
+
+void aresoncv_print_tree(aresoncv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("bw:");
+    sound_print_tree_1(susp->bw, n);
+}
+
+
+sound_type snd_make_aresoncv(sound_type s1, double hz, sound_type bw, int normalization)
+{
+    register aresoncv_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, bw->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (S1) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, aresoncv_susp_node, "snd_make_aresoncv");
+    susp->c3co = 0.0;
+    susp->coshz = cos(hz * PI2 / s1->sr);
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    bw->scale = (float) (bw->scale * (-PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(bw, sr);
+    switch (interp_desc) {
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = aresoncv_ns_fetch; break;
+      case INTERP_ni: susp->susp.fetch = aresoncv_ni_fetch; break;
+      case INTERP_nr: susp->susp.fetch = aresoncv_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < bw->t0) sound_prepend_zeros(bw, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(bw->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = aresoncv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = aresoncv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = aresoncv_mark;
+    susp->susp.print_tree = aresoncv_print_tree;
+    susp->susp.name = "aresoncv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->bw = bw;
+    susp->bw_cnt = 0;
+    susp->bw_pHaSe = 0.0;
+    susp->bw_pHaSe_iNcR = bw->sr / sr;
+    susp->bw_n = 0;
+    susp->output_per_bw = sr / bw->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_aresoncv(sound_type s1, double hz, sound_type bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type bw_copy = sound_copy(bw);
+    return snd_make_aresoncv(s1_copy, hz, bw_copy, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/aresoncv.h b/lib-src/libnyquist/nyquist/tran/aresoncv.h
new file mode 100644
index 0000000..6cf9a0a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresoncv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_aresoncv(sound_type s1, double hz, sound_type bw, int normalization);
+sound_type snd_aresoncv(sound_type s1, double hz, sound_type bw, int normalization);
+    /* LISP: (snd-aresoncv SOUND ANYNUM SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvc.alg b/lib-src/libnyquist/nyquist/tran/aresonvc.alg
new file mode 100644
index 0000000..277ef8a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvc.alg
@@ -0,0 +1,34 @@
+(ARESONVC-ALG
+(NAME "aresonvc")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz") ("double" "bw")
+           ("int" "normalization"))
+(LINEAR s1)
+(INLINE-INTERPOLATION T)
+(ALWAYS-SCALE hz)
+(START (MAX s1 hz))
+(TERMINATE (MIN s1 hz))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz)
+(STATE ("double" "c3co" "exp(bw * -PI2 / s1->sr)")
+       ("double" "c3p1" "susp->c3co + 1.0")
+       ("double" "c3t4" "susp->c3co * 4.0")
+       ("double" "omc3" "1.0 - susp->c3co")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))"))
+(DEPENDS ("c2" "hz" "c3t4 * cos(hz) / c3p1")
+         ("c1" "hz" "(normalization == 0 ? 0.0 :
+          (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - c2 * c2 / c3t4) :
+              1.0 - sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1))"))
+(CONSTANT "c1" "c2" "c3co" "c3p1" "c3t4" "omc3" "normalization")
+(FORCE-INTO-REGISTER c3t4 c3p1 normalization omc3)
+(INNER-LOOP-LOCALS "            register double y0, current;")
+(INNER-LOOP "current = s1;
+            y0 = c1 * current + c2 * y1 - c3co * y2;
+            output = (sample_type) y0;
+            y2 = y1; y1 = y0 - current")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvc.c b/lib-src/libnyquist/nyquist/tran/aresonvc.c
new file mode 100644
index 0000000..f0c47fc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvc.c
@@ -0,0 +1,586 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "aresonvc.h"
+
+void aresonvc_free();
+
+
+typedef struct aresonvc_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz;
+    long hz_cnt;
+    sample_block_values_type hz_ptr;
+
+    /* support for interpolation of hz */
+    sample_type hz_x1_sample;
+    double hz_pHaSe;
+    double hz_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz */
+    double output_per_hz;
+    long hz_n;
+
+    double c3co;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    double c2;
+    double c1;
+    int normalization;
+    double y1;
+    double y2;
+} aresonvc_susp_node, *aresonvc_susp_type;
+
+
+void aresonvc_ns_fetch(register aresonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type hz_scale_reg = susp->hz->scale;
+    register sample_block_values_type hz_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvc_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz input sample block: */
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	togo = min(togo, susp->hz_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz_ptr_reg = susp->hz_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    c2_reg = c3t4_reg * cos((hz_scale_reg * *hz_ptr_reg++)) / c3p1_reg;
+	    c1_reg = (normalization_reg == 0 ? 0.0 :
+          (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+              1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using hz_ptr_reg is a bad idea on RS/6000: */
+	susp->hz_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvc_ns_fetch */
+
+
+void aresonvc_ni_fetch(register aresonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double hz_pHaSe_iNcR_rEg = susp->hz_pHaSe_iNcR;
+    register double hz_pHaSe_ReG;
+    register sample_type hz_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvc_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	susp->c2 = susp->c3t4 * cos(susp->hz_x1_sample) / susp->c3p1;
+	susp->c1 = (susp->normalization == 0 ? 0.0 :
+          (susp->normalization == 1 ? 1.0 - susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+              1.0 - sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1));
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz_pHaSe_ReG = susp->hz_pHaSe;
+	hz_x1_sample_reg = susp->hz_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (hz_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz */
+		/* pick up next sample as hz_x1_sample: */
+		susp->hz_ptr++;
+		susp_took(hz_cnt, 1);
+		hz_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz, hz_ptr, hz_cnt, hz_x1_sample_reg);
+		hz_x1_sample_reg = susp_current_sample(hz, hz_ptr);
+		c2_reg = susp->c2 = c3t4_reg * cos(hz_x1_sample_reg) / c3p1_reg;
+		c1_reg = susp->c1 = (normalization_reg == 0 ? 0.0 :
+          (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+              1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    hz_pHaSe_ReG += hz_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->hz_pHaSe = hz_pHaSe_ReG;
+	susp->hz_x1_sample = hz_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvc_ni_fetch */
+
+
+void aresonvc_nr_fetch(register aresonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvc_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz_x1_sample when phase goes past 1.0; */
+	/* use hz_n (computed below) to avoid roundoff errors: */
+	if (susp->hz_n <= 0) {
+	    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	    susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	    susp->hz_pHaSe -= 1.0;
+	    /* hz_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz_n = (long) ((1.0 - susp->hz_pHaSe) *
+					susp->output_per_hz);
+	    susp->c2 = susp->c3t4 * cos(susp->hz_x1_sample) / susp->c3p1;
+	    susp->c1 = (susp->normalization == 0 ? 0.0 :
+          (susp->normalization == 1 ? 1.0 - susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+              1.0 - sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1));
+	}
+	togo = min(togo, susp->hz_n);
+	hz_val = susp->hz_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz_pHaSe += togo * susp->hz_pHaSe_iNcR;
+	susp->hz_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvc_nr_fetch */
+
+
+void aresonvc_toss_fetch(susp, snd_list)
+  register aresonvc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >=
+	   susp->hz->current)
+	susp_get_samples(hz, hz_ptr, hz_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz->t0) * susp->hz->sr -
+         (susp->hz->current - susp->hz_cnt));
+    susp->hz_ptr += n;
+    susp_took(hz_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void aresonvc_mark(aresonvc_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz);
+}
+
+
+void aresonvc_free(aresonvc_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz);
+    ffree_generic(susp, sizeof(aresonvc_susp_node), "aresonvc_free");
+}
+
+
+void aresonvc_print_tree(aresonvc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz:");
+    sound_print_tree_1(susp->hz, n);
+}
+
+
+sound_type snd_make_aresonvc(sound_type s1, sound_type hz, double bw, int normalization)
+{
+    register aresonvc_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, hz->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (S1) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, aresonvc_susp_node, "snd_make_aresonvc");
+    susp->c3co = exp(bw * -PI2 / s1->sr);
+    susp->c3p1 = susp->c3co + 1.0;
+    susp->c3t4 = susp->c3co * 4.0;
+    susp->omc3 = 1.0 - susp->c3co;
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz, sr);
+    switch (interp_desc) {
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = aresonvc_ns_fetch; break;
+      case INTERP_ni: susp->susp.fetch = aresonvc_ni_fetch; break;
+      case INTERP_nr: susp->susp.fetch = aresonvc_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz->t0) sound_prepend_zeros(hz, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = aresonvc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = aresonvc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = aresonvc_mark;
+    susp->susp.print_tree = aresonvc_print_tree;
+    susp->susp.name = "aresonvc";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz = hz;
+    susp->hz_cnt = 0;
+    susp->hz_pHaSe = 0.0;
+    susp->hz_pHaSe_iNcR = hz->sr / sr;
+    susp->hz_n = 0;
+    susp->output_per_hz = sr / hz->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_aresonvc(sound_type s1, sound_type hz, double bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz_copy = sound_copy(hz);
+    return snd_make_aresonvc(s1_copy, hz_copy, bw, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvc.h b/lib-src/libnyquist/nyquist/tran/aresonvc.h
new file mode 100644
index 0000000..0783f66
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_aresonvc(sound_type s1, sound_type hz, double bw, int normalization);
+sound_type snd_aresonvc(sound_type s1, sound_type hz, double bw, int normalization);
+    /* LISP: (snd-aresonvc SOUND SOUND ANYNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvv.alg b/lib-src/libnyquist/nyquist/tran/aresonvv.alg
new file mode 100644
index 0000000..a56c2fd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvv.alg
@@ -0,0 +1,50 @@
+(ARESONVV-ALG
+(NAME "aresonvv")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz1") ("sound_type" "bw")
+           ("int" "normalization"))
+(INLINE-INTERPOLATION T)
+(ALWAYS-SCALE hz1 bw)
+(START (MAX s1 hz1 bw))
+(TERMINATE (MIN s1 hz1 bw))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz1 bw)
+(LINEAR s1)
+(STATE ("double" "scale1" "s1->scale")
+       ("double" "c3co" "0.0")
+       ("double" "c3p1" "0.0")
+       ("double" "c3t4" "0.0")
+       ("double" "omc3" "0.0")
+       ("double" "coshz" "0.0")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("boolean" "recompute" "false")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    hz1->scale = (sample_type) (hz1->scale * (PI2 / s1->sr));
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr));"))
+(DEPENDS ("coshz" "hz1" "cos(hz1)")
+         ("recompute" "hz1" "true")
+         ("c3co"  "bw" "exp(bw)")
+         ("c3p1"  "bw" "c3co + 1.0")
+          ("c3t4"  "bw" "c3co * 4.0")
+         ("omc3"  "bw" "1.0 - c3co")
+         ("recompute" "bw" "true"))
+(JOINT-DEPENDENCY (("hz1" "bw")
+"if (recompute) {"
+"    recompute = false;"
+"    c2 = c3t4 * coshz / c3p1;"
+"    c1 = (normalization == 0 ? 0.0 :"
+"          (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - c2 * c2 / c3t4) :"
+"           1.0 - sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1));"
+"}"))
+(CONSTANT "c1" "c2" "c3co" "coshz" "c3p1" "c3t4" "omc3" 
+          "normalization" "scale1")
+(FORCE-INTO-REGISTER recompute) ;c3t4 c3p1 normalization omc3 scale1
+(INNER-LOOP-LOCALS "            register double y0, current;")
+(INNER-LOOP "current = s1;
+            y0 = c1 * current + c2 * y1 - c3co * y2;
+            output = (sample_type) y0;
+            y2 = y1; y1 = y0 - current")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvv.c b/lib-src/libnyquist/nyquist/tran/aresonvv.c
new file mode 100644
index 0000000..b38d9d9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvv.c
@@ -0,0 +1,1729 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "aresonvv.h"
+
+void aresonvv_free();
+
+
+typedef struct aresonvv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz1;
+    long hz1_cnt;
+    sample_block_values_type hz1_ptr;
+
+    /* support for interpolation of hz1 */
+    sample_type hz1_x1_sample;
+    double hz1_pHaSe;
+    double hz1_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz1 */
+    double output_per_hz1;
+    long hz1_n;
+    sound_type bw;
+    long bw_cnt;
+    sample_block_values_type bw_ptr;
+
+    /* support for interpolation of bw */
+    sample_type bw_x1_sample;
+    double bw_pHaSe;
+    double bw_pHaSe_iNcR;
+
+    /* support for ramp between samples of bw */
+    double output_per_bw;
+    long bw_n;
+
+    double scale1;
+    double c3co;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    double coshz;
+    double c2;
+    double c1;
+    boolean recompute;
+    int normalization;
+    double y1;
+    double y2;
+} aresonvv_susp_node, *aresonvv_susp_type;
+
+
+void aresonvv_nss_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nss_fetch */
+
+
+void aresonvv_nsi_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nsi_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nsi_fetch */
+
+
+void aresonvv_nsr_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nsr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nsr_fetch */
+
+
+void aresonvv_nis_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nis_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nis_fetch */
+
+
+void aresonvv_nii_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nii_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nii_fetch */
+
+
+void aresonvv_nir_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nir_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nir_fetch */
+
+
+void aresonvv_nrs_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nrs_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nrs_fetch */
+
+
+void aresonvv_nri_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nri_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 0.0 :
+	              (normalization_reg == 1 ? 1.0 - omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               1.0 - sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg));
+	    }
+current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nri_fetch */
+
+
+void aresonvv_nrr_fetch(register aresonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "aresonvv_nrr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	if (susp->recompute) {
+	    susp->recompute = false;
+	    susp->c2 = susp->c3t4 * susp->coshz / susp->c3p1;
+	    susp->c1 = (susp->normalization == 0 ? 0.0 :
+	          (susp->normalization == 1 ? 1.0 - susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+	           1.0 - sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1));
+	}
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            register double y0, current;current = *s1_ptr_reg++;
+            y0 = c1_reg * current + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0 - current;
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* aresonvv_nrr_fetch */
+
+
+void aresonvv_toss_fetch(susp, snd_list)
+  register aresonvv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz1->t0) * susp->hz1->sr)) >=
+	   susp->hz1->current)
+	susp_get_samples(hz1, hz1_ptr, hz1_cnt);
+    /* fetch samples from bw up to final_time for this block of zeros */
+    while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >=
+	   susp->bw->current)
+	susp_get_samples(bw, bw_ptr, bw_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz1->t0) * susp->hz1->sr -
+         (susp->hz1->current - susp->hz1_cnt));
+    susp->hz1_ptr += n;
+    susp_took(hz1_cnt, n);
+    n = round((final_time - susp->bw->t0) * susp->bw->sr -
+         (susp->bw->current - susp->bw_cnt));
+    susp->bw_ptr += n;
+    susp_took(bw_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void aresonvv_mark(aresonvv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz1);
+    sound_xlmark(susp->bw);
+}
+
+
+void aresonvv_free(aresonvv_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz1);
+    sound_unref(susp->bw);
+    ffree_generic(susp, sizeof(aresonvv_susp_node), "aresonvv_free");
+}
+
+
+void aresonvv_print_tree(aresonvv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz1:");
+    sound_print_tree_1(susp->hz1, n);
+
+    indent(n);
+    stdputstr("bw:");
+    sound_print_tree_1(susp->bw, n);
+}
+
+
+sound_type snd_make_aresonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization)
+{
+    register aresonvv_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(max(s1->t0, hz1->t0), bw->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (S1) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, aresonvv_susp_node, "snd_make_aresonvv");
+    susp->scale1 = s1->scale;
+    susp->c3co = 0.0;
+    susp->c3p1 = 0.0;
+    susp->c3t4 = 0.0;
+    susp->omc3 = 0.0;
+    susp->coshz = 0.0;
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->recompute = false;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    hz1->scale = (sample_type) (hz1->scale * (PI2 / s1->sr));
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr));;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(bw, sr);
+    switch (interp_desc) {
+      case INTERP_nnn: /* handled below */
+      case INTERP_nns: /* handled below */
+      case INTERP_nsn: /* handled below */
+      case INTERP_nss: susp->susp.fetch = aresonvv_nss_fetch; break;
+      case INTERP_nni: /* handled below */
+      case INTERP_nsi: susp->susp.fetch = aresonvv_nsi_fetch; break;
+      case INTERP_nnr: /* handled below */
+      case INTERP_nsr: susp->susp.fetch = aresonvv_nsr_fetch; break;
+      case INTERP_nin: /* handled below */
+      case INTERP_nis: susp->susp.fetch = aresonvv_nis_fetch; break;
+      case INTERP_nii: susp->susp.fetch = aresonvv_nii_fetch; break;
+      case INTERP_nir: susp->susp.fetch = aresonvv_nir_fetch; break;
+      case INTERP_nrn: /* handled below */
+      case INTERP_nrs: susp->susp.fetch = aresonvv_nrs_fetch; break;
+      case INTERP_nri: susp->susp.fetch = aresonvv_nri_fetch; break;
+      case INTERP_nrr: susp->susp.fetch = aresonvv_nrr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz1->t0) sound_prepend_zeros(hz1, t0);
+    if (t0 < bw->t0) sound_prepend_zeros(bw, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz1->t0, min(bw->t0, t0)));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = aresonvv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = aresonvv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = aresonvv_mark;
+    susp->susp.print_tree = aresonvv_print_tree;
+    susp->susp.name = "aresonvv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz1 = hz1;
+    susp->hz1_cnt = 0;
+    susp->hz1_pHaSe = 0.0;
+    susp->hz1_pHaSe_iNcR = hz1->sr / sr;
+    susp->hz1_n = 0;
+    susp->output_per_hz1 = sr / hz1->sr;
+    susp->bw = bw;
+    susp->bw_cnt = 0;
+    susp->bw_pHaSe = 0.0;
+    susp->bw_pHaSe_iNcR = bw->sr / sr;
+    susp->bw_n = 0;
+    susp->output_per_bw = sr / bw->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_aresonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz1_copy = sound_copy(hz1);
+    sound_type bw_copy = sound_copy(bw);
+    return snd_make_aresonvv(s1_copy, hz1_copy, bw_copy, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/aresonvv.h b/lib-src/libnyquist/nyquist/tran/aresonvv.h
new file mode 100644
index 0000000..1aba1b6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/aresonvv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_aresonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization);
+sound_type snd_aresonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization);
+    /* LISP: (snd-aresonvv SOUND SOUND SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/atone.alg b/lib-src/libnyquist/nyquist/tran/atone.alg
new file mode 100644
index 0000000..03b4d9f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atone.alg
@@ -0,0 +1,20 @@
+(ATONE-ALG
+(NAME "atone")
+(ARGUMENTS ("sound_type" "s") ("double" "hz"))
+(START (MIN s))
+(TERMINATE (MIN s))
+(LOGICAL-STOP (MIN s))
+(STATE ("double" "bb" "2.0 - cos(hz * PI2 / s->sr)" TEMP)
+       ("double" "cc" "bb - sqrt((bb * bb) - 1.0)")
+       ("double" "prev" "0.0"))
+(CONSTANT "cc")
+(INNER-LOOP-LOCALS "        double current;
+")
+(INNER-LOOP "current = s;
+            prev = cc * (prev + current); /* use prev as temp variable ... */
+            output = (float) prev; /* ... so we can do proper type conversion */
+            prev -= current;")
+; old code was:
+;	    prev = (output = cc * (prev + current)) - current;")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/atone.c b/lib-src/libnyquist/nyquist/tran/atone.c
new file mode 100644
index 0000000..2ff1f5d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atone.c
@@ -0,0 +1,317 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "atone.h"
+
+void atone_free();
+
+
+typedef struct atone_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+
+    double cc;
+    double prev;
+} atone_susp_node, *atone_susp_type;
+
+
+void atone_n_fetch(register atone_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cc_reg;
+    register double prev_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "atone_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cc_reg = susp->cc;
+	prev_reg = susp->prev;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double current;
+current = *s_ptr_reg++;
+            prev_reg = cc_reg * (prev_reg + current); /* use prev_reg as temp variable ... */
+            *out_ptr_reg++ = (float) prev_reg; /* ... so we can do proper type conversion */
+            prev_reg -= current;;
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* atone_n_fetch */
+
+
+void atone_s_fetch(register atone_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cc_reg;
+    register double prev_reg;
+    register sample_type s_scale_reg = susp->s->scale;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "atone_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cc_reg = susp->cc;
+	prev_reg = susp->prev;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double current;
+current = (s_scale_reg * *s_ptr_reg++);
+            prev_reg = cc_reg * (prev_reg + current); /* use prev_reg as temp variable ... */
+            *out_ptr_reg++ = (float) prev_reg; /* ... so we can do proper type conversion */
+            prev_reg -= current;;
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* atone_s_fetch */
+
+
+void atone_toss_fetch(susp, snd_list)
+  register atone_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while ((round((final_time - susp->s->t0) * susp->s->sr)) >=
+	   susp->s->current)
+	susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void atone_mark(atone_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void atone_free(atone_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(atone_susp_node), "atone_free");
+}
+
+
+void atone_print_tree(atone_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_atone(sound_type s, double hz)
+{
+    register atone_susp_type susp;
+    double bb;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, atone_susp_node, "snd_make_atone");
+    bb = 2.0 - cos(hz * PI2 / s->sr);
+    susp->cc = bb - sqrt((bb * bb) - 1.0);
+    susp->prev = 0.0;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = atone_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = atone_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = atone_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = atone_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = atone_mark;
+    susp->susp.print_tree = atone_print_tree;
+    susp->susp.name = "atone";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_atone(sound_type s, double hz)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_atone(s_copy, hz);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/atone.h b/lib-src/libnyquist/nyquist/tran/atone.h
new file mode 100644
index 0000000..9fa57d5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atone.h
@@ -0,0 +1,3 @@
+sound_type snd_make_atone(sound_type s, double hz);
+sound_type snd_atone(sound_type s, double hz);
+    /* LISP: (snd-atone SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/atonev.alg b/lib-src/libnyquist/nyquist/tran/atonev.alg
new file mode 100644
index 0000000..441206f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atonev.alg
@@ -0,0 +1,25 @@
+(ATONEV-ALG
+(NAME "atonev")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz"))
+(INLINE-INTERPOLATION T)
+(LINEAR hz)
+(ALWAYS-SCALE hz)
+(START (MAX s1 hz))
+(TERMINATE (MIN s1 hz))
+(LOGICAL-STOP (MIN s1))
+(STATE ("double" "cc" "0.0")
+       ("double" "prev" "0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))"))
+(LINEAR s1)
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz)
+(DEPENDS ("bb" "hz" "2.0 - cos(hz)" TEMP "register double")
+         ("cc" "hz" "bb - sqrt((bb * bb) - 1.0)"))
+(CONSTANT "cc")
+(INNER-LOOP-LOCALS "        double current;
+")
+(INNER-LOOP "current = s1;
+            prev = cc * (prev + current);
+            output = (sample_type) prev;
+            prev -= current;")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/atonev.c b/lib-src/libnyquist/nyquist/tran/atonev.c
new file mode 100644
index 0000000..72532c6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atonev.c
@@ -0,0 +1,526 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "atonev.h"
+
+void atonev_free();
+
+
+typedef struct atonev_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz;
+    long hz_cnt;
+    sample_block_values_type hz_ptr;
+
+    /* support for interpolation of hz */
+    sample_type hz_x1_sample;
+    double hz_pHaSe;
+    double hz_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz */
+    double output_per_hz;
+    long hz_n;
+
+    double cc;
+    double prev;
+} atonev_susp_node, *atonev_susp_type;
+
+
+void atonev_ns_fetch(register atonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cc_reg;
+    register double prev_reg;
+    register sample_type hz_scale_reg = susp->hz->scale;
+    register sample_block_values_type hz_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "atonev_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz input sample block: */
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	togo = min(togo, susp->hz_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cc_reg = susp->cc;
+	prev_reg = susp->prev;
+	hz_ptr_reg = susp->hz_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double current;
+	    register double bb;
+	    bb = 2.0 - cos((hz_scale_reg * *hz_ptr_reg++));
+	    cc_reg = bb - sqrt((bb * bb) - 1.0);
+current = *s1_ptr_reg++;
+            prev_reg = cc_reg * (prev_reg + current);
+            *out_ptr_reg++ = (sample_type) prev_reg;
+            prev_reg -= current;;
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using hz_ptr_reg is a bad idea on RS/6000: */
+	susp->hz_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* atonev_ns_fetch */
+
+
+void atonev_ni_fetch(register atonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cc_reg;
+    register double prev_reg;
+    register double hz_pHaSe_iNcR_rEg = susp->hz_pHaSe_iNcR;
+    register double hz_pHaSe_ReG;
+    register sample_type hz_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "atonev_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	    register double bb;
+	susp->started = true;
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	bb = 2.0 - cos(susp->hz_x1_sample);
+	susp->cc = bb - sqrt((bb * bb) - 1.0);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cc_reg = susp->cc;
+	prev_reg = susp->prev;
+	hz_pHaSe_ReG = susp->hz_pHaSe;
+	hz_x1_sample_reg = susp->hz_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double current;
+	    if (hz_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz */
+		register double bb; 
+		/* pick up next sample as hz_x1_sample: */
+		susp->hz_ptr++;
+		susp_took(hz_cnt, 1);
+		hz_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz, hz_ptr, hz_cnt, hz_x1_sample_reg);
+		hz_x1_sample_reg = susp_current_sample(hz, hz_ptr);
+		bb = 2.0 - cos(hz_x1_sample_reg);
+		cc_reg = susp->cc = bb - sqrt((bb * bb) - 1.0);
+	    }
+current = *s1_ptr_reg++;
+            prev_reg = cc_reg * (prev_reg + current);
+            *out_ptr_reg++ = (sample_type) prev_reg;
+            prev_reg -= current;;
+	    hz_pHaSe_ReG += hz_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->prev = prev_reg;
+	susp->hz_pHaSe = hz_pHaSe_ReG;
+	susp->hz_x1_sample = hz_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* atonev_ni_fetch */
+
+
+void atonev_nr_fetch(register atonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cc_reg;
+    register double prev_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "atonev_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz_x1_sample when phase goes past 1.0; */
+	/* use hz_n (computed below) to avoid roundoff errors: */
+	if (susp->hz_n <= 0) {
+	    register double bb;
+	    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	    susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	    susp->hz_pHaSe -= 1.0;
+	    /* hz_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz_n = (long) ((1.0 - susp->hz_pHaSe) *
+					susp->output_per_hz);
+	    bb = 2.0 - cos(susp->hz_x1_sample);
+	    susp->cc = bb - sqrt((bb * bb) - 1.0);
+	}
+	togo = min(togo, susp->hz_n);
+	hz_val = susp->hz_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cc_reg = susp->cc;
+	prev_reg = susp->prev;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double current;
+current = *s1_ptr_reg++;
+            prev_reg = cc_reg * (prev_reg + current);
+            *out_ptr_reg++ = (sample_type) prev_reg;
+            prev_reg -= current;;
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz_pHaSe += togo * susp->hz_pHaSe_iNcR;
+	susp->hz_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* atonev_nr_fetch */
+
+
+void atonev_toss_fetch(susp, snd_list)
+  register atonev_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >=
+	   susp->hz->current)
+	susp_get_samples(hz, hz_ptr, hz_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz->t0) * susp->hz->sr -
+         (susp->hz->current - susp->hz_cnt));
+    susp->hz_ptr += n;
+    susp_took(hz_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void atonev_mark(atonev_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz);
+}
+
+
+void atonev_free(atonev_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz);
+    ffree_generic(susp, sizeof(atonev_susp_node), "atonev_free");
+}
+
+
+void atonev_print_tree(atonev_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz:");
+    sound_print_tree_1(susp->hz, n);
+}
+
+
+sound_type snd_make_atonev(sound_type s1, sound_type hz)
+{
+    register atonev_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, hz->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (S1) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, atonev_susp_node, "snd_make_atonev");
+    susp->cc = 0.0;
+    susp->prev = 0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz, sr);
+    switch (interp_desc) {
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = atonev_ns_fetch; break;
+      case INTERP_ni: susp->susp.fetch = atonev_ni_fetch; break;
+      case INTERP_nr: susp->susp.fetch = atonev_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz->t0) sound_prepend_zeros(hz, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = atonev_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = atonev_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = atonev_mark;
+    susp->susp.print_tree = atonev_print_tree;
+    susp->susp.name = "atonev";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz = hz;
+    susp->hz_cnt = 0;
+    susp->hz_pHaSe = 0.0;
+    susp->hz_pHaSe_iNcR = hz->sr / sr;
+    susp->hz_n = 0;
+    susp->output_per_hz = sr / hz->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_atonev(sound_type s1, sound_type hz)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz_copy = sound_copy(hz);
+    return snd_make_atonev(s1_copy, hz_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/atonev.h b/lib-src/libnyquist/nyquist/tran/atonev.h
new file mode 100644
index 0000000..9abcc2a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/atonev.h
@@ -0,0 +1,3 @@
+sound_type snd_make_atonev(sound_type s1, sound_type hz);
+sound_type snd_atonev(sound_type s1, sound_type hz);
+    /* LISP: (snd-atonev SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/biquadfilt.alg b/lib-src/libnyquist/nyquist/tran/biquadfilt.alg
new file mode 100644
index 0000000..da2c75b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/biquadfilt.alg
@@ -0,0 +1,28 @@
+; general order-2 IIR filter.
+; a0 is assumed to be unity.
+; for a1 and a2, our sign convention is opposite to Matlab's.
+
+(SNDBIQUAD-ALG
+(NAME "biquadfilt")
+(LISPNAME "biquad")
+(ARGUMENTS ("sound_type" "s") 
+        ("double" "b0") ("double" "b1") ("double" "b2") 
+                         ("double" "a1") ("double" "a2")
+        ("double" "z1init") ("double" "z2init"))
+(START (MIN s))
+(TERMINATE (MIN s))
+(LOGICAL-STOP (MIN s))
+(STATE	("double" "z1" "z1init")
+        ("double" "z2" "z2init")
+        ("double" "b0" "b0")
+        ("double" "b1" "b1")
+        ("double" "b2" "b2")
+        ("double" "a1" "a1")
+        ("double" "a2" "a2"))
+(CONSTANT "b0" "b1" "b2" "a1" "a2")
+(INNER-LOOP-LOCALS "double z0;")
+(INNER-LOOP "	z0 = s + a1*z1 + a2*z2;
+                    output = (sample_type) (z0*b0 + z1*b1 + z2*b2);
+                    z2 = z1; z1 = z0;")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/biquadfilt.c b/lib-src/libnyquist/nyquist/tran/biquadfilt.c
new file mode 100644
index 0000000..c5e81da
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/biquadfilt.c
@@ -0,0 +1,343 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "biquadfilt.h"
+
+void biquadfilt_free();
+
+
+typedef struct biquadfilt_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+
+    double z1;
+    double z2;
+    double b0;
+    double b1;
+    double b2;
+    double a1;
+    double a2;
+} biquadfilt_susp_node, *biquadfilt_susp_type;
+
+
+void biquadfilt_n_fetch(register biquadfilt_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double z1_reg;
+    register double z2_reg;
+    register double b0_reg;
+    register double b1_reg;
+    register double b2_reg;
+    register double a1_reg;
+    register double a2_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "biquadfilt_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	z1_reg = susp->z1;
+	z2_reg = susp->z2;
+	b0_reg = susp->b0;
+	b1_reg = susp->b1;
+	b2_reg = susp->b2;
+	a1_reg = susp->a1;
+	a2_reg = susp->a2;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double z0;	z0 = *s_ptr_reg++ + a1_reg*z1_reg + a2_reg*z2_reg;
+                    *out_ptr_reg++ = (sample_type) (z0*b0_reg + z1_reg*b1_reg + z2_reg*b2_reg);
+                    z2_reg = z1_reg; z1_reg = z0;;
+	} while (--n); /* inner loop */
+
+	susp->z1 = z1_reg;
+	susp->z2 = z2_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* biquadfilt_n_fetch */
+
+
+void biquadfilt_s_fetch(register biquadfilt_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double z1_reg;
+    register double z2_reg;
+    register double b0_reg;
+    register double b1_reg;
+    register double b2_reg;
+    register double a1_reg;
+    register double a2_reg;
+    register sample_type s_scale_reg = susp->s->scale;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "biquadfilt_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	z1_reg = susp->z1;
+	z2_reg = susp->z2;
+	b0_reg = susp->b0;
+	b1_reg = susp->b1;
+	b2_reg = susp->b2;
+	a1_reg = susp->a1;
+	a2_reg = susp->a2;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double z0;	z0 = (s_scale_reg * *s_ptr_reg++) + a1_reg*z1_reg + a2_reg*z2_reg;
+                    *out_ptr_reg++ = (sample_type) (z0*b0_reg + z1_reg*b1_reg + z2_reg*b2_reg);
+                    z2_reg = z1_reg; z1_reg = z0;;
+	} while (--n); /* inner loop */
+
+	susp->z1 = z1_reg;
+	susp->z2 = z2_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* biquadfilt_s_fetch */
+
+
+void biquadfilt_toss_fetch(susp, snd_list)
+  register biquadfilt_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while ((round((final_time - susp->s->t0) * susp->s->sr)) >=
+	   susp->s->current)
+	susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void biquadfilt_mark(biquadfilt_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void biquadfilt_free(biquadfilt_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(biquadfilt_susp_node), "biquadfilt_free");
+}
+
+
+void biquadfilt_print_tree(biquadfilt_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_biquadfilt(sound_type s, double b0, double b1, double b2, double a1, double a2, double z1init, double z2init)
+{
+    register biquadfilt_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, biquadfilt_susp_node, "snd_make_biquadfilt");
+    susp->z1 = z1init;
+    susp->z2 = z2init;
+    susp->b0 = b0;
+    susp->b1 = b1;
+    susp->b2 = b2;
+    susp->a1 = a1;
+    susp->a2 = a2;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = biquadfilt_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = biquadfilt_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = biquadfilt_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = biquadfilt_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = biquadfilt_mark;
+    susp->susp.print_tree = biquadfilt_print_tree;
+    susp->susp.name = "biquadfilt";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_biquadfilt(sound_type s, double b0, double b1, double b2, double a1, double a2, double z1init, double z2init)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_biquadfilt(s_copy, b0, b1, b2, a1, a2, z1init, z2init);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/biquadfilt.h b/lib-src/libnyquist/nyquist/tran/biquadfilt.h
new file mode 100644
index 0000000..e48addd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/biquadfilt.h
@@ -0,0 +1,3 @@
+sound_type snd_make_biquadfilt(sound_type s, double b0, double b1, double b2, double a1, double a2, double z1init, double z2init);
+sound_type snd_biquadfilt(sound_type s, double b0, double b1, double b2, double a1, double a2, double z1init, double z2init);
+    /* LISP: (snd-biquad SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/buzz.alg b/lib-src/libnyquist/nyquist/tran/buzz.alg
new file mode 100644
index 0000000..1bbf108
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/buzz.alg
@@ -0,0 +1,54 @@
+(BUZZ-ALG
+(NAME "buzz")
+(ARGUMENTS ("long" "n") ("rate_type" "sr") ("double" "hz")
+           ("time_type" "t0") ("sound_type" "s_fm"))
+(SUPPORT-FUNCTIONS "
+#include \"sine.h\"
+")
+(STATE ("double" "ph_incr" "0")
+       ("float" "n_2_r" "1.0F / (n * 2)")
+       ("float" "n_2_p1" "(n * 2) + 1")
+	;; note: hz * 0.5 because this formula generates tones an octave up,
+	;; we also have to correct for the modulation s_fm. If hz != 0, then
+    	;; ph_incr is the increment per hz, so ph_incr/hz is the right scale
+	;; factor. If hz == 0, then the ph_incr/hz is SINE_TABLE_LEN * 0.5 / sr.
+       ("double" "phase" "compute_phase(PI*0.5, 69.0, SINE_TABLE_LEN,
+        SINE_TABLE_LEN * 440.0, sr, hz * 0.5, &susp->ph_incr);
+    s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz)
+                           : (sample_type) (SINE_TABLE_LEN * 0.5 / sr)")) ;cancel 0/0
+
+(ALWAYS-SCALE s_fm)
+(INLINE-INTERPOLATION T) ; so that modulation can be low frequency
+(STEP-FUNCTION s_fm)
+(TERMINATE (MIN s_fm))
+(LOGICAL-STOP (MIN s_fm))
+(INNER-LOOP-LOCALS "	    long table_index;
+            double x1;
+            sample_type num, denom, samp;
+")
+(INNER-LOOP "
+            table_index = (long) phase;
+            x1 = sine_table[table_index];
+            denom = (sample_type) (x1 + (phase - table_index) * 
+                          (sine_table[table_index + 1] - x1));
+            if (denom < 0.001 && denom > -0.005) {
+                samp = 1.0F;
+            } else {
+                double phn2p1 = phase * n_2_p1 * (1.0/SINE_TABLE_LEN);
+                phn2p1 = (phn2p1 - (long) phn2p1) * SINE_TABLE_LEN;
+                table_index = (long) phn2p1;
+                x1 = sine_table[table_index];
+                num = (sample_type) (x1 + (phn2p1 - table_index) *
+                        (sine_table[table_index + 1] - x1));
+                samp = ((num / denom) - 1.0F) * n_2_r;
+            }
+            output = samp;
+            phase += ph_incr + s_fm;
+            while (phase > SINE_TABLE_LEN) phase -= SINE_TABLE_LEN;
+            /* watch out for negative frequencies! */
+            while (phase < 0) phase += SINE_TABLE_LEN")
+(CONSTANT "ph_incr" "n_2_p1" "n_2_r")
+
+(SAMPLE-RATE "sr")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/buzz.c b/lib-src/libnyquist/nyquist/tran/buzz.c
new file mode 100644
index 0000000..5619811
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/buzz.c
@@ -0,0 +1,536 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "buzz.h"
+
+void buzz_free();
+
+
+typedef struct buzz_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s_fm;
+    long s_fm_cnt;
+    sample_block_values_type s_fm_ptr;
+
+    /* support for interpolation of s_fm */
+    sample_type s_fm_x1_sample;
+    double s_fm_pHaSe;
+    double s_fm_pHaSe_iNcR;
+
+    /* support for ramp between samples of s_fm */
+    double output_per_s_fm;
+    long s_fm_n;
+
+    double ph_incr;
+    float n_2_r;
+    float n_2_p1;
+    double phase;
+} buzz_susp_node, *buzz_susp_type;
+
+
+#include "sine.h"
+
+
+void buzz_s_fetch(register buzz_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double ph_incr_reg;
+    register float n_2_r_reg;
+    register float n_2_p1_reg;
+    register double phase_reg;
+    register sample_type s_fm_scale_reg = susp->s_fm->scale;
+    register sample_block_values_type s_fm_ptr_reg;
+    falloc_sample_block(out, "buzz_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s_fm input sample block: */
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	togo = min(togo, susp->s_fm_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	ph_incr_reg = susp->ph_incr;
+	n_2_r_reg = susp->n_2_r;
+	n_2_p1_reg = susp->n_2_p1;
+	phase_reg = susp->phase;
+	s_fm_ptr_reg = susp->s_fm_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+            sample_type num, denom, samp;
+
+            table_index = (long) phase_reg;
+            x1 = sine_table[table_index];
+            denom = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (sine_table[table_index + 1] - x1));
+            if (denom < 0.001 && denom > -0.005) {
+                samp = 1.0F;
+            } else {
+                double phn2p1 = phase_reg * n_2_p1_reg * (1.0/SINE_TABLE_LEN);
+                phn2p1 = (phn2p1 - (long) phn2p1) * SINE_TABLE_LEN;
+                table_index = (long) phn2p1;
+                x1 = sine_table[table_index];
+                num = (sample_type) (x1 + (phn2p1 - table_index) *
+                        (sine_table[table_index + 1] - x1));
+                samp = ((num / denom) - 1.0F) * n_2_r_reg;
+            }
+            *out_ptr_reg++ = samp;
+            phase_reg += ph_incr_reg + (s_fm_scale_reg * *s_fm_ptr_reg++);
+            while (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += SINE_TABLE_LEN;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	/* using s_fm_ptr_reg is a bad idea on RS/6000: */
+	susp->s_fm_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_fm_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* buzz_s_fetch */
+
+
+void buzz_i_fetch(register buzz_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double ph_incr_reg;
+    register float n_2_r_reg;
+    register float n_2_p1_reg;
+    register double phase_reg;
+    register double s_fm_pHaSe_iNcR_rEg = susp->s_fm_pHaSe_iNcR;
+    register double s_fm_pHaSe_ReG;
+    register sample_type s_fm_x1_sample_reg;
+    falloc_sample_block(out, "buzz_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	ph_incr_reg = susp->ph_incr;
+	n_2_r_reg = susp->n_2_r;
+	n_2_p1_reg = susp->n_2_p1;
+	phase_reg = susp->phase;
+	s_fm_pHaSe_ReG = susp->s_fm_pHaSe;
+	s_fm_x1_sample_reg = susp->s_fm_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+            sample_type num, denom, samp;
+	    if (s_fm_pHaSe_ReG >= 1.0) {
+/* fixup-depends s_fm */
+		/* pick up next sample as s_fm_x1_sample: */
+		susp->s_fm_ptr++;
+		susp_took(s_fm_cnt, 1);
+		s_fm_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(s_fm, s_fm_ptr, s_fm_cnt, s_fm_x1_sample_reg);
+		s_fm_x1_sample_reg = susp_current_sample(s_fm, s_fm_ptr);
+	    }
+
+            table_index = (long) phase_reg;
+            x1 = sine_table[table_index];
+            denom = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (sine_table[table_index + 1] - x1));
+            if (denom < 0.001 && denom > -0.005) {
+                samp = 1.0F;
+            } else {
+                double phn2p1 = phase_reg * n_2_p1_reg * (1.0/SINE_TABLE_LEN);
+                phn2p1 = (phn2p1 - (long) phn2p1) * SINE_TABLE_LEN;
+                table_index = (long) phn2p1;
+                x1 = sine_table[table_index];
+                num = (sample_type) (x1 + (phn2p1 - table_index) *
+                        (sine_table[table_index + 1] - x1));
+                samp = ((num / denom) - 1.0F) * n_2_r_reg;
+            }
+            *out_ptr_reg++ = samp;
+            phase_reg += ph_incr_reg + s_fm_x1_sample_reg;
+            while (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += SINE_TABLE_LEN;
+	    s_fm_pHaSe_ReG += s_fm_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->phase = phase_reg;
+	susp->s_fm_pHaSe = s_fm_pHaSe_ReG;
+	susp->s_fm_x1_sample = s_fm_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* buzz_i_fetch */
+
+
+void buzz_r_fetch(register buzz_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type s_fm_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double ph_incr_reg;
+    register float n_2_r_reg;
+    register float n_2_p1_reg;
+    register double phase_reg;
+    falloc_sample_block(out, "buzz_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->s_fm_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next s_fm_x1_sample when phase goes past 1.0; */
+	/* use s_fm_n (computed below) to avoid roundoff errors: */
+	if (susp->s_fm_n <= 0) {
+	    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_pHaSe -= 1.0;
+	    /* s_fm_n gets number of samples before phase exceeds 1.0: */
+	    susp->s_fm_n = (long) ((1.0 - susp->s_fm_pHaSe) *
+					susp->output_per_s_fm);
+	}
+	togo = min(togo, susp->s_fm_n);
+	s_fm_val = susp->s_fm_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	ph_incr_reg = susp->ph_incr;
+	n_2_r_reg = susp->n_2_r;
+	n_2_p1_reg = susp->n_2_p1;
+	phase_reg = susp->phase;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+            sample_type num, denom, samp;
+
+            table_index = (long) phase_reg;
+            x1 = sine_table[table_index];
+            denom = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (sine_table[table_index + 1] - x1));
+            if (denom < 0.001 && denom > -0.005) {
+                samp = 1.0F;
+            } else {
+                double phn2p1 = phase_reg * n_2_p1_reg * (1.0/SINE_TABLE_LEN);
+                phn2p1 = (phn2p1 - (long) phn2p1) * SINE_TABLE_LEN;
+                table_index = (long) phn2p1;
+                x1 = sine_table[table_index];
+                num = (sample_type) (x1 + (phn2p1 - table_index) *
+                        (sine_table[table_index + 1] - x1));
+                samp = ((num / denom) - 1.0F) * n_2_r_reg;
+            }
+            *out_ptr_reg++ = samp;
+            phase_reg += ph_incr_reg + s_fm_val;
+            while (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += SINE_TABLE_LEN;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	out_ptr += togo;
+	susp->s_fm_pHaSe += togo * susp->s_fm_pHaSe_iNcR;
+	susp->s_fm_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* buzz_r_fetch */
+
+
+void buzz_toss_fetch(susp, snd_list)
+  register buzz_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s_fm up to final_time for this block of zeros */
+    while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >=
+	   susp->s_fm->current)
+	susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr -
+         (susp->s_fm->current - susp->s_fm_cnt));
+    susp->s_fm_ptr += n;
+    susp_took(s_fm_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void buzz_mark(buzz_susp_type susp)
+{
+    sound_xlmark(susp->s_fm);
+}
+
+
+void buzz_free(buzz_susp_type susp)
+{
+    sound_unref(susp->s_fm);
+    ffree_generic(susp, sizeof(buzz_susp_node), "buzz_free");
+}
+
+
+void buzz_print_tree(buzz_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s_fm:");
+    sound_print_tree_1(susp->s_fm, n);
+}
+
+
+sound_type snd_make_buzz(long n, rate_type sr, double hz, time_type t0, sound_type s_fm)
+{
+    register buzz_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, buzz_susp_node, "snd_make_buzz");
+    susp->ph_incr = 0;
+    susp->n_2_r = 1.0F / (n * 2);
+    susp->n_2_p1 = (n * 2) + 1;
+    susp->phase = compute_phase(PI*0.5, 69.0, SINE_TABLE_LEN,
+        SINE_TABLE_LEN * 440.0, sr, hz * 0.5, &susp->ph_incr);
+    s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz)
+                           : (sample_type) (SINE_TABLE_LEN * 0.5 / sr);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s_fm, sr);
+    switch (interp_desc) {
+      case INTERP_n: /* handled below */
+      case INTERP_s: susp->susp.fetch = buzz_s_fetch; break;
+      case INTERP_i: susp->susp.fetch = buzz_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = buzz_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s_fm->t0) sound_prepend_zeros(s_fm, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s_fm->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = buzz_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = buzz_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = buzz_mark;
+    susp->susp.print_tree = buzz_print_tree;
+    susp->susp.name = "buzz";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s_fm);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s_fm = s_fm;
+    susp->s_fm_cnt = 0;
+    susp->s_fm_pHaSe = 0.0;
+    susp->s_fm_pHaSe_iNcR = s_fm->sr / sr;
+    susp->s_fm_n = 0;
+    susp->output_per_s_fm = sr / s_fm->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_buzz(long n, rate_type sr, double hz, time_type t0, sound_type s_fm)
+{
+    sound_type s_fm_copy = sound_copy(s_fm);
+    return snd_make_buzz(n, sr, hz, t0, s_fm_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/buzz.h b/lib-src/libnyquist/nyquist/tran/buzz.h
new file mode 100644
index 0000000..466c7f3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/buzz.h
@@ -0,0 +1,3 @@
+sound_type snd_make_buzz(long n, rate_type sr, double hz, time_type t0, sound_type s_fm);
+sound_type snd_buzz(long n, rate_type sr, double hz, time_type t0, sound_type s_fm);
+    /* LISP: (snd-buzz FIXNUM ANYNUM ANYNUM ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/chase.alg b/lib-src/libnyquist/nyquist/tran/chase.alg
new file mode 100644
index 0000000..dd4b0c1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/chase.alg
@@ -0,0 +1,19 @@
+(CHASE-ALG
+  (NAME "chase")
+  (ARGUMENTS ("sound_type" "input") ("double" "risetime") ("double" "falltime")) 
+  (STATE ("double" "level" "0.0")
+         ("double" "upslope" "1.0/(input->sr * risetime)")
+         ("double" "downslope" "1.0/(input->sr * falltime)"))
+  (START (MIN input))
+  (INNER-LOOP "	double x = input;
+        if (x > level) {
+            level += upslope;
+            if (x < level) level = x;
+        } else {
+            level -= downslope;
+            if (x > level) level = x;
+        }
+        output = (sample_type) level;")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/chase.c b/lib-src/libnyquist/nyquist/tran/chase.c
new file mode 100644
index 0000000..30d664a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/chase.c
@@ -0,0 +1,333 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "chase.h"
+
+void chase_free();
+
+
+typedef struct chase_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double level;
+    double upslope;
+    double downslope;
+} chase_susp_node, *chase_susp_type;
+
+
+void chase_n_fetch(register chase_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double level_reg;
+    register double upslope_reg;
+    register double downslope_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "chase_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	level_reg = susp->level;
+	upslope_reg = susp->upslope;
+	downslope_reg = susp->downslope;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	double x = *input_ptr_reg++;
+        if (x > level_reg) {
+            level_reg += upslope_reg;
+            if (x < level_reg) level_reg = x;
+        } else {
+            level_reg -= downslope_reg;
+            if (x > level_reg) level_reg = x;
+        }
+        *out_ptr_reg++ = (sample_type) level_reg;;
+	} while (--n); /* inner loop */
+
+	susp->level = level_reg;
+	susp->upslope = upslope_reg;
+	susp->downslope = downslope_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* chase_n_fetch */
+
+
+void chase_s_fetch(register chase_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double level_reg;
+    register double upslope_reg;
+    register double downslope_reg;
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "chase_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	level_reg = susp->level;
+	upslope_reg = susp->upslope;
+	downslope_reg = susp->downslope;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	double x = (input_scale_reg * *input_ptr_reg++);
+        if (x > level_reg) {
+            level_reg += upslope_reg;
+            if (x < level_reg) level_reg = x;
+        } else {
+            level_reg -= downslope_reg;
+            if (x > level_reg) level_reg = x;
+        }
+        *out_ptr_reg++ = (sample_type) level_reg;;
+	} while (--n); /* inner loop */
+
+	susp->level = level_reg;
+	susp->upslope = upslope_reg;
+	susp->downslope = downslope_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* chase_s_fetch */
+
+
+void chase_toss_fetch(susp, snd_list)
+  register chase_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void chase_mark(chase_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void chase_free(chase_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(chase_susp_node), "chase_free");
+}
+
+
+void chase_print_tree(chase_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_chase(sound_type input, double risetime, double falltime)
+{
+    register chase_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, chase_susp_node, "snd_make_chase");
+    susp->level = 0.0;
+    susp->upslope = 1.0/(input->sr * risetime);
+    susp->downslope = 1.0/(input->sr * falltime);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = chase_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = chase_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = chase_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = chase_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = chase_mark;
+    susp->susp.print_tree = chase_print_tree;
+    susp->susp.name = "chase";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_chase(sound_type input, double risetime, double falltime)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_chase(input_copy, risetime, falltime);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/chase.h b/lib-src/libnyquist/nyquist/tran/chase.h
new file mode 100644
index 0000000..a63112e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/chase.h
@@ -0,0 +1,3 @@
+sound_type snd_make_chase(sound_type input, double risetime, double falltime);
+sound_type snd_chase(sound_type input, double risetime, double falltime);
+    /* LISP: (snd-chase SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/clip.alg b/lib-src/libnyquist/nyquist/tran/clip.alg
new file mode 100644
index 0000000..1bf56fe
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/clip.alg
@@ -0,0 +1,9 @@
+(CLIP-ALG
+  (NAME "clip")
+  (ARGUMENTS ("sound_type" "s") ("double" "level")) 
+  (STATE ("sample_type" "level" "(sample_type) level"))
+  (START (MIN s))
+  (INNER-LOOP "double x = s; output = (sample_type) (x > level ? level : (x < -level ? -level : x))")
+  (TERMINATE (MIN s))
+  (LOGICAL-STOP (MIN s))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/clip.c b/lib-src/libnyquist/nyquist/tran/clip.c
new file mode 100644
index 0000000..e6a5bec
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/clip.c
@@ -0,0 +1,301 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "clip.h"
+
+void clip_free();
+
+
+typedef struct clip_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+
+    sample_type level;
+} clip_susp_node, *clip_susp_type;
+
+
+void clip_n_fetch(register clip_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type level_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "clip_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	level_reg = susp->level;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double x = *s_ptr_reg++; *out_ptr_reg++ = (sample_type) (x > level_reg ? level_reg : (x < -level_reg ? -level_reg : x));
+	} while (--n); /* inner loop */
+
+	susp->level = level_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* clip_n_fetch */
+
+
+void clip_s_fetch(register clip_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type level_reg;
+    register sample_type s_scale_reg = susp->s->scale;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "clip_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	level_reg = susp->level;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double x = (s_scale_reg * *s_ptr_reg++); *out_ptr_reg++ = (sample_type) (x > level_reg ? level_reg : (x < -level_reg ? -level_reg : x));
+	} while (--n); /* inner loop */
+
+	susp->level = level_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* clip_s_fetch */
+
+
+void clip_toss_fetch(susp, snd_list)
+  register clip_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while ((round((final_time - susp->s->t0) * susp->s->sr)) >=
+	   susp->s->current)
+	susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void clip_mark(clip_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void clip_free(clip_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(clip_susp_node), "clip_free");
+}
+
+
+void clip_print_tree(clip_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_clip(sound_type s, double level)
+{
+    register clip_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, clip_susp_node, "snd_make_clip");
+    susp->level = (sample_type) level;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = clip_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = clip_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = clip_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = clip_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = clip_mark;
+    susp->susp.print_tree = clip_print_tree;
+    susp->susp.name = "clip";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_clip(sound_type s, double level)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_clip(s_copy, level);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/clip.h b/lib-src/libnyquist/nyquist/tran/clip.h
new file mode 100644
index 0000000..1b28307
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/clip.h
@@ -0,0 +1,3 @@
+sound_type snd_make_clip(sound_type s, double level);
+sound_type snd_clip(sound_type s, double level);
+    /* LISP: (snd-clip SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/congen.alg b/lib-src/libnyquist/nyquist/tran/congen.alg
new file mode 100644
index 0000000..9ff02d2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/congen.alg
@@ -0,0 +1,17 @@
+(CONGEN
+(NAME "congen")
+(ARGUMENTS ("sound_type" "sndin") ("double" "risetime") ("double" "falltime"))
+(START (MIN sndin))
+(STATE ("double" "value" "0")
+       ("double" "rise_factor" "exp(log(0.5) / (sndin->sr * risetime))")
+       ("double" "fall_factor" "exp(log(0.5) / (sndin->sr * falltime))"))
+(CONSTANT "fall_factor" "rise_factor")
+(ALWAYS-SCALE sndin)
+(TERMINATE (MIN sndin))
+(INNER-LOOP "      sample_type current = sndin;
+    if (current > value) {
+        value = current - (current - value) * rise_factor;
+    } else {
+        value = current - (current - value) * fall_factor;
+    }
+    output = (sample_type) value;"))
diff --git a/lib-src/libnyquist/nyquist/tran/congen.c b/lib-src/libnyquist/nyquist/tran/congen.c
new file mode 100644
index 0000000..ed074c7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/congen.c
@@ -0,0 +1,185 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "congen.h"
+
+void congen_free();
+
+
+typedef struct congen_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type sndin;
+    long sndin_cnt;
+    sample_block_values_type sndin_ptr;
+
+    double value;
+    double rise_factor;
+    double fall_factor;
+} congen_susp_node, *congen_susp_type;
+
+
+void congen_s_fetch(register congen_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double value_reg;
+    register double rise_factor_reg;
+    register double fall_factor_reg;
+    register sample_type sndin_scale_reg = susp->sndin->scale;
+    register sample_block_values_type sndin_ptr_reg;
+    falloc_sample_block(out, "congen_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the sndin input sample block: */
+	susp_check_term_samples(sndin, sndin_ptr, sndin_cnt);
+	togo = min(togo, susp->sndin_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	value_reg = susp->value;
+	rise_factor_reg = susp->rise_factor;
+	fall_factor_reg = susp->fall_factor;
+	sndin_ptr_reg = susp->sndin_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+      sample_type current = (sndin_scale_reg * *sndin_ptr_reg++);
+    if (current > value_reg) {
+        value_reg = current - (current - value_reg) * rise_factor_reg;
+    } else {
+        value_reg = current - (current - value_reg) * fall_factor_reg;
+    }
+    *out_ptr_reg++ = (sample_type) value_reg;;
+	} while (--n); /* inner loop */
+
+	susp->value = value_reg;
+	/* using sndin_ptr_reg is a bad idea on RS/6000: */
+	susp->sndin_ptr += togo;
+	out_ptr += togo;
+	susp_took(sndin_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* congen_s_fetch */
+
+
+void congen_toss_fetch(susp, snd_list)
+  register congen_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from sndin up to final_time for this block of zeros */
+    while ((round((final_time - susp->sndin->t0) * susp->sndin->sr)) >=
+	   susp->sndin->current)
+	susp_get_samples(sndin, sndin_ptr, sndin_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->sndin->t0) * susp->sndin->sr -
+         (susp->sndin->current - susp->sndin_cnt));
+    susp->sndin_ptr += n;
+    susp_took(sndin_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void congen_mark(congen_susp_type susp)
+{
+    sound_xlmark(susp->sndin);
+}
+
+
+void congen_free(congen_susp_type susp)
+{
+    sound_unref(susp->sndin);
+    ffree_generic(susp, sizeof(congen_susp_node), "congen_free");
+}
+
+
+void congen_print_tree(congen_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("sndin:");
+    sound_print_tree_1(susp->sndin, n);
+}
+
+
+sound_type snd_make_congen(sound_type sndin, double risetime, double falltime)
+{
+    register congen_susp_type susp;
+    rate_type sr = sndin->sr;
+    time_type t0 = sndin->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, congen_susp_node, "snd_make_congen");
+    susp->value = 0;
+    susp->rise_factor = exp(log(0.5) / (sndin->sr * risetime));
+    susp->fall_factor = exp(log(0.5) / (sndin->sr * falltime));
+    susp->susp.fetch = congen_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < sndin->t0) sound_prepend_zeros(sndin, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(sndin->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = congen_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = congen_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = congen_mark;
+    susp->susp.print_tree = congen_print_tree;
+    susp->susp.name = "congen";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->sndin = sndin;
+    susp->sndin_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_congen(sound_type sndin, double risetime, double falltime)
+{
+    sound_type sndin_copy = sound_copy(sndin);
+    return snd_make_congen(sndin_copy, risetime, falltime);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/congen.h b/lib-src/libnyquist/nyquist/tran/congen.h
new file mode 100644
index 0000000..dd336b2
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/congen.h
@@ -0,0 +1,3 @@
+sound_type snd_make_congen(sound_type sndin, double risetime, double falltime);
+sound_type snd_congen(sound_type sndin, double risetime, double falltime);
+    /* LISP: (snd-congen SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/const.alg b/lib-src/libnyquist/nyquist/tran/const.alg
new file mode 100644
index 0000000..3d89b09
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/const.alg
@@ -0,0 +1,11 @@
+(CONST-ALG
+(NAME "const")
+(ARGUMENTS ("double" "c") ("time_type" "t0")
+           ("rate_type" "sr") ("time_type" "d"))
+(STATE ("sample_type" "c" "(sample_type) c"))
+(CONSTANT "c")
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "output = c")
+(SAMPLE-RATE "sr")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/const.c b/lib-src/libnyquist/nyquist/tran/const.c
new file mode 100644
index 0000000..042cd52
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/const.c
@@ -0,0 +1,109 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "const.h"
+
+void const_free();
+
+
+typedef struct const_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    sample_type c;
+} const_susp_node, *const_susp_type;
+
+
+void const__fetch(register const_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type c_reg;
+    falloc_sample_block(out, "const__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	c_reg = susp->c;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = c_reg;
+	} while (--n); /* inner loop */
+
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* const__fetch */
+
+
+void const_free(const_susp_type susp)
+{
+    ffree_generic(susp, sizeof(const_susp_node), "const_free");
+}
+
+
+void const_print_tree(const_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_const(double c, time_type t0, rate_type sr, time_type d)
+{
+    register const_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, const_susp_node, "snd_make_const");
+    susp->c = (sample_type) c;
+    susp->susp.fetch = const__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = const_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = const_print_tree;
+    susp->susp.name = "const";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_const(double c, time_type t0, rate_type sr, time_type d)
+{
+    return snd_make_const(c, t0, sr, d);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/const.h b/lib-src/libnyquist/nyquist/tran/const.h
new file mode 100644
index 0000000..e29a167
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/const.h
@@ -0,0 +1,3 @@
+sound_type snd_make_const(double c, time_type t0, rate_type sr, time_type d);
+sound_type snd_const(double c, time_type t0, rate_type sr, time_type d);
+    /* LISP: (snd-const ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/convolve.alg b/lib-src/libnyquist/nyquist/tran/convolve.alg
new file mode 100644
index 0000000..94107b4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/convolve.alg
@@ -0,0 +1,63 @@
+(CONVOLVE-ALG
+(NAME "convolve")
+(SUPPORT-FUNCTIONS "
+void h_reverse(sample_type *h, long len)
+{
+    sample_type temp;
+    int i;
+    
+    for (i = 0; i < len; i++) {
+        temp = h[i];
+        h[i] = h[len - 1];
+        h[len - 1] = temp;
+        len--;
+    }
+}
+")
+
+(ARGUMENTS ("sound_type" "x_snd") ("sound_type" "h_snd") )
+(TABLE "h_snd")
+(START (MIN x_snd))
+(NOT-IN-INNER-LOOP "h_snd")
+(STATE 
+        ("table_type" "table" "sound_to_table(h_snd)")
+        ("sample_type *" "h_buf" "susp->table->samples")
+        ("double" "length_of_h" "susp->table->length")
+        ("long" "h_len" "(long) susp->length_of_h;
+         h_reverse(susp->h_buf, susp->h_len)")
+        ("long" "x_buf_len" "2 * susp->h_len")
+        ("sample_type *" "x_buffer_pointer" 
+         "calloc((2 * (susp->h_len)), sizeof(float))")
+        ("sample_type *" "x_buffer_current" "susp->x_buffer_pointer")  )
+(ALWAYS-SCALE x_snd)
+(TERMINATE (MIN x_snd))
+(LOGICAL-STOP (MIN x_snd))
+(INNER-LOOP-LOCALS 
+  "long i; double sum;")
+(INNER-LOOP "
+        /* see if we've reached end of x_buffer */
+        if ((x_buffer_pointer + x_buf_len) <= (x_buffer_current + h_len)) {
+            /* shift x_buffer from current back to base */
+            for (i = 1; i < h_len; i++) {
+                x_buffer_pointer[i-1] = x_buffer_current[i];
+            }    
+            /* this will be incremented back to x_buffer_pointer below */
+            x_buffer_current = x_buffer_pointer - 1;
+        }
+
+        x_buffer_current++;
+
+        x_buffer_current[h_len - 1] = x_snd;
+
+        sum = 0.0;
+        for (i = 0; i < h_len; i++) {
+            sum += x_buffer_current[i] * h_buf[i];
+        }
+
+        output = (sample_type) sum;
+")
+(CONSTANT "h_buf" "h_len" "x_buf_len" "table")
+(SAMPLE-RATE "x_snd->sr")
+(FINALIZATION "    table_unref(susp->table); 
+    free(susp->x_buffer_pointer);")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/coterm.alg b/lib-src/libnyquist/nyquist/tran/coterm.alg
new file mode 100644
index 0000000..84bce1d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/coterm.alg
@@ -0,0 +1,11 @@
+(COTERM-ALG
+  (NAME "coterm")
+  (ARGUMENTS ("sound_type" "s1") ("sound_type" "s2"))
+  (START (MAX s1 s2))
+  (INNER-LOOP "{sample_type dummy = s2; output = s1;}")
+  (LINEAR s1)
+  (TERMINATE (MIN s1 s2))
+  (LOGICAL-STOP (MIN s1 s2))
+  (INTERNAL-SCALING s2)
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/coterm.c b/lib-src/libnyquist/nyquist/tran/coterm.c
new file mode 100644
index 0000000..dfc4a1d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/coterm.c
@@ -0,0 +1,238 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "coterm.h"
+
+void coterm_free();
+
+
+typedef struct coterm_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type s2;
+    long s2_cnt;
+    sample_block_values_type s2_ptr;
+} coterm_susp_node, *coterm_susp_type;
+
+
+void coterm_nn_fetch(register coterm_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_block_values_type s2_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "coterm_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the s2 input sample block: */
+	susp_check_term_log_samples(s2, s2_ptr, s2_cnt);
+	togo = min(togo, susp->s2_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	s2_ptr_reg = susp->s2_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{sample_type dummy = *s2_ptr_reg++; *out_ptr_reg++ = *s1_ptr_reg++;};
+	} while (--n); /* inner loop */
+
+	/* using s2_ptr_reg is a bad idea on RS/6000: */
+	susp->s2_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(s2_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* coterm_nn_fetch */
+
+
+void coterm_toss_fetch(susp, snd_list)
+  register coterm_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from s2 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >=
+	   susp->s2->current)
+	susp_get_samples(s2, s2_ptr, s2_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->s2->t0) * susp->s2->sr -
+         (susp->s2->current - susp->s2_cnt));
+    susp->s2_ptr += n;
+    susp_took(s2_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void coterm_mark(coterm_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->s2);
+}
+
+
+void coterm_free(coterm_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(coterm_susp_node), "coterm_free");
+}
+
+
+void coterm_print_tree(coterm_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("s2:");
+    sound_print_tree_1(susp->s2, n);
+}
+
+
+sound_type snd_make_coterm(sound_type s1, sound_type s2)
+{
+    register coterm_susp_type susp;
+    rate_type sr = max(s1->sr, s2->sr);
+    time_type t0 = max(s1->t0, s2->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    long lsc;
+    /* combine scale factors of linear inputs (S1) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, coterm_susp_node, "snd_make_coterm");
+    susp->susp.fetch = coterm_nn_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < s2->t0) sound_prepend_zeros(s2, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(s2->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = coterm_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = coterm_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = coterm_mark;
+    susp->susp.print_tree = coterm_print_tree;
+    susp->susp.name = "coterm";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    lsc = logical_stop_cnt_cvt(s2);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = s2;
+    susp->s2_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_coterm(sound_type s1, sound_type s2)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type s2_copy = sound_copy(s2);
+    return snd_make_coterm(s1_copy, s2_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/coterm.h b/lib-src/libnyquist/nyquist/tran/coterm.h
new file mode 100644
index 0000000..629678d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/coterm.h
@@ -0,0 +1,3 @@
+sound_type snd_make_coterm(sound_type s1, sound_type s2);
+sound_type snd_coterm(sound_type s1, sound_type s2);
+    /* LISP: (snd-coterm SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/delay.alg b/lib-src/libnyquist/nyquist/tran/delay.alg
new file mode 100644
index 0000000..8e2d502
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delay.alg
@@ -0,0 +1,20 @@
+(DELAY-ALG
+(NAME "delay")
+(ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("double" "feedback"))
+(START (MIN input))
+(STATE ("double" "feedback" "feedback")
+       ("long" "delaylen" "max(1, round(input->sr * delay))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "endptr" "susp->delaybuf + susp->delaylen"))
+(CONSTANT "feedback" "delaylen" "endptr")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP "output = *delayptr;
+         *delayptr = (sample_type) (*delayptr * feedback) + input;
+         if (++delayptr >= endptr) delayptr = susp->delaybuf;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/delaycc.alg b/lib-src/libnyquist/nyquist/tran/delaycc.alg
new file mode 100644
index 0000000..8e2d502
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycc.alg
@@ -0,0 +1,20 @@
+(DELAY-ALG
+(NAME "delay")
+(ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("double" "feedback"))
+(START (MIN input))
+(STATE ("double" "feedback" "feedback")
+       ("long" "delaylen" "max(1, round(input->sr * delay))")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "endptr" "susp->delaybuf + susp->delaylen"))
+(CONSTANT "feedback" "delaylen" "endptr")
+(NOT-REGISTER delaybuf)
+(LINEAR input)
+(TERMINATE (MIN input))
+(INNER-LOOP "output = *delayptr;
+         *delayptr = (sample_type) (*delayptr * feedback) + input;
+         if (++delayptr >= endptr) delayptr = susp->delaybuf;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/delaycc.c b/lib-src/libnyquist/nyquist/tran/delaycc.c
new file mode 100644
index 0000000..3584d89
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycc.c
@@ -0,0 +1,191 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "delaycc.h"
+
+void delay_free();
+
+
+typedef struct delay_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double feedback;
+    long delaylen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} delay_susp_node, *delay_susp_type;
+
+
+void delay_n_fetch(register delay_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double feedback_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "delay_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	feedback_reg = susp->feedback;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *delayptr_reg;
+         *delayptr_reg = (sample_type) (*delayptr_reg * feedback_reg) + *input_ptr_reg++;
+         if (++delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* delay_n_fetch */
+
+
+void delay_toss_fetch(susp, snd_list)
+  register delay_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void delay_mark(delay_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void delay_free(delay_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(delay_susp_node), "delay_free");
+}
+
+
+void delay_print_tree(delay_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_delay(sound_type input, time_type delay, double feedback)
+{
+    register delay_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, delay_susp_node, "snd_make_delay");
+    susp->feedback = feedback;
+    susp->delaylen = max(1, round(input->sr * delay));
+    susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type));
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->delaylen;
+    susp->susp.fetch = delay_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = delay_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = delay_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = delay_mark;
+    susp->susp.print_tree = delay_print_tree;
+    susp->susp.name = "delay";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_delay(sound_type input, time_type delay, double feedback)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_delay(input_copy, delay, feedback);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/delaycc.h b/lib-src/libnyquist/nyquist/tran/delaycc.h
new file mode 100644
index 0000000..c8ced3f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_delay(sound_type input, time_type delay, double feedback);
+sound_type snd_delay(sound_type input, time_type delay, double feedback);
+    /* LISP: (snd-delay SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/delaycv.alg b/lib-src/libnyquist/nyquist/tran/delaycv.alg
new file mode 100644
index 0000000..5823dbd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycv.alg
@@ -0,0 +1,19 @@
+(DELAYCV-ALG
+(NAME "delaycv")
+(ARGUMENTS ("sound_type" "s") ("time_type" "delay") ("sound_type" "feedback"))
+(START (MAX s feedback))
+(STATE ("long" "delaylen" "round(s->sr * delay)")
+       ("sample_type *" "delaybuf"
+               "(sample_type *) calloc (sizeof(double), susp->delaylen)")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "endptr" "susp->delaybuf + susp->delaylen"))
+(CONSTANT "delaylen" "delaybuf")
+(NOT-REGISTER delaybuf)
+(LINEAR s)
+(TERMINATE (MIN s))
+(INNER-LOOP "output = *delayptr;
+         *delayptr = *delayptr * feedback + s;
+         if (++delayptr >= endptr) delayptr = susp->delaybuf;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/delaycv.c b/lib-src/libnyquist/nyquist/tran/delaycv.c
new file mode 100644
index 0000000..984e88d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycv.c
@@ -0,0 +1,300 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "delaycv.h"
+
+void delaycv_free();
+
+
+typedef struct delaycv_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+    sound_type feedback;
+    long feedback_cnt;
+    sample_block_values_type feedback_ptr;
+
+    long delaylen;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *endptr;
+} delaycv_susp_node, *delaycv_susp_type;
+
+
+void delaycv_nn_fetch(register delaycv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "delaycv_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *delayptr_reg;
+         *delayptr_reg = *delayptr_reg * *feedback_ptr_reg++ + *s_ptr_reg++;
+         if (++delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	susp->endptr = endptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* delaycv_nn_fetch */
+
+
+void delaycv_ns_fetch(register delaycv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type * delayptr_reg;
+    register sample_type * endptr_reg;
+    register sample_type feedback_scale_reg = susp->feedback->scale;
+    register sample_block_values_type feedback_ptr_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "delaycv_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past the feedback input sample block: */
+	susp_check_samples(feedback, feedback_ptr, feedback_cnt);
+	togo = min(togo, susp->feedback_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	delayptr_reg = susp->delayptr;
+	endptr_reg = susp->endptr;
+	feedback_ptr_reg = susp->feedback_ptr;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *delayptr_reg;
+         *delayptr_reg = *delayptr_reg * (feedback_scale_reg * *feedback_ptr_reg++) + *s_ptr_reg++;
+         if (++delayptr_reg >= endptr_reg) delayptr_reg = susp->delaybuf;;
+	} while (--n); /* inner loop */
+
+	susp->delayptr = delayptr_reg;
+	susp->endptr = endptr_reg;
+	/* using feedback_ptr_reg is a bad idea on RS/6000: */
+	susp->feedback_ptr += togo;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	susp_took(feedback_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* delaycv_ns_fetch */
+
+
+void delaycv_toss_fetch(susp, snd_list)
+  register delaycv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while ((round((final_time - susp->s->t0) * susp->s->sr)) >=
+	   susp->s->current)
+	susp_get_samples(s, s_ptr, s_cnt);
+    /* fetch samples from feedback up to final_time for this block of zeros */
+    while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >=
+	   susp->feedback->current)
+	susp_get_samples(feedback, feedback_ptr, feedback_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    n = round((final_time - susp->feedback->t0) * susp->feedback->sr -
+         (susp->feedback->current - susp->feedback_cnt));
+    susp->feedback_ptr += n;
+    susp_took(feedback_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void delaycv_mark(delaycv_susp_type susp)
+{
+    sound_xlmark(susp->s);
+    sound_xlmark(susp->feedback);
+}
+
+
+void delaycv_free(delaycv_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->s);
+    sound_unref(susp->feedback);
+    ffree_generic(susp, sizeof(delaycv_susp_node), "delaycv_free");
+}
+
+
+void delaycv_print_tree(delaycv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+
+    indent(n);
+    stdputstr("feedback:");
+    sound_print_tree_1(susp->feedback, n);
+}
+
+
+sound_type snd_make_delaycv(sound_type s, time_type delay, sound_type feedback)
+{
+    register delaycv_susp_type susp;
+    rate_type sr = max(s->sr, feedback->sr);
+    time_type t0 = max(s->t0, feedback->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (S) */
+    scale_factor *= s->scale;
+    s->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s->sr < sr) { s->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, delaycv_susp_node, "snd_make_delaycv");
+    susp->delaylen = round(s->sr * delay);
+    susp->delaybuf = (sample_type *) calloc (sizeof(double), susp->delaylen);
+    susp->delayptr = susp->delaybuf;
+    susp->endptr = susp->delaybuf + susp->delaylen;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s, sr);
+    interp_desc = (interp_desc << 2) + interp_style(feedback, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = delaycv_nn_fetch; break;
+      case INTERP_ns: susp->susp.fetch = delaycv_ns_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    if (t0 < feedback->t0) sound_prepend_zeros(feedback, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s->t0, min(feedback->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = delaycv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = delaycv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = delaycv_mark;
+    susp->susp.print_tree = delaycv_print_tree;
+    susp->susp.name = "delaycv";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    susp->feedback = feedback;
+    susp->feedback_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_delaycv(sound_type s, time_type delay, sound_type feedback)
+{
+    sound_type s_copy = sound_copy(s);
+    sound_type feedback_copy = sound_copy(feedback);
+    return snd_make_delaycv(s_copy, delay, feedback_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/delaycv.h b/lib-src/libnyquist/nyquist/tran/delaycv.h
new file mode 100644
index 0000000..5c6e3d0
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/delaycv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_delaycv(sound_type s, time_type delay, sound_type feedback);
+sound_type snd_delaycv(sound_type s, time_type delay, sound_type feedback);
+    /* LISP: (snd-delaycv SOUND ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/downproto.alg b/lib-src/libnyquist/nyquist/tran/downproto.alg
new file mode 100644
index 0000000..98680ba
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/downproto.alg
@@ -0,0 +1,18 @@
+(DOWNSAMPLE-PROTO-ALG
+  (NAME "down")
+  (ARGUMENTS ("rate_type" "sr") ("sound_type" "s"))
+  (SAMPLE-RATE "sr")
+  (START (MIN s))
+  (INLINE-INTERPOLATION T)
+  (STATE )
+  (INNER-LOOP "output = s")
+  (TERMINATE (MIN s))
+  (LOGICAL-STOP (MIN s))
+  (TYPE-CHECK
+"    if (s->sr < sr) {
+        sound_unref(s);
+        xlfail(\"snd-down: output sample rate must be lower than input\");
+    }
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/eqbandv.alg b/lib-src/libnyquist/nyquist/tran/eqbandv.alg
new file mode 100644
index 0000000..1837f43
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/eqbandv.alg
@@ -0,0 +1,56 @@
+; general order-2 IIR filter.
+; a0 is assumed to be unity.
+; for a1 and a2, our sign convention is opposite to Matlab's.
+
+(EQBANDVVV-ALG
+(NAME "eqbandvvv")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz"))
+;;           ("sound_type" "gain") ("sound_type" "width") )
+(START (MIN s1 hz)) ;; gain width))
+(TERMINATE (MIN s1 hz )) ;; gain width))
+(LOGICAL-STOP (MIN s1 hz)) ;; gain width))
+(SAMPLE-RATE (MAX s1))
+(INTERNAL-SCALING s1)
+(INLINE-INTERPOLATION T)
+(ALWAYS-SCALE hz)
+(STEP-FUNCTION hz gain width)
+(STATE	("double" "scale1" "s1->scale")
+        ("double" "w1" "0.0")
+        ("double" "sw" "0.0")
+        ("double" "cw" "0.0")
+        ("double" "J" "0.0")
+        ("double" "g" "0.0")
+        ("double" "b0" "0.0")
+        ("double" "b1" "0.0")
+        ("double" "b2" "0.0")
+        ("double" "a0" "0.0")
+        ("double" "a1" "0.0")
+        ("double" "a2" "0.0"))
+(DEPENDS ("w1" "hz" "PI2 * hz / s1->sr")
+         ("sw" "hz" "sin(w1)")
+         ("cw" "hz" "cos(w1)")
+         ("b1" "hz" "-2.0 * cw")
+         ("a1" "hz" "-b1")
+         ;; ("J" "gain" "sqrt(gain)")
+         ;; ("recompute" "width" "true")
+         ("recompute" "hz" "true")
+         ;; ("recompute" "gain" "true")
+)
+;; (JOINT-DEPENDENCY (("width" "hz")
+;;"if (recompute) {"
+;;"    recompute = false;"
+;;"    g = sw * sinh(log_of_2_over_2 * width * w1 / sw);"
+;;"    b0 = 1.0 + g * J;"
+;;"    b2 = 1.0 - g * J;"
+;;"    a0 = 1.0 + g / J;"
+;;"    a2 = g / J - 1.0;"
+;;"}"))
+(FORCE-INTO-REGISTER recompute)
+(STEP-FUNCTION hz) ;; gain width)
+(CONSTANT "w1" "sw" "cw" "J" "g" "b0" "b1" "b2" "b3" "a0" "a1" "a2")
+(INNER-LOOP-LOCALS "double z0;")
+(INNER-LOOP "    z0 = s + a1*z1 + a2*z2;
+    output = (sample_type) (z0*b0 + z1*b1 + z2*b2);
+    z2 = z1; z1 = z0;")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/eqbandvvv.alg b/lib-src/libnyquist/nyquist/tran/eqbandvvv.alg
new file mode 100644
index 0000000..c2a14a4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/eqbandvvv.alg
@@ -0,0 +1,64 @@
+; general order-2 IIR filter.
+; a0 is assumed to be unity.
+; for a1 and a2, our sign convention is opposite to Matlab's.
+
+(EQBANDVVV-ALG
+(NAME "eqbandvvv")
+(ARGUMENTS ("sound_type" "input") ("sound_type" "hz") 
+           ("sound_type" "gain") ("sound_type" "width") )
+(SUPPORT-FUNCTIONS "#define log_of_2_over_2 0.3465735902799726547086\n")
+(START (MIN input hz gain width))
+(TERMINATE (MIN input hz gain width))
+(LOGICAL-STOP (MIN input hz gain width))
+(SAMPLE-RATE (MAX input))
+;;(INTERNAL-SCALING input hz gain width)
+(INLINE-INTERPOLATION T)
+(MATCHED-SAMPLE-RATE hz gain width)
+(ALWAYS-SCALE input hz gain width)
+(STEP-FUNCTION hz gain width)
+(STATE	("double" "inp_scale" "input->scale")
+        ("double" "w1" "0.0")
+        ("double" "sw" "0.0")
+        ("double" "cw" "0.0")
+        ("double" "J" "0.0")
+        ("double" "gg" "0.0")
+        ("double" "b0" "0.0")
+        ("double" "b1" "0.0")
+        ("double" "b2" "0.0")
+        ("double" "a0" "0.0")
+        ("double" "a1" "0.0")
+        ("double" "a2" "0.0")
+        ("double" "z1" "0.0")
+        ("double" "z2" "0.0")
+        ("boolean" "recompute" "false")
+        ("double" "inp_period" "1.0 / input->sr"))
+(DEPENDS ("w1" "hz" "PI2 * hz * inp_period")
+         ("sw" "hz" "sin(w1)")
+         ("cw" "hz" "cos(w1)")
+         ("b1" "hz" "-2.0 * cw")
+         ("a1" "hz" "-b1")
+         ("J" "gain" "sqrt(gain)")
+         ("recompute" "width" "true")
+         ("recompute" "hz" "true")
+         ("recompute" "gain" "true")
+)
+(JOINT-DEPENDENCY (("width" "hz")
+"if (recompute) {"
+"    /* a0 = 1.0 + gg / J; */"
+"    double a_0_recip = J / (J + gg);"
+"    recompute = false;"
+"    gg = sw * sinh(log_of_2_over_2 * width * w1 / sw);"
+"    b0 = (1.0 + gg * J) * a_0_recip;"
+"    b1 *= a_0_recip;"
+"    b2 = (1.0 - gg * J) * a_0_recip;"
+"    a1 *= a_0_recip;"
+"    a2 = (gg / J - 1.0) * a_0_recip;"
+"}"))
+(FORCE-INTO-REGISTER recompute inp_period cw)
+(CONSTANT "w1" "sw" "cw" "J" "gg" "b0" "b1" "b2" "b3" "a0" "a1" "a2" "inp_period")
+(INNER-LOOP-LOCALS "            double z0;\n")
+(INNER-LOOP "    z0 = input + a1*z1 + a2*z2;
+    output = (sample_type) (z0*b0 + z1*b1 + z2*b2);
+    z2 = z1; z1 = z0;")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/eqbandvvv.c b/lib-src/libnyquist/nyquist/tran/eqbandvvv.c
new file mode 100644
index 0000000..1c5bcb5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/eqbandvvv.c
@@ -0,0 +1,868 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "eqbandvvv.h"
+
+void eqbandvvv_free();
+
+
+typedef struct eqbandvvv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+    sound_type hz;
+    long hz_cnt;
+    sample_block_values_type hz_ptr;
+
+    /* support for interpolation of hz */
+    sample_type hz_x1_sample;
+    double hz_pHaSe;
+    double hz_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz */
+    double output_per_hz;
+    long hz_n;
+    sound_type gain;
+    long gain_cnt;
+    sample_block_values_type gain_ptr;
+
+    /* support for interpolation of gain */
+    sample_type gain_x1_sample;
+    double gain_pHaSe;
+    double gain_pHaSe_iNcR;
+
+    /* support for ramp between samples of gain */
+    double output_per_gain;
+    long gain_n;
+    sound_type width;
+    long width_cnt;
+    sample_block_values_type width_ptr;
+
+    /* support for interpolation of width */
+    sample_type width_x1_sample;
+    double width_pHaSe;
+    double width_pHaSe_iNcR;
+
+    /* support for ramp between samples of width */
+    double output_per_width;
+    long width_n;
+
+    double inp_scale;
+    double w1;
+    double sw;
+    double cw;
+    double J;
+    double gg;
+    double b0;
+    double b1;
+    double b2;
+    double a0;
+    double a1;
+    double a2;
+    double z1;
+    double z2;
+    boolean recompute;
+    double inp_period;
+} eqbandvvv_susp_node, *eqbandvvv_susp_type;
+
+#define log_of_2_over_2 0.3465735902799726547086
+
+
+void eqbandvvv_ssss_fetch(register eqbandvvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double w1_reg;
+    register double sw_reg;
+    register double cw_reg;
+    register double J_reg;
+    register double gg_reg;
+    register double b0_reg;
+    register double b1_reg;
+    register double b2_reg;
+    register double a0_reg;
+    register double a1_reg;
+    register double a2_reg;
+    register double z1_reg;
+    register double z2_reg;
+    register boolean recompute_reg;
+    register double inp_period_reg;
+    register sample_type width_scale_reg = susp->width->scale;
+    register sample_block_values_type width_ptr_reg;
+    register sample_type gain_scale_reg = susp->gain->scale;
+    register sample_block_values_type gain_ptr_reg;
+    register sample_type hz_scale_reg = susp->hz->scale;
+    register sample_block_values_type hz_ptr_reg;
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "eqbandvvv_ssss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past the hz input sample block: */
+	susp_check_term_log_samples(hz, hz_ptr, hz_cnt);
+	togo = min(togo, susp->hz_cnt);
+
+	/* don't run past the gain input sample block: */
+	susp_check_term_log_samples(gain, gain_ptr, gain_cnt);
+	togo = min(togo, susp->gain_cnt);
+
+	/* don't run past the width input sample block: */
+	susp_check_term_log_samples(width, width_ptr, width_cnt);
+	togo = min(togo, susp->width_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	w1_reg = susp->w1;
+	sw_reg = susp->sw;
+	cw_reg = susp->cw;
+	J_reg = susp->J;
+	gg_reg = susp->gg;
+	b0_reg = susp->b0;
+	b1_reg = susp->b1;
+	b2_reg = susp->b2;
+	a0_reg = susp->a0;
+	a1_reg = susp->a1;
+	a2_reg = susp->a2;
+	z1_reg = susp->z1;
+	z2_reg = susp->z2;
+	recompute_reg = susp->recompute;
+	inp_period_reg = susp->inp_period;
+	width_ptr_reg = susp->width_ptr;
+	gain_ptr_reg = susp->gain_ptr;
+	hz_ptr_reg = susp->hz_ptr;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double z0;
+	    w1_reg = PI2 * (hz_scale_reg * *hz_ptr_reg++) * inp_period_reg;
+	    sw_reg = sin(w1_reg);
+	    cw_reg = cos(w1_reg);
+	    b1_reg = -2.0 * cw_reg;
+	    a1_reg = -b1_reg;
+	    J_reg = sqrt((gain_scale_reg * *gain_ptr_reg++));
+	    recompute_reg = true;
+	    recompute_reg = true;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        /* a0_reg = 1.0 + gg_reg / J_reg; */
+	        double a_0_recip = J_reg / (J_reg + gg_reg);
+	        recompute_reg = false;
+	        gg_reg = sw_reg * sinh(log_of_2_over_2 * (width_scale_reg * *width_ptr_reg++) * w1_reg / sw_reg);
+	        b0_reg = (1.0 + gg_reg * J_reg) * a_0_recip;
+	        b1_reg *= a_0_recip;
+	        b2_reg = (1.0 - gg_reg * J_reg) * a_0_recip;
+	        a1_reg *= a_0_recip;
+	        a2_reg = (gg_reg / J_reg - 1.0) * a_0_recip;
+	    }
+    z0 = (input_scale_reg * *input_ptr_reg++) + a1_reg*z1_reg + a2_reg*z2_reg;
+    *out_ptr_reg++ = (sample_type) (z0*b0_reg + z1_reg*b1_reg + z2_reg*b2_reg);
+    z2_reg = z1_reg; z1_reg = z0;;
+	} while (--n); /* inner loop */
+
+	susp->z1 = z1_reg;
+	susp->z2 = z2_reg;
+	susp->recompute = recompute_reg;
+	/* using width_ptr_reg is a bad idea on RS/6000: */
+	susp->width_ptr += togo;
+	/* using gain_ptr_reg is a bad idea on RS/6000: */
+	susp->gain_ptr += togo;
+	/* using hz_ptr_reg is a bad idea on RS/6000: */
+	susp->hz_ptr += togo;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp_took(hz_cnt, togo);
+	susp_took(gain_cnt, togo);
+	susp_took(width_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* eqbandvvv_ssss_fetch */
+
+
+void eqbandvvv_siii_fetch(register eqbandvvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double w1_reg;
+    register double sw_reg;
+    register double cw_reg;
+    register double J_reg;
+    register double gg_reg;
+    register double b0_reg;
+    register double b1_reg;
+    register double b2_reg;
+    register double a0_reg;
+    register double a1_reg;
+    register double a2_reg;
+    register double z1_reg;
+    register double z2_reg;
+    register boolean recompute_reg;
+    register double inp_period_reg;
+    register double width_pHaSe_iNcR_rEg = susp->width_pHaSe_iNcR;
+    register double width_pHaSe_ReG;
+    register sample_type width_x1_sample_reg;
+    register double gain_pHaSe_iNcR_rEg = susp->gain_pHaSe_iNcR;
+    register double gain_pHaSe_ReG;
+    register sample_type gain_x1_sample_reg;
+    register double hz_pHaSe_iNcR_rEg = susp->hz_pHaSe_iNcR;
+    register double hz_pHaSe_ReG;
+    register sample_type hz_x1_sample_reg;
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "eqbandvvv_siii_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(hz, hz_ptr, hz_cnt);
+	susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	susp->w1 = PI2 * susp->hz_x1_sample * susp->inp_period;
+	susp->sw = sin(susp->w1);
+	susp->cw = cos(susp->w1);
+	susp->b1 = -2.0 * susp->cw;
+	susp->a1 = -susp->b1;
+	susp->recompute = true;
+	susp_check_term_log_samples(gain, gain_ptr, gain_cnt);
+	susp->gain_x1_sample = susp_fetch_sample(gain, gain_ptr, gain_cnt);
+	susp->J = sqrt(susp->gain_x1_sample);
+	susp->recompute = true;
+	susp_check_term_log_samples(width, width_ptr, width_cnt);
+	susp->width_x1_sample = susp_fetch_sample(width, width_ptr, width_cnt);
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	w1_reg = susp->w1;
+	sw_reg = susp->sw;
+	cw_reg = susp->cw;
+	J_reg = susp->J;
+	gg_reg = susp->gg;
+	b0_reg = susp->b0;
+	b1_reg = susp->b1;
+	b2_reg = susp->b2;
+	a0_reg = susp->a0;
+	a1_reg = susp->a1;
+	a2_reg = susp->a2;
+	z1_reg = susp->z1;
+	z2_reg = susp->z2;
+	recompute_reg = susp->recompute;
+	inp_period_reg = susp->inp_period;
+	width_pHaSe_ReG = susp->width_pHaSe;
+	width_x1_sample_reg = susp->width_x1_sample;
+	gain_pHaSe_ReG = susp->gain_pHaSe;
+	gain_x1_sample_reg = susp->gain_x1_sample;
+	hz_pHaSe_ReG = susp->hz_pHaSe;
+	hz_x1_sample_reg = susp->hz_x1_sample;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double z0;
+	    if (hz_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz */
+		/* pick up next sample as hz_x1_sample: */
+		susp->hz_ptr++;
+		susp_took(hz_cnt, 1);
+		hz_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(hz, hz_ptr, hz_cnt, hz_x1_sample_reg);
+		hz_x1_sample_reg = susp_current_sample(hz, hz_ptr);
+		w1_reg = susp->w1 = PI2 * hz_x1_sample_reg * inp_period_reg;
+		sw_reg = susp->sw = sin(w1_reg);
+		cw_reg = susp->cw = cos(w1_reg);
+		b1_reg = susp->b1 = -2.0 * cw_reg;
+		a1_reg = susp->a1 = -b1_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (gain_pHaSe_ReG >= 1.0) {
+/* fixup-depends gain */
+		/* pick up next sample as gain_x1_sample: */
+		susp->gain_ptr++;
+		susp_took(gain_cnt, 1);
+		gain_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(gain, gain_ptr, gain_cnt, gain_x1_sample_reg);
+		gain_x1_sample_reg = susp_current_sample(gain, gain_ptr);
+		J_reg = susp->J = sqrt(gain_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (width_pHaSe_ReG >= 1.0) {
+/* fixup-depends width */
+		/* pick up next sample as width_x1_sample: */
+		susp->width_ptr++;
+		susp_took(width_cnt, 1);
+		width_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(width, width_ptr, width_cnt, width_x1_sample_reg);
+		width_x1_sample_reg = susp_current_sample(width, width_ptr);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        /* a0_reg = 1.0 + gg_reg / J_reg; */
+	        double a_0_recip = J_reg / (J_reg + gg_reg);
+	        recompute_reg = false;
+	        gg_reg = sw_reg * sinh(log_of_2_over_2 * width_x1_sample_reg * w1_reg / sw_reg);
+	        b0_reg = (1.0 + gg_reg * J_reg) * a_0_recip;
+	        b1_reg *= a_0_recip;
+	        b2_reg = (1.0 - gg_reg * J_reg) * a_0_recip;
+	        a1_reg *= a_0_recip;
+	        a2_reg = (gg_reg / J_reg - 1.0) * a_0_recip;
+	    }
+    z0 = (input_scale_reg * *input_ptr_reg++) + a1_reg*z1_reg + a2_reg*z2_reg;
+    *out_ptr_reg++ = (sample_type) (z0*b0_reg + z1_reg*b1_reg + z2_reg*b2_reg);
+    z2_reg = z1_reg; z1_reg = z0;;
+	    hz_pHaSe_ReG += hz_pHaSe_iNcR_rEg;
+	    gain_pHaSe_ReG += gain_pHaSe_iNcR_rEg;
+	    width_pHaSe_ReG += width_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->z1 = z1_reg;
+	susp->z2 = z2_reg;
+	susp->recompute = recompute_reg;
+	susp->width_pHaSe = width_pHaSe_ReG;
+	susp->width_x1_sample = width_x1_sample_reg;
+	susp->gain_pHaSe = gain_pHaSe_ReG;
+	susp->gain_x1_sample = gain_x1_sample_reg;
+	susp->hz_pHaSe = hz_pHaSe_ReG;
+	susp->hz_x1_sample = hz_x1_sample_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* eqbandvvv_siii_fetch */
+
+
+void eqbandvvv_srrr_fetch(register eqbandvvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz_val;
+    sample_type gain_val;
+    sample_type width_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double cw_reg;
+    register double b0_reg;
+    register double b1_reg;
+    register double b2_reg;
+    register double a1_reg;
+    register double a2_reg;
+    register double z1_reg;
+    register double z2_reg;
+    register boolean recompute_reg;
+    register double inp_period_reg;
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "eqbandvvv_srrr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz_pHaSe = 1.0;
+	susp->gain_pHaSe = 1.0;
+	susp->width_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(hz, hz_ptr, hz_cnt);
+
+    susp_check_term_log_samples(gain, gain_ptr, gain_cnt);
+
+    susp_check_term_log_samples(width, width_ptr, width_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* grab next hz_x1_sample when phase goes past 1.0; */
+	/* use hz_n (computed below) to avoid roundoff errors: */
+	if (susp->hz_n <= 0) {
+	    susp_check_term_log_samples(hz, hz_ptr, hz_cnt);
+	    susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	    susp->hz_pHaSe -= 1.0;
+	    /* hz_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz_n = (long) ((1.0 - susp->hz_pHaSe) *
+					susp->output_per_hz);
+	    susp->w1 = PI2 * susp->hz_x1_sample * susp->inp_period;
+	    susp->sw = sin(susp->w1);
+	    susp->cw = cos(susp->w1);
+	    susp->b1 = -2.0 * susp->cw;
+	    susp->a1 = -susp->b1;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz_n);
+	hz_val = susp->hz_x1_sample;
+	/* grab next gain_x1_sample when phase goes past 1.0; */
+	/* use gain_n (computed below) to avoid roundoff errors: */
+	if (susp->gain_n <= 0) {
+	    susp_check_term_log_samples(gain, gain_ptr, gain_cnt);
+	    susp->gain_x1_sample = susp_fetch_sample(gain, gain_ptr, gain_cnt);
+	    susp->gain_pHaSe -= 1.0;
+	    /* gain_n gets number of samples before phase exceeds 1.0: */
+	    susp->gain_n = (long) ((1.0 - susp->gain_pHaSe) *
+					susp->output_per_gain);
+	    susp->J = sqrt(susp->gain_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->gain_n);
+	gain_val = susp->gain_x1_sample;
+	/* grab next width_x1_sample when phase goes past 1.0; */
+	/* use width_n (computed below) to avoid roundoff errors: */
+	if (susp->width_n <= 0) {
+	    susp_check_term_log_samples(width, width_ptr, width_cnt);
+	    susp->width_x1_sample = susp_fetch_sample(width, width_ptr, width_cnt);
+	    susp->width_pHaSe -= 1.0;
+	    /* width_n gets number of samples before phase exceeds 1.0: */
+	    susp->width_n = (long) ((1.0 - susp->width_pHaSe) *
+					susp->output_per_width);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->width_n);
+	width_val = susp->width_x1_sample;
+	if (susp->recompute) {
+	    /* susp->a0 = 1.0 + susp->gg / susp->J; */
+	    double a_0_recip = susp->J / (susp->J + susp->gg);
+	    susp->recompute = false;
+	    susp->gg = susp->sw * sinh(log_of_2_over_2 * width_val * susp->w1 / susp->sw);
+	    susp->b0 = (1.0 + susp->gg * susp->J) * a_0_recip;
+	    susp->b1 *= a_0_recip;
+	    susp->b2 = (1.0 - susp->gg * susp->J) * a_0_recip;
+	    susp->a1 *= a_0_recip;
+	    susp->a2 = (susp->gg / susp->J - 1.0) * a_0_recip;
+	}
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	cw_reg = susp->cw;
+	b0_reg = susp->b0;
+	b1_reg = susp->b1;
+	b2_reg = susp->b2;
+	a1_reg = susp->a1;
+	a2_reg = susp->a2;
+	z1_reg = susp->z1;
+	z2_reg = susp->z2;
+	recompute_reg = susp->recompute;
+	inp_period_reg = susp->inp_period;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double z0;
+    z0 = (input_scale_reg * *input_ptr_reg++) + a1_reg*z1_reg + a2_reg*z2_reg;
+    *out_ptr_reg++ = (sample_type) (z0*b0_reg + z1_reg*b1_reg + z2_reg*b2_reg);
+    z2_reg = z1_reg; z1_reg = z0;;
+	} while (--n); /* inner loop */
+
+	susp->z1 = z1_reg;
+	susp->z2 = z2_reg;
+	susp->recompute = recompute_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	susp->hz_pHaSe += togo * susp->hz_pHaSe_iNcR;
+	susp->hz_n -= togo;
+	susp->gain_pHaSe += togo * susp->gain_pHaSe_iNcR;
+	susp->gain_n -= togo;
+	susp->width_pHaSe += togo * susp->width_pHaSe_iNcR;
+	susp->width_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* eqbandvvv_srrr_fetch */
+
+
+void eqbandvvv_toss_fetch(susp, snd_list)
+  register eqbandvvv_susp_type susp;
+  snd_list_type snd_list;
+{
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* fetch samples from hz up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >=
+	   susp->hz->current)
+	susp_get_samples(hz, hz_ptr, hz_cnt);
+    /* fetch samples from gain up to final_time for this block of zeros */
+    while ((round((final_time - susp->gain->t0) * susp->gain->sr)) >=
+	   susp->gain->current)
+	susp_get_samples(gain, gain_ptr, gain_cnt);
+    /* fetch samples from width up to final_time for this block of zeros */
+    while ((round((final_time - susp->width->t0) * susp->width->sr)) >=
+	   susp->width->current)
+	susp_get_samples(width, width_ptr, width_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    n = round((final_time - susp->hz->t0) * susp->hz->sr -
+         (susp->hz->current - susp->hz_cnt));
+    susp->hz_ptr += n;
+    susp_took(hz_cnt, n);
+    n = round((final_time - susp->gain->t0) * susp->gain->sr -
+         (susp->gain->current - susp->gain_cnt));
+    susp->gain_ptr += n;
+    susp_took(gain_cnt, n);
+    n = round((final_time - susp->width->t0) * susp->width->sr -
+         (susp->width->current - susp->width_cnt));
+    susp->width_ptr += n;
+    susp_took(width_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void eqbandvvv_mark(eqbandvvv_susp_type susp)
+{
+    sound_xlmark(susp->input);
+    sound_xlmark(susp->hz);
+    sound_xlmark(susp->gain);
+    sound_xlmark(susp->width);
+}
+
+
+void eqbandvvv_free(eqbandvvv_susp_type susp)
+{
+    sound_unref(susp->input);
+    sound_unref(susp->hz);
+    sound_unref(susp->gain);
+    sound_unref(susp->width);
+    ffree_generic(susp, sizeof(eqbandvvv_susp_node), "eqbandvvv_free");
+}
+
+
+void eqbandvvv_print_tree(eqbandvvv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+
+    indent(n);
+    stdputstr("hz:");
+    sound_print_tree_1(susp->hz, n);
+
+    indent(n);
+    stdputstr("gain:");
+    sound_print_tree_1(susp->gain, n);
+
+    indent(n);
+    stdputstr("width:");
+    sound_print_tree_1(susp->width, n);
+}
+
+
+sound_type snd_make_eqbandvvv(sound_type input, sound_type hz, sound_type gain, sound_type width)
+{
+    register eqbandvvv_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = min(min(min(input->t0, hz->t0), gain->t0), width->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    long lsc;
+    falloc_generic(susp, eqbandvvv_susp_node, "snd_make_eqbandvvv");
+    susp->inp_scale = input->scale;
+    susp->w1 = 0.0;
+    susp->sw = 0.0;
+    susp->cw = 0.0;
+    susp->J = 0.0;
+    susp->gg = 0.0;
+    susp->b0 = 0.0;
+    susp->b1 = 0.0;
+    susp->b2 = 0.0;
+    susp->a0 = 0.0;
+    susp->a1 = 0.0;
+    susp->a2 = 0.0;
+    susp->z1 = 0.0;
+    susp->z2 = 0.0;
+    susp->recompute = false;
+    susp->inp_period = 1.0 / input->sr;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz, sr);
+    interp_desc = (interp_desc << 2) + interp_style(gain, sr);
+    interp_desc = (interp_desc << 2) + interp_style(width, sr);
+    switch (interp_desc) {
+      case INTERP_nnnn: /* handled below */
+      case INTERP_nnns: /* handled below */
+      case INTERP_nnsn: /* handled below */
+      case INTERP_nnss: /* handled below */
+      case INTERP_nsnn: /* handled below */
+      case INTERP_nsns: /* handled below */
+      case INTERP_nssn: /* handled below */
+      case INTERP_nsss: /* handled below */
+      case INTERP_snnn: /* handled below */
+      case INTERP_snns: /* handled below */
+      case INTERP_snsn: /* handled below */
+      case INTERP_snss: /* handled below */
+      case INTERP_ssnn: /* handled below */
+      case INTERP_ssns: /* handled below */
+      case INTERP_sssn: /* handled below */
+      case INTERP_ssss: susp->susp.fetch = eqbandvvv_ssss_fetch; break;
+      case INTERP_niii: /* handled below */
+      case INTERP_siii: susp->susp.fetch = eqbandvvv_siii_fetch; break;
+      case INTERP_nrrr: /* handled below */
+      case INTERP_srrr: susp->susp.fetch = eqbandvvv_srrr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    if (t0 < hz->t0) sound_prepend_zeros(hz, t0);
+    if (t0 < gain->t0) sound_prepend_zeros(gain, t0);
+    if (t0 < width->t0) sound_prepend_zeros(width, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, min(hz->t0, min(gain->t0, min(width->t0, t0))));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = eqbandvvv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = eqbandvvv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = eqbandvvv_mark;
+    susp->susp.print_tree = eqbandvvv_print_tree;
+    susp->susp.name = "eqbandvvv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    lsc = logical_stop_cnt_cvt(hz);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    lsc = logical_stop_cnt_cvt(gain);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    lsc = logical_stop_cnt_cvt(width);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    susp->hz = hz;
+    susp->hz_cnt = 0;
+    susp->hz_pHaSe = 0.0;
+    susp->hz_pHaSe_iNcR = hz->sr / sr;
+    susp->hz_n = 0;
+    susp->output_per_hz = sr / hz->sr;
+    susp->gain = gain;
+    susp->gain_cnt = 0;
+    susp->gain_pHaSe = 0.0;
+    susp->gain_pHaSe_iNcR = gain->sr / sr;
+    susp->gain_n = 0;
+    susp->output_per_gain = sr / gain->sr;
+    susp->width = width;
+    susp->width_cnt = 0;
+    susp->width_pHaSe = 0.0;
+    susp->width_pHaSe_iNcR = width->sr / sr;
+    susp->width_n = 0;
+    susp->output_per_width = sr / width->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_eqbandvvv(sound_type input, sound_type hz, sound_type gain, sound_type width)
+{
+    sound_type input_copy = sound_copy(input);
+    sound_type hz_copy = sound_copy(hz);
+    sound_type gain_copy = sound_copy(gain);
+    sound_type width_copy = sound_copy(width);
+    return snd_make_eqbandvvv(input_copy, hz_copy, gain_copy, width_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/eqbandvvv.h b/lib-src/libnyquist/nyquist/tran/eqbandvvv.h
new file mode 100644
index 0000000..a42a44f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/eqbandvvv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_eqbandvvv(sound_type input, sound_type hz, sound_type gain, sound_type width);
+sound_type snd_eqbandvvv(sound_type input, sound_type hz, sound_type gain, sound_type width);
+    /* LISP: (snd-eqbandvvv SOUND SOUND SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/exp.alg b/lib-src/libnyquist/nyquist/tran/exp.alg
new file mode 100644
index 0000000..e3f706e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/exp.alg
@@ -0,0 +1,9 @@
+(EXP-ALG
+  (NAME "exp")
+  (ARGUMENTS ("sound_type" "in"))
+  (ALWAYS-SCALE in)
+  (START (MIN in))
+  (INNER-LOOP "output = (sample_type) exp(in)")
+  (TERMINATE (MIN in))
+  (LOGICAL-STOP (MIN in))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/exp.c b/lib-src/libnyquist/nyquist/tran/exp.c
new file mode 100644
index 0000000..1cae60e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/exp.c
@@ -0,0 +1,198 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "exp.h"
+
+void exp_free();
+
+
+typedef struct exp_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type in;
+    long in_cnt;
+    sample_block_values_type in_ptr;
+} exp_susp_node, *exp_susp_type;
+
+
+void exp_s_fetch(register exp_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type in_scale_reg = susp->in->scale;
+    register sample_block_values_type in_ptr_reg;
+    falloc_sample_block(out, "exp_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the in input sample block: */
+	susp_check_term_log_samples(in, in_ptr, in_cnt);
+	togo = min(togo, susp->in_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	in_ptr_reg = susp->in_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) exp((in_scale_reg * *in_ptr_reg++));
+	} while (--n); /* inner loop */
+
+	/* using in_ptr_reg is a bad idea on RS/6000: */
+	susp->in_ptr += togo;
+	out_ptr += togo;
+	susp_took(in_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* exp_s_fetch */
+
+
+void exp_toss_fetch(susp, snd_list)
+  register exp_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from in up to final_time for this block of zeros */
+    while ((round((final_time - susp->in->t0) * susp->in->sr)) >=
+	   susp->in->current)
+	susp_get_samples(in, in_ptr, in_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->in->t0) * susp->in->sr -
+         (susp->in->current - susp->in_cnt));
+    susp->in_ptr += n;
+    susp_took(in_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void exp_mark(exp_susp_type susp)
+{
+    sound_xlmark(susp->in);
+}
+
+
+void exp_free(exp_susp_type susp)
+{
+    sound_unref(susp->in);
+    ffree_generic(susp, sizeof(exp_susp_node), "exp_free");
+}
+
+
+void exp_print_tree(exp_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("in:");
+    sound_print_tree_1(susp->in, n);
+}
+
+
+sound_type snd_make_exp(sound_type in)
+{
+    register exp_susp_type susp;
+    rate_type sr = in->sr;
+    time_type t0 = in->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, exp_susp_node, "snd_make_exp");
+    susp->susp.fetch = exp_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < in->t0) sound_prepend_zeros(in, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(in->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = exp_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = exp_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = exp_mark;
+    susp->susp.print_tree = exp_print_tree;
+    susp->susp.name = "exp";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(in);
+    susp->susp.current = 0;
+    susp->in = in;
+    susp->in_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_exp(sound_type in)
+{
+    sound_type in_copy = sound_copy(in);
+    return snd_make_exp(in_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/exp.h b/lib-src/libnyquist/nyquist/tran/exp.h
new file mode 100644
index 0000000..7e16a13
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/exp.h
@@ -0,0 +1,3 @@
+sound_type snd_make_exp(sound_type in);
+sound_type snd_exp(sound_type in);
+    /* LISP: (snd-exp SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/exprel.alg b/lib-src/libnyquist/nyquist/tran/exprel.alg
new file mode 100644
index 0000000..2e29a4b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/exprel.alg
@@ -0,0 +1,50 @@
+;; this is the beginnings of a new function that just passes input to output until
+;; a given "release time" at which point the output decays exponentially to zero.
+;; this is hard to do in Nyquist without a new primitive because the amplitude of
+;; the exponential decay depends on the value of the input at some given time.
+;; (Yes, you can evaluate that point, but then you have to compute all the samples,
+;; and they will be held in memory, which might not be a good thing.)
+
+(EXPREL-ALG
+(NAME "exprel")
+(ARGUMENTS ("sound_type" "signal") ("time_type" "release_time") ("double" "fall_time"))
+(SUPPORT-FUNCTIONS "#define ST_HOLD 0
+#define ST_FALL 1
+#define ST_FALL_UNTIL 2
+#define ST_OFF 3
+#define ST_OFF_UNTIL 4
+#define ST_RISE 5
+
+/* Overview:
+This operation passes its input to its output until the release time. Then, it takes
+the last sample output as a starting point for an exponential decay, with a duration
+of falltime.
+*/
+
+")
+(STATE 
+       ("long" "release_time" "signal->sr * release_time + 0.5")
+       ("double" "fall_time" "signal->sr * falltime + 0.5")
+       ("sample_type" "value" "0")
+       ("bool" "falling" "0"))
+(TERMINATE (MIN signal))
+(LOGICAL-STOP "release_time")
+(LINEAR signal)
+(INNER-LOOP "{
+        sample_type result;
+        if (falling) {
+            value = value * decay;
+            result = value;
+        } else {
+            result = signal;
+            if (release_time <= susp->susp.current + cnt + togo - n) {
+                value = result;
+                falling = 1;
+            }
+        }
+        output = (sample_type) value;
+      }")
+)
+
+need to do logical stop time and termination time
+ 
diff --git a/lib-src/libnyquist/nyquist/tran/fmfb.alg b/lib-src/libnyquist/nyquist/tran/fmfb.alg
new file mode 100644
index 0000000..801da05
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfb.alg
@@ -0,0 +1,26 @@
+(FMFB-ALG
+  (NAME "fmfb")
+  (ARGUMENTS ("time_type" "t0")("double" "hz") ("rate_type" "sr")("double" "index") ("time_type" "d")) 
+  (TERMINATE (AFTER "d"))
+  (STATE ("double" "yy" "0.0")
+         ("double" "sin_y" "0.0")
+         ("double" "xx" "0.0")
+         ("double" "x_incr" 
+                   "hz * SINE_TABLE_LEN / sr")
+	 ("double" "index" "index * SINE_TABLE_LEN / PI2"))
+  (INNER-LOOP "xx += x_incr;
+               if (xx > SINE_TABLE_LEN) xx -= SINE_TABLE_LEN;
+               /* xx incremented and index scaled to table index, and
+                  sin_y is a signal (-1 to +1) */
+               yy = xx + index * sin_y;
+               /* so yy is a table index */
+               while (yy > SINE_TABLE_LEN) yy -= SINE_TABLE_LEN;
+               while (yy < 0) yy += SINE_TABLE_LEN;
+               sin_y = sine_table[(int) yy]; /* truncation gets valid index */
+               /* sin_y is now a signal not ready for table lookup */
+               output = sin_y;")
+  (CONSTANT "x_incr")
+  (SAMPLE-RATE "sr")
+  (SUPPORT-HEADER "#include \"sine.h\" /* sine_table and SINE_TABLE_LEN */
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/fmfb.c b/lib-src/libnyquist/nyquist/tran/fmfb.c
new file mode 100644
index 0000000..28ce95e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfb.c
@@ -0,0 +1,139 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "fmfb.h"
+
+void fmfb_free();
+
+
+typedef struct fmfb_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    double yy;
+    double sin_y;
+    double xx;
+    double x_incr;
+    double index;
+} fmfb_susp_node, *fmfb_susp_type;
+
+
+void fmfb__fetch(register fmfb_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double yy_reg;
+    register double sin_y_reg;
+    register double xx_reg;
+    register double x_incr_reg;
+    register double index_reg;
+    falloc_sample_block(out, "fmfb__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	yy_reg = susp->yy;
+	sin_y_reg = susp->sin_y;
+	xx_reg = susp->xx;
+	x_incr_reg = susp->x_incr;
+	index_reg = susp->index;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+xx_reg += x_incr_reg;
+               if (xx_reg > SINE_TABLE_LEN) xx_reg -= SINE_TABLE_LEN;
+               /* xx_reg incremented and index_reg scaled to table index_reg, and
+                  sin_y_reg is a signal (-1 to +1) */
+               yy_reg = xx_reg + index_reg * sin_y_reg;
+               /* so yy_reg is a table index_reg */
+               while (yy_reg > SINE_TABLE_LEN) yy_reg -= SINE_TABLE_LEN;
+               while (yy_reg < 0) yy_reg += SINE_TABLE_LEN;
+               sin_y_reg = sine_table[(int) yy_reg]; /* truncation gets valid index_reg */
+               /* sin_y_reg is now a signal not ready for table lookup */
+               *out_ptr_reg++ = sin_y_reg;;
+	} while (--n); /* inner loop */
+
+	susp->yy = yy_reg;
+	susp->sin_y = sin_y_reg;
+	susp->xx = xx_reg;
+	susp->index = index_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* fmfb__fetch */
+
+
+void fmfb_free(fmfb_susp_type susp)
+{
+    ffree_generic(susp, sizeof(fmfb_susp_node), "fmfb_free");
+}
+
+
+void fmfb_print_tree(fmfb_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_fmfb(time_type t0, double hz, rate_type sr, double index, time_type d)
+{
+    register fmfb_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, fmfb_susp_node, "snd_make_fmfb");
+    susp->yy = 0.0;
+    susp->sin_y = 0.0;
+    susp->xx = 0.0;
+    susp->x_incr = hz * SINE_TABLE_LEN / sr;
+    susp->index = index * SINE_TABLE_LEN / PI2;
+    susp->susp.fetch = fmfb__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = fmfb_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = fmfb_print_tree;
+    susp->susp.name = "fmfb";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_fmfb(time_type t0, double hz, rate_type sr, double index, time_type d)
+{
+    return snd_make_fmfb(t0, hz, sr, index, d);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/fmfb.h b/lib-src/libnyquist/nyquist/tran/fmfb.h
new file mode 100644
index 0000000..7cd3a59
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfb.h
@@ -0,0 +1,4 @@
+sound_type snd_make_fmfb(time_type t0, double hz, rate_type sr, double index, time_type d);
+sound_type snd_fmfb(time_type t0, double hz, rate_type sr, double index, time_type d);
+    /* LISP: (snd-fmfb ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
+#include "sine.h" /* sine_table and SINE_TABLE_LEN */
diff --git a/lib-src/libnyquist/nyquist/tran/fmfbv.alg b/lib-src/libnyquist/nyquist/tran/fmfbv.alg
new file mode 100644
index 0000000..8034ddb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfbv.alg
@@ -0,0 +1,30 @@
+(FMFBV-ALG
+  (NAME "fmfbv")
+  (ARGUMENTS ("time_type" "t0")("double" "hz") ("rate_type" "sr")("sound_type" "index")) 
+  (START (MIN index))
+  (TERMINATE (MIN index))
+  (LOGICAL-STOP (MIN index))
+  (STEP-FUNCTION index)
+  (INLINE-INTERPOLATION T)
+  (STATE ("double" "yy" "0.0")
+         ("double" "sin_y" "0.0")
+         ("double" "phase" "0.0")
+	 ("double" "ph_incr" "hz * SINE_TABLE_LEN / sr;
+    index->scale *= SINE_TABLE_LEN / PI2
+"))
+  (INNER-LOOP "phase += ph_incr;
+               if (phase > SINE_TABLE_LEN) phase -= SINE_TABLE_LEN;
+               /* PHASE is incremented and INDEX scaled to table INDEX, and
+                  sin_y is a signal (-1 to +1) */
+               yy = phase + index * sin_y;
+               /* so yy is a table index */
+               while (yy > SINE_TABLE_LEN) yy -= SINE_TABLE_LEN;
+               while (yy < 0) yy += SINE_TABLE_LEN;
+               sin_y = sine_table[(int) yy]; /* truncation gets valid index */
+               /* sin_y is now a signal not ready for table lookup */
+               output =  sin_y;")
+  (CONSTANT "ph_incr")
+  (SAMPLE-RATE "sr")
+  (SUPPORT-HEADER "#include \"sine.h\" /* sine_table and SINE_TABLE_LEN */
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/fmfbv.c b/lib-src/libnyquist/nyquist/tran/fmfbv.c
new file mode 100644
index 0000000..e843a45
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfbv.c
@@ -0,0 +1,606 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "fmfbv.h"
+
+void fmfbv_free();
+
+
+typedef struct fmfbv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type index;
+    long index_cnt;
+    sample_block_values_type index_ptr;
+
+    /* support for interpolation of index */
+    sample_type index_x1_sample;
+    double index_pHaSe;
+    double index_pHaSe_iNcR;
+
+    /* support for ramp between samples of index */
+    double output_per_index;
+    long index_n;
+
+    double yy;
+    double sin_y;
+    double phase;
+    double ph_incr;
+} fmfbv_susp_node, *fmfbv_susp_type;
+
+
+void fmfbv_n_fetch(register fmfbv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double yy_reg;
+    register double sin_y_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    register sample_block_values_type index_ptr_reg;
+    falloc_sample_block(out, "fmfbv_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the index input sample block: */
+	susp_check_term_log_samples(index, index_ptr, index_cnt);
+	togo = min(togo, susp->index_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	yy_reg = susp->yy;
+	sin_y_reg = susp->sin_y;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	index_ptr_reg = susp->index_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+phase_reg += ph_incr_reg;
+               if (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+               /* PHASE is incremented and INDEX scaled to table INDEX, and
+                  sin_y_reg is a signal (-1 to +1) */
+               yy_reg = phase_reg + *index_ptr_reg++ * sin_y_reg;
+               /* so yy_reg is a table index */
+               while (yy_reg > SINE_TABLE_LEN) yy_reg -= SINE_TABLE_LEN;
+               while (yy_reg < 0) yy_reg += SINE_TABLE_LEN;
+               sin_y_reg = sine_table[(int) yy_reg]; /* truncation gets valid index */
+               /* sin_y_reg is now a signal not ready for table lookup */
+               *out_ptr_reg++ =  sin_y_reg;;
+	} while (--n); /* inner loop */
+
+	susp->yy = yy_reg;
+	susp->sin_y = sin_y_reg;
+	susp->phase = phase_reg;
+	/* using index_ptr_reg is a bad idea on RS/6000: */
+	susp->index_ptr += togo;
+	out_ptr += togo;
+	susp_took(index_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmfbv_n_fetch */
+
+
+void fmfbv_s_fetch(register fmfbv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double yy_reg;
+    register double sin_y_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    register sample_type index_scale_reg = susp->index->scale;
+    register sample_block_values_type index_ptr_reg;
+    falloc_sample_block(out, "fmfbv_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the index input sample block: */
+	susp_check_term_log_samples(index, index_ptr, index_cnt);
+	togo = min(togo, susp->index_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	yy_reg = susp->yy;
+	sin_y_reg = susp->sin_y;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	index_ptr_reg = susp->index_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+phase_reg += ph_incr_reg;
+               if (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+               /* PHASE is incremented and INDEX scaled to table INDEX, and
+                  sin_y_reg is a signal (-1 to +1) */
+               yy_reg = phase_reg + (index_scale_reg * *index_ptr_reg++) * sin_y_reg;
+               /* so yy_reg is a table index */
+               while (yy_reg > SINE_TABLE_LEN) yy_reg -= SINE_TABLE_LEN;
+               while (yy_reg < 0) yy_reg += SINE_TABLE_LEN;
+               sin_y_reg = sine_table[(int) yy_reg]; /* truncation gets valid index */
+               /* sin_y_reg is now a signal not ready for table lookup */
+               *out_ptr_reg++ =  sin_y_reg;;
+	} while (--n); /* inner loop */
+
+	susp->yy = yy_reg;
+	susp->sin_y = sin_y_reg;
+	susp->phase = phase_reg;
+	/* using index_ptr_reg is a bad idea on RS/6000: */
+	susp->index_ptr += togo;
+	out_ptr += togo;
+	susp_took(index_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmfbv_s_fetch */
+
+
+void fmfbv_i_fetch(register fmfbv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double yy_reg;
+    register double sin_y_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    register double index_pHaSe_iNcR_rEg = susp->index_pHaSe_iNcR;
+    register double index_pHaSe_ReG;
+    register sample_type index_x1_sample_reg;
+    falloc_sample_block(out, "fmfbv_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(index, index_ptr, index_cnt);
+	susp->index_x1_sample = susp_fetch_sample(index, index_ptr, index_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	yy_reg = susp->yy;
+	sin_y_reg = susp->sin_y;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	index_pHaSe_ReG = susp->index_pHaSe;
+	index_x1_sample_reg = susp->index_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (index_pHaSe_ReG >= 1.0) {
+/* fixup-depends index */
+		/* pick up next sample as index_x1_sample: */
+		susp->index_ptr++;
+		susp_took(index_cnt, 1);
+		index_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(index, index_ptr, index_cnt, index_x1_sample_reg);
+		index_x1_sample_reg = susp_current_sample(index, index_ptr);
+	    }
+phase_reg += ph_incr_reg;
+               if (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+               /* PHASE is incremented and INDEX scaled to table INDEX, and
+                  sin_y_reg is a signal (-1 to +1) */
+               yy_reg = phase_reg + index_x1_sample_reg * sin_y_reg;
+               /* so yy_reg is a table index */
+               while (yy_reg > SINE_TABLE_LEN) yy_reg -= SINE_TABLE_LEN;
+               while (yy_reg < 0) yy_reg += SINE_TABLE_LEN;
+               sin_y_reg = sine_table[(int) yy_reg]; /* truncation gets valid index */
+               /* sin_y_reg is now a signal not ready for table lookup */
+               *out_ptr_reg++ =  sin_y_reg;;
+	    index_pHaSe_ReG += index_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->yy = yy_reg;
+	susp->sin_y = sin_y_reg;
+	susp->phase = phase_reg;
+	susp->index_pHaSe = index_pHaSe_ReG;
+	susp->index_x1_sample = index_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmfbv_i_fetch */
+
+
+void fmfbv_r_fetch(register fmfbv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type index_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double yy_reg;
+    register double sin_y_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    falloc_sample_block(out, "fmfbv_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->index_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(index, index_ptr, index_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next index_x1_sample when phase goes past 1.0; */
+	/* use index_n (computed below) to avoid roundoff errors: */
+	if (susp->index_n <= 0) {
+	    susp_check_term_log_samples(index, index_ptr, index_cnt);
+	    susp->index_x1_sample = susp_fetch_sample(index, index_ptr, index_cnt);
+	    susp->index_pHaSe -= 1.0;
+	    /* index_n gets number of samples before phase exceeds 1.0: */
+	    susp->index_n = (long) ((1.0 - susp->index_pHaSe) *
+					susp->output_per_index);
+	}
+	togo = min(togo, susp->index_n);
+	index_val = susp->index_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	yy_reg = susp->yy;
+	sin_y_reg = susp->sin_y;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+phase_reg += ph_incr_reg;
+               if (phase_reg > SINE_TABLE_LEN) phase_reg -= SINE_TABLE_LEN;
+               /* PHASE is incremented and INDEX scaled to table INDEX, and
+                  sin_y_reg is a signal (-1 to +1) */
+               yy_reg = phase_reg + index_val * sin_y_reg;
+               /* so yy_reg is a table index */
+               while (yy_reg > SINE_TABLE_LEN) yy_reg -= SINE_TABLE_LEN;
+               while (yy_reg < 0) yy_reg += SINE_TABLE_LEN;
+               sin_y_reg = sine_table[(int) yy_reg]; /* truncation gets valid index */
+               /* sin_y_reg is now a signal not ready for table lookup */
+               *out_ptr_reg++ =  sin_y_reg;;
+	} while (--n); /* inner loop */
+
+	susp->yy = yy_reg;
+	susp->sin_y = sin_y_reg;
+	susp->phase = phase_reg;
+	out_ptr += togo;
+	susp->index_pHaSe += togo * susp->index_pHaSe_iNcR;
+	susp->index_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmfbv_r_fetch */
+
+
+void fmfbv_toss_fetch(susp, snd_list)
+  register fmfbv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from index up to final_time for this block of zeros */
+    while ((round((final_time - susp->index->t0) * susp->index->sr)) >=
+	   susp->index->current)
+	susp_get_samples(index, index_ptr, index_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->index->t0) * susp->index->sr -
+         (susp->index->current - susp->index_cnt));
+    susp->index_ptr += n;
+    susp_took(index_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void fmfbv_mark(fmfbv_susp_type susp)
+{
+    sound_xlmark(susp->index);
+}
+
+
+void fmfbv_free(fmfbv_susp_type susp)
+{
+    sound_unref(susp->index);
+    ffree_generic(susp, sizeof(fmfbv_susp_node), "fmfbv_free");
+}
+
+
+void fmfbv_print_tree(fmfbv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("index:");
+    sound_print_tree_1(susp->index, n);
+}
+
+
+sound_type snd_make_fmfbv(time_type t0, double hz, rate_type sr, sound_type index)
+{
+    register fmfbv_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, fmfbv_susp_node, "snd_make_fmfbv");
+    susp->yy = 0.0;
+    susp->sin_y = 0.0;
+    susp->phase = 0.0;
+    susp->ph_incr = hz * SINE_TABLE_LEN / sr;
+    index->scale *= SINE_TABLE_LEN / PI2
+;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(index, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = fmfbv_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = fmfbv_s_fetch; break;
+      case INTERP_i: susp->susp.fetch = fmfbv_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = fmfbv_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < index->t0) sound_prepend_zeros(index, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(index->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = fmfbv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = fmfbv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = fmfbv_mark;
+    susp->susp.print_tree = fmfbv_print_tree;
+    susp->susp.name = "fmfbv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(index);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->index = index;
+    susp->index_cnt = 0;
+    susp->index_pHaSe = 0.0;
+    susp->index_pHaSe_iNcR = index->sr / sr;
+    susp->index_n = 0;
+    susp->output_per_index = sr / index->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_fmfbv(time_type t0, double hz, rate_type sr, sound_type index)
+{
+    sound_type index_copy = sound_copy(index);
+    return snd_make_fmfbv(t0, hz, sr, index_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/fmfbv.h b/lib-src/libnyquist/nyquist/tran/fmfbv.h
new file mode 100644
index 0000000..ffb11a7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmfbv.h
@@ -0,0 +1,4 @@
+sound_type snd_make_fmfbv(time_type t0, double hz, rate_type sr, sound_type index);
+sound_type snd_fmfbv(time_type t0, double hz, rate_type sr, sound_type index);
+    /* LISP: (snd-fmfbv ANYNUM ANYNUM ANYNUM SOUND) */
+#include "sine.h" /* sine_table and SINE_TABLE_LEN */
diff --git a/lib-src/libnyquist/nyquist/tran/fmosc.alg b/lib-src/libnyquist/nyquist/tran/fmosc.alg
new file mode 100644
index 0000000..1bbbc98
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmosc.alg
@@ -0,0 +1,39 @@
+(FMOSC-ALG
+(NAME "fmosc")
+(ARGUMENTS ("sound_type" "s") ("double" "step") ("rate_type" "sr")
+           ("double" "hz") ("time_type" "t0") ("sound_type" "s_fm")
+           ("double" "phase"))
+(TABLE "s")
+(NOT-IN-INNER-LOOP "s")
+(STATE ("table_type" "the_table" "sound_to_table(s)")
+       ("double" "table_len" "susp->the_table->length")
+       ("double" "ph_incr" "0")
+       ("sample_type *" "table_ptr" "susp->the_table->samples")
+       ("double" "phase" "compute_phase(phase, step, (long) susp->table_len,
+        s->sr, sr, hz, &susp->ph_incr);
+    s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz)
+                                                   : s->sr / (sr * step_to_hz(step))") ) ; cancel 0/0
+
+(ALWAYS-SCALE s_fm)
+(INLINE-INTERPOLATION T) ; so that modulation can be low frequency
+(STEP-FUNCTION s_fm)
+(TERMINATE (MIN s_fm))
+(LOGICAL-STOP (MIN s_fm))
+(INNER-LOOP-LOCALS "	    long table_index;
+            double x1;
+")
+(INNER-LOOP "table_index = (long) phase;
+            x1 = table_ptr[table_index];
+            output = (sample_type) (x1 + (phase - table_index) * 
+                          (table_ptr[table_index + 1] - x1));
+            phase += ph_incr + s_fm;
+            while (phase > table_len) phase -= table_len;
+            /* watch out for negative frequencies! */
+            while (phase < 0) phase += table_len")
+(CONSTANT "ph_incr" "table_len" "table_ptr" "table")
+
+(SAMPLE-RATE "sr")
+(FINALIZATION "    table_unref(susp->the_table);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/fmosc.c b/lib-src/libnyquist/nyquist/tran/fmosc.c
new file mode 100644
index 0000000..cbff1be
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmosc.c
@@ -0,0 +1,494 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "fmosc.h"
+
+void fmosc_free();
+
+
+typedef struct fmosc_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s_fm;
+    long s_fm_cnt;
+    sample_block_values_type s_fm_ptr;
+
+    /* support for interpolation of s_fm */
+    sample_type s_fm_x1_sample;
+    double s_fm_pHaSe;
+    double s_fm_pHaSe_iNcR;
+
+    /* support for ramp between samples of s_fm */
+    double output_per_s_fm;
+    long s_fm_n;
+
+    table_type the_table;
+    double table_len;
+    double ph_incr;
+    sample_type *table_ptr;
+    double phase;
+} fmosc_susp_node, *fmosc_susp_type;
+
+
+void fmosc_s_fetch(register fmosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_ptr_reg;
+    register double phase_reg;
+    register sample_type s_fm_scale_reg = susp->s_fm->scale;
+    register sample_block_values_type s_fm_ptr_reg;
+    falloc_sample_block(out, "fmosc_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s_fm input sample block: */
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	togo = min(togo, susp->s_fm_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_ptr_reg = susp->table_ptr;
+	phase_reg = susp->phase;
+	s_fm_ptr_reg = susp->s_fm_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + (s_fm_scale_reg * *s_fm_ptr_reg++);
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	/* using s_fm_ptr_reg is a bad idea on RS/6000: */
+	susp->s_fm_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_fm_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmosc_s_fetch */
+
+
+void fmosc_i_fetch(register fmosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_ptr_reg;
+    register double phase_reg;
+    register double s_fm_pHaSe_iNcR_rEg = susp->s_fm_pHaSe_iNcR;
+    register double s_fm_pHaSe_ReG;
+    register sample_type s_fm_x1_sample_reg;
+    falloc_sample_block(out, "fmosc_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_ptr_reg = susp->table_ptr;
+	phase_reg = susp->phase;
+	s_fm_pHaSe_ReG = susp->s_fm_pHaSe;
+	s_fm_x1_sample_reg = susp->s_fm_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+	    if (s_fm_pHaSe_ReG >= 1.0) {
+/* fixup-depends s_fm */
+		/* pick up next sample as s_fm_x1_sample: */
+		susp->s_fm_ptr++;
+		susp_took(s_fm_cnt, 1);
+		s_fm_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(s_fm, s_fm_ptr, s_fm_cnt, s_fm_x1_sample_reg);
+		s_fm_x1_sample_reg = susp_current_sample(s_fm, s_fm_ptr);
+	    }
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + s_fm_x1_sample_reg;
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	    s_fm_pHaSe_ReG += s_fm_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->phase = phase_reg;
+	susp->s_fm_pHaSe = s_fm_pHaSe_ReG;
+	susp->s_fm_x1_sample = s_fm_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmosc_i_fetch */
+
+
+void fmosc_r_fetch(register fmosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type s_fm_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_ptr_reg;
+    register double phase_reg;
+    falloc_sample_block(out, "fmosc_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->s_fm_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next s_fm_x1_sample when phase goes past 1.0; */
+	/* use s_fm_n (computed below) to avoid roundoff errors: */
+	if (susp->s_fm_n <= 0) {
+	    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_pHaSe -= 1.0;
+	    /* s_fm_n gets number of samples before phase exceeds 1.0: */
+	    susp->s_fm_n = (long) ((1.0 - susp->s_fm_pHaSe) *
+					susp->output_per_s_fm);
+	}
+	togo = min(togo, susp->s_fm_n);
+	s_fm_val = susp->s_fm_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_ptr_reg = susp->table_ptr;
+	phase_reg = susp->phase;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + s_fm_val;
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	out_ptr += togo;
+	susp->s_fm_pHaSe += togo * susp->s_fm_pHaSe_iNcR;
+	susp->s_fm_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* fmosc_r_fetch */
+
+
+void fmosc_toss_fetch(susp, snd_list)
+  register fmosc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s_fm up to final_time for this block of zeros */
+    while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >=
+	   susp->s_fm->current)
+	susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr -
+         (susp->s_fm->current - susp->s_fm_cnt));
+    susp->s_fm_ptr += n;
+    susp_took(s_fm_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void fmosc_mark(fmosc_susp_type susp)
+{
+    sound_xlmark(susp->s_fm);
+}
+
+
+void fmosc_free(fmosc_susp_type susp)
+{
+    table_unref(susp->the_table);
+    sound_unref(susp->s_fm);
+    ffree_generic(susp, sizeof(fmosc_susp_node), "fmosc_free");
+}
+
+
+void fmosc_print_tree(fmosc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s_fm:");
+    sound_print_tree_1(susp->s_fm, n);
+}
+
+
+sound_type snd_make_fmosc(sound_type s, double step, rate_type sr, double hz, time_type t0, sound_type s_fm, double phase)
+{
+    register fmosc_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, fmosc_susp_node, "snd_make_fmosc");
+    susp->the_table = sound_to_table(s);
+    susp->table_len = susp->the_table->length;
+    susp->ph_incr = 0;
+    susp->table_ptr = susp->the_table->samples;
+    susp->phase = compute_phase(phase, step, (long) susp->table_len,
+        s->sr, sr, hz, &susp->ph_incr);
+    s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz)
+                                                   : s->sr / (sr * step_to_hz(step));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s_fm, sr);
+    switch (interp_desc) {
+      case INTERP_n: /* handled below */
+      case INTERP_s: susp->susp.fetch = fmosc_s_fetch; break;
+      case INTERP_i: susp->susp.fetch = fmosc_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = fmosc_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s_fm->t0) sound_prepend_zeros(s_fm, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s_fm->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = fmosc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = fmosc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = fmosc_mark;
+    susp->susp.print_tree = fmosc_print_tree;
+    susp->susp.name = "fmosc";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s_fm);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s_fm = s_fm;
+    susp->s_fm_cnt = 0;
+    susp->s_fm_pHaSe = 0.0;
+    susp->s_fm_pHaSe_iNcR = s_fm->sr / sr;
+    susp->s_fm_n = 0;
+    susp->output_per_s_fm = sr / s_fm->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_fmosc(sound_type s, double step, rate_type sr, double hz, time_type t0, sound_type s_fm, double phase)
+{
+    sound_type s_fm_copy = sound_copy(s_fm);
+    return snd_make_fmosc(s, step, sr, hz, t0, s_fm_copy, phase);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/fmosc.h b/lib-src/libnyquist/nyquist/tran/fmosc.h
new file mode 100644
index 0000000..c3724de
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fmosc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_fmosc(sound_type s, double step, rate_type sr, double hz, time_type t0, sound_type s_fm, double phase);
+sound_type snd_fmosc(sound_type s, double step, rate_type sr, double hz, time_type t0, sound_type s_fm, double phase);
+    /* LISP: (snd-fmosc SOUND ANYNUM ANYNUM ANYNUM ANYNUM SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/follow.alg b/lib-src/libnyquist/nyquist/tran/follow.alg
new file mode 100644
index 0000000..9765897
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/follow.alg
@@ -0,0 +1,106 @@
+(FOLLOW-ALG
+(NAME "follow")
+(SUPPORT-FUNCTIONS 
+"/* Description: this is a sophisticated envelope follower.
+    The input is an envelope, e.g. something produced with
+    the AVG function. The purpose of this function is to
+    generate a smooth envelope that is generally not less
+    than the input signal. In other words, we want to \"ride\"
+    the peaks of the signal with a smooth function. The 
+    algorithm is as follows: keep a current output value
+    (called the \"value\"). The value is allowed to increase
+    by at most rise_factor and decrease by at most fall_factor.
+    Therefore, the next value should be between
+    value * rise_factor and value * fall_factor. If the input
+    is in this range, then the next value is simply the input.
+    If the input is less than value * fall_factor, then the
+    next value is just value * fall_factor, which will be greater
+    than the input signal. If the input is greater than value *
+    rise_factor, then we compute a rising envelope that meets
+    the input value by working bacwards in time, changing the
+    previous values to input / rise_factor, input / rise_factor^2,
+    input / rise_factor^3, etc. until this new envelope intersects
+    the previously computed values. There is only a limited buffer
+    in which we can work backwards, so if the new envelope does not
+    intersect the old one, then make yet another pass, this time
+    from the oldest buffered value forward, increasing on each 
+    sample by rise_factor to produce a maximal envelope. This will 
+    still be less than the input.
+    
+    The value has a lower limit of floor to make sure value has a 
+    reasonable positive value from which to begin an attack.
+    
+    Because this algorithm can make 2 passes through the buffer on
+    sharply rising input signals, it is not particularly fast. The
+    assumption is that it operates on fairly short buffers at low
+    sample rates appropriate for gain control, so this should not
+    matter.
+    */
+
+static sample_type *create_buf(double floor, long lookahead)
+{
+    sample_type *buf = (sample_type *) malloc(lookahead * sizeof(sample_type));
+    int i;
+    
+    for (i = 0; i < lookahead; i++) buf[i] = (sample_type) floor;
+    return buf;
+}
+")
+(ARGUMENTS ("sound_type" "sndin") ("double" "floor") ("double" "risetime") 
+                   ("double" "falltime") ("long" "lookahead"))
+(START (MIN sndin))
+(STATE ("long" "lookahead" "lookahead = lookahead + 1")
+       ("sample_type *" "delaybuf" "create_buf(floor, lookahead)")
+       ("sample_type *" "delayptr" "susp->delaybuf")
+       ("sample_type *" "prevptr" "susp->delaybuf + lookahead - 1;
+    *(susp->prevptr) = (sample_type) floor;")
+       ("sample_type *" "endptr" "susp->delaybuf + lookahead")
+           ("double" "floor" "floor; floor = log(floor);")
+           ("double" "rise_factor" "exp(- floor / (sndin->sr * risetime + 0.5))")
+           ("double" "fall_factor" "exp(floor / (sndin->sr * falltime + 0.5))")
+       ("double" "value" "susp->floor"))
+(CONSTANT "feedback" "rise_factor" "fall_factor" "endptr")
+(NOT-REGISTER delaybuf)
+(ALWAYS-SCALE sndin)
+(TERMINATE (MIN sndin))
+(INNER-LOOP "            sample_type current = sndin;
+            sample_type high = (sample_type) (*prevptr * rise_factor);
+            sample_type low = (sample_type) (*prevptr * fall_factor);
+            if (low < floor) low = (sample_type) floor;
+            if (current < low) *delayptr = (sample_type) low;
+            else if (current < high) *delayptr = current;
+            else /* current > high */ {
+                /* work back from current */
+                double rise_inverse = 1.0 / rise_factor;
+                double temp = current * rise_inverse;
+                boolean ok = false;
+                sample_type *ptr = prevptr;
+                int i;
+                               
+                for (i = 0; i < lookahead - 2; i++) {
+                    if (*ptr < temp) {
+                    *ptr-- = (sample_type) temp;
+                    temp *= rise_inverse;
+                    if (ptr < susp->delaybuf)
+                        ptr = endptr - 1;
+                    } else {
+                        ok = true;
+                        break;
+                    }
+                }
+                if (!ok && (*ptr < temp)) {
+                    temp = *ptr;
+                    for (i = 0; i < lookahead - 1; i++) {
+                        ptr++;
+                        if (ptr == endptr) ptr = susp->delaybuf;
+                        temp *= rise_factor;
+                        *ptr = (sample_type) temp;
+                    }
+                } else *delayptr = current;
+            }
+            prevptr = delayptr++;
+            if (delayptr == endptr) delayptr = susp->delaybuf;
+            output = *delayptr;")
+(FINALIZATION "free(susp->delaybuf);")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/follow.c b/lib-src/libnyquist/nyquist/tran/follow.c
new file mode 100644
index 0000000..695c4b6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/follow.c
@@ -0,0 +1,286 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "follow.h"
+
+void follow_free();
+
+
+typedef struct follow_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type sndin;
+    long sndin_cnt;
+    sample_block_values_type sndin_ptr;
+
+    long lookahead;
+    sample_type *delaybuf;
+    sample_type *delayptr;
+    sample_type *prevptr;
+    sample_type *endptr;
+    double floor;
+    double rise_factor;
+    double fall_factor;
+    double value;
+} follow_susp_node, *follow_susp_type;
+
+/* Description: this is a sophisticated envelope follower.
+    The input is an envelope, e.g. something produced with
+    the AVG function. The purpose of this function is to
+    generate a smooth envelope that is generally not less
+    than the input signal. In other words, we want to "ride"
+    the peaks of the signal with a smooth function. The 
+    algorithm is as follows: keep a current output value
+    (called the "value"). The value is allowed to increase
+    by at most rise_factor and decrease by at most fall_factor.
+    Therefore, the next value should be between
+    value * rise_factor and value * fall_factor. If the input
+    is in this range, then the next value is simply the input.
+    If the input is less than value * fall_factor, then the
+    next value is just value * fall_factor, which will be greater
+    than the input signal. If the input is greater than value *
+    rise_factor, then we compute a rising envelope that meets
+    the input value by working bacwards in time, changing the
+    previous values to input / rise_factor, input / rise_factor^2,
+    input / rise_factor^3, etc. until this new envelope intersects
+    the previously computed values. There is only a limited buffer
+    in which we can work backwards, so if the new envelope does not
+    intersect the old one, then make yet another pass, this time
+    from the oldest buffered value forward, increasing on each 
+    sample by rise_factor to produce a maximal envelope. This will 
+    still be less than the input.
+    
+    The value has a lower limit of floor to make sure value has a 
+    reasonable positive value from which to begin an attack.
+    
+    Because this algorithm can make 2 passes through the buffer on
+    sharply rising input signals, it is not particularly fast. The
+    assumption is that it operates on fairly short buffers at low
+    sample rates appropriate for gain control, so this should not
+    matter.
+    */
+
+static sample_type *create_buf(double floor, long lookahead)
+{
+    sample_type *buf = (sample_type *) malloc(lookahead * sizeof(sample_type));
+    int i;
+    
+    for (i = 0; i < lookahead; i++) buf[i] = (sample_type) floor;
+    return buf;
+}
+
+
+void follow_s_fetch(register follow_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long lookahead_reg;
+    register sample_type * delayptr_reg;
+    register sample_type * prevptr_reg;
+    register sample_type * endptr_reg;
+    register double floor_reg;
+    register double rise_factor_reg;
+    register double fall_factor_reg;
+    register sample_type sndin_scale_reg = susp->sndin->scale;
+    register sample_block_values_type sndin_ptr_reg;
+    falloc_sample_block(out, "follow_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the sndin input sample block: */
+	susp_check_term_samples(sndin, sndin_ptr, sndin_cnt);
+	togo = min(togo, susp->sndin_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	lookahead_reg = susp->lookahead;
+	delayptr_reg = susp->delayptr;
+	prevptr_reg = susp->prevptr;
+	endptr_reg = susp->endptr;
+	floor_reg = susp->floor;
+	rise_factor_reg = susp->rise_factor;
+	fall_factor_reg = susp->fall_factor;
+	sndin_ptr_reg = susp->sndin_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            sample_type current = (sndin_scale_reg * *sndin_ptr_reg++);
+            sample_type high = (sample_type) (*prevptr_reg * rise_factor_reg);
+            sample_type low = (sample_type) (*prevptr_reg * fall_factor_reg);
+            if (low < floor_reg) low = (sample_type) floor_reg;
+            if (current < low) *delayptr_reg = (sample_type) low;
+            else if (current < high) *delayptr_reg = current;
+            else /* current > high */ {
+                /* work back from current */
+                double rise_inverse = 1.0 / rise_factor_reg;
+                double temp = current * rise_inverse;
+                boolean ok = false;
+                sample_type *ptr = prevptr_reg;
+                int i;
+                               
+                for (i = 0; i < lookahead_reg - 2; i++) {
+                    if (*ptr < temp) {
+                    *ptr-- = (sample_type) temp;
+                    temp *= rise_inverse;
+                    if (ptr < susp->delaybuf)
+                        ptr = endptr_reg - 1;
+                    } else {
+                        ok = true;
+                        break;
+                    }
+                }
+                if (!ok && (*ptr < temp)) {
+                    temp = *ptr;
+                    for (i = 0; i < lookahead_reg - 1; i++) {
+                        ptr++;
+                        if (ptr == endptr_reg) ptr = susp->delaybuf;
+                        temp *= rise_factor_reg;
+                        *ptr = (sample_type) temp;
+                    }
+                } else *delayptr_reg = current;
+            }
+            prevptr_reg = delayptr_reg++;
+            if (delayptr_reg == endptr_reg) delayptr_reg = susp->delaybuf;
+            *out_ptr_reg++ = *delayptr_reg;;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->lookahead = lookahead_reg;
+	susp->delayptr = delayptr_reg;
+	susp->prevptr = prevptr_reg;
+	susp->floor = floor_reg;
+	/* using sndin_ptr_reg is a bad idea on RS/6000: */
+	susp->sndin_ptr += togo;
+	out_ptr += togo;
+	susp_took(sndin_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* follow_s_fetch */
+
+
+void follow_toss_fetch(susp, snd_list)
+  register follow_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from sndin up to final_time for this block of zeros */
+    while ((round((final_time - susp->sndin->t0) * susp->sndin->sr)) >=
+	   susp->sndin->current)
+	susp_get_samples(sndin, sndin_ptr, sndin_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->sndin->t0) * susp->sndin->sr -
+         (susp->sndin->current - susp->sndin_cnt));
+    susp->sndin_ptr += n;
+    susp_took(sndin_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void follow_mark(follow_susp_type susp)
+{
+    sound_xlmark(susp->sndin);
+}
+
+
+void follow_free(follow_susp_type susp)
+{
+free(susp->delaybuf);    sound_unref(susp->sndin);
+    ffree_generic(susp, sizeof(follow_susp_node), "follow_free");
+}
+
+
+void follow_print_tree(follow_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("sndin:");
+    sound_print_tree_1(susp->sndin, n);
+}
+
+
+sound_type snd_make_follow(sound_type sndin, double floor, double risetime, double falltime, long lookahead)
+{
+    register follow_susp_type susp;
+    rate_type sr = sndin->sr;
+    time_type t0 = sndin->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, follow_susp_node, "snd_make_follow");
+    susp->lookahead = lookahead = lookahead + 1;
+    susp->delaybuf = create_buf(floor, lookahead);
+    susp->delayptr = susp->delaybuf;
+    susp->prevptr = susp->delaybuf + lookahead - 1;
+    *(susp->prevptr) = (sample_type) floor;;
+    susp->endptr = susp->delaybuf + lookahead;
+    susp->floor = floor; floor = log(floor);;
+    susp->rise_factor = exp(- floor / (sndin->sr * risetime + 0.5));
+    susp->fall_factor = exp(floor / (sndin->sr * falltime + 0.5));
+    susp->value = susp->floor;
+    susp->susp.fetch = follow_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < sndin->t0) sound_prepend_zeros(sndin, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(sndin->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = follow_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = follow_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = follow_mark;
+    susp->susp.print_tree = follow_print_tree;
+    susp->susp.name = "follow";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->sndin = sndin;
+    susp->sndin_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_follow(sound_type sndin, double floor, double risetime, double falltime, long lookahead)
+{
+    sound_type sndin_copy = sound_copy(sndin);
+    return snd_make_follow(sndin_copy, floor, risetime, falltime, lookahead);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/follow.h b/lib-src/libnyquist/nyquist/tran/follow.h
new file mode 100644
index 0000000..6dbc3bb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/follow.h
@@ -0,0 +1,3 @@
+sound_type snd_make_follow(sound_type sndin, double floor, double risetime, double falltime, long lookahead);
+sound_type snd_follow(sound_type sndin, double floor, double risetime, double falltime, long lookahead);
+    /* LISP: (snd-follow SOUND ANYNUM ANYNUM ANYNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/fromarraystream.alg b/lib-src/libnyquist/nyquist/tran/fromarraystream.alg
new file mode 100644
index 0000000..4ae2254
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromarraystream.alg
@@ -0,0 +1,82 @@
+(FRMASTRM-ALG
+  (NAME "fromarraystream")
+  (ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("LVAL" "src"))
+  (SUPPORT-FUNCTIONS "
+/* IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either an
+ * array of samples or NIL. The output of ifft is simply the
+ * concatenation of the samples taken from the array. Later,
+ * an ifft will be plugged in and this will return overlapped
+ * adds of the ifft's.
+ */
+
+#include \"samples.h\"
+")
+
+  (SAMPLE-RATE "sr")
+  (STATE
+          ("long" "index" "0") ; samples index
+          ("long" "length" "0"); samples length
+          ("LVAL" "array" "NULL")
+        ("LVAL" "src" "src")
+        ("sample_type *" "samples" "NULL;"))
+  
+  (OUTER-LOOP "
+        if (susp->src == NULL) {
+out:	    togo = 0;	/* indicate termination */
+            break;	/* we're done */
+        }
+        if (susp->index >= susp->length) {
+            long i;
+            susp->index = 0;
+            susp->array = xleval(cons(s_send, cons(susp->src, consa(s_next))));
+            susp->index = 0;
+            if (susp->array == NULL) {
+                susp->src = NULL;
+                goto out;
+            } else if (!vectorp(susp->array)) {
+                xlerror(\"array expected\", susp->array);
+            } else if (susp->samples == NULL) {
+                /* assume arrays are all the same size as first one;
+                   now that we know the size, we just have to do this
+                   first allocation.
+                 */
+                susp->length = getsize(susp->array);
+                if (susp->length < 1) xlerror(\"array has no elements\", susp->array);
+                susp->samples = 
+                    (sample_type *) calloc(susp->length,
+                                           sizeof(sample_type));
+            } else if (getsize(susp->array) != susp->length) {
+                xlerror(\"arrays must all be the same length\", susp->array);
+            }
+            /* at this point, we have a new array and a place to put samples */
+            for (i = 0; i < susp->length; i++) {
+                LVAL elem = getelement(susp->array, i);
+                if (ntype(elem) != FLONUM) {
+                    xlerror(\"flonum expected\", elem);
+                }
+                susp->samples[i] = (sample_type) getflonum(elem);
+            }
+            susp->array = NULL; /* free the array */
+        }
+        togo = min(togo, susp->length - susp->index);
+")
+  (INNER-LOOP "output = samples[index++];")
+  (CONSTANT "length" "samples" "array" "src")
+  (TERMINATE COMPUTED)
+  (FINALIZATION "    free(susp->samples);
+")
+
+)
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib-src/libnyquist/nyquist/tran/fromarraystream.c b/lib-src/libnyquist/nyquist/tran/fromarraystream.c
new file mode 100644
index 0000000..7df0a9b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromarraystream.c
@@ -0,0 +1,170 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "fromarraystream.h"
+
+void fromarraystream_free();
+
+
+typedef struct fromarraystream_susp_struct {
+    snd_susp_node susp;
+
+    long index;
+    long length;
+    LVAL array;
+    LVAL src;
+    sample_type *samples;
+} fromarraystream_susp_node, *fromarraystream_susp_type;
+
+
+/* IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either an
+ * array of samples or NIL. The output of ifft is simply the
+ * concatenation of the samples taken from the array. Later,
+ * an ifft will be plugged in and this will return overlapped
+ * adds of the ifft's.
+ */
+
+#include "samples.h"
+
+
+void fromarraystream__fetch(register fromarraystream_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long index_reg;
+    register sample_type * samples_reg;
+    falloc_sample_block(out, "fromarraystream__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+
+        if (susp->src == NULL) {
+out:	    togo = 0;	/* indicate termination */
+            break;	/* we're done */
+        }
+        if (susp->index >= susp->length) {
+            long i;
+            susp->index = 0;
+            susp->array = xleval(cons(s_send, cons(susp->src, consa(s_next))));
+            susp->index = 0;
+            if (susp->array == NULL) {
+                susp->src = NULL;
+                goto out;
+            } else if (!vectorp(susp->array)) {
+                xlerror("array expected", susp->array);
+            } else if (susp->samples == NULL) {
+                /* assume arrays are all the same size as first one;
+                   now that we know the size, we just have to do this
+                   first allocation.
+                 */
+                susp->length = getsize(susp->array);
+                if (susp->length < 1) xlerror("array has no elements", susp->array);
+                susp->samples = 
+                    (sample_type *) calloc(susp->length,
+                                           sizeof(sample_type));
+            } else if (getsize(susp->array) != susp->length) {
+                xlerror("arrays must all be the same length", susp->array);
+            }
+            /* at this point, we have a new array and a place to put samples */
+            for (i = 0; i < susp->length; i++) {
+                LVAL elem = getelement(susp->array, i);
+                if (ntype(elem) != FLONUM) {
+                    xlerror("flonum expected", elem);
+                }
+                susp->samples[i] = (sample_type) getflonum(elem);
+            }
+            susp->array = NULL; /* free the array */
+        }
+        togo = min(togo, susp->length - susp->index);
+
+	n = togo;
+	index_reg = susp->index;
+	samples_reg = susp->samples;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = samples_reg[index_reg++];;
+	} while (--n); /* inner loop */
+
+	susp->index = index_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* fromarraystream__fetch */
+
+
+void fromarraystream_mark(fromarraystream_susp_type susp)
+{
+    if (susp->src) mark(susp->src);
+    if (susp->array) mark(susp->array);
+}
+
+
+void fromarraystream_free(fromarraystream_susp_type susp)
+{
+    free(susp->samples);
+    ffree_generic(susp, sizeof(fromarraystream_susp_node), "fromarraystream_free");
+}
+
+
+void fromarraystream_print_tree(fromarraystream_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_fromarraystream(time_type t0, rate_type sr, LVAL src)
+{
+    register fromarraystream_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, fromarraystream_susp_node, "snd_make_fromarraystream");
+    susp->index = 0;
+    susp->length = 0;
+    susp->array = NULL;
+    susp->src = src;
+    susp->samples = NULL;;
+    susp->susp.fetch = fromarraystream__fetch;
+
+    /* initialize susp state */
+    susp->susp.free = fromarraystream_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = fromarraystream_mark;
+    susp->susp.print_tree = fromarraystream_print_tree;
+    susp->susp.name = "fromarraystream";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_fromarraystream(time_type t0, rate_type sr, LVAL src)
+{
+    return snd_make_fromarraystream(t0, sr, src);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/fromarraystream.h b/lib-src/libnyquist/nyquist/tran/fromarraystream.h
new file mode 100644
index 0000000..51a5a60
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromarraystream.h
@@ -0,0 +1,3 @@
+sound_type snd_make_fromarraystream(time_type t0, rate_type sr, LVAL src);
+sound_type snd_fromarraystream(time_type t0, rate_type sr, LVAL src);
+    /* LISP: (snd-fromarraystream ANYNUM ANYNUM ANY) */
diff --git a/lib-src/libnyquist/nyquist/tran/fromobject.alg b/lib-src/libnyquist/nyquist/tran/fromobject.alg
new file mode 100644
index 0000000..f119a7f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromobject.alg
@@ -0,0 +1,37 @@
+(FROMOBJ-ALG
+  (NAME "fromobject")
+  (ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("LVAL" "src"))
+  (SUPPORT-FUNCTIONS "
+/* IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either a
+ *  FLONUM sample or NIL. The output of fromobj is simply the
+ * sequence of the samples. 
+ */
+
+#include \"samples.h\"
+")
+
+  (SAMPLE-RATE "sr")
+  (STATE
+        ("boolean" "done" "false")
+        ("LVAL" "src" "src"))
+  
+  (OUTER-LOOP "        if (susp->done) {
+            togo = 0; /* indicate termination */
+            break;    /* we're done */
+        }
+")
+  (INNER-LOOP 
+"            LVAL rslt = xleval(cons(s_send, cons(src,
+                                                 consa(s_next))));
+            if (floatp(rslt)) {
+                output = (sample_type) getflonum(rslt);
+            } else {
+                done = true;
+                /* adjust togo to what it should have been */
+                break;
+            }")
+  (CONSTANT "length" "samples" "array" "src")
+  (TERMINATE COMPUTED)
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/fromobject.c b/lib-src/libnyquist/nyquist/tran/fromobject.c
new file mode 100644
index 0000000..f744a9d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromobject.c
@@ -0,0 +1,134 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "fromobject.h"
+
+void fromobject_free();
+
+
+typedef struct fromobject_susp_struct {
+    snd_susp_node susp;
+
+    boolean done;
+    LVAL src;
+} fromobject_susp_node, *fromobject_susp_type;
+
+
+/* IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either a
+ *  FLONUM sample or NIL. The output of fromobj is simply the
+ * sequence of the samples. 
+ */
+
+#include "samples.h"
+
+
+void fromobject__fetch(register fromobject_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register boolean done_reg;
+    register LVAL src_reg;
+    falloc_sample_block(out, "fromobject__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+        if (susp->done) {
+            togo = 0; /* indicate termination */
+            break;    /* we're done */
+        }
+
+	n = togo;
+	done_reg = susp->done;
+	src_reg = susp->src;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            LVAL rslt = xleval(cons(s_send, cons(src_reg,
+                                                 consa(s_next))));
+            if (floatp(rslt)) {
+                *out_ptr_reg++ = (sample_type) getflonum(rslt);
+            } else {
+                done_reg = true;
+                /* adjust togo to what it should have been */
+                break;
+            };
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->done = done_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* fromobject__fetch */
+
+
+void fromobject_mark(fromobject_susp_type susp)
+{
+    if (susp->src) mark(susp->src);
+}
+
+
+void fromobject_free(fromobject_susp_type susp)
+{
+    ffree_generic(susp, sizeof(fromobject_susp_node), "fromobject_free");
+}
+
+
+void fromobject_print_tree(fromobject_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_fromobject(time_type t0, rate_type sr, LVAL src)
+{
+    register fromobject_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, fromobject_susp_node, "snd_make_fromobject");
+    susp->done = false;
+    susp->src = src;
+    susp->susp.fetch = fromobject__fetch;
+
+    /* initialize susp state */
+    susp->susp.free = fromobject_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = fromobject_mark;
+    susp->susp.print_tree = fromobject_print_tree;
+    susp->susp.name = "fromobject";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_fromobject(time_type t0, rate_type sr, LVAL src)
+{
+    return snd_make_fromobject(t0, sr, src);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/fromobject.h b/lib-src/libnyquist/nyquist/tran/fromobject.h
new file mode 100644
index 0000000..b8d560d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/fromobject.h
@@ -0,0 +1,3 @@
+sound_type snd_make_fromobject(time_type t0, rate_type sr, LVAL src);
+sound_type snd_fromobject(time_type t0, rate_type sr, LVAL src);
+    /* LISP: (snd-fromobject ANYNUM ANYNUM ANY) */
diff --git a/lib-src/libnyquist/nyquist/tran/gate.alg b/lib-src/libnyquist/nyquist/tran/gate.alg
new file mode 100644
index 0000000..eb3e0a4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/gate.alg
@@ -0,0 +1,166 @@
+(GATE-ALG
+(NAME "gate")
+(ARGUMENTS ("sound_type" "signal") ("time_type" "lookahead") ("double" "risetime")
+           ("double" "falltime") ("double" "floor") ("double" "threshold"))
+(START (MIN signal))
+(SUPPORT-FUNCTIONS "#define ST_HOLD 0
+#define ST_FALL 1
+#define ST_FALL_UNTIL 2
+#define ST_OFF 3
+#define ST_OFF_UNTIL 4
+#define ST_RISE 5
+
+/* Overview:
+This operation generates an exponential rise and decay suitable for implementing a 
+noise gate. The decay starts when the signal drops below threshold and stays there
+for longer than lookahead. 
+Decay continues until the value reaches floor, at which point the decay stops
+and the value is held constant. Either during the decay or after the floor is reached,
+if the signal goes above threshold, then the output value will rise to 1.0 (0dB) at
+the point the signal crosses the threshold. Again, lookahead is used, so the rise
+actually starts before the signal crosses the threshold. The rise rate is constant
+and set so that a rise from floor to 0dB occurs in the specified risetime.  Similarly,
+the fall rate is constant such that a fall from 0dB to the floor takes falltime.
+
+Rather than looking ahead, the output actually lags the input by lookahead. The caller
+should advance the time of the input signal in order to get a correct output signal,
+and this will be taken care of in Lisp code.
+
+The implementation is a finite-state machine that simultaneously computes the value
+and scans ahead for threshold crossings. Time points, remembered as sample counts are
+saved in variables:
+    on_count -- the time at which the rise should complete
+    off_count -- the time at which the fall should begin
+    rise_factor -- multiply by this to get exponential rise
+    fall_factor -- multiply by this to get exponential fall
+    rise_time -- number of samples for a full rise
+    fall_time -- number of samples for a full fall
+    floor -- the lowest value to output
+    threshold -- compare the signal s to this value
+    start_rise -- the sample count at which a rise begins
+    delay_len -- number of samples to look ahead, length of buffer
+    state -- the current state of finite state machine
+        (see the individual 'case' statements for description of states)
+    value -- the current output value
+    
+computing fall_factor:
+    factor ^ (sample_rate * time) == floor
+    log(factor) * sample_rate * time == log(floor)
+    log(factor) == log(floor) / (sample_rate * time)
+    factor == exp(log(floor) / (sample_rate * time))
+    
+*/
+
+void compute_start_rise(gate_susp_type susp)
+{
+    /* to compute when to start rise to achieve 0dB at on_count:
+    By similar triangles:
+        truncated rise time    truncated fall time
+        ------------------- == -------------------
+            full rise time         full fall time
+    when you enter ST_FALL, set start_fall = now
+    then if (on_count - start_fall) < (rise_time + fall_time)
+    then start rise at
+    on_time - rise_time * (on_count-start_fall)/(rise_time+fall_time)
+    */
+    long total = (long) (susp->rise_time + susp->fall_time);
+    if ((susp->on_count - susp->start_fall) < total) {
+        susp->start_rise = (long) (susp->on_count - 
+            (susp->rise_time * susp->on_count - susp->start_fall) / total);
+    } else susp->start_rise = (long) (susp->on_count - susp->rise_time);
+}
+")
+(STATE 
+       ("double" "rise_time" "signal->sr * risetime + 0.5")
+       ("double" "fall_time" "signal->sr * falltime + 0.5")
+       ("double" "floor" "floor; floor = log(floor);")
+       ("double" "threshold" "threshold")
+       ("long" "on_count" "0")
+       ("long" "off_count" "0")
+       ("double" "rise_factor" "exp(- floor / susp->rise_time)")
+       ("double" "fall_factor" "exp(floor / susp->fall_time)")
+       ("long" "start_fall" "0")
+       ("long" "start_rise" "0")
+       ("long" "stop_count" "0")
+       ("long" "delay_len" "max(1, round(signal->sr * lookahead))")
+       ("int" "state" "ST_OFF")
+       ("double" "value" "susp->floor"))
+
+(CONSTANT "lookahead" "rise_time" "fall_time" "floor" "threshold" "delay_len" "end_ptr"
+    "rise_factor" "fall_factor")
+(NOT-REGISTER delay_buf rise_factor fall_factor rise_time fall_time floor 
+              on_count start_fall start_rise)
+(LINEAR signal)
+(TERMINATE (MIN signal))
+(INNER-LOOP "{
+        sample_type future = signal;
+        long now = susp->susp.current + cnt + togo - n;
+        
+        switch (state) {
+          /* hold at 1.0 and look for the moment to begin fall: */
+          case ST_HOLD:
+              if (future >= threshold) {
+                  off_count = now + delay_len;
+              } else if (now >= off_count) {
+                  state = ST_FALL;
+                  stop_count = (long) (now + susp->fall_time);
+                  susp->start_fall = now;
+              }
+              break;
+          /* fall until stop_count while looking for next rise time */
+          case ST_FALL:
+            if (future >= threshold) {
+                off_count = susp->on_count = now + delay_len;
+                compute_start_rise(susp);
+                state = ST_FALL_UNTIL;
+            } else if (now == stop_count) {
+                state = ST_OFF;
+                value = susp->floor;
+            } else value *= susp->fall_factor;
+            break;
+          /* fall until start_rise while looking for next fall time */
+          case ST_FALL_UNTIL:
+            value *= susp->fall_factor;
+            if (future >= threshold) {
+                   off_count = now + delay_len;
+               }
+               if (now >= susp->start_rise) {
+                   state = ST_RISE;
+               } else if (now >= stop_count) {
+                   state = ST_OFF_UNTIL;
+                   value = susp->floor;
+               }
+               break;
+          /* hold at floor (minimum value) and look for next rise time */
+          case ST_OFF:
+            if (future >= threshold) {
+                off_count = susp->on_count = now + delay_len;
+                compute_start_rise(susp);
+                state = ST_OFF_UNTIL;
+            }
+            break;
+          /* hold at floor until start_rise while looking for next fall time */
+          case ST_OFF_UNTIL:
+              if (future >= threshold) {
+                  off_count = now + delay_len;
+              }
+              if (now >= susp->start_rise) {
+                  state = ST_RISE;
+              }
+              break;
+          /* rise while looking for fall time */
+          case ST_RISE:
+            value *= susp->rise_factor;
+            if (future >= threshold) {
+                off_count = now + delay_len;
+            }
+            if (now >= susp->on_count) {
+                value = 1.0;
+                state = ST_HOLD;
+            }
+            break;
+          }
+          output = (sample_type) value;
+      }")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/gate.c b/lib-src/libnyquist/nyquist/tran/gate.c
new file mode 100644
index 0000000..eec4a9d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/gate.c
@@ -0,0 +1,353 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "gate.h"
+
+void gate_free();
+
+
+typedef struct gate_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type signal;
+    long signal_cnt;
+    sample_block_values_type signal_ptr;
+
+    double rise_time;
+    double fall_time;
+    double floor;
+    double threshold;
+    long on_count;
+    long off_count;
+    double rise_factor;
+    double fall_factor;
+    long start_fall;
+    long start_rise;
+    long stop_count;
+    long delay_len;
+    int state;
+    double value;
+} gate_susp_node, *gate_susp_type;
+
+#define ST_HOLD 0
+#define ST_FALL 1
+#define ST_FALL_UNTIL 2
+#define ST_OFF 3
+#define ST_OFF_UNTIL 4
+#define ST_RISE 5
+
+/* Overview:
+This operation generates an exponential rise and decay suitable for implementing a 
+noise gate. The decay starts when the signal drops below threshold and stays there
+for longer than lookahead. 
+Decay continues until the value reaches floor, at which point the decay stops
+and the value is held constant. Either during the decay or after the floor is reached,
+if the signal goes above threshold, then the output value will rise to 1.0 (0dB) at
+the point the signal crosses the threshold. Again, lookahead is used, so the rise
+actually starts before the signal crosses the threshold. The rise rate is constant
+and set so that a rise from floor to 0dB occurs in the specified risetime.  Similarly,
+the fall rate is constant such that a fall from 0dB to the floor takes falltime.
+
+Rather than looking ahead, the output actually lags the input by lookahead. The caller
+should advance the time of the input signal in order to get a correct output signal,
+and this will be taken care of in Lisp code.
+
+The implementation is a finite-state machine that simultaneously computes the value
+and scans ahead for threshold crossings. Time points, remembered as sample counts are
+saved in variables:
+    on_count -- the time at which the rise should complete
+    off_count -- the time at which the fall should begin
+    rise_factor -- multiply by this to get exponential rise
+    fall_factor -- multiply by this to get exponential fall
+    rise_time -- number of samples for a full rise
+    fall_time -- number of samples for a full fall
+    floor -- the lowest value to output
+    threshold -- compare the signal s to this value
+    start_rise -- the sample count at which a rise begins
+    delay_len -- number of samples to look ahead, length of buffer
+    state -- the current state of finite state machine
+        (see the individual 'case' statements for description of states)
+    value -- the current output value
+    
+computing fall_factor:
+    factor ^ (sample_rate * time) == floor
+    log(factor) * sample_rate * time == log(floor)
+    log(factor) == log(floor) / (sample_rate * time)
+    factor == exp(log(floor) / (sample_rate * time))
+    
+*/
+
+void compute_start_rise(gate_susp_type susp)
+{
+    /* to compute when to start rise to achieve 0dB at on_count:
+    By similar triangles:
+        truncated rise time    truncated fall time
+        ------------------- == -------------------
+            full rise time         full fall time
+    when you enter ST_FALL, set start_fall = now
+    then if (on_count - start_fall) < (rise_time + fall_time)
+    then start rise at
+    on_time - rise_time * (on_count-start_fall)/(rise_time+fall_time)
+    */
+    long total = (long) (susp->rise_time + susp->fall_time);
+    if ((susp->on_count - susp->start_fall) < total) {
+        susp->start_rise = (long) (susp->on_count - 
+            (susp->rise_time * susp->on_count - susp->start_fall) / total);
+    } else susp->start_rise = (long) (susp->on_count - susp->rise_time);
+}
+
+
+void gate_n_fetch(register gate_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double threshold_reg;
+    register long off_count_reg;
+    register long stop_count_reg;
+    register long delay_len_reg;
+    register int state_reg;
+    register double value_reg;
+    register sample_block_values_type signal_ptr_reg;
+    falloc_sample_block(out, "gate_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the signal input sample block: */
+	susp_check_term_samples(signal, signal_ptr, signal_cnt);
+	togo = min(togo, susp->signal_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	threshold_reg = susp->threshold;
+	off_count_reg = susp->off_count;
+	stop_count_reg = susp->stop_count;
+	delay_len_reg = susp->delay_len;
+	state_reg = susp->state;
+	value_reg = susp->value;
+	signal_ptr_reg = susp->signal_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{
+        sample_type future = *signal_ptr_reg++;
+        long now = susp->susp.current + cnt + togo - n;
+        
+        switch (state_reg) {
+          /* hold at 1.0 and look for the moment to begin fall: */
+          case ST_HOLD:
+              if (future >= threshold_reg) {
+                  off_count_reg = now + delay_len_reg;
+              } else if (now >= off_count_reg) {
+                  state_reg = ST_FALL;
+                  stop_count_reg = (long) (now + susp->fall_time);
+                  susp->start_fall = now;
+              }
+              break;
+          /* fall until stop_count_reg while looking for next rise time */
+          case ST_FALL:
+            if (future >= threshold_reg) {
+                off_count_reg = susp->on_count = now + delay_len_reg;
+                compute_start_rise(susp);
+                state_reg = ST_FALL_UNTIL;
+            } else if (now == stop_count_reg) {
+                state_reg = ST_OFF;
+                value_reg = susp->floor;
+            } else value_reg *= susp->fall_factor;
+            break;
+          /* fall until start_rise while looking for next fall time */
+          case ST_FALL_UNTIL:
+            value_reg *= susp->fall_factor;
+            if (future >= threshold_reg) {
+                   off_count_reg = now + delay_len_reg;
+               }
+               if (now >= susp->start_rise) {
+                   state_reg = ST_RISE;
+               } else if (now >= stop_count_reg) {
+                   state_reg = ST_OFF_UNTIL;
+                   value_reg = susp->floor;
+               }
+               break;
+          /* hold at floor (minimum value_reg) and look for next rise time */
+          case ST_OFF:
+            if (future >= threshold_reg) {
+                off_count_reg = susp->on_count = now + delay_len_reg;
+                compute_start_rise(susp);
+                state_reg = ST_OFF_UNTIL;
+            }
+            break;
+          /* hold at floor until start_rise while looking for next fall time */
+          case ST_OFF_UNTIL:
+              if (future >= threshold_reg) {
+                  off_count_reg = now + delay_len_reg;
+              }
+              if (now >= susp->start_rise) {
+                  state_reg = ST_RISE;
+              }
+              break;
+          /* rise while looking for fall time */
+          case ST_RISE:
+            value_reg *= susp->rise_factor;
+            if (future >= threshold_reg) {
+                off_count_reg = now + delay_len_reg;
+            }
+            if (now >= susp->on_count) {
+                value_reg = 1.0;
+                state_reg = ST_HOLD;
+            }
+            break;
+          }
+          *out_ptr_reg++ = (sample_type) value_reg;
+      };
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->off_count = off_count_reg;
+	susp->stop_count = stop_count_reg;
+	susp->state = state_reg;
+	susp->value = value_reg;
+	/* using signal_ptr_reg is a bad idea on RS/6000: */
+	susp->signal_ptr += togo;
+	out_ptr += togo;
+	susp_took(signal_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* gate_n_fetch */
+
+
+void gate_toss_fetch(susp, snd_list)
+  register gate_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from signal up to final_time for this block of zeros */
+    while ((round((final_time - susp->signal->t0) * susp->signal->sr)) >=
+	   susp->signal->current)
+	susp_get_samples(signal, signal_ptr, signal_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->signal->t0) * susp->signal->sr -
+         (susp->signal->current - susp->signal_cnt));
+    susp->signal_ptr += n;
+    susp_took(signal_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void gate_mark(gate_susp_type susp)
+{
+    sound_xlmark(susp->signal);
+}
+
+
+void gate_free(gate_susp_type susp)
+{
+    sound_unref(susp->signal);
+    ffree_generic(susp, sizeof(gate_susp_node), "gate_free");
+}
+
+
+void gate_print_tree(gate_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("signal:");
+    sound_print_tree_1(susp->signal, n);
+}
+
+
+sound_type snd_make_gate(sound_type signal, time_type lookahead, double risetime, double falltime, double floor, double threshold)
+{
+    register gate_susp_type susp;
+    rate_type sr = signal->sr;
+    time_type t0 = signal->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (SIGNAL) */
+    scale_factor *= signal->scale;
+    signal->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (signal->sr < sr) { signal->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, gate_susp_node, "snd_make_gate");
+    susp->rise_time = signal->sr * risetime + 0.5;
+    susp->fall_time = signal->sr * falltime + 0.5;
+    susp->floor = floor; floor = log(floor);;
+    susp->threshold = threshold;
+    susp->on_count = 0;
+    susp->off_count = 0;
+    susp->rise_factor = exp(- floor / susp->rise_time);
+    susp->fall_factor = exp(floor / susp->fall_time);
+    susp->start_fall = 0;
+    susp->start_rise = 0;
+    susp->stop_count = 0;
+    susp->delay_len = max(1, round(signal->sr * lookahead));
+    susp->state = ST_OFF;
+    susp->value = susp->floor;
+    susp->susp.fetch = gate_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < signal->t0) sound_prepend_zeros(signal, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(signal->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = gate_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = gate_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = gate_mark;
+    susp->susp.print_tree = gate_print_tree;
+    susp->susp.name = "gate";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->signal = signal;
+    susp->signal_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_gate(sound_type signal, time_type lookahead, double risetime, double falltime, double floor, double threshold)
+{
+    sound_type signal_copy = sound_copy(signal);
+    return snd_make_gate(signal_copy, lookahead, risetime, falltime, floor, threshold);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/gate.h b/lib-src/libnyquist/nyquist/tran/gate.h
new file mode 100644
index 0000000..851c783
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/gate.h
@@ -0,0 +1,3 @@
+sound_type snd_make_gate(sound_type signal, time_type lookahead, double risetime, double falltime, double floor, double threshold);
+sound_type snd_gate(sound_type signal, time_type lookahead, double risetime, double falltime, double floor, double threshold);
+    /* LISP: (snd-gate SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/ifft-old.alg b/lib-src/libnyquist/nyquist/tran/ifft-old.alg
new file mode 100644
index 0000000..442be85
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/ifft-old.alg
@@ -0,0 +1,92 @@
+(IFFT-ALG
+  (NAME "ifft")
+  (ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("LVAL" "src"))
+  (SUPPORT-FUNCTIONS "
+/* IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either an
+ * array of samples or NIL. The output of ifft is simply the
+ * concatenation of the samples taken from the array. Later,
+ * an ifft will be plugged in and this will return overlapped
+ * adds of the ifft's.
+ */
+
+#include \"samples.h\"
+
+ /* IFFT code goes here */
+")
+
+  (SAMPLE-RATE "sr")
+  (STATE
+          ("long" "index" "0") ; samples index
+          ("long" "length" "0"); samples length
+          ("LVAL" "array" "NULL")
+        ("LVAL" "src" "src")
+        ("sample_type *" "samples" "NULL"))
+  
+  (OUTER-LOOP "
+        if (susp->src == NULL) {
+out:	    togo = 0;	/* indicate termination */
+            break;	/* we're done */
+        }
+        if (susp->index >= susp->length) {
+            long i;
+            susp->index = 0;
+            susp->array = xleval(cons(s_send, cons(susp->src, consa(s_next))));
+            susp->index = 0;
+            if (susp->array == NULL) {
+                susp->src = NULL;
+                goto out;
+            } else if (!vectorp(susp->array)) {
+                xlerror(\"array expected\", susp->array);
+            } else if (susp->samples == NULL) {
+                /* assume arrays are all the same size as first one;
+                   now that we know the size, we just have to do this
+                   first allocation.
+                 */
+                susp->length = getsize(susp->array);
+                if (susp->length < 1) xlerror(\"array has no elements\", susp->array);
+                susp->samples = 
+                    (sample_type *) calloc(susp->length,
+                                           sizeof(sample_type));
+            } else if (getsize(susp->array) != susp->length) {
+                xlerror(\"arrays must all be the same length\", susp->array);
+            }
+            /* at this point, we have a new array and a place to put samples */
+            for (i = 0; i < susp->length; i++) {
+                LVAL elem = getelement(susp->array, i);
+                if (ntype(elem) != FLONUM) {
+                    xlerror(\"flonum expected\", elem);
+                }
+                susp->samples[i] = (sample_type) getflonum(elem);
+            }
+            susp->array = NULL; /* free the array */
+            /* here is where the IFFT and windowing should take place */
+/*
+            temp_fft = (double *) malloc (susp->length * sizeof(double));
+            if (temp_fft == 0) return;
+            big_samples = (double *) malloc (susp->length * sizeof(double));
+            if (big_samples == 0) return;
+            for (i = 0; i < susp->length; i++) {
+                big_samples[i] = (double) susp->samples[i];
+            }
+            rp = rfftw_create_plan(susp->length, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE);
+            rfftw_one(rp, big_samples, temp_fft);
+            rfftw_destroy_plan(rp);
+            free(big_samples);
+            for (i = 0; i < susp->length; i++) {
+                setelement(result, i, cvflonum(temp_fft[i]));
+            }
+            free (temp_fft);
+*/
+            
+        }
+        togo = min(togo, susp->length - susp->index);
+")
+  (INNER-LOOP "output = samples[index++];")
+  (CONSTANT "length" "samples" "array" "src")
+  (TERMINATE COMPUTED)
+  (FINALIZATION "    free(susp->samples);
+")
+
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/ifft.alg b/lib-src/libnyquist/nyquist/tran/ifft.alg
new file mode 100644
index 0000000..c634351
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/ifft.alg
@@ -0,0 +1,182 @@
+(IFFT-ALG
+  (NAME "ifft")
+  (ARGUMENTS ("time_type" "t0") ("rate_type" "sr")
+             ("LVAL" "src") ("long" "stepsize")
+             ("LVAL" "window"))
+  (SUPPORT-FUNCTIONS "
+/* index: index into outbuf whree we get output samples
+ * length: size of the frame, window, and outbuf; half size of samples
+ * array: spectral frame goes here (why not a local var?)
+ * window_len: size of window, should equal length
+ * outbuf: real part of samples are multiplied by window and added to
+ *          outbuf (after shifting)
+ * src: send :NEXT to this object to get next frame
+ * stepsize: shift by this many and add each frame
+ * samples: result of ifft goes here, real and imag
+ * window: multiply samples by window if any 
+ *
+ * IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either an
+ * array of samples or NIL. The output of ifft is simply the
+ * concatenation of the samples taken from the array. Later,
+ * an ifft will be plugged in and this will return overlapped
+ * adds of the ifft's.
+ *
+ * OVERLAP: stepsize must be less than or equal to the length
+ * of real part of the transformed spectrum. A transform step
+ * works like this: 
+ * (1) shift the output buffer by stepsize samples, filling
+ *     the end of the buffer with zeros
+ * (2) get and transform an array of spectral coefficients
+ * (3) multiply the result by a window
+ * (4) add the result to the output buffer
+ * (5) output the first stepsize samples of the buffer
+ * 
+ * DATA FORMAT: the DC component goes in array elem 0
+ * Cosine part is in elements 2*i-1
+ * Sine part is in elements 2*i
+ * Nyquist frequency is in element length-1
+ */
+
+#include \"samples.h\"
+#include \"fftext.h\"
+
+#define MUST_BE_FLONUM(e) \\
+    if (!(e) || ntype(e) != FLONUM) { xlerror(\"flonum expected\", (e)); }
+
+table_type get_window_samples(LVAL window, sample_type **samples, long *len)
+{
+    table_type result = NULL;
+    if (soundp(window)) {
+        sound_type window_sound = getsound(window);
+        xlprot1(window); /* maybe not necessary */
+        result = sound_to_table(window_sound);
+        xlpop();
+        *samples = result->samples;
+        *len = (long) (result->length + 0.5);
+    }
+    return result;
+}
+")
+
+  (SAMPLE-RATE "sr")
+  (STATE
+          ("long" "index" "stepsize") ; samples index
+          ("long" "length" "0")       ; samples length
+          ("LVAL" "array" "NULL")
+          ("long" "window_len" "0")
+          ("sample_type *" "outbuf" "NULL")
+          ("LVAL" "src" "src")
+          ("long" "stepsize" "stepsize")
+          ("sample_type *" "window" "NULL") ; window samples
+          ("sample_type *" "samples" "NULL")
+          ("table_type" "table" 
+           "get_window_samples(window, &susp->window, &susp->window_len)"))
+  
+  (OUTER-LOOP "
+        if (susp->src == NULL) {
+out:        togo = 0;   /* indicate termination */
+            break;      /* we're done */
+        }
+        if (susp->index >= susp->stepsize) {
+            long i;
+            long m, n;
+            LVAL elem;
+            susp->index = 0;
+            susp->array = 
+                xleval(cons(s_send, cons(susp->src, consa(s_next))));
+            if (susp->array == NULL) {
+                susp->src = NULL;
+                goto out;
+            } else if (!vectorp(susp->array)) {
+                xlerror(\"array expected\", susp->array);
+            } else if (susp->samples == NULL) {
+                /* assume arrays are all the same size as first one;
+                   now that we know the size, we just have to do this
+                   first allocation.
+                 */
+                susp->length = getsize(susp->array);
+                if (susp->length < 1) 
+                    xlerror(\"array has no elements\", susp->array);
+                if (susp->window && (susp->window_len != susp->length))
+                    xlerror(\"window size and spectrum size differ\", 
+                            susp->array);
+                /* tricky non-power of 2 detector: only if this is a
+                 * power of 2 will the highest 1 bit be cleared when
+                 * we subtract 1 ...
+                 */
+                if (susp->length & (susp->length - 1))
+                    xlfail(\"spectrum size must be a power of 2\");
+                susp->samples = (sample_type *) calloc(susp->length,
+                                                       sizeof(sample_type));
+                susp->outbuf = (sample_type *) calloc(susp->length, 
+                                                      sizeof(sample_type));
+            } else if (getsize(susp->array) != susp->length) {
+                xlerror(\"arrays must all be the same length\", susp->array);
+            }
+
+            /* at this point, we have a new array to put samples */
+            /* the incoming array format is [DC, R1, I1, R2, I2, ... RN]
+             * where RN is the real coef at the Nyquist frequency
+             * but susp->samples should be organized as [DC, RN, R1, I1, ...]
+             */
+            n = susp->length;
+            /* get the DC (real) coef */
+            elem = getelement(susp->array, 0);
+            MUST_BE_FLONUM(elem)
+            susp->samples[0] = (sample_type) getflonum(elem);
+
+            /* get the Nyquist (real) coef */
+            elem = getelement(susp->array, n - 1);
+            MUST_BE_FLONUM(elem);
+            susp->samples[1] = (sample_type) getflonum(elem);
+
+            /* get the remaining coef */
+            for (i = 1; i < n - 1; i++) {
+                elem = getelement(susp->array, i);
+                MUST_BE_FLONUM(elem)
+                susp->samples[i + 1] = (sample_type) getflonum(elem);
+            }
+            susp->array = NULL; /* free the array */
+
+            /* here is where the IFFT and windowing should take place */
+            //fftnf(1, &n, susp->samples, susp->samples + n, -1, 1.0);
+            m = round(log2(n));
+            if (!fftInit(m)) riffts(susp->samples, m, 1);
+            else xlfail(\"FFT initialization error\");
+            if (susp->window) {
+                n = susp->length;
+                for (i = 0; i < n; i++) {
+                    susp->samples[i] *= susp->window[i];
+                }
+            }
+
+            /* shift the outbuf */
+            n = susp->length - susp->stepsize;
+            for (i = 0; i < n; i++) {
+                susp->outbuf[i] = susp->outbuf[i + susp->stepsize];
+            }
+
+            /* clear end of outbuf */
+            for (i = n; i < susp->length; i++) {
+                susp->outbuf[i] = 0;
+            }
+
+            /* add in the ifft result */
+            n = susp->length;
+            for (i = 0; i < n; i++) {
+                susp->outbuf[i] += susp->samples[i];
+            }
+        }
+        togo = min(togo, susp->stepsize - susp->index);
+")
+  (INNER-LOOP "output = outbuf[index++];")
+  (CONSTANT "length" "samples" "array" "src" "window")
+  (TERMINATE COMPUTED)
+  (FINALIZATION "    if (susp->samples) free(susp->samples);
+    if (susp->table) table_unref(susp->table);
+    if (susp->outbuf) free(susp->outbuf);
+")
+
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/ifft.c b/lib-src/libnyquist/nyquist/tran/ifft.c
new file mode 100644
index 0000000..3165f15
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/ifft.c
@@ -0,0 +1,286 @@
+#include "stdio.h"
+#define _USE_MATH_DEFINES 1 /* for Visual C++ to get M_LN2 */
+#include <math.h>
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "ifft.h"
+
+void ifft_free();
+
+
+typedef struct ifft_susp_struct {
+    snd_susp_node susp;
+
+    long index;
+    long length;
+    LVAL array;
+    long window_len;
+    sample_type *outbuf;
+    LVAL src;
+    long stepsize;
+    sample_type *window;
+    sample_type *samples;
+    table_type table;
+} ifft_susp_node, *ifft_susp_type;
+
+
+/* index: index into outbuf whree we get output samples
+ * length: size of the frame, window, and outbuf; half size of samples
+ * array: spectral frame goes here (why not a local var?)
+ * window_len: size of window, should equal length
+ * outbuf: real part of samples are multiplied by window and added to
+ *          outbuf (after shifting)
+ * src: send :NEXT to this object to get next frame
+ * stepsize: shift by this many and add each frame
+ * samples: result of ifft goes here, real and imag
+ * window: multiply samples by window if any 
+ *
+ * IMPLEMENTATION NOTE:
+ * The src argument is an XLisp object that returns either an
+ * array of samples or NIL. The output of ifft is simply the
+ * concatenation of the samples taken from the array. Later,
+ * an ifft will be plugged in and this will return overlapped
+ * adds of the ifft's.
+ *
+ * OVERLAP: stepsize must be less than or equal to the length
+ * of real part of the transformed spectrum. A transform step
+ * works like this: 
+ * (1) shift the output buffer by stepsize samples, filling
+ *     the end of the buffer with zeros
+ * (2) get and transform an array of spectral coefficients
+ * (3) multiply the result by a window
+ * (4) add the result to the output buffer
+ * (5) output the first stepsize samples of the buffer
+ * 
+ * DATA FORMAT: the DC component goes in array elem 0
+ * Cosine part is in elements 2*i-1
+ * Sine part is in elements 2*i
+ * Nyquist frequency is in element length-1
+ */
+
+#include "samples.h"
+#include "fftext.h"
+
+#define MUST_BE_FLONUM(e) \
+    if (!(e) || ntype(e) != FLONUM) { xlerror("flonum expected", (e)); }
+
+table_type get_window_samples(LVAL window, sample_type **samples, long *len)
+{
+    table_type result = NULL;
+    if (soundp(window)) {
+        sound_type window_sound = getsound(window);
+        xlprot1(window); /* maybe not necessary */
+        result = sound_to_table(window_sound);
+        xlpop();
+        *samples = result->samples;
+        *len = (long) (result->length + 0.5);
+    }
+    return result;
+}
+
+
+void ifft__fetch(register ifft_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long index_reg;
+    register sample_type * outbuf_reg;
+    falloc_sample_block(out, "ifft__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+
+        if (susp->src == NULL) {
+out:        togo = 0;   /* indicate termination */
+            break;      /* we're done */
+        }
+        if (susp->index >= susp->stepsize) {
+            long i;
+            long m, n;
+            LVAL elem;
+            susp->index = 0;
+            susp->array = 
+                xleval(cons(s_send, cons(susp->src, consa(s_next))));
+            if (susp->array == NULL) {
+                susp->src = NULL;
+                goto out;
+            } else if (!vectorp(susp->array)) {
+                xlerror("array expected", susp->array);
+            } else if (susp->samples == NULL) {
+                /* assume arrays are all the same size as first one;
+                   now that we know the size, we just have to do this
+                   first allocation.
+                 */
+                susp->length = getsize(susp->array);
+                if (susp->length < 1) 
+                    xlerror("array has no elements", susp->array);
+                if (susp->window && (susp->window_len != susp->length))
+                    xlerror("window size and spectrum size differ", 
+                            susp->array);
+                /* tricky non-power of 2 detector: only if this is a
+                 * power of 2 will the highest 1 bit be cleared when
+                 * we subtract 1 ...
+                 */
+                if (susp->length & (susp->length - 1))
+                    xlfail("spectrum size must be a power of 2");
+                susp->samples = (sample_type *) calloc(susp->length,
+                                                       sizeof(sample_type));
+                susp->outbuf = (sample_type *) calloc(susp->length, 
+                                                      sizeof(sample_type));
+            } else if (getsize(susp->array) != susp->length) {
+                xlerror("arrays must all be the same length", susp->array);
+            }
+
+            /* at this point, we have a new array to put samples */
+            /* the incoming array format is [DC, R1, I1, R2, I2, ... RN]
+             * where RN is the real coef at the Nyquist frequency
+             * but susp->samples should be organized as [DC, RN, R1, I1, ...]
+             */
+            n = susp->length;
+            /* get the DC (real) coef */
+            elem = getelement(susp->array, 0);
+            MUST_BE_FLONUM(elem)
+            susp->samples[0] = (sample_type) getflonum(elem);
+
+            /* get the Nyquist (real) coef */
+            elem = getelement(susp->array, n - 1);
+            MUST_BE_FLONUM(elem);
+            susp->samples[1] = (sample_type) getflonum(elem);
+
+            /* get the remaining coef */
+            for (i = 1; i < n - 1; i++) {
+                elem = getelement(susp->array, i);
+                MUST_BE_FLONUM(elem)
+                susp->samples[i + 1] = (sample_type) getflonum(elem);
+            }
+            susp->array = NULL; /* free the array */
+
+            /* here is where the IFFT and windowing should take place */
+            //fftnf(1, &n, susp->samples, susp->samples + n, -1, 1.0);
+            m = round(log(n) / M_LN2);
+            if (!fftInit(m)) riffts(susp->samples, m, 1);
+            else xlfail("FFT initialization error");
+            if (susp->window) {
+                n = susp->length;
+                for (i = 0; i < n; i++) {
+                    susp->samples[i] *= susp->window[i];
+                }
+            }
+
+            /* shift the outbuf */
+            n = susp->length - susp->stepsize;
+            for (i = 0; i < n; i++) {
+                susp->outbuf[i] = susp->outbuf[i + susp->stepsize];
+            }
+
+            /* clear end of outbuf */
+            for (i = n; i < susp->length; i++) {
+                susp->outbuf[i] = 0;
+            }
+
+            /* add in the ifft result */
+            n = susp->length;
+            for (i = 0; i < n; i++) {
+                susp->outbuf[i] += susp->samples[i];
+            }
+        }
+        togo = min(togo, susp->stepsize - susp->index);
+
+	n = togo;
+	index_reg = susp->index;
+	outbuf_reg = susp->outbuf;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = outbuf_reg[index_reg++];;
+	} while (--n); /* inner loop */
+
+	susp->index = index_reg;
+	susp->outbuf = outbuf_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* ifft__fetch */
+
+
+void ifft_mark(ifft_susp_type susp)
+{
+    if (susp->src) mark(susp->src);
+    if (susp->array) mark(susp->array);
+}
+
+
+void ifft_free(ifft_susp_type susp)
+{
+    if (susp->samples) free(susp->samples);
+    if (susp->table) table_unref(susp->table);
+    if (susp->outbuf) free(susp->outbuf);
+    ffree_generic(susp, sizeof(ifft_susp_node), "ifft_free");
+}
+
+
+void ifft_print_tree(ifft_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_ifft(time_type t0, rate_type sr, LVAL src, long stepsize, LVAL window)
+{
+    register ifft_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, ifft_susp_node, "snd_make_ifft");
+    susp->index = stepsize;
+    susp->length = 0;
+    susp->array = NULL;
+    susp->window_len = 0;
+    susp->outbuf = NULL;
+    susp->src = src;
+    susp->stepsize = stepsize;
+    susp->window = NULL;
+    susp->samples = NULL;
+    susp->table = get_window_samples(window, &susp->window, &susp->window_len);
+    susp->susp.fetch = ifft__fetch;
+
+    /* initialize susp state */
+    susp->susp.free = ifft_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = ifft_mark;
+    susp->susp.print_tree = ifft_print_tree;
+    susp->susp.name = "ifft";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_ifft(time_type t0, rate_type sr, LVAL src, long stepsize, LVAL window)
+{
+    return snd_make_ifft(t0, sr, src, stepsize, window);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/ifft.h b/lib-src/libnyquist/nyquist/tran/ifft.h
new file mode 100644
index 0000000..186cec6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/ifft.h
@@ -0,0 +1,3 @@
+sound_type snd_make_ifft(time_type t0, rate_type sr, LVAL src, long stepsize, LVAL window);
+sound_type snd_ifft(time_type t0, rate_type sr, LVAL src, long stepsize, LVAL window);
+    /* LISP: (snd-ifft ANYNUM ANYNUM ANY FIXNUM ANY) */
diff --git a/lib-src/libnyquist/nyquist/tran/init.lsp b/lib-src/libnyquist/nyquist/tran/init.lsp
new file mode 100644
index 0000000..ac49ca1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/init.lsp
@@ -0,0 +1,24 @@
+(expand 50)
+
+(load "../runtime/xlinit.lsp")
+
+(load "../runtime/misc.lsp")
+
+;; set to T to get interpolation within inner loops
+(setf *INLINE-INTERPOLATION* nil)
+
+;; set to T to get ANSI headers and NIL to get antique headers
+(setf *ANSI* NIL)
+
+;; set to T to generate tracing code, NIL to disable tracing code
+(setf *WATCH* NIL)
+
+(load "translate")
+(load "writesusp")
+(load "writemake")
+(load "writetoss")
+(load "innerloop")
+
+(setf *gc-flag* t)
+
+(setf *watch* nil)
diff --git a/lib-src/libnyquist/nyquist/tran/innerloop.lsp b/lib-src/libnyquist/nyquist/tran/innerloop.lsp
new file mode 100644
index 0000000..7d914aa
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/innerloop.lsp
@@ -0,0 +1,311 @@
+;; innerloop.lsp -- code to generate inner loops from specs
+
+;; the inner loop has a setup, a loop, and a cleanup
+;; in the setup, structure fields used in the inner loop are
+;;     copied or "cached" into register variables
+;; in the inner loop, access expressions are substituted for
+;;     variable names in the spec
+;; in the cleanup, resulting register variable "cache" is copied
+;;     back into the structure fields
+
+
+(defun compute-inner-loop (alg inner-loop)
+  (let ((interp (get-slot alg 'interpolation))
+        (sound-names (get alg 'sound-names))
+        (state-list (get-slot alg 'state))
+        (step-function (get alg 'step-function))
+        (maintain-list (get-slot alg 'maintain))
+        (constant-list (get-slot alg 'constant))
+        (force-into-register (get-slot alg 'force-into-register))
+        (not-register (get-slot alg 'not-register))
+        register-decl register-init register-cleanup new-state-list
+       )
+
+    ;; this loop computes and applies substitutions to the INNER-LOOP spec
+
+    (setf inner-loop (substitute inner-loop "output" "*out_ptr_reg++" nil))
+    (push "\tout_ptr_reg = out_ptr;\n" register-init)
+    (push "\tout_ptr += togo;\n" register-cleanup)
+
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp))
+            expression)
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((eq method 'NONE)
+                ;-----------------
+                ; NONE:
+                ;      <expr> ::= *NAME_ptr_reg++
+                ;-----------------
+               (pushnew (format nil
+ "    register sample_block_values_type ~A_ptr_reg;~%" name)
+                        register-decl)
+               (pushnew (format nil 
+                "\t~A_ptr_reg = susp->~A_ptr;~%" name name)
+                register-init)
+               (pushnew (format nil
+                "\t/* using ~A_ptr_reg is a bad idea on RS/6000: */~
+                ~%\tsusp->~A_ptr += togo;~%" name name name)
+                register-cleanup)
+
+               (setf expression (format nil "*~A_ptr_reg++" name)))
+
+              ((eq method 'SCALE)
+                ;-----------------
+                ; SCALE
+                ;	<expr> ::= (NAME_scale_reg * *NAME_ptr_reg++)
+                ;-----------------
+               (pushnew (format nil
+ "    register sample_block_values_type ~A_ptr_reg;~%" name)
+                        register-decl)
+               (pushnew (format nil
+ "    register sample_type ~A_scale_reg = susp->~A->scale;~%" name name)
+                        register-decl)
+               (pushnew (format nil 
+                "\t~A_ptr_reg = susp->~A_ptr;~%" name name)
+                register-init)
+               (pushnew (format nil
+                "\t/* using ~A_ptr_reg is a bad idea on RS/6000: */~
+                ~%\tsusp->~A_ptr += togo;~%" name name name)
+                register-cleanup)
+               (setf expression (format nil
+                "(~A_scale_reg * *~A_ptr_reg++)" name name)))
+
+              ((and interpolate-samples (eq method 'INTERP))
+                ;-----------------
+                ; INTERP:
+                ;	<expr> ::= susp->NAME_x1_sample * (1 - 
+                ;			susp->NAME_pHaSe +
+                ;  	              susp->NAME_x2_sample * susp->NAME_pHaSe)
+                ;-----------------
+               (pushnew (format nil
+ "    register sample_type ~A_x1_sample_reg;~%" name)
+                        register-decl)
+               (pushnew (format nil
+ "    register double ~A_pHaSe_ReG;~%" name)
+                        register-decl)
+               (pushnew (format nil
+ "    register double ~A_pHaSe_iNcR_rEg = susp->~A_pHaSe_iNcR;~%" name name)
+                        register-decl)
+
+               (pushnew (format nil
+                "\t~A_x1_sample_reg = susp->~A_x1_sample;~%" name name)
+                register-init)
+               (pushnew (format nil
+                "\t~A_pHaSe_ReG = susp->~A_pHaSe;~%" name name)
+                register-init)
+
+               (pushnew (format nil
+                "\tsusp->~A_x1_sample = ~A_x1_sample_reg;~%" name name)
+                register-cleanup)
+               (pushnew (format nil
+                "\tsusp->~A_pHaSe = ~A_pHaSe_ReG;~%" name name)
+                register-cleanup)
+
+               (setf expression (format nil 
+                    "\n\t\t(~A_x1_sample_reg * (1 - ~A_pHaSe_ReG) + ~A_x2_sample * ~A_pHaSe_ReG)"
+                                 name name name name)))
+
+              ((eq method 'INTERP)
+                ;-----------------
+                ; STEP FUNCTION:
+                ;	<expr> ::= NAME_x1_sample_reg
+                ;-----------------
+               (pushnew (format nil
+ "    register sample_type ~A_x1_sample_reg;~%" name)
+                        register-decl)
+               (pushnew (format nil
+ "    register double ~A_pHaSe_ReG;~%" name)
+                        register-decl)
+               (pushnew (format nil
+ "    register double ~A_pHaSe_iNcR_rEg = susp->~A_pHaSe_iNcR;~%" name name)
+                        register-decl)
+
+               (pushnew (format nil
+                "\t~A_x1_sample_reg = susp->~A_x1_sample;~%" name name)
+                register-init)
+               (pushnew (format nil
+                "\t~A_pHaSe_ReG = susp->~A_pHaSe;~%" name name)
+                register-init)
+
+               (pushnew (format nil
+                "\tsusp->~A_x1_sample = ~A_x1_sample_reg;~%" name name)
+                register-cleanup)
+               (pushnew (format nil
+                "\tsusp->~A_pHaSe = ~A_pHaSe_ReG;~%" name name)
+                register-cleanup)
+
+               (setf expression (format nil "~A_x1_sample_reg" name)))
+              ((and interpolate-samples (eq method 'RAMP))
+                ;-----------------
+                ; RAMP:
+                ;	<expr>  ::= NAME_val
+                ;-----------------
+               (setf expression (format nil "~A_val" name)))
+              ((eq method 'RAMP)
+                ;-----------------
+                ; RAMP:
+                ;	<expr>  ::= NAME_val
+                ;-----------------
+                ; this doesn't seem to be used -RBD 7/97
+               ;(pushnew (format nil
+                ;"    register sample_type ~A_x1_sample_reg;~%" name)
+                ;register-decl)
+               (setf expression (format nil "~A_val" name))))
+
+        (setf inner-loop (substitute inner-loop name expression nil))
+        ))
+
+    ;; determine the members of state-list that are actually referenced in
+    ;; the inner loop.  If not, don't cache the state in registers before
+    ;; starting the loop.
+    (dolist (state state-list)
+      (let ((var-name (cadr state)))
+        (cond ((and (or (string-search var-name inner-loop)
+                        (member (name-to-symbol var-name) force-into-register))
+                    (not (member (name-to-symbol var-name) not-register)))
+               (push state new-state-list)))))
+
+    ;; this loop applies substitutions for state variables:
+    ;;   the specified state variable name is the cadr of state-list element
+    ;;   the state variable <var> is replaced in inner-loop by <var>_reg
+
+    (dolist (state new-state-list)
+      (let ((var-name (cadr state))
+            maintain)
+        (pushnew (format nil "    register ~A ~A_reg;~%" (car state) var-name)
+                        register-decl)
+        (pushnew (format nil "\t~A_reg = susp->~A;~%" var-name var-name)
+                       register-init)
+        (setf maintain (find-maintain-stmt var-name maintain-list))
+;        (display "find-maintain-stmt returned:" maintain)
+        (cond (maintain
+               (pushnew (format nil "\t~A;~%" maintain) register-cleanup))
+              ((not (is-constant-in-inner-loop var-name constant-list))
+               ;(pushnew (format nil "var-name: ~A constant-list: ~A~%" var-name constant-list)
+               ;        register-cleanup)
+               (pushnew (format nil "\tsusp->~A = ~A_reg;~%" var-name var-name)
+                       register-cleanup)))
+        (setf inner-loop (substitute inner-loop var-name 
+                          (format nil "~A_reg" var-name) t))
+        ))
+    
+    ;(display "register decls" state-list register-decl) (read)
+
+    ;; if the user-written code has a break statement or if the interpolation
+    ;; type is INTERP, we need to write out "togo -= n;" to get an accurate
+    ;; count of how many times we went through the loop.  Otherwise don't do it
+    ;; because it makes n a live variable and affects compiler optimization.
+    (cond ((or (member 'INTERP interp)
+               (string-search "break" inner-loop))
+           (push "\ttogo -= n;\n" register-cleanup)))
+
+    (put-slot alg inner-loop 'inner-loop-stmts)
+    (put-slot alg register-decl 'register-decl)
+    (put-slot alg register-init 'register-init)
+    (put-slot alg register-cleanup 'register-cleanup)
+
+    ;-----------------
+    ; WATCH:
+    ;
+    ; show_samples(1,s1,s1_ptr - s1->samples)
+    ;
+    ; Note: this is not right because we need to have the correct
+    ; parameter for s1, but that is part of the s1_ptr++ computation
+    ; so I don't know where to get it...
+    ;-----------------
+;    (if *WATCH*
+;      (format stream "\t    show_samples(1,s1,s1_ptr - s1_samples);~%")
+;    )
+    ))
+
+
+;; find-maintain-list -- find an assignment for variable in a MAINTAIN spec
+;;
+(defun find-maintain-stmt (var specs)
+  (let ((spec (assoc var specs :test #'equal)))
+    (if spec (cadr spec))))
+
+
+;; is-constant-in-inner-loop -- see if var is in constant-list
+;;
+(defun is-constant-in-inner-loop (var constant-list)
+  (member var constant-list :test #'equal))
+
+
+;; pushnew -- pushes string onto list unless already there
+;;
+(defmacro pushnew (string var)
+  `(if (not (member ,string ,var :test #'equal))
+     (push ,string ,var)))
+
+
+;;**********
+;; substitute -- string substitution 
+;; Inputs:
+;;	s - input string
+;;	pat - pattern
+;;	repl - replacement for pattern
+;;	all - T or NIL (T : replace everywhere; NIL : replace once)
+;;
+;;**********
+
+(defun substitute (s pat repl all)
+;  (display "substitute" s pat repl)
+  (let ((p (position s pat))
+        (l (length pat)))
+    (cond (p
+           (strcat (subseq s 0 p) repl 
+            ;; the remainder of the string depends on all.  If T, then
+            ;; use recursion to continue substitutions:
+            (cond (all (substitute (subseq s (+ p l)) pat repl all))
+                  (t (subseq s (+ p l))))))
+          (t s))))
+
+
+(defun write-inner-loop (alg stream)
+  (let ((interp (get-slot alg 'interpolation))
+        (step-function (get alg 'step-function))
+        (sound-names (get alg 'sound-names))
+       )
+
+    (format stream "~A;~%"
+     (get-slot alg 'inner-loop-stmts))
+
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((eq method 'INTERP)
+                ;-----------------
+                ; INTERP:
+                ;
+                ;    NAME_pHaSe_ReG += NAME_pHaSe_iNcR_rEg;
+                ;-----------------
+                (format stream "\t    ~A_pHaSe_ReG += ~A_pHaSe_iNcR_rEg;~%"
+                     name name))
+
+              ((and interpolate-samples (eq method 'RAMP))
+                ;-----------------
+                ; RAMP:
+                ;	NAME_val += NAME_DeLtA
+                ;-----------------
+               (format stream "\t    ~A_val += ~A_DeLtA;~%" name name)))))
+
+    ;----------------------------
+    ; WATCH:
+    ;	    show_samples(0,out,out_ptr - 1 - out->samples);
+    ;----------------------------
+
+;    (if *WATCH*
+;       (format stream "\t    show_samples(0,out,out_ptr - 1 - out->samples);~%"))
+    ;----------------------------
+    ;  } while (--n); /* inner loop */
+    ;----------------------------
+    (format stream "\t} while (--n); /* inner loop */~%~%")))
diff --git a/lib-src/libnyquist/nyquist/tran/instrbanded.alg b/lib-src/libnyquist/nyquist/tran/instrbanded.alg
new file mode 100644
index 0000000..49345d9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbanded.alg
@@ -0,0 +1,24 @@
+(INSTRBANDED-ALG
+(NAME "bandedwg")
+(ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env") ("int" "preset")("rate_type" "sr"))
+(STATE ("struct instr *" "mybanded" "initInstrument(BANDEDWG, round(sr));
+    controlChange(susp->mybanded, 16, preset);")
+       ("int" "temp_ret_value" "noteOn(susp->mybanded, freq, 1.0)"))
+(START (min bowpress_env))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value" "preset")
+(SAMPLE-RATE "sr")
+(ALWAYS-SCALE bowpress_env)
+(TERMINATE (min bowpress_env))
+(INNER-LOOP "
+	    controlChange(mybanded, 2, BANDEDWG_CONTROL_CHANGE_CONST * bowpress_env);
+	    output = (sample_type) tick(mybanded)")
+(SUPPORT-HEADER "
+	    #define BANDEDWG_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mybanded);
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/instrbanded.c b/lib-src/libnyquist/nyquist/tran/instrbanded.c
new file mode 100644
index 0000000..585bcfc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbanded.c
@@ -0,0 +1,181 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrbanded.h"
+
+void bandedwg_free();
+
+
+typedef struct bandedwg_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type bowpress_env;
+    long bowpress_env_cnt;
+    sample_block_values_type bowpress_env_ptr;
+
+    struct instr *mybanded;
+    int temp_ret_value;
+} bandedwg_susp_node, *bandedwg_susp_type;
+
+
+	    #include "instr.h"
+
+
+void bandedwg_s_fetch(register bandedwg_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mybanded_reg;
+    register sample_type bowpress_env_scale_reg = susp->bowpress_env->scale;
+    register sample_block_values_type bowpress_env_ptr_reg;
+    falloc_sample_block(out, "bandedwg_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the bowpress_env input sample block: */
+	susp_check_term_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+	togo = min(togo, susp->bowpress_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mybanded_reg = susp->mybanded;
+	bowpress_env_ptr_reg = susp->bowpress_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(mybanded_reg, 2, BANDEDWG_CONTROL_CHANGE_CONST * (bowpress_env_scale_reg * *bowpress_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(mybanded_reg);
+	} while (--n); /* inner loop */
+
+	susp->mybanded = mybanded_reg;
+	/* using bowpress_env_ptr_reg is a bad idea on RS/6000: */
+	susp->bowpress_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(bowpress_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* bandedwg_s_fetch */
+
+
+void bandedwg_toss_fetch(susp, snd_list)
+  register bandedwg_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from bowpress_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >=
+	   susp->bowpress_env->current)
+	susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr -
+         (susp->bowpress_env->current - susp->bowpress_env_cnt));
+    susp->bowpress_env_ptr += n;
+    susp_took(bowpress_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void bandedwg_mark(bandedwg_susp_type susp)
+{
+    sound_xlmark(susp->bowpress_env);
+}
+
+
+void bandedwg_free(bandedwg_susp_type susp)
+{
+
+	    deleteInstrument(susp->mybanded);
+    sound_unref(susp->bowpress_env);
+    ffree_generic(susp, sizeof(bandedwg_susp_node), "bandedwg_free");
+}
+
+
+void bandedwg_print_tree(bandedwg_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("bowpress_env:");
+    sound_print_tree_1(susp->bowpress_env, n);
+}
+
+
+sound_type snd_make_bandedwg(double freq, sound_type bowpress_env, int preset, rate_type sr)
+{
+    register bandedwg_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = bowpress_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, bandedwg_susp_node, "snd_make_bandedwg");
+    susp->mybanded = initInstrument(BANDEDWG, round(sr));
+    controlChange(susp->mybanded, 16, preset);;
+    susp->temp_ret_value = noteOn(susp->mybanded, freq, 1.0);
+    susp->susp.fetch = bandedwg_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < bowpress_env->t0) sound_prepend_zeros(bowpress_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(bowpress_env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = bandedwg_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = bandedwg_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = bandedwg_mark;
+    susp->susp.print_tree = bandedwg_print_tree;
+    susp->susp.name = "bandedwg";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->bowpress_env = bowpress_env;
+    susp->bowpress_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_bandedwg(double freq, sound_type bowpress_env, int preset, rate_type sr)
+{
+    sound_type bowpress_env_copy = sound_copy(bowpress_env);
+    return snd_make_bandedwg(freq, bowpress_env_copy, preset, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrbanded.h b/lib-src/libnyquist/nyquist/tran/instrbanded.h
new file mode 100644
index 0000000..f582d9e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbanded.h
@@ -0,0 +1,5 @@
+sound_type snd_make_bandedwg(double freq, sound_type bowpress_env, int preset, rate_type sr);
+sound_type snd_bandedwg(double freq, sound_type bowpress_env, int preset, rate_type sr);
+    /* LISP: (snd-bandedwg ANYNUM SOUND FIXNUM ANYNUM) */
+
+	    #define BANDEDWG_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrbow.alg b/lib-src/libnyquist/nyquist/tran/instrbow.alg
new file mode 100644
index 0000000..315eb54
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbow.alg
@@ -0,0 +1,25 @@
+(INSTRBOW-ALG
+(NAME "bowed")
+(ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "mybow" "initInstrument(BOWED, round(sr));
+    controlChange(susp->mybow, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->mybow, freq, 1.0)"))
+(START (min bowpress_env))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(ALWAYS-SCALE bowpress_env)
+(TERMINATE (min bowpress_env))
+(INNER-LOOP "
+	    controlChange(mybow, 128, BOW_CONTROL_CHANGE_CONST * bowpress_env);
+	    output = (sample_type) tick(mybow)")
+(SUPPORT-HEADER "
+	    #define BOW_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mybow);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrbow.c b/lib-src/libnyquist/nyquist/tran/instrbow.c
new file mode 100644
index 0000000..b9cc841
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbow.c
@@ -0,0 +1,181 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrbow.h"
+
+void bowed_free();
+
+
+typedef struct bowed_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type bowpress_env;
+    long bowpress_env_cnt;
+    sample_block_values_type bowpress_env_ptr;
+
+    struct instr *mybow;
+    int temp_ret_value;
+} bowed_susp_node, *bowed_susp_type;
+
+
+	    #include "instr.h"
+
+
+void bowed_s_fetch(register bowed_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mybow_reg;
+    register sample_type bowpress_env_scale_reg = susp->bowpress_env->scale;
+    register sample_block_values_type bowpress_env_ptr_reg;
+    falloc_sample_block(out, "bowed_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the bowpress_env input sample block: */
+	susp_check_term_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+	togo = min(togo, susp->bowpress_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mybow_reg = susp->mybow;
+	bowpress_env_ptr_reg = susp->bowpress_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(mybow_reg, 128, BOW_CONTROL_CHANGE_CONST * (bowpress_env_scale_reg * *bowpress_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(mybow_reg);
+	} while (--n); /* inner loop */
+
+	susp->mybow = mybow_reg;
+	/* using bowpress_env_ptr_reg is a bad idea on RS/6000: */
+	susp->bowpress_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(bowpress_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* bowed_s_fetch */
+
+
+void bowed_toss_fetch(susp, snd_list)
+  register bowed_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from bowpress_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >=
+	   susp->bowpress_env->current)
+	susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr -
+         (susp->bowpress_env->current - susp->bowpress_env_cnt));
+    susp->bowpress_env_ptr += n;
+    susp_took(bowpress_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void bowed_mark(bowed_susp_type susp)
+{
+    sound_xlmark(susp->bowpress_env);
+}
+
+
+void bowed_free(bowed_susp_type susp)
+{
+
+	    deleteInstrument(susp->mybow);
+    sound_unref(susp->bowpress_env);
+    ffree_generic(susp, sizeof(bowed_susp_node), "bowed_free");
+}
+
+
+void bowed_print_tree(bowed_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("bowpress_env:");
+    sound_print_tree_1(susp->bowpress_env, n);
+}
+
+
+sound_type snd_make_bowed(double freq, sound_type bowpress_env, rate_type sr)
+{
+    register bowed_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = bowpress_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, bowed_susp_node, "snd_make_bowed");
+    susp->mybow = initInstrument(BOWED, round(sr));
+    controlChange(susp->mybow, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->mybow, freq, 1.0);
+    susp->susp.fetch = bowed_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < bowpress_env->t0) sound_prepend_zeros(bowpress_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(bowpress_env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = bowed_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = bowed_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = bowed_mark;
+    susp->susp.print_tree = bowed_print_tree;
+    susp->susp.name = "bowed";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->bowpress_env = bowpress_env;
+    susp->bowpress_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_bowed(double freq, sound_type bowpress_env, rate_type sr)
+{
+    sound_type bowpress_env_copy = sound_copy(bowpress_env);
+    return snd_make_bowed(freq, bowpress_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrbow.h b/lib-src/libnyquist/nyquist/tran/instrbow.h
new file mode 100644
index 0000000..2da6d16
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbow.h
@@ -0,0 +1,5 @@
+sound_type snd_make_bowed(double freq, sound_type bowpress_env, rate_type sr);
+sound_type snd_bowed(double freq, sound_type bowpress_env, rate_type sr);
+    /* LISP: (snd-bowed ANYNUM SOUND ANYNUM) */
+
+	    #define BOW_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg
new file mode 100644
index 0000000..dca0b46
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg
@@ -0,0 +1,28 @@
+(INSTRBOWED-FREQ-ALG
+(NAME "bowed_freq")
+(ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env")
+        	("sound_type" "freq_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "mybow" "initInstrument(BOWED, round(sr));
+    controlChange(susp->mybow, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->mybow, freq, 1.0)")
+	("double" "frequency" "freq"))
+(START (min bowpress_env))
+(NOT-IN-INNER-LOOP  "temp_ret_value")
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(MATCHED-SAMPLE-RATE freq_env bowpress_env)
+(TERMINATE (min bowpress_env))
+(INNER-LOOP "
+	    controlChange(mybow, 128, BOW_CONTROL_CHANGE_CONST * bowpress_env);
+            setFrequency(mybow, frequency + freq_env);
+	    output = (sample_type) tick(mybow)")
+(SUPPORT-HEADER "
+	    #define BOW_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mybow);
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c
new file mode 100644
index 0000000..99961bb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c
@@ -0,0 +1,298 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrbowedfreq.h"
+
+void bowed_freq_free();
+
+
+typedef struct bowed_freq_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type bowpress_env;
+    long bowpress_env_cnt;
+    sample_block_values_type bowpress_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+
+    struct instr *mybow;
+    int temp_ret_value;
+    double frequency;
+} bowed_freq_susp_node, *bowed_freq_susp_type;
+
+
+	    #include "instr.h"
+
+
+void bowed_freq_nn_fetch(register bowed_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mybow_reg;
+    register double frequency_reg;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_block_values_type bowpress_env_ptr_reg;
+    falloc_sample_block(out, "bowed_freq_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the bowpress_env input sample block: */
+	susp_check_term_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+	togo = min(togo, susp->bowpress_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mybow_reg = susp->mybow;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	bowpress_env_ptr_reg = susp->bowpress_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(mybow_reg, 128, BOW_CONTROL_CHANGE_CONST * *bowpress_env_ptr_reg++);
+            setFrequency(mybow_reg, frequency_reg + *freq_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(mybow_reg);
+	} while (--n); /* inner loop */
+
+	susp->mybow = mybow_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using bowpress_env_ptr_reg is a bad idea on RS/6000: */
+	susp->bowpress_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(bowpress_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* bowed_freq_nn_fetch */
+
+
+void bowed_freq_ss_fetch(register bowed_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mybow_reg;
+    register double frequency_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type bowpress_env_scale_reg = susp->bowpress_env->scale;
+    register sample_block_values_type bowpress_env_ptr_reg;
+    falloc_sample_block(out, "bowed_freq_ss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the bowpress_env input sample block: */
+	susp_check_term_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+	togo = min(togo, susp->bowpress_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mybow_reg = susp->mybow;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	bowpress_env_ptr_reg = susp->bowpress_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(mybow_reg, 128, BOW_CONTROL_CHANGE_CONST * (bowpress_env_scale_reg * *bowpress_env_ptr_reg++));
+            setFrequency(mybow_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(mybow_reg);
+	} while (--n); /* inner loop */
+
+	susp->mybow = mybow_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using bowpress_env_ptr_reg is a bad idea on RS/6000: */
+	susp->bowpress_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(bowpress_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* bowed_freq_ss_fetch */
+
+
+void bowed_freq_toss_fetch(susp, snd_list)
+  register bowed_freq_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from bowpress_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >=
+	   susp->bowpress_env->current)
+	susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr -
+         (susp->bowpress_env->current - susp->bowpress_env_cnt));
+    susp->bowpress_env_ptr += n;
+    susp_took(bowpress_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void bowed_freq_mark(bowed_freq_susp_type susp)
+{
+    sound_xlmark(susp->bowpress_env);
+    sound_xlmark(susp->freq_env);
+}
+
+
+void bowed_freq_free(bowed_freq_susp_type susp)
+{
+
+	    deleteInstrument(susp->mybow);
+    sound_unref(susp->bowpress_env);
+    sound_unref(susp->freq_env);
+    ffree_generic(susp, sizeof(bowed_freq_susp_node), "bowed_freq_free");
+}
+
+
+void bowed_freq_print_tree(bowed_freq_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("bowpress_env:");
+    sound_print_tree_1(susp->bowpress_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+}
+
+
+sound_type snd_make_bowed_freq(double freq, sound_type bowpress_env, sound_type freq_env, rate_type sr)
+{
+    register bowed_freq_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = bowpress_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, bowed_freq_susp_node, "snd_make_bowed_freq");
+    susp->mybow = initInstrument(BOWED, round(sr));
+    controlChange(susp->mybow, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->mybow, freq, 1.0);
+    susp->frequency = freq;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(bowpress_env, sr);
+    interp_desc = (interp_desc << 2) + interp_style(freq_env, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = bowed_freq_nn_fetch; break;
+      case INTERP_ss: susp->susp.fetch = bowed_freq_ss_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < bowpress_env->t0) sound_prepend_zeros(bowpress_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(bowpress_env->t0, min(freq_env->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = bowed_freq_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = bowed_freq_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = bowed_freq_mark;
+    susp->susp.print_tree = bowed_freq_print_tree;
+    susp->susp.name = "bowed_freq";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->bowpress_env = bowpress_env;
+    susp->bowpress_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_bowed_freq(double freq, sound_type bowpress_env, sound_type freq_env, rate_type sr)
+{
+    sound_type bowpress_env_copy = sound_copy(bowpress_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    return snd_make_bowed_freq(freq, bowpress_env_copy, freq_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.h b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.h
new file mode 100644
index 0000000..8b657c9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.h
@@ -0,0 +1,5 @@
+sound_type snd_make_bowed_freq(double freq, sound_type bowpress_env, sound_type freq_env, rate_type sr);
+sound_type snd_bowed_freq(double freq, sound_type bowpress_env, sound_type freq_env, rate_type sr);
+    /* LISP: (snd-bowed_freq ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define BOW_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrclar.alg b/lib-src/libnyquist/nyquist/tran/instrclar.alg
new file mode 100644
index 0000000..7146792
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclar.alg
@@ -0,0 +1,25 @@
+(INSTRCLAR-ALG
+(NAME "clarinet")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr));
+    controlChange(susp->clar, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->clar, freq, 1.0)"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(ALWAYS-SCALE breath_env)
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(clar, 128, CLAR_CONTROL_CHANGE_CONST * breath_env);
+	    output = (sample_type) tick(clar)")
+(SUPPORT-HEADER "
+	    #define CLAR_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->clar);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrclar.c b/lib-src/libnyquist/nyquist/tran/instrclar.c
new file mode 100644
index 0000000..8f9cb38
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclar.c
@@ -0,0 +1,181 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrclar.h"
+
+void clarinet_free();
+
+
+typedef struct clarinet_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+
+    struct instr *clar;
+    int temp_ret_value;
+} clarinet_susp_node, *clarinet_susp_type;
+
+
+	    #include "instr.h"
+
+
+void clarinet_s_fetch(register clarinet_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * clar_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "clarinet_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	clar_reg = susp->clar;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(clar_reg, 128, CLAR_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(clar_reg);
+	} while (--n); /* inner loop */
+
+	susp->clar = clar_reg;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* clarinet_s_fetch */
+
+
+void clarinet_toss_fetch(susp, snd_list)
+  register clarinet_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void clarinet_mark(clarinet_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+}
+
+
+void clarinet_free(clarinet_susp_type susp)
+{
+
+	    deleteInstrument(susp->clar);
+    sound_unref(susp->breath_env);
+    ffree_generic(susp, sizeof(clarinet_susp_node), "clarinet_free");
+}
+
+
+void clarinet_print_tree(clarinet_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+}
+
+
+sound_type snd_make_clarinet(double freq, sound_type breath_env, rate_type sr)
+{
+    register clarinet_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, clarinet_susp_node, "snd_make_clarinet");
+    susp->clar = initInstrument(CLARINET, round(sr));
+    controlChange(susp->clar, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->clar, freq, 1.0);
+    susp->susp.fetch = clarinet_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = clarinet_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = clarinet_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = clarinet_mark;
+    susp->susp.print_tree = clarinet_print_tree;
+    susp->susp.name = "clarinet";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_clarinet(double freq, sound_type breath_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    return snd_make_clarinet(freq, breath_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrclar.h b/lib-src/libnyquist/nyquist/tran/instrclar.h
new file mode 100644
index 0000000..7408945
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclar.h
@@ -0,0 +1,5 @@
+sound_type snd_make_clarinet(double freq, sound_type breath_env, rate_type sr);
+sound_type snd_clarinet(double freq, sound_type breath_env, rate_type sr);
+    /* LISP: (snd-clarinet ANYNUM SOUND ANYNUM) */
+
+	    #define CLAR_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarall.alg b/lib-src/libnyquist/nyquist/tran/instrclarall.alg
new file mode 100644
index 0000000..a10f26c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarall.alg
@@ -0,0 +1,44 @@
+(INSTRCLAR-COMPLETE-ALG
+
+;; parameters are:
+;;   freq_env -- frequency modulation, aftertouch 128
+;;   breath_env -- amplitude envelope, aftertouch 128
+;;   vibrato_freq -- vibrato frequency, ModFreq 11
+;;   vibrato_gain -- vibrato gain, ModWheel 1
+;;   reed_stiffness -- reed stiffness, ReedStiff 2
+;;   noise -- noise, Noise 4
+;;
+(NAME "clarinet_all")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env")
+    ("double" "vibrato_freq") ("double" "vibrato_gain")
+    ("sound_type" "reed_stiffness") ("sound_type" "noise") ("rate_type" "sr"))
+;; use a constant rate of 1.0 because it will actually be conrolled
+;; by breath_env
+(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr));
+    noteOn(susp->clar, freq, 1.0);
+    controlChange(susp->clar, 11, CLAR_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->clar, 1, CLAR_CONTROL_CHANGE_CONST * vibrato_gain);")
+       ("double" "frequency" "freq"))
+(START (min breath_env))
+(MATCHED-SAMPLE-RATE freq_env breath_env reed_stiffness noise)
+(ALWAYS-SCALE freq_env breath_env reed_stiffness noise)
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(clar, 128, CLAR_CONTROL_CHANGE_CONST * breath_env);
+	    controlChange(clar, 2, CLAR_CONTROL_CHANGE_CONST * reed_stiffness);
+	    controlChange(clar, 4, CLAR_CONTROL_CHANGE_CONST * noise);
+	    setFrequency(clar, frequency + freq_env);
+	    output = (sample_type) tick(clar)")
+(SUPPORT-HEADER "
+	    #define CLAR_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->clar);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarall.c b/lib-src/libnyquist/nyquist/tran/instrclarall.c
new file mode 100644
index 0000000..7b65cc1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarall.c
@@ -0,0 +1,281 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrclarall.h"
+
+void clarinet_all_free();
+
+
+typedef struct clarinet_all_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+    sound_type reed_stiffness;
+    long reed_stiffness_cnt;
+    sample_block_values_type reed_stiffness_ptr;
+    sound_type noise;
+    long noise_cnt;
+    sample_block_values_type noise_ptr;
+
+    struct instr *clar;
+    double frequency;
+} clarinet_all_susp_node, *clarinet_all_susp_type;
+
+
+	    #include "instr.h"
+
+
+void clarinet_all_ssss_fetch(register clarinet_all_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * clar_reg;
+    register double frequency_reg;
+    register sample_type noise_scale_reg = susp->noise->scale;
+    register sample_block_values_type noise_ptr_reg;
+    register sample_type reed_stiffness_scale_reg = susp->reed_stiffness->scale;
+    register sample_block_values_type reed_stiffness_ptr_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "clarinet_all_ssss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past the reed_stiffness input sample block: */
+	susp_check_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt);
+	togo = min(togo, susp->reed_stiffness_cnt);
+
+	/* don't run past the noise input sample block: */
+	susp_check_samples(noise, noise_ptr, noise_cnt);
+	togo = min(togo, susp->noise_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	clar_reg = susp->clar;
+	frequency_reg = susp->frequency;
+	noise_ptr_reg = susp->noise_ptr;
+	reed_stiffness_ptr_reg = susp->reed_stiffness_ptr;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(clar_reg, 128, CLAR_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    controlChange(clar_reg, 2, CLAR_CONTROL_CHANGE_CONST * (reed_stiffness_scale_reg * *reed_stiffness_ptr_reg++));
+	    controlChange(clar_reg, 4, CLAR_CONTROL_CHANGE_CONST * (noise_scale_reg * *noise_ptr_reg++));
+	    setFrequency(clar_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(clar_reg);
+	} while (--n); /* inner loop */
+
+	susp->clar = clar_reg;
+	/* using noise_ptr_reg is a bad idea on RS/6000: */
+	susp->noise_ptr += togo;
+	/* using reed_stiffness_ptr_reg is a bad idea on RS/6000: */
+	susp->reed_stiffness_ptr += togo;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	susp_took(reed_stiffness_cnt, togo);
+	susp_took(noise_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* clarinet_all_ssss_fetch */
+
+
+void clarinet_all_toss_fetch(susp, snd_list)
+  register clarinet_all_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* fetch samples from reed_stiffness up to final_time for this block of zeros */
+    while ((round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >=
+	   susp->reed_stiffness->current)
+	susp_get_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt);
+    /* fetch samples from noise up to final_time for this block of zeros */
+    while ((round((final_time - susp->noise->t0) * susp->noise->sr)) >=
+	   susp->noise->current)
+	susp_get_samples(noise, noise_ptr, noise_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    n = round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr -
+         (susp->reed_stiffness->current - susp->reed_stiffness_cnt));
+    susp->reed_stiffness_ptr += n;
+    susp_took(reed_stiffness_cnt, n);
+    n = round((final_time - susp->noise->t0) * susp->noise->sr -
+         (susp->noise->current - susp->noise_cnt));
+    susp->noise_ptr += n;
+    susp_took(noise_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void clarinet_all_mark(clarinet_all_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+    sound_xlmark(susp->reed_stiffness);
+    sound_xlmark(susp->noise);
+}
+
+
+void clarinet_all_free(clarinet_all_susp_type susp)
+{
+
+	    deleteInstrument(susp->clar);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    sound_unref(susp->reed_stiffness);
+    sound_unref(susp->noise);
+    ffree_generic(susp, sizeof(clarinet_all_susp_node), "clarinet_all_free");
+}
+
+
+void clarinet_all_print_tree(clarinet_all_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+
+    indent(n);
+    stdputstr("reed_stiffness:");
+    sound_print_tree_1(susp->reed_stiffness, n);
+
+    indent(n);
+    stdputstr("noise:");
+    sound_print_tree_1(susp->noise, n);
+}
+
+
+sound_type snd_make_clarinet_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, rate_type sr)
+{
+    register clarinet_all_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, clarinet_all_susp_node, "snd_make_clarinet_all");
+    susp->clar = initInstrument(CLARINET, round(sr));
+    noteOn(susp->clar, freq, 1.0);
+    controlChange(susp->clar, 11, CLAR_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->clar, 1, CLAR_CONTROL_CHANGE_CONST * vibrato_gain);;
+    susp->frequency = freq;
+    susp->susp.fetch = clarinet_all_ssss_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    if (t0 < reed_stiffness->t0) sound_prepend_zeros(reed_stiffness, t0);
+    if (t0 < noise->t0) sound_prepend_zeros(noise, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, min(reed_stiffness->t0, min(noise->t0, t0))));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = clarinet_all_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = clarinet_all_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = clarinet_all_mark;
+    susp->susp.print_tree = clarinet_all_print_tree;
+    susp->susp.name = "clarinet_all";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    susp->reed_stiffness = reed_stiffness;
+    susp->reed_stiffness_cnt = 0;
+    susp->noise = noise;
+    susp->noise_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_clarinet_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    sound_type reed_stiffness_copy = sound_copy(reed_stiffness);
+    sound_type noise_copy = sound_copy(noise);
+    return snd_make_clarinet_all(freq, breath_env_copy, freq_env_copy, vibrato_freq, vibrato_gain, reed_stiffness_copy, noise_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarall.h b/lib-src/libnyquist/nyquist/tran/instrclarall.h
new file mode 100644
index 0000000..5f47d10
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarall.h
@@ -0,0 +1,5 @@
+sound_type snd_make_clarinet_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, rate_type sr);
+sound_type snd_clarinet_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, rate_type sr);
+    /* LISP: (snd-clarinet_all ANYNUM SOUND SOUND ANYNUM ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define CLAR_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg b/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg
new file mode 100644
index 0000000..3e408b6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg
@@ -0,0 +1,29 @@
+(INSTRCLAR-FREQ-ALG
+(NAME "clarinet_freq")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env") 
+           ("rate_type" "sr"))
+(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr));
+    controlChange(susp->clar, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->clar, freq, 1.0)")
+       ("double" "frequency" "freq"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP "temp_ret_value")
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(MATCHED-SAMPLE-RATE freq_env breath_env)
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(clar, 128, CLAR_CONTROL_CHANGE_CONST * breath_env);
+	    setFrequency(clar, frequency + freq_env);
+	    output = (sample_type) tick(clar)")
+(SUPPORT-HEADER "
+	    #define CLAR_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->clar);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarfreq.c b/lib-src/libnyquist/nyquist/tran/instrclarfreq.c
new file mode 100644
index 0000000..7f1e8c6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarfreq.c
@@ -0,0 +1,298 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrclarfreq.h"
+
+void clarinet_freq_free();
+
+
+typedef struct clarinet_freq_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+
+    struct instr *clar;
+    int temp_ret_value;
+    double frequency;
+} clarinet_freq_susp_node, *clarinet_freq_susp_type;
+
+
+	    #include "instr.h"
+
+
+void clarinet_freq_nn_fetch(register clarinet_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * clar_reg;
+    register double frequency_reg;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "clarinet_freq_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	clar_reg = susp->clar;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(clar_reg, 128, CLAR_CONTROL_CHANGE_CONST * *breath_env_ptr_reg++);
+	    setFrequency(clar_reg, frequency_reg + *freq_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(clar_reg);
+	} while (--n); /* inner loop */
+
+	susp->clar = clar_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* clarinet_freq_nn_fetch */
+
+
+void clarinet_freq_ss_fetch(register clarinet_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * clar_reg;
+    register double frequency_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "clarinet_freq_ss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	clar_reg = susp->clar;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(clar_reg, 128, CLAR_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    setFrequency(clar_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(clar_reg);
+	} while (--n); /* inner loop */
+
+	susp->clar = clar_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* clarinet_freq_ss_fetch */
+
+
+void clarinet_freq_toss_fetch(susp, snd_list)
+  register clarinet_freq_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void clarinet_freq_mark(clarinet_freq_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+}
+
+
+void clarinet_freq_free(clarinet_freq_susp_type susp)
+{
+
+	    deleteInstrument(susp->clar);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    ffree_generic(susp, sizeof(clarinet_freq_susp_node), "clarinet_freq_free");
+}
+
+
+void clarinet_freq_print_tree(clarinet_freq_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+}
+
+
+sound_type snd_make_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    register clarinet_freq_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, clarinet_freq_susp_node, "snd_make_clarinet_freq");
+    susp->clar = initInstrument(CLARINET, round(sr));
+    controlChange(susp->clar, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->clar, freq, 1.0);
+    susp->frequency = freq;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(breath_env, sr);
+    interp_desc = (interp_desc << 2) + interp_style(freq_env, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = clarinet_freq_nn_fetch; break;
+      case INTERP_ss: susp->susp.fetch = clarinet_freq_ss_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = clarinet_freq_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = clarinet_freq_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = clarinet_freq_mark;
+    susp->susp.print_tree = clarinet_freq_print_tree;
+    susp->susp.name = "clarinet_freq";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    return snd_make_clarinet_freq(freq, breath_env_copy, freq_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrclarfreq.h b/lib-src/libnyquist/nyquist/tran/instrclarfreq.h
new file mode 100644
index 0000000..1ee6a22
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrclarfreq.h
@@ -0,0 +1,5 @@
+sound_type snd_make_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+sound_type snd_clarinet_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+    /* LISP: (snd-clarinet_freq ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define CLAR_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrflute.alg b/lib-src/libnyquist/nyquist/tran/instrflute.alg
new file mode 100644
index 0000000..363d9a5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflute.alg
@@ -0,0 +1,25 @@
+(INSTRFLUTE-ALG
+(NAME "flute")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr));
+    controlChange(susp->myflute, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->myflute, freq, 1.0)"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(ALWAYS-SCALE breath_env)
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(myflute, 128, FLUTE_CONTROL_CHANGE_CONST * breath_env);
+	    output = (sample_type) tick(myflute)")
+(SUPPORT-HEADER "
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->myflute);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrflute.c b/lib-src/libnyquist/nyquist/tran/instrflute.c
new file mode 100644
index 0000000..eebefed
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflute.c
@@ -0,0 +1,181 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrflute.h"
+
+void flute_free();
+
+
+typedef struct flute_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+
+    struct instr *myflute;
+    int temp_ret_value;
+} flute_susp_node, *flute_susp_type;
+
+
+	    #include "instr.h"
+
+
+void flute_s_fetch(register flute_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * myflute_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "flute_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	myflute_reg = susp->myflute;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(myflute_reg, 128, FLUTE_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(myflute_reg);
+	} while (--n); /* inner loop */
+
+	susp->myflute = myflute_reg;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* flute_s_fetch */
+
+
+void flute_toss_fetch(susp, snd_list)
+  register flute_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void flute_mark(flute_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+}
+
+
+void flute_free(flute_susp_type susp)
+{
+
+	    deleteInstrument(susp->myflute);
+    sound_unref(susp->breath_env);
+    ffree_generic(susp, sizeof(flute_susp_node), "flute_free");
+}
+
+
+void flute_print_tree(flute_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+}
+
+
+sound_type snd_make_flute(double freq, sound_type breath_env, rate_type sr)
+{
+    register flute_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, flute_susp_node, "snd_make_flute");
+    susp->myflute = initInstrument(FLUTE, round(sr));
+    controlChange(susp->myflute, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->myflute, freq, 1.0);
+    susp->susp.fetch = flute_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = flute_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = flute_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = flute_mark;
+    susp->susp.print_tree = flute_print_tree;
+    susp->susp.name = "flute";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_flute(double freq, sound_type breath_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    return snd_make_flute(freq, breath_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrflute.h b/lib-src/libnyquist/nyquist/tran/instrflute.h
new file mode 100644
index 0000000..3158cbd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflute.h
@@ -0,0 +1,5 @@
+sound_type snd_make_flute(double freq, sound_type breath_env, rate_type sr);
+sound_type snd_flute(double freq, sound_type breath_env, rate_type sr);
+    /* LISP: (snd-flute ANYNUM SOUND ANYNUM) */
+
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrfluteall.alg b/lib-src/libnyquist/nyquist/tran/instrfluteall.alg
new file mode 100644
index 0000000..045b52b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrfluteall.alg
@@ -0,0 +1,43 @@
+(INSTRFLUTEALL-ALG
+
+;; parameters are:
+;;   freq_env -- frequency modulation, aftertouch 128
+;;   breath_env -- amplitude envelope, aftertouch 128
+;;   vibrato_freq -- vibrato frequency, ModFreq 11
+;;   vibrato_gain -- vibrato gain, ModWheel 1
+;;   jet_delay -- jet delay, 2
+;;   noise -- noise, Noise 4
+;;
+(NAME "flute_all")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env")
+    ("double" "vibrato_freq") ("double" "vibrato_gain")
+    ("sound_type" "jet_delay") ("sound_type" "noise") ("rate_type" "sr"))
+;; use a constant rate of 1.0 because it will actually be conrolled
+;; by breath_env
+(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr));
+    noteOn(susp->myflute, freq, 1.0);
+    controlChange(susp->myflute, 11, FLUTE_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->myflute, 1, FLUTE_CONTROL_CHANGE_CONST * vibrato_gain);")
+       ("double" "frequency" "freq"))
+(START (min breath_env))
+(MATCHED-SAMPLE-RATE freq_env breath_env jet_delay noise)
+(ALWAYS-SCALE freq_env breath_env jet_delay noise)
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(myflute, 128, FLUTE_CONTROL_CHANGE_CONST * breath_env);
+	    controlChange(myflute, 2, FLUTE_CONTROL_CHANGE_CONST * jet_delay);
+	    controlChange(myflute, 4, FLUTE_CONTROL_CHANGE_CONST * noise);
+	    setFrequency(myflute, frequency + freq_env);
+	    output = (sample_type) tick(myflute)")
+(SUPPORT-HEADER "
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->myflute);
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/instrfluteall.c b/lib-src/libnyquist/nyquist/tran/instrfluteall.c
new file mode 100644
index 0000000..64e3f56
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrfluteall.c
@@ -0,0 +1,281 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrfluteall.h"
+
+void flute_all_free();
+
+
+typedef struct flute_all_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+    sound_type jet_delay;
+    long jet_delay_cnt;
+    sample_block_values_type jet_delay_ptr;
+    sound_type noise;
+    long noise_cnt;
+    sample_block_values_type noise_ptr;
+
+    struct instr *myflute;
+    double frequency;
+} flute_all_susp_node, *flute_all_susp_type;
+
+
+	    #include "instr.h"
+
+
+void flute_all_ssss_fetch(register flute_all_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * myflute_reg;
+    register double frequency_reg;
+    register sample_type noise_scale_reg = susp->noise->scale;
+    register sample_block_values_type noise_ptr_reg;
+    register sample_type jet_delay_scale_reg = susp->jet_delay->scale;
+    register sample_block_values_type jet_delay_ptr_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "flute_all_ssss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past the jet_delay input sample block: */
+	susp_check_samples(jet_delay, jet_delay_ptr, jet_delay_cnt);
+	togo = min(togo, susp->jet_delay_cnt);
+
+	/* don't run past the noise input sample block: */
+	susp_check_samples(noise, noise_ptr, noise_cnt);
+	togo = min(togo, susp->noise_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	myflute_reg = susp->myflute;
+	frequency_reg = susp->frequency;
+	noise_ptr_reg = susp->noise_ptr;
+	jet_delay_ptr_reg = susp->jet_delay_ptr;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(myflute_reg, 128, FLUTE_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    controlChange(myflute_reg, 2, FLUTE_CONTROL_CHANGE_CONST * (jet_delay_scale_reg * *jet_delay_ptr_reg++));
+	    controlChange(myflute_reg, 4, FLUTE_CONTROL_CHANGE_CONST * (noise_scale_reg * *noise_ptr_reg++));
+	    setFrequency(myflute_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(myflute_reg);
+	} while (--n); /* inner loop */
+
+	susp->myflute = myflute_reg;
+	/* using noise_ptr_reg is a bad idea on RS/6000: */
+	susp->noise_ptr += togo;
+	/* using jet_delay_ptr_reg is a bad idea on RS/6000: */
+	susp->jet_delay_ptr += togo;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	susp_took(jet_delay_cnt, togo);
+	susp_took(noise_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* flute_all_ssss_fetch */
+
+
+void flute_all_toss_fetch(susp, snd_list)
+  register flute_all_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* fetch samples from jet_delay up to final_time for this block of zeros */
+    while ((round((final_time - susp->jet_delay->t0) * susp->jet_delay->sr)) >=
+	   susp->jet_delay->current)
+	susp_get_samples(jet_delay, jet_delay_ptr, jet_delay_cnt);
+    /* fetch samples from noise up to final_time for this block of zeros */
+    while ((round((final_time - susp->noise->t0) * susp->noise->sr)) >=
+	   susp->noise->current)
+	susp_get_samples(noise, noise_ptr, noise_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    n = round((final_time - susp->jet_delay->t0) * susp->jet_delay->sr -
+         (susp->jet_delay->current - susp->jet_delay_cnt));
+    susp->jet_delay_ptr += n;
+    susp_took(jet_delay_cnt, n);
+    n = round((final_time - susp->noise->t0) * susp->noise->sr -
+         (susp->noise->current - susp->noise_cnt));
+    susp->noise_ptr += n;
+    susp_took(noise_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void flute_all_mark(flute_all_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+    sound_xlmark(susp->jet_delay);
+    sound_xlmark(susp->noise);
+}
+
+
+void flute_all_free(flute_all_susp_type susp)
+{
+
+	    deleteInstrument(susp->myflute);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    sound_unref(susp->jet_delay);
+    sound_unref(susp->noise);
+    ffree_generic(susp, sizeof(flute_all_susp_node), "flute_all_free");
+}
+
+
+void flute_all_print_tree(flute_all_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+
+    indent(n);
+    stdputstr("jet_delay:");
+    sound_print_tree_1(susp->jet_delay, n);
+
+    indent(n);
+    stdputstr("noise:");
+    sound_print_tree_1(susp->noise, n);
+}
+
+
+sound_type snd_make_flute_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type jet_delay, sound_type noise, rate_type sr)
+{
+    register flute_all_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, flute_all_susp_node, "snd_make_flute_all");
+    susp->myflute = initInstrument(FLUTE, round(sr));
+    noteOn(susp->myflute, freq, 1.0);
+    controlChange(susp->myflute, 11, FLUTE_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->myflute, 1, FLUTE_CONTROL_CHANGE_CONST * vibrato_gain);;
+    susp->frequency = freq;
+    susp->susp.fetch = flute_all_ssss_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    if (t0 < jet_delay->t0) sound_prepend_zeros(jet_delay, t0);
+    if (t0 < noise->t0) sound_prepend_zeros(noise, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, min(jet_delay->t0, min(noise->t0, t0))));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = flute_all_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = flute_all_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = flute_all_mark;
+    susp->susp.print_tree = flute_all_print_tree;
+    susp->susp.name = "flute_all";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    susp->jet_delay = jet_delay;
+    susp->jet_delay_cnt = 0;
+    susp->noise = noise;
+    susp->noise_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_flute_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type jet_delay, sound_type noise, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    sound_type jet_delay_copy = sound_copy(jet_delay);
+    sound_type noise_copy = sound_copy(noise);
+    return snd_make_flute_all(freq, breath_env_copy, freq_env_copy, vibrato_freq, vibrato_gain, jet_delay_copy, noise_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrfluteall.h b/lib-src/libnyquist/nyquist/tran/instrfluteall.h
new file mode 100644
index 0000000..f8ca679
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrfluteall.h
@@ -0,0 +1,5 @@
+sound_type snd_make_flute_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type jet_delay, sound_type noise, rate_type sr);
+sound_type snd_flute_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type jet_delay, sound_type noise, rate_type sr);
+    /* LISP: (snd-flute_all ANYNUM SOUND SOUND ANYNUM ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg b/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg
new file mode 100644
index 0000000..bab34ec
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg
@@ -0,0 +1,28 @@
+(INSTRFLUTE-FREQ--ALG
+(NAME "flute_freq")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env")
+        	("sound_type" "freq_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr));
+    controlChange(susp->myflute, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->myflute, freq, 1.0)")
+	("double" "frequency" "freq"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP  "temp_ret_value")
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(MATCHED-SAMPLE-RATE freq_env breath_env)
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(myflute, 128, FLUTE_CONTROL_CHANGE_CONST * breath_env);
+            setFrequency(myflute, frequency + freq_env);
+	    output = (sample_type) tick(myflute)")
+(SUPPORT-HEADER "
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->myflute);
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/instrflutefreq.c b/lib-src/libnyquist/nyquist/tran/instrflutefreq.c
new file mode 100644
index 0000000..8369edf
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflutefreq.c
@@ -0,0 +1,298 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrflutefreq.h"
+
+void flute_freq_free();
+
+
+typedef struct flute_freq_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+
+    struct instr *myflute;
+    int temp_ret_value;
+    double frequency;
+} flute_freq_susp_node, *flute_freq_susp_type;
+
+
+	    #include "instr.h"
+
+
+void flute_freq_nn_fetch(register flute_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * myflute_reg;
+    register double frequency_reg;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "flute_freq_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	myflute_reg = susp->myflute;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(myflute_reg, 128, FLUTE_CONTROL_CHANGE_CONST * *breath_env_ptr_reg++);
+            setFrequency(myflute_reg, frequency_reg + *freq_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(myflute_reg);
+	} while (--n); /* inner loop */
+
+	susp->myflute = myflute_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* flute_freq_nn_fetch */
+
+
+void flute_freq_ss_fetch(register flute_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * myflute_reg;
+    register double frequency_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "flute_freq_ss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	myflute_reg = susp->myflute;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(myflute_reg, 128, FLUTE_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+            setFrequency(myflute_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(myflute_reg);
+	} while (--n); /* inner loop */
+
+	susp->myflute = myflute_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* flute_freq_ss_fetch */
+
+
+void flute_freq_toss_fetch(susp, snd_list)
+  register flute_freq_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void flute_freq_mark(flute_freq_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+}
+
+
+void flute_freq_free(flute_freq_susp_type susp)
+{
+
+	    deleteInstrument(susp->myflute);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    ffree_generic(susp, sizeof(flute_freq_susp_node), "flute_freq_free");
+}
+
+
+void flute_freq_print_tree(flute_freq_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+}
+
+
+sound_type snd_make_flute_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    register flute_freq_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, flute_freq_susp_node, "snd_make_flute_freq");
+    susp->myflute = initInstrument(FLUTE, round(sr));
+    controlChange(susp->myflute, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->myflute, freq, 1.0);
+    susp->frequency = freq;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(breath_env, sr);
+    interp_desc = (interp_desc << 2) + interp_style(freq_env, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = flute_freq_nn_fetch; break;
+      case INTERP_ss: susp->susp.fetch = flute_freq_ss_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = flute_freq_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = flute_freq_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = flute_freq_mark;
+    susp->susp.print_tree = flute_freq_print_tree;
+    susp->susp.name = "flute_freq";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_flute_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    return snd_make_flute_freq(freq, breath_env_copy, freq_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrflutefreq.h b/lib-src/libnyquist/nyquist/tran/instrflutefreq.h
new file mode 100644
index 0000000..15ca31d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrflutefreq.h
@@ -0,0 +1,5 @@
+sound_type snd_make_flute_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+sound_type snd_flute_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+    /* LISP: (snd-flute_freq ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define FLUTE_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrmandolin.alg b/lib-src/libnyquist/nyquist/tran/instrmandolin.alg
new file mode 100644
index 0000000..4d1654e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmandolin.alg
@@ -0,0 +1,25 @@
+(INSTRMANDOLIN-ALG
+(NAME "mandolin")
+(ARGUMENTS ("time_type" "t0")("double" "freq") ("time_type" "d") 
+           ("double" "body_size")("double" "detune")("rate_type" "sr"))
+(STATE ("struct instr *" "mymand" "initInstrument(MANDOLIN, round(sr));
+      controlChange(susp->mymand, 1, detune);
+      controlChange(susp->mymand, 2, MAND_CONTROL_CHANGE_CONST * body_size);")
+       ("int" "temp_ret_value" "noteOn(susp->mymand, freq, 1.0)"))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value"  "body_size" "detune")
+(SAMPLE-RATE "sr")
+(TERMINATE (after "d"))
+(INNER-LOOP "
+	    output = (sample_type) tick(mymand)")
+(SUPPORT-HEADER "
+	    #define MAND_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mymand);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrmandolin.c b/lib-src/libnyquist/nyquist/tran/instrmandolin.c
new file mode 100644
index 0000000..6beae2a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmandolin.c
@@ -0,0 +1,121 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrmandolin.h"
+
+void mandolin_free();
+
+
+typedef struct mandolin_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    struct instr *mymand;
+    int temp_ret_value;
+} mandolin_susp_node, *mandolin_susp_type;
+
+
+	    #include "instr.h"
+
+
+
+void mandolin__fetch(register mandolin_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mymand_reg;
+    falloc_sample_block(out, "mandolin__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mymand_reg = susp->mymand;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    *out_ptr_reg++ = (sample_type) tick(mymand_reg);
+	} while (--n); /* inner loop */
+
+	susp->mymand = mymand_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* mandolin__fetch */
+
+
+void mandolin_free(mandolin_susp_type susp)
+{
+
+	    deleteInstrument(susp->mymand);
+    ffree_generic(susp, sizeof(mandolin_susp_node), "mandolin_free");
+}
+
+
+void mandolin_print_tree(mandolin_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_mandolin(time_type t0, double freq, time_type d, double body_size, double detune, rate_type sr)
+{
+    register mandolin_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, mandolin_susp_node, "snd_make_mandolin");
+    susp->mymand = initInstrument(MANDOLIN, round(sr));
+      controlChange(susp->mymand, 1, detune);
+      controlChange(susp->mymand, 2, MAND_CONTROL_CHANGE_CONST * body_size);;
+    susp->temp_ret_value = noteOn(susp->mymand, freq, 1.0);
+    susp->susp.fetch = mandolin__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = mandolin_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = mandolin_print_tree;
+    susp->susp.name = "mandolin";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_mandolin(time_type t0, double freq, time_type d, double body_size, double detune, rate_type sr)
+{
+    return snd_make_mandolin(t0, freq, d, body_size, detune, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrmandolin.h b/lib-src/libnyquist/nyquist/tran/instrmandolin.h
new file mode 100644
index 0000000..965cbe3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmandolin.h
@@ -0,0 +1,5 @@
+sound_type snd_make_mandolin(time_type t0, double freq, time_type d, double body_size, double detune, rate_type sr);
+sound_type snd_mandolin(time_type t0, double freq, time_type d, double body_size, double detune, rate_type sr);
+    /* LISP: (snd-mandolin ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
+
+	    #define MAND_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg b/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg
new file mode 100644
index 0000000..4a2cc34
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg
@@ -0,0 +1,19 @@
+(INSTRMODALBAR-ALG
+(NAME "modalbar")
+(ARGUMENTS ("time_type" "t0")("double" "freq") ("int" "preset")("time_type" "dur") ("rate_type" "sr"))
+(STATE ("struct instr *" "mymbar" "initInstrument(MODALBAR, round(sr));
+                  controlChange(susp->mymbar, 16, preset);")
+       ("int" "temp_ret_value" "noteOn(susp->mymbar, freq, 1.0);"))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(TERMINATE (after "dur"))
+(INNER-LOOP "
+	    output = (sample_type) tick(mymbar)")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mymbar);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrmodalbar.c b/lib-src/libnyquist/nyquist/tran/instrmodalbar.c
new file mode 100644
index 0000000..29b0035
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmodalbar.c
@@ -0,0 +1,119 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrmodalbar.h"
+
+void modalbar_free();
+
+
+typedef struct modalbar_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    struct instr *mymbar;
+    int temp_ret_value;
+} modalbar_susp_node, *modalbar_susp_type;
+
+
+	    #include "instr.h"
+
+
+void modalbar__fetch(register modalbar_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mymbar_reg;
+    falloc_sample_block(out, "modalbar__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mymbar_reg = susp->mymbar;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    *out_ptr_reg++ = (sample_type) tick(mymbar_reg);
+	} while (--n); /* inner loop */
+
+	susp->mymbar = mymbar_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* modalbar__fetch */
+
+
+void modalbar_free(modalbar_susp_type susp)
+{
+
+	    deleteInstrument(susp->mymbar);
+    ffree_generic(susp, sizeof(modalbar_susp_node), "modalbar_free");
+}
+
+
+void modalbar_print_tree(modalbar_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_modalbar(time_type t0, double freq, int preset, time_type dur, rate_type sr)
+{
+    register modalbar_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, modalbar_susp_node, "snd_make_modalbar");
+    susp->mymbar = initInstrument(MODALBAR, round(sr));
+                  controlChange(susp->mymbar, 16, preset);;
+    susp->temp_ret_value = noteOn(susp->mymbar, freq, 1.0);;
+    susp->susp.fetch = modalbar__fetch;
+
+    susp->terminate_cnt = round((dur) * sr);
+    /* initialize susp state */
+    susp->susp.free = modalbar_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = modalbar_print_tree;
+    susp->susp.name = "modalbar";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_modalbar(time_type t0, double freq, int preset, time_type dur, rate_type sr)
+{
+    return snd_make_modalbar(t0, freq, preset, dur, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrmodalbar.h b/lib-src/libnyquist/nyquist/tran/instrmodalbar.h
new file mode 100644
index 0000000..21c9ac4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrmodalbar.h
@@ -0,0 +1,3 @@
+sound_type snd_make_modalbar(time_type t0, double freq, int preset, time_type dur, rate_type sr);
+sound_type snd_modalbar(time_type t0, double freq, int preset, time_type dur, rate_type sr);
+    /* LISP: (snd-modalbar ANYNUM ANYNUM FIXNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/instrsax.alg b/lib-src/libnyquist/nyquist/tran/instrsax.alg
new file mode 100644
index 0000000..d708839
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsax.alg
@@ -0,0 +1,24 @@
+(INSTRSAX-ALG
+(NAME "sax")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr));
+    controlChange(susp->sax, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->sax, freq, 1.0)"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(sax, 128, SAX_CONTROL_CHANGE_CONST * breath_env);
+	    output = (sample_type) tick(sax)")
+(SUPPORT-HEADER "
+	    #define SAX_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->sax);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrsax.c b/lib-src/libnyquist/nyquist/tran/instrsax.c
new file mode 100644
index 0000000..e70b3a6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsax.c
@@ -0,0 +1,249 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrsax.h"
+
+void sax_free();
+
+
+typedef struct sax_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+
+    struct instr *sax;
+    int temp_ret_value;
+} sax_susp_node, *sax_susp_type;
+
+
+	    #include "instr.h"
+
+
+void sax_n_fetch(register sax_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * *breath_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_n_fetch */
+
+
+void sax_s_fetch(register sax_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_s_fetch */
+
+
+void sax_toss_fetch(susp, snd_list)
+  register sax_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void sax_mark(sax_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+}
+
+
+void sax_free(sax_susp_type susp)
+{
+
+	    deleteInstrument(susp->sax);
+    sound_unref(susp->breath_env);
+    ffree_generic(susp, sizeof(sax_susp_node), "sax_free");
+}
+
+
+void sax_print_tree(sax_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+}
+
+
+sound_type snd_make_sax(double freq, sound_type breath_env, rate_type sr)
+{
+    register sax_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, sax_susp_node, "snd_make_sax");
+    susp->sax = initInstrument(SAXOFONY, round(sr));
+    controlChange(susp->sax, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->sax, freq, 1.0);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(breath_env, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = sax_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = sax_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = sax_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = sax_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = sax_mark;
+    susp->susp.print_tree = sax_print_tree;
+    susp->susp.name = "sax";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sax(double freq, sound_type breath_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    return snd_make_sax(freq, breath_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrsax.h b/lib-src/libnyquist/nyquist/tran/instrsax.h
new file mode 100644
index 0000000..4227342
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsax.h
@@ -0,0 +1,5 @@
+sound_type snd_make_sax(double freq, sound_type breath_env, rate_type sr);
+sound_type snd_sax(double freq, sound_type breath_env, rate_type sr);
+    /* LISP: (snd-sax ANYNUM SOUND ANYNUM) */
+
+	    #define SAX_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxall.alg b/lib-src/libnyquist/nyquist/tran/instrsaxall.alg
new file mode 100644
index 0000000..bcc61ad
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxall.alg
@@ -0,0 +1,38 @@
+(INSTRSAX-COMPLETE-ALG
+(NAME "sax_all")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env")
+        ("double" "vibrato_freq") ("double" "vibrato_gain")
+	("sound_type" "reed_stiffness") ("sound_type" "noise") 
+        ("sound_type" "blow_pos") ("sound_type" "reed_table_offset")
+        ("rate_type" "sr"))
+(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr));
+    noteOn(susp->sax, freq, 1.0);
+    controlChange(susp->sax, 29, SAX_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->sax, 1, SAX_CONTROL_CHANGE_CONST * vibrato_gain);")
+       ("double" "frequency" "freq"))
+(START (min breath_env))
+(MATCHED-SAMPLE-RATE freq_env breath_env 
+                     reed_stiffness noise blow_pos reed_table_offset)
+(CONSTANT "frequency")
+(ALWAYS-SCALE freq_env breath_env reed_stiffness noise blow_pos reed_table_offset)
+(SAMPLE-RATE "sr")
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(sax, 128, SAX_CONTROL_CHANGE_CONST * breath_env);
+	    controlChange(sax, 2, SAX_CONTROL_CHANGE_CONST * reed_stiffness);
+	    controlChange(sax, 4, SAX_CONTROL_CHANGE_CONST * noise);
+	    controlChange(sax, 11, SAX_CONTROL_CHANGE_CONST * blow_pos);
+	    controlChange(sax, 26, SAX_CONTROL_CHANGE_CONST * reed_table_offset);
+	    setFrequency(sax, frequency + freq_env);
+	    output = (sample_type) tick(sax)")
+(SUPPORT-HEADER "
+	    #define SAX_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->sax);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxall.c b/lib-src/libnyquist/nyquist/tran/instrsaxall.c
new file mode 100644
index 0000000..6b0aa89
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxall.c
@@ -0,0 +1,345 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrsaxall.h"
+
+void sax_all_free();
+
+
+typedef struct sax_all_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+    sound_type reed_stiffness;
+    long reed_stiffness_cnt;
+    sample_block_values_type reed_stiffness_ptr;
+    sound_type noise;
+    long noise_cnt;
+    sample_block_values_type noise_ptr;
+    sound_type blow_pos;
+    long blow_pos_cnt;
+    sample_block_values_type blow_pos_ptr;
+    sound_type reed_table_offset;
+    long reed_table_offset_cnt;
+    sample_block_values_type reed_table_offset_ptr;
+
+    struct instr *sax;
+    double frequency;
+} sax_all_susp_node, *sax_all_susp_type;
+
+
+	    #include "instr.h"
+
+
+void sax_all_ssssss_fetch(register sax_all_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register double frequency_reg;
+    register sample_type reed_table_offset_scale_reg = susp->reed_table_offset->scale;
+    register sample_block_values_type reed_table_offset_ptr_reg;
+    register sample_type blow_pos_scale_reg = susp->blow_pos->scale;
+    register sample_block_values_type blow_pos_ptr_reg;
+    register sample_type noise_scale_reg = susp->noise->scale;
+    register sample_block_values_type noise_ptr_reg;
+    register sample_type reed_stiffness_scale_reg = susp->reed_stiffness->scale;
+    register sample_block_values_type reed_stiffness_ptr_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_all_ssssss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past the reed_stiffness input sample block: */
+	susp_check_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt);
+	togo = min(togo, susp->reed_stiffness_cnt);
+
+	/* don't run past the noise input sample block: */
+	susp_check_samples(noise, noise_ptr, noise_cnt);
+	togo = min(togo, susp->noise_cnt);
+
+	/* don't run past the blow_pos input sample block: */
+	susp_check_samples(blow_pos, blow_pos_ptr, blow_pos_cnt);
+	togo = min(togo, susp->blow_pos_cnt);
+
+	/* don't run past the reed_table_offset input sample block: */
+	susp_check_samples(reed_table_offset, reed_table_offset_ptr, reed_table_offset_cnt);
+	togo = min(togo, susp->reed_table_offset_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	frequency_reg = susp->frequency;
+	reed_table_offset_ptr_reg = susp->reed_table_offset_ptr;
+	blow_pos_ptr_reg = susp->blow_pos_ptr;
+	noise_ptr_reg = susp->noise_ptr;
+	reed_stiffness_ptr_reg = susp->reed_stiffness_ptr;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    controlChange(sax_reg, 2, SAX_CONTROL_CHANGE_CONST * (reed_stiffness_scale_reg * *reed_stiffness_ptr_reg++));
+	    controlChange(sax_reg, 4, SAX_CONTROL_CHANGE_CONST * (noise_scale_reg * *noise_ptr_reg++));
+	    controlChange(sax_reg, 11, SAX_CONTROL_CHANGE_CONST * (blow_pos_scale_reg * *blow_pos_ptr_reg++));
+	    controlChange(sax_reg, 26, SAX_CONTROL_CHANGE_CONST * (reed_table_offset_scale_reg * *reed_table_offset_ptr_reg++));
+	    setFrequency(sax_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using reed_table_offset_ptr_reg is a bad idea on RS/6000: */
+	susp->reed_table_offset_ptr += togo;
+	/* using blow_pos_ptr_reg is a bad idea on RS/6000: */
+	susp->blow_pos_ptr += togo;
+	/* using noise_ptr_reg is a bad idea on RS/6000: */
+	susp->noise_ptr += togo;
+	/* using reed_stiffness_ptr_reg is a bad idea on RS/6000: */
+	susp->reed_stiffness_ptr += togo;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	susp_took(reed_stiffness_cnt, togo);
+	susp_took(noise_cnt, togo);
+	susp_took(blow_pos_cnt, togo);
+	susp_took(reed_table_offset_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_all_ssssss_fetch */
+
+
+void sax_all_toss_fetch(susp, snd_list)
+  register sax_all_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* fetch samples from reed_stiffness up to final_time for this block of zeros */
+    while ((round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >=
+	   susp->reed_stiffness->current)
+	susp_get_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt);
+    /* fetch samples from noise up to final_time for this block of zeros */
+    while ((round((final_time - susp->noise->t0) * susp->noise->sr)) >=
+	   susp->noise->current)
+	susp_get_samples(noise, noise_ptr, noise_cnt);
+    /* fetch samples from blow_pos up to final_time for this block of zeros */
+    while ((round((final_time - susp->blow_pos->t0) * susp->blow_pos->sr)) >=
+	   susp->blow_pos->current)
+	susp_get_samples(blow_pos, blow_pos_ptr, blow_pos_cnt);
+    /* fetch samples from reed_table_offset up to final_time for this block of zeros */
+    while ((round((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr)) >=
+	   susp->reed_table_offset->current)
+	susp_get_samples(reed_table_offset, reed_table_offset_ptr, reed_table_offset_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    n = round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr -
+         (susp->reed_stiffness->current - susp->reed_stiffness_cnt));
+    susp->reed_stiffness_ptr += n;
+    susp_took(reed_stiffness_cnt, n);
+    n = round((final_time - susp->noise->t0) * susp->noise->sr -
+         (susp->noise->current - susp->noise_cnt));
+    susp->noise_ptr += n;
+    susp_took(noise_cnt, n);
+    n = round((final_time - susp->blow_pos->t0) * susp->blow_pos->sr -
+         (susp->blow_pos->current - susp->blow_pos_cnt));
+    susp->blow_pos_ptr += n;
+    susp_took(blow_pos_cnt, n);
+    n = round((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr -
+         (susp->reed_table_offset->current - susp->reed_table_offset_cnt));
+    susp->reed_table_offset_ptr += n;
+    susp_took(reed_table_offset_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void sax_all_mark(sax_all_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+    sound_xlmark(susp->reed_stiffness);
+    sound_xlmark(susp->noise);
+    sound_xlmark(susp->blow_pos);
+    sound_xlmark(susp->reed_table_offset);
+}
+
+
+void sax_all_free(sax_all_susp_type susp)
+{
+
+	    deleteInstrument(susp->sax);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    sound_unref(susp->reed_stiffness);
+    sound_unref(susp->noise);
+    sound_unref(susp->blow_pos);
+    sound_unref(susp->reed_table_offset);
+    ffree_generic(susp, sizeof(sax_all_susp_node), "sax_all_free");
+}
+
+
+void sax_all_print_tree(sax_all_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+
+    indent(n);
+    stdputstr("reed_stiffness:");
+    sound_print_tree_1(susp->reed_stiffness, n);
+
+    indent(n);
+    stdputstr("noise:");
+    sound_print_tree_1(susp->noise, n);
+
+    indent(n);
+    stdputstr("blow_pos:");
+    sound_print_tree_1(susp->blow_pos, n);
+
+    indent(n);
+    stdputstr("reed_table_offset:");
+    sound_print_tree_1(susp->reed_table_offset, n);
+}
+
+
+sound_type snd_make_sax_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, sound_type blow_pos, sound_type reed_table_offset, rate_type sr)
+{
+    register sax_all_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, sax_all_susp_node, "snd_make_sax_all");
+    susp->sax = initInstrument(SAXOFONY, round(sr));
+    noteOn(susp->sax, freq, 1.0);
+    controlChange(susp->sax, 29, SAX_CONTROL_CHANGE_CONST * vibrato_freq);
+    controlChange(susp->sax, 1, SAX_CONTROL_CHANGE_CONST * vibrato_gain);;
+    susp->frequency = freq;
+    susp->susp.fetch = sax_all_ssssss_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    if (t0 < reed_stiffness->t0) sound_prepend_zeros(reed_stiffness, t0);
+    if (t0 < noise->t0) sound_prepend_zeros(noise, t0);
+    if (t0 < blow_pos->t0) sound_prepend_zeros(blow_pos, t0);
+    if (t0 < reed_table_offset->t0) sound_prepend_zeros(reed_table_offset, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, min(reed_stiffness->t0, min(noise->t0, min(blow_pos->t0, min(reed_table_offset->t0, t0))))));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = sax_all_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = sax_all_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = sax_all_mark;
+    susp->susp.print_tree = sax_all_print_tree;
+    susp->susp.name = "sax_all";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    susp->reed_stiffness = reed_stiffness;
+    susp->reed_stiffness_cnt = 0;
+    susp->noise = noise;
+    susp->noise_cnt = 0;
+    susp->blow_pos = blow_pos;
+    susp->blow_pos_cnt = 0;
+    susp->reed_table_offset = reed_table_offset;
+    susp->reed_table_offset_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sax_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, sound_type blow_pos, sound_type reed_table_offset, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    sound_type reed_stiffness_copy = sound_copy(reed_stiffness);
+    sound_type noise_copy = sound_copy(noise);
+    sound_type blow_pos_copy = sound_copy(blow_pos);
+    sound_type reed_table_offset_copy = sound_copy(reed_table_offset);
+    return snd_make_sax_all(freq, breath_env_copy, freq_env_copy, vibrato_freq, vibrato_gain, reed_stiffness_copy, noise_copy, blow_pos_copy, reed_table_offset_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxall.h b/lib-src/libnyquist/nyquist/tran/instrsaxall.h
new file mode 100644
index 0000000..d8d0c51
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxall.h
@@ -0,0 +1,5 @@
+sound_type snd_make_sax_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, sound_type blow_pos, sound_type reed_table_offset, rate_type sr);
+sound_type snd_sax_all(double freq, sound_type breath_env, sound_type freq_env, double vibrato_freq, double vibrato_gain, sound_type reed_stiffness, sound_type noise, sound_type blow_pos, sound_type reed_table_offset, rate_type sr);
+    /* LISP: (snd-sax_all ANYNUM SOUND SOUND ANYNUM ANYNUM SOUND SOUND SOUND SOUND ANYNUM) */
+
+	    #define SAX_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg
new file mode 100644
index 0000000..09ef2d6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg
@@ -0,0 +1,27 @@
+(INSTRSAX-FREQ-ALG
+(NAME "sax_freq")
+(ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env") ("rate_type" "sr"))
+(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr));
+    controlChange(susp->sax, 1, 0.0);")
+       ("int" "temp_ret_value" "noteOn(susp->sax, freq, 1.0)")
+       ("double" "frequency" "freq"))
+(START (min breath_env))
+(NOT-IN-INNER-LOOP "temp_ret_value")
+(CONSTANT "frequency")
+(SAMPLE-RATE "sr")
+(TERMINATE (min breath_env))
+(INNER-LOOP "
+	    controlChange(sax, 128, SAX_CONTROL_CHANGE_CONST * breath_env);
+	    setFrequency(sax, frequency + freq_env);
+	    output = (sample_type) tick(sax)")
+(SUPPORT-HEADER "
+	    #define SAX_CONTROL_CHANGE_CONST	128
+")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->sax);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c
new file mode 100644
index 0000000..284dd7f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c
@@ -0,0 +1,446 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrsaxfreq.h"
+
+void sax_freq_free();
+
+
+typedef struct sax_freq_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    sound_type breath_env;
+    long breath_env_cnt;
+    sample_block_values_type breath_env_ptr;
+    sound_type freq_env;
+    long freq_env_cnt;
+    sample_block_values_type freq_env_ptr;
+
+    struct instr *sax;
+    int temp_ret_value;
+    double frequency;
+} sax_freq_susp_node, *sax_freq_susp_type;
+
+
+	    #include "instr.h"
+
+
+void sax_freq_nn_fetch(register sax_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register double frequency_reg;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_freq_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * *breath_env_ptr_reg++);
+	    setFrequency(sax_reg, frequency_reg + *freq_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_freq_nn_fetch */
+
+
+void sax_freq_ns_fetch(register sax_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register double frequency_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_freq_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * *breath_env_ptr_reg++);
+	    setFrequency(sax_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_freq_ns_fetch */
+
+
+void sax_freq_sn_fetch(register sax_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register double frequency_reg;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_freq_sn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    setFrequency(sax_reg, frequency_reg + *freq_env_ptr_reg++);
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_freq_sn_fetch */
+
+
+void sax_freq_ss_fetch(register sax_freq_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * sax_reg;
+    register double frequency_reg;
+    register sample_type freq_env_scale_reg = susp->freq_env->scale;
+    register sample_block_values_type freq_env_ptr_reg;
+    register sample_type breath_env_scale_reg = susp->breath_env->scale;
+    register sample_block_values_type breath_env_ptr_reg;
+    falloc_sample_block(out, "sax_freq_ss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the breath_env input sample block: */
+	susp_check_term_samples(breath_env, breath_env_ptr, breath_env_cnt);
+	togo = min(togo, susp->breath_env_cnt);
+
+	/* don't run past the freq_env input sample block: */
+	susp_check_samples(freq_env, freq_env_ptr, freq_env_cnt);
+	togo = min(togo, susp->freq_env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	sax_reg = susp->sax;
+	frequency_reg = susp->frequency;
+	freq_env_ptr_reg = susp->freq_env_ptr;
+	breath_env_ptr_reg = susp->breath_env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    controlChange(sax_reg, 128, SAX_CONTROL_CHANGE_CONST * (breath_env_scale_reg * *breath_env_ptr_reg++));
+	    setFrequency(sax_reg, frequency_reg + (freq_env_scale_reg * *freq_env_ptr_reg++));
+	    *out_ptr_reg++ = (sample_type) tick(sax_reg);
+	} while (--n); /* inner loop */
+
+	susp->sax = sax_reg;
+	/* using freq_env_ptr_reg is a bad idea on RS/6000: */
+	susp->freq_env_ptr += togo;
+	/* using breath_env_ptr_reg is a bad idea on RS/6000: */
+	susp->breath_env_ptr += togo;
+	out_ptr += togo;
+	susp_took(breath_env_cnt, togo);
+	susp_took(freq_env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sax_freq_ss_fetch */
+
+
+void sax_freq_toss_fetch(susp, snd_list)
+  register sax_freq_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from breath_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >=
+	   susp->breath_env->current)
+	susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt);
+    /* fetch samples from freq_env up to final_time for this block of zeros */
+    while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >=
+	   susp->freq_env->current)
+	susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr -
+         (susp->breath_env->current - susp->breath_env_cnt));
+    susp->breath_env_ptr += n;
+    susp_took(breath_env_cnt, n);
+    n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr -
+         (susp->freq_env->current - susp->freq_env_cnt));
+    susp->freq_env_ptr += n;
+    susp_took(freq_env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void sax_freq_mark(sax_freq_susp_type susp)
+{
+    sound_xlmark(susp->breath_env);
+    sound_xlmark(susp->freq_env);
+}
+
+
+void sax_freq_free(sax_freq_susp_type susp)
+{
+
+	    deleteInstrument(susp->sax);
+    sound_unref(susp->breath_env);
+    sound_unref(susp->freq_env);
+    ffree_generic(susp, sizeof(sax_freq_susp_node), "sax_freq_free");
+}
+
+
+void sax_freq_print_tree(sax_freq_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("breath_env:");
+    sound_print_tree_1(susp->breath_env, n);
+
+    indent(n);
+    stdputstr("freq_env:");
+    sound_print_tree_1(susp->freq_env, n);
+}
+
+
+sound_type snd_make_sax_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    register sax_freq_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = breath_env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, sax_freq_susp_node, "snd_make_sax_freq");
+    susp->sax = initInstrument(SAXOFONY, round(sr));
+    controlChange(susp->sax, 1, 0.0);;
+    susp->temp_ret_value = noteOn(susp->sax, freq, 1.0);
+    susp->frequency = freq;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(breath_env, sr);
+    interp_desc = (interp_desc << 2) + interp_style(freq_env, sr);
+    switch (interp_desc) {
+      case INTERP_nn: susp->susp.fetch = sax_freq_nn_fetch; break;
+      case INTERP_ns: susp->susp.fetch = sax_freq_ns_fetch; break;
+      case INTERP_sn: susp->susp.fetch = sax_freq_sn_fetch; break;
+      case INTERP_ss: susp->susp.fetch = sax_freq_ss_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < breath_env->t0) sound_prepend_zeros(breath_env, t0);
+    if (t0 < freq_env->t0) sound_prepend_zeros(freq_env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(breath_env->t0, min(freq_env->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = sax_freq_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = sax_freq_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = sax_freq_mark;
+    susp->susp.print_tree = sax_freq_print_tree;
+    susp->susp.name = "sax_freq";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    susp->breath_env = breath_env;
+    susp->breath_env_cnt = 0;
+    susp->freq_env = freq_env;
+    susp->freq_env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sax_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr)
+{
+    sound_type breath_env_copy = sound_copy(breath_env);
+    sound_type freq_env_copy = sound_copy(freq_env);
+    return snd_make_sax_freq(freq, breath_env_copy, freq_env_copy, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.h b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.h
new file mode 100644
index 0000000..71e2f4d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.h
@@ -0,0 +1,5 @@
+sound_type snd_make_sax_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+sound_type snd_sax_freq(double freq, sound_type breath_env, sound_type freq_env, rate_type sr);
+    /* LISP: (snd-sax_freq ANYNUM SOUND SOUND ANYNUM) */
+
+	    #define SAX_CONTROL_CHANGE_CONST	128
diff --git a/lib-src/libnyquist/nyquist/tran/instrsitar.alg b/lib-src/libnyquist/nyquist/tran/instrsitar.alg
new file mode 100644
index 0000000..d2d2d56
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsitar.alg
@@ -0,0 +1,17 @@
+(INSTRSITAR-ALG
+(NAME "sitar")
+(ARGUMENTS ("time_type" "t0")("double" "freq")("time_type" "dur")("rate_type" "sr"))
+(STATE ("struct instr *" "mysitar" "initInstrument(SITAR, round(sr))")
+       ("int" "temp_ret_value" "noteOn(susp->mysitar, freq, 1.0)"))
+(NOT-IN-INNER-LOOP "freq" "temp_ret_value")
+(SAMPLE-RATE "sr")
+(TERMINATE (after "dur"))
+(INNER-LOOP "
+	    output = (sample_type) tick(mysitar)")
+(SUPPORT-FUNCTIONS "
+	    #include \"instr.h\"
+")
+(FINALIZATION "
+	    deleteInstrument(susp->mysitar);
+")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/instrsitar.c b/lib-src/libnyquist/nyquist/tran/instrsitar.c
new file mode 100644
index 0000000..9aa8127
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsitar.c
@@ -0,0 +1,118 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "instrsitar.h"
+
+void sitar_free();
+
+
+typedef struct sitar_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    struct instr *mysitar;
+    int temp_ret_value;
+} sitar_susp_node, *sitar_susp_type;
+
+
+	    #include "instr.h"
+
+
+void sitar__fetch(register sitar_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct instr * mysitar_reg;
+    falloc_sample_block(out, "sitar__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	mysitar_reg = susp->mysitar;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	    *out_ptr_reg++ = (sample_type) tick(mysitar_reg);
+	} while (--n); /* inner loop */
+
+	susp->mysitar = mysitar_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sitar__fetch */
+
+
+void sitar_free(sitar_susp_type susp)
+{
+
+	    deleteInstrument(susp->mysitar);
+    ffree_generic(susp, sizeof(sitar_susp_node), "sitar_free");
+}
+
+
+void sitar_print_tree(sitar_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_sitar(time_type t0, double freq, time_type dur, rate_type sr)
+{
+    register sitar_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, sitar_susp_node, "snd_make_sitar");
+    susp->mysitar = initInstrument(SITAR, round(sr));
+    susp->temp_ret_value = noteOn(susp->mysitar, freq, 1.0);
+    susp->susp.fetch = sitar__fetch;
+
+    susp->terminate_cnt = round((dur) * sr);
+    /* initialize susp state */
+    susp->susp.free = sitar_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = sitar_print_tree;
+    susp->susp.name = "sitar";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sitar(time_type t0, double freq, time_type dur, rate_type sr)
+{
+    return snd_make_sitar(t0, freq, dur, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/instrsitar.h b/lib-src/libnyquist/nyquist/tran/instrsitar.h
new file mode 100644
index 0000000..15d8d5d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/instrsitar.h
@@ -0,0 +1,3 @@
+sound_type snd_make_sitar(time_type t0, double freq, time_type dur, rate_type sr);
+sound_type snd_sitar(time_type t0, double freq, time_type dur, rate_type sr);
+    /* LISP: (snd-sitar ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/integrate.alg b/lib-src/libnyquist/nyquist/tran/integrate.alg
new file mode 100644
index 0000000..34b4ecb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/integrate.alg
@@ -0,0 +1,12 @@
+(INTEGRATE-ALG
+(NAME "integrate")
+(ARGUMENTS ("sound_type" "input"))
+(START (MIN input))
+(TERMINATE (MIN input))
+(LINEAR input)
+(LOGICAL-STOP (MIN input))
+(STATE ("double" "integral" "0.0;
+    scale_factor = (sample_type) (scale_factor / input->sr)"))
+(INNER-LOOP "output = (sample_type) integral; integral += input;")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/integrate.c b/lib-src/libnyquist/nyquist/tran/integrate.c
new file mode 100644
index 0000000..f9459ff
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/integrate.c
@@ -0,0 +1,211 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "integrate.h"
+
+void integrate_free();
+
+
+typedef struct integrate_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double integral;
+} integrate_susp_node, *integrate_susp_type;
+
+
+void integrate_n_fetch(register integrate_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double integral_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "integrate_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	integral_reg = susp->integral;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) integral_reg; integral_reg += *input_ptr_reg++;;
+	} while (--n); /* inner loop */
+
+	susp->integral = integral_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* integrate_n_fetch */
+
+
+void integrate_toss_fetch(susp, snd_list)
+  register integrate_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void integrate_mark(integrate_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void integrate_free(integrate_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(integrate_susp_node), "integrate_free");
+}
+
+
+void integrate_print_tree(integrate_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_integrate(sound_type input)
+{
+    register integrate_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, integrate_susp_node, "snd_make_integrate");
+    susp->integral = 0.0;
+    scale_factor = (sample_type) (scale_factor / input->sr);
+    susp->susp.fetch = integrate_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = integrate_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = integrate_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = integrate_mark;
+    susp->susp.print_tree = integrate_print_tree;
+    susp->susp.name = "integrate";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_integrate(sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_integrate(input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/integrate.h b/lib-src/libnyquist/nyquist/tran/integrate.h
new file mode 100644
index 0000000..33ecbbc
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/integrate.h
@@ -0,0 +1,3 @@
+sound_type snd_make_integrate(sound_type input);
+sound_type snd_integrate(sound_type input);
+    /* LISP: (snd-integrate SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/log.alg b/lib-src/libnyquist/nyquist/tran/log.alg
new file mode 100644
index 0000000..b45c6bd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/log.alg
@@ -0,0 +1,9 @@
+(LOG-ALG
+  (NAME "log")
+  (ARGUMENTS ("sound_type" "input"))
+  (ALWAYS-SCALE input)
+  (START (MIN input))
+  (INNER-LOOP "output = (sample_type) log(input)")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/log.c b/lib-src/libnyquist/nyquist/tran/log.c
new file mode 100644
index 0000000..deb8d99
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/log.c
@@ -0,0 +1,198 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "log.h"
+
+void log_free();
+
+
+typedef struct log_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+} log_susp_node, *log_susp_type;
+
+
+void log_s_fetch(register log_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "log_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) log((input_scale_reg * *input_ptr_reg++));
+	} while (--n); /* inner loop */
+
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* log_s_fetch */
+
+
+void log_toss_fetch(susp, snd_list)
+  register log_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void log_mark(log_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void log_free(log_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(log_susp_node), "log_free");
+}
+
+
+void log_print_tree(log_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_log(sound_type input)
+{
+    register log_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, log_susp_node, "snd_make_log");
+    susp->susp.fetch = log_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = log_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = log_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = log_mark;
+    susp->susp.print_tree = log_print_tree;
+    susp->susp.name = "log";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_log(sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_log(input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/log.h b/lib-src/libnyquist/nyquist/tran/log.h
new file mode 100644
index 0000000..141a0ac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/log.h
@@ -0,0 +1,3 @@
+sound_type snd_make_log(sound_type input);
+sound_type snd_log(sound_type input);
+    /* LISP: (snd-log SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/lpreson.alg b/lib-src/libnyquist/nyquist/tran/lpreson.alg
new file mode 100644
index 0000000..65e5179
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/lpreson.alg
@@ -0,0 +1,109 @@
+(LPRESON-ALG
+(NAME "lpreson")
+(ARGUMENTS ("sound_type" "x_snd")("LVAL" "src")("time_type" "frame_time"))
+(SUPPORT-FUNCTIONS "
+#include \"samples.h\"
+
+")
+(START (MIN x_snd))
+(ALWAYS-SCALE x_snd)
+(TERMINATE (MIN x_snd))
+(LOGICAL-STOP (MIN x_snd))
+(SAMPLE-RATE "x_snd->sr")
+(STATE  
+        ("long" "fr_indx" "0")
+        ("long" "ak_len" "0") ; length of coefs ak array 
+        ("long" "frame_length" "(long) (frame_time*x_snd->sr)") ; samples length
+        ("LVAL" "src" "src")
+        ("LVAL" "frame" "NULL")
+        ("double *" "ak_coefs" "NULL")  ; coefs array
+        ("double *" "zk_buf" "NULL")  ; last values of output
+        ("double" "gain" "1.0")
+        ("long" "index" "0")
+                
+     )
+
+(OUTER-LOOP "
+      if (susp->src == NULL) {
+out:        togo = 0;     /* indicate termination */
+            break;        /* we're done */
+      }
+
+      if (susp->fr_indx >= susp->frame_length)
+           susp->fr_indx -= susp->frame_length;
+      
+      if (susp->fr_indx==0)
+      {
+         long i;
+         susp->frame = xleval(cons(s_send, cons(susp->src, consa(s_next))));
+         if (susp->frame == NULL) {
+            susp->src = NULL;
+            goto out;
+/* en susp->frame tenemos la lista proporcionada por el objeto */
+         } else if (!listp(susp->frame) || !listp(cdr(susp->frame)) ||
+                  !listp(cdr(cdr(susp->frame))) ||
+                  !listp(cdr(cdr(cdr(susp->frame))))) {
+             xlerror(\"list expected\", susp->frame);
+         }
+         /* frame is a list: (RMS1 RMS2 ERR FILTER-COEFS) */
+         /* gain is square root of RMS2 */
+         susp->gain = sqrt(getflonum(car(cdr(susp->frame))));
+         /* get filter coefs */
+         susp->frame=car(cdr(cdr(cdr(susp->frame)))); 
+         if (!vectorp(susp->frame)) {
+            xlerror(\"array expected\", susp->frame);
+         }
+         else if (susp->ak_coefs == NULL) {
+            susp->ak_len = getsize(susp->frame);
+            if (susp->ak_len < 1) xlerror(\"array has no elements\", susp->frame);
+            susp->ak_coefs = (double *) calloc(susp->ak_len, sizeof(double));
+            susp->zk_buf = (double *) calloc(susp->ak_len, sizeof(double));
+         }
+         /* at this point we have a new array and a place to put ak coefs */
+
+         for (i=0; i < susp->ak_len; i++) {
+            LVAL elem = getelement(susp->frame, i);
+            if (ntype(elem) != FLONUM) {
+                  xlerror(\"flonum expected\", elem);
+            }
+            susp->ak_coefs[i] = getflonum(elem);
+         }
+
+                  //  printf(\"NUEVO FILTRO: \");  /* here for debug */
+                  //  for(k=0; k < susp->ak_len; k++) printf(\" %g \", susp->ak_coefs[k]);
+                  //  printf(\"GAIN %g  AKLEN %d \", susp->gain, susp->ak_len);
+
+
+
+         susp->frame = NULL; /* free the array */
+       
+
+}    
+
+       togo = min(susp->frame_length - susp->fr_indx, togo);
+
+")
+
+(INNER-LOOP-LOCALS "double z0; long xi; long xj;")
+
+(INNER-LOOP "
+             z0 = x_snd * gain;
+             for (xi=0; xi < ak_len; xi++) {
+                 xj = index + xi; if (xj >= ak_len) xj -= ak_len;
+                 z0 += ak_coefs[xi] * zk_buf[xj];
+             } 
+             zk_buf[index] = z0;
+             index++; if (index == ak_len) index = 0;
+             fr_indx++; 
+             output = (sample_type) z0;
+")
+
+(CONSTANT "frame_length" "src")
+
+(FINALIZATION " free(susp->ak_coefs);
+                free(susp->zk_buf);
+")
+
+)
+
+
diff --git a/lib-src/libnyquist/nyquist/tran/lpreson.c b/lib-src/libnyquist/nyquist/tran/lpreson.c
new file mode 100644
index 0000000..3c08f05
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/lpreson.c
@@ -0,0 +1,313 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "lpreson.h"
+
+void lpreson_free();
+
+
+typedef struct lpreson_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type x_snd;
+    long x_snd_cnt;
+    sample_block_values_type x_snd_ptr;
+
+    long fr_indx;
+    long ak_len;
+    long frame_length;
+    LVAL src;
+    LVAL frame;
+    double *ak_coefs;
+    double *zk_buf;
+    double gain;
+    long index;
+} lpreson_susp_node, *lpreson_susp_type;
+
+
+#include "samples.h"
+
+
+
+void lpreson_s_fetch(register lpreson_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long fr_indx_reg;
+    register long ak_len_reg;
+    register double * ak_coefs_reg;
+    register double * zk_buf_reg;
+    register double gain_reg;
+    register long index_reg;
+    register sample_type x_snd_scale_reg = susp->x_snd->scale;
+    register sample_block_values_type x_snd_ptr_reg;
+    falloc_sample_block(out, "lpreson_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the x_snd input sample block: */
+	susp_check_term_log_samples(x_snd, x_snd_ptr, x_snd_cnt);
+	togo = min(togo, susp->x_snd_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+
+      if (susp->src == NULL) {
+out:        togo = 0;     /* indicate termination */
+            break;        /* we're done */
+      }
+
+      if (susp->fr_indx >= susp->frame_length)
+           susp->fr_indx -= susp->frame_length;
+      
+      if (susp->fr_indx==0)
+      {
+         long i;
+         susp->frame = xleval(cons(s_send, cons(susp->src, consa(s_next))));
+         if (susp->frame == NULL) {
+            susp->src = NULL;
+            goto out;
+/* en susp->frame tenemos la lista proporcionada por el objeto */
+         } else if (!listp(susp->frame) || !listp(cdr(susp->frame)) ||
+                  !listp(cdr(cdr(susp->frame))) ||
+                  !listp(cdr(cdr(cdr(susp->frame))))) {
+             xlerror("list expected", susp->frame);
+         }
+         /* frame is a list: (RMS1 RMS2 ERR FILTER-COEFS) */
+         /* gain is square root of RMS2 */
+         susp->gain = sqrt(getflonum(car(cdr(susp->frame))));
+         /* get filter coefs */
+         susp->frame=car(cdr(cdr(cdr(susp->frame)))); 
+         if (!vectorp(susp->frame)) {
+            xlerror("array expected", susp->frame);
+         }
+         else if (susp->ak_coefs == NULL) {
+            susp->ak_len = getsize(susp->frame);
+            if (susp->ak_len < 1) xlerror("array has no elements", susp->frame);
+            susp->ak_coefs = (double *) calloc(susp->ak_len, sizeof(double));
+            susp->zk_buf = (double *) calloc(susp->ak_len, sizeof(double));
+         }
+         /* at this point we have a new array and a place to put ak coefs */
+
+         for (i=0; i < susp->ak_len; i++) {
+            LVAL elem = getelement(susp->frame, i);
+            if (ntype(elem) != FLONUM) {
+                  xlerror("flonum expected", elem);
+            }
+            susp->ak_coefs[i] = getflonum(elem);
+         }
+
+                  //  printf("NUEVO FILTRO: ");  /* here for debug */
+                  //  for(k=0; k < susp->ak_len; k++) printf(" %g ", susp->ak_coefs[k]);
+                  //  printf("GAIN %g  AKLEN %d ", susp->gain, susp->ak_len);
+
+
+
+         susp->frame = NULL; /* free the array */
+       
+
+}    
+
+       togo = min(susp->frame_length - susp->fr_indx, togo);
+
+
+	n = togo;
+	fr_indx_reg = susp->fr_indx;
+	ak_len_reg = susp->ak_len;
+	ak_coefs_reg = susp->ak_coefs;
+	zk_buf_reg = susp->zk_buf;
+	gain_reg = susp->gain;
+	index_reg = susp->index;
+	x_snd_ptr_reg = susp->x_snd_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double z0; long xi; long xj;
+             z0 = (x_snd_scale_reg * *x_snd_ptr_reg++) * gain_reg;
+             for (xi=0; xi < ak_len_reg; xi++) {
+                 xj = index_reg + xi; if (xj >= ak_len_reg) xj -= ak_len_reg;
+                 z0 += ak_coefs_reg[xi] * zk_buf_reg[xj];
+             } 
+             zk_buf_reg[index_reg] = z0;
+             index_reg++; if (index_reg == ak_len_reg) index_reg = 0;
+             fr_indx_reg++; 
+             *out_ptr_reg++ = (sample_type) z0;
+;
+	} while (--n); /* inner loop */
+
+	susp->fr_indx = fr_indx_reg;
+	susp->ak_len = ak_len_reg;
+	susp->ak_coefs = ak_coefs_reg;
+	susp->zk_buf = zk_buf_reg;
+	susp->gain = gain_reg;
+	susp->index = index_reg;
+	/* using x_snd_ptr_reg is a bad idea on RS/6000: */
+	susp->x_snd_ptr += togo;
+	out_ptr += togo;
+	susp_took(x_snd_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* lpreson_s_fetch */
+
+
+void lpreson_toss_fetch(susp, snd_list)
+  register lpreson_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from x_snd up to final_time for this block of zeros */
+    while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >=
+	   susp->x_snd->current)
+	susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr -
+         (susp->x_snd->current - susp->x_snd_cnt));
+    susp->x_snd_ptr += n;
+    susp_took(x_snd_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void lpreson_mark(lpreson_susp_type susp)
+{
+    if (susp->frame) mark(susp->frame);
+    if (susp->src) mark(susp->src);
+    sound_xlmark(susp->x_snd);
+}
+
+
+void lpreson_free(lpreson_susp_type susp)
+{
+ free(susp->ak_coefs);
+                free(susp->zk_buf);
+    sound_unref(susp->x_snd);
+    ffree_generic(susp, sizeof(lpreson_susp_node), "lpreson_free");
+}
+
+
+void lpreson_print_tree(lpreson_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("x_snd:");
+    sound_print_tree_1(susp->x_snd, n);
+}
+
+
+sound_type snd_make_lpreson(sound_type x_snd, LVAL src, time_type frame_time)
+{
+    register lpreson_susp_type susp;
+    rate_type sr = x_snd->sr;
+    time_type t0 = x_snd->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, lpreson_susp_node, "snd_make_lpreson");
+    susp->fr_indx = 0;
+    susp->ak_len = 0;
+    susp->frame_length = (long) (frame_time*x_snd->sr);
+    susp->src = src;
+    susp->frame = NULL;
+    susp->ak_coefs = NULL;
+    susp->zk_buf = NULL;
+    susp->gain = 1.0;
+    susp->index = 0;
+    susp->susp.fetch = lpreson_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < x_snd->t0) sound_prepend_zeros(x_snd, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(x_snd->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = lpreson_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = lpreson_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = lpreson_mark;
+    susp->susp.print_tree = lpreson_print_tree;
+    susp->susp.name = "lpreson";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(x_snd);
+    susp->susp.current = 0;
+    susp->x_snd = x_snd;
+    susp->x_snd_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_lpreson(sound_type x_snd, LVAL src, time_type frame_time)
+{
+    sound_type x_snd_copy = sound_copy(x_snd);
+    return snd_make_lpreson(x_snd_copy, src, frame_time);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/lpreson.h b/lib-src/libnyquist/nyquist/tran/lpreson.h
new file mode 100644
index 0000000..335fefd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/lpreson.h
@@ -0,0 +1,3 @@
+sound_type snd_make_lpreson(sound_type x_snd, LVAL src, time_type frame_time);
+sound_type snd_lpreson(sound_type x_snd, LVAL src, time_type frame_time);
+    /* LISP: (snd-lpreson SOUND ANY ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/maxv.alg b/lib-src/libnyquist/nyquist/tran/maxv.alg
new file mode 100644
index 0000000..d800921
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/maxv.alg
@@ -0,0 +1,11 @@
+(MAXV-ALG
+  (NAME "maxv")
+  (ARGUMENTS ("sound_type" "s1") ("sound_type" "s2")) 
+  (ALWAYS-SCALE s1 s2)
+  (START (MAX s1 s2))
+  (INNER-LOOP "double x1 = s1;
+      double x2 = s2;
+      output = (sample_type) (x1 > x2 ? x1 : x2)")
+  (TERMINATE (MIN s1 s2))
+  (LOGICAL-STOP (MIN s1 s2))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/maxv.c b/lib-src/libnyquist/nyquist/tran/maxv.c
new file mode 100644
index 0000000..a313b2e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/maxv.c
@@ -0,0 +1,235 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "maxv.h"
+
+void maxv_free();
+
+
+typedef struct maxv_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type s2;
+    long s2_cnt;
+    sample_block_values_type s2_ptr;
+} maxv_susp_node, *maxv_susp_type;
+
+
+void maxv_ss_fetch(register maxv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type s2_scale_reg = susp->s2->scale;
+    register sample_block_values_type s2_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "maxv_ss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the s2 input sample block: */
+	susp_check_term_log_samples(s2, s2_ptr, s2_cnt);
+	togo = min(togo, susp->s2_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	s2_ptr_reg = susp->s2_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+double x1 = (s1_scale_reg * *s1_ptr_reg++);
+      double x2 = (s2_scale_reg * *s2_ptr_reg++);
+      *out_ptr_reg++ = (sample_type) (x1 > x2 ? x1 : x2);
+	} while (--n); /* inner loop */
+
+	/* using s2_ptr_reg is a bad idea on RS/6000: */
+	susp->s2_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(s2_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* maxv_ss_fetch */
+
+
+void maxv_toss_fetch(susp, snd_list)
+  register maxv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from s2 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >=
+	   susp->s2->current)
+	susp_get_samples(s2, s2_ptr, s2_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->s2->t0) * susp->s2->sr -
+         (susp->s2->current - susp->s2_cnt));
+    susp->s2_ptr += n;
+    susp_took(s2_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void maxv_mark(maxv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->s2);
+}
+
+
+void maxv_free(maxv_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(maxv_susp_node), "maxv_free");
+}
+
+
+void maxv_print_tree(maxv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("s2:");
+    sound_print_tree_1(susp->s2, n);
+}
+
+
+sound_type snd_make_maxv(sound_type s1, sound_type s2)
+{
+    register maxv_susp_type susp;
+    rate_type sr = max(s1->sr, s2->sr);
+    time_type t0 = max(s1->t0, s2->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    long lsc;
+    falloc_generic(susp, maxv_susp_node, "snd_make_maxv");
+    susp->susp.fetch = maxv_ss_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < s2->t0) sound_prepend_zeros(s2, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(s2->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = maxv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = maxv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = maxv_mark;
+    susp->susp.print_tree = maxv_print_tree;
+    susp->susp.name = "maxv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    lsc = logical_stop_cnt_cvt(s2);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = s2;
+    susp->s2_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_maxv(sound_type s1, sound_type s2)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type s2_copy = sound_copy(s2);
+    return snd_make_maxv(s1_copy, s2_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/maxv.h b/lib-src/libnyquist/nyquist/tran/maxv.h
new file mode 100644
index 0000000..327b80a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/maxv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_maxv(sound_type s1, sound_type s2);
+sound_type snd_maxv(sound_type s1, sound_type s2);
+    /* LISP: (snd-maxv SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/offset.alg b/lib-src/libnyquist/nyquist/tran/offset.alg
new file mode 100644
index 0000000..316628e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/offset.alg
@@ -0,0 +1,11 @@
+(SCALE-ALG
+  (NAME "offset")
+  (ARGUMENTS ("sound_type" "s1") ("double" "offset"))
+  (STATE ("sample_type" "offset" "(sample_type) offset"))
+  (CONSTANT "offset")
+  (START (MIN s1))
+  (INNER-LOOP "output = s1 + offset")
+  (TERMINATE (MIN s1))
+  (LOGICAL-STOP (MIN s1))
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/offset.c b/lib-src/libnyquist/nyquist/tran/offset.c
new file mode 100644
index 0000000..9d62b1e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/offset.c
@@ -0,0 +1,299 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "offset.h"
+
+void offset_free();
+
+
+typedef struct offset_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    sample_type offset;
+} offset_susp_node, *offset_susp_type;
+
+
+void offset_n_fetch(register offset_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type offset_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "offset_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *s1_ptr_reg++ + offset_reg;
+	} while (--n); /* inner loop */
+
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* offset_n_fetch */
+
+
+void offset_s_fetch(register offset_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type offset_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "offset_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (s1_scale_reg * *s1_ptr_reg++) + offset_reg;
+	} while (--n); /* inner loop */
+
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* offset_s_fetch */
+
+
+void offset_toss_fetch(susp, snd_list)
+  register offset_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void offset_mark(offset_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void offset_free(offset_susp_type susp)
+{
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(offset_susp_node), "offset_free");
+}
+
+
+void offset_print_tree(offset_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_offset(sound_type s1, double offset)
+{
+    register offset_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, offset_susp_node, "snd_make_offset");
+    susp->offset = (sample_type) offset;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = offset_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = offset_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = offset_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = offset_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = offset_mark;
+    susp->susp.print_tree = offset_print_tree;
+    susp->susp.name = "offset";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_offset(sound_type s1, double offset)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_offset(s1_copy, offset);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/offset.h b/lib-src/libnyquist/nyquist/tran/offset.h
new file mode 100644
index 0000000..5b08433
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/offset.h
@@ -0,0 +1,3 @@
+sound_type snd_make_offset(sound_type s1, double offset);
+sound_type snd_offset(sound_type s1, double offset);
+    /* LISP: (snd-offset SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/oneshot.alg b/lib-src/libnyquist/nyquist/tran/oneshot.alg
new file mode 100644
index 0000000..a90282e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/oneshot.alg
@@ -0,0 +1,16 @@
+(ONESHOT-ALG
+  (NAME "oneshot")
+  (ARGUMENTS ("sound_type" "input") ("double" "level") ("double" "ontime")) 
+  ; (INTERNAL-SCALING input) ; scale factor not handled in level because scale could be negative
+  (STATE ("double" "lev" "level")
+         ("long" "oncount" "round(ontime * input->sr)")
+         ("long" "cnt" "0"))
+  (START (MIN input))
+  (INNER-LOOP "        double x = input;
+        if (x > lev) cnt = oncount;
+        cnt--;
+        output = (cnt >= 0 ? 1.0F : 0.0F);")
+  (CONSTANT "lev" "oncount")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/oneshot.c b/lib-src/libnyquist/nyquist/tran/oneshot.c
new file mode 100644
index 0000000..9b880ba
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/oneshot.c
@@ -0,0 +1,319 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "oneshot.h"
+
+void oneshot_free();
+
+
+typedef struct oneshot_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double lev;
+    long oncount;
+    long cnt;
+} oneshot_susp_node, *oneshot_susp_type;
+
+
+void oneshot_n_fetch(register oneshot_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double lev_reg;
+    register long oncount_reg;
+    register long cnt_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "oneshot_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	lev_reg = susp->lev;
+	oncount_reg = susp->oncount;
+	cnt_reg = susp->cnt;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double x = *input_ptr_reg++;
+        if (x > lev_reg) cnt_reg = oncount_reg;
+        cnt_reg--;
+        *out_ptr_reg++ = (cnt_reg >= 0 ? 1.0F : 0.0F);;
+	} while (--n); /* inner loop */
+
+	susp->cnt = cnt_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* oneshot_n_fetch */
+
+
+void oneshot_s_fetch(register oneshot_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double lev_reg;
+    register long oncount_reg;
+    register long cnt_reg;
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "oneshot_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	lev_reg = susp->lev;
+	oncount_reg = susp->oncount;
+	cnt_reg = susp->cnt;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+        double x = (input_scale_reg * *input_ptr_reg++);
+        if (x > lev_reg) cnt_reg = oncount_reg;
+        cnt_reg--;
+        *out_ptr_reg++ = (cnt_reg >= 0 ? 1.0F : 0.0F);;
+	} while (--n); /* inner loop */
+
+	susp->cnt = cnt_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* oneshot_s_fetch */
+
+
+void oneshot_toss_fetch(susp, snd_list)
+  register oneshot_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void oneshot_mark(oneshot_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void oneshot_free(oneshot_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(oneshot_susp_node), "oneshot_free");
+}
+
+
+void oneshot_print_tree(oneshot_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_oneshot(sound_type input, double level, double ontime)
+{
+    register oneshot_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, oneshot_susp_node, "snd_make_oneshot");
+    susp->lev = level;
+    susp->oncount = round(ontime * input->sr);
+    susp->cnt = 0;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = oneshot_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = oneshot_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = oneshot_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = oneshot_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = oneshot_mark;
+    susp->susp.print_tree = oneshot_print_tree;
+    susp->susp.name = "oneshot";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_oneshot(sound_type input, double level, double ontime)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_oneshot(input_copy, level, ontime);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/oneshot.h b/lib-src/libnyquist/nyquist/tran/oneshot.h
new file mode 100644
index 0000000..9a13225
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/oneshot.h
@@ -0,0 +1,3 @@
+sound_type snd_make_oneshot(sound_type input, double level, double ontime);
+sound_type snd_oneshot(sound_type input, double level, double ontime);
+    /* LISP: (snd-oneshot SOUND ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/osc.alg b/lib-src/libnyquist/nyquist/tran/osc.alg
new file mode 100644
index 0000000..3705098
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/osc.alg
@@ -0,0 +1,31 @@
+(OSC-ALG
+(NAME "osc")
+(ARGUMENTS ("sound_type" "input") ("double" "step") ("rate_type" "sr")
+       ("double" "hz") ("time_type" "t0") ("time_type" "d")
+       ("double" "phase"))
+(TABLE "input")
+(NOT-IN-INNER-LOOP "input")
+(STATE 
+       ("double" "ph_incr" "0")
+       ("table_type" "the_table" "sound_to_table(input)")
+       ("sample_type *" "table_ptr" "susp->the_table->samples")
+       ("double" "table_len" "susp->the_table->length")
+       ("double" "phase" "compute_phase(phase, step, (long) susp->table_len,
+    input->sr, sr, hz, &susp->ph_incr)") )
+;	"((hz * susp->table_len) / sr)")
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "
+        long table_index = (long) phase;
+        double x1 = table_ptr[table_index];
+        output = (sample_type) (x1 + (phase - table_index) * 
+              (table_ptr[table_index + 1] - x1));
+        phase += ph_incr;
+        while (phase >= table_len) phase -= table_len;
+")
+(CONSTANT "ph_incr" "table_len" "table_ptr")
+
+(SAMPLE-RATE "sr")
+(FINALIZATION "    table_unref(susp->the_table);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/osc.c b/lib-src/libnyquist/nyquist/tran/osc.c
new file mode 100644
index 0000000..c2e7ce5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/osc.c
@@ -0,0 +1,133 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "osc.h"
+
+void osc_free();
+
+
+typedef struct osc_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    double ph_incr;
+    table_type the_table;
+    sample_type *table_ptr;
+    double table_len;
+    double phase;
+} osc_susp_node, *osc_susp_type;
+
+
+void osc__fetch(register osc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double ph_incr_reg;
+    register sample_type * table_ptr_reg;
+    register double table_len_reg;
+    register double phase_reg;
+    falloc_sample_block(out, "osc__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	ph_incr_reg = susp->ph_incr;
+	table_ptr_reg = susp->table_ptr;
+	table_len_reg = susp->table_len;
+	phase_reg = susp->phase;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+        long table_index = (long) phase_reg;
+        double x1 = table_ptr_reg[table_index];
+        *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+              (table_ptr_reg[table_index + 1] - x1));
+        phase_reg += ph_incr_reg;
+        while (phase_reg >= table_len_reg) phase_reg -= table_len_reg;
+;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* osc__fetch */
+
+
+void osc_free(osc_susp_type susp)
+{
+    table_unref(susp->the_table);
+    ffree_generic(susp, sizeof(osc_susp_node), "osc_free");
+}
+
+
+void osc_print_tree(osc_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_osc(sound_type input, double step, rate_type sr, double hz, time_type t0, time_type d, double phase)
+{
+    register osc_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, osc_susp_node, "snd_make_osc");
+    susp->ph_incr = 0;
+    susp->the_table = sound_to_table(input);
+    susp->table_ptr = susp->the_table->samples;
+    susp->table_len = susp->the_table->length;
+    susp->phase = compute_phase(phase, step, (long) susp->table_len,
+    input->sr, sr, hz, &susp->ph_incr);
+    susp->susp.fetch = osc__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = osc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = osc_print_tree;
+    susp->susp.name = "osc";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_osc(sound_type input, double step, rate_type sr, double hz, time_type t0, time_type d, double phase)
+{
+    return snd_make_osc(input, step, sr, hz, t0, d, phase);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/osc.h b/lib-src/libnyquist/nyquist/tran/osc.h
new file mode 100644
index 0000000..acf3a6e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/osc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_osc(sound_type input, double step, rate_type sr, double hz, time_type t0, time_type d, double phase);
+sound_type snd_osc(sound_type input, double step, rate_type sr, double hz, time_type t0, time_type d, double phase);
+    /* LISP: (snd-osc SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/partial.alg b/lib-src/libnyquist/nyquist/tran/partial.alg
new file mode 100644
index 0000000..45a1999
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/partial.alg
@@ -0,0 +1,20 @@
+(PARTIAL-ALG
+(NAME "partial")
+(ARGUMENTS ("rate_type" "sr") ("double" "hz") ("sound_type" "env"))
+(SUPPORT-FUNCTIONS "
+#include \"sine.h\"
+")
+(START (MIN env))
+(STATE ("long" "phase" "0")
+       ("long" "ph_incr" "round((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr)"))
+(TERMINATE (MIN env))
+(LOGICAL-STOP (MIN env))
+(INNER-LOOP "output = sine_table[phase >> SINE_TABLE_SHIFT] * env;
+            phase += ph_incr;
+            phase &= SINE_TABLE_MASK;")
+(MAINTAIN ("phase" 
+ "susp->phase = (susp->phase + susp->ph_incr * togo) & SINE_TABLE_MASK"))
+(CONSTANT "ph_incr")
+(SAMPLE-RATE "sr")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/partial.c b/lib-src/libnyquist/nyquist/tran/partial.c
new file mode 100644
index 0000000..4550f33
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/partial.c
@@ -0,0 +1,314 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "partial.h"
+
+void partial_free();
+
+
+typedef struct partial_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type env;
+    long env_cnt;
+    sample_block_values_type env_ptr;
+
+    long phase;
+    long ph_incr;
+} partial_susp_node, *partial_susp_type;
+
+
+#include "sine.h"
+
+
+void partial_n_fetch(register partial_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long phase_reg;
+    register long ph_incr_reg;
+    register sample_block_values_type env_ptr_reg;
+    falloc_sample_block(out, "partial_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the env input sample block: */
+	susp_check_term_log_samples(env, env_ptr, env_cnt);
+	togo = min(togo, susp->env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	env_ptr_reg = susp->env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = sine_table[phase_reg >> SINE_TABLE_SHIFT] * *env_ptr_reg++;
+            phase_reg += ph_incr_reg;
+            phase_reg &= SINE_TABLE_MASK;;
+	} while (--n); /* inner loop */
+
+	susp->phase = (susp->phase + susp->ph_incr * togo) & SINE_TABLE_MASK;
+	/* using env_ptr_reg is a bad idea on RS/6000: */
+	susp->env_ptr += togo;
+	out_ptr += togo;
+	susp_took(env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* partial_n_fetch */
+
+
+void partial_s_fetch(register partial_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long phase_reg;
+    register long ph_incr_reg;
+    register sample_type env_scale_reg = susp->env->scale;
+    register sample_block_values_type env_ptr_reg;
+    falloc_sample_block(out, "partial_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the env input sample block: */
+	susp_check_term_log_samples(env, env_ptr, env_cnt);
+	togo = min(togo, susp->env_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	env_ptr_reg = susp->env_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = sine_table[phase_reg >> SINE_TABLE_SHIFT] * (env_scale_reg * *env_ptr_reg++);
+            phase_reg += ph_incr_reg;
+            phase_reg &= SINE_TABLE_MASK;;
+	} while (--n); /* inner loop */
+
+	susp->phase = (susp->phase + susp->ph_incr * togo) & SINE_TABLE_MASK;
+	/* using env_ptr_reg is a bad idea on RS/6000: */
+	susp->env_ptr += togo;
+	out_ptr += togo;
+	susp_took(env_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* partial_s_fetch */
+
+
+void partial_toss_fetch(susp, snd_list)
+  register partial_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from env up to final_time for this block of zeros */
+    while ((round((final_time - susp->env->t0) * susp->env->sr)) >=
+	   susp->env->current)
+	susp_get_samples(env, env_ptr, env_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->env->t0) * susp->env->sr -
+         (susp->env->current - susp->env_cnt));
+    susp->env_ptr += n;
+    susp_took(env_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void partial_mark(partial_susp_type susp)
+{
+    sound_xlmark(susp->env);
+}
+
+
+void partial_free(partial_susp_type susp)
+{
+    sound_unref(susp->env);
+    ffree_generic(susp, sizeof(partial_susp_node), "partial_free");
+}
+
+
+void partial_print_tree(partial_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("env:");
+    sound_print_tree_1(susp->env, n);
+}
+
+
+sound_type snd_make_partial(rate_type sr, double hz, sound_type env)
+{
+    register partial_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = env->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, partial_susp_node, "snd_make_partial");
+    susp->phase = 0;
+    susp->ph_incr = round((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(env, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = partial_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = partial_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < env->t0) sound_prepend_zeros(env, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(env->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = partial_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = partial_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = partial_mark;
+    susp->susp.print_tree = partial_print_tree;
+    susp->susp.name = "partial";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(env);
+    susp->susp.current = 0;
+    susp->env = env;
+    susp->env_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_partial(rate_type sr, double hz, sound_type env)
+{
+    sound_type env_copy = sound_copy(env);
+    return snd_make_partial(sr, hz, env_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/partial.h b/lib-src/libnyquist/nyquist/tran/partial.h
new file mode 100644
index 0000000..7b9858e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/partial.h
@@ -0,0 +1,3 @@
+sound_type snd_make_partial(rate_type sr, double hz, sound_type env);
+sound_type snd_partial(rate_type sr, double hz, sound_type env);
+    /* LISP: (snd-partial ANYNUM ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/pluck.alg b/lib-src/libnyquist/nyquist/tran/pluck.alg
new file mode 100644
index 0000000..6bd342f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pluck.alg
@@ -0,0 +1,144 @@
+;; PLUCK.ALG is based on the Pluck.t instrument from M4C
+;;
+; to assist with debugging, here are some calculated parameters
+; dumped from a run of M4C:
+;
+; Setup Pluck at t=  6.000
+; DUR= 1.000, pitch= 8.060, amp= 10000, DB_drop=  60.0, rfrac=0.00
+; freq 369.995
+; freq = 369.995361
+; Final = 1000.000000, t= 0.052715, y = 0.000000, lF = 6.907755
+; tdecay = 13.430565, sT = 369.995361, rho = 0.982869, stretch = 0.500000
+; N = 59, x = 0.095342, cons = 0.825914
+; x2 0.412957 x3 0.912957 stretch 0.5 cons 0.825914 SR 22050
+; complete Pluck setup
+;;
+
+(PLUCK-ALG
+(NAME "pluck")
+(ARGUMENTS ("rate_type" "sr") ("double" "hz") ("time_type" "t0") 
+           ("time_type" "d") ("double" "final_amp"))
+(SUPPORT-FUNCTIONS "
+#define MAXLENGTH 20000
+
+long pluck_parameters(double hz, double sr, double final, double dur,
+                        double *stretch, double *cons, double *rho)
+{
+    double t = PI * (hz / sr);
+    double y = fabs(cos(t));
+    /* original m4c code used ratio of initial amp to final amp in dB
+       and then converted to a ratio, e.g. you specify 60 and the 
+       parameter Final is 1000.0. This is counterintuitive to me (RBD)
+       because I would expect the value to be -60dB or 0.001. That is
+       what I implemented, so to get this back into correspondence
+       with the m4c algorithm, I take the NEGATIVE log to get lf, 
+       whereas m4c takes the positive log:
+     */
+    double lf = -log(final);
+    double tdecay = -lf / (hz * log(y));
+    double st;
+    long len;
+    double x;
+
+    if (hz <= sr / MAXLENGTH) {
+        xlfail(\"pluck hz is too low\");
+    } else if (hz >= sr / 3) {
+        xlfail(\"pluck hz is too high\");
+    }
+    /*
+     * if desired decay time is shorter than the natural decay time,
+     * then introduce a loss factor.  Otherwise, stretch note out.
+     */
+    st = hz * dur;
+    if (dur < tdecay) {
+        *rho = exp(-lf / st) / y;
+        *stretch = 0.5;
+    } else {
+        *rho = 1;
+        *stretch = 0.5 + sqrt(0.25 - 
+                              (1 - exp(2 * lf * (hz - sr) / (st * sr))) /
+                              (2 - 2 * cos(2 * t)));
+    }
+
+    /* delay line length is */
+    len = (int) ((sr / hz) - *stretch - 0.001);
+
+    /* tuning constant is */
+    x = (sr / hz) - len - *stretch;
+    *cons = (1.0 - x) / (1.0 + x);
+
+    if (len <= 1) {
+        xlfail(\"internal error: pluck delay line length too short\");
+    }
+    return len;
+}
+
+static unsigned int rnext = 1;
+int krand()
+{
+    rnext = rnext * 1103515245 + 12345;
+    return (rnext >> 16) & 0x7fff;
+}
+
+void pluck_initialize(sample_type *shiftreg, sample_type *array,
+                      long len, double cons)
+{
+    sample_type suma = 0.0F;
+    long k;
+    sample_type avea;
+    array[1] = 0;
+    for (k = len; k > 0; k--, array--) {
+        /* note: the m4c code has a bug. It claims to filter
+           the initial values, but it really just sets the
+           values to +1 or -1. The following does the same
+           thing with much less code:
+         */
+        *array = (krand() & 2) - 1;
+        suma += *array; /* compute sum for the average */
+    }
+    avea = suma / len;
+    /* zero the average */
+    for (k = 0; k <= len + 1; k++) shiftreg[k] -= avea;
+    shiftreg[len] = 0;
+    shiftreg[len + 1] = 0;
+}")
+(STATE ("double" "stretch" "0")
+       ("double" "cons" "0")
+       ("double" "loss" "0")
+       ("long" "len" "pluck_parameters(hz, sr, final_amp, d,
+                                &susp->stretch, &susp->cons, 
+                                &susp->loss)")
+       ("double" "x2" "-susp->cons * (susp->stretch - 1)")
+       ("double" "x3" "susp->cons * susp->stretch - susp->stretch + 1")
+       ("sample_type *" "shiftreg"
+       ;; I think susp->len + 2 is the correct value, but I use +4 to be safe
+                       "(sample_type *) calloc (susp->len + 4, sizeof(sample_type))")
+       ("sample_type *" "i1" "susp->shiftreg + susp->len + 1")
+       ("sample_type *" "i2" "susp->shiftreg + susp->len")
+       ("sample_type *" "i3" "susp->shiftreg + susp->len - 1")
+       ("sample_type *" "i4" "susp->shiftreg + susp->len - 2")
+       ("sample_type *" "endptr" "susp->shiftreg + susp->len + 2; 
+                   pluck_initialize(susp->shiftreg, susp->i3, 
+                                    susp->len, susp->cons)"))
+(CONSTANT "stretch" "cons" "loss" "len" "x2" "x3" "endptr")
+(SAMPLE-RATE "sr")
+(NOT-REGISTER shiftreg)
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "            sample_type sum = (sample_type)
+                ((*i1++ * x2) + (*i2++ * x3) + 
+                 (*i3++ * stretch) - (*i4++ * cons));
+            /* wrap pointers around shift register if necessary */
+            if (i1 == endptr) i1 = susp->shiftreg;
+            if (i2 == endptr) i2 = susp->shiftreg;
+            if (i3 == endptr) i3 = susp->shiftreg;
+            if (i4 == endptr) i4 = susp->shiftreg;
+
+            /* store new value in shift register */
+            *i4 = (sample_type) (sum * loss);
+
+            /* deliver sample */
+            output = sum;
+")
+(FINALIZATION "    free(susp->shiftreg);\n")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/pluck.c b/lib-src/libnyquist/nyquist/tran/pluck.c
new file mode 100644
index 0000000..267e98c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pluck.c
@@ -0,0 +1,256 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "pluck.h"
+
+void pluck_free();
+
+
+typedef struct pluck_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    double stretch;
+    double cons;
+    double loss;
+    long len;
+    double x2;
+    double x3;
+    sample_type *shiftreg;
+    sample_type *i1;
+    sample_type *i2;
+    sample_type *i3;
+    sample_type *i4;
+    sample_type *endptr;
+} pluck_susp_node, *pluck_susp_type;
+
+
+#define MAXLENGTH 20000
+
+long pluck_parameters(double hz, double sr, double final, double dur,
+                        double *stretch, double *cons, double *rho)
+{
+    double t = PI * (hz / sr);
+    double y = fabs(cos(t));
+    /* original m4c code used ratio of initial amp to final amp in dB
+       and then converted to a ratio, e.g. you specify 60 and the 
+       parameter Final is 1000.0. This is counterintuitive to me (RBD)
+       because I would expect the value to be -60dB or 0.001. That is
+       what I implemented, so to get this back into correspondence
+       with the m4c algorithm, I take the NEGATIVE log to get lf, 
+       whereas m4c takes the positive log:
+     */
+    double lf = -log(final);
+    double tdecay = -lf / (hz * log(y));
+    double st;
+    long len;
+    double x;
+
+    if (hz <= sr / MAXLENGTH) {
+        xlfail("pluck hz is too low");
+    } else if (hz >= sr / 3) {
+        xlfail("pluck hz is too high");
+    }
+    /*
+     * if desired decay time is shorter than the natural decay time,
+     * then introduce a loss factor.  Otherwise, stretch note out.
+     */
+    st = hz * dur;
+    if (dur < tdecay) {
+        *rho = exp(-lf / st) / y;
+        *stretch = 0.5;
+    } else {
+        *rho = 1;
+        *stretch = 0.5 + sqrt(0.25 - 
+                              (1 - exp(2 * lf * (hz - sr) / (st * sr))) /
+                              (2 - 2 * cos(2 * t)));
+    }
+
+    /* delay line length is */
+    len = (int) ((sr / hz) - *stretch - 0.001);
+
+    /* tuning constant is */
+    x = (sr / hz) - len - *stretch;
+    *cons = (1.0 - x) / (1.0 + x);
+
+    if (len <= 1) {
+        xlfail("internal error: pluck delay line length too short");
+    }
+    return len;
+}
+
+static unsigned int rnext = 1;
+int krand()
+{
+    rnext = rnext * 1103515245 + 12345;
+    return (rnext >> 16) & 0x7fff;
+}
+
+void pluck_initialize(sample_type *shiftreg, sample_type *array,
+                      long len, double cons)
+{
+    sample_type suma = 0.0F;
+    long k;
+    sample_type avea;
+    array[1] = 0;
+    for (k = len; k > 0; k--, array--) {
+        /* note: the m4c code has a bug. It claims to filter
+           the initial values, but it really just sets the
+           values to +1 or -1. The following does the same
+           thing with much less code:
+         */
+        *array = (krand() & 2) - 1;
+        suma += *array; /* compute sum for the average */
+    }
+    avea = suma / len;
+    /* zero the average */
+    for (k = 0; k <= len + 1; k++) shiftreg[k] -= avea;
+    shiftreg[len] = 0;
+    shiftreg[len + 1] = 0;
+}
+
+void pluck__fetch(register pluck_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double stretch_reg;
+    register double cons_reg;
+    register double loss_reg;
+    register double x2_reg;
+    register double x3_reg;
+    register sample_type * i1_reg;
+    register sample_type * i2_reg;
+    register sample_type * i3_reg;
+    register sample_type * i4_reg;
+    register sample_type * endptr_reg;
+    falloc_sample_block(out, "pluck__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	stretch_reg = susp->stretch;
+	cons_reg = susp->cons;
+	loss_reg = susp->loss;
+	x2_reg = susp->x2;
+	x3_reg = susp->x3;
+	i1_reg = susp->i1;
+	i2_reg = susp->i2;
+	i3_reg = susp->i3;
+	i4_reg = susp->i4;
+	endptr_reg = susp->endptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            sample_type sum = (sample_type)
+                ((*i1_reg++ * x2_reg) + (*i2_reg++ * x3_reg) + 
+                 (*i3_reg++ * stretch_reg) - (*i4_reg++ * cons_reg));
+            /* wrap pointers around shift register if necessary */
+            if (i1_reg == endptr_reg) i1_reg = susp->shiftreg;
+            if (i2_reg == endptr_reg) i2_reg = susp->shiftreg;
+            if (i3_reg == endptr_reg) i3_reg = susp->shiftreg;
+            if (i4_reg == endptr_reg) i4_reg = susp->shiftreg;
+
+            /* store new value in shift register */
+            *i4_reg = (sample_type) (sum * loss_reg);
+
+            /* deliver sample */
+            *out_ptr_reg++ = sum;
+;
+	} while (--n); /* inner loop */
+
+	susp->i1 = i1_reg;
+	susp->i2 = i2_reg;
+	susp->i3 = i3_reg;
+	susp->i4 = i4_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* pluck__fetch */
+
+
+void pluck_free(pluck_susp_type susp)
+{
+    free(susp->shiftreg);
+    ffree_generic(susp, sizeof(pluck_susp_node), "pluck_free");
+}
+
+
+void pluck_print_tree(pluck_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_pluck(rate_type sr, double hz, time_type t0, time_type d, double final_amp)
+{
+    register pluck_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, pluck_susp_node, "snd_make_pluck");
+    susp->stretch = 0;
+    susp->cons = 0;
+    susp->loss = 0;
+    susp->len = pluck_parameters(hz, sr, final_amp, d,
+                                &susp->stretch, &susp->cons, 
+                                &susp->loss);
+    susp->x2 = -susp->cons * (susp->stretch - 1);
+    susp->x3 = susp->cons * susp->stretch - susp->stretch + 1;
+    susp->shiftreg = (sample_type *) calloc (susp->len + 4, sizeof(sample_type));
+    susp->i1 = susp->shiftreg + susp->len + 1;
+    susp->i2 = susp->shiftreg + susp->len;
+    susp->i3 = susp->shiftreg + susp->len - 1;
+    susp->i4 = susp->shiftreg + susp->len - 2;
+    susp->endptr = susp->shiftreg + susp->len + 2; 
+                   pluck_initialize(susp->shiftreg, susp->i3, 
+                                    susp->len, susp->cons);
+    susp->susp.fetch = pluck__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = pluck_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = pluck_print_tree;
+    susp->susp.name = "pluck";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_pluck(rate_type sr, double hz, time_type t0, time_type d, double final_amp)
+{
+    return snd_make_pluck(sr, hz, t0, d, final_amp);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/pluck.h b/lib-src/libnyquist/nyquist/tran/pluck.h
new file mode 100644
index 0000000..36be409
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pluck.h
@@ -0,0 +1,3 @@
+sound_type snd_make_pluck(rate_type sr, double hz, time_type t0, time_type d, double final_amp);
+sound_type snd_pluck(rate_type sr, double hz, time_type t0, time_type d, double final_amp);
+    /* LISP: (snd-pluck ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/prod.alg b/lib-src/libnyquist/nyquist/tran/prod.alg
new file mode 100644
index 0000000..1a36c04
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/prod.alg
@@ -0,0 +1,11 @@
+(PROD-ALG
+  (NAME "prod")
+  (ARGUMENTS ("sound_type" "s1") ("sound_type" "s2"))
+  (START (MAX s1 s2))
+  (COMMUTATIVE (s1 s2))
+  (INNER-LOOP "output = s1 * s2")
+  (LINEAR s1 s2)
+  (TERMINATE (MIN s1 s2))
+  (LOGICAL-STOP (MIN s1 s2))
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/prod.c b/lib-src/libnyquist/nyquist/tran/prod.c
new file mode 100644
index 0000000..dc2be08
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/prod.c
@@ -0,0 +1,244 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "prod.h"
+
+void prod_free();
+
+
+typedef struct prod_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type s2;
+    long s2_cnt;
+    sample_block_values_type s2_ptr;
+} prod_susp_node, *prod_susp_type;
+
+
+void prod_nn_fetch(register prod_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_block_values_type s2_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "prod_nn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the s2 input sample block: */
+	susp_check_term_log_samples(s2, s2_ptr, s2_cnt);
+	togo = min(togo, susp->s2_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	s2_ptr_reg = susp->s2_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *s1_ptr_reg++ * *s2_ptr_reg++;
+	} while (--n); /* inner loop */
+
+	/* using s2_ptr_reg is a bad idea on RS/6000: */
+	susp->s2_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(s2_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* prod_nn_fetch */
+
+
+void prod_toss_fetch(susp, snd_list)
+  register prod_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from s2 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >=
+	   susp->s2->current)
+	susp_get_samples(s2, s2_ptr, s2_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->s2->t0) * susp->s2->sr -
+         (susp->s2->current - susp->s2_cnt));
+    susp->s2_ptr += n;
+    susp_took(s2_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void prod_mark(prod_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->s2);
+}
+
+
+void prod_free(prod_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->s2);
+    ffree_generic(susp, sizeof(prod_susp_node), "prod_free");
+}
+
+
+void prod_print_tree(prod_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("s2:");
+    sound_print_tree_1(susp->s2, n);
+}
+
+
+sound_type snd_make_prod(sound_type s1, sound_type s2)
+{
+    register prod_susp_type susp;
+    rate_type sr = max(s1->sr, s2->sr);
+    time_type t0 = max(s1->t0, s2->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    long lsc;
+    /* sort commutative signals: (S1 S2) */
+    snd_sort_2(&s1, &s2, sr);
+
+    /* combine scale factors of linear inputs (S1 S2) */
+    scale_factor *= s1->scale;
+    s1->scale = 1.0F;
+    scale_factor *= s2->scale;
+    s2->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; }
+    else if (s2->sr < sr) { s2->scale = scale_factor; scale_factor = 1.0F; }
+
+    falloc_generic(susp, prod_susp_node, "snd_make_prod");
+    susp->susp.fetch = prod_nn_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < s2->t0) sound_prepend_zeros(s2, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(s2->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = prod_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = prod_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = prod_mark;
+    susp->susp.print_tree = prod_print_tree;
+    susp->susp.name = "prod";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    lsc = logical_stop_cnt_cvt(s2);
+    if (susp->susp.log_stop_cnt > lsc)
+        susp->susp.log_stop_cnt = lsc;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->s2 = s2;
+    susp->s2_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_prod(sound_type s1, sound_type s2)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type s2_copy = sound_copy(s2);
+    return snd_make_prod(s1_copy, s2_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/prod.h b/lib-src/libnyquist/nyquist/tran/prod.h
new file mode 100644
index 0000000..127b7f9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/prod.h
@@ -0,0 +1,3 @@
+sound_type snd_make_prod(sound_type s1, sound_type s2);
+sound_type snd_prod(sound_type s1, sound_type s2);
+    /* LISP: (snd-prod SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/pwl.alg b/lib-src/libnyquist/nyquist/tran/pwl.alg
new file mode 100644
index 0000000..e9f66db
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pwl.alg
@@ -0,0 +1,82 @@
+(PWL-ALG
+  (NAME "pwl")
+  (ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("LVAL" "lis"))
+  (SUPPORT-FUNCTIONS "
+/* IMPLEMENTATION NOTE:
+ * The lis argument is a list of alternating sample numbers and values
+ * which are taken in pairs, with an implicit (0, 0) starting point.  The
+ * last point  is a sample number only, the value being implicitly 0.
+ * The bpt_ptr points to the next sample number in the list.
+ * The incr is set to the increment per sample, and lvl is the next
+ * sample value.
+ *
+ * The list is assumed to be well-formed, so it should be checked by
+ * the caller (users should not call this directly).
+ */
+
+
+/* compute_lvl -- setup the susp with level, advance bpt_ptr */
+/*
+ * returns true if it is time to terminate
+ *
+ * Note: compute_lvl gets called in the outer loop to skip over
+ * a breakpoint pair before starting the compute_incr loop, which
+ * searches for a breakpoint that is some number of samples in the
+ * future.  This code is not embedded in compute_incr because it is
+ * NOT called from the initialization, where it would be wrong to
+ * skip over the first breakpoint.
+ */
+boolean compute_lvl(pwl_susp_type susp)
+{
+    if (!cdr(susp->bpt_ptr)) return true;
+    susp->lvl = getflonum(car(cdr(susp->bpt_ptr)));
+    susp->bpt_ptr = cdr(cdr(susp->bpt_ptr));
+    return !susp->bpt_ptr;
+}
+
+
+/* compute_incr -- setup the susp with level and increment */
+/*
+ * returns true if it is time to terminate
+ */
+boolean compute_incr(pwl_susp_type susp, long *n, long cur)
+{
+    double target;
+    while (*n == 0) {
+        *n = getfixnum(car(susp->bpt_ptr)) - cur;
+        /* if there is a 2nd element of the pair, get the target */
+        if (cdr(susp->bpt_ptr))
+            target = getflonum(car(cdr(susp->bpt_ptr)));
+        else target = 0.0;
+        if (*n > 0) susp->incr = (target - susp->lvl) / *n;
+        else if (compute_lvl(susp)) return true;
+    }
+    return false;
+}
+")
+ (SAMPLE-RATE "sr")
+  (STATE 
+        ("LVAL" "bpt_ptr" "lis")
+        ("double" "incr" "0.0")
+        ("double" "lvl" "0.0; 
+         { long temp = 0; compute_incr(susp, &temp, 0); }"))
+  
+  (OUTER-LOOP "
+        if (susp->bpt_ptr == NULL) {
+out:	    togo = 0;	/* indicate termination */
+            break;	/* we're done */
+        }
+        { long cur = susp->susp.current + cnt;
+          long nn = getfixnum(car(susp->bpt_ptr)) - cur;
+          if (nn == 0) {
+              if (compute_lvl(susp) || compute_incr(susp, &nn, cur)) goto out;
+          }
+          togo = min(nn, togo);
+        }
+")
+  (INNER-LOOP "output = (sample_type) lvl; lvl += incr;")
+  (MAINTAIN ("lvl" "susp->lvl += susp->incr * togo"))
+  (CONSTANT "incr")
+  (TERMINATE COMPUTED)
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/pwl.c b/lib-src/libnyquist/nyquist/tran/pwl.c
new file mode 100644
index 0000000..09681cd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pwl.c
@@ -0,0 +1,180 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "pwl.h"
+
+void pwl_free();
+
+
+typedef struct pwl_susp_struct {
+    snd_susp_node susp;
+
+    LVAL bpt_ptr;
+    double incr;
+    double lvl;
+} pwl_susp_node, *pwl_susp_type;
+
+
+/* IMPLEMENTATION NOTE:
+ * The lis argument is a list of alternating sample numbers and values
+ * which are taken in pairs, with an implicit (0, 0) starting point.  The
+ * last point  is a sample number only, the value being implicitly 0.
+ * The bpt_ptr points to the next sample number in the list.
+ * The incr is set to the increment per sample, and lvl is the next
+ * sample value.
+ *
+ * The list is assumed to be well-formed, so it should be checked by
+ * the caller (users should not call this directly).
+ */
+
+
+/* compute_lvl -- setup the susp with level, advance bpt_ptr */
+/*
+ * returns true if it is time to terminate
+ *
+ * Note: compute_lvl gets called in the outer loop to skip over
+ * a breakpoint pair before starting the compute_incr loop, which
+ * searches for a breakpoint that is some number of samples in the
+ * future.  This code is not embedded in compute_incr because it is
+ * NOT called from the initialization, where it would be wrong to
+ * skip over the first breakpoint.
+ */
+boolean compute_lvl(pwl_susp_type susp)
+{
+    if (!cdr(susp->bpt_ptr)) return true;
+    susp->lvl = getflonum(car(cdr(susp->bpt_ptr)));
+    susp->bpt_ptr = cdr(cdr(susp->bpt_ptr));
+    return !susp->bpt_ptr;
+}
+
+
+/* compute_incr -- setup the susp with level and increment */
+/*
+ * returns true if it is time to terminate
+ */
+boolean compute_incr(pwl_susp_type susp, long *n, long cur)
+{
+    double target;
+    while (*n == 0) {
+        *n = getfixnum(car(susp->bpt_ptr)) - cur;
+        /* if there is a 2nd element of the pair, get the target */
+        if (cdr(susp->bpt_ptr))
+            target = getflonum(car(cdr(susp->bpt_ptr)));
+        else target = 0.0;
+        if (*n > 0) susp->incr = (target - susp->lvl) / *n;
+        else if (compute_lvl(susp)) return true;
+    }
+    return false;
+}
+
+
+void pwl__fetch(register pwl_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double incr_reg;
+    register double lvl_reg;
+    falloc_sample_block(out, "pwl__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+
+        if (susp->bpt_ptr == NULL) {
+out:	    togo = 0;	/* indicate termination */
+            break;	/* we're done */
+        }
+        { long cur = susp->susp.current + cnt;
+          long nn = getfixnum(car(susp->bpt_ptr)) - cur;
+          if (nn == 0) {
+              if (compute_lvl(susp) || compute_incr(susp, &nn, cur)) goto out;
+          }
+          togo = min(nn, togo);
+        }
+
+	n = togo;
+	incr_reg = susp->incr;
+	lvl_reg = susp->lvl;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) lvl_reg; lvl_reg += incr_reg;;
+	} while (--n); /* inner loop */
+
+	susp->lvl += susp->incr * togo;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* pwl__fetch */
+
+
+void pwl_mark(pwl_susp_type susp)
+{
+    if (susp->bpt_ptr) mark(susp->bpt_ptr);
+}
+
+
+void pwl_free(pwl_susp_type susp)
+{
+    ffree_generic(susp, sizeof(pwl_susp_node), "pwl_free");
+}
+
+
+void pwl_print_tree(pwl_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_pwl(time_type t0, rate_type sr, LVAL lis)
+{
+    register pwl_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, pwl_susp_node, "snd_make_pwl");
+    susp->bpt_ptr = lis;
+    susp->incr = 0.0;
+    susp->lvl = 0.0; 
+         { long temp = 0; compute_incr(susp, &temp, 0); };
+    susp->susp.fetch = pwl__fetch;
+
+    /* initialize susp state */
+    susp->susp.free = pwl_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = pwl_mark;
+    susp->susp.print_tree = pwl_print_tree;
+    susp->susp.name = "pwl";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_pwl(time_type t0, rate_type sr, LVAL lis)
+{
+    return snd_make_pwl(t0, sr, lis);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/pwl.h b/lib-src/libnyquist/nyquist/tran/pwl.h
new file mode 100644
index 0000000..36700f6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/pwl.h
@@ -0,0 +1,3 @@
+sound_type snd_make_pwl(time_type t0, rate_type sr, LVAL lis);
+sound_type snd_pwl(time_type t0, rate_type sr, LVAL lis);
+    /* LISP: (snd-pwl ANYNUM ANYNUM ANY) */
diff --git a/lib-src/libnyquist/nyquist/tran/quantize.alg b/lib-src/libnyquist/nyquist/tran/quantize.alg
new file mode 100644
index 0000000..fc268bd
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/quantize.alg
@@ -0,0 +1,11 @@
+(QUANTIZE-ALG
+  (NAME "quantize")
+  (ARGUMENTS ("sound_type" "s1") ("long" "steps"))
+  (INTERNAL-SCALING s1)
+  (START (MIN s1))
+  (STATE ("double" "factor" "s1->scale * steps; scale_factor = (sample_type) (1.0 / steps);"))
+  (INNER-LOOP "register long xx = (long) (s1 * factor); output = (float) xx;")
+  (TERMINATE (MIN s1))
+  (CONSTANT "factor")
+  (LOGICAL-STOP (MIN s1))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/quantize.c b/lib-src/libnyquist/nyquist/tran/quantize.c
new file mode 100644
index 0000000..cf919a6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/quantize.c
@@ -0,0 +1,202 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "quantize.h"
+
+void quantize_free();
+
+
+typedef struct quantize_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    double factor;
+} quantize_susp_node, *quantize_susp_type;
+
+
+void quantize_n_fetch(register quantize_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double factor_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "quantize_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	factor_reg = susp->factor;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+register long xx = (long) (*s1_ptr_reg++ * factor_reg); *out_ptr_reg++ = (float) xx;;
+	} while (--n); /* inner loop */
+
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* quantize_n_fetch */
+
+
+void quantize_toss_fetch(susp, snd_list)
+  register quantize_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void quantize_mark(quantize_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void quantize_free(quantize_susp_type susp)
+{
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(quantize_susp_node), "quantize_free");
+}
+
+
+void quantize_print_tree(quantize_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_quantize(sound_type s1, long steps)
+{
+    register quantize_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, quantize_susp_node, "snd_make_quantize");
+    susp->factor = s1->scale * steps; scale_factor = (sample_type) (1.0 / steps);;
+    susp->susp.fetch = quantize_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = quantize_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = quantize_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = quantize_mark;
+    susp->susp.print_tree = quantize_print_tree;
+    susp->susp.name = "quantize";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_quantize(sound_type s1, long steps)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_quantize(s1_copy, steps);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/quantize.h b/lib-src/libnyquist/nyquist/tran/quantize.h
new file mode 100644
index 0000000..49630da
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/quantize.h
@@ -0,0 +1,3 @@
+sound_type snd_make_quantize(sound_type s1, long steps);
+sound_type snd_quantize(sound_type s1, long steps);
+    /* LISP: (snd-quantize SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/recip.alg b/lib-src/libnyquist/nyquist/tran/recip.alg
new file mode 100644
index 0000000..8a535d6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/recip.alg
@@ -0,0 +1,11 @@
+(RECIP-ALG
+  (NAME "recip")
+  (ARGUMENTS ("sound_type" "s1"))
+  (STATE ("double" "scale" "(1.0 / s1->scale)"))
+  (INTERNAL-SCALING s1)
+  (CONSTANT "scale")
+  (START (MIN s1))
+  (INNER-LOOP "output = (sample_type) (scale / s1)")
+  (TERMINATE (MIN s1))
+  (LOGICAL-STOP (MIN s1))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/recip.c b/lib-src/libnyquist/nyquist/tran/recip.c
new file mode 100644
index 0000000..36dd832
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/recip.c
@@ -0,0 +1,202 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "recip.h"
+
+void recip_free();
+
+
+typedef struct recip_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    double scale;
+} recip_susp_node, *recip_susp_type;
+
+
+void recip_n_fetch(register recip_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "recip_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale_reg = susp->scale;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) (scale_reg / *s1_ptr_reg++);
+	} while (--n); /* inner loop */
+
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* recip_n_fetch */
+
+
+void recip_toss_fetch(susp, snd_list)
+  register recip_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void recip_mark(recip_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void recip_free(recip_susp_type susp)
+{
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(recip_susp_node), "recip_free");
+}
+
+
+void recip_print_tree(recip_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_recip(sound_type s1)
+{
+    register recip_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, recip_susp_node, "snd_make_recip");
+    susp->scale = 1.0 / s1->scale;
+    susp->susp.fetch = recip_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = recip_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = recip_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = recip_mark;
+    susp->susp.print_tree = recip_print_tree;
+    susp->susp.name = "recip";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_recip(sound_type s1)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_recip(s1_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/recip.h b/lib-src/libnyquist/nyquist/tran/recip.h
new file mode 100644
index 0000000..059c7c7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/recip.h
@@ -0,0 +1,3 @@
+sound_type snd_make_recip(sound_type s1);
+sound_type snd_recip(sound_type s1);
+    /* LISP: (snd-recip SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/reson.alg b/lib-src/libnyquist/nyquist/tran/reson.alg
new file mode 100644
index 0000000..bc73cc3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/reson.alg
@@ -0,0 +1,23 @@
+(RESON-ALG
+(NAME "reson")
+(ARGUMENTS ("sound_type" "s") ("double" "hz") ("double" "bw")
+           ("int" "normalization"))
+(START (MIN s))
+(TERMINATE (MIN s))
+(LOGICAL-STOP (MIN s))
+(STATE ("double" "c3" "exp(bw * -PI2 / s->sr)")
+       ("double" "c3p1" "susp->c3 + 1.0")
+       ("double" "c3t4" "susp->c3 * 4.0")
+       ("double" "omc3" "1.0 - susp->c3")
+       ("double" "c2" "susp->c3t4 * cos(hz * PI2 / s->sr) / susp->c3p1")
+       ("double" "c1" "(normalization == 0 ? 1.0 :
+        (normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+            sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1))")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0"))
+(CONSTANT "c1" "c2" "c3")
+(INNER-LOOP "{ double y0 = c1 * s + c2 * y1 - c3 * y2;
+            output = (sample_type) y0;	
+            y2 = y1; y1 = y0; }")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/reson.c b/lib-src/libnyquist/nyquist/tran/reson.c
new file mode 100644
index 0000000..c20aa3b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/reson.c
@@ -0,0 +1,339 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "reson.h"
+
+void reson_free();
+
+
+typedef struct reson_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s;
+    long s_cnt;
+    sample_block_values_type s_ptr;
+
+    double c3;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    double c2;
+    double c1;
+    double y1;
+    double y2;
+} reson_susp_node, *reson_susp_type;
+
+
+void reson_n_fetch(register reson_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "reson_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3_reg = susp->c3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * *s_ptr_reg++ + c2_reg * y1_reg - c3_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;	
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* reson_n_fetch */
+
+
+void reson_s_fetch(register reson_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type s_scale_reg = susp->s->scale;
+    register sample_block_values_type s_ptr_reg;
+    falloc_sample_block(out, "reson_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s input sample block: */
+	susp_check_term_log_samples(s, s_ptr, s_cnt);
+	togo = min(togo, susp->s_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3_reg = susp->c3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s_ptr_reg = susp->s_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * (s_scale_reg * *s_ptr_reg++) + c2_reg * y1_reg - c3_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;	
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s_ptr_reg is a bad idea on RS/6000: */
+	susp->s_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* reson_s_fetch */
+
+
+void reson_toss_fetch(susp, snd_list)
+  register reson_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s up to final_time for this block of zeros */
+    while ((round((final_time - susp->s->t0) * susp->s->sr)) >=
+	   susp->s->current)
+	susp_get_samples(s, s_ptr, s_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s->t0) * susp->s->sr -
+         (susp->s->current - susp->s_cnt));
+    susp->s_ptr += n;
+    susp_took(s_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void reson_mark(reson_susp_type susp)
+{
+    sound_xlmark(susp->s);
+}
+
+
+void reson_free(reson_susp_type susp)
+{
+    sound_unref(susp->s);
+    ffree_generic(susp, sizeof(reson_susp_node), "reson_free");
+}
+
+
+void reson_print_tree(reson_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s:");
+    sound_print_tree_1(susp->s, n);
+}
+
+
+sound_type snd_make_reson(sound_type s, double hz, double bw, int normalization)
+{
+    register reson_susp_type susp;
+    rate_type sr = s->sr;
+    time_type t0 = s->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, reson_susp_node, "snd_make_reson");
+    susp->c3 = exp(bw * -PI2 / s->sr);
+    susp->c3p1 = susp->c3 + 1.0;
+    susp->c3t4 = susp->c3 * 4.0;
+    susp->omc3 = 1.0 - susp->c3;
+    susp->c2 = susp->c3t4 * cos(hz * PI2 / s->sr) / susp->c3p1;
+    susp->c1 = (normalization == 0 ? 1.0 :
+        (normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+            sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1));
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = reson_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = reson_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s->t0) sound_prepend_zeros(s, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = reson_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = reson_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = reson_mark;
+    susp->susp.print_tree = reson_print_tree;
+    susp->susp.name = "reson";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s);
+    susp->susp.current = 0;
+    susp->s = s;
+    susp->s_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_reson(sound_type s, double hz, double bw, int normalization)
+{
+    sound_type s_copy = sound_copy(s);
+    return snd_make_reson(s_copy, hz, bw, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/reson.h b/lib-src/libnyquist/nyquist/tran/reson.h
new file mode 100644
index 0000000..aec354a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/reson.h
@@ -0,0 +1,3 @@
+sound_type snd_make_reson(sound_type s, double hz, double bw, int normalization);
+sound_type snd_reson(sound_type s, double hz, double bw, int normalization);
+    /* LISP: (snd-reson SOUND ANYNUM ANYNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/resoncv.alg b/lib-src/libnyquist/nyquist/tran/resoncv.alg
new file mode 100644
index 0000000..8ad5c64
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resoncv.alg
@@ -0,0 +1,35 @@
+(RESONCV-ALG
+(NAME "resoncv")
+(ARGUMENTS ("sound_type" "s1") ("double" "hz") ("sound_type" "bw")
+           ("int" "normalization"))
+(INLINE-INTERPOLATION T)
+(INTERNAL-SCALING s1)
+(ALWAYS-SCALE bw)
+(START (MAX s1 bw))
+(TERMINATE (MIN s1 bw))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION bw)
+(STATE ("double" "scale1" "s1->scale")
+       ("double" "c3co" "0.0")
+       ("double" "coshz" "cos(hz * PI2 / s1->sr)")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr))"))
+(DEPENDS ("c3co" "bw" "exp(bw)")
+         ("c3p1" "bw" "c3co + 1.0" TEMP "double")
+         ("c3t4" "bw" "c3co * 4.0" TEMP "double")
+         ("omc3" "bw" "1.0 - c3co" TEMP "double")
+         ("c2"   "bw" "c3t4 * coshz / c3p1")
+         ("c1"   "bw" "(normalization == 0 ? 1.0 :
+          (normalization == 1 ? omc3 * sqrt(1.0 - c2 * c2 / c3t4) :
+              sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1)) * scale1"))
+(CONSTANT "c1" "c2" "c3co" "coshz" "normalization" "scale1")
+(FORCE-INTO-REGISTER normalization coshz scale1)
+(INNER-LOOP "{ double y0 = c1 * s1 + c2 * y1 - c3co * y2;
+            output = (sample_type) y0; 
+            y2 = y1; y1 = y0; }")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/resoncv.c b/lib-src/libnyquist/nyquist/tran/resoncv.c
new file mode 100644
index 0000000..77a8eb4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resoncv.c
@@ -0,0 +1,600 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "resoncv.h"
+
+void resoncv_free();
+
+
+typedef struct resoncv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type bw;
+    long bw_cnt;
+    sample_block_values_type bw_ptr;
+
+    /* support for interpolation of bw */
+    sample_type bw_x1_sample;
+    double bw_pHaSe;
+    double bw_pHaSe_iNcR;
+
+    /* support for ramp between samples of bw */
+    double output_per_bw;
+    long bw_n;
+
+    double scale1;
+    double c3co;
+    double coshz;
+    double c2;
+    double c1;
+    int normalization;
+    double y1;
+    double y2;
+} resoncv_susp_node, *resoncv_susp_type;
+
+
+void resoncv_ns_fetch(register resoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resoncv_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    double c3p1;
+	    double c3t4;
+	    double omc3;
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1 = c3co_reg + 1.0;
+	    c3t4 = c3co_reg * 4.0;
+	    omc3 = 1.0 - c3co_reg;
+	    c2_reg = c3t4 * coshz_reg / c3p1;
+	    c1_reg = (normalization_reg == 0 ? 1.0 :
+          (normalization_reg == 1 ? omc3 * sqrt(1.0 - c2_reg * c2_reg / c3t4) :
+              sqrt(c3p1 * c3p1 - c2_reg * c2_reg) * omc3 / c3p1)) * scale1_reg;
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0; 
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resoncv_ns_fetch */
+
+
+void resoncv_ni_fetch(register resoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resoncv_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	    double c3p1;
+	    double c3t4;
+	    double omc3;
+	susp->started = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	c3p1 = susp->c3co + 1.0;
+	c3t4 = susp->c3co * 4.0;
+	omc3 = 1.0 - susp->c3co;
+	susp->c2 = c3t4 * susp->coshz / c3p1;
+	susp->c1 = (susp->normalization == 0 ? 1.0 :
+          (susp->normalization == 1 ? omc3 * sqrt(1.0 - susp->c2 * susp->c2 / c3t4) :
+              sqrt(c3p1 * c3p1 - susp->c2 * susp->c2) * omc3 / c3p1)) * susp->scale1;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		double c3p1; 
+		double c3t4; 
+		double omc3; 
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1 = c3co_reg + 1.0;
+		c3t4 = c3co_reg * 4.0;
+		omc3 = 1.0 - c3co_reg;
+		c2_reg = susp->c2 = c3t4 * coshz_reg / c3p1;
+		c1_reg = susp->c1 = (normalization_reg == 0 ? 1.0 :
+          (normalization_reg == 1 ? omc3 * sqrt(1.0 - c2_reg * c2_reg / c3t4) :
+              sqrt(c3p1 * c3p1 - c2_reg * c2_reg) * omc3 / c3p1)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0; 
+            y2_reg = y1_reg; y1_reg = y0; };
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resoncv_ni_fetch */
+
+
+void resoncv_nr_fetch(register resoncv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resoncv_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    double c3p1;
+	    double c3t4;
+	    double omc3;
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    c3p1 = susp->c3co + 1.0;
+	    c3t4 = susp->c3co * 4.0;
+	    omc3 = 1.0 - susp->c3co;
+	    susp->c2 = c3t4 * susp->coshz / c3p1;
+	    susp->c1 = (susp->normalization == 0 ? 1.0 :
+          (susp->normalization == 1 ? omc3 * sqrt(1.0 - susp->c2 * susp->c2 / c3t4) :
+              sqrt(c3p1 * c3p1 - susp->c2 * susp->c2) * omc3 / c3p1)) * susp->scale1;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0; 
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resoncv_nr_fetch */
+
+
+void resoncv_toss_fetch(susp, snd_list)
+  register resoncv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from bw up to final_time for this block of zeros */
+    while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >=
+	   susp->bw->current)
+	susp_get_samples(bw, bw_ptr, bw_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->bw->t0) * susp->bw->sr -
+         (susp->bw->current - susp->bw_cnt));
+    susp->bw_ptr += n;
+    susp_took(bw_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void resoncv_mark(resoncv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->bw);
+}
+
+
+void resoncv_free(resoncv_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->bw);
+    ffree_generic(susp, sizeof(resoncv_susp_node), "resoncv_free");
+}
+
+
+void resoncv_print_tree(resoncv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("bw:");
+    sound_print_tree_1(susp->bw, n);
+}
+
+
+sound_type snd_make_resoncv(sound_type s1, double hz, sound_type bw, int normalization)
+{
+    register resoncv_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, bw->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, resoncv_susp_node, "snd_make_resoncv");
+    susp->scale1 = s1->scale;
+    susp->c3co = 0.0;
+    susp->coshz = cos(hz * PI2 / s1->sr);
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(bw, sr);
+    switch (interp_desc) {
+      case INTERP_sn: /* handled below */
+      case INTERP_ss: /* handled below */
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = resoncv_ns_fetch; break;
+      case INTERP_si: /* handled below */
+      case INTERP_ni: susp->susp.fetch = resoncv_ni_fetch; break;
+      case INTERP_sr: /* handled below */
+      case INTERP_nr: susp->susp.fetch = resoncv_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < bw->t0) sound_prepend_zeros(bw, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(bw->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = resoncv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = resoncv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = resoncv_mark;
+    susp->susp.print_tree = resoncv_print_tree;
+    susp->susp.name = "resoncv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->bw = bw;
+    susp->bw_cnt = 0;
+    susp->bw_pHaSe = 0.0;
+    susp->bw_pHaSe_iNcR = bw->sr / sr;
+    susp->bw_n = 0;
+    susp->output_per_bw = sr / bw->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_resoncv(sound_type s1, double hz, sound_type bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type bw_copy = sound_copy(bw);
+    return snd_make_resoncv(s1_copy, hz, bw_copy, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/resoncv.h b/lib-src/libnyquist/nyquist/tran/resoncv.h
new file mode 100644
index 0000000..57bbf60
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resoncv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_resoncv(sound_type s1, double hz, sound_type bw, int normalization);
+sound_type snd_resoncv(sound_type s1, double hz, sound_type bw, int normalization);
+    /* LISP: (snd-resoncv SOUND ANYNUM SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/resonvc.alg b/lib-src/libnyquist/nyquist/tran/resonvc.alg
new file mode 100644
index 0000000..74945b8
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvc.alg
@@ -0,0 +1,33 @@
+(RESONVC-ALG
+(NAME "resonvc")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz") ("double" "bw")
+           ("int" "normalization"))
+(INLINE-INTERPOLATION T)
+(INTERNAL-SCALING s1)
+(ALWAYS-SCALE hz)
+(START (MAX s1 hz))
+(TERMINATE (MIN s1 hz))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz)
+(STATE ("double" "scale1" "s1->scale")
+       ("double" "c3co" "exp(bw * -PI2 / s1->sr)")
+       ("double" "c3p1" "susp->c3co + 1.0")
+       ("double" "c3t4" "susp->c3co * 4.0")
+       ("double" "omc3" "1.0 - susp->c3co")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))"))
+(DEPENDS ("c2" "hz" "c3t4 * cos(hz) / c3p1")
+         ("c1" "hz" "(normalization == 0 ? scale1 :
+          (normalization == 1 ? omc3 * sqrt(1.0 - c2 * c2 / c3t4) :
+              sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1)) * scale1"))
+(CONSTANT "c1" "c2" "c3co" "c3p1" "c3t4" "omc3" "normalization" "scale1")
+(FORCE-INTO-REGISTER c3t4 c3p1 normalization omc3 scale1)
+(INNER-LOOP "{ double y0 = c1 * s1 + c2 * y1 - c3co * y2;
+            output = (sample_type) y0;
+            y2 = y1; y1 = y0; }")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/resonvc.c b/lib-src/libnyquist/nyquist/tran/resonvc.c
new file mode 100644
index 0000000..a84e5a5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvc.c
@@ -0,0 +1,588 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "resonvc.h"
+
+void resonvc_free();
+
+
+typedef struct resonvc_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz;
+    long hz_cnt;
+    sample_block_values_type hz_ptr;
+
+    /* support for interpolation of hz */
+    sample_type hz_x1_sample;
+    double hz_pHaSe;
+    double hz_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz */
+    double output_per_hz;
+    long hz_n;
+
+    double scale1;
+    double c3co;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    double c2;
+    double c1;
+    int normalization;
+    double y1;
+    double y2;
+} resonvc_susp_node, *resonvc_susp_type;
+
+
+void resonvc_ns_fetch(register resonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type hz_scale_reg = susp->hz->scale;
+    register sample_block_values_type hz_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvc_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz input sample block: */
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	togo = min(togo, susp->hz_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz_ptr_reg = susp->hz_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    c2_reg = c3t4_reg * cos((hz_scale_reg * *hz_ptr_reg++)) / c3p1_reg;
+	    c1_reg = (normalization_reg == 0 ? scale1_reg :
+          (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+              sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using hz_ptr_reg is a bad idea on RS/6000: */
+	susp->hz_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvc_ns_fetch */
+
+
+void resonvc_ni_fetch(register resonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double hz_pHaSe_iNcR_rEg = susp->hz_pHaSe_iNcR;
+    register double hz_pHaSe_ReG;
+    register sample_type hz_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvc_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	susp->c2 = susp->c3t4 * cos(susp->hz_x1_sample) / susp->c3p1;
+	susp->c1 = (susp->normalization == 0 ? susp->scale1 :
+          (susp->normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+              sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1)) * susp->scale1;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz_pHaSe_ReG = susp->hz_pHaSe;
+	hz_x1_sample_reg = susp->hz_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz */
+		/* pick up next sample as hz_x1_sample: */
+		susp->hz_ptr++;
+		susp_took(hz_cnt, 1);
+		hz_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz, hz_ptr, hz_cnt, hz_x1_sample_reg);
+		hz_x1_sample_reg = susp_current_sample(hz, hz_ptr);
+		c2_reg = susp->c2 = c3t4_reg * cos(hz_x1_sample_reg) / c3p1_reg;
+		c1_reg = susp->c1 = (normalization_reg == 0 ? scale1_reg :
+          (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+              sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz_pHaSe_ReG += hz_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->hz_pHaSe = hz_pHaSe_ReG;
+	susp->hz_x1_sample = hz_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvc_ni_fetch */
+
+
+void resonvc_nr_fetch(register resonvc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvc_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz_x1_sample when phase goes past 1.0; */
+	/* use hz_n (computed below) to avoid roundoff errors: */
+	if (susp->hz_n <= 0) {
+	    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	    susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	    susp->hz_pHaSe -= 1.0;
+	    /* hz_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz_n = (long) ((1.0 - susp->hz_pHaSe) *
+					susp->output_per_hz);
+	    susp->c2 = susp->c3t4 * cos(susp->hz_x1_sample) / susp->c3p1;
+	    susp->c1 = (susp->normalization == 0 ? susp->scale1 :
+          (susp->normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+              sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1)) * susp->scale1;
+	}
+	togo = min(togo, susp->hz_n);
+	hz_val = susp->hz_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz_pHaSe += togo * susp->hz_pHaSe_iNcR;
+	susp->hz_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvc_nr_fetch */
+
+
+void resonvc_toss_fetch(susp, snd_list)
+  register resonvc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >=
+	   susp->hz->current)
+	susp_get_samples(hz, hz_ptr, hz_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz->t0) * susp->hz->sr -
+         (susp->hz->current - susp->hz_cnt));
+    susp->hz_ptr += n;
+    susp_took(hz_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void resonvc_mark(resonvc_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz);
+}
+
+
+void resonvc_free(resonvc_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz);
+    ffree_generic(susp, sizeof(resonvc_susp_node), "resonvc_free");
+}
+
+
+void resonvc_print_tree(resonvc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz:");
+    sound_print_tree_1(susp->hz, n);
+}
+
+
+sound_type snd_make_resonvc(sound_type s1, sound_type hz, double bw, int normalization)
+{
+    register resonvc_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, hz->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, resonvc_susp_node, "snd_make_resonvc");
+    susp->scale1 = s1->scale;
+    susp->c3co = exp(bw * -PI2 / s1->sr);
+    susp->c3p1 = susp->c3co + 1.0;
+    susp->c3t4 = susp->c3co * 4.0;
+    susp->omc3 = 1.0 - susp->c3co;
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz, sr);
+    switch (interp_desc) {
+      case INTERP_sn: /* handled below */
+      case INTERP_ss: /* handled below */
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = resonvc_ns_fetch; break;
+      case INTERP_si: /* handled below */
+      case INTERP_ni: susp->susp.fetch = resonvc_ni_fetch; break;
+      case INTERP_sr: /* handled below */
+      case INTERP_nr: susp->susp.fetch = resonvc_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz->t0) sound_prepend_zeros(hz, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = resonvc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = resonvc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = resonvc_mark;
+    susp->susp.print_tree = resonvc_print_tree;
+    susp->susp.name = "resonvc";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz = hz;
+    susp->hz_cnt = 0;
+    susp->hz_pHaSe = 0.0;
+    susp->hz_pHaSe_iNcR = hz->sr / sr;
+    susp->hz_n = 0;
+    susp->output_per_hz = sr / hz->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_resonvc(sound_type s1, sound_type hz, double bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz_copy = sound_copy(hz);
+    return snd_make_resonvc(s1_copy, hz_copy, bw, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/resonvc.h b/lib-src/libnyquist/nyquist/tran/resonvc.h
new file mode 100644
index 0000000..b7b5d84
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_resonvc(sound_type s1, sound_type hz, double bw, int normalization);
+sound_type snd_resonvc(sound_type s1, sound_type hz, double bw, int normalization);
+    /* LISP: (snd-resonvc SOUND SOUND ANYNUM FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/resonvv.alg b/lib-src/libnyquist/nyquist/tran/resonvv.alg
new file mode 100644
index 0000000..4f6f429
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvv.alg
@@ -0,0 +1,47 @@
+(RESONVV-ALG
+(NAME "resonvv")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz1") ("sound_type" "bw")
+           ("int" "normalization"))
+(INLINE-INTERPOLATION T)
+(ALWAYS-SCALE hz1 bw)
+(START (MAX s1 hz1 bw))
+(TERMINATE (MIN s1 hz1 bw))
+(LOGICAL-STOP (MIN s1))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz1 bw)
+(STATE ("double" "scale1" "s1->scale")
+       ("double" "c3co" "0.0")
+       ("double" "c3p1" "0.0")
+       ("double" "c3t4" "0.0")
+       ("double" "omc3" "0.0")
+       ("double" "coshz" "0.0")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("boolean" "recompute" "false")
+       ("int" "normalization" "normalization")
+       ("double" "y1" "0.0")
+       ("double" "y2" "0.0;
+    hz1->scale = (sample_type) (hz1->scale * (PI2 / s1->sr));
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr));"))
+(DEPENDS ("c3co"  "bw" "exp(bw)")
+         ("c3p1"  "bw" "c3co + 1.0")
+          ("c3t4"  "bw" "c3co * 4.0")
+         ("omc3"  "bw" "1.0 - c3co")
+         ("recompute" "bw" "true")
+         ("coshz" "hz1" "cos(hz1)")
+         ("recompute" "hz1" "true"))
+(JOINT-DEPENDENCY (("hz1" "bw")
+"if (recompute) {"
+"    recompute = false;"
+"    c2 = c3t4 * coshz / c3p1;"
+"    c1 = (normalization == 0 ? 1.0 :"
+"          (normalization == 1 ? omc3 * sqrt(1.0 - c2 * c2 / c3t4) :"
+"           sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1)) * scale1;"
+"}"))
+(CONSTANT "c1" "c2" "c3co" "coshz" "c3p1" "c3t4" "omc3" 
+          "normalization" "scale1")
+(FORCE-INTO-REGISTER recompute) ;c3t4 c3p1 normalization omc3 scale1
+(INNER-LOOP "{ double y0 = c1 * s1 + c2 * y1 - c3co * y2;
+            output = (sample_type) y0;
+            y2 = y1; y1 = y0; }")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/resonvv.c b/lib-src/libnyquist/nyquist/tran/resonvv.c
new file mode 100644
index 0000000..3b2aca9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvv.c
@@ -0,0 +1,3251 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "resonvv.h"
+
+void resonvv_free();
+
+
+typedef struct resonvv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz1;
+    long hz1_cnt;
+    sample_block_values_type hz1_ptr;
+
+    /* support for interpolation of hz1 */
+    sample_type hz1_x1_sample;
+    double hz1_pHaSe;
+    double hz1_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz1 */
+    double output_per_hz1;
+    long hz1_n;
+    sound_type bw;
+    long bw_cnt;
+    sample_block_values_type bw_ptr;
+
+    /* support for interpolation of bw */
+    sample_type bw_x1_sample;
+    double bw_pHaSe;
+    double bw_pHaSe_iNcR;
+
+    /* support for ramp between samples of bw */
+    double output_per_bw;
+    long bw_n;
+
+    double scale1;
+    double c3co;
+    double c3p1;
+    double c3t4;
+    double omc3;
+    double coshz;
+    double c2;
+    double c1;
+    boolean recompute;
+    int normalization;
+    double y1;
+    double y2;
+} resonvv_susp_node, *resonvv_susp_type;
+
+
+void resonvv_nss_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nss_fetch */
+
+
+void resonvv_nsi_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nsi_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nsi_fetch */
+
+
+void resonvv_nsr_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nsr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nsr_fetch */
+
+
+void resonvv_nis_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nis_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nis_fetch */
+
+
+void resonvv_nii_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nii_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nii_fetch */
+
+
+void resonvv_nir_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nir_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nir_fetch */
+
+
+void resonvv_nrs_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nrs_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nrs_fetch */
+
+
+void resonvv_nri_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nri_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nri_fetch */
+
+
+void resonvv_nrr_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_nrr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	if (susp->recompute) {
+	    susp->recompute = false;
+	    susp->c2 = susp->c3t4 * susp->coshz / susp->c3p1;
+	    susp->c1 = (susp->normalization == 0 ? 1.0 :
+	          (susp->normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+	           sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1)) * susp->scale1;
+	}
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * *s1_ptr_reg++ + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_nrr_fetch */
+
+
+void resonvv_sss_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_sss_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_sss_fetch */
+
+
+void resonvv_ssi_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_ssi_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_ssi_fetch */
+
+
+void resonvv_ssr_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type hz1_scale_reg = susp->hz1->scale;
+    register sample_block_values_type hz1_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_ssr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz1 input sample block: */
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	togo = min(togo, susp->hz1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_ptr_reg = susp->hz1_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    coshz_reg = cos((hz1_scale_reg * *hz1_ptr_reg++));
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using hz1_ptr_reg is a bad idea on RS/6000: */
+	susp->hz1_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_ssr_fetch */
+
+
+void resonvv_sis_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_sis_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_sis_fetch */
+
+
+void resonvv_sii_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_sii_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_sii_fetch */
+
+
+void resonvv_sir_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double hz1_pHaSe_iNcR_rEg = susp->hz1_pHaSe_iNcR;
+    register double hz1_pHaSe_ReG;
+    register sample_type hz1_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_sir_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	susp->coshz = cos(susp->hz1_x1_sample);
+	susp->recompute = true;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	hz1_pHaSe_ReG = susp->hz1_pHaSe;
+	hz1_x1_sample_reg = susp->hz1_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz1_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz1 */
+		/* pick up next sample as hz1_x1_sample: */
+		susp->hz1_ptr++;
+		susp_took(hz1_cnt, 1);
+		hz1_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz1, hz1_ptr, hz1_cnt, hz1_x1_sample_reg);
+		hz1_x1_sample_reg = susp_current_sample(hz1, hz1_ptr);
+		coshz_reg = susp->coshz = cos(hz1_x1_sample_reg);
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    hz1_pHaSe_ReG += hz1_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->hz1_pHaSe = hz1_pHaSe_ReG;
+	susp->hz1_x1_sample = hz1_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_sir_fetch */
+
+
+void resonvv_srs_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type bw_scale_reg = susp->bw->scale;
+    register sample_block_values_type bw_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_srs_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past the bw input sample block: */
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	togo = min(togo, susp->bw_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_ptr_reg = susp->bw_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    c3co_reg = exp((bw_scale_reg * *bw_ptr_reg++));
+	    c3p1_reg = c3co_reg + 1.0;
+	    c3t4_reg = c3co_reg * 4.0;
+	    omc3_reg = 1.0 - c3co_reg;
+	    recompute_reg = true;
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using bw_ptr_reg is a bad idea on RS/6000: */
+	susp->bw_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp_took(bw_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_srs_fetch */
+
+
+void resonvv_sri_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c3co_reg;
+    register double c3p1_reg;
+    register double c3t4_reg;
+    register double omc3_reg;
+    register double coshz_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register int normalization_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register double bw_pHaSe_iNcR_rEg = susp->bw_pHaSe_iNcR;
+    register double bw_pHaSe_ReG;
+    register sample_type bw_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_sri_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	susp->c3co = exp(susp->bw_x1_sample);
+	susp->c3p1 = susp->c3co + 1.0;
+	susp->c3t4 = susp->c3co * 4.0;
+	susp->omc3 = 1.0 - susp->c3co;
+	susp->recompute = true;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c3co_reg = susp->c3co;
+	c3p1_reg = susp->c3p1;
+	c3t4_reg = susp->c3t4;
+	omc3_reg = susp->omc3;
+	coshz_reg = susp->coshz;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	normalization_reg = susp->normalization;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	bw_pHaSe_ReG = susp->bw_pHaSe;
+	bw_x1_sample_reg = susp->bw_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (bw_pHaSe_ReG >= 1.0) {
+/* fixup-depends bw */
+		/* pick up next sample as bw_x1_sample: */
+		susp->bw_ptr++;
+		susp_took(bw_cnt, 1);
+		bw_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(bw, bw_ptr, bw_cnt, bw_x1_sample_reg);
+		bw_x1_sample_reg = susp_current_sample(bw, bw_ptr);
+		c3co_reg = susp->c3co = exp(bw_x1_sample_reg);
+		c3p1_reg = susp->c3p1 = c3co_reg + 1.0;
+		c3t4_reg = susp->c3t4 = c3co_reg * 4.0;
+		omc3_reg = susp->omc3 = 1.0 - c3co_reg;
+		recompute_reg = susp->recompute = true;
+	    }
+	    if (recompute_reg) {
+	        recompute_reg = false;
+	        c2_reg = c3t4_reg * coshz_reg / c3p1_reg;
+	        c1_reg = (normalization_reg == 0 ? 1.0 :
+	              (normalization_reg == 1 ? omc3_reg * sqrt(1.0 - c2_reg * c2_reg / c3t4_reg) :
+	               sqrt(c3p1_reg * c3p1_reg - c2_reg * c2_reg) * omc3_reg / c3p1_reg)) * scale1_reg;
+	    }
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	    bw_pHaSe_ReG += bw_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	susp->bw_pHaSe = bw_pHaSe_ReG;
+	susp->bw_x1_sample = bw_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_sri_fetch */
+
+
+void resonvv_srr_fetch(register resonvv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz1_val;
+    sample_type bw_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c3co_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register boolean recompute_reg;
+    register double y1_reg;
+    register double y2_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "resonvv_srr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz1_pHaSe = 1.0;
+	susp->bw_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+
+    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz1_x1_sample when phase goes past 1.0; */
+	/* use hz1_n (computed below) to avoid roundoff errors: */
+	if (susp->hz1_n <= 0) {
+	    susp_check_term_samples(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_x1_sample = susp_fetch_sample(hz1, hz1_ptr, hz1_cnt);
+	    susp->hz1_pHaSe -= 1.0;
+	    /* hz1_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz1_n = (long) ((1.0 - susp->hz1_pHaSe) *
+					susp->output_per_hz1);
+	    susp->coshz = cos(susp->hz1_x1_sample);
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->hz1_n);
+	hz1_val = susp->hz1_x1_sample;
+	/* grab next bw_x1_sample when phase goes past 1.0; */
+	/* use bw_n (computed below) to avoid roundoff errors: */
+	if (susp->bw_n <= 0) {
+	    susp_check_term_samples(bw, bw_ptr, bw_cnt);
+	    susp->bw_x1_sample = susp_fetch_sample(bw, bw_ptr, bw_cnt);
+	    susp->bw_pHaSe -= 1.0;
+	    /* bw_n gets number of samples before phase exceeds 1.0: */
+	    susp->bw_n = (long) ((1.0 - susp->bw_pHaSe) *
+					susp->output_per_bw);
+	    susp->c3co = exp(susp->bw_x1_sample);
+	    susp->c3p1 = susp->c3co + 1.0;
+	    susp->c3t4 = susp->c3co * 4.0;
+	    susp->omc3 = 1.0 - susp->c3co;
+	    susp->recompute = true;
+	}
+	togo = min(togo, susp->bw_n);
+	bw_val = susp->bw_x1_sample;
+	if (susp->recompute) {
+	    susp->recompute = false;
+	    susp->c2 = susp->c3t4 * susp->coshz / susp->c3p1;
+	    susp->c1 = (susp->normalization == 0 ? 1.0 :
+	          (susp->normalization == 1 ? susp->omc3 * sqrt(1.0 - susp->c2 * susp->c2 / susp->c3t4) :
+	           sqrt(susp->c3p1 * susp->c3p1 - susp->c2 * susp->c2) * susp->omc3 / susp->c3p1)) * susp->scale1;
+	}
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c3co_reg = susp->c3co;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	recompute_reg = susp->recompute;
+	y1_reg = susp->y1;
+	y2_reg = susp->y2;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ double y0 = c1_reg * (s1_scale_reg * *s1_ptr_reg++) + c2_reg * y1_reg - c3co_reg * y2_reg;
+            *out_ptr_reg++ = (sample_type) y0;
+            y2_reg = y1_reg; y1_reg = y0; };
+	} while (--n); /* inner loop */
+
+	susp->recompute = recompute_reg;
+	susp->y1 = y1_reg;
+	susp->y2 = y2_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz1_pHaSe += togo * susp->hz1_pHaSe_iNcR;
+	susp->hz1_n -= togo;
+	susp->bw_pHaSe += togo * susp->bw_pHaSe_iNcR;
+	susp->bw_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* resonvv_srr_fetch */
+
+
+void resonvv_toss_fetch(susp, snd_list)
+  register resonvv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz1->t0) * susp->hz1->sr)) >=
+	   susp->hz1->current)
+	susp_get_samples(hz1, hz1_ptr, hz1_cnt);
+    /* fetch samples from bw up to final_time for this block of zeros */
+    while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >=
+	   susp->bw->current)
+	susp_get_samples(bw, bw_ptr, bw_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz1->t0) * susp->hz1->sr -
+         (susp->hz1->current - susp->hz1_cnt));
+    susp->hz1_ptr += n;
+    susp_took(hz1_cnt, n);
+    n = round((final_time - susp->bw->t0) * susp->bw->sr -
+         (susp->bw->current - susp->bw_cnt));
+    susp->bw_ptr += n;
+    susp_took(bw_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void resonvv_mark(resonvv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz1);
+    sound_xlmark(susp->bw);
+}
+
+
+void resonvv_free(resonvv_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz1);
+    sound_unref(susp->bw);
+    ffree_generic(susp, sizeof(resonvv_susp_node), "resonvv_free");
+}
+
+
+void resonvv_print_tree(resonvv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz1:");
+    sound_print_tree_1(susp->hz1, n);
+
+    indent(n);
+    stdputstr("bw:");
+    sound_print_tree_1(susp->bw, n);
+}
+
+
+sound_type snd_make_resonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization)
+{
+    register resonvv_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(max(s1->t0, hz1->t0), bw->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, resonvv_susp_node, "snd_make_resonvv");
+    susp->scale1 = s1->scale;
+    susp->c3co = 0.0;
+    susp->c3p1 = 0.0;
+    susp->c3t4 = 0.0;
+    susp->omc3 = 0.0;
+    susp->coshz = 0.0;
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->recompute = false;
+    susp->normalization = normalization;
+    susp->y1 = 0.0;
+    susp->y2 = 0.0;
+    hz1->scale = (sample_type) (hz1->scale * (PI2 / s1->sr));
+    bw->scale = (sample_type) (bw->scale * (-PI2 / s1->sr));;
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(bw, sr);
+    switch (interp_desc) {
+      case INTERP_nnn: /* handled below */
+      case INTERP_nns: /* handled below */
+      case INTERP_nsn: /* handled below */
+      case INTERP_nss: susp->susp.fetch = resonvv_nss_fetch; break;
+      case INTERP_nni: /* handled below */
+      case INTERP_nsi: susp->susp.fetch = resonvv_nsi_fetch; break;
+      case INTERP_nnr: /* handled below */
+      case INTERP_nsr: susp->susp.fetch = resonvv_nsr_fetch; break;
+      case INTERP_nin: /* handled below */
+      case INTERP_nis: susp->susp.fetch = resonvv_nis_fetch; break;
+      case INTERP_nii: susp->susp.fetch = resonvv_nii_fetch; break;
+      case INTERP_nir: susp->susp.fetch = resonvv_nir_fetch; break;
+      case INTERP_nrn: /* handled below */
+      case INTERP_nrs: susp->susp.fetch = resonvv_nrs_fetch; break;
+      case INTERP_nri: susp->susp.fetch = resonvv_nri_fetch; break;
+      case INTERP_nrr: susp->susp.fetch = resonvv_nrr_fetch; break;
+      case INTERP_snn: /* handled below */
+      case INTERP_sns: /* handled below */
+      case INTERP_ssn: /* handled below */
+      case INTERP_sss: susp->susp.fetch = resonvv_sss_fetch; break;
+      case INTERP_sni: /* handled below */
+      case INTERP_ssi: susp->susp.fetch = resonvv_ssi_fetch; break;
+      case INTERP_snr: /* handled below */
+      case INTERP_ssr: susp->susp.fetch = resonvv_ssr_fetch; break;
+      case INTERP_sin: /* handled below */
+      case INTERP_sis: susp->susp.fetch = resonvv_sis_fetch; break;
+      case INTERP_sii: susp->susp.fetch = resonvv_sii_fetch; break;
+      case INTERP_sir: susp->susp.fetch = resonvv_sir_fetch; break;
+      case INTERP_srn: /* handled below */
+      case INTERP_srs: susp->susp.fetch = resonvv_srs_fetch; break;
+      case INTERP_sri: susp->susp.fetch = resonvv_sri_fetch; break;
+      case INTERP_srr: susp->susp.fetch = resonvv_srr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz1->t0) sound_prepend_zeros(hz1, t0);
+    if (t0 < bw->t0) sound_prepend_zeros(bw, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz1->t0, min(bw->t0, t0)));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = resonvv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = resonvv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = resonvv_mark;
+    susp->susp.print_tree = resonvv_print_tree;
+    susp->susp.name = "resonvv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz1 = hz1;
+    susp->hz1_cnt = 0;
+    susp->hz1_pHaSe = 0.0;
+    susp->hz1_pHaSe_iNcR = hz1->sr / sr;
+    susp->hz1_n = 0;
+    susp->output_per_hz1 = sr / hz1->sr;
+    susp->bw = bw;
+    susp->bw_cnt = 0;
+    susp->bw_pHaSe = 0.0;
+    susp->bw_pHaSe_iNcR = bw->sr / sr;
+    susp->bw_n = 0;
+    susp->output_per_bw = sr / bw->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_resonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz1_copy = sound_copy(hz1);
+    sound_type bw_copy = sound_copy(bw);
+    return snd_make_resonvv(s1_copy, hz1_copy, bw_copy, normalization);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/resonvv.h b/lib-src/libnyquist/nyquist/tran/resonvv.h
new file mode 100644
index 0000000..f1fee48
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/resonvv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_resonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization);
+sound_type snd_resonvv(sound_type s1, sound_type hz1, sound_type bw, int normalization);
+    /* LISP: (snd-resonvv SOUND SOUND SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/sampler.alg b/lib-src/libnyquist/nyquist/tran/sampler.alg
new file mode 100644
index 0000000..cc5fad7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sampler.alg
@@ -0,0 +1,49 @@
+(SAMPLER-ALG
+(NAME "sampler")
+(ARGUMENTS ("sound_type" "s") ("double" "step") ("double" "loop_start") 
+        ("rate_type" "sr") ("double" "hz") ("time_type" "t0") ("sound_type" "s_fm")
+        ("long" "npoints"))
+(TABLE "s")
+(NOT-IN-INNER-LOOP "s")
+(STATE 
+       ("double" "loop_to" "loop_start * s->sr")
+       ("table_type" "the_table" "sound_to_table(s)")
+       ("sample_type *" "table_ptr" "susp->the_table->samples")
+       ("double" "table_len" "susp->the_table->length;
+    { long index = (long) susp->loop_to;
+      double frac = susp->loop_to - index;
+      if (index > round(susp->table_len) ||
+          index < 0) {
+          index = 0;
+          frac = 0;
+      }
+      susp->table_ptr[round(susp->table_len)] = /* copy interpolated start to last entry */
+          (sample_type) (susp->table_ptr[index] * (1.0 - frac) + 
+                         susp->table_ptr[index + 1] * frac);}")
+       ("double" "phase" "0.0")
+       ("double" "ph_incr" "(s->sr / sr) * hz / step_to_hz(step);
+    s_fm->scale = (sample_type) (s_fm->scale * (susp->ph_incr / hz))") )
+
+(ALWAYS-SCALE s_fm)
+(INLINE-INTERPOLATION T) ; so that modulation can be low frequency
+(STEP-FUNCTION s_fm)
+(TERMINATE (MIN s_fm))
+(LOGICAL-STOP (MIN s_fm))
+(INNER-LOOP-LOCALS "	    long table_index;
+            double x1;
+")
+(INNER-LOOP "table_index = (long) phase;
+            x1 = table_ptr[table_index];
+            output = (sample_type) (x1 + (phase - table_index) * 
+                          (table_ptr[table_index + 1] - x1));
+            phase += ph_incr + s_fm;
+            while (phase > table_len) phase -= (table_len - loop_to);
+            /* watch out for negative frequencies! */
+            if (phase < 0) phase = 0")
+(CONSTANT "ph_incr" "table_len" "table_ptr" "loop_to")
+
+(SAMPLE-RATE "sr")
+(FINALIZATION "    table_unref(susp->the_table);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/sampler.c b/lib-src/libnyquist/nyquist/tran/sampler.c
new file mode 100644
index 0000000..2ba3ed3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sampler.c
@@ -0,0 +1,510 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "sampler.h"
+
+void sampler_free();
+
+
+typedef struct sampler_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s_fm;
+    long s_fm_cnt;
+    sample_block_values_type s_fm_ptr;
+
+    /* support for interpolation of s_fm */
+    sample_type s_fm_x1_sample;
+    double s_fm_pHaSe;
+    double s_fm_pHaSe_iNcR;
+
+    /* support for ramp between samples of s_fm */
+    double output_per_s_fm;
+    long s_fm_n;
+
+    double loop_to;
+    table_type the_table;
+    sample_type *table_ptr;
+    double table_len;
+    double phase;
+    double ph_incr;
+} sampler_susp_node, *sampler_susp_type;
+
+
+void sampler_s_fetch(register sampler_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double loop_to_reg;
+    register sample_type * table_ptr_reg;
+    register double table_len_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    register sample_type s_fm_scale_reg = susp->s_fm->scale;
+    register sample_block_values_type s_fm_ptr_reg;
+    falloc_sample_block(out, "sampler_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s_fm input sample block: */
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	togo = min(togo, susp->s_fm_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	loop_to_reg = susp->loop_to;
+	table_ptr_reg = susp->table_ptr;
+	table_len_reg = susp->table_len;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	s_fm_ptr_reg = susp->s_fm_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + (s_fm_scale_reg * *s_fm_ptr_reg++);
+            while (phase_reg > table_len_reg) phase_reg -= (table_len_reg - loop_to_reg);
+            /* watch out for negative frequencies! */
+            if (phase_reg < 0) phase_reg = 0;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	/* using s_fm_ptr_reg is a bad idea on RS/6000: */
+	susp->s_fm_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_fm_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* sampler_s_fetch */
+
+
+void sampler_i_fetch(register sampler_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double loop_to_reg;
+    register sample_type * table_ptr_reg;
+    register double table_len_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    register double s_fm_pHaSe_iNcR_rEg = susp->s_fm_pHaSe_iNcR;
+    register double s_fm_pHaSe_ReG;
+    register sample_type s_fm_x1_sample_reg;
+    falloc_sample_block(out, "sampler_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	loop_to_reg = susp->loop_to;
+	table_ptr_reg = susp->table_ptr;
+	table_len_reg = susp->table_len;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	s_fm_pHaSe_ReG = susp->s_fm_pHaSe;
+	s_fm_x1_sample_reg = susp->s_fm_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+	    if (s_fm_pHaSe_ReG >= 1.0) {
+/* fixup-depends s_fm */
+		/* pick up next sample as s_fm_x1_sample: */
+		susp->s_fm_ptr++;
+		susp_took(s_fm_cnt, 1);
+		s_fm_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(s_fm, s_fm_ptr, s_fm_cnt, s_fm_x1_sample_reg);
+		s_fm_x1_sample_reg = susp_current_sample(s_fm, s_fm_ptr);
+	    }
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + s_fm_x1_sample_reg;
+            while (phase_reg > table_len_reg) phase_reg -= (table_len_reg - loop_to_reg);
+            /* watch out for negative frequencies! */
+            if (phase_reg < 0) phase_reg = 0;
+	    s_fm_pHaSe_ReG += s_fm_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->phase = phase_reg;
+	susp->s_fm_pHaSe = s_fm_pHaSe_ReG;
+	susp->s_fm_x1_sample = s_fm_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* sampler_i_fetch */
+
+
+void sampler_r_fetch(register sampler_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type s_fm_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double loop_to_reg;
+    register sample_type * table_ptr_reg;
+    register double table_len_reg;
+    register double phase_reg;
+    register double ph_incr_reg;
+    falloc_sample_block(out, "sampler_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->s_fm_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next s_fm_x1_sample when phase goes past 1.0; */
+	/* use s_fm_n (computed below) to avoid roundoff errors: */
+	if (susp->s_fm_n <= 0) {
+	    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_pHaSe -= 1.0;
+	    /* s_fm_n gets number of samples before phase exceeds 1.0: */
+	    susp->s_fm_n = (long) ((1.0 - susp->s_fm_pHaSe) *
+					susp->output_per_s_fm);
+	}
+	togo = min(togo, susp->s_fm_n);
+	s_fm_val = susp->s_fm_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	loop_to_reg = susp->loop_to;
+	table_ptr_reg = susp->table_ptr;
+	table_len_reg = susp->table_len;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double x1;
+table_index = (long) phase_reg;
+            x1 = table_ptr_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (phase_reg - table_index) * 
+                          (table_ptr_reg[table_index + 1] - x1));
+            phase_reg += ph_incr_reg + s_fm_val;
+            while (phase_reg > table_len_reg) phase_reg -= (table_len_reg - loop_to_reg);
+            /* watch out for negative frequencies! */
+            if (phase_reg < 0) phase_reg = 0;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	out_ptr += togo;
+	susp->s_fm_pHaSe += togo * susp->s_fm_pHaSe_iNcR;
+	susp->s_fm_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* sampler_r_fetch */
+
+
+void sampler_toss_fetch(susp, snd_list)
+  register sampler_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s_fm up to final_time for this block of zeros */
+    while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >=
+	   susp->s_fm->current)
+	susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr -
+         (susp->s_fm->current - susp->s_fm_cnt));
+    susp->s_fm_ptr += n;
+    susp_took(s_fm_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void sampler_mark(sampler_susp_type susp)
+{
+    sound_xlmark(susp->s_fm);
+}
+
+
+void sampler_free(sampler_susp_type susp)
+{
+    table_unref(susp->the_table);
+    sound_unref(susp->s_fm);
+    ffree_generic(susp, sizeof(sampler_susp_node), "sampler_free");
+}
+
+
+void sampler_print_tree(sampler_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s_fm:");
+    sound_print_tree_1(susp->s_fm, n);
+}
+
+
+sound_type snd_make_sampler(sound_type s, double step, double loop_start, rate_type sr, double hz, time_type t0, sound_type s_fm, long npoints)
+{
+    register sampler_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, sampler_susp_node, "snd_make_sampler");
+    susp->loop_to = loop_start * s->sr;
+    susp->the_table = sound_to_table(s);
+    susp->table_ptr = susp->the_table->samples;
+    susp->table_len = susp->the_table->length;
+    { long index = (long) susp->loop_to;
+      double frac = susp->loop_to - index;
+      if (index > round(susp->table_len) ||
+          index < 0) {
+          index = 0;
+          frac = 0;
+      }
+      susp->table_ptr[round(susp->table_len)] = /* copy interpolated start to last entry */
+          (sample_type) (susp->table_ptr[index] * (1.0 - frac) + 
+                         susp->table_ptr[index + 1] * frac);};
+    susp->phase = 0.0;
+    susp->ph_incr = (s->sr / sr) * hz / step_to_hz(step);
+    s_fm->scale = (sample_type) (s_fm->scale * (susp->ph_incr / hz));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s_fm, sr);
+    switch (interp_desc) {
+      case INTERP_n: /* handled below */
+      case INTERP_s: susp->susp.fetch = sampler_s_fetch; break;
+      case INTERP_i: susp->susp.fetch = sampler_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = sampler_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s_fm->t0) sound_prepend_zeros(s_fm, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s_fm->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = sampler_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = sampler_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = sampler_mark;
+    susp->susp.print_tree = sampler_print_tree;
+    susp->susp.name = "sampler";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s_fm);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s_fm = s_fm;
+    susp->s_fm_cnt = 0;
+    susp->s_fm_pHaSe = 0.0;
+    susp->s_fm_pHaSe_iNcR = s_fm->sr / sr;
+    susp->s_fm_n = 0;
+    susp->output_per_s_fm = sr / s_fm->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sampler(sound_type s, double step, double loop_start, rate_type sr, double hz, time_type t0, sound_type s_fm, long npoints)
+{
+    sound_type s_fm_copy = sound_copy(s_fm);
+    return snd_make_sampler(s, step, loop_start, sr, hz, t0, s_fm_copy, npoints);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/sampler.h b/lib-src/libnyquist/nyquist/tran/sampler.h
new file mode 100644
index 0000000..49be41e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sampler.h
@@ -0,0 +1,3 @@
+sound_type snd_make_sampler(sound_type s, double step, double loop_start, rate_type sr, double hz, time_type t0, sound_type s_fm, long npoints);
+sound_type snd_sampler(sound_type s, double step, double loop_start, rate_type sr, double hz, time_type t0, sound_type s_fm, long npoints);
+    /* LISP: (snd-sampler SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM SOUND FIXNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/scale.alg b/lib-src/libnyquist/nyquist/tran/scale.alg
new file mode 100644
index 0000000..f993e95
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/scale.alg
@@ -0,0 +1,11 @@
+(SCALE-ALG
+  (NAME "normalize")
+  (ARGUMENTS ("sound_type" "s1"))
+  (STATE ("sample_type" "scale" "s1->scale"))
+  (CONSTANT "scale")
+  (START (MIN s1))
+  (INTERNAL-SCALING s1)
+  (INNER-LOOP "output = s1 * scale")
+  (TERMINATE (MIN s1))
+  (LOGICAL-STOP (MIN s1))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/scale.c b/lib-src/libnyquist/nyquist/tran/scale.c
new file mode 100644
index 0000000..cc011a9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/scale.c
@@ -0,0 +1,202 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "scale.h"
+
+void normalize_free();
+
+
+typedef struct normalize_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    sample_type scale;
+} normalize_susp_node, *normalize_susp_type;
+
+
+void normalize_n_fetch(register normalize_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type scale_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "normalize_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale_reg = susp->scale;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = *s1_ptr_reg++ * scale_reg;
+	} while (--n); /* inner loop */
+
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* normalize_n_fetch */
+
+
+void normalize_toss_fetch(susp, snd_list)
+  register normalize_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void normalize_mark(normalize_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void normalize_free(normalize_susp_type susp)
+{
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(normalize_susp_node), "normalize_free");
+}
+
+
+void normalize_print_tree(normalize_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_normalize(sound_type s1)
+{
+    register normalize_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, normalize_susp_node, "snd_make_normalize");
+    susp->scale = s1->scale;
+    susp->susp.fetch = normalize_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = normalize_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = normalize_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = normalize_mark;
+    susp->susp.print_tree = normalize_print_tree;
+    susp->susp.name = "normalize";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_normalize(sound_type s1)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_normalize(s1_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/scale.h b/lib-src/libnyquist/nyquist/tran/scale.h
new file mode 100644
index 0000000..48f73f9
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/scale.h
@@ -0,0 +1,3 @@
+sound_type snd_make_normalize(sound_type s1);
+sound_type snd_normalize(sound_type s1);
+    /* LISP: (snd-normalize SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/shape.alg b/lib-src/libnyquist/nyquist/tran/shape.alg
new file mode 100644
index 0000000..ad6d603
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/shape.alg
@@ -0,0 +1,39 @@
+(SHAPE-ALG
+        (NAME "shape") 
+        (ARGUMENTS ("sound_type" "sin") ("sound_type" "fn") 
+                ("double" "origin"))
+        (START (MIN sin))       
+        (TABLE "fn")
+        (NOT-IN-INNER-LOOP "fn")
+        (STATE 
+               ("double" "time_to_index" "fn->sr")
+               ("double" "origin" "origin")
+               ("table_type" "the_table" "sound_to_table(fn)")
+               ("sample_type *" "fcn_table" "susp->the_table->samples")         
+           ("double" "table_len" "susp->the_table->length") )
+        (TERMINATE (MIN sin))
+        (LOGICAL-STOP (MIN sin))
+        (INNER-LOOP "
+            register double offset, x1;
+            register long table_index;
+            register double phase = sin;
+            if (phase > 1.0) phase = 1.0;
+            else if (phase < -1.0) phase = -1.0;
+            offset = (phase + origin) * time_to_index;
+            table_index = (long) offset;
+            if (table_index < 0) { 
+                table_index = 0; 
+                offset = 0;
+            }
+            if (table_index >= table_len) {
+                offset = table_len - 1;
+                table_index = (long) offset;
+            }
+            x1 = fcn_table[table_index];
+            output = (sample_type) (x1 + (offset - table_index) * 
+                     (fcn_table[table_index + 1] - x1));
+        ")
+        (ALWAYS-SCALE sin)
+        (CONSTANT "table_len" "time_to_index" "origen" "fcn_table" "the_table")
+        (FINALIZATION "table_unref(susp->the_table);")
+)
diff --git a/lib-src/libnyquist/nyquist/tran/shape.c b/lib-src/libnyquist/nyquist/tran/shape.c
new file mode 100644
index 0000000..1df83c4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/shape.c
@@ -0,0 +1,237 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "shape.h"
+
+void shape_free();
+
+
+typedef struct shape_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type sin;
+    long sin_cnt;
+    sample_block_values_type sin_ptr;
+
+    double time_to_index;
+    double origin;
+    table_type the_table;
+    sample_type *fcn_table;
+    double table_len;
+} shape_susp_node, *shape_susp_type;
+
+
+void shape_s_fetch(register shape_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double time_to_index_reg;
+    register double origin_reg;
+    register sample_type * fcn_table_reg;
+    register double table_len_reg;
+    register sample_type sin_scale_reg = susp->sin->scale;
+    register sample_block_values_type sin_ptr_reg;
+    falloc_sample_block(out, "shape_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the sin input sample block: */
+	susp_check_term_log_samples(sin, sin_ptr, sin_cnt);
+	togo = min(togo, susp->sin_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	time_to_index_reg = susp->time_to_index;
+	origin_reg = susp->origin;
+	fcn_table_reg = susp->fcn_table;
+	table_len_reg = susp->table_len;
+	sin_ptr_reg = susp->sin_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+            register double offset, x1;
+            register long table_index;
+            register double phase = (sin_scale_reg * *sin_ptr_reg++);
+            if (phase > 1.0) phase = 1.0;
+            else if (phase < -1.0) phase = -1.0;
+            offset = (phase + origin_reg) * time_to_index_reg;
+            table_index = (long) offset;
+            if (table_index < 0) { 
+                table_index = 0; 
+                offset = 0;
+            }
+            if (table_index >= table_len_reg) {
+                offset = table_len_reg - 1;
+                table_index = (long) offset;
+            }
+            x1 = fcn_table_reg[table_index];
+            *out_ptr_reg++ = (sample_type) (x1 + (offset - table_index) * 
+                     (fcn_table_reg[table_index + 1] - x1));
+        ;
+	} while (--n); /* inner loop */
+
+	susp->origin = origin_reg;
+	/* using sin_ptr_reg is a bad idea on RS/6000: */
+	susp->sin_ptr += togo;
+	out_ptr += togo;
+	susp_took(sin_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* shape_s_fetch */
+
+
+void shape_toss_fetch(susp, snd_list)
+  register shape_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from sin up to final_time for this block of zeros */
+    while ((round((final_time - susp->sin->t0) * susp->sin->sr)) >=
+	   susp->sin->current)
+	susp_get_samples(sin, sin_ptr, sin_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->sin->t0) * susp->sin->sr -
+         (susp->sin->current - susp->sin_cnt));
+    susp->sin_ptr += n;
+    susp_took(sin_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void shape_mark(shape_susp_type susp)
+{
+    sound_xlmark(susp->sin);
+}
+
+
+void shape_free(shape_susp_type susp)
+{
+table_unref(susp->the_table);    sound_unref(susp->sin);
+    ffree_generic(susp, sizeof(shape_susp_node), "shape_free");
+}
+
+
+void shape_print_tree(shape_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("sin:");
+    sound_print_tree_1(susp->sin, n);
+}
+
+
+sound_type snd_make_shape(sound_type sin, sound_type fn, double origin)
+{
+    register shape_susp_type susp;
+    rate_type sr = sin->sr;
+    time_type t0 = sin->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, shape_susp_node, "snd_make_shape");
+    susp->time_to_index = fn->sr;
+    susp->origin = origin;
+    susp->the_table = sound_to_table(fn);
+    susp->fcn_table = susp->the_table->samples;
+    susp->table_len = susp->the_table->length;
+    susp->susp.fetch = shape_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < sin->t0) sound_prepend_zeros(sin, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(sin->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = shape_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = shape_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = shape_mark;
+    susp->susp.print_tree = shape_print_tree;
+    susp->susp.name = "shape";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(sin);
+    susp->susp.current = 0;
+    susp->sin = sin;
+    susp->sin_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_shape(sound_type sin, sound_type fn, double origin)
+{
+    sound_type sin_copy = sound_copy(sin);
+    return snd_make_shape(sin_copy, fn, origin);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/shape.h b/lib-src/libnyquist/nyquist/tran/shape.h
new file mode 100644
index 0000000..d0ab65e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/shape.h
@@ -0,0 +1,3 @@
+sound_type snd_make_shape(sound_type sin, sound_type fn, double origin);
+sound_type snd_shape(sound_type sin, sound_type fn, double origin);
+    /* LISP: (snd-shape SOUND SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/sine.alg b/lib-src/libnyquist/nyquist/tran/sine.alg
new file mode 100644
index 0000000..e00afde
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sine.alg
@@ -0,0 +1,31 @@
+(SINE-ALG
+(NAME "sine")
+(ARGUMENTS ("time_type" "t0") ("double" "hz") ("rate_type" "sr") ("time_type" "d"))
+(STATE ("long" "phase" "0")
+       ("long" "ph_incr" "round(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr))"))
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "output = sine_table[phase >> SINE_TABLE_SHIFT];
+            phase += ph_incr;
+            phase &= SINE_TABLE_MASK;")
+(MAINTAIN ("phase" 
+ "susp->phase = (susp->phase + susp->ph_incr * togo) & SINE_TABLE_MASK"))
+(CONSTANT "ph_incr")
+(SAMPLE-RATE "sr")
+(SUPPORT-HEADER "#define SINE_TABLE_LEN 2048
+#define SINE_TABLE_MASK 0x7FFFFFFF
+#define SINE_TABLE_SHIFT 20
+void sine_init();
+extern sample_type sine_table[];
+")
+(SUPPORT-FUNCTIONS "
+sample_type sine_table[SINE_TABLE_LEN + 1];
+
+void sine_init()
+{
+    int i;
+    for (i = 0; i <= SINE_TABLE_LEN; i++)
+        sine_table[i] = (sample_type) (sin((PI * 2 * i) / SINE_TABLE_LEN));
+}
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/sine.c b/lib-src/libnyquist/nyquist/tran/sine.c
new file mode 100644
index 0000000..c84d85f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sine.c
@@ -0,0 +1,126 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "sine.h"
+
+void sine_free();
+
+
+typedef struct sine_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+
+    long phase;
+    long ph_incr;
+} sine_susp_node, *sine_susp_type;
+
+
+sample_type sine_table[SINE_TABLE_LEN + 1];
+
+void sine_init()
+{
+    int i;
+    for (i = 0; i <= SINE_TABLE_LEN; i++)
+        sine_table[i] = (sample_type) (sin((PI * 2 * i) / SINE_TABLE_LEN));
+}
+
+
+void sine__fetch(register sine_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register long phase_reg;
+    register long ph_incr_reg;
+    falloc_sample_block(out, "sine__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	phase_reg = susp->phase;
+	ph_incr_reg = susp->ph_incr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = sine_table[phase_reg >> SINE_TABLE_SHIFT];
+            phase_reg += ph_incr_reg;
+            phase_reg &= SINE_TABLE_MASK;;
+	} while (--n); /* inner loop */
+
+	susp->phase = (susp->phase + susp->ph_incr * togo) & SINE_TABLE_MASK;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* sine__fetch */
+
+
+void sine_free(sine_susp_type susp)
+{
+    ffree_generic(susp, sizeof(sine_susp_node), "sine_free");
+}
+
+
+void sine_print_tree(sine_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_sine(time_type t0, double hz, rate_type sr, time_type d)
+{
+    register sine_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, sine_susp_node, "snd_make_sine");
+    susp->phase = 0;
+    susp->ph_incr = round(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr));
+    susp->susp.fetch = sine__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = sine_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = sine_print_tree;
+    susp->susp.name = "sine";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sine(time_type t0, double hz, rate_type sr, time_type d)
+{
+    return snd_make_sine(t0, hz, sr, d);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/sine.h b/lib-src/libnyquist/nyquist/tran/sine.h
new file mode 100644
index 0000000..9c9897d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sine.h
@@ -0,0 +1,8 @@
+sound_type snd_make_sine(time_type t0, double hz, rate_type sr, time_type d);
+sound_type snd_sine(time_type t0, double hz, rate_type sr, time_type d);
+    /* LISP: (snd-sine ANYNUM ANYNUM ANYNUM ANYNUM) */
+#define SINE_TABLE_LEN 2048
+#define SINE_TABLE_MASK 0x7FFFFFFF
+#define SINE_TABLE_SHIFT 20
+void sine_init();
+extern sample_type sine_table[];
diff --git a/lib-src/libnyquist/nyquist/tran/siosc.alg b/lib-src/libnyquist/nyquist/tran/siosc.alg
new file mode 100644
index 0000000..2ec4690
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/siosc.alg
@@ -0,0 +1,131 @@
+(SIOSC-ALG
+(NAME "siosc")
+
+; wave tables are provided in the argument "lis" as follows:
+; (tab0 t1 tab1 t2 tab2 t3 tab3 ... tN tabN)
+; where tab0 is the initial table, the table is linearly interpolated until
+; sample t1, at which point the table is tab1.  From there, tab1 is interpolated
+; to tab2 at t2, etc.  The sound stops at the terminate time of s_fm, so
+; if that comes before tN, tabN is used for the remainder of the sound.
+; t1, t2, ... tN are fixnums with sample counts
+
+(ARGUMENTS ("LVAL" "lis") ("rate_type" "sr")
+           ("double" "hz") ("time_type" "t0") ("sound_type" "s_fm"))
+(SUPPORT-FUNCTIONS "
+/* sisosc_table_init -- set up first two tables for interpolation */
+/**/
+void siosc_table_init(siosc_susp_type susp)
+{
+    sound_type snd;
+    if (!susp->lis) xlfail(\"bad table list in SIOSC\");
+    snd = getsound(car(susp->lis));
+    susp->table_b_ptr_ptr = sound_to_table(snd);
+    susp->table_b_samps = susp->table_b_ptr_ptr->samples;
+    susp->lis = cdr(susp->lis);
+    susp->table_sr = snd->sr;
+    susp->table_len = susp->table_b_ptr_ptr->length;
+}
+
+/* siosc_table_update -- outer loop processing, get next table */
+/**/
+long siosc_table_update(siosc_susp_type susp, long cur)
+{
+    long n;
+
+    /* swap ampramps: */
+    susp->ampramp_a = 1.0;
+    susp->ampramp_b = 0.0;
+
+    /* swap tables: */
+    table_unref(susp->table_a_ptr);
+    susp->table_a_ptr = susp->table_b_ptr_ptr;
+    susp->table_a_samps = susp->table_b_samps;
+    susp->table_b_ptr_ptr = NULL; /* so we do not try to unref it */
+
+    if (susp->lis) {
+        sound_type snd;
+
+        /* compute slope */
+        susp->next_breakpoint = getfixnum(car(susp->lis));
+        susp->lis = cdr(susp->lis);
+        n = susp->next_breakpoint - cur;
+        susp->ampslope = 1.0 / n;
+
+        /* build new table: */
+        if (!susp->lis) xlfail(\"bad table list in SIOSC\");
+        snd = getsound(car(susp->lis));
+        susp->table_b_ptr_ptr = sound_to_table(snd);
+        susp->table_b_samps = susp->table_b_ptr_ptr->samples;
+        if (susp->table_b_ptr_ptr->length != susp->table_len || susp->table_sr != snd->sr)
+            xlfail(\"mismatched tables passed to SIOSC\") ;
+        susp->lis = cdr(susp->lis);
+    } else { /* use only table a */
+        susp->ampslope = 0.0;
+        susp->next_breakpoint = 0x7FFFFFFF;
+        n = 0x7FFFFFFF;
+    }
+    return n;
+}
+")
+
+(STATE ("double" "table_len" "0.0")
+       ("double" "ph_incr" "0.0")
+       ("table_type" "table_a_ptr" "NULL")
+       ("table_type" "table_b_ptr_ptr" "NULL")
+       ("sample_type *" "table_a_samps" "NULL")
+       ("sample_type *" "table_b_samps" "NULL")
+       ("double" "table_sr" "0.0")
+       ("double" "phase" "0.0")
+       ("LVAL" "lis" "lis")
+       ("long" "next_breakpoint" "0")
+       ("double" "ampramp_a" "1.0")
+       ("double" "ampramp_b" "0.0")
+       ("double" "ampslope" "0.0;
+    siosc_table_init(susp);
+    susp->ph_incr = hz * susp->table_len / sr;
+    s_fm->scale = (sample_type) (s_fm->scale * (susp->table_len / sr))") 
+)
+
+(ALWAYS-SCALE s_fm)
+(INLINE-INTERPOLATION T) ; so that modulation can be low frequency
+(STEP-FUNCTION s_fm)
+(TERMINATE (MIN s_fm))
+(LOGICAL-STOP (MIN s_fm))
+(INNER-LOOP-LOCALS "	    long table_index;
+            double xa, xb;
+")
+
+; Implementation notes:
+;  "lis" points to the next time to be used, or NULL
+
+(OUTER-LOOP "
+        { long cur = susp->susp.current + cnt;
+            n = susp->next_breakpoint - cur;
+            if (n == 0) n = siosc_table_update(susp, cur);
+        }
+        togo = min(n, togo);
+")
+
+(INNER-LOOP "	    table_index = (long) phase;
+            xa = table_a_samps[table_index];
+            xb = table_b_samps[table_index];
+            output = (sample_type) 
+                      (ampramp_a * (xa + (phase - table_index) * 
+                          (table_a_samps[table_index + 1] - xa)) +
+                       ampramp_b * (xb + (phase - table_index) * 
+                          (table_b_samps[table_index + 1] - xb)));
+            ampramp_a -= ampslope;
+            ampramp_b += ampslope;
+            phase += ph_incr + s_fm;
+            while (phase > table_len) phase -= table_len;
+            /* watch out for negative frequencies! */
+            while (phase < 0) phase += table_len")
+(CONSTANT "ph_incr" "table_len" "table_ptr" "table_a_samps"
+          "table_b_samps" "ampslope" "table_a_ptr" "table_b_ptr_ptr")
+
+(SAMPLE-RATE "sr")
+(FINALIZATION "    table_unref(susp->table_a_ptr);
+    table_unref(susp->table_b_ptr_ptr);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/siosc.c b/lib-src/libnyquist/nyquist/tran/siosc.c
new file mode 100644
index 0000000..f4a0b44
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/siosc.c
@@ -0,0 +1,637 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "siosc.h"
+
+void siosc_free();
+
+
+typedef struct siosc_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s_fm;
+    long s_fm_cnt;
+    sample_block_values_type s_fm_ptr;
+
+    /* support for interpolation of s_fm */
+    sample_type s_fm_x1_sample;
+    double s_fm_pHaSe;
+    double s_fm_pHaSe_iNcR;
+
+    /* support for ramp between samples of s_fm */
+    double output_per_s_fm;
+    long s_fm_n;
+
+    double table_len;
+    double ph_incr;
+    table_type table_a_ptr;
+    table_type table_b_ptr_ptr;
+    sample_type *table_a_samps;
+    sample_type *table_b_samps;
+    double table_sr;
+    double phase;
+    LVAL lis;
+    long next_breakpoint;
+    double ampramp_a;
+    double ampramp_b;
+    double ampslope;
+} siosc_susp_node, *siosc_susp_type;
+
+
+/* sisosc_table_init -- set up first two tables for interpolation */
+/**/
+void siosc_table_init(siosc_susp_type susp)
+{
+    sound_type snd;
+    if (!susp->lis) xlfail("bad table list in SIOSC");
+    snd = getsound(car(susp->lis));
+    susp->table_b_ptr_ptr = sound_to_table(snd);
+    susp->table_b_samps = susp->table_b_ptr_ptr->samples;
+    susp->lis = cdr(susp->lis);
+    susp->table_sr = snd->sr;
+    susp->table_len = susp->table_b_ptr_ptr->length;
+}
+
+/* siosc_table_update -- outer loop processing, get next table */
+/**/
+long siosc_table_update(siosc_susp_type susp, long cur)
+{
+    long n;
+
+    /* swap ampramps: */
+    susp->ampramp_a = 1.0;
+    susp->ampramp_b = 0.0;
+
+    /* swap tables: */
+    table_unref(susp->table_a_ptr);
+    susp->table_a_ptr = susp->table_b_ptr_ptr;
+    susp->table_a_samps = susp->table_b_samps;
+    susp->table_b_ptr_ptr = NULL; /* so we do not try to unref it */
+
+    if (susp->lis) {
+        sound_type snd;
+
+        /* compute slope */
+        susp->next_breakpoint = getfixnum(car(susp->lis));
+        susp->lis = cdr(susp->lis);
+        n = susp->next_breakpoint - cur;
+        susp->ampslope = 1.0 / n;
+
+        /* build new table: */
+        if (!susp->lis) xlfail("bad table list in SIOSC");
+        snd = getsound(car(susp->lis));
+        susp->table_b_ptr_ptr = sound_to_table(snd);
+        susp->table_b_samps = susp->table_b_ptr_ptr->samples;
+        if (susp->table_b_ptr_ptr->length != susp->table_len || susp->table_sr != snd->sr)
+            xlfail("mismatched tables passed to SIOSC") ;
+        susp->lis = cdr(susp->lis);
+    } else { /* use only table a */
+        susp->ampslope = 0.0;
+        susp->next_breakpoint = 0x7FFFFFFF;
+        n = 0x7FFFFFFF;
+    }
+    return n;
+}
+
+
+void siosc_s_fetch(register siosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_a_samps_reg;
+    register sample_type * table_b_samps_reg;
+    register double phase_reg;
+    register double ampramp_a_reg;
+    register double ampramp_b_reg;
+    register double ampslope_reg;
+    register sample_type s_fm_scale_reg = susp->s_fm->scale;
+    register sample_block_values_type s_fm_ptr_reg;
+    falloc_sample_block(out, "siosc_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s_fm input sample block: */
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	togo = min(togo, susp->s_fm_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+
+        { long cur = susp->susp.current + cnt;
+            n = susp->next_breakpoint - cur;
+            if (n == 0) n = siosc_table_update(susp, cur);
+        }
+        togo = min(n, togo);
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_a_samps_reg = susp->table_a_samps;
+	table_b_samps_reg = susp->table_b_samps;
+	phase_reg = susp->phase;
+	ampramp_a_reg = susp->ampramp_a;
+	ampramp_b_reg = susp->ampramp_b;
+	ampslope_reg = susp->ampslope;
+	s_fm_ptr_reg = susp->s_fm_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double xa, xb;
+	    table_index = (long) phase_reg;
+            xa = table_a_samps_reg[table_index];
+            xb = table_b_samps_reg[table_index];
+            *out_ptr_reg++ = (sample_type) 
+                      (ampramp_a_reg * (xa + (phase_reg - table_index) * 
+                          (table_a_samps_reg[table_index + 1] - xa)) +
+                       ampramp_b_reg * (xb + (phase_reg - table_index) * 
+                          (table_b_samps_reg[table_index + 1] - xb)));
+            ampramp_a_reg -= ampslope_reg;
+            ampramp_b_reg += ampslope_reg;
+            phase_reg += ph_incr_reg + (s_fm_scale_reg * *s_fm_ptr_reg++);
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	susp->ampramp_a = ampramp_a_reg;
+	susp->ampramp_b = ampramp_b_reg;
+	/* using s_fm_ptr_reg is a bad idea on RS/6000: */
+	susp->s_fm_ptr += togo;
+	out_ptr += togo;
+	susp_took(s_fm_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* siosc_s_fetch */
+
+
+void siosc_i_fetch(register siosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_a_samps_reg;
+    register sample_type * table_b_samps_reg;
+    register double phase_reg;
+    register double ampramp_a_reg;
+    register double ampramp_b_reg;
+    register double ampslope_reg;
+    register double s_fm_pHaSe_iNcR_rEg = susp->s_fm_pHaSe_iNcR;
+    register double s_fm_pHaSe_ReG;
+    register sample_type s_fm_x1_sample_reg;
+    falloc_sample_block(out, "siosc_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+
+        { long cur = susp->susp.current + cnt;
+            n = susp->next_breakpoint - cur;
+            if (n == 0) n = siosc_table_update(susp, cur);
+        }
+        togo = min(n, togo);
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_a_samps_reg = susp->table_a_samps;
+	table_b_samps_reg = susp->table_b_samps;
+	phase_reg = susp->phase;
+	ampramp_a_reg = susp->ampramp_a;
+	ampramp_b_reg = susp->ampramp_b;
+	ampslope_reg = susp->ampslope;
+	s_fm_pHaSe_ReG = susp->s_fm_pHaSe;
+	s_fm_x1_sample_reg = susp->s_fm_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double xa, xb;
+	    if (s_fm_pHaSe_ReG >= 1.0) {
+/* fixup-depends s_fm */
+		/* pick up next sample as s_fm_x1_sample: */
+		susp->s_fm_ptr++;
+		susp_took(s_fm_cnt, 1);
+		s_fm_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(s_fm, s_fm_ptr, s_fm_cnt, s_fm_x1_sample_reg);
+		s_fm_x1_sample_reg = susp_current_sample(s_fm, s_fm_ptr);
+	    }
+	    table_index = (long) phase_reg;
+            xa = table_a_samps_reg[table_index];
+            xb = table_b_samps_reg[table_index];
+            *out_ptr_reg++ = (sample_type) 
+                      (ampramp_a_reg * (xa + (phase_reg - table_index) * 
+                          (table_a_samps_reg[table_index + 1] - xa)) +
+                       ampramp_b_reg * (xb + (phase_reg - table_index) * 
+                          (table_b_samps_reg[table_index + 1] - xb)));
+            ampramp_a_reg -= ampslope_reg;
+            ampramp_b_reg += ampslope_reg;
+            phase_reg += ph_incr_reg + s_fm_x1_sample_reg;
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	    s_fm_pHaSe_ReG += s_fm_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->phase = phase_reg;
+	susp->ampramp_a = ampramp_a_reg;
+	susp->ampramp_b = ampramp_b_reg;
+	susp->s_fm_pHaSe = s_fm_pHaSe_ReG;
+	susp->s_fm_x1_sample = s_fm_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* siosc_i_fetch */
+
+
+void siosc_r_fetch(register siosc_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type s_fm_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double table_len_reg;
+    register double ph_incr_reg;
+    register sample_type * table_a_samps_reg;
+    register sample_type * table_b_samps_reg;
+    register double phase_reg;
+    register double ampramp_a_reg;
+    register double ampramp_b_reg;
+    register double ampslope_reg;
+    falloc_sample_block(out, "siosc_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->s_fm_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next s_fm_x1_sample when phase goes past 1.0; */
+	/* use s_fm_n (computed below) to avoid roundoff errors: */
+	if (susp->s_fm_n <= 0) {
+	    susp_check_term_log_samples(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_x1_sample = susp_fetch_sample(s_fm, s_fm_ptr, s_fm_cnt);
+	    susp->s_fm_pHaSe -= 1.0;
+	    /* s_fm_n gets number of samples before phase exceeds 1.0: */
+	    susp->s_fm_n = (long) ((1.0 - susp->s_fm_pHaSe) *
+					susp->output_per_s_fm);
+	}
+	togo = min(togo, susp->s_fm_n);
+	s_fm_val = susp->s_fm_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+
+        { long cur = susp->susp.current + cnt;
+            n = susp->next_breakpoint - cur;
+            if (n == 0) n = siosc_table_update(susp, cur);
+        }
+        togo = min(n, togo);
+
+	n = togo;
+	table_len_reg = susp->table_len;
+	ph_incr_reg = susp->ph_incr;
+	table_a_samps_reg = susp->table_a_samps;
+	table_b_samps_reg = susp->table_b_samps;
+	phase_reg = susp->phase;
+	ampramp_a_reg = susp->ampramp_a;
+	ampramp_b_reg = susp->ampramp_b;
+	ampslope_reg = susp->ampslope;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    long table_index;
+            double xa, xb;
+	    table_index = (long) phase_reg;
+            xa = table_a_samps_reg[table_index];
+            xb = table_b_samps_reg[table_index];
+            *out_ptr_reg++ = (sample_type) 
+                      (ampramp_a_reg * (xa + (phase_reg - table_index) * 
+                          (table_a_samps_reg[table_index + 1] - xa)) +
+                       ampramp_b_reg * (xb + (phase_reg - table_index) * 
+                          (table_b_samps_reg[table_index + 1] - xb)));
+            ampramp_a_reg -= ampslope_reg;
+            ampramp_b_reg += ampslope_reg;
+            phase_reg += ph_incr_reg + s_fm_val;
+            while (phase_reg > table_len_reg) phase_reg -= table_len_reg;
+            /* watch out for negative frequencies! */
+            while (phase_reg < 0) phase_reg += table_len_reg;
+	} while (--n); /* inner loop */
+
+	susp->phase = phase_reg;
+	susp->ampramp_a = ampramp_a_reg;
+	susp->ampramp_b = ampramp_b_reg;
+	out_ptr += togo;
+	susp->s_fm_pHaSe += togo * susp->s_fm_pHaSe_iNcR;
+	susp->s_fm_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* siosc_r_fetch */
+
+
+void siosc_toss_fetch(susp, snd_list)
+  register siosc_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s_fm up to final_time for this block of zeros */
+    while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >=
+	   susp->s_fm->current)
+	susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr -
+         (susp->s_fm->current - susp->s_fm_cnt));
+    susp->s_fm_ptr += n;
+    susp_took(s_fm_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void siosc_mark(siosc_susp_type susp)
+{
+    if (susp->lis) mark(susp->lis);
+    sound_xlmark(susp->s_fm);
+}
+
+
+void siosc_free(siosc_susp_type susp)
+{
+    table_unref(susp->table_a_ptr);
+    table_unref(susp->table_b_ptr_ptr);
+    sound_unref(susp->s_fm);
+    ffree_generic(susp, sizeof(siosc_susp_node), "siosc_free");
+}
+
+
+void siosc_print_tree(siosc_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s_fm:");
+    sound_print_tree_1(susp->s_fm, n);
+}
+
+
+sound_type snd_make_siosc(LVAL lis, rate_type sr, double hz, time_type t0, sound_type s_fm)
+{
+    register siosc_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, siosc_susp_node, "snd_make_siosc");
+    susp->table_len = 0.0;
+    susp->ph_incr = 0.0;
+    susp->table_a_ptr = NULL;
+    susp->table_b_ptr_ptr = NULL;
+    susp->table_a_samps = NULL;
+    susp->table_b_samps = NULL;
+    susp->table_sr = 0.0;
+    susp->phase = 0.0;
+    susp->lis = lis;
+    susp->next_breakpoint = 0;
+    susp->ampramp_a = 1.0;
+    susp->ampramp_b = 0.0;
+    susp->ampslope = 0.0;
+    siosc_table_init(susp);
+    susp->ph_incr = hz * susp->table_len / sr;
+    s_fm->scale = (sample_type) (s_fm->scale * (susp->table_len / sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s_fm, sr);
+    switch (interp_desc) {
+      case INTERP_n: /* handled below */
+      case INTERP_s: susp->susp.fetch = siosc_s_fetch; break;
+      case INTERP_i: susp->susp.fetch = siosc_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = siosc_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s_fm->t0) sound_prepend_zeros(s_fm, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s_fm->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = siosc_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = siosc_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = siosc_mark;
+    susp->susp.print_tree = siosc_print_tree;
+    susp->susp.name = "siosc";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s_fm);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s_fm = s_fm;
+    susp->s_fm_cnt = 0;
+    susp->s_fm_pHaSe = 0.0;
+    susp->s_fm_pHaSe_iNcR = s_fm->sr / sr;
+    susp->s_fm_n = 0;
+    susp->output_per_s_fm = sr / s_fm->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_siosc(LVAL lis, rate_type sr, double hz, time_type t0, sound_type s_fm)
+{
+    sound_type s_fm_copy = sound_copy(s_fm);
+    return snd_make_siosc(lis, sr, hz, t0, s_fm_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/siosc.h b/lib-src/libnyquist/nyquist/tran/siosc.h
new file mode 100644
index 0000000..5507075
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/siosc.h
@@ -0,0 +1,3 @@
+sound_type snd_make_siosc(LVAL lis, rate_type sr, double hz, time_type t0, sound_type s_fm);
+sound_type snd_siosc(LVAL lis, rate_type sr, double hz, time_type t0, sound_type s_fm);
+    /* LISP: (snd-siosc ANY ANYNUM ANYNUM ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/slope.alg b/lib-src/libnyquist/nyquist/tran/slope.alg
new file mode 100644
index 0000000..7b0cb2b
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/slope.alg
@@ -0,0 +1,15 @@
+(SLOPE-ALG
+  (NAME "slope")
+  (ARGUMENTS ("sound_type" "input"))
+  (STATE ("sample_type" "prev" "0.0F")
+          ("double" "scale" "input->sr * input->scale"))
+  (INTERNAL-SCALING input)
+  (CONSTANT "scale")
+  (DELAY 1)
+  (START (MIN input))
+  (INNER-LOOP "{ register sample_type x = input;
+output = (sample_type) ((x - prev) * scale);
+prev = x;}")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/slope.c b/lib-src/libnyquist/nyquist/tran/slope.c
new file mode 100644
index 0000000..2ed5846
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/slope.c
@@ -0,0 +1,210 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "slope.h"
+
+void slope_free();
+
+
+typedef struct slope_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    sample_type prev;
+    double scale;
+} slope_susp_node, *slope_susp_type;
+
+
+void slope_n_fetch(register slope_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type prev_reg;
+    register double scale_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "slope_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	prev_reg = susp->prev;
+	scale_reg = susp->scale;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ register sample_type x = *input_ptr_reg++;
+*out_ptr_reg++ = (sample_type) ((x - prev_reg) * scale_reg);
+prev_reg = x;};
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* slope_n_fetch */
+
+
+void slope_toss_fetch(susp, snd_list)
+  register slope_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void slope_mark(slope_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void slope_free(slope_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(slope_susp_node), "slope_free");
+}
+
+
+void slope_print_tree(slope_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_slope(sound_type input)
+{
+    register slope_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, slope_susp_node, "snd_make_slope");
+    susp->prev = 0.0F;
+    susp->scale = input->sr * input->scale;
+    susp->susp.fetch = slope_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    /* Toss an extra 1 samples to make up for internal buffering: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 1.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = slope_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = slope_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = slope_mark;
+    susp->susp.print_tree = slope_print_tree;
+    susp->susp.name = "slope";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_slope(sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_slope(input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/slope.h b/lib-src/libnyquist/nyquist/tran/slope.h
new file mode 100644
index 0000000..39cafaf
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/slope.h
@@ -0,0 +1,3 @@
+sound_type snd_make_slope(sound_type input);
+sound_type snd_slope(sound_type input);
+    /* LISP: (snd-slope SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/sqrt.alg b/lib-src/libnyquist/nyquist/tran/sqrt.alg
new file mode 100644
index 0000000..5c392a3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sqrt.alg
@@ -0,0 +1,9 @@
+(SQRT-ALG
+  (NAME "sqrt")
+  (ARGUMENTS ("sound_type" "input"))
+  (ALWAYS-SCALE input)
+  (START (MIN input))
+  (INNER-LOOP "{ sample_type i = input; if (i < 0) i = 0; output = (sample_type) sqrt(i); }")
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+)
diff --git a/lib-src/libnyquist/nyquist/tran/sqrt.c b/lib-src/libnyquist/nyquist/tran/sqrt.c
new file mode 100644
index 0000000..66b2ae7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sqrt.c
@@ -0,0 +1,198 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "sqrt.h"
+
+void sqrt_free();
+
+
+typedef struct sqrt_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+} sqrt_susp_node, *sqrt_susp_type;
+
+
+void sqrt_s_fetch(register sqrt_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_type input_scale_reg = susp->input->scale;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "sqrt_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+{ sample_type i = (input_scale_reg * *input_ptr_reg++); if (i < 0) i = 0; *out_ptr_reg++ = (sample_type) sqrt(i); };
+	} while (--n); /* inner loop */
+
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* sqrt_s_fetch */
+
+
+void sqrt_toss_fetch(susp, snd_list)
+  register sqrt_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void sqrt_mark(sqrt_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void sqrt_free(sqrt_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(sqrt_susp_node), "sqrt_free");
+}
+
+
+void sqrt_print_tree(sqrt_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_sqrt(sound_type input)
+{
+    register sqrt_susp_type susp;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, sqrt_susp_node, "snd_make_sqrt");
+    susp->susp.fetch = sqrt_s_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = sqrt_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = sqrt_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = sqrt_mark;
+    susp->susp.print_tree = sqrt_print_tree;
+    susp->susp.name = "sqrt";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_sqrt(sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_sqrt(input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/sqrt.h b/lib-src/libnyquist/nyquist/tran/sqrt.h
new file mode 100644
index 0000000..ab47c6f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/sqrt.h
@@ -0,0 +1,3 @@
+sound_type snd_make_sqrt(sound_type input);
+sound_type snd_sqrt(sound_type input);
+    /* LISP: (snd-sqrt SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/stkchorus.alg b/lib-src/libnyquist/nyquist/tran/stkchorus.alg
new file mode 100644
index 0000000..3e3e19a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkchorus.alg
@@ -0,0 +1,21 @@
+(STKCHORUS-ALG
+(NAME "stkchorus")
+(ARGUMENTS ("sound_type" "s1")("double" "baseDelay")("double" "depth")("double" "freq")
+	("double" "mix")("rate_type" "sr"))
+(STATE 	("struct stkEffect *" "mych"  "initStkChorus(baseDelay, depth, freq,  round(sr));
+stkEffectSetMix(susp->mych, mix)"))
+(START (MIN s1))
+(TERMINATE (MIN s1))
+(LOGICAL-STOP (MIN s1))
+(NOT-IN-INNER-LOOP "mych" "baseDelay" "depth" "freq" "mix" "sr")
+(SAMPLE-RATE "sr")
+(SUPPORT-FUNCTIONS "
+      #include \"stkint.h\"
+")
+(INNER-LOOP "
+	output = (sample_type) (stkEffectTick(mych, s1))
+")
+(FINALIZATION "
+	deleteStkEffect(susp->mych);
+")
+)
\ No newline at end of file
diff --git a/lib-src/libnyquist/nyquist/tran/stkchorus.c b/lib-src/libnyquist/nyquist/tran/stkchorus.c
new file mode 100644
index 0000000..a66fc07
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkchorus.c
@@ -0,0 +1,311 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "stkchorus.h"
+
+void stkchorus_free();
+
+
+typedef struct stkchorus_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    struct stkEffect *mych;
+} stkchorus_susp_node, *stkchorus_susp_type;
+
+
+      #include "stkint.h"
+
+
+void stkchorus_n_fetch(register stkchorus_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * mych_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkchorus_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	mych_reg = susp->mych;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(mych_reg, *s1_ptr_reg++))
+;
+	} while (--n); /* inner loop */
+
+	susp->mych = mych_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkchorus_n_fetch */
+
+
+void stkchorus_s_fetch(register stkchorus_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * mych_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkchorus_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	mych_reg = susp->mych;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(mych_reg, (s1_scale_reg * *s1_ptr_reg++)))
+;
+	} while (--n); /* inner loop */
+
+	susp->mych = mych_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkchorus_s_fetch */
+
+
+void stkchorus_toss_fetch(susp, snd_list)
+  register stkchorus_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void stkchorus_mark(stkchorus_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void stkchorus_free(stkchorus_susp_type susp)
+{
+
+	deleteStkEffect(susp->mych);
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(stkchorus_susp_node), "stkchorus_free");
+}
+
+
+void stkchorus_print_tree(stkchorus_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_stkchorus(sound_type s1, double baseDelay, double depth, double freq, double mix, rate_type sr)
+{
+    register stkchorus_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, stkchorus_susp_node, "snd_make_stkchorus");
+    susp->mych = initStkChorus(baseDelay, depth, freq,  round(sr));
+stkEffectSetMix(susp->mych, mix);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = stkchorus_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = stkchorus_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = stkchorus_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = stkchorus_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = stkchorus_mark;
+    susp->susp.print_tree = stkchorus_print_tree;
+    susp->susp.name = "stkchorus";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_stkchorus(sound_type s1, double baseDelay, double depth, double freq, double mix, rate_type sr)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_stkchorus(s1_copy, baseDelay, depth, freq, mix, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/stkchorus.h b/lib-src/libnyquist/nyquist/tran/stkchorus.h
new file mode 100644
index 0000000..5bbd13a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkchorus.h
@@ -0,0 +1,3 @@
+sound_type snd_make_stkchorus(sound_type s1, double baseDelay, double depth, double freq, double mix, rate_type sr);
+sound_type snd_stkchorus(sound_type s1, double baseDelay, double depth, double freq, double mix, rate_type sr);
+    /* LISP: (snd-stkchorus SOUND ANYNUM ANYNUM ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/stkpitshift.alg b/lib-src/libnyquist/nyquist/tran/stkpitshift.alg
new file mode 100644
index 0000000..0c7b2ac
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkpitshift.alg
@@ -0,0 +1,20 @@
+(STKPITSHIFT-ALG
+(NAME "stkpitshift")
+(ARGUMENTS ("sound_type" "s1")("double" "shift")("double" "mix")("rate_type" "sr"))
+(STATE 	("struct stkEffect *" "mych"  "initStkPitShift(shift, round(sr));
+stkEffectSetMix(susp->mych, mix)"))
+(START (MIN s1))
+(TERMINATE (MIN s1))
+(LOGICAL-STOP (MIN s1))
+(NOT-IN-INNER-LOOP "mych" "shift" "mix" "sr")
+(SAMPLE-RATE "sr")
+(SUPPORT-FUNCTIONS "
+      #include \"stkint.h\"
+")
+(INNER-LOOP "
+	output = (sample_type) (stkEffectTick(mych, s1))
+")
+(FINALIZATION "
+	deleteStkEffect(susp->mych);
+")
+)
\ No newline at end of file
diff --git a/lib-src/libnyquist/nyquist/tran/stkpitshift.c b/lib-src/libnyquist/nyquist/tran/stkpitshift.c
new file mode 100644
index 0000000..586bab4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkpitshift.c
@@ -0,0 +1,311 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "stkpitshift.h"
+
+void stkpitshift_free();
+
+
+typedef struct stkpitshift_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    struct stkEffect *mych;
+} stkpitshift_susp_node, *stkpitshift_susp_type;
+
+
+      #include "stkint.h"
+
+
+void stkpitshift_n_fetch(register stkpitshift_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * mych_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkpitshift_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	mych_reg = susp->mych;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(mych_reg, *s1_ptr_reg++))
+;
+	} while (--n); /* inner loop */
+
+	susp->mych = mych_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkpitshift_n_fetch */
+
+
+void stkpitshift_s_fetch(register stkpitshift_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * mych_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkpitshift_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	mych_reg = susp->mych;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(mych_reg, (s1_scale_reg * *s1_ptr_reg++)))
+;
+	} while (--n); /* inner loop */
+
+	susp->mych = mych_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkpitshift_s_fetch */
+
+
+void stkpitshift_toss_fetch(susp, snd_list)
+  register stkpitshift_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void stkpitshift_mark(stkpitshift_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void stkpitshift_free(stkpitshift_susp_type susp)
+{
+
+	deleteStkEffect(susp->mych);
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(stkpitshift_susp_node), "stkpitshift_free");
+}
+
+
+void stkpitshift_print_tree(stkpitshift_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_stkpitshift(sound_type s1, double shift, double mix, rate_type sr)
+{
+    register stkpitshift_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, stkpitshift_susp_node, "snd_make_stkpitshift");
+    susp->mych = initStkPitShift(shift, round(sr));
+stkEffectSetMix(susp->mych, mix);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = stkpitshift_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = stkpitshift_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = stkpitshift_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = stkpitshift_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = stkpitshift_mark;
+    susp->susp.print_tree = stkpitshift_print_tree;
+    susp->susp.name = "stkpitshift";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_stkpitshift(sound_type s1, double shift, double mix, rate_type sr)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_stkpitshift(s1_copy, shift, mix, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/stkpitshift.h b/lib-src/libnyquist/nyquist/tran/stkpitshift.h
new file mode 100644
index 0000000..ff9c16e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkpitshift.h
@@ -0,0 +1,3 @@
+sound_type snd_make_stkpitshift(sound_type s1, double shift, double mix, rate_type sr);
+sound_type snd_stkpitshift(sound_type s1, double shift, double mix, rate_type sr);
+    /* LISP: (snd-stkpitshift SOUND ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/stkrev.alg b/lib-src/libnyquist/nyquist/tran/stkrev.alg
new file mode 100644
index 0000000..b4704ad
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkrev.alg
@@ -0,0 +1,20 @@
+(STKREV-ALG
+(NAME "stkrev")
+(ARGUMENTS ("int" "rev_type")("sound_type" "s1")("time_type" "trev")("double" "mix")("rate_type" "sr"))
+(STATE 	("struct stkEffect *" "myrv"  "initStkEffect(rev_type, trev, round(sr));
+stkEffectSetMix(susp->myrv, mix)"))
+(START (MIN s1))
+(TERMINATE (MIN s1))
+(LOGICAL-STOP (MIN s1))
+(NOT-IN-INNER-LOOP "myrv" "trev")
+(SAMPLE-RATE "sr")
+(SUPPORT-FUNCTIONS "
+      #include \"stkint.h\"
+")
+(INNER-LOOP "
+	output = (sample_type) (stkEffectTick(myrv, s1))
+")
+(FINALIZATION "
+	deleteStkEffect(susp->myrv);
+")
+)
\ No newline at end of file
diff --git a/lib-src/libnyquist/nyquist/tran/stkrev.c b/lib-src/libnyquist/nyquist/tran/stkrev.c
new file mode 100644
index 0000000..36490d7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkrev.c
@@ -0,0 +1,311 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "stkrev.h"
+
+void stkrev_free();
+
+
+typedef struct stkrev_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+
+    struct stkEffect *myrv;
+} stkrev_susp_node, *stkrev_susp_type;
+
+
+      #include "stkint.h"
+
+
+void stkrev_n_fetch(register stkrev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * myrv_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkrev_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	myrv_reg = susp->myrv;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(myrv_reg, *s1_ptr_reg++))
+;
+	} while (--n); /* inner loop */
+
+	susp->myrv = myrv_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkrev_n_fetch */
+
+
+void stkrev_s_fetch(register stkrev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register struct stkEffect * myrv_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "stkrev_s_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	myrv_reg = susp->myrv;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+
+	*out_ptr_reg++ = (sample_type) (stkEffectTick(myrv_reg, (s1_scale_reg * *s1_ptr_reg++)))
+;
+	} while (--n); /* inner loop */
+
+	susp->myrv = myrv_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* stkrev_s_fetch */
+
+
+void stkrev_toss_fetch(susp, snd_list)
+  register stkrev_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void stkrev_mark(stkrev_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+}
+
+
+void stkrev_free(stkrev_susp_type susp)
+{
+
+	deleteStkEffect(susp->myrv);
+    sound_unref(susp->s1);
+    ffree_generic(susp, sizeof(stkrev_susp_node), "stkrev_free");
+}
+
+
+void stkrev_print_tree(stkrev_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+}
+
+
+sound_type snd_make_stkrev(int rev_type, sound_type s1, time_type trev, double mix, rate_type sr)
+{
+    register stkrev_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = s1->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, stkrev_susp_node, "snd_make_stkrev");
+    susp->myrv = initStkEffect(rev_type, trev, round(sr));
+stkEffectSetMix(susp->myrv, mix);
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = stkrev_n_fetch; break;
+      case INTERP_s: susp->susp.fetch = stkrev_s_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = stkrev_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = stkrev_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = stkrev_mark;
+    susp->susp.print_tree = stkrev_print_tree;
+    susp->susp.name = "stkrev";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_stkrev(int rev_type, sound_type s1, time_type trev, double mix, rate_type sr)
+{
+    sound_type s1_copy = sound_copy(s1);
+    return snd_make_stkrev(rev_type, s1_copy, trev, mix, sr);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/stkrev.h b/lib-src/libnyquist/nyquist/tran/stkrev.h
new file mode 100644
index 0000000..09926c6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/stkrev.h
@@ -0,0 +1,3 @@
+sound_type snd_make_stkrev(int rev_type, sound_type s1, time_type trev, double mix, rate_type sr);
+sound_type snd_stkrev(int rev_type, sound_type s1, time_type trev, double mix, rate_type sr);
+    /* LISP: (snd-stkrev FIXNUM SOUND ANYNUM ANYNUM ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/tapf.alg b/lib-src/libnyquist/nyquist/tran/tapf.alg
new file mode 100644
index 0000000..90175e0
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapf.alg
@@ -0,0 +1,49 @@
+(TAPF-ALG
+(NAME "tapf")
+(ARGUMENTS ("sound_type" "s1") ("double" "offset") ("sound_type" "vardelay")
+           ("double" "maxdelay"))
+(INLINE-INTERPOLATION T)
+(STEP-FUNCTION "vardelay")
+(INTERNAL-SCALING vardelay)
+(ALWAYS-SCALE s1)
+(START (MAX s1 vardelay))
+(TERMINATE (MIN s1 vardelay))
+(LOGICAL-STOP (MIN s1))
+(STATE ("double" "offset" "offset * s1->sr")
+       ("double" "vdscale" "vardelay->scale * s1->sr")
+       ("long" "maxdelay" "(long)(maxdelay * s1->sr)")
+       ("long" "bufflen" "max(2, (long) (susp->maxdelay + 0.5))")
+       ("long" "index" "susp->bufflen")
+       ("sample_type *" "buffer" 
+        "(sample_type *) calloc(susp->bufflen + 1, sizeof(sample_type))"))
+(SAMPLE-RATE (MAX s1))
+(CONSTANT "maxdelay" "offset" "vdscale" "buffer")
+(INNER-LOOP-LOCALS "            long phase;
+")
+(INNER-LOOP "        phase = (long) (vardelay * vdscale + offset);
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay) phase = maxdelay;
+        phase = index - phase;
+        /* now phase is a location in the buffer (before modulo) */
+
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer[index++] = s1;
+        if (index >= bufflen) {
+            index = 0;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen;
+        output = (sample_type) (buffer[phase]);")
+(FINALIZATION "    free(susp->buffer);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/tapf.c b/lib-src/libnyquist/nyquist/tran/tapf.c
new file mode 100644
index 0000000..c7c4556
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapf.c
@@ -0,0 +1,619 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "tapf.h"
+
+void tapf_free();
+
+
+typedef struct tapf_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type vardelay;
+    long vardelay_cnt;
+    sample_block_values_type vardelay_ptr;
+
+    /* support for interpolation of vardelay */
+    sample_type vardelay_x1_sample;
+    double vardelay_pHaSe;
+    double vardelay_pHaSe_iNcR;
+
+    /* support for ramp between samples of vardelay */
+    double output_per_vardelay;
+    long vardelay_n;
+
+    double offset;
+    double vdscale;
+    long maxdelay;
+    long bufflen;
+    long index;
+    sample_type *buffer;
+} tapf_susp_node, *tapf_susp_type;
+
+
+void tapf_sn_fetch(register tapf_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register long maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register sample_block_values_type vardelay_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapf_sn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the vardelay input sample block: */
+	susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	togo = min(togo, susp->vardelay_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	vardelay_ptr_reg = susp->vardelay_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            long phase;
+        phase = (long) (*vardelay_ptr_reg++ * vdscale_reg + offset_reg);
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg >= bufflen_reg) {
+            index_reg = 0;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        *out_ptr_reg++ = (sample_type) (buffer_reg[phase]);;
+	} while (--n); /* inner loop */
+
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	/* using vardelay_ptr_reg is a bad idea on RS/6000: */
+	susp->vardelay_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(vardelay_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapf_sn_fetch */
+
+
+void tapf_si_fetch(register tapf_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type vardelay_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register long maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register double vardelay_pHaSe_iNcR_rEg = susp->vardelay_pHaSe_iNcR;
+    register double vardelay_pHaSe_ReG;
+    register sample_type vardelay_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapf_si_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	susp->vardelay_x1_sample = (susp->vardelay_cnt--, *(susp->vardelay_ptr));
+    }
+
+    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    vardelay_x2_sample = *(susp->vardelay_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	vardelay_pHaSe_ReG = susp->vardelay_pHaSe;
+	vardelay_x1_sample_reg = susp->vardelay_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            long phase;
+	    if (vardelay_pHaSe_ReG >= 1.0) {
+		vardelay_x1_sample_reg = vardelay_x2_sample;
+		/* pick up next sample as vardelay_x2_sample: */
+		susp->vardelay_ptr++;
+		susp_took(vardelay_cnt, 1);
+		vardelay_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(vardelay, vardelay_ptr, vardelay_cnt, vardelay_x2_sample);
+	    }
+        phase = (long) (
+		(vardelay_x1_sample_reg * (1 - vardelay_pHaSe_ReG) + vardelay_x2_sample * vardelay_pHaSe_ReG) * vdscale_reg + offset_reg);
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg >= bufflen_reg) {
+            index_reg = 0;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        *out_ptr_reg++ = (sample_type) (buffer_reg[phase]);;
+	    vardelay_pHaSe_ReG += vardelay_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	susp->vardelay_pHaSe = vardelay_pHaSe_ReG;
+	susp->vardelay_x1_sample = vardelay_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapf_si_fetch */
+
+
+void tapf_sr_fetch(register tapf_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type vardelay_DeLtA;
+    sample_type vardelay_val;
+    sample_type vardelay_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register long maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapf_sr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->vardelay_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    vardelay_x2_sample = *(susp->vardelay_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next vardelay_x2_sample when phase goes past 1.0; */
+	/* we use vardelay_n (computed below) to avoid roundoff errors: */
+	if (susp->vardelay_n <= 0) {
+	    susp->vardelay_x1_sample = vardelay_x2_sample;
+	    susp->vardelay_ptr++;
+	    susp_took(vardelay_cnt, 1);
+	    susp->vardelay_pHaSe -= 1.0;
+	    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	    vardelay_x2_sample = *(susp->vardelay_ptr);
+	    /* vardelay_n gets number of samples before phase exceeds 1.0: */
+	    susp->vardelay_n = (long) ((1.0 - susp->vardelay_pHaSe) *
+					susp->output_per_vardelay);
+	}
+	togo = min(togo, susp->vardelay_n);
+	vardelay_DeLtA = (sample_type) ((vardelay_x2_sample - susp->vardelay_x1_sample) * susp->vardelay_pHaSe_iNcR);
+	vardelay_val = (sample_type) (susp->vardelay_x1_sample * (1.0 - susp->vardelay_pHaSe) +
+		 vardelay_x2_sample * susp->vardelay_pHaSe);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            long phase;
+        phase = (long) (vardelay_val * vdscale_reg + offset_reg);
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg >= bufflen_reg) {
+            index_reg = 0;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        *out_ptr_reg++ = (sample_type) (buffer_reg[phase]);;
+	    vardelay_val += vardelay_DeLtA;
+	} while (--n); /* inner loop */
+
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->vardelay_pHaSe += togo * susp->vardelay_pHaSe_iNcR;
+	susp->vardelay_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapf_sr_fetch */
+
+
+void tapf_toss_fetch(susp, snd_list)
+  register tapf_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from vardelay up to final_time for this block of zeros */
+    while ((round((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >=
+	   susp->vardelay->current)
+	susp_get_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->vardelay->t0) * susp->vardelay->sr -
+         (susp->vardelay->current - susp->vardelay_cnt));
+    susp->vardelay_ptr += n;
+    susp_took(vardelay_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void tapf_mark(tapf_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->vardelay);
+}
+
+
+void tapf_free(tapf_susp_type susp)
+{
+    free(susp->buffer);
+    sound_unref(susp->s1);
+    sound_unref(susp->vardelay);
+    ffree_generic(susp, sizeof(tapf_susp_node), "tapf_free");
+}
+
+
+void tapf_print_tree(tapf_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("vardelay:");
+    sound_print_tree_1(susp->vardelay, n);
+}
+
+
+sound_type snd_make_tapf(sound_type s1, double offset, sound_type vardelay, double maxdelay)
+{
+    register tapf_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, vardelay->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, tapf_susp_node, "snd_make_tapf");
+    susp->offset = offset * s1->sr;
+    susp->vdscale = vardelay->scale * s1->sr;
+    susp->maxdelay = (long)(maxdelay * s1->sr);
+    susp->bufflen = max(2, (long) (susp->maxdelay + 0.5));
+    susp->index = susp->bufflen;
+    susp->buffer = (sample_type *) calloc(susp->bufflen + 1, sizeof(sample_type));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(vardelay, sr);
+    switch (interp_desc) {
+      case INTERP_ns: /* handled below */
+      case INTERP_nn: /* handled below */
+      case INTERP_ss: /* handled below */
+      case INTERP_sn: susp->susp.fetch = tapf_sn_fetch; break;
+      case INTERP_ni: /* handled below */
+      case INTERP_si: susp->susp.fetch = tapf_si_fetch; break;
+      case INTERP_nr: /* handled below */
+      case INTERP_sr: susp->susp.fetch = tapf_sr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < vardelay->t0) sound_prepend_zeros(vardelay, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(vardelay->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = tapf_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = tapf_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = tapf_mark;
+    susp->susp.print_tree = tapf_print_tree;
+    susp->susp.name = "tapf";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->vardelay = vardelay;
+    susp->vardelay_cnt = 0;
+    susp->vardelay_pHaSe = 0.0;
+    susp->vardelay_pHaSe_iNcR = vardelay->sr / sr;
+    susp->vardelay_n = 0;
+    susp->output_per_vardelay = sr / vardelay->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_tapf(sound_type s1, double offset, sound_type vardelay, double maxdelay)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type vardelay_copy = sound_copy(vardelay);
+    return snd_make_tapf(s1_copy, offset, vardelay_copy, maxdelay);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/tapf.h b/lib-src/libnyquist/nyquist/tran/tapf.h
new file mode 100644
index 0000000..879e0f1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapf.h
@@ -0,0 +1,3 @@
+sound_type snd_make_tapf(sound_type s1, double offset, sound_type vardelay, double maxdelay);
+sound_type snd_tapf(sound_type s1, double offset, sound_type vardelay, double maxdelay);
+    /* LISP: (snd-tapf SOUND ANYNUM SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/tapv.alg b/lib-src/libnyquist/nyquist/tran/tapv.alg
new file mode 100644
index 0000000..e71b3e5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapv.alg
@@ -0,0 +1,53 @@
+(TAPV-ALG
+(NAME "tapv")
+(ARGUMENTS ("sound_type" "s1") ("double" "offset") ("sound_type" "vardelay")
+           ("double" "maxdelay"))
+(INLINE-INTERPOLATION T)
+(INTERNAL-SCALING vardelay)
+(ALWAYS-SCALE s1)
+(START (MAX s1 vardelay))
+(TERMINATE (MIN s1 vardelay))
+(LOGICAL-STOP (MIN s1))
+(STATE ("double" "offset" "offset * s1->sr")
+       ("double" "vdscale" "vardelay->scale * s1->sr")
+       ("double" "maxdelay" "maxdelay * s1->sr")
+       ("long" "bufflen" "max(2, (long) (susp->maxdelay + 1.5))")
+       ("long" "index" "susp->bufflen")
+       ("sample_type *" "buffer" 
+        "(sample_type *) calloc(susp->bufflen + 1, sizeof(sample_type))"))
+(SAMPLE-RATE (MAX s1))
+(CONSTANT "maxdelay" "offset" "vdscale" "buffer")
+(INNER-LOOP-LOCALS "            double phase;
+            long i;
+")
+(INNER-LOOP "        phase = vardelay * vdscale + offset;
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay) phase = maxdelay;
+        phase = (double) index - phase;
+        /* now phase is a location in the buffer (before modulo) */
+
+        /* Time out to update the buffer:
+         * this is a tricky buffer: buffer[0] == buffer[bufflen]
+         * the logical length is bufflen, but the actual length
+         * is bufflen + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer[index++] = s1;
+        if (index > bufflen) {
+            buffer[0] = buffer[bufflen];
+            index = 1;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen;
+        i = (long) phase;    /* put integer part in i */
+        phase -= (double) i; /* put fractional part in phase */	     
+            output = (sample_type) (buffer[i] * (1.0 - phase) + 
+                                    buffer[i + 1] * phase);")
+(FINALIZATION "    free(susp->buffer);
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/tapv.c b/lib-src/libnyquist/nyquist/tran/tapv.c
new file mode 100644
index 0000000..c7e555c
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapv.c
@@ -0,0 +1,634 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "tapv.h"
+
+void tapv_free();
+
+
+typedef struct tapv_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type vardelay;
+    long vardelay_cnt;
+    sample_block_values_type vardelay_ptr;
+
+    /* support for interpolation of vardelay */
+    sample_type vardelay_x1_sample;
+    double vardelay_pHaSe;
+    double vardelay_pHaSe_iNcR;
+
+    /* support for ramp between samples of vardelay */
+    double output_per_vardelay;
+    long vardelay_n;
+
+    double offset;
+    double vdscale;
+    double maxdelay;
+    long bufflen;
+    long index;
+    sample_type *buffer;
+} tapv_susp_node, *tapv_susp_type;
+
+
+void tapv_sn_fetch(register tapv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register double maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register sample_block_values_type vardelay_ptr_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapv_sn_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the vardelay input sample block: */
+	susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	togo = min(togo, susp->vardelay_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	vardelay_ptr_reg = susp->vardelay_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double phase;
+            long i;
+        phase = *vardelay_ptr_reg++ * vdscale_reg + offset_reg;
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = (double) index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg > bufflen_reg) {
+            buffer_reg[0] = buffer_reg[bufflen_reg];
+            index_reg = 1;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        i = (long) phase;    /* put integer part in i */
+        phase -= (double) i; /* put fractional part in phase */	     
+            *out_ptr_reg++ = (sample_type) (buffer_reg[i] * (1.0 - phase) + 
+                                    buffer_reg[i + 1] * phase);;
+	} while (--n); /* inner loop */
+
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	/* using vardelay_ptr_reg is a bad idea on RS/6000: */
+	susp->vardelay_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(vardelay_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapv_sn_fetch */
+
+
+void tapv_si_fetch(register tapv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type vardelay_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register double maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register double vardelay_pHaSe_iNcR_rEg = susp->vardelay_pHaSe_iNcR;
+    register double vardelay_pHaSe_ReG;
+    register sample_type vardelay_x1_sample_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapv_si_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	susp->vardelay_x1_sample = (susp->vardelay_cnt--, *(susp->vardelay_ptr));
+    }
+
+    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    vardelay_x2_sample = *(susp->vardelay_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	vardelay_pHaSe_ReG = susp->vardelay_pHaSe;
+	vardelay_x1_sample_reg = susp->vardelay_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double phase;
+            long i;
+	    if (vardelay_pHaSe_ReG >= 1.0) {
+		vardelay_x1_sample_reg = vardelay_x2_sample;
+		/* pick up next sample as vardelay_x2_sample: */
+		susp->vardelay_ptr++;
+		susp_took(vardelay_cnt, 1);
+		vardelay_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(vardelay, vardelay_ptr, vardelay_cnt, vardelay_x2_sample);
+	    }
+        phase = 
+		(vardelay_x1_sample_reg * (1 - vardelay_pHaSe_ReG) + vardelay_x2_sample * vardelay_pHaSe_ReG) * vdscale_reg + offset_reg;
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = (double) index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg > bufflen_reg) {
+            buffer_reg[0] = buffer_reg[bufflen_reg];
+            index_reg = 1;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        i = (long) phase;    /* put integer part in i */
+        phase -= (double) i; /* put fractional part in phase */	     
+            *out_ptr_reg++ = (sample_type) (buffer_reg[i] * (1.0 - phase) + 
+                                    buffer_reg[i + 1] * phase);;
+	    vardelay_pHaSe_ReG += vardelay_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	susp->vardelay_pHaSe = vardelay_pHaSe_ReG;
+	susp->vardelay_x1_sample = vardelay_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapv_si_fetch */
+
+
+void tapv_sr_fetch(register tapv_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type vardelay_DeLtA;
+    sample_type vardelay_val;
+    sample_type vardelay_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double offset_reg;
+    register double vdscale_reg;
+    register double maxdelay_reg;
+    register long bufflen_reg;
+    register long index_reg;
+    register sample_type * buffer_reg;
+    register sample_type s1_scale_reg = susp->s1->scale;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tapv_sr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->vardelay_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    vardelay_x2_sample = *(susp->vardelay_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next vardelay_x2_sample when phase goes past 1.0; */
+	/* we use vardelay_n (computed below) to avoid roundoff errors: */
+	if (susp->vardelay_n <= 0) {
+	    susp->vardelay_x1_sample = vardelay_x2_sample;
+	    susp->vardelay_ptr++;
+	    susp_took(vardelay_cnt, 1);
+	    susp->vardelay_pHaSe -= 1.0;
+	    susp_check_term_samples(vardelay, vardelay_ptr, vardelay_cnt);
+	    vardelay_x2_sample = *(susp->vardelay_ptr);
+	    /* vardelay_n gets number of samples before phase exceeds 1.0: */
+	    susp->vardelay_n = (long) ((1.0 - susp->vardelay_pHaSe) *
+					susp->output_per_vardelay);
+	}
+	togo = min(togo, susp->vardelay_n);
+	vardelay_DeLtA = (sample_type) ((vardelay_x2_sample - susp->vardelay_x1_sample) * susp->vardelay_pHaSe_iNcR);
+	vardelay_val = (sample_type) (susp->vardelay_x1_sample * (1.0 - susp->vardelay_pHaSe) +
+		 vardelay_x2_sample * susp->vardelay_pHaSe);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	offset_reg = susp->offset;
+	vdscale_reg = susp->vdscale;
+	maxdelay_reg = susp->maxdelay;
+	bufflen_reg = susp->bufflen;
+	index_reg = susp->index;
+	buffer_reg = susp->buffer;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            double phase;
+            long i;
+        phase = vardelay_val * vdscale_reg + offset_reg;
+        /* now phase should give number of samples of delay */
+        if (phase < 0) phase = 0;
+        else if (phase > maxdelay_reg) phase = maxdelay_reg;
+        phase = (double) index_reg - phase;
+        /* now phase is a location in the buffer_reg (before modulo) */
+
+        /* Time out to update the buffer_reg:
+         * this is a tricky buffer_reg: buffer_reg[0] == buffer_reg[bufflen_reg]
+         * the logical length is bufflen_reg, but the actual length
+         * is bufflen_reg + 1 to allow for a repeated sample at the
+         * end. This allows for efficient interpolation.
+         */ 
+        buffer_reg[index_reg++] = (s1_scale_reg * *s1_ptr_reg++);
+        if (index_reg > bufflen_reg) {
+            buffer_reg[0] = buffer_reg[bufflen_reg];
+            index_reg = 1;
+        }
+
+        /* back to the phase calculation: 
+         * use conditional instead of modulo
+         */
+        if (phase < 0) phase += bufflen_reg;
+        i = (long) phase;    /* put integer part in i */
+        phase -= (double) i; /* put fractional part in phase */	     
+            *out_ptr_reg++ = (sample_type) (buffer_reg[i] * (1.0 - phase) + 
+                                    buffer_reg[i + 1] * phase);;
+	    vardelay_val += vardelay_DeLtA;
+	} while (--n); /* inner loop */
+
+	susp->bufflen = bufflen_reg;
+	susp->index = index_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->vardelay_pHaSe += togo * susp->vardelay_pHaSe_iNcR;
+	susp->vardelay_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tapv_sr_fetch */
+
+
+void tapv_toss_fetch(susp, snd_list)
+  register tapv_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from vardelay up to final_time for this block of zeros */
+    while ((round((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >=
+	   susp->vardelay->current)
+	susp_get_samples(vardelay, vardelay_ptr, vardelay_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->vardelay->t0) * susp->vardelay->sr -
+         (susp->vardelay->current - susp->vardelay_cnt));
+    susp->vardelay_ptr += n;
+    susp_took(vardelay_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void tapv_mark(tapv_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->vardelay);
+}
+
+
+void tapv_free(tapv_susp_type susp)
+{
+    free(susp->buffer);
+    sound_unref(susp->s1);
+    sound_unref(susp->vardelay);
+    ffree_generic(susp, sizeof(tapv_susp_node), "tapv_free");
+}
+
+
+void tapv_print_tree(tapv_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("vardelay:");
+    sound_print_tree_1(susp->vardelay, n);
+}
+
+
+sound_type snd_make_tapv(sound_type s1, double offset, sound_type vardelay, double maxdelay)
+{
+    register tapv_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, vardelay->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, tapv_susp_node, "snd_make_tapv");
+    susp->offset = offset * s1->sr;
+    susp->vdscale = vardelay->scale * s1->sr;
+    susp->maxdelay = maxdelay * s1->sr;
+    susp->bufflen = max(2, (long) (susp->maxdelay + 1.5));
+    susp->index = susp->bufflen;
+    susp->buffer = (sample_type *) calloc(susp->bufflen + 1, sizeof(sample_type));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(vardelay, sr);
+    switch (interp_desc) {
+      case INTERP_ns: /* handled below */
+      case INTERP_nn: /* handled below */
+      case INTERP_ss: /* handled below */
+      case INTERP_sn: susp->susp.fetch = tapv_sn_fetch; break;
+      case INTERP_ni: /* handled below */
+      case INTERP_si: susp->susp.fetch = tapv_si_fetch; break;
+      case INTERP_nr: /* handled below */
+      case INTERP_sr: susp->susp.fetch = tapv_sr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < vardelay->t0) sound_prepend_zeros(vardelay, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(vardelay->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = tapv_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = tapv_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = tapv_mark;
+    susp->susp.print_tree = tapv_print_tree;
+    susp->susp.name = "tapv";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->vardelay = vardelay;
+    susp->vardelay_cnt = 0;
+    susp->vardelay_pHaSe = 0.0;
+    susp->vardelay_pHaSe_iNcR = vardelay->sr / sr;
+    susp->vardelay_n = 0;
+    susp->output_per_vardelay = sr / vardelay->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_tapv(sound_type s1, double offset, sound_type vardelay, double maxdelay)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type vardelay_copy = sound_copy(vardelay);
+    return snd_make_tapv(s1_copy, offset, vardelay_copy, maxdelay);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/tapv.h b/lib-src/libnyquist/nyquist/tran/tapv.h
new file mode 100644
index 0000000..81f4b83
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tapv.h
@@ -0,0 +1,3 @@
+sound_type snd_make_tapv(sound_type s1, double offset, sound_type vardelay, double maxdelay);
+sound_type snd_tapv(sound_type s1, double offset, sound_type vardelay, double maxdelay);
+    /* LISP: (snd-tapv SOUND ANYNUM SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/tone.alg b/lib-src/libnyquist/nyquist/tran/tone.alg
new file mode 100644
index 0000000..9a8e1a5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tone.alg
@@ -0,0 +1,15 @@
+(TONE-ALG
+(NAME "tone")
+(ARGUMENTS ("sound_type" "input") ("double" "hz"))
+(START (MIN input))
+(TERMINATE (MIN input))
+(LOGICAL-STOP (MIN input))
+(STATE ("double" "b" "2.0 - cos(hz * PI2 / input->sr)" TEMP)
+       ("double" "c2" "b - sqrt((b * b) - 1.0)")
+       ("double" "c1" "(1.0 - susp->c2) * input->scale")
+       ("double" "prev" "0.0"))
+(INTERNAL-SCALING input)
+(CONSTANT "c1" "c2")
+(INNER-LOOP "output = (sample_type) (prev = c1 * input + c2 * prev)")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/tone.c b/lib-src/libnyquist/nyquist/tran/tone.c
new file mode 100644
index 0000000..a4c2e04
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tone.c
@@ -0,0 +1,213 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "tone.h"
+
+void tone_free();
+
+
+typedef struct tone_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    double c2;
+    double c1;
+    double prev;
+} tone_susp_node, *tone_susp_type;
+
+
+void tone_n_fetch(register tone_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double c2_reg;
+    register double c1_reg;
+    register double prev_reg;
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "tone_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	prev_reg = susp->prev;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) (prev_reg = c1_reg * *input_ptr_reg++ + c2_reg * prev_reg);
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tone_n_fetch */
+
+
+void tone_toss_fetch(susp, snd_list)
+  register tone_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void tone_mark(tone_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void tone_free(tone_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(tone_susp_node), "tone_free");
+}
+
+
+void tone_print_tree(tone_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_tone(sound_type input, double hz)
+{
+    register tone_susp_type susp;
+    double b;
+    rate_type sr = input->sr;
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, tone_susp_node, "snd_make_tone");
+    b = 2.0 - cos(hz * PI2 / input->sr);
+    susp->c2 = b - sqrt((b * b) - 1.0);
+    susp->c1 = (1.0 - susp->c2) * input->scale;
+    susp->prev = 0.0;
+    susp->susp.fetch = tone_n_fetch;
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = tone_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = tone_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = tone_mark;
+    susp->susp.print_tree = tone_print_tree;
+    susp->susp.name = "tone";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_tone(sound_type input, double hz)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_tone(input_copy, hz);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/tone.h b/lib-src/libnyquist/nyquist/tran/tone.h
new file mode 100644
index 0000000..34798a1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tone.h
@@ -0,0 +1,3 @@
+sound_type snd_make_tone(sound_type input, double hz);
+sound_type snd_tone(sound_type input, double hz);
+    /* LISP: (snd-tone SOUND ANYNUM) */
diff --git a/lib-src/libnyquist/nyquist/tran/tonev.alg b/lib-src/libnyquist/nyquist/tran/tonev.alg
new file mode 100644
index 0000000..c7ba37e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tonev.alg
@@ -0,0 +1,24 @@
+(TONEV-ALG
+(NAME "tonev")
+(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz"))
+(INLINE-INTERPOLATION T)
+(INTERNAL-SCALING s1)
+(ALWAYS-SCALE hz)
+(START (MAX s1 hz))
+(TERMINATE (MIN s1 hz))
+(LOGICAL-STOP (MIN s1))
+(STATE ("double" "scale1" "s1->scale")
+       ("double" "c2" "0.0")
+       ("double" "c1" "0.0")
+       ("double" "prev" "0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))"))
+(SAMPLE-RATE (MAX s1))
+(STEP-FUNCTION hz)
+(DEPENDS ("b" "hz" "2.0 - cos(hz)" TEMP "register double")
+         ("c2" "hz" "b - sqrt((b * b) - 1.0)")
+         ("c1" "hz" "(1.0 - c2) * scale1"))
+(CONSTANT "c1" "c2" "b" "scale1")
+(FORCE-INTO-REGISTER scale1)
+(INNER-LOOP "            output = (sample_type) (prev = c1 * s1 + c2 * prev)")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/tonev.c b/lib-src/libnyquist/nyquist/tran/tonev.c
new file mode 100644
index 0000000..689d322
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tonev.c
@@ -0,0 +1,531 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "tonev.h"
+
+void tonev_free();
+
+
+typedef struct tonev_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type s1;
+    long s1_cnt;
+    sample_block_values_type s1_ptr;
+    sound_type hz;
+    long hz_cnt;
+    sample_block_values_type hz_ptr;
+
+    /* support for interpolation of hz */
+    sample_type hz_x1_sample;
+    double hz_pHaSe;
+    double hz_pHaSe_iNcR;
+
+    /* support for ramp between samples of hz */
+    double output_per_hz;
+    long hz_n;
+
+    double scale1;
+    double c2;
+    double c1;
+    double prev;
+} tonev_susp_node, *tonev_susp_type;
+
+
+void tonev_ns_fetch(register tonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double prev_reg;
+    register sample_type hz_scale_reg = susp->hz->scale;
+    register sample_block_values_type hz_ptr_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tonev_ns_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past the hz input sample block: */
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	togo = min(togo, susp->hz_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	prev_reg = susp->prev;
+	hz_ptr_reg = susp->hz_ptr;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    register double b;
+	    b = 2.0 - cos((hz_scale_reg * *hz_ptr_reg++));
+	    c2_reg = b - sqrt((b * b) - 1.0);
+	    c1_reg = (1.0 - c2_reg) * scale1_reg;
+            *out_ptr_reg++ = (sample_type) (prev_reg = c1_reg * *s1_ptr_reg++ + c2_reg * prev_reg);
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using hz_ptr_reg is a bad idea on RS/6000: */
+	susp->hz_ptr += togo;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp_took(hz_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tonev_ns_fetch */
+
+
+void tonev_ni_fetch(register tonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double prev_reg;
+    register double hz_pHaSe_iNcR_rEg = susp->hz_pHaSe_iNcR;
+    register double hz_pHaSe_ReG;
+    register sample_type hz_x1_sample_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tonev_ni_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	    register double b;
+	susp->started = true;
+	susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	b = 2.0 - cos(susp->hz_x1_sample);
+	susp->c2 = b - sqrt((b * b) - 1.0);
+	susp->c1 = (1.0 - susp->c2) * susp->scale1;
+    }
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	prev_reg = susp->prev;
+	hz_pHaSe_ReG = susp->hz_pHaSe;
+	hz_x1_sample_reg = susp->hz_x1_sample;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (hz_pHaSe_ReG >= 1.0) {
+/* fixup-depends hz */
+		register double b; 
+		/* pick up next sample as hz_x1_sample: */
+		susp->hz_ptr++;
+		susp_took(hz_cnt, 1);
+		hz_pHaSe_ReG -= 1.0;
+		susp_check_term_samples_break(hz, hz_ptr, hz_cnt, hz_x1_sample_reg);
+		hz_x1_sample_reg = susp_current_sample(hz, hz_ptr);
+		b = 2.0 - cos(hz_x1_sample_reg);
+		c2_reg = susp->c2 = b - sqrt((b * b) - 1.0);
+		c1_reg = susp->c1 = (1.0 - c2_reg) * scale1_reg;
+	    }
+            *out_ptr_reg++ = (sample_type) (prev_reg = c1_reg * *s1_ptr_reg++ + c2_reg * prev_reg);
+	    hz_pHaSe_ReG += hz_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->prev = prev_reg;
+	susp->hz_pHaSe = hz_pHaSe_ReG;
+	susp->hz_x1_sample = hz_x1_sample_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tonev_ni_fetch */
+
+
+void tonev_nr_fetch(register tonev_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type hz_val;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double scale1_reg;
+    register double c2_reg;
+    register double c1_reg;
+    register double prev_reg;
+    register sample_block_values_type s1_ptr_reg;
+    falloc_sample_block(out, "tonev_nr_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->hz_pHaSe = 1.0;
+    }
+
+    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the s1 input sample block: */
+	susp_check_term_log_samples(s1, s1_ptr, s1_cnt);
+	togo = min(togo, susp->s1_cnt);
+
+	/* grab next hz_x1_sample when phase goes past 1.0; */
+	/* use hz_n (computed below) to avoid roundoff errors: */
+	if (susp->hz_n <= 0) {
+	    register double b;
+	    susp_check_term_samples(hz, hz_ptr, hz_cnt);
+	    susp->hz_x1_sample = susp_fetch_sample(hz, hz_ptr, hz_cnt);
+	    susp->hz_pHaSe -= 1.0;
+	    /* hz_n gets number of samples before phase exceeds 1.0: */
+	    susp->hz_n = (long) ((1.0 - susp->hz_pHaSe) *
+					susp->output_per_hz);
+	    b = 2.0 - cos(susp->hz_x1_sample);
+	    susp->c2 = b - sqrt((b * b) - 1.0);
+	    susp->c1 = (1.0 - susp->c2) * susp->scale1;
+	}
+	togo = min(togo, susp->hz_n);
+	hz_val = susp->hz_x1_sample;
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	scale1_reg = susp->scale1;
+	c2_reg = susp->c2;
+	c1_reg = susp->c1;
+	prev_reg = susp->prev;
+	s1_ptr_reg = susp->s1_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+            *out_ptr_reg++ = (sample_type) (prev_reg = c1_reg * *s1_ptr_reg++ + c2_reg * prev_reg);
+	} while (--n); /* inner loop */
+
+	susp->prev = prev_reg;
+	/* using s1_ptr_reg is a bad idea on RS/6000: */
+	susp->s1_ptr += togo;
+	out_ptr += togo;
+	susp_took(s1_cnt, togo);
+	susp->hz_pHaSe += togo * susp->hz_pHaSe_iNcR;
+	susp->hz_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* tonev_nr_fetch */
+
+
+void tonev_toss_fetch(susp, snd_list)
+  register tonev_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from s1 up to final_time for this block of zeros */
+    while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >=
+	   susp->s1->current)
+	susp_get_samples(s1, s1_ptr, s1_cnt);
+    /* fetch samples from hz up to final_time for this block of zeros */
+    while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >=
+	   susp->hz->current)
+	susp_get_samples(hz, hz_ptr, hz_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->s1->t0) * susp->s1->sr -
+         (susp->s1->current - susp->s1_cnt));
+    susp->s1_ptr += n;
+    susp_took(s1_cnt, n);
+    n = round((final_time - susp->hz->t0) * susp->hz->sr -
+         (susp->hz->current - susp->hz_cnt));
+    susp->hz_ptr += n;
+    susp_took(hz_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void tonev_mark(tonev_susp_type susp)
+{
+    sound_xlmark(susp->s1);
+    sound_xlmark(susp->hz);
+}
+
+
+void tonev_free(tonev_susp_type susp)
+{
+    sound_unref(susp->s1);
+    sound_unref(susp->hz);
+    ffree_generic(susp, sizeof(tonev_susp_node), "tonev_free");
+}
+
+
+void tonev_print_tree(tonev_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("s1:");
+    sound_print_tree_1(susp->s1, n);
+
+    indent(n);
+    stdputstr("hz:");
+    sound_print_tree_1(susp->hz, n);
+}
+
+
+sound_type snd_make_tonev(sound_type s1, sound_type hz)
+{
+    register tonev_susp_type susp;
+    rate_type sr = s1->sr;
+    time_type t0 = max(s1->t0, hz->t0);
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    falloc_generic(susp, tonev_susp_node, "snd_make_tonev");
+    susp->scale1 = s1->scale;
+    susp->c2 = 0.0;
+    susp->c1 = 0.0;
+    susp->prev = 0.0;
+    hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr));
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(s1, sr);
+    interp_desc = (interp_desc << 2) + interp_style(hz, sr);
+    switch (interp_desc) {
+      case INTERP_sn: /* handled below */
+      case INTERP_ss: /* handled below */
+      case INTERP_nn: /* handled below */
+      case INTERP_ns: susp->susp.fetch = tonev_ns_fetch; break;
+      case INTERP_si: /* handled below */
+      case INTERP_ni: susp->susp.fetch = tonev_ni_fetch; break;
+      case INTERP_sr: /* handled below */
+      case INTERP_nr: susp->susp.fetch = tonev_nr_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < s1->t0) sound_prepend_zeros(s1, t0);
+    if (t0 < hz->t0) sound_prepend_zeros(hz, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(s1->t0, min(hz->t0, t0));
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = tonev_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = tonev_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = tonev_mark;
+    susp->susp.print_tree = tonev_print_tree;
+    susp->susp.name = "tonev";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->s1 = s1;
+    susp->s1_cnt = 0;
+    susp->hz = hz;
+    susp->hz_cnt = 0;
+    susp->hz_pHaSe = 0.0;
+    susp->hz_pHaSe_iNcR = hz->sr / sr;
+    susp->hz_n = 0;
+    susp->output_per_hz = sr / hz->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_tonev(sound_type s1, sound_type hz)
+{
+    sound_type s1_copy = sound_copy(s1);
+    sound_type hz_copy = sound_copy(hz);
+    return snd_make_tonev(s1_copy, hz_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/tonev.h b/lib-src/libnyquist/nyquist/tran/tonev.h
new file mode 100644
index 0000000..95bc791
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/tonev.h
@@ -0,0 +1,3 @@
+sound_type snd_make_tonev(sound_type s1, sound_type hz);
+sound_type snd_tonev(sound_type s1, sound_type hz);
+    /* LISP: (snd-tonev SOUND SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/translate-stk.lsp b/lib-src/libnyquist/nyquist/tran/translate-stk.lsp
new file mode 100644
index 0000000..15bf23a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/translate-stk.lsp
@@ -0,0 +1,13 @@
+(translate "stkrev")
+(translate "stkpitshift")
+(translate "stkchorus")
+(translate "instrbow")
+(translate "instrbowedfreq")
+(translate "instrbanded")
+(translate "instrmandolin")
+(translate "instrsitar")
+(translate "instrmodalbar")                   
+(translate "instrflute")
+(translate "instrflutefreq")
+(translate "instrfluteall")
+
diff --git a/lib-src/libnyquist/nyquist/tran/translate.lsp b/lib-src/libnyquist/nyquist/tran/translate.lsp
new file mode 100644
index 0000000..2fc81b7
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/translate.lsp
@@ -0,0 +1,1013 @@
+;*************
+;           Change Log
+;  Date     | Change
+;-----------+------------------------------------
+; 18-Dec-91 | [1.2] <jmn> Created
+; 18-Dec-91 | [1.2] <jmn> added *ANSI* tests
+; 13-Jan-92 | [1.2] <jmn> ANSI header includes stdlib.h, excludes decl of
+;           | malloc
+; 13-Jan-92 | [1.2] <jmn> upgraded to support new sound block structure
+; 15-Jan-92 | [1.2] <jmn> added declarations for UNKNOWN, isunknown()
+; 15-Jan-92 | [1.2] <jmn> commented out boolean, true, false now declared
+;           | in sound.h
+;*************
+;; translate.lsp -- build signal processing code from high level descr.
+
+(setf *ANSI* t)
+(setf *debug* t)
+
+;;**********
+;;	combinations - generate all combinations
+;; Inputs:
+;;	n - number of combinations to generate
+;; Result:
+;;	list of the form
+;;	( (a1 b1) (a2 b2) (a3 b3) ... (an bn) )
+;;	
+;;**********
+
+(defun combinations (n)
+  (let (comb)
+    (cond ((eq n 0) '(nil))
+      (t
+       (setf comb (combinations (1- n)))
+       (append (insert 'ramp comb)
+           (insert 'interp comb)
+           (insert 'scale comb)
+           (insert 'none comb))))))
+
+(print 'comb)
+
+(defun lt () (load "translate"))
+(defun ls () (load "writesusp"))
+(defun lm () (load "writemake"))
+(defun lo () (load "writetoss"))
+(defun li () (load "innerloop"))
+
+(defun ma () (translate "partial"))
+(defun mb () (translate "buzz"))
+(defun mal () (translate "alpass"))
+(defun macv () (translate "alpasscv"))
+(defun mavv () (translate "alpassvv"))
+(defun mf () (translate "follow"))
+(defun mfas () (translate "fromarraystream"))
+(defun mfo () (translate "fromobject"))
+(defun mp () (translate "prod"))
+(defun mc () (translate "const"))
+(defun mct () (translate "coterm"))
+(defun mcl () (translate "clip"))
+(defun meqb () (translate "eqbandvvv"))
+(defun me () (translate "exp"))
+(defun mg () (translate "gate"))
+;(defun mr () (translate "ramp"))
+(defun ms () (translate "sine"))
+(defun msh () (translate "shape"))
+(defun mpw () (translate "pwl"))
+;(defun msfr () (translate "sfread"))
+(defun mde () (translate "delaycc"))
+(defun mdcv () (translate "delaycv"))
+; note: downproto is hand retouched to make downsample
+;(defun md () (translate "downproto"))
+(defun mu () (translate "upsample"))
+(defun ml () (translate "scale"))
+(defun mlo () (translate "log"))
+(defun mm () (translate "maxv"))
+(defun mo () (translate "osc"))
+(defun mof () (translate "offset"))
+(defun mam () (translate "amosc"))
+(defun mfm () (translate "fmosc"))
+(defun mi () (translate "integrate"))
+(defun msl () (translate "slope"))
+(defun mw () (translate "white"))
+(defun mt () (translate "tone"))
+(defun mta () (translate "tapv"))
+(defun mtf () (translate "tapf"))
+(defun mat () (translate "atone"))
+(defun mre () (translate "reson"))
+(defun mrec () (translate "recip"))
+(defun mar () (translate "areson"))
+(defun mtv () (translate "tonev"))
+(defun matv () (translate "atonev"))
+(defun mrvc () (translate "resonvc"))
+(defun mrcv () (translate "resoncv"))
+(defun marvc () (translate "aresonvc"))
+(defun marcv () (translate "aresoncv"))
+(defun mrvv () (translate "resonvv"))
+(defun marvv () (translate "aresonvv"))
+(defun msa () (translate "sampler"))
+(defun msio () (translate "siosc"))
+(defun mq () (translate "quantize"))
+(defun mbq () (translate "biquadfilt"))
+(defun mabs () (translate "abs"))
+(defun msqrt () (translate "sqrt"))
+
+(defun mifft () (translate "ifft"))
+
+(defun mcg () (translate "congen"))
+(defun mcv () (translate "convolve")) ;; this does not generate the final version
+    ;; see the hand-modified version of convolve.c in nyqsrc directory
+(defun mos () (translate "oneshot"))
+(defun mch () (translate "chase"))
+(defun mpl () (translate "pluck"))
+(defun icl () (translate "instrclar"))
+(defun isx () (translate "instrsax"))
+(defun icla () (translate "instrclarall"))
+(defun isxa () (translate "instrsaxall"))
+(defun iclf () (translate "instrclarfreq"))
+(defun isxf () (translate "instrsaxfreq"))
+(defun mla () (translate "allpoles"))
+(defun mlr () (translate "lpreson"))
+
+(defun mstk () (icl) (isx) (icla) (isxa) (iclf) (isxf))
+(defun mfmfb () (translate "fmfb") (translate "fmfbv"))
+
+(defun m () (mf) (mp) (mc) (mcl) (mg)
+;;;;;;      (mr) (msfr) (md)
+        (mm) (ms) (msh) (mpw) (ma) (mb) (mde) (mdcv)
+        (mi) (mu) (ml) (mlo)
+        (mo) (mof) (mam) (mfm) (mw) (msl) (mt) (mat) (mre) (mrec)
+        (mar) (mtv)	(mta) (mtf) (matv) (mrvc) (mrcv) (marvc) (marcv)
+            (mrvv) (marvv) (me) (msa) (msio) (mq) (mcg) (mifft) 
+            (mfas) (mfo) (mct) (mal) (mos) (mch) (mbq) (mpl)
+            (mabs) (msqrt) (macv) (mavv) ; (mcv) must be managed by hand
+            (mstk) (mla) (mlr) (load "translate-stk") (mfmfb))
+
+; call this when you change writesusp.lsp: "N"ew "S"usp
+(defun ns () (ls) (m))
+; call this when you change writemake.lsp:
+(defun nm () (lm) (m))
+; call this when you change innerloop.lsp:
+(defun ni () (li) (m))
+
+
+;;**********
+;; any-ramp-in -- see if interpolation-list has 'ramp
+;;
+;; note: lis is a list of lists of atoms
+;;**********
+(defun any-ramp-in (lis)
+  (dolist (spec lis)
+    (cond ((member 'RAMP spec)
+       (return t)))))
+
+
+;;**********
+;; any-ramp-or-interp-in -- see if interpolation-list has 'ramp or 'interp
+;;
+;;**********
+(defun any-ramp-or-interp-in (lis)
+  (or (any-ramp-in lis)
+      (dolist (spec lis)
+    (cond ((member 'INTERP spec)
+           (return t))))))
+
+
+;;**********
+;; encode -- come up with ascii string for interp spec
+;;
+;; e.g. (none ramp) -> "nr"
+;;
+;;**********
+(defun encode (interpolation)
+  (let (first-letter 
+    (result ""))
+    (dolist (interp interpolation)
+      (setf first-letter (string (char (symbol-name interp) 0)))
+      (setf result (strcat result first-letter)))
+    (string-downcase result)))
+
+
+;; ****************
+;;	header-list
+;;
+;; Result:
+;;	'( "s1" "s2" ... "sn" )
+;; 	where s1, s2, etc. are the strings for the header part of the
+;;	resulting .c file
+;; Notes:
+;;	Kludgy.  Fix this up for easier maintenance
+;; ****************
+
+(if *ANSI* 
+    ; ANSI
+    (setf header-list 
+     '("#include \"stdio.h\"\n"
+       "#ifndef mips\n"
+       "#include \"stdlib.h\"\n"
+       "#endif\n"
+       "#include \"xlisp.h\"\n"                             
+       "#include \"sound.h\"\n\n"
+       "#include \"falloc.h\"\n"
+       "#include \"cext.h\"\n"
+       ))
+    ; non-ANSI
+    (setf header-list 
+     '("#include \"stdio.h\"\n"
+       "#include \"xlisp.h\"\n"                             
+       "#include \"sound.h\"\n"
+       "#include \"falloc.h\"\n")))
+
+
+(setf h-boilerplate nil)
+
+;--------------obsolete boilerplate-------------
+;; Note that we use "-1" and "< 0".  We rely upon C's semantics to
+;; make this work correctly if it is being assigned to a long, float, or
+;; double, and if a long, float, or double is being compared
+;      '("\n#ifndef UNKNOWN\n"
+;	"#define UNKNOWN -1\n"
+;	"#define isunknown(x) ( (x) < 0)\n"
+;	"#endif /* UNKNOWN */\n"))
+;-------------------------
+
+
+;;**********
+;; code-gen -- do the output
+;;
+;; Inputs:
+;;	alg -
+;;	stream -
+;;	hstream -
+;;**********
+
+(defun code-gen (alg stream hstream)
+  (let (interpolation-list
+    (support-functions (get-slot alg 'support-functions))
+    (support-header    (get-slot alg 'support-header))
+    (name (get-slot alg 'name)))
+    ;(display "code-gen: " alg stream hstream)
+    (print-strings header-list stream)
+    (format stream "#include \"~A\"~%" (get-slot alg 'hfile))
+    (display "code-gen: printed header")
+    (format stream "~%void ~A_free();~%" name)
+    (setf interpolation-list (make-interpolation-list alg))
+    (display "code-gen: " interpolation-list)
+    (put-slot alg interpolation-list 'interpolation-list)
+    (put-slot alg (make-interpolation-rationale alg) 
+          'interpolation-rationale)
+      
+    (write-typedef alg stream)
+    (display "code-gen: wrote typedef")
+
+    (cond (support-functions
+       (format stream "~%~A" support-functions)))
+
+    (dolist (interpolation interpolation-list)
+      (put-slot alg interpolation 'interpolation)
+      (display "code-gen: going to write susp for " interpolation)
+      (write-susp alg stream)
+      (display "code-gen: wrote susp for" interpolation))
+
+    ;; this is a special case for no sound arguments
+    (cond ((null interpolation-list)
+       (write-susp alg stream)))
+
+    ;; write the function that is called to read and toss
+    ;; samples up to the start time (but only if there are sound arguments)
+    (cond ((get-slot alg 'sound-names)
+       (write-toss alg stream)))
+
+    ;; write the GC marking function        
+    (cond ((needs-mark-routine alg)
+       (write-mark alg stream)))
+
+    (write-make alg stream)
+    (display "code-gen: wrote make")
+
+    (write-xlmake alg stream)
+    (display "code-gen: wrote xlmake")
+
+    (write-header alg hstream)
+    (cond ( support-header
+            (print-strings support-header hstream)))
+    (print-strings h-boilerplate hstream)
+    (display "code-gen: wrote header")))
+
+
+;;**********
+;; commute-check -- 
+;;
+;; Purpose:
+;; 	see if interpolation spec is redundant due to commutativity
+;; Algorithm: 
+;;	for each list of "commutable" sounds, make sure spec asks for
+;;	cannonical ordering:  NONE > SCALE > INTERP > RAMP
+;;**********
+(defun commute-check (alg spec)
+  (let ((sounds (get-slot alg 'sound-args))
+    (commute-list (get-slot alg 'commutative))
+    (result t)
+    s1 s2)
+    (dolist (commute commute-list)
+      (dotimes (n (1- (length commute)))  ; look at all pairs
+    (setf s1 (nth n commute))
+    (setf s2 (nth (1+ n) commute))
+    (setf s1 (index s1 sounds))
+    (setf s2 (index s2 sounds))
+    (setf s1 (nth s1 spec))
+    (setf s2 (nth s2 spec))
+    (cond ((< (eval s1) (eval s2))
+           (setf result nil)
+           (return)))))
+    result))
+
+(setf NONE 4) (setf SCALE 3) (setf INTERP 2) (setf RAMP 1)
+
+
+(print 'ramp)
+
+
+;;**********
+;; concatenate -- string concatenation
+;;
+;; Inputs:
+;;	"s1" - string
+;;	"s2" - string
+;; Result:
+;;	"s1s2"
+;;**********
+
+(defun concatenate (type s1 s2)
+    (cond ((eq type 'string) (strcat s1 s2))
+          (t (error "concatenate type"))))
+
+
+;;**********
+;; get-slot -- access the algorithm description, return single value
+;;
+;;**********
+
+(setfn get-slot get)
+
+
+;;**********
+;; index -- find location of list element
+;;
+;; Inputs:
+;;	atom - atom to be found in list
+;;	lis  - list searched for
+;; Result:
+;;	integer - index of atom in lis
+;;	NIL	- atom not member of lis
+;;**********
+
+(defun index (atom lis)
+  (let ((i 0))
+    (dolist (elt lis)
+      (cond ((eq elt atom)
+         (return i)))
+      (setf i (1+ i)))))
+
+
+;;**********
+;; insert -- insert an atom at the front of each element of a list
+;;
+;; Inputs:
+;;	atom - 
+;;	list-of-lists - lists of the form ( (L1) (L2) ... (Ln))
+;; Result:
+;;	( (atom L1) (atom L2) ... (atom Ln) )
+;;**********
+(defun insert (atom list-of-lists)
+  (mapcar '(lambda (lis) (cons atom lis)) list-of-lists))
+
+(print 'insert)
+
+;; interp-check -- check to see that no interpolation is being done
+;;   (unless the algorithm is the up-sample algorithm, a special case
+;;
+(defun interp-check (alg spec)
+  (or *INLINE-INTERPOLATION*
+      (get alg 'inline-interpolation)
+      (and (not (member 'INTERP spec))
+       (not (member 'RAMP spec)))))
+    
+(print 'interp-check)
+
+
+;;**********
+;; make-interpolation-list -- figure out the possible interpolation forms
+;;
+;; Inputs:
+;;	 alg - algorithm description
+;; Output:
+;;  List of interpolation styles, e.g. 
+;;  ((NONE NONE) (NONE INTERP) (NONE RAMP)), where the styles
+;; are in the same order as the sound arguments (sound-args)
+;; 
+;;**********
+(defun make-interpolation-list (alg)
+  (let (sound-args specs real-specs sound-names sound-to-name
+    (sr (get-slot alg 'sample-rate))
+    (not-in-inner-loop (get-slot alg 'not-in-inner-loop)))
+    ; derive some lists:
+    ;   sound-args are atom names of sound-type arguments
+    ;   sound-names are the corresponding string names
+    ;   sound-to-name is an assoc list mapping atom to case-sensitive string
+;    (display "make-interpolation-list")
+
+    (dolist (arg (get-slot alg 'arguments))
+    (cond ((and (equal (car arg) "sound_type")
+            (not (member (cadr arg) not-in-inner-loop :test #'equal)))
+           (setf sound-names (cons (cadr arg) sound-names))
+           (setf sound-args (cons (name-to-symbol (cadr arg))
+                      sound-args))
+           (setf sound-to-name (cons (cons (car sound-args)
+                           (car sound-names))
+                     sound-to-name))
+;	       (display "in make-interpolation-list" sound-to-name)
+          )))
+;    (display "make-interpolation-list: " (reverse sound-args))
+    (put-slot alg (reverse sound-args) 'sound-args)
+;    (display "make-interpolation-list: " (reverse sound-names))
+    (put-slot alg (reverse sound-names) 'sound-names)
+    (put-slot alg sound-to-name 'sound-to-name)
+    ; make all combinations of interpolations
+    (setf specs (combinations (length sound-args)))
+    ;; don't print this or you'll die when the list is huge
+    ;; (display "make-interpolation-list: " specs)
+    ;; we really should have filtered with match-check inside combinations
+    ;; to avoid exponential explosion
+    ; reject combinations based on commutativity, linearity, and sample rate:
+    ; if sample-rate is not specified, then some interpolation must be 'NONE,
+    ; i.e. sample-rate is specified OR an interpolation is 'NONE:
+    ; if INLINE-INTERPOLATION is turned off, don't allow RAMP or INTERP
+     ; if INTERNAL-SCALING applies, then don't allow SCALE
+    (dolist (spec specs)
+      (cond ((and spec
+                  (interp-check alg spec)
+                  (commute-check alg spec)
+                  (scale-check alg spec)
+                  (match-check alg spec)
+                  (sr-check alg spec))
+             (setf real-specs (cons spec real-specs)))))
+    (cond ((and (car specs) (null real-specs))
+       (error "no interpolation specs")))
+    (print real-specs)))
+
+
+; MAKE-INTERPOLATION-RATIONALE -- record the rationale for
+; interpolation combinations:
+;   NIL means no special considerations
+;   ALWAYS-SCALE means 'n' eliminated, use 's' instead
+;   LINEAR means 's' eliminated and unnecessary
+;   INTERNAL-SCALING means 's' eliminated, use 'n' instead
+;
+(defun make-interpolation-rationale (alg)
+  (let (interpolation-rationale len snd
+    (sounds (get-slot alg 'sound-args))
+    (linear (get-slot alg 'linear))
+    (internal-scaling (get-slot alg 'internal-scaling))
+    (always-scale (get-slot alg 'always-scale)))
+    (setf interpolation-rationale (mapcar #'return-nil sounds))
+    (setf len (length interpolation-rationale))
+    (dotimes (n len)
+         (setf snd (nth n sounds))
+         (cond ((member snd always-scale)
+            (setf (nth n interpolation-rationale) 'ALWAYS-SCALE)))
+         (cond ((member snd linear)
+            (cond ((nth n interpolation-rationale)
+               (error "parameter is both linear and always-scale"
+                  snd)))
+            (setf (nth n interpolation-rationale) 'LINEAR)))
+         (cond ((member snd internal-scaling)
+            (cond ((nth n interpolation-rationale)
+               (error 
+ "parameter is both linear and always-scale or internal-scaling" snd)))
+            (setf (nth n interpolation-rationale) 'INTERNAL-SCALING))))
+    (display "make-interpolation-rationale" interpolation-rationale)
+    interpolation-rationale))
+
+
+(print 'hi)
+
+;;**********
+;; make-schema-from-slots -- take attr/value pairs and make property list
+;;
+;; Inputs:
+;;	slots - a list of the form 
+;;			(name
+;;			   (attribute1 value1) (attribute2 value2)
+;;					... (attributen valuen) )
+;; Result:
+;;	The atom 'name' with the attached property list
+;; Effect:
+;;	Adds properties to the atom 'name' based on the attribute-value
+;;	pairs. 
+;; Notes:
+;;	The property-list representation is chosen for time efficiency of
+;;	access
+;;**********
+
+(defun make-schema-from-slots (slots)
+  (let ((name (car slots)))
+    (setf (symbol-plist name) nil)
+    (dolist (slot (cdr slots))
+      (putprop name (cdr slot) (car slot)))
+    name))
+
+;;****************
+;; name-to-symbol -- convert from case-sensitive C name to internal symbol
+;;****************
+(defun name-to-symbol (name) (intern (string-upcase name)))
+
+
+
+;;**********
+;; position -- find a pattern in a string
+;;
+;; Inputs:
+;;	s -
+;;	p -
+;;**********
+
+(defun position (s p)
+  (let (result (len (length p)))
+    (dotimes (n (+ 1 (length s) (- len)))
+      (cond ((equal (subseq s n (+ n len)) p)
+         (setf result n)
+         (return))))
+    result))
+
+
+;;**********
+;; print a list of strings to a stream
+;;
+;; Inputs:
+;;	strings - a list of strings
+;;	stream - stream on which to write the strings
+;; Effect:
+;;	
+;;**********
+
+(defun print-strings (strings stream)
+  (dolist (s strings) (princ s stream)))
+
+
+
+;;**********
+;; put-slot: 
+;;	
+;; Inputs:
+;;	schema - name of the schema
+;;	value - value of the attribute to be added or modified
+;;	property - name of the attribute to be modified
+;;
+;;**********
+
+(setfn put-slot putprop)
+
+
+(defun return-nil (ignore) nil)
+
+;;**********
+;; scale-check -- make sure scale method is not used on linear input or
+;;	on input where scaling is factored into other computation; 
+;; 	Also, don't use NONE scale method if sound appears on always-scale
+;; 	list (these sounds have low likelihood of ever using 'NONE method -
+;;	see fmosc for an example).  Note that if you say always-scale (removing
+;;                NONE) and linear or internal-scaling (removing SCALE),
+;;                then you'll be in big trouble.
+;;
+;; Inputs:
+;;	alg - algorithm description
+;;	spec -
+;; Notes:
+;;	
+;;**********
+
+(defun scale-check (alg spec)
+  (let ((sounds (get-slot alg 'sound-args))
+        (linear (get-slot alg 'linear))
+        (internal-scaling (get-slot alg 'internal-scaling))
+        (always-scale (get-slot alg 'always-scale))
+        snd
+        (result t)
+       )
+    ; initially, the rationale list is nil for each sound:
+    (cond (always-scale
+       (dotimes (n (length spec))  ; look at each method in spec
+         (cond ((eq 'NONE (nth n spec))
+            (setf snd (nth n sounds))
+            (cond ((member snd always-scale)
+               (setf result nil)
+               (return))))))))
+    (cond ((member 'SCALE spec)	; quick test
+       (dotimes (n (length spec))  ; look at each method in spec
+         (cond ((eq 'SCALE (nth n spec))
+            (setf snd (nth n sounds))
+            (cond ((or (member snd linear) 
+                   (member snd internal-scaling))
+               (if (member snd internal-scaling) 
+                 (format t "WARNING internal scaling not fully debugged, check your results...\n"))
+               (setf result nil)
+               (return))))))))
+    result))
+
+
+;; match-check -- make sure spec is consistent with inputs whose sample-rates
+;; are matched. If a set of inputs appears on a MATCHED-SAMPLE-RATE clause,
+;; then the spec for each input must be the same. This is used to control
+;; combinatorial explosions.
+;;
+(defun match-check (alg spec)
+  (let ((sounds (get-slot alg 'sound-args))
+        (matched-sample-rate (get-slot alg 'matched-sample-rate))
+        kind ;; kind of access used by all matched sounds
+        snd  ;; the current sound in list
+        (result t))
+    ;; algorithm: scan list for members of matched-sample-rate
+    ;; when first is found, set kind; after than, insist that
+    ;; other members have matching spec
+    (cond (matched-sample-rate
+           (dotimes (n (length spec))
+             (setf snd (nth n sounds))
+             (cond ((member snd matched-sample-rate)
+                    (cond ((null kind)
+                           (setf kind (nth n spec)))
+                          ((eq (nth n spec) kind))
+                          (t
+                           (setf result nil))))))))
+    result))
+
+
+;;****************
+;; space-if-no-trailing-star -- returns "" if arg ends with "*", else space
+;;****************
+(defun space-if-no-trailing-star (str)
+  (if (equal #\* (char str (1- (length str))))
+    ""
+    #\Space))
+
+
+;; SPEC-IS-NONE-OR-SCALE -- see if spec is none or scale, called by sr-check
+;;
+;; sig is the search key
+;; sound-args is a list, one element matches sig
+;; spec is list of specs corresponding to elements in sound-args
+;; return t if (eq sig (nth n sound-args)) and (nth n spec) is 
+;; either 'none or 'scale
+;;
+(defun spec-is-none-or-scale (sig sound-args spec)                      
+  (dolist (arg sound-args)
+      (cond ((eq sig arg)
+         (return (member (car spec) '(NONE SCALE)))))
+      (setf spec (cdr spec))))
+
+
+;;****************
+;; sr-check -- see if interpolation spec is ok wrt sample rate spec
+;;****************
+(defun sr-check (alg spec)
+  (let ((sample-rate (get-slot alg 'sample-rate))
+    (sound-args (get-slot alg 'sound-args))
+    (result t))
+    ;; if expression given, then anything is ok
+    (cond ((stringp sample-rate) t)
+      ;; if (MAX ...) expression given, then one of signals must be NONE or SCALE
+      ((and (listp sample-rate) (eq (car sample-rate) 'MAX))
+       (dolist (sig (cdr sample-rate))  ; for all sig in max list ...
+           (cond ((not (spec-is-none-or-scale sig sound-args spec))
+              (setf result nil))))
+       result)
+      ;; if no expression given, then one signal must be NONE or SCALE
+      ((or (member 'NONE spec) (member 'SCALE spec)) t)
+      ;; o.w. return false
+      (t nil))))
+
+
+;;****************
+;; symbol-to-name -- convert from internal symbol to case-sensitive C name
+;;****************
+(defun symbol-to-name (symbol) (get symbol 'string-name))
+
+
+
+;;**********
+;; translate -- main procedure
+;;
+;; Inputs:
+;;	name - string which is name of file to translate
+;; Effect:
+;;	Reads the algorithm specification as "name.alg"
+;;	Generates output files "name.c" and "name.h"
+;;**********
+(defun translate (name)
+  (prog* ((infile (concatenate 'string name ".alg"))
+      (outfile (concatenate 'string name ".c"))
+      (hfile (concatenate 'string name ".h"))
+      (inf (open infile :direction :input))
+      (hf (open hfile :direction :output))
+      (outf (open outfile :direction :output)))
+
+   (if (null inf) (error "translate: couldn't open inf"))
+   (if (null hf) (error "translate: couldn't open hf"))
+   (if (null outf) (error "translate: couldn't open outf"))
+
+   (display "FILES" inf hf outf)
+
+   (if *WATCH*
+      (print "**** TRACING HOOKS ENABLED!  ****")
+      (print "**** NO TRACING ****")
+   )
+   loop
+    ;; read the algorithm description 
+    (setq alg (read inf))
+
+    ;; if the algorithm is NIL, we had some sort of failure
+    (cond ((null alg) 
+       (close inf)
+       (close hf)
+       (close outf)
+       (return)))
+
+    ;; we have read in the high-level schema specification
+    ;; convert it to a schema
+    (display "translate: " infile alg)
+    (setf alg (make-schema-from-slots alg))
+    (display "translate: schema " alg)
+
+    ;; save the .h file name
+    (put-slot alg hfile 'hfile)
+    ;; perform the type-check on the schema parameters
+    (type-check-and-transform alg)
+    (display "translate: transformed schema" alg)
+    (code-gen alg outf hf)
+    (display "translate: finished code-gen")
+    (setf save-alg alg)
+    (go loop)
+ )
+)
+    
+
+(print 'translate)
+
+;;**********
+;; type-check-and-transform -- fix up slots in an algorithm schema
+;;
+;; Inputs:
+;;	alg - the name of the algorithm; values are its property list
+;; Notes:
+;;	Report an error if required slot values are absent
+;;	Any slot which should be a single value and is a list is
+;;	coerced to be the car of the list
+;;	Put argument string names on argument symbols for conversion.
+;;**********
+
+(defun type-check-and-transform (alg)
+
+  ;; the quoted list that follows 'slot' is the list of required
+  ;; parameters.  If any parameter is missing, this will cause an
+  ;; error
+
+  (dolist (slot '(name inner-loop)) ; other necessarily non-nil slots go here
+    (cond ((null (get-slot alg slot))
+       (error "missing slot"))))
+
+  ; fix single-value slots to not be stored as lists:
+  ;     If the value is a list, the value is coerced to
+  ;	be the car of the list
+
+  (dolist 
+       (slot 
+     '(name lispname inner-loop sample-rate support-functions inline-interpolation delay
+       )) 
+       (put-slot alg (car (get-slot alg slot)) slot))
+
+  ; Make sure there are no strings, only symbols, in TERMINATE and
+  ; LOGICAL-STOP MIN lists: (TERMINATE (MIN "s1")) is wrong, it should be
+  ; (TERMINATE (MIN s1))
+
+  (dolist (field '(terminate logical-stop))
+    (setf spec (get-slot alg field))
+    (display "type-check" spec field)
+    (cond ((and spec
+        (listp (car spec))
+        (member (caar spec) '(MIN MAX)))
+       (dolist (entry (cdar spec))
+         (display "type-check" spec field entry)
+         (cond ((eq (type-of entry) 'STRING)
+            (error "MIN and MAX args are symbols, not strings"
+               spec)))))))
+
+  ; (ARGUMENTS ( "type1" "name1") ("type2" "name2") ... ("typen" "namen") )
+  ; if "sr" is the name of an argument, its type must be "rate_type"
+  ; i.e. ("rate_type" "sr")
+
+  (dolist (arg (get-slot alg 'arguments))
+    (cond ((and (equal (cadr arg) "sr")
+           (not (equal (car arg) "rate_type")))
+       (error "argument sr must be of type rate_type"))
+      ((equal (car arg) "sound_type")
+       (putprop (name-to-symbol (cadr arg)) (cadr arg) 'string-name)))))
+
+
+
+;;**********
+;; union-of-nth -- get the union of the nth element of each sublist
+;;
+;;**********
+(defun union-of-nth (lis n)
+  (let (result a)
+    (dolist (sublis lis)
+      (setf a (nth n sublis))
+      (cond ((not (member a result)) 
+         (setf result (cons a result)))))
+    result))
+
+
+(print 'union-of-nth)
+
+;;**********
+;; write-header -- write a header file for the suspension create routine
+;;
+;; Inputs:
+;;	alg - algorithm name
+;;	stream - output stream for .h file
+;; Effect:
+;;	Writes to the stream
+;;		sound_type snd_make_NAME();
+;; Notes:
+;;	Uses NAME property of algorithm to emit the procedure header to
+;;	the .h file
+;;**********
+
+(setf c-to-xlisp-type '(
+  ("double" . "ANYNUM")
+  ("float" . "ANYNUM")
+  ("time_type" . "ANYNUM")
+  ("rate_type" . "ANYNUM")
+  ("sample_type" . "ANYNUM")
+  ("sound_type" . "SOUND")
+  ("char *" . "STRING")
+  ("LVAL" . "ANY")
+  ("int" . "FIXNUM")
+  ("long" . "FIXNUM")
+  ("boolean" . "BOOLEAN")
+))
+  
+
+(defun write-header (alg stream)
+;;  (format stream "sound_type snd_make_~A();~%" (get-slot alg 'name))
+    (let ((arguments (get-slot alg 'arguments))
+      (name (get-slot alg 'name))
+      (lisp-name (get-slot alg 'lispname)))
+       (cond ((null lisp-name) (setf lisp-name name)))
+       (format stream "sound_type snd_make_~A" name)
+       (write-ansi-prototype-list stream "" arguments)
+       (format stream ";~%")
+
+       ; write the xlisp interface routine
+       (format stream "sound_type snd_~A" name)
+       (write-ansi-prototype-list stream "" arguments)
+       (format stream ";~%")
+
+       ; write the type specification for intgen
+       (format stream "    /* LISP: (snd-~A" lisp-name)
+       (dolist (arg arguments)
+     (let ((xltype (assoc (car arg) c-to-xlisp-type :test #'equal)))
+       (cond ((null xltype)
+          (error "couldn't translate c-type" (car arg))))
+       (format stream " ~A" (cdr xltype))))
+       (format stream ") */~%")))
+
+
+;;**********
+;; write-typedef -- compile the suspension type definition
+;;
+;; Inputs:
+;;	alg - the algorithm specification
+;;	stream - stream to which to write it
+;; Effect:
+;;	typedef struct NAME_susp_struct {
+;;		...
+;;	} NAME_susp_node, *NAME_susp_type;
+;;
+;;  A side-effect of write-typedef is the initialization
+;;  of slot xlisp-pointers in alg.  This is used later by
+;;  write-mark to generate the garbage collection mark routine.
+;;**********
+
+(defun write-typedef (alg stream)
+  (let (arg-type args interpolation-list sound-names arg
+    (alg-name (get-slot alg 'name))
+    name xlisp-pointers
+    (state-list (get-slot alg 'state))
+    (logical-stop (car (get-slot alg 'logical-stop)))
+    (terminate (car (get-slot alg 'terminate))))
+    ;----------------------------
+    ;  typedef struct NAME_susp_strct {
+     ;     snd_susp_node susp;
+    ;----------------------------
+    (format stream "~%~%typedef struct ~A_susp_struct {~%~A~%"
+    alg-name "    snd_susp_node susp;")
+
+    ; go through interpolation list:
+    ;   NONE means use each sample
+    ;   INTERP means interpolate between samples
+    ;   RAMP means do ramp generation between samples
+    ;   NIL means this is not a signal
+
+    (setf interpolation-list (get-slot alg 'interpolation-list))
+    (setf sound-names (get-slot alg 'sound-names))
+
+    ; declare started flag if there is a ramp or interp signal anywhere
+    (cond ((any-ramp-or-interp-in interpolation-list)
+           ;---------------------
+       ; INTERP/RAMP:
+       ;	boolean started;
+           ;---------------------
+       (format stream "    boolean started;~%")))
+
+    (display "in translate.lsp" 
+         terminate alg (terminate-check-needed terminate alg))
+    (cond ((terminate-check-needed terminate alg)
+       ;----------------
+       ; long terminate_cnt;
+       ;----------------
+       (format stream "    long terminate_cnt;~%")))
+
+    (cond ((logical-stop-check-needed logical-stop)
+       ;----------------
+       ; boolean logically_stopped;
+       ;----------------
+       (format stream
+        "    boolean logically_stopped;~%")))
+
+    ; each sound argument has a variety of ways it might be
+    ; interpolated.  These are stored on interpolation-list, and union-of-nth
+     ; is used to gather all the interpolation styles that must be supported 
+     ; for a given signal - we then declare whatever state is necessary for
+     ; each possible interpolation
+    (dotimes (n (length (get alg 'sound-args)))
+      (let ((interpolation (union-of-nth interpolation-list n)))
+    (setf name (nth n sound-names))	; get name of signal
+    ;------------------------
+    ;	sound_type NAMEi;
+    ;	long  NAME_cnt;
+    ;       sample_block_values_type NAME_ptr;
+    ;------------------------
+    (format stream "    sound_type ~A;~%" name)
+    (format stream "    long ~A_cnt;~%" name)
+    (format stream "    sample_block_values_type ~A_ptr;~%" name)
+    (cond ((or (member 'INTERP interpolation)
+           (member 'RAMP interpolation))
+           ;-----------------
+           ;  /* support for interpolation of NAMEi */
+           ;-----------------
+           (format stream 
+        "~%    /* support for interpolation of ~A */~%" name)
+
+           ;-----------------
+           ;  sample_type NAME_x1_sample;
+           ;-----------------
+           (format stream "    sample_type ~A_x1_sample;~%" name)
+
+           ;-----------------
+           ; double NAME_pHaSe;
+           ; double NAME_pHaSe_iNcR;
+           ;-----------------
+           (format stream "    double ~A_pHaSe;~%" name)
+           (format stream "    double ~A_pHaSe_iNcR;~%" name)))
+
+    (cond ((member 'RAMP interpolation)
+           ;-----------------
+           ; RAMP:
+           ;	/* support for ramp between samples of NAME */
+           ;	double output_per_NAME;
+           ; long NAME_n;
+           ;-----------------
+           (format stream
+        "~%    /* support for ramp between samples of ~A */~%" name)
+           (format stream "    double output_per_~A;~%" name)
+           (format stream "    long ~A_n;~%" name) ))))
+
+    ;----------------------------
+    ; STATE
+    ; 	TYPEi VARNAMEi ;
+    ;----------------------------
+    ;; now write state variables
+    ;; (STATE (s1) (s2)... (sn) )
+    ;; each (si) is of the form
+    ;;		("type" "varname" "?" [TEMP])
+    (cond (state-list (format stream "~%")))
+    (dolist (state state-list)
+      (cond ((equal "LVAL" (car state))
+         (push (cadr state) xlisp-pointers)))
+      (cond ((and (cdddr state)
+          (cadddr state)
+          (eq (cadddr state) 'TEMP))
+         ; no field allocated for local/temp variables
+        )
+         (t
+         (let ((sep (space-if-no-trailing-star (car state))))
+           (format stream "    ~A~A~A;~%" 
+        (car state) sep (cadr state))))))
+    (put-slot alg xlisp-pointers 'xlisp-pointers)
+
+    ;----------------------------
+    ;	} ALG-NAME_susp_node, *ALG-NAME_susp_type;
+    ;----------------------------
+    (format stream "} ~A_susp_node, *~A_susp_type;~%" alg-name alg-name)))
+
+(print 'end)
diff --git a/lib-src/libnyquist/nyquist/tran/upsample.alg b/lib-src/libnyquist/nyquist/tran/upsample.alg
new file mode 100644
index 0000000..82aaca3
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/upsample.alg
@@ -0,0 +1,18 @@
+(UP-ALG
+  (NAME "up")
+  (ARGUMENTS ("rate_type" "sr") ("sound_type" "input"))
+  (INLINE-INTERPOLATION T)
+  (SAMPLE-RATE "sr")
+  (START (MIN input))
+  (INNER-LOOP "output = (sample_type) input")
+  (LINEAR input)
+  (TERMINATE (MIN input))
+  (LOGICAL-STOP (MIN input))
+  (TYPE-CHECK
+"    if (input->sr > sr) {
+        sound_unref(input);
+        xlfail(\"snd-up: output sample rate must be higher than input\");
+    }
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/upsample.c b/lib-src/libnyquist/nyquist/tran/upsample.c
new file mode 100644
index 0000000..a83c678
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/upsample.c
@@ -0,0 +1,448 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "upsample.h"
+
+void up_free();
+
+
+typedef struct up_susp_struct {
+    snd_susp_node susp;
+    boolean started;
+    long terminate_cnt;
+    boolean logically_stopped;
+    sound_type input;
+    long input_cnt;
+    sample_block_values_type input_ptr;
+
+    /* support for interpolation of input */
+    sample_type input_x1_sample;
+    double input_pHaSe;
+    double input_pHaSe_iNcR;
+
+    /* support for ramp between samples of input */
+    double output_per_input;
+    long input_n;
+} up_susp_node, *up_susp_type;
+
+
+void up_n_fetch(register up_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register sample_block_values_type input_ptr_reg;
+    falloc_sample_block(out, "up_n_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past the input input sample block: */
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	togo = min(togo, susp->input_cnt);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	input_ptr_reg = susp->input_ptr;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) *input_ptr_reg++;
+	} while (--n); /* inner loop */
+
+	/* using input_ptr_reg is a bad idea on RS/6000: */
+	susp->input_ptr += togo;
+	out_ptr += togo;
+	susp_took(input_cnt, togo);
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* up_n_fetch */
+
+
+void up_i_fetch(register up_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type input_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    register double input_pHaSe_iNcR_rEg = susp->input_pHaSe_iNcR;
+    register double input_pHaSe_ReG;
+    register sample_type input_x1_sample_reg;
+    falloc_sample_block(out, "up_i_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp_check_term_log_samples(input, input_ptr, input_cnt);
+	susp->input_x1_sample = susp_fetch_sample(input, input_ptr, input_cnt);
+    }
+
+    susp_check_term_log_samples(input, input_ptr, input_cnt);
+    input_x2_sample = susp_current_sample(input, input_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	input_pHaSe_ReG = susp->input_pHaSe;
+	input_x1_sample_reg = susp->input_x1_sample;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+	    if (input_pHaSe_ReG >= 1.0) {
+		input_x1_sample_reg = input_x2_sample;
+		/* pick up next sample as input_x2_sample: */
+		susp->input_ptr++;
+		susp_took(input_cnt, 1);
+		input_pHaSe_ReG -= 1.0;
+		susp_check_term_log_samples_break(input, input_ptr, input_cnt, input_x2_sample);
+	    }
+*out_ptr_reg++ = (sample_type) 
+		(input_x1_sample_reg * (1 - input_pHaSe_ReG) + input_x2_sample * input_pHaSe_ReG);
+	    input_pHaSe_ReG += input_pHaSe_iNcR_rEg;
+	} while (--n); /* inner loop */
+
+	togo -= n;
+	susp->input_pHaSe = input_pHaSe_ReG;
+	susp->input_x1_sample = input_x1_sample_reg;
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* up_i_fetch */
+
+
+void up_r_fetch(register up_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    sample_type input_DeLtA;
+    sample_type input_val;
+    sample_type input_x2_sample;
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    falloc_sample_block(out, "up_r_fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    /* make sure sounds are primed with first values */
+    if (!susp->started) {
+	susp->started = true;
+	susp->input_pHaSe = 1.0;
+    }
+
+    susp_check_term_log_samples(input, input_ptr, input_cnt);
+    input_x2_sample = susp_current_sample(input, input_ptr);
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* grab next input_x2_sample when phase goes past 1.0; */
+	/* we use input_n (computed below) to avoid roundoff errors: */
+	if (susp->input_n <= 0) {
+	    susp->input_x1_sample = input_x2_sample;
+	    susp->input_ptr++;
+	    susp_took(input_cnt, 1);
+	    susp->input_pHaSe -= 1.0;
+	    susp_check_term_log_samples(input, input_ptr, input_cnt);
+	    input_x2_sample = susp_current_sample(input, input_ptr);
+	    /* input_n gets number of samples before phase exceeds 1.0: */
+	    susp->input_n = (long) ((1.0 - susp->input_pHaSe) *
+					susp->output_per_input);
+	}
+	togo = min(togo, susp->input_n);
+	input_DeLtA = (sample_type) ((input_x2_sample - susp->input_x1_sample) * susp->input_pHaSe_iNcR);
+	input_val = (sample_type) (susp->input_x1_sample * (1.0 - susp->input_pHaSe) +
+		 input_x2_sample * susp->input_pHaSe);
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+
+	/* don't run past logical stop time */
+	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+	    /* break if to_stop == 0 (we're at the logical stop)
+	     * AND cnt > 0 (we're not at the beginning of the
+	     * output block).
+	     */
+	    if (to_stop < togo) {
+		if (to_stop == 0) {
+		    if (cnt) {
+			togo = 0;
+			break;
+		    } else /* keep togo as is: since cnt == 0, we
+		            * can set the logical stop flag on this
+		            * output block
+		            */
+			susp->logically_stopped = true;
+		} else /* limit togo so we can start a new
+		        * block at the LST
+		        */
+		    togo = to_stop;
+	    }
+	}
+
+	n = togo;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) input_val;
+	    input_val += input_DeLtA;
+	} while (--n); /* inner loop */
+
+	out_ptr += togo;
+	susp->input_pHaSe += togo * susp->input_pHaSe_iNcR;
+	susp->input_n -= togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+    /* test for logical stop */
+    if (susp->logically_stopped) {
+	snd_list->logically_stopped = true;
+    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+	susp->logically_stopped = true;
+    }
+} /* up_r_fetch */
+
+
+void up_toss_fetch(susp, snd_list)
+  register up_susp_type susp;
+  snd_list_type snd_list;
+{
+    long final_count = susp->susp.toss_cnt;
+    time_type final_time = susp->susp.t0;
+    long n;
+
+    /* fetch samples from input up to final_time for this block of zeros */
+    while ((round((final_time - susp->input->t0) * susp->input->sr)) >=
+	   susp->input->current)
+	susp_get_samples(input, input_ptr, input_cnt);
+    /* convert to normal processing when we hit final_count */
+    /* we want each signal positioned at final_time */
+    n = round((final_time - susp->input->t0) * susp->input->sr -
+         (susp->input->current - susp->input_cnt));
+    susp->input_ptr += n;
+    susp_took(input_cnt, n);
+    susp->susp.fetch = susp->susp.keep_fetch;
+    (*(susp->susp.fetch))(susp, snd_list);
+}
+
+
+void up_mark(up_susp_type susp)
+{
+    sound_xlmark(susp->input);
+}
+
+
+void up_free(up_susp_type susp)
+{
+    sound_unref(susp->input);
+    ffree_generic(susp, sizeof(up_susp_node), "up_free");
+}
+
+
+void up_print_tree(up_susp_type susp, int n)
+{
+    indent(n);
+    stdputstr("input:");
+    sound_print_tree_1(susp->input, n);
+}
+
+
+sound_type snd_make_up(rate_type sr, sound_type input)
+{
+    register up_susp_type susp;
+    /* sr specified as input parameter */
+    time_type t0 = input->t0;
+    int interp_desc = 0;
+    sample_type scale_factor = 1.0F;
+    time_type t0_min = t0;
+    /* combine scale factors of linear inputs (INPUT) */
+    scale_factor *= input->scale;
+    input->scale = 1.0F;
+
+    /* try to push scale_factor back to a low sr input */
+    if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; }
+
+    if (input->sr > sr) {
+        sound_unref(input);
+        xlfail("snd-up: output sample rate must be higher than input");
+    }
+    falloc_generic(susp, up_susp_node, "snd_make_up");
+
+    /* select a susp fn based on sample rates */
+    interp_desc = (interp_desc << 2) + interp_style(input, sr);
+    switch (interp_desc) {
+      case INTERP_n: susp->susp.fetch = up_n_fetch; break;
+      case INTERP_i: susp->susp.fetch = up_i_fetch; break;
+      case INTERP_r: susp->susp.fetch = up_r_fetch; break;
+      default: snd_badsr(); break;
+    }
+
+    susp->terminate_cnt = UNKNOWN;
+    /* handle unequal start times, if any */
+    if (t0 < input->t0) sound_prepend_zeros(input, t0);
+    /* minimum start time over all inputs: */
+    t0_min = min(input->t0, t0);
+    /* how many samples to toss before t0: */
+    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
+    if (susp->susp.toss_cnt > 0) {
+	susp->susp.keep_fetch = susp->susp.fetch;
+	susp->susp.fetch = up_toss_fetch;
+    }
+
+    /* initialize susp state */
+    susp->susp.free = up_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = up_mark;
+    susp->susp.print_tree = up_print_tree;
+    susp->susp.name = "up";
+    susp->logically_stopped = false;
+    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(input);
+    susp->started = false;
+    susp->susp.current = 0;
+    susp->input = input;
+    susp->input_cnt = 0;
+    susp->input_pHaSe = 0.0;
+    susp->input_pHaSe_iNcR = input->sr / sr;
+    susp->input_n = 0;
+    susp->output_per_input = sr / input->sr;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_up(rate_type sr, sound_type input)
+{
+    sound_type input_copy = sound_copy(input);
+    return snd_make_up(sr, input_copy);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/upsample.h b/lib-src/libnyquist/nyquist/tran/upsample.h
new file mode 100644
index 0000000..5629b15
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/upsample.h
@@ -0,0 +1,3 @@
+sound_type snd_make_up(rate_type sr, sound_type input);
+sound_type snd_up(rate_type sr, sound_type input);
+    /* LISP: (snd-up ANYNUM SOUND) */
diff --git a/lib-src/libnyquist/nyquist/tran/white.alg b/lib-src/libnyquist/nyquist/tran/white.alg
new file mode 100644
index 0000000..8fc3832
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/white.alg
@@ -0,0 +1,24 @@
+(WHITE-ALG
+(NAME "white")
+(ARGUMENTS ("time_type" "t0") ("rate_type" "sr") ("time_type" "d"))
+(STATE )
+(TERMINATE (AFTER "d"))
+(INNER-LOOP "output = (sample_type) (rand() * rand_scale - 1.0);")
+(SAMPLE-RATE "sr")
+(SUPPORT-HEADER "
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03 rbd all systems now use rand(), based on DM's modifications
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+/* rand returns from 0 to RAND_MAX. Scale and offset
+ * to get range from -1 to +1
+ */
+#define rand_scale (2.0/RAND_MAX)
+
+")
+)
+
diff --git a/lib-src/libnyquist/nyquist/tran/white.c b/lib-src/libnyquist/nyquist/tran/white.c
new file mode 100644
index 0000000..a411562
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/white.c
@@ -0,0 +1,104 @@
+#include "stdio.h"
+#ifndef mips
+#include "stdlib.h"
+#endif
+#include "xlisp.h"
+#include "sound.h"
+
+#include "falloc.h"
+#include "cext.h"
+#include "white.h"
+
+void white_free();
+
+
+typedef struct white_susp_struct {
+    snd_susp_node susp;
+    long terminate_cnt;
+} white_susp_node, *white_susp_type;
+
+
+void white__fetch(register white_susp_type susp, snd_list_type snd_list)
+{
+    int cnt = 0; /* how many samples computed */
+    int togo;
+    int n;
+    sample_block_type out;
+    register sample_block_values_type out_ptr;
+
+    register sample_block_values_type out_ptr_reg;
+
+    falloc_sample_block(out, "white__fetch");
+    out_ptr = out->samples;
+    snd_list->block = out;
+
+    while (cnt < max_sample_block_len) { /* outer loop */
+	/* first compute how many samples to generate in inner loop: */
+	/* don't overflow the output sample block: */
+	togo = max_sample_block_len - cnt;
+
+	/* don't run past terminate time */
+	if (susp->terminate_cnt != UNKNOWN &&
+	    susp->terminate_cnt <= susp->susp.current + cnt + togo) {
+	    togo = susp->terminate_cnt - (susp->susp.current + cnt);
+	    if (togo == 0) break;
+	}
+
+	n = togo;
+	out_ptr_reg = out_ptr;
+	if (n) do { /* the inner sample computation loop */
+*out_ptr_reg++ = (sample_type) (rand() * rand_scale - 1.0);;
+	} while (--n); /* inner loop */
+
+	out_ptr += togo;
+	cnt += togo;
+    } /* outer loop */
+
+    /* test for termination */
+    if (togo == 0 && cnt == 0) {
+	snd_list_terminate(snd_list);
+    } else {
+	snd_list->block_len = cnt;
+	susp->susp.current += cnt;
+    }
+} /* white__fetch */
+
+
+void white_free(white_susp_type susp)
+{
+    ffree_generic(susp, sizeof(white_susp_node), "white_free");
+}
+
+
+void white_print_tree(white_susp_type susp, int n)
+{
+}
+
+
+sound_type snd_make_white(time_type t0, rate_type sr, time_type d)
+{
+    register white_susp_type susp;
+    /* sr specified as input parameter */
+    /* t0 specified as input parameter */
+    sample_type scale_factor = 1.0F;
+    falloc_generic(susp, white_susp_node, "snd_make_white");
+    susp->susp.fetch = white__fetch;
+
+    susp->terminate_cnt = round((d) * sr);
+    /* initialize susp state */
+    susp->susp.free = white_free;
+    susp->susp.sr = sr;
+    susp->susp.t0 = t0;
+    susp->susp.mark = NULL;
+    susp->susp.print_tree = white_print_tree;
+    susp->susp.name = "white";
+    susp->susp.log_stop_cnt = UNKNOWN;
+    susp->susp.current = 0;
+    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);
+}
+
+
+sound_type snd_white(time_type t0, rate_type sr, time_type d)
+{
+    return snd_make_white(t0, sr, d);
+}
diff --git a/lib-src/libnyquist/nyquist/tran/white.h b/lib-src/libnyquist/nyquist/tran/white.h
new file mode 100644
index 0000000..953a54d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/white.h
@@ -0,0 +1,17 @@
+sound_type snd_make_white(time_type t0, rate_type sr, time_type d);
+sound_type snd_white(time_type t0, rate_type sr, time_type d);
+    /* LISP: (snd-white ANYNUM ANYNUM ANYNUM) */
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03 rbd all systems now use rand(), based on DM's modifications
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+/* rand returns from 0 to RAND_MAX. Scale and offset
+ * to get range from -1 to +1
+ */
+#define rand_scale (2.0/RAND_MAX)
+
diff --git a/lib-src/libnyquist/nyquist/tran/writemake.lsp b/lib-src/libnyquist/nyquist/tran/writemake.lsp
new file mode 100644
index 0000000..52468c5
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/writemake.lsp
@@ -0,0 +1,934 @@
+;;************
+;; writemake.lsp -- generate the sound create routine
+;;************
+;;************
+;;           Change Log
+;;  Date     | Change
+;;-----------+--------------------
+;; 17-Dec-91 | [1.1] <jmn> Created
+;; 17-Dec-91 | [1.1] <jmn> return sound_create(...) cast type to correct
+;;           | type
+;; 21-Dec-91 | [1.2] <jmn> added start-time, default 0.0
+;; 21-Dec-91 | [1.2] <jmn> prefix creation local variables with C_
+;; 13-Jan-92 | [1.2] <jmn> reformatted and recommented
+;;  3-May-99 | <rbd> modified toss_fetch code to retain proper t0
+;;************
+
+
+
+;; check-for-no-interpolation - if you see an "s", make sure there
+;;     is a corresponding "n", if not use "s" to cover the "n" case. And vice versa.
+;; 
+(defun check-for-no-interpolation (encoding interpolation-rationale stream)
+  ; *cfni-output* used to keep track of newline output
+  (setf *cfni-output* nil)
+  (check-for-no-interpolation-1 encoding 0 interpolation-rationale stream))
+
+;; Hint: this algorithm constructs the 2^n variations by substituting
+;; (or not) 'n' for 's' whereever s'es occur.  The search is cut off
+;; however, when an altered string is found in the encoding-list, which
+;; tells what cases are handled directly.
+;;
+;; Wow, returning to the description above after several months, I couldn't make 
+;; heads or tails of it, and I wrote it!  Here's another perhaps better, description:
+;; 
+;; We generated various _fetch routines that differ in their assumptions about how to
+;; access signal arguments.  There are (now) 4 variations: NONE, SCALE, INTERP, and
+;; RAMP.  All 4^N combinations of these are generated initially, but many combinations
+;; are deleted before any code is generated.  Reasons for removing a combination include
+;; the use of symetry, linearity, and simply the promise that input arguments will be
+;; interpolated externally.  In most of these cases, combinations are removed because
+;; they cannot occur in practice.  But in others, combinations are removed because they
+;; should be handled by different code.  For example, an input signal matching the output 
+;; sample rate and with a scale factor of 1 is normally handled by NONE style 
+;; "interpolation".  Note: "interpolation" is used throughout this code, but a better term
+;; would be "access method," because no interpolation is involved in the NONE and
+;; SCALE variants. The inner loop access code for NONE style is something like "*s++".  
+;; However, an input signal suitable for NONE style interpolation can also be handled
+;; by SCALE style interpolation (which looks something like "(*s++ * s_scale)", i.e.
+;; an extra multiplication is required.  If the attribute INTERNAL-SCALING is used,
+;; then the scale factor does not actually appear at the access point because it has been
+;; factored into a filter coefficient or some other factor, saving the multiply.  
+;; Alternatively, the ALWAYS-SCALE attribute can specify that there is little to be
+;; gained by saving a multiply.  In these cases, we want to handle NONE style signals
+;; with SCALE style interpolation.  Let's run through these possibilities again and
+;; describe how they are handled:
+;;
+;; ALWAYS-SCALE: here we delete the NONE variant(s) and only generate fetch
+;; routines that have scaling code in them.  When we get an actual parameter with
+;; a scale factor of 1 (implying NONE interpolation), we handle it with the SCALE
+;; fetch routine.
+;; INTERNAL-SCALING: here we generate NONE fetch routines because the
+;; scale factor is taken care of elsewhere in the code, e.g. in a filter coefficient.
+;; LINEAR: here, the scale factor of the actual argument becomes a scale factor
+;; on the output (part of the data structure), deferring multiplies until later.  We
+;; then modify the argument scale factor to 1, and NONE style interpolation applies.
+;; There is no need to generate SCALE style routines, because there will never be
+;; any need for them.
+;;
+;; For a given signal parameter, these 3 cases are mutually exclusive.
+;;
+;; Looking at these three cases, we see that sometimes there will be SCALE style
+;; routines handling NONE arguments, sometimes NONE style routines handling
+;; SCALE arguments, and sometimes NONE style routines because there will
+;; never be a need for SCALE.  
+;; This code is going to generate labels so that other fetch routines 
+;; handle the "missing" ones.
+;; To do this, we generate extra labels in the case
+;; statement that selects the fetch routine (interpolation is in the inner loop in the
+;; fetch routine.  For example, we might generate this code:
+;; ...
+;;  case INTERP_nn:
+;;  case INTERP_sn:
+;;  case INTERP_ns:
+;;  case INTERP_ss: susp->susp.fetch = tonev_ss_fetch; break;
+;; ...
+;; Here, a single fetch routine (tonev_ss_fetch) handles all variations of NONE and
+;; SCALE (n and s) types of the two signal arguments.  The basic rule is: if you did not
+;; generate a fetch routine for the NONE case, then handle it with the SCALE case, and
+;; if you did not generate a fetch routine for the SCALE case, handle it with the NONE
+;; case.
+;; 
+;; The algorithm uses the list interpolation-rationale, which lists for each sound
+;; parameter one of {NIL, LINEAR, ALWAYS-SCALE, INTERNAL-SCALING}.
+;; Using this list, the code enumerates all the possible cases that might be handled
+;; by the current fetch routine (represented by the "encoding" parameter).  
+;; This is a recursive algorithm because, if there are n SCALE type parameters, then
+;; there are 2^N possible variations to enumerate.  (E.g. look at the 4 variations in
+;; the code example above.)
+;;
+;;
+(defun check-for-no-interpolation-1 (encoding index 
+                                     interpolation-rationale stream)
+  (cond ((= index (length encoding))
+         (display "check-for-no-interpolation output" encoding)
+         ; see if we need a newline (*cfni-output* is initially nil)
+         (if *cfni-output* (format stream "/* handled below */~%"))
+         (setf *cfni-output* t)
+         (format stream "      case INTERP_~A: " encoding))
+        (t
+         (let ((ch (char encoding index)))
+           (display "cfni" index ch)
+           (cond ((eql ch #\s)
+                  (let ((new-encoding (strcat (subseq encoding 0 index)
+                                              "n"
+                                              (subseq encoding (1+ index)))))
+                    (cond ((eq (nth index interpolation-rationale) 'ALWAYS-SCALE)
+                           (check-for-no-interpolation-1 new-encoding (1+ index)
+                                interpolation-rationale stream)))))
+                 ((eql ch #\n)
+                  (let ((new-encoding (strcat (subseq encoding 0 index)
+                                              "s"
+                                              (subseq encoding (1+ index)))))
+                    (cond ((eq (nth index interpolation-rationale) 'INTERNAL-SCALING)
+                           (check-for-no-interpolation-1 new-encoding (1+ index)
+                                interpolation-rationale stream))))))
+           (check-for-no-interpolation-1 encoding (1+ index)
+                interpolation-rationale stream)))))
+                              
+;;************
+;; is-argument -- see if string is in argument list
+;;
+;;************
+
+(defun is-argument (arg arguments)
+  (dolist (a arguments)
+    (cond ((equal arg (cadr a)) (return t)))))
+
+
+
+;; needs-mark-routine -- is there anything for GC to mark here?
+;;
+(defun needs-mark-routine (alg)
+  (or (get-slot alg 'sound-names)
+      (get-slot alg 'xlisp-pointers)))
+
+
+;; lsc-needed-p -- see if we need the lsc variable declared
+(defun lsc-needed-p (alg)
+  (let ((spec (get-slot alg 'logical-stop)))
+    (and spec (listp (car spec))
+                  (eq (caar spec) 'MIN)
+              (cdar spec)
+              (cddar spec))))
+
+
+;; write-initial-logical-stop-cnt -- writes part of snd_make_<name>
+;;
+(defun write-initial-logical-stop-cnt (alg stream)
+  (let ((spec (get-slot alg 'logical-stop))
+        min-list)
+    (cond ((and spec (listp (car spec))
+                    (eq (caar spec) 'MIN)
+                (cdar spec))
+           (setf min-list (cdar spec))
+           ; take stop_cnt from first argument in MIN list
+           (format stream
+            "    susp->susp.log_stop_cnt = logical_stop_cnt_cvt(~A);\n"
+            (symbol-to-name (cadar spec)))
+           ; modify stop_cnt to be minimum over all remaining arguments
+           (dolist (sym (cddar spec))
+             (let ((name (symbol-to-name sym)))
+               (format stream
+                "    lsc = logical_stop_cnt_cvt(~A);\n" name)
+               (format stream
+                "    if (susp->susp.log_stop_cnt > lsc)\n"
+                name)
+               (format stream
+                "        susp->susp.log_stop_cnt = lsc;\n"
+                name))))
+          (t
+           (format stream
+            "    susp->susp.log_stop_cnt = UNKNOWN;\n")))
+))
+
+
+;;************
+;;				  write-mark
+;;
+;; Inputs:
+;;	alg - algorithm description
+;;	stream - stream on which to write .c file
+;; Effect:
+;;	writes NAME_mark(...)
+;;************
+
+(defun write-mark (alg stream)
+  (let ((name (get-slot alg 'name))
+        (sound-names (get-slot alg 'sound-names))
+        (xlisp-pointers (get-slot alg 'xlisp-pointers)))
+    ;----------------
+    ; void NAME_mark(NAME_susp_type susp)
+    ; {
+    ; *WATCH*: printf("NAME_mark(%x)\n", susp);
+    ;----------------
+    (format stream "~%~%void ~A_mark(~A_susp_type susp)~%{~%" name name)
+    (if *WATCH*
+      (format stream
+       "    printf(\"~A_mark(%x)\\n\", susp);~%" name))
+
+    ;----------------
+    ; for each LVAL argument:
+    ;
+    ; if (susp->NAME) mark(susp->NAME);
+    ;----------------
+    (dolist (name xlisp-pointers)
+            (format stream "    if (susp->~A) mark(susp->~A);~%" name name))
+
+    ;----------------
+    ; for each sound argument:
+    ;
+    ; *WATCH*: printf("marking SND@%x in NAME@%x\n", susp->snd, susp);
+    ; sound_xlmark(susp->NAME);
+    ;----------------
+    (dolist (snd sound-names)
+            (if *watch*
+              (format stream
+               "    printf(\"marking ~A@%x in ~A@%x\\n\", susp->~A, susp);~%"
+               snd name snd))
+            (format stream "    sound_xlmark(susp->~A);~%" snd))
+
+    ;----------------
+    ; }
+    ;----------------
+    (format stream "}~%")))
+
+(print 'write-mark)
+
+;;************
+;;				  write-make
+;;
+;; Inputs:
+;;	alg - algorithm description
+;;	stream - stream on which to write .c file
+;; Effect:
+;;	writes NAME_free(...), NAME_print_tree,  and snd_make_NAME(...)
+;;************
+
+(defun write-make (alg stream)
+  (let ((name (get-slot alg 'name))
+        (sr (get-slot alg 'sample-rate))
+        (else-prefix "")
+        first-time
+        (sound-names (get-slot alg 'sound-names))
+        (logical-stop (car (get-slot alg 'logical-stop)))
+        (sound-to-name (get-slot alg 'sound-to-name))
+        (state-list (get-slot alg 'state))
+        (linear (get-slot alg 'linear))
+        (arguments (get-slot alg 'arguments))
+        (finalization (get-slot alg 'finalization))
+        (interpolation-list (get-slot alg 'interpolation-list))
+        (interpolation-rationale (get-slot alg 'interpolation-rationale))
+        encoding-list
+        (terminate (car (get-slot alg 'terminate)))
+        (type-check (car (get-slot alg 'type-check)))
+        (delay (get-slot alg 'delay))
+        (start (get-slot alg 'start)))
+
+    ;--------------------
+    ; void NAME_free(NAME_susp_type susp)
+    ; {
+    ;----------------
+    (format stream "~%~%void ~A_free(~A_susp_type susp)~%{~%"
+            name name)
+
+    ;----------------
+    ; if there's a finalization, do it
+    ;----------------
+    (if finalization (print-strings finalization stream))
+
+    ;----------------
+    ; for each sound argument:
+    ;
+    ; sound_unref(susp->NAME);
+    ;----------------
+    (dolist (name sound-names)
+      (format stream "    sound_unref(susp->~A);~%" name))
+
+    ;----------------
+    ;     ffree_generic(susp, sizeof(NAME_susp_node), "fn-name");
+    ; }
+    ;--------------------
+    (format stream 
+            "    ffree_generic(susp, sizeof(~A_susp_node), \"~A_free\");~%}~%"
+            name name)
+
+    ;--------------------
+    ; void NAME_print_tree(NAME_susp_type susp, int n)
+    ; {
+    ;----------------
+    (format stream "~%~%void ~A_print_tree(~A_susp_type susp, int n)~%{~%"
+            name name)
+    ;----------------
+    ; for each sound argument:
+    ;
+    ; indent(n);
+    ; printf("NAME:");
+    ; sound_print_tree_1(susp->NAME, n);
+    ;----------------
+    (setf first-time t)
+    (dolist (name sound-names)
+      (cond (first-time
+             (setf first-time nil))
+            (t  ; space between each iteration
+             (format stream "~%")))
+      (format stream "    indent(n);~%    stdputstr(\"~A:\");~%" name)
+      (format stream "    sound_print_tree_1(susp->~A, n);~%" name))
+
+    ;----------------
+    ; }
+    ;--------------------
+    (format stream "}~%")
+
+    ;--------------------
+    ;   sound_type snd_make_NAME
+    ;--------------------
+
+    (format stream "~%~%sound_type snd_make_~A" name)
+
+    ;--------------------
+    ;    ( type name, ...)
+    ;--------------------
+
+    (write-ansi-parameter-list stream "" arguments)
+    (format stream "~%")
+    (if (not *ANSI*)
+        (dolist (arg arguments)
+          (format stream "  ~A ~A;~%" (car arg) (cadr arg))))
+
+    ;--------------------
+    ;     NAME_susp_type susp;
+    ;--------------------
+    (format stream 
+     "{~%    register ~A_susp_type susp;~%" name);
+
+    ;; declare "state" variables with TEMP flag
+    ;--------------------
+    ;     <type[i]> <name[i]>;
+    ;--------------------
+    (dolist (state state-list)
+      (cond ((and (cdddr state)
+                  (cadddr state)
+                  (eq (cadddr state) 'TEMP))
+             (format stream "    ~A ~A;~%" 
+                (car state) (cadr state)))))
+
+    (write-sample-rate stream sr sound-names arguments)
+
+    ; compute the t0 for new signal (default: use zero): 
+    ;
+    (write-start-time stream start arguments)
+
+    ;--------------------
+    ;    int interp_desc = 0;
+    ;--------------------
+    (cond (interpolation-list
+           (format stream "    int interp_desc = 0;~%")))
+
+    ;--------------------
+    ;     sample_type scale_factor = 1.0F;
+    ;  time_type t0_min; -- but only if there are sound args, implied by non-null sound-names
+    ;  long lsc;  
+    ;--------------------
+    (format stream "    sample_type scale_factor = 1.0F;~%")
+    (if sound-names (format stream "    time_type t0_min = t0;~%"))
+    (if (lsc-needed-p alg)
+        (format stream "    long lsc;~%"))
+
+    ; now do canonical ordering of commutable sounds
+    ;
+    (dolist (lis (get-slot alg 'commutative))
+      ;--------------------
+      ;   /* sort commuative signals: s1 s2 ... */
+      ;   snd_sort_<n>
+      ;         (...)
+      ;--------------------
+      (format stream "    /* sort commutative signals: ~A */~%" lis)
+      (format stream "    snd_sort_~A" (length lis))
+      (write-parameter-list stream ""
+        (append (mapcar 
+                  '(lambda (snd) 
+                    (strcat "&" (cdr (assoc snd sound-to-name))))
+                  lis)
+                '("sr")))
+      (format stream ";~%~%"))
+
+    ; figure scale factor -- if signal is linear wrt some interpolated or
+    ;   ramped signal (which do the multiply anyway), then put the scale
+    ;   factor there.
+    ;--------------------
+    ;  /* combine scale factors of linear inputs <linear> */
+    ;--------------------
+
+    (cond (linear
+           (format stream 
+            "    /* combine scale factors of linear inputs ~A */~%" linear)))
+    ;--------------------
+    ;  scale_factor *= NAME ->scale;
+    ;  NAME ->scale = 1.0F;
+    ;--------------------
+
+    (dolist (snd linear)
+      (let ((name (cdr (assoc snd sound-to-name))))
+        (format stream "    scale_factor *= ~A->scale;~%" name)
+        (format stream "    ~A->scale = 1.0F;~%" name)))
+
+    ;--------------------
+    ;  /* try to push scale_factor back to a low sr input */
+    ;--------------------
+
+    (cond (linear
+           (format stream 
+            "~%    /* try to push scale_factor back to a low sr input */~%")))
+
+    ;--------------------
+    ; if (NAME ->sr < sr) {
+    ;     NAME ->scale = scale_factor; scale_factor = 1.0F; }
+    ;--------------------
+
+    (dolist (snd linear)
+      (let ((name (cdr (assoc snd sound-to-name))))
+        (format stream 
+"    ~Aif (~A->sr < sr) { ~A->scale = scale_factor; scale_factor = 1.0F; }~%"
+         else-prefix name name)
+        (setf else-prefix "else ")))
+    (if linear (format stream "~%"))
+
+    ;-------------------
+    ; insert TYPE-CHECK code here
+    ;-------------------
+    (display "write-make" type-check)
+    (if type-check
+      (format stream type-check))
+
+    ;--------------------
+    ; falloc_generic(susp, NAME_susp_node, "fn-name"); 
+    ;--------------------
+    (format stream 
+     "    falloc_generic(susp, ~A_susp_node, \"snd_make_~A\");~%" name name)
+
+    ;; initialize state: the state list has (type field initialization [temp])
+    ;--------------------
+    ;    susp-> <state[i]> = <value[i]>
+    ;--------------------
+    ;; if TEMP is present, generate:
+    ;--------------------
+    ;    <state[i]> = <value[i]>
+    ;--------------------
+
+    (dolist (state state-list)
+      (let ((prefix "susp->"))
+        (cond ((and (cdddr state)
+                    (cadddr state)
+                    (eq (cadddr state) 'TEMP))
+               (setf prefix "")))
+        (format stream "    ~A~A = ~A;~%" 
+                prefix (cadr state) (caddr state))))
+
+    ; if we have a choice of implementations, select one
+    (cond ((< 1 (length interpolation-list))
+
+           ;--------------------
+           ; /* select a susp fn based on sample rates */
+           ;--------------------
+           ; build a descriptor
+           (format stream 
+                "~%    /* select a susp fn based on sample rates */~%")
+
+           ;------------------------
+           ;  interp_desc = (interp_desc << 2) + interp_style( NAME, sr);
+           ;------------------------
+           (dolist (snd sound-names)
+             (format stream
+              "    interp_desc = (interp_desc << 2) + interp_style(~A, sr);~%"
+              snd))
+
+           ;--------------------
+           ;     switch (interp_desc) {
+           ;--------------------
+           (cond (interpolation-list
+                  (format stream "    switch (interp_desc) {~%")))
+
+           ;--------------------------
+           ;         case INTERP_<encoding>: susp->susp.fetch = 
+           ;                                 NAME_<encoding>_fetch; break;
+           ;--------------------------
+           (setf encoding-list (mapcar #'encode interpolation-list))
+           (dolist (encoding encoding-list)
+             (check-for-no-interpolation encoding interpolation-rationale stream)
+             (format stream "susp->susp.fetch = ~A_~A_fetch; break;~%"
+              name encoding))
+           ;--------------------------
+           ;     default: snd_badsr(); break;
+           ;--------------------------
+           (format stream "      default: snd_badsr(); break;~%")
+           ;--------------------
+           ;        } /* initialize susp state */
+           ;-------------------------
+           (format stream "    }~%~%"))
+          (interpolation-list
+           (format stream "    susp->susp.fetch = ~A_~A_fetch;~%" 
+            name (encode (car interpolation-list))))
+          (t
+        ;-------------------------
+        ;   susp->susp.fetch = NAME__fetch;
+        ;-------------------------
+           (format stream "    susp->susp.fetch = ~A__fetch;~%~%" name)))
+ 
+    ;----------------
+    ; /* compute terminate count */
+    ;----------------
+    (cond ((terminate-check-needed terminate alg)
+           (cond ((eq (car terminate) 'AT)
+                  (let ((time-expr (cadr terminate)))
+        ;----------------
+        ; susp->terminate_cnt = round(((TIME-EXPR) - t0) * sr);
+        ;----------------
+                    (format stream 
+                     "    susp->terminate_cnt = round(((~A) - t0) * sr);~%"
+                            time-expr)))
+                 ((eq (car terminate) 'AFTER)
+                  (let ((dur-expr (cadr terminate)))
+                    ;----------------
+                    ; susp->terminate_cnt = round((DUR-EXPR) * sr);
+                    ;----------------
+                    (format stream 
+                            "    susp->terminate_cnt = round((~A) * sr);~%"
+                            dur-expr)))
+                 (t
+                  ;----------------
+                  ; susp->terminate_cnt = UNKNOWN;
+                  ;----------------
+                  (format stream "    susp->terminate_cnt = UNKNOWN;~%")))))
+
+    ;----------------
+    ;    /* handle unequal start times, if any */
+    ;----------------
+    (if sound-names
+      (format stream "    /* handle unequal start times, if any */~%"))
+    ;----------------
+    ; for each sound argument:
+    ;    if (t0 < NAME->t0) sound_prepend_zeros(NAME, t0);
+    ;----------------
+    (dolist (name sound-names)
+      (format stream 
+       "    if (t0 < ~A->t0) sound_prepend_zeros(~A, t0);~%" name name))
+    ;----------------
+    ; t0_min = min(NAME1->t0, min(NAME2->t0, ... NAMEn->t0, t0)...);
+    ;----------------
+    (cond (sound-names
+           (format stream "    /* minimum start time over all inputs: */~%")
+           (format stream "    t0_min = ")
+           (dolist (name sound-names)
+             (format stream "min(~A->t0, " name))
+           (format stream "t0")
+           (dolist (name sound-names)
+             (format stream ")"))
+           (format stream ";~%")))
+
+    ;----------------
+    ;    /* how many samples to toss before t0: */
+    ;    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + <DELAY>.5);
+    ;    if (susp->susp.toss_cnt > 0) {
+    ;	susp->susp.keep_fetch = susp->susp.fetch;
+    ;	susp->susp.fetch = NAME_toss_fetch;
+    ;	t0 = t0_min; -- DELETED 3MAY99 by RBD
+    ;    }
+    ;----------------
+    (cond (sound-names
+           (format stream "    /* how many samples to toss before t0: */\n")
+           (if delay
+             (format stream "    /* Toss an extra ~A samples to make up for internal buffering: */\n" delay))
+           (format stream "    susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + ~A.5);\n"
+                   (if delay delay 0))
+           (format stream "    if (susp->susp.toss_cnt > 0) {\n")
+           (format stream "\tsusp->susp.keep_fetch = susp->susp.fetch;\n")
+           (format stream "\tsusp->susp.fetch = ~A_toss_fetch;~%" name)
+;	   (format stream "\tt0 = t0_min;~%    }\n\n")))
+           (format stream "    }\n\n")))
+
+    ;--------------------
+    ; /* initialize susp state */
+    ; susp->susp.free = NAME_free;
+    ; susp->susp.sr = sr;
+    ; susp->susp.t0 = t0;
+    ;--------------------
+    (format stream "    /* initialize susp state */~%")
+    (format stream "    susp->susp.free = ~A_free;~%" name)
+    (format stream "    susp->susp.sr = sr;~%")
+    (format stream "    susp->susp.t0 = t0;~%")
+
+    ;----------------
+    ; if there are sound arguments:
+    ;     susp->susp.mark = NAME_mark;
+    ; otherwise...
+    ;     susp->susp.mark = NULL;
+    ;----------------
+    (let ((value "NULL"))
+      (cond ((needs-mark-routine alg)
+             (setf value (strcat name "_mark"))))
+      (format stream "    susp->susp.mark = ~A;~%" value))
+
+    ;----------------
+    ; for debugging...
+    ;    susp->susp.print_tree = NAME_print_tree;
+    ;    susp->susp.name = "NAME";
+    ;----------------
+    (format stream "    susp->susp.print_tree = ~A_print_tree;~%" name)
+    (format stream "    susp->susp.name = \"~A\";~%" name)
+
+    ;----------------
+    ; if there is a logical stop attribute:
+    ; susp->logically_stopped = false;
+    ; susp->susp.log_stop_cnt = UNKNOWN;
+    ;----------------
+    (cond ((logical-stop-check-needed logical-stop)
+           (format stream 
+            "    susp->logically_stopped = false;\n")))
+    (write-initial-logical-stop-cnt alg stream)
+
+    ;--------------------
+    ; ramped or interpolated:
+    ;
+    ;	susp->started = false;
+    ;--------------------
+    (cond ((any-ramp-or-interp-in interpolation-list)
+           (format stream "    susp->started = false;~%")))
+
+    ;--------------------
+    ;	susp->susp.current = 0;
+    ;--------------------
+    (format stream "    susp->susp.current = 0;~%")
+
+    ;----------------------------
+    ; For each sound arg:
+    ;
+    ;     susp-> <arg> = <arg>;
+    ;     susp-> <arg>_cnt = 0;
+    ;----------------------------
+
+    (dotimes (n (length (get alg 'sound-args)))
+      (let ((interpolation (union-of-nth interpolation-list n)))
+        (setf arg (nth n sound-names))	; get name of signal
+        (format stream "    susp->~A = ~A;~%" arg arg)
+        (format stream "    susp->~A_cnt = 0;~%" arg)
+        ;-----------------------------------------------
+        ; Interpolation: 
+        ;
+        ;	  susp-> <arg>_pHaSe = 0.0;               
+        ;         susp-> <arg>_pHaSe_iNcR = <arg> ->sr    
+        ;-----------------------------------------------
+        (cond ((member 'INTERP interpolation)
+               (format stream "    susp->~A_pHaSe = 0.0;~%" arg)
+               (format stream "    susp->~A_pHaSe_iNcR = ~A->sr / sr;~%"
+                              arg arg)))
+        ;-----------------------------------------------
+        ; Ramp: 
+        ;
+        ;    susp->output_per_<arg> = <arg> ->sr;
+        ;-----------------------------------------------
+
+        (cond ((member 'RAMP interpolation)
+               (format stream "    susp->~A_n = 0;~%" arg)
+               (format stream "    susp->output_per_~A = sr / ~A->sr;~%"
+                              arg arg)))))
+    
+    ;----------------------------
+    ;   return sound_create (snd_susp_type)susp, t0, sr, scale_factor);
+    ;----------------------------
+
+    (format stream 
+     "    return sound_create((snd_susp_type)susp, t0, sr, scale_factor);~%}~%")))
+
+
+(print 'write-make)
+
+;;************
+;; write-parameter-list -- with comma separator, open and close parens
+;;
+;;************
+
+(defun write-parameter-list (stream prefix strings)
+  (let ((comma ""))
+    (format stream "(")
+    (dolist (parm strings)
+      (format stream "~A~A~A" comma prefix parm)
+      (setf comma ", "))
+    (format stream ")")))
+
+;;************
+;; write-ansi-prototype-list -- with comma separator, open and close parens
+;;
+;; Inputs:
+;;	stream - output stream
+;;	prefix - arg prefix, perhaps ""
+;;	args - argument type/name pairs of the form
+;;		( (type1 name1) (type2 name2) ... )
+;; Effect:
+;;	if *ANSI* is set T, writes ANSI-style parameter list of the form
+;;		type name, ...
+;;	if *ANSI* is set NIL, writes antique-style parameter list of the form
+;;		()
+;;************
+
+(defun write-ansi-prototype-list (stream prefix args)
+  (let ((comma ""))
+    (format stream "(")
+    (if *ANSI*
+       (dolist (parm args)
+          ;--------------------
+          ; for each parameter
+          ;	<comma>type <prefix><parm>
+          ;--------------------
+          (format stream "~A~A ~A~A" comma (car parm) prefix (cadr parm))
+          (setf comma ", "))
+    )
+    (format stream ")")))
+
+;;************
+;;			   write-ansi-parameter-list
+;;
+;; Inputs:
+;;	stream - output stream
+;;	prefix - arg prefix, perhaps ""
+;;	args - argument type/name pairs of the form
+;;		( (type1 name1) (type2 name2) ... )
+;; Effect:
+;;	if *ANSI* is set T, writes ANSI-style parameter list of the form
+;;		(type name, ...)
+;;	if *ANSI* is set NIL, writes antique-style parameter list of the form
+;;		(name, ...)
+;; Note:
+;;  to get a space between types and arguments, a space is prepended to prefix if
+;; this is an *ANSI* arg list.
+;;************
+
+(defun write-ansi-parameter-list (stream prefix args)
+  (let ((comma ""))
+    (format stream "(")
+    (cond (*ANSI*
+           (setf prefix (strcat " " prefix))))
+    (dolist (parm args)
+            (format stream "~A~A~A~A" comma 
+                            (if *ANSI* (car parm) "")
+                        prefix (cadr parm))
+            (setf comma ", ")
+    )
+    (format stream ")")))
+
+;;************
+;;			       write-sample-rate
+;; Effect:
+;; 	declare sr and compute the sample rate for the new signal
+;; Notes:
+;;	If sr is an input parameter, it is not declared
+;;	If (SAMPLE-RATE expr) is specified, declare sr to be initialized
+;;	   to the expr
+;;	If (SAMPLE-RATE (MAX s1 s2 ...)), sr is initialized to the max.
+;;	Otherwise, sr is initialized to the max of the sample rates of
+;;	all the sound-type arguments	
+;;************
+
+(defun write-sample-rate (stream sr sound-names arguments)
+    ;; if sr is "sr" and "sr" is a parameter, then do nothing:
+
+    (display "write-sample-rate: " sr sound-names arguments)
+
+    (cond ( (and (equal sr "sr") (is-argument "sr" arguments))
+            ;---------------------
+            ;   /* sr specified as input parameter */
+            ;---------------------
+                (format stream "    /* sr specified as input parameter */~%")
+          )
+    ;; else if sample rate is specified, use it to initialize sr:
+          ((stringp sr)
+           (display "write-sample-rate: using specified sr" sr)
+            ;---------------------
+            ;   rate_type sr = <sr>;
+            ;---------------------
+           (format stream "    rate_type sr = ~A;~%" sr)
+          )
+    ;; else look for (MAX ...) expression
+          ((and (listp sr) (eq (car sr) 'MAX))
+           (format stream "    rate_type sr = ")
+           (write-redux-of-names stream "max" 
+                (mapcar #'symbol-to-name (cdr sr)) "->sr")
+           (format stream ";~%")
+          )
+    ;; else assume sr is max of sr's of all sound arguments
+          (sound-names
+            ;---------------------
+            ;   rate_type sr = max( <arg[0]> ->sr, <arg[i]> ->sr);
+            ;---------------------
+           (format stream "    rate_type sr = ")	; jmn
+           (write-redux-of-names stream "max" sound-names "->sr")
+           (format stream ";~%")
+          )
+           (t
+            (error "Missing SAMPLE-RATE specification."))
+    )
+)
+ 
+
+(defun write-redux-of-names (stream fn sound-names suffix)
+  (dotimes (n (1- (length sound-names)))
+           (format stream "~A(" fn))
+  (format stream "~A~A" (car sound-names) suffix)
+  (dolist (snd (cdr sound-names))
+          (format stream ", ~A~A)" snd suffix)))
+
+
+
+;;************
+;;			       write-start-time
+;; Effect:
+;; 	declare sr and compute the start time for the new signal
+;; Notes:
+;;	If t0 is an input parameter, it is not declared
+;;	If (START (AT expr)) is specified, declare t0 to be initialized
+;;	   to the expr
+;;	Otherwise, t0 is initialized to 0
+;;************
+
+(defun write-start-time (stream start arguments)
+  ;; if t0 is "t0" and "t0" is a parameter, then do nothing:
+  (display "write-start time:" start arguments)
+  (cond ((is-argument "t0" arguments)
+         ;---------------------
+         ;   /* t0 specified as input parameter */
+         ;---------------------
+             (format stream "    /* t0 specified as input parameter */~%"))
+    ;; else if start time is specified, use it to initialize sr:
+        (t (cond (start
+                  ;---------------
+                  ;   (START (AT <expr>)) specified:
+                  ;
+                  ;   time_type t0 = <expr>;
+                  ;---------------
+                  (setf start (car start))
+                  (cond ((eq (car start) 'AT)
+                         (format stream "    time_type t0 = ~A;~%" (cadr start)))
+                        ((eq (car start) 'MIN)
+                         (format stream "    time_type t0 = ")
+                         (write-redux-of-names stream "min" 
+                                               (c-names (cdr start)) "->t0")
+                         (format stream ";~%"))
+                        ((eq (car start) 'MAX)
+                         (format stream "    time_type t0 = ")
+                         (write-redux-of-names stream "max" 
+                                               (c-names (cdr start)) "->t0")
+                         (format stream ";~%"))
+                        (t (error (format nil
+                            "Unrecognized START specification ~A" start)))))
+                ;---------------
+                ;   time_type t0 = 0.0;
+                ;---------------
+                (t (format stream "    time_type t0 = 0.0;~%"))))))
+
+
+;; c-names -- get the C names corresponding to list of symbols
+;;
+(defun c-names (syms) (mapcar '(lambda (sym) (string-downcase (symbol-name sym))) syms))
+
+(defun is-table (alg snd)
+  (dolist (table (get-slot alg 'table))
+    (cond ((equal snd table)
+           (display "is-table" snd table)
+           (return t)))))
+
+ 
+;; write-xlmake -- write out a function snd_NAME to be called by xlisp
+;
+; this function copies any sound arguments and passes them on to snd_make_NAME
+;
+(defun write-xlmake (alg stream)
+  (let ((name (get-slot alg 'name))
+        (sound-names (get-slot alg 'sound-names))
+        (arguments (get-slot alg 'arguments))
+        comma)
+    ;--------------------
+    ;   sound_type snd_NAME
+    ;--------------------
+
+    (format stream "~%~%sound_type snd_~A" name)
+
+    ;--------------------
+    ;    ( type name, ...)
+    ;    {
+    ;--------------------
+
+    (write-ansi-parameter-list stream "" arguments)
+    (format stream "~%")
+    (if (not *ANSI*)
+        (dolist (arg arguments)
+          (format stream "  ~A ~A;~%" (car arg) (cadr arg))))
+    (format stream "{~%")
+
+    ;----------------
+    ; for each sound argument that is not a table
+    ;     sound_type SND_copy = sound_copy(SND);
+    ;----------------
+
+    (dolist (arg arguments)
+      (cond ((equal (car arg) "sound_type")
+             (let ((snd (cadr arg)))
+                (cond ((not (is-table alg snd))
+                       (format stream 
+                               "    sound_type ~A_copy = sound_copy(~A);~%"
+                               snd snd)))))))
+
+    ;----------------
+    ; now call snd_make_ALG. When SND is a sound_type that is not a table,
+    ;  substitute SND_copy for SND.
+    ;----------------
+
+    (format stream "    return snd_make_~A(" name)
+    (setf comma "")
+    (dolist (arg arguments)
+      (let ((suffix ""))
+        (cond ((and (equal (car arg) "sound_type")
+                    (not (is-table alg (cadr arg))))
+               (setf suffix "_copy")))
+        (format stream "~A~A~A" comma (cadr arg) suffix)
+        (setf comma ", ")))
+    (format stream ");~%}~%")))
diff --git a/lib-src/libnyquist/nyquist/tran/writesusp.lsp b/lib-src/libnyquist/nyquist/tran/writesusp.lsp
new file mode 100644
index 0000000..77595f6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/writesusp.lsp
@@ -0,0 +1,1025 @@
+;;************
+;;          Change Log
+;; Date     | Change
+;;----------+---------------------
+;; 17-Dec-91 | [1.1] <jmn> Created
+;; 17-Dec-91 | [1.1] <jmn> cast arg of snd_list_create to correct type
+;; 17-Dec-91 | [1.1] <jmn> cast truncation as (int) explicitly, avoid lint
+;;           | errors
+;; 13-Jan-92 | [1.2] <jmn> reformatted and recommented
+;;************
+
+;;****************
+;; depended-on-in-inner-loop - test if variables updated in inner loop
+;;****************
+(defun depended-on-in-inner-loop (vars interp sound-names step-function)
+  (dotimes (n (length interp))
+    (let ((method (nth n interp))
+          (name (nth n sound-names))
+          interpolate-samples)
+      (setf interpolate-samples
+            (not (member (name-to-symbol name) step-function)))
+      (cond ((and (or (member method '(NONE SCALE INTERP))
+                      interpolate-samples)
+                  (member name vars :test #'equal))
+             (return t))))))
+
+;;****************
+;; fixup-depends-prime - write code to update depend variables
+;; 	this code is only run the first time the suspension
+;;	is invoked
+;;****************
+(defun fixup-depends-prime (alg stream name indent var-name)
+  (let ((depends (get-slot alg 'depends)))
+    (dolist (dep depends)
+      (cond ((equal name (cadr dep))
+             (cond ((eq (cadddr dep) 'TEMP)
+                    (format stream "~A~A = ~A;~%" indent (car dep)
+                        (fixup-substitutions-prime alg
+                                (caddr dep) name var-name)))
+                   (t
+                    (format stream "~Asusp->~A = ~A;~%" indent (car dep)
+                        (fixup-substitutions-prime alg
+                                (caddr dep) name var-name)))))))))
+
+(print 'fixup-depends-prime)
+
+
+;;****************
+;; fixup-depends-prime-decls - write declarations for temp depend variables
+;; 	this code is only run the first time the suspension
+;;	is invoked
+;;****************
+(defun fixup-depends-prime-decls (alg stream name)
+  (let ((depends (get-slot alg 'depends)))
+    (dolist (dep depends)
+      (cond ((equal name (cadr dep))
+             (cond ((eq (cadddr dep) 'TEMP)
+                    (format stream "\t    ~A ~A;~%" (car (cddddr dep))
+                                   (car dep)))))))))
+
+(print 'fixup-depends-prime-decls)
+
+
+;;****************
+;; fixup-substitutions-prime - substitute susp-><var> for <var> for each 
+;;	state variable in code, also substitute var-name for name
+;;	(this is the depended-on value)
+;;****************
+(defun fixup-substitutions-prime (alg code name var-name)
+  (dolist (state (get-slot alg 'state))
+    (let ((var (cadr state)))
+      (setf code (substitute code var (strcat "susp->" var) t))))
+  (if name (setf code (substitute code name var-name nil)))
+  code)
+
+(print 'fixup-substitutions-prime)
+
+;; fixup-substitutions-for-depends is used to prepare joint-dependency
+;; code for use outside the inner loop. In this position, the state
+;; variables must be accessed using "susp-><name>" and signals must
+;; be accessed using the local variable <name>_val
+;;
+(defun fixup-substitutions-for-depends (alg code)
+  (setf code (fixup-substitutions-prime alg code nil nil))
+  (let ((interp (get alg 'interpolation))
+        (step-function (get-slot alg 'step-function))
+        (sound-names (get-slot alg 'sound-names)))
+    (dotimes (n (length interp))
+       ;(display "fixup-loop" n name interp sound-names)
+       (let* ((name (nth n sound-names))
+              (method (nth n interp))
+              (is-step (member (name-to-symbol name) step-function)))
+         (cond ((and is-step (eq method 'RAMP))
+                (setf code (substitute code name (strcat name "_val") t))
+                ;(display "fixup-check" name)
+               ))))
+    code))
+
+
+
+;;****************
+;; fixup-depends - write code to declare and update depend variables
+;; 	this is called at declaration time (the point where 
+;;	declarations should be output), but also generates code
+;; 	to be output after the depended-on variable is updated
+;;****************
+(defun fixup-depends (alg stream name)
+  (format stream "/* fixup-depends ~A */~%" name)
+  (let ((depends (get-slot alg 'depends))
+        (fixup-code "")
+        (var-name (strcat name "_x1_sample_reg")))
+    (dolist (dep depends)
+      (cond ((equal name (cadr dep))
+             (cond ((eq (cadddr dep) 'TEMP)
+                    (format stream "\t\t~A ~A; ~%" (car (cddddr dep))
+                                (car dep))
+                    (setf fixup-code
+                          (format nil "~A\t\t~A = ~A;~%"
+                                  fixup-code (car dep) 
+                                  (fixup-substitutions alg
+                                   (caddr dep) name var-name))))
+                   (t
+                    (setf fixup-code
+                          (format nil "~A\t\t~A_reg = susp->~A = ~A;~%"
+                                  fixup-code (car dep) (car dep)
+                                  (fixup-substitutions alg
+                                   (caddr dep) name var-name))))))))
+    (put-slot alg fixup-code 'fixup-code)))
+
+(print 'fixup-depends)
+
+
+;;****************
+;; fixup-substitutions - substitute <var>_reg for <var> for each 
+;;	state variable in code, also substitute var-name for name
+;;	(this is the depended-on value)
+;;****************
+(defun fixup-substitutions (alg code name var-name)
+  (dolist (state (get-slot alg 'state))
+    (let ((var (cadr state)))
+      (setf code (substitute code var (strcat var "_reg") t))))
+  (substitute code name var-name nil))
+
+(print 'fixup-substitutions)
+
+
+;;****************
+;; in-min-list - see if name is in TERMINATE MIN list or
+;;   LOGICAL-STOP MIN list
+;;
+;; returns true if algorithm specified, say (TERMINATE (MIN s1 s2 s3)) and
+;; name is, say, "s2".
+;; NOTE: name is a string, so we have to do a lookup to get the symbol name
+;;****************
+(defun in-min-list (name alg terminate-or-logical-stop)
+  (let ((spec (get alg terminate-or-logical-stop)))
+;    (display "in-min-list" name alg terminate-or-logical-stop spec)
+    (and spec
+         (listp (car spec))
+         (eq (caar spec) 'MIN)
+         (member (name-to-symbol name) (cdar spec)))))
+
+
+;;****************
+;; logical-stop-check-needed -- says if we need to check for logical stop
+;;    after the outer loop
+;; the argument is the logical-stop clause from the algorithm prop list
+;;****************
+(defun logical-stop-check-needed (logical-stop)
+  (cond ((and logical-stop
+              (listp logical-stop)
+              (or (eq (car logical-stop) 'MIN)
+                  (eq (car logical-stop) 'AT))))))
+
+
+;;****************
+;; susp-check-fn -- find fn to check need for new block of samples
+;;
+;; To simply check if susp->S_ptr points to something, you call 
+;; susp_check_samples(S, S_ptr, S_cnt), but during this check, it is
+;; also necessary to check for termination condition and logical stop
+;; condition, BUT ONLY if S is in a MIN list for the TERMINATE or
+;; LOGICAL-STOP attributes (i.e. this signal stops when S does).
+;;
+;; The algorithm is: if S is on the LOGICAL-STOP MIN list and on
+;; the TERMINATE MIN list, then call susp_check_term_log_samples.
+;;Otherwise if S is on the LOGICAL-STOP MIN list then call
+;; susp_check_log_samples.  Otherwise, if S is on the TERMINATE MIN
+;; list, call susp_check_term_samples.  The "normal" case should be 
+;; susp_check_term_samples, which happens when the LOGICAL-STOP
+;; MIN list is empty (nothing was specified).  Note that a signal logically
+;; stops at termination time anyway, so this achieves the logically stopped
+;; condition with no checking.
+;;****************
+(defun susp-check-fn (name alg)
+  (let ((in-log-list (in-min-list name alg 'logical-stop))
+        (in-term-list (in-min-list name alg 'terminate)))
+    (cond ((and in-log-list in-term-list)
+           "susp_check_term_log_samples")
+          (in-log-list
+           "susp_check_log_samples")
+          (in-term-list
+           "susp_check_term_samples")
+          (t
+           "susp_check_samples"))))
+
+
+;;************
+;; write-depend-decls -- declare TEMP depends variables
+;;
+;;************
+;(defun write-depend-decls (alg stream)
+;  (dolist (dep (get-slot alg 'depends))
+;    (cond ((eq (cadddr dep) 'TEMP)
+;	   (format stream "\t~A ~A; ~%" (car (cddddr dep)) (car dep))))))
+;--------
+
+(defun write-depend-decls (alg stream interp sound-names step-function)
+  (dotimes (n (length interp))
+    (let ((name (nth n sound-names))
+          (method (nth n interp))
+          is-step)
+      (cond ((eq method 'INTERP)
+             (setf is-step (member (name-to-symbol name) step-function))
+             (cond (is-step
+                    (fixup-depends-prime-decls alg stream name))))))))
+
+
+;;************
+;; write-prime -- write conditional code to prime input sounds and susp
+;;
+;;************
+(defun write-prime (alg stream interp sound-names)
+ (let ((step-function (get-slot alg 'step-function))
+       (internal-scaling (get-slot alg 'internal-scaling)))
+  ;------------------------------
+  ;   /* make sure sounds are primed with first values */
+  ;------------------------------
+  (format stream "~%    /* make sure sounds are primed with first values */~%")
+
+  ;------------------------------
+  ;   if  (!susp->started) {
+  ;       susp->started = true;
+  ;------------------------------
+
+  (format stream "    if (!susp->started) {~%")
+  ; this is generating extraneous declarations, is it necessary?
+  ; yes, at least sometimes, so we're leaving it in
+  ; "atonev.alg" is a good test case to prove you can't comment this out
+  (write-depend-decls alg stream interp sound-names step-function)
+  (format stream "\tsusp->started = true;~%")
+
+  ;------------------------------
+  ; for each method
+  ;------------------------------
+  (dotimes (n (length interp))
+    (let ((name (nth n sound-names))
+          (method (nth n interp))
+          is-step)
+      (cond ((eq method 'INTERP)
+             ;--------------------
+             ; susp_XX_samples(NAME, NAME_ptr, NAME_cnt);
+             ; susp->NAME_x1_sample = susp_fetch_sample(NAME, NAME_ptr,
+             ;                                          NAME_cnt);
+             ; <fixup depends variables> (if a step function)
+             ;--------------------
+             (format stream "\t~A(~A, ~A_ptr, ~A_cnt);~%"
+              (susp-check-fn name alg) name name name)
+             (cond ((member (name-to-symbol name) internal-scaling)
+                    (format stream
+                     "\tsusp->~A_x1_sample = (susp->~A_cnt--, *(susp->~A_ptr));~%"
+                     name name name))
+                   (t
+                    (format stream 
+                     "\tsusp->~A_x1_sample = susp_fetch_sample(~A, ~A_ptr, ~A_cnt);~%"
+                    name name name name)))
+             (setf is-step (member (name-to-symbol name) step-function))
+             (cond (is-step
+                    (fixup-depends-prime alg stream name "\t"
+                        (strcat "susp->" name "_x1_sample")))))
+            ((eq method 'RAMP)
+             ;--------------------
+             ; susp->NAME_pHaSe = 1.0;
+             ;--------------------
+             (format stream "\tsusp->~A_pHaSe = ~A;~%" name "1.0")))))
+
+  ;--------------------
+  ; *WATCH*
+  ;       show_samples(2,susp->NAME_x2,0);
+  ;--------------------
+; (if *WATCH*
+;   (format stream "\tshow_samples(2,~A_x2,0);~%" name))
+
+  ;--------------------
+  ; }
+  ;--------------------
+  (format stream "    }~%")))
+      
+
+(print 'write-prime)
+
+;;************
+;; show-samples-option
+;;
+;; Inputs:
+;;	stream: output stream for file
+;;	name: token to use for forming name
+;; Effect:
+;;	Writes sampling clause
+;;************
+(defun show-samples-option (stream name)
+    ;----------------------------
+    ;	else
+    ;	   { /* just show NAME */
+    ;	    show_samples(1,NAME,NAME_ptr - NAME->samples); 
+    ;	   } /* just show NAME */
+    ;----------------------------
+;  (format stream "\t    show_samples(1, ~A, 0);~%\t} else {~%" name)
+;  (format stream "\t    show_samples(1, ~A, ~A_ptr - ~A->samples);~%~%"
+;          name name name)
+)
+
+
+(print "show-samples-option")
+
+;;************
+;; write-susp -- compile the suspension according to interpolation spec
+;;
+;;************
+
+(defun write-susp (alg stream)
+  (let* ((interp (get alg 'interpolation))
+         (encoding (encode interp))
+         (internal-scaling (get alg 'internal-scaling))
+         (sound-names (get alg 'sound-names))
+         (name (get-slot alg 'name))
+         (logical-stop (car (get-slot alg 'logical-stop)))
+         (terminate (car (get-slot alg 'terminate)))
+         (outer-loop (get-slot alg 'outer-loop))
+         (step-function (get-slot alg 'step-function))
+         (depends (get-slot alg 'depends))
+         (inner-loop (get-slot alg 'inner-loop))
+         n s m p fn-name loop-prefix joint-depend)
+
+    (display "write-susp" interp encoding)
+
+    ;---------------------------
+    ; non-ANSI:
+    ;     void NAME_<encoding>_fetch(susp, snd_list)
+    ;   register pwl_susp_type susp;
+    ;        snd_list_type snd_list;
+    ;	     {
+    ; ANSI:
+    ;     void NAME_<encoding>_fetch(register susp_type susp, snd_list_type snd_list)
+    ;        {
+    ;---------------------------
+
+    (setf fn-name (format nil "~A_~A_fetch" name encoding))
+    (cond (*ANSI*
+           (format stream
+        "~%~%void ~A(register ~A_susp_type susp, snd_list_type snd_list)~%{~%"
+            fn-name name))
+          (t
+           (format stream
+            "~%~%void ~A(susp, snd_list)~%  register ~A_susp_type susp;~%~A~%"
+            fn-name name "  snd_list_type snd_list;\n{")))
+
+    ;-----------------------------
+    ;    int cnt = 0;  /* how many samples computed */
+    ;-----------------------------
+    (format stream "    int cnt = 0; /* how many samples computed */~%")
+
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((and interpolate-samples (eq method 'INTERP))
+               (format stream "    sample_type ~A_x2_sample;~%" name))
+              ((eq method 'INTERP))
+              ((and interpolate-samples (eq method 'RAMP))
+               ;-----------------
+               ;    sample_type NAME_DeLtA;
+               ;    sample_type NAME_val;
+               ;-----------------
+               (format stream "    sample_type ~A_DeLtA;~%" name)
+               (format stream "    sample_type ~A_val;~%" name)
+               (format stream "    sample_type ~A_x2_sample;~%" name))
+              ((eq method 'RAMP)
+               ;-----------------
+               ;    sample_type NAME_val;
+               ;-----------------
+               (format stream "    sample_type ~A_val;~%" name)))))
+
+    ;-----------------------------
+    ;   int togo;
+    ;   int n;
+    ;   sample_block_type out;
+    ;   register sample_block_values_type out_ptr;
+    ;   register sample_block_values_type out_ptr_reg;
+    ;-----------------------------
+    (format stream "    int togo;~%")
+    (format stream "    int n;~%")
+    (format stream "    sample_block_type out;~%")
+    (format stream "    register sample_block_values_type out_ptr;~%~%")
+    (format stream "    register sample_block_values_type out_ptr_reg;~%~%")
+
+    ;; computations for DEPENDS variables added to inner loop
+    (setf loop-prefix "")
+    (dolist (dep depends)
+      (dotimes (n (length interp))
+        (let ((method (nth n interp))
+              (name (nth n sound-names))
+              interpolate-samples)
+          (setf interpolate-samples
+                (not (member (name-to-symbol name) step-function)))
+          (cond ((and (equal name (cadr dep))
+                      (or (member method '(NONE SCALE))
+                          interpolate-samples))
+                 (setf loop-prefix (format nil "~A\t    ~A = ~A;~%"
+                                    loop-prefix (car dep) (caddr dep))))))))
+
+    ;; computation of JOINT-DEPENDENCY, if applicable
+    (setf joint-depend "")
+    (dolist (dep (get-slot alg 'joint-dependency))
+      ;; if any depended on var is recomputed in inner loop, add the stmts
+      (cond ((depended-on-in-inner-loop (car dep) interp sound-names 
+                                        step-function)
+             (dolist (stmt (cdr dep))
+                (setf joint-depend (strcat joint-depend 
+                                        "\t    " stmt "\n"))))))
+
+    ; this computes some additional declarations
+    (compute-inner-loop alg (strcat loop-prefix joint-depend inner-loop))
+    ; make the declarations
+    (print-strings (get-slot alg 'register-decl) stream)
+
+    ;-----------------------------
+    ;   falloc_sample_block(out, "caller");
+    ;  out_ptr = out->samples;
+    ;  snd_list->block = out;
+    ;-----------------------------
+    (format stream "    falloc_sample_block(out, \"~A\");~%" fn-name)
+    (format stream "    out_ptr = out->samples;~%")
+    (format stream "    snd_list->block = out;~%")
+
+    ;-----------------------------
+    ; prime the ramp/interp streams
+    ;-----------------------------
+    ;; run this code the first time the suspension is called
+    (cond ((or (member 'RAMP interp) (member 'INTERP interp))
+           (write-prime alg stream interp sound-names)))
+
+    (dotimes (n (length interp))
+       (let ((name (nth n sound-names))
+             interpolate-samples
+             (method (nth n interp)))
+         (setf interpolate-samples
+               (not (member (name-to-symbol name) step-function)))
+
+         (cond ((or (and interpolate-samples (eq method 'INTERP))
+                    (eq method 'RAMP))
+                ;-------------
+                ;   susp_check_XX_samples(NAME, NAME_ptr, NAME_cnt);
+                ;-------------
+                (format stream
+                        "~%    ~A(~A, ~A_ptr, ~A_cnt);~%"
+                        (susp-check-fn name alg) name name name)))
+
+         (cond ((and interpolate-samples (eq method 'INTERP))
+                ;-------------
+                ;  susp->NAME_x2_sample = susp->NAME->scale * susp->NAME_x2_ptr);
+                ;-------------
+                (cond ((member (name-to-symbol name) internal-scaling)
+                       (format stream
+                        "    ~A_x2_sample = *(susp->~A_ptr);~%" name name))
+                      (t
+                	  (format stream
+                        "    ~A_x2_sample = susp_current_sample(~A, ~A_ptr);~%"
+                        name name name))))
+               ((eq method 'INTERP)
+                ;-------------
+                ;
+                ;-------------
+                )
+               ((and interpolate-samples (eq method 'RAMP))
+                ;----------------
+                ; susp->NAME_x2_sample = susp_current_sample(NAME, NAME_ptr);
+                ;----------------
+                (cond ((member (name-to-symbol name) internal-scaling)
+                       (format stream
+                        "    ~A_x2_sample = *(susp->~A_ptr);~%" name name))
+                      (t
+                       (format stream 
+                        "    ~A_x2_sample = susp_current_sample(~A, ~A_ptr);~%"
+                        name name name))))
+               ((eq method 'RAMP)
+                ))))
+
+    ;----------------------------
+    ; *WATCH*: printf("NAME %x new block %x\n", susp, out);
+    ;----------------------------
+    (if *watch*
+      (format stream "    printf(\"~A %x new block %x\\n\", susp, out);~%" name))
+
+    ;----------------------------
+    ;    while (cnt < max_sample_block_len)  { /* outer loop */
+    ;      /* first compute how many samples to generate in inner loop: */
+    ;	   /* don't overflow the output sample block: */
+    ;      togo = max_sample_block_len - cnt;
+    ;----------------------------
+    
+    (format stream 
+            "~%    while (cnt < max_sample_block_len) { /* outer loop */~%")
+    (format stream 
+     "\t/* first compute how many samples to generate in inner loop: */~%")
+    (format stream
+     "\t/* don't overflow the output sample block: */~%")
+    (format stream
+     "\ttogo = max_sample_block_len - cnt;~%~%")
+
+    ;; this loop gets ready to execute the INNER-LOOP
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((member method '(NONE SCALE))
+               ;-----------------
+               ; NONE:
+               ;    /* don't run past the NAME input sample block */
+               ; susp_check_XX_for_samples(NAME, NAME_ptr, NAME_cnt);
+               ;    togo = min(togo, susp->NAME_cnt);
+               ;-----------------
+               (format stream
+                "\t/* don't run past the ~A input sample block: */~%" name)
+               (display "don't run past the ..." name (susp-check-fn name alg))
+               (format stream
+                "\t~A(~A, ~A_ptr, ~A_cnt);~%"
+                (susp-check-fn name alg) name name name)
+               (format stream "\ttogo = min(togo, susp->~A_cnt);~%~%" name))
+              ((eq method 'INTERP))
+              ((and interpolate-samples (eq method 'RAMP))
+                ;-----------------
+                ; RAMP:
+                ;
+                ;    /* grab next NAME_x2_sample when phase goes past 1.0 */
+                ;    /* we use NAME_n (computed below) to avoid roundoff errors: */
+                ; if (susp->NAME_n <= 0) {
+                ;     susp->NAME_x1_sample = NAME_x2_sample;
+                ;     susp->NAME_ptr++;
+                ;     susp_took(NAME_cnt, 1);
+                ;     susp->NAME_pHaSe -= 1.0;
+                ;     susp_check_log_samples(NAME, NAME_ptr, NAME_cnt);
+                ;     NAME_x2_sample = susp_current_sample(NAME, NAME_ptr);
+                ; }
+                ; /* NAME_n gets number of samples before phase exceeds 1.0: */
+                ; susp->NAME_n = 0.5 + (long) ((1.0 - susp->NAME_pHaSe) * susp->output_per_NAME);
+                ; togo = min(togo, susp->NAME_n);
+                ; NAME_DeLtA = (sample_type) ((NAME_x2_sample - susp->NAME_x1_sample) *  susp->NAME_pHaSe_iNcR);
+                ; NAME_val = (sample_type) (susp->NAME_x1_sample * (1.0 - susp->NAME_pHaSe) +
+                ;      NAME_x2_sample * susp->NAME_pHaSe);
+                ;-----------------
+                (format stream
+                 "\t/* grab next ~A_x2_sample when phase goes past 1.0; */~%" name)
+                (format stream
+                 "\t/* we use ~A_n (computed below) to avoid roundoff errors: */~%" name)
+                (format stream "\tif (susp->~A_n <= 0) {~%" name)
+                (format stream "\t    susp->~A_x1_sample = ~A_x2_sample;~%"
+                               name name)
+                (format stream "\t    susp->~A_ptr++;~%" name);
+                (format stream "\t    susp_took(~A_cnt, 1);~%" name);
+                (format stream "\t    susp->~A_pHaSe -= 1.0;~%" name);
+                (format stream "\t    ~A(~A, ~A_ptr, ~A_cnt);~%"
+                 (susp-check-fn name alg) name name name)
+                (cond ((member (name-to-symbol name) internal-scaling)
+                       (format stream
+                        "\t    ~A_x2_sample = *(susp->~A_ptr);~%" name name))
+                      (t
+                       (format stream 
+                        "\t    ~A_x2_sample = susp_current_sample(~A, ~A_ptr);~%"
+                        name name name)))
+                (format stream
+                 "\t    /* ~A_n gets number of samples before phase exceeds 1.0: */~%"
+                        name)
+                (format stream 
+                        "\t    susp->~A_n = (long) ((1.0 - susp->~A_pHaSe) *~%"
+                        name name)
+                (format stream "\t\t\t\t\tsusp->output_per_~A);~%\t}~%" name)
+                (format stream "\ttogo = min(togo, susp->~A_n);~%" name)
+                (format stream "\t~A_DeLtA = (sample_type) ((~A_x2_sample - susp->~A_x1_sample) * susp->~A_pHaSe_iNcR);~%" 
+                        name name name name)
+                (format stream 
+                 "\t~A_val = (sample_type) (susp->~A_x1_sample * (1.0 - susp->~A_pHaSe) +~%"
+                 name name name)
+                (format stream "\t\t ~A_x2_sample * susp->~A_pHaSe);~%~%"
+                         name name))
+              ((eq method 'RAMP)
+                ;-----------------
+                ; SLOW STEP FUNCTION
+                ;
+                ; /* grab next NAME_x1_sample when phase goes past 1.0 */
+                ; /* use NAME_n (computed below) to avoid roundoff errors: */
+                ; if (susp->NAME_n <= 0) {
+                ;     <fixup depends declarations>
+                ;     susp_check_log_samples(NAME, NAME_ptr, NAME_cnt);
+                ;     susp->NAME_x1_sample = susp_fetch_sample(NAME, NAME_ptr,
+                ; 					       NAME_cnt);
+                ;     susp->NAME_pHaSe -= 1.0;
+                ;     /* NAME_n gets number of samples before phase 
+                ;        exceeds 1.0: */
+                ;     susp->NAME_n = (long) ((1.0 - susp->NAME_pHaSe) *
+                ;                    susp->output_per_NAME);
+                ;     <fixup depends variables>
+                ; }
+                ; togo = min(togo, susp->NAME_n);
+                ; NAME_val = susp->NAME_x1_sample; 
+                ;-----------------
+                (format stream
+                 "\t/* grab next ~A_x1_sample when phase goes past 1.0; */~%"
+                 name)
+                (format stream
+                "\t/* use ~A_n (computed below) to avoid roundoff errors: */~%"
+                 name)
+                (format stream "\tif (susp->~A_n <= 0) {~%" name)
+                (fixup-depends-prime-decls alg stream name)
+                (format stream "\t    ~A(~A, ~A_ptr, ~A_cnt);~%"
+                 (susp-check-fn name alg) name name name)
+                (format stream 
+          "\t    susp->~A_x1_sample = susp_fetch_sample(~A, ~A_ptr, ~A_cnt);~%"
+                 name name name name)
+                (format stream "\t    susp->~A_pHaSe -= 1.0;~%" name);
+                (format stream
+          "\t    /* ~A_n gets number of samples before phase exceeds 1.0: */~%"
+                        name)
+                (format stream 
+                 "\t    susp->~A_n = (long) ((1.0 - susp->~A_pHaSe) *~%"
+                        name name)
+                (format stream "\t\t\t\t\tsusp->output_per_~A);~%" name)
+                (fixup-depends-prime alg stream name "\t    "
+                        (strcat "susp->" name "_x1_sample"))
+                (format stream "\t}~%" name)
+                (format stream "\ttogo = min(togo, susp->~A_n);~%" name)
+                (format stream 
+                 "\t~A_val = susp->~A_x1_sample;~%" name name) ))))
+    
+    ;---------------
+    ; see if there are joint-dependencies that should be output now
+    ; output here if none of depended-on signals are updated in inner loop
+    ;---------------
+    ;; computation of JOINT-DEPENDENCY, if applicable
+    (setf joint-depend "")
+    (dolist (dep (get-slot alg 'joint-dependency))
+      (cond ((not (depended-on-in-inner-loop (car dep) interp sound-names 
+                                             step-function))
+             (dolist (stmt (cdr dep))
+                (setf joint-depend (strcat joint-depend 
+                                        "\t" stmt "\n"))))))
+    (display "joint-depend before fixup" joint-depend)
+    (setf joint-depend (fixup-substitutions-for-depends alg joint-depend))
+    (if joint-depend (format stream joint-depend))
+    (display "joint-depend outside loop" joint-depend)
+
+    ;----------------
+    ; if the teminate time is a MIN of some signals or AT some expression
+    ; (i.e. specified at all) see if we're coming to the terminate cnt:
+    ;
+    ;	/* don't run past terminate time */
+    ;	if (susp->terminate_cnt != UNKNOWN && 
+    ;		susp->terminate_cnt <= susp->susp.current) {
+    ;	    int to_stop = (susp->terminate_cnt + max_sample_block_len) -
+    ;			 (susp->susp.current + cnt);
+    ;	    if (to_stop < togo && ((togo = to_stop) == 0)) break;
+    ;	}
+    ;----------------
+    (cond ((terminate-check-needed terminate alg)
+           (print-strings '(
+     "\t/* don't run past terminate time */\n"
+     "\tif (susp->terminate_cnt != UNKNOWN &&\n"
+     "\t    susp->terminate_cnt <= susp->susp.current + cnt + togo) {\n"
+     "\t    togo = susp->terminate_cnt - (susp->susp.current + cnt);\n"
+     "\t    if (togo == 0) break;\n"
+     "\t}\n\n") stream)))
+
+    ;----------------
+    ; if the logical-stop attribute is MIN of some signals or AT some expression
+    ; see if we're coming to the logical stop:
+    ;
+    ;   /* don't run past logical stop time */
+    ;	if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {
+    ;	    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);
+    ;           /* break if to_stop == 0 (we're at the logical stop)
+    ;	     * AND cnt > 0 (we're not at the beginning of the
+    ;	     * output block).
+    ;	     */
+    ;	    if (to_stop < togo) {
+    ;		if (to_stop == 0) {
+    ;		    if (cnt) {
+    ;			togo = 0;
+    ;			break;
+    ;		    } else /* keep togo as is: since cnt == 0, we
+    ;			    * can set the logical stop flag on this
+    ;			    * output block
+    ;			    */
+    ;			susp->logically_stopped = true;
+    ;		} else /* limit togo so we can start a new
+    ;			* block at the LST
+    ;			*/
+    ;		    togo = to_stop;
+    ;   	      }	    
+    ;	}
+    ;----------------
+    (cond (logical-stop
+           (print-strings '(
+     "\n\t/* don't run past logical stop time */\n"
+     "\tif (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) {\n"
+     "\t    int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt);\n"
+     "\t    /* break if to_stop == 0 (we're at the logical stop)\n"
+     "\t     * AND cnt > 0 (we're not at the beginning of the\n"
+     "\t     * output block).\n"
+     "\t     */\n"
+     "\t    if (to_stop < togo) {\n"
+     "\t\tif (to_stop == 0) {\n"
+     "\t\t    if (cnt) {\n"
+     "\t\t\ttogo = 0;\n"
+     "\t\t\tbreak;\n"
+     "\t\t    } else /* keep togo as is: since cnt == 0, we\n"
+     "\t\t            * can set the logical stop flag on this\n"
+     "\t\t            * output block\n"
+     "\t\t            */\n"
+     "\t\t\tsusp->logically_stopped = true;\n"
+     "\t\t} else /* limit togo so we can start a new\n"
+     "\t\t        * block at the LST\n"
+     "\t\t        */\n"
+     "\t\t    togo = to_stop;\n"
+     "\t    }\n"
+     "\t}\n\n")
+                          stream)))
+
+    (cond (outer-loop
+           (print-strings outer-loop stream)
+           (format stream "~%")))
+
+    ;----------------------------
+    ; n = togo;
+    ; *WATCH*: printf("ALG %x starting inner loop, n %d\n", susp, n);
+    ;----------------------------
+
+    (format stream "\tn = togo;~%")
+    (if *watch* 
+      (format stream
+              "\tprintf(\"~A %x starting inner loop, n %d\\n\", susp, n);~%"
+              name))
+
+    (dotimes (n (length interp))
+       (let ((name (nth n sound-names))
+             (method (nth n interp)))
+          (cond ((eq method 'NONE))
+                 ;-----------------
+                 ;  NONE:
+                 ;-----------------
+                ((eq method 'RAMP))
+                ;-----------------
+                ; RAMP:
+                ;-----------------
+                ((and (eq method 'INTERP) (eq n 0))
+                ;-----------------
+                ; INTERP (first arg only)
+;		;	susp->NAME_cnt -= togo;
+                ;-----------------
+;	  	 (format stream "\tsusp->~A_cnt -= togo;~%" name)
+                 ))))
+
+    (print-strings (get-slot alg 'register-init) stream)
+    ;----------------------------
+    ; if (n) do  { /* inner loop */
+    ;----------------------------
+
+    (format stream
+            "\tif (n) do { /* the inner sample computation loop */~%")
+
+    ;;----------------------------
+    ;; write local declarations supplied by user
+    ;;----------------------------
+
+    (print-strings (get-slot alg 'inner-loop-locals) stream)
+
+    ;;----------------------------
+    ;; declare temps that depend on signals
+    ;;----------------------------
+
+    (dotimes (n (length interp))
+      (let ((method (nth n interp))
+            interpolate-samples
+            (name (nth n sound-names)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+        (cond ((or (member method '(NONE SCALE))
+                   interpolate-samples)
+               (dolist (dep depends)
+                (cond ((and (equal (cadr dep) name)
+                            (eq (cadddr dep) 'TEMP))
+                       (format stream "\t    ~A ~A;~%" (car (cddddr dep)) 
+                                      (car dep)))))))))
+
+    ;; this loop writes code that runs in the INNER-LOOP and checks to see
+    ;; if we need to advance to the next pair of interpolated points for
+    ;; each interpolated sound
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((and interpolate-samples (eq method 'INTERP))
+                ;-----------------
+                ; INTERP:
+                ;
+                ;    if (susp->NAME_pHaSe >= 1.0)  { 
+                ;          NAME_x1_sample_reg =NAME_x2_sample_reg;
+                ;       /* pick up next sample as NAME_x2_sample */
+                ;       susp->NAME_ptr++;
+                ;        susp_took(NAME_cnt, 1);
+                                     ;        susp->NAME_pHaSe -= 1.0;
+                ;       susp_check_XX_samples_break(NAME, NAME_ptr, NAME_cnt, NAME_x2_sample);
+                ; }
+                ; <maintenance of depends variables>
+                ;-----------------
+                (format stream "\t    if (~A_pHaSe_ReG >= 1.0) {~%" name)
+                (format stream "\t\t~A_x1_sample_reg = ~A_x2_sample;~%"
+                                name name)
+                (format stream "\t\t/* pick up next sample as ~A_x2_sample: */~%" name)
+                (format stream "\t\tsusp->~A_ptr++;~%" name)
+                (format stream "\t\tsusp_took(~A_cnt, 1);~%" name)
+                (format stream "\t\t~A_pHaSe_ReG -= 1.0;~%" name)
+                (format stream "\t\t~A_break(~A, ~A_ptr, ~A_cnt, ~A_x2_sample);~%"
+                        (susp-check-fn name alg) name name name name)
+;                (format stream "\t\t~A_x2_sample = susp_current_sample(~A, ~A_ptr);~%"
+;                        name name name)
+
+                ;     show_samples(2, susp->NAME_x2, susp->NAME_x2_ptr -
+                ;			NAME_x2->block->samples);
+                ;-----------------
+
+;		(if *WATCH* 
+;		    (format stream "\t\tshow_samples(2,susp->~A_x2,susp->~A_x2_ptr - susp->~A_x2->block->samples);~%"
+;		    		name name name)
+;                )
+                ;-----------------
+                ;      }
+                ;-----------------
+                (format stream "\t    }~%")
+              )
+              ((eq method 'INTERP)
+                ;-----------------
+                ; STEP FUNCTION:
+                ;
+                ;    if (susp->NAME_pHaSe >= 1.0)  { 
+                ; 	<optional depends/fixup declarations>
+                ;       /* pick up next sample as NAME_x1_sample */
+                ;       susp->NAME_ptr++;
+                ;        susp_took(NAME_cnt, 1);
+                ;        susp->NAME_pHaSe -= 1.0;
+                ;       susp_check_XX_samples_break(NAME, NAME_ptr, NAME_cnt, NAME_x1_sample);
+                ;        NAME_x1_sample_reg = susp_current_sample(NAME, NAME_ptr);
+                ; 	<optional depends/fixup code>
+                ; }
+                ;-----------------
+                (format stream "\t    if (~A_pHaSe_ReG >= 1.0) {~%" name)
+                (fixup-depends alg stream name)
+                (format stream "\t\t/* pick up next sample as ~A_x1_sample: */~%" name)
+                (format stream "\t\tsusp->~A_ptr++;~%" name)
+                (format stream "\t\tsusp_took(~A_cnt, 1);~%" name)
+                (format stream "\t\t~A_pHaSe_ReG -= 1.0;~%" name)
+                (format stream "\t\t~A_break(~A, ~A_ptr, ~A_cnt, ~A_x1_sample_reg);~%"
+                        (susp-check-fn name alg) name name name name)
+                (format stream "\t\t~A_x1_sample_reg = susp_current_sample(~A, ~A_ptr);~%"
+                        name name name)
+
+                ;     show_samples(2, susp->NAME_x2, susp->NAME_x2_ptr -
+                ;			NAME_x2->block->samples);
+                ;-----------------
+
+;		(if *WATCH* 
+;		    (format stream "\t\tshow_samples(2,susp->~A_x2,susp->~A_x2_ptr - susp->~A_x2->block->samples);~%"
+;		    		name name name)
+;                )
+                (let ((fixup-code (get-slot alg 'fixup-code)))
+                  (if fixup-code (format stream fixup-code)))
+
+                ;-----------------
+                ;      }
+                ;-----------------
+                (format stream "\t    }~%")))))
+
+    (write-inner-loop alg stream)
+    (print-strings (get-slot alg 'register-cleanup) stream)
+
+    ;; this loop calls loop tail computations on all sounds
+    (dotimes (n (length interp))
+      (let ((name (nth n sound-names))
+            interpolate-samples
+            (method (nth n interp)))
+        (setf interpolate-samples
+              (not (member (name-to-symbol name) step-function)))
+
+        (cond ((member method '(NONE SCALE))
+               ;-----------------
+               ; NONE:
+               ;    susp_took(NAME_cnt, togo - n);
+               ;-----------------
+               (format stream "\tsusp_took(~A_cnt, togo);~%" name))
+              ((eq method 'INTERP))
+              ((eq method 'RAMP)
+                ;-----------------
+                ; RAMP:
+                ;	susp->NAME_pHaSe += togo * susp->NAME_pHaSe_iNcR;
+                ;	susp->NAME_n -= togo; 
+                ;-----------------
+                (format stream
+                 "\tsusp->~A_pHaSe += togo * susp->~A_pHaSe_iNcR;~%"
+                 name name)
+                (format stream "\tsusp->~A_n -= togo;~%" name)
+               ))))
+    ;-----------------------------
+    ;     cnt += togo;
+    ;    } /* outer loop */
+    ; 
+    ; snd_list->block_len = cnt;
+    ;-----------------------------
+
+    (format stream "~A~%~A~%~%" "\tcnt += togo;"
+                   "    } /* outer loop */")
+    ;-----------------------------
+    ; if terminate is not NONE (infinite), check for it as follows:
+    ;    /* test for termination */
+    ;    if (togo == 0 && cnt == 0) {
+    ;        snd_list_terminate(snd_list);
+    ;   *WATCH*: printf("NAME %x terminated\n", susp);
+    ;    } else {
+    ;       snd_list->block_len = cnt;
+    ;       susp->susp.current += cnt;
+    ;    }
+    ;-----------------------------
+    (cond ((terminate-possible terminate alg)
+           (print-strings '(
+             "    /* test for termination */\n"
+             "    if (togo == 0 && cnt == 0) {\n"
+             "\tsnd_list_terminate(snd_list);\n")
+            stream)
+           (if *watch*
+             (format stream "\tprintf(\"~A %x terminated.\\n\", susp);~%" name))
+           (print-strings '(
+             "    } else {\n"
+             "\tsnd_list->block_len = cnt;\n"
+             "\tsusp->susp.current += cnt;\n"
+             "    }\n") stream))
+          (t
+    ;----------------
+    ; OTHERWISE (no termination test):
+    ;    snd_list->block_len = cnt;
+    ;    susp->susp.current += cnt;
+    ;----------------
+           (print-strings '(
+             "    snd_list->block_len = cnt;\n"
+             "    susp->susp.current += cnt;\n") stream)))
+
+     ;----------------
+     ; if logical-stop is not the default check for it as follows:
+     ;    /* test for logical stop */
+     ;    if (susp->logically_stopped) {
+     ;      snd_list-> logically_stopped = true;
+     ;    } else if (susp->susp.log_stop_cnt == susp->susp.current) {
+     ;      susp->logically_stopped = true;
+     ;    }
+     ;----------------
+    (cond ((logical-stop-check-needed logical-stop)
+           (print-strings '(
+    "    /* test for logical stop */\n"
+    "    if (susp->logically_stopped) {\n"
+    "\tsnd_list->logically_stopped = true;\n"
+    "    } else if (susp->susp.log_stop_cnt == susp->susp.current) {\n"
+    "\tsusp->logically_stopped = true;\n"
+    "    }\n") stream)))
+
+     ;----------------
+     ;  } /* name_encoding_fetch */
+     ;----------------
+    (format stream "} /* ~A_~A_fetch */~%" name encoding)))
+
+(print 'write-susp)
+
+; terminate-check-needed -- see if this is either a terminate clause
+; that specifies MIN or AT, or is NIL (meaning none-specified so take
+; the default) and there are signal parameters
+;
+(defun terminate-check-needed (terminate alg)
+  (cond (terminate
+         (cond ((listp terminate)
+                (cond ((member (car terminate) '(MIN AT AFTER)) t)
+                      (t nil)))
+               ((member terminate '(COMPUTED NONE)) nil)
+               (t
+                (error "TERMINATE clause should specify a list"))))
+        ((get alg 'sound-args) t)))
+
+          
+; same as terminate-check-needed, but also returns true for COMPUTED 
+; termination
+;
+(defun terminate-possible (terminate alg)
+  (cond (terminate
+         (cond ((listp terminate)
+                (cond ((member (car terminate) '(MIN AT AFTER COMPUTED)) t)
+                      (t nil)))
+               ((eq terminate 'NONE) nil)
+               ((eq terminate 'COMPUTED) t)
+               (t
+                (error "TERMINATE clause should specify a list"))))
+        ((get alg 'sound-args) t)))
diff --git a/lib-src/libnyquist/nyquist/tran/writetoss.lsp b/lib-src/libnyquist/nyquist/tran/writetoss.lsp
new file mode 100644
index 0000000..acc8e0a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/tran/writetoss.lsp
@@ -0,0 +1,85 @@
+;; writetoss -- writes the "toss prepended samples" routine
+
+;; modified May 3, 1999 by RBD to not adjust t0 when samples will be tossed
+;;    also, final_time is just susp->susp.t0, since t0 is unadjusted.
+
+(defun write-toss (alg stream)
+  (let ((alg-name (get alg 'name))
+        (sound-names (get alg 'sound-names)))
+    ;;----------------
+    ;; void ALG_toss_fetch(susp, snd_list)
+    ;;   register ALG_susp_type susp;
+    ;;   snd_list_type snd_list;
+    ;; {
+    ;;    long final_count = susp->susp.toss_cnt);
+    ;;    time_type final_time = susp->susp.t0;
+    ;;    FORMERLY, THIS WAS:
+    ;;      time_type final_time = susp->susp.t0 + final_count / susp->susp.sr;
+    ;;    long n;
+    ;;----------------
+    (format stream "~%~%void ~A_toss_fetch(susp, snd_list)~%" alg-name)
+    (format stream "  register ~A_susp_type susp;~%" alg-name)
+    (format stream "  snd_list_type snd_list;~%{~%")
+    (format stream
+     "    long final_count = susp->susp.toss_cnt;~%")
+    (format stream
+"    time_type final_time = susp->susp.t0;~%")
+    (format stream "    long n;~%~%")
+
+    (cond (*watch*
+           (format stream
+            "    printf(\"~A_toss_fetch: final count %d final time %d\\n\", "
+            alg-name)
+           (format stream "final_count, final_time);~%")))
+
+    ;;------------------------------
+    ;; for each sound argument:
+    ;;
+    ;;    /* fetch samples from NAME up to final_time for this block of zeros */
+    ;;    while ((round((final_time - susp->NAME->t0) * susp->NAME->sr)) >=
+    ;;	   susp->NAME->current)
+    ;;	susp_get_samples(NAME, NAME_ptr, NAME_cnt);
+    ;;------------------------------
+    (dolist (name sound-names)
+      (format stream
+  "    /* fetch samples from ~A up to final_time for this block of zeros */~%"
+       name)
+      (format stream
+  "    while ((round((final_time - susp->~A->t0) * susp->~A->sr)) >=~%" 
+       name name)
+      (format stream "\t   susp->~A->current)~%" name)
+      (format stream "\tsusp_get_samples(~A, ~A_ptr, ~A_cnt);~%" 
+              name name name))
+
+    ;;----------------
+    ;;    /* convert to normal processing when we hit final_count */
+    ;;    /* we want each signal positioned at final_time */
+    ;;----------------
+      (format stream
+       "    /* convert to normal processing when we hit final_count */~%")
+      (format stream "    /* we want each signal positioned at final_time */~%")
+
+    ;;----------------
+    ;; for each sound argument:
+    ;;
+    ;;	n = round((final_time - susp->NAME->t0) * susp->NAME->sr -
+    ;;	     (susp->NAME->current - susp->NAME_cnt));
+    ;;	susp->NAME_ptr += n;
+    ;;	susp_took(NAME_cnt, n);
+    ;;----------------
+    (dolist (name sound-names)
+      (format stream "    n = round((final_time - susp->~A->t0) * susp->~A->sr -~%"
+              name name)
+      (format stream "         (susp->~A->current - susp->~A_cnt));~%"
+              name name)
+      (format stream "    susp->~A_ptr += n;~%" name)
+      (format stream "    susp_took(~A_cnt, n);~%" name))
+
+    ;;----------------
+    ;;	susp->susp.fetch = susp->susp.keep_fetch;
+    ;;  (*(susp->susp.fetch))(susp, snd_list);
+    ;; }
+    ;;----------------
+    (format stream "    susp->susp.fetch = susp->susp.keep_fetch;~%")
+    (format stream "    (*(susp->susp.fetch))(susp, snd_list);~%")
+    (format stream "}~%")))
diff --git a/lib-src/libnyquist/nyquist/xlisp/extern.c b/lib-src/libnyquist/nyquist/xlisp/extern.c
new file mode 100644
index 0000000..6a4295f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/extern.c
@@ -0,0 +1,129 @@
+/* extern.c - external type support for xlisp 2.0 */
+
+/* Description of external types:
+
+        A new node type EXTERN has been created to allow extensions to the
+xlisp type system.  If a node is of type EXTERN then it contains two fields:
+(1) a pointer to a type descriptor, and (2) a value which is normally a pointer
+to an instance of the data type.
+        The type descriptor has 6 fields:
+type_name: a string name for the type
+type_symbol: a pointer to a symbol whose print name is type_name
+free_meth: routine to call when the node is freed
+print_meth: routine to call to print the node
+save_meth: routine to save the value to a file
+restore_meth: routine to restore the value from a file
+        The routine create_desc() is used to allocate and initialize a type
+descriptor.  There should be only one type descriptor for each unique type.
+Typically, the module that manages a type will create the type descriptor
+at initialization time.
+        The routine cvextern() is used to combine a type descriptor and a
+value to create an EXTERN node that can be used by xlisp.  This routine is
+called whenever a new value is allocated and returned to xlisp.
+        The routine exttype() returns the type symbol for an EXTERN type.
+        The routine exttypep() tests for a type match.
+        If EXTERN objects are dynamically allocated and freed, then there
+should only be one EXTERN node whose value field (xe_inst) points to the object.
+If there is more than one node (normally created only by cvextern), then one
+of the following should hold:
+1. the object is not dynamically freed.
+2. the object is reference counted and freed when the last EXTERN node is gc'd.
+3. the object will be freed when the first node pointing to it is gc'd, resulting
+in a dangling pointer bug.
+        The save and restore capability of xlisp version 2.0 causes some
+difficulties in that symbols get relocated whenever a workspace is loaded.
+However, type descriptors must point to symbols and type descriptors must be
+present in order to load external types from a workspace.  My solution to this
+problem is to store a string name for each type and also to cache a pointer
+to the corresponding symbol.  The cache is invalidated whenever a workspace is
+loaded (causing symbols to be reallocated).  To make it possible to save and
+restore references to type descriptors, all type descriptors are kept in
+static storage.  Internally, they are referenced by pointers, but when saved,
+an integer index is used.  Because of the integer index, types must always be
+allocated in the same order.  This is taken care of in localinit().
+
+*/
+
+#include "xlisp.h"
+#include "extern.h"
+
+int extindex = 0;
+
+struct xtype_desc_struct desc_table[NTYPES];
+
+
+/* create_desc - create a new external type */
+/**/
+xtype_desc create_desc(
+  char *type_name,	/* the type string name */
+  void (*fm)(),		/* method to free instances of the type */
+  void (*pm)(),		/* method to print instances of the type */
+  void (*sm)(),		/* method to save instances of the type */
+  unsigned char * (*rm)(), /* method to restore instances of the type */
+  void (*mm)())		/* method to mark instances of the type for GC */
+{
+    xtype_desc td;	/* the new type descriptor */
+    if (extindex >= NTYPES) xlfail("insufficient type desc space");
+    td = &desc_table[extindex++];
+    td->type_name = type_name;
+    td->type_symbol = NULL;
+    td->free_meth = fm;
+    td->print_meth = pm;
+    td->save_meth = sm;
+    td->restore_meth = rm;
+    td->mark_meth = mm;
+    return td;
+}
+
+
+/* cvextern - create an instance of some type */
+/**/
+LVAL cvextern(typeptr, instptr)
+  xtype_desc typeptr;	/* pointer to type descriptor */
+  unsigned char *instptr;	/* pointer to the data */
+{
+    LVAL xnode;	/* the resulting lisp node */
+    xnode = newnode(EXTERN);
+    setdesc(xnode, typeptr);
+    setinst(xnode, instptr);
+    return xnode;
+}
+
+
+/* exttype -- get the type of an EXTERN */
+/**/
+LVAL exttype(x)
+  LVAL x;
+{
+    if (!(getdesc(x)->type_symbol)) {
+        getdesc(x)->type_symbol = xlenter(getdesc(x)->type_name);
+    }
+    return getdesc(x)->type_symbol;
+}
+
+
+/* exttypep -- test for type match */
+/*
+ * x is a node, type_sym is a symbol
+ */
+int exttypep(LVAL x, LVAL type_sym)
+{
+    if ((x) && ntype(x) == EXTERN) {
+        if (!(getdesc(x)->type_symbol)) {
+            getdesc(x)->type_symbol = xlenter(getdesc(x)->type_name);
+        }
+        return (getdesc(x)->type_symbol == type_sym);
+    }
+    return FALSE;
+}
+
+
+/* inval_caches -- set type_symbol fields to NULL */
+/**/
+void inval_caches()
+{
+    int i;
+    for (i = 0; i < extindex; i++) {
+        desc_table[i].type_symbol = NULL;
+    }
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/extern.h b/lib-src/libnyquist/nyquist/xlisp/extern.h
new file mode 100644
index 0000000..7021190
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/extern.h
@@ -0,0 +1,6 @@
+
+xtype_desc create_desc(char *type_name, void (*fm)(), void (*pm)(),
+                       void (*sm)(), unsigned char * (*rm)(), void (*mm)());
+int exttypep(LVAL x, LVAL type_sym);
+
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/osdefs.h b/lib-src/libnyquist/nyquist/xlisp/osdefs.h
new file mode 100644
index 0000000..4b5fd42
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/osdefs.h
@@ -0,0 +1,4 @@
+/* osdefs.h - system specific function declarations */
+
+extern LVAL xsystem(void),xgetkey(void);
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/osptrs.h b/lib-src/libnyquist/nyquist/xlisp/osptrs.h
new file mode 100644
index 0000000..5e5c70d
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/osptrs.h
@@ -0,0 +1,6 @@
+/* osptrs.h - system specific function pointers */
+
+{	"SYSTEM",	S,	xsystem	},
+{	"GET-KEY",	S,	xgetkey	},
+
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/path.c b/lib-src/libnyquist/nyquist/xlisp/path.c
new file mode 100644
index 0000000..5497906
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/path.c
@@ -0,0 +1,226 @@
+/*
+ * New xlisp_path code by Dominic Mazzoni
+ *
+ * There is now a function provided to set the xlisp_path.
+ * This is particularly useful for external programs
+ * (e.g. Audacity, or a Nyquist GUI) that have their own
+ * mechanism of setting/finding the path.  If xlisp_path
+ * is NULL, the old platform-specific methods are still
+ * used.
+ */
+/* CHANGE LOG
+ *
+ * 24-dec-05  RBD
+ *    Made ';' a valid path separator for every system (to work
+ *    around a windows installer limitation)
+ *
+ * 22-jul-07  RBD
+ *    Added get_user_id() 
+ *
+ *  9-jan-08  RBD
+ *    Added find-in-xlisp-path as XLISP primitive
+ */
+
+#include <string.h>
+
+#include "switches.h"
+#include "xlisp.h"
+
+static char *g_xlisp_path = NULL;
+
+void set_xlisp_path(const char *p)
+{
+    if (g_xlisp_path) {
+        free(g_xlisp_path);
+        g_xlisp_path = NULL;
+    }
+
+    if (p) {
+        g_xlisp_path = malloc(strlen(p)+1);
+        strcpy(g_xlisp_path, p);
+    }
+}
+
+#ifdef UNIX
+const char *unix_return_xlisp_path()
+{
+    char *paths = getenv("XLISPPATH");
+    if (!paths || !*paths) {
+        char msg[512];
+        sprintf(msg, "\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
+                "Warning: XLISP failed to find XLISPPATH in the environment.",
+                "If you are using Nyquist, probably you should cd to the",
+                "nyquist directory and type:",
+                "    setenv XLISPPATH `pwd`/runtime:`pwd`/lib",
+                "or set XLISPPATH in your .login or .cshrc file.",
+                "If you use the bash shell, try:",
+                "    XLISPPATH=`pwd`/runtime:`pwd`/lib; export XLISPPATH");
+        errputstr(msg);
+    }
+    return paths;
+}
+#endif
+
+#ifdef WINDOWS
+#include "winfun.h"
+
+const char *windows_return_xlisp_path()
+{
+    #define paths_max 1024
+    static char paths[paths_max];
+    get_xlisp_path(paths, paths_max);
+    /* make sure we got paths, and the list is not empty */
+    if (!paths[0]) {
+        sprintf(paths, "\n%s\n%s\n%s\n",
+           "Warning: XLISP failed to find XLISPPATH in the Registry.",
+           "You should follow the installation instructions. Enter an",
+           "empty string if you really want no search path.");
+        errputstr(paths);
+    }
+
+    return paths;
+}
+
+#endif
+
+#ifdef MACINTOSH
+const char *mac_return_xlisp_path()
+{
+    #define paths_max 1024
+    static char paths[paths_max];
+    int prefs_found = false;
+    get_xlisp_path(paths, paths_max, &prefs_found);
+    if (!paths[0]) {
+        if (prefs_found) {
+            sprintf(paths, "\n%s\n%s\n%s\n",
+             "Warning: XLISP failed to find XLISPPATH in XLisp Preferences.",
+             "You should probably delete XLisp Preferences and let XLisp",
+             "create a new one for you.");
+        }
+        else {
+           sprintf(paths, "\n%s\n%s\n%s\n%s\n%s\n",
+            "Warning: XLISP failed to find XLisp Preferences.",
+            "You should manually locate and load the file runtime:init.lsp",
+            "Nyquist will create an XLisp Preferences file to automatically",
+            "find the file next time. You may edit XLisp Preferences to add",
+            "additional search paths, using a comma as separator.");
+        }
+        errputstr(paths);
+    }
+
+    return paths;
+}
+
+const char *get_user_id()
+{
+    // not implemented for MACINTOSH (OS 9), just use "nyquist"
+    return "nyquist";
+}
+#endif
+
+const char *return_xlisp_path()
+{
+    if (g_xlisp_path)
+        return g_xlisp_path;
+
+#ifdef WINDOWS
+    return windows_return_xlisp_path();
+#endif
+#ifdef MACINTOSH
+    return mac_return_xlisp_path();
+#endif
+#ifdef UNIX
+    return unix_return_xlisp_path();
+#endif
+}
+
+
+char *g_xlptemp = NULL;
+
+// find_in_xlisp_path -- find fname or fname.lsp by searching XLISP_PATH
+//
+// NOTE: this module owns the string. The string is valid
+// until the next call to find_in_xlisp_path()
+//
+const char *find_in_xlisp_path(const char *fname)
+{
+    const char *paths = return_xlisp_path();
+    if (!paths)
+        return NULL;
+
+    while (paths && *paths) {
+        FILE *fp;
+        const char *start;
+        int len;
+
+        /* skip over separator */
+        while (*paths == os_sepchar || *paths == ';') paths++;
+
+        /* find next directory */
+        start = paths;
+        while (*paths && (*paths != os_sepchar && *paths != ';'))
+            paths++;
+
+        if (g_xlptemp) {
+           free(g_xlptemp);
+           g_xlptemp = NULL;
+        }
+
+        len = paths - start;
+        g_xlptemp = malloc(len + strlen(fname) + 10);
+        memcpy(g_xlptemp, start, len);
+
+        if (len == 0)
+           continue;
+
+        /* add "/" if needed */
+        if (g_xlptemp[len-1] != os_pathchar)
+           g_xlptemp[len++] = os_pathchar;
+        
+        /* append the file name */
+        memcpy(&g_xlptemp[len], fname, strlen(fname));
+        len += strlen(fname);
+        g_xlptemp[len] = 0;
+
+
+        /* printf("Attempting to open %s, start is %s\n", g_xlptemp, start); */
+        fp = osaopen(g_xlptemp, "r");
+        if (!fp) {
+            /* try appending the .lsp extension */
+            if (needsextension(g_xlptemp)) {
+                strcat(g_xlptemp, ".lsp");
+                fp = osaopen(g_xlptemp, "r");
+                if (!fp) {
+                    g_xlptemp[strlen(g_xlptemp) - 4] = 0; /* remove .lsp */
+                }
+            }
+        }
+        if (fp) {
+           fclose(fp);
+
+           #ifdef MACINTOSH
+           /* We found the file ok, call setup_preferences to create
+            * XLisp Preferences file (this only happens if previous
+            * attempt to find the file failed
+            */
+           setup_preferences(g_xlptemp);
+           #endif
+
+           return g_xlptemp;
+        }
+    }
+
+    /* It wasn't found */
+    return NULL;
+}
+
+
+/* xfind_in_xlisp_path -- search XLISPPATH for file, return full path */
+LVAL xfind_in_xlisp_path()
+{
+   LVAL string = xlgastring();
+   const char *path = (const char *) getstring(string);
+   xllastarg();
+   path = find_in_xlisp_path(path);
+   return (path ? cvstring(path) : NULL);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlbfun.c b/lib-src/libnyquist/nyquist/xlisp/xlbfun.c
new file mode 100644
index 0000000..1b5a397
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlbfun.c
@@ -0,0 +1,669 @@
+/* xlbfun.c - xlisp basic built-in functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+#include "xlisp.h"
+#include "string.h"
+
+/* forward declarations */
+FORWARD LOCAL LVAL makesymbol(int iflag);
+
+/* xeval - the built-in function 'eval' */
+LVAL xeval(void)
+{
+    LVAL expr;
+
+    /* get the expression to evaluate */
+    expr = xlgetarg();
+    xllastarg();
+
+    /* evaluate the expression */
+    return (xleval(expr));
+}
+
+/* xapply - the built-in function 'apply' */
+LVAL xapply(void)
+{
+    LVAL fun,arglist;
+
+    /* get the function and argument list */
+    fun = xlgetarg();
+    arglist = xlgalist();
+    xllastarg();
+
+    /* apply the function to the arguments */
+    return (xlapply(pushargs(fun,arglist)));
+}
+
+/* xfuncall - the built-in function 'funcall' */
+LVAL xfuncall(void)
+{
+    LVAL *newfp;
+    int argc;
+    
+    /* build a new argument stack frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(xlgetarg());
+    pusharg(NIL); /* will be argc */
+
+    /* push each argument */
+    for (argc = 0; moreargs(); ++argc)
+        pusharg(nextarg());
+
+    /* establish the new stack frame */
+    newfp[2] = cvfixnum((FIXTYPE)argc);
+    xlfp = newfp;
+
+    /* apply the function to the arguments */
+    return (xlapply(argc));
+}
+
+/* xmacroexpand - expand a macro call repeatedly */
+LVAL xmacroexpand(void)
+{
+    LVAL form;
+    form = xlgetarg();
+    xllastarg();
+    return (xlexpandmacros(form));
+}
+
+/* x1macroexpand - expand a macro call */
+LVAL x1macroexpand(void)
+{
+    LVAL form,fun,args;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(fun);
+    xlsave(args);
+
+    /* get the form */
+    form = xlgetarg();
+    xllastarg();
+
+    /* expand until the form isn't a macro call */
+    if (consp(form)) {
+        fun = car(form);		/* get the macro name */
+        args = cdr(form);		/* get the arguments */
+        if (symbolp(fun) && fboundp(fun)) {
+            fun = xlgetfunction(fun);	/* get the expansion function */
+            macroexpand(fun,args,&form);
+        }
+    }
+
+    /* restore the stack and return the expansion */
+    xlpopn(2);
+    return (form);
+}
+
+/* xatom - is this an atom? */
+LVAL xatom(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (atomp(arg) ? s_true : NIL);
+}
+
+/* xsymbolp - is this an symbol? */
+LVAL xsymbolp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (arg == NIL || symbolp(arg) ? s_true : NIL);
+}
+
+/* xnumberp - is this a number? */
+LVAL xnumberp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (fixp(arg) || floatp(arg) ? s_true : NIL);
+}
+
+/* xintegerp - is this an integer? */
+LVAL xintegerp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (fixp(arg) ? s_true : NIL);
+}
+
+/* xfloatp - is this a float? */
+LVAL xfloatp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (floatp(arg) ? s_true : NIL);
+}
+
+/* xcharp - is this a character? */
+LVAL xcharp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (charp(arg) ? s_true : NIL);
+}
+
+/* xstringp - is this a string? */
+LVAL xstringp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (stringp(arg) ? s_true : NIL);
+}
+
+/* xarrayp - is this an array? */
+LVAL xarrayp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (vectorp(arg) ? s_true : NIL);
+}
+
+/* xstreamp - is this a stream? */
+LVAL xstreamp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (streamp(arg) || ustreamp(arg) ? s_true : NIL);
+}
+
+/* xobjectp - is this an object? */
+LVAL xobjectp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (objectp(arg) ? s_true : NIL);
+}
+
+/* xboundp - is this a value bound to this symbol? */
+LVAL xboundp(void)
+{
+    LVAL sym;
+    sym = xlgasymbol();
+    xllastarg();
+    return (boundp(sym) ? s_true : NIL);
+}
+
+/* xfboundp - is this a functional value bound to this symbol? */
+LVAL xfboundp(void)
+{
+    LVAL sym;
+    sym = xlgasymbol();
+    xllastarg();
+    return (fboundp(sym) ? s_true : NIL);
+}
+
+/* xnull - is this null? */
+LVAL xnull(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (null(arg) ? s_true : NIL);
+}
+
+/* xlistp - is this a list? */
+LVAL xlistp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (listp(arg) ? s_true : NIL);
+}
+
+/* xendp - is this the end of a list? */
+LVAL xendp(void)
+{
+    LVAL arg;
+    arg = xlgalist();
+    xllastarg();
+    return (null(arg) ? s_true : NIL);
+}
+
+/* xconsp - is this a cons? */
+LVAL xconsp(void)
+{
+    LVAL arg;
+    arg = xlgetarg();
+    xllastarg();
+    return (consp(arg) ? s_true : NIL);
+}
+
+/* xeq - are these equal? */
+LVAL xeq(void)
+{
+    LVAL arg1,arg2;
+
+    /* get the two arguments */
+    arg1 = xlgetarg();
+    arg2 = xlgetarg();
+    xllastarg();
+
+    /* compare the arguments */
+    return (arg1 == arg2 ? s_true : NIL);
+}
+
+/* xeql - are these equal? */
+LVAL xeql(void)
+{
+    LVAL arg1,arg2;
+
+    /* get the two arguments */
+    arg1 = xlgetarg();
+    arg2 = xlgetarg();
+    xllastarg();
+
+    /* compare the arguments */
+    return (eql(arg1,arg2) ? s_true : NIL);
+}
+
+/* xequal - are these equal? (recursive) */
+LVAL xequal(void)
+{
+    LVAL arg1,arg2;
+
+    /* get the two arguments */
+    arg1 = xlgetarg();
+    arg2 = xlgetarg();
+    xllastarg();
+
+    /* compare the arguments */
+    return (lval_equal(arg1,arg2) ? s_true : NIL);
+}
+
+/* xset - built-in function set */
+LVAL xset(void)
+{
+    LVAL sym,val;
+
+    /* get the symbol and new value */
+    sym = xlgasymbol();
+    val = xlgetarg();
+    xllastarg();
+
+    /* assign the symbol the value of argument 2 and the return value */
+    setvalue(sym,val);
+
+    /* return the result value */
+    return (val);
+}
+
+/* xgensym - generate a symbol */
+LVAL xgensym(void)
+{
+    char sym[STRMAX+11]; /* enough space for prefix and number */
+    LVAL x;
+
+    /* get the prefix or number */
+    if (moreargs()) {
+        x = xlgetarg();
+        switch (ntype(x)) {
+        case SYMBOL:
+                x = getpname(x);
+        case STRING:
+                strncpy(gsprefix, (char *) getstring(x),STRMAX);
+                gsprefix[STRMAX] = '\0';
+                break;
+        case FIXNUM:
+                gsnumber = getfixnum(x);
+                break;
+        default:
+                xlerror("bad argument type",x);
+        }
+    }
+    xllastarg();
+
+    /* create the pname of the new symbol */
+    sprintf(sym,"%s%d",gsprefix,gsnumber++);
+
+    /* make a symbol with this print name */
+    return (xlmakesym(sym));
+}
+
+/* xmakesymbol - make a new uninterned symbol */
+LVAL xmakesymbol(void)
+{
+    return (makesymbol(FALSE));
+}
+
+/* xintern - make a new interned symbol */
+LVAL xintern(void)
+{
+    return (makesymbol(TRUE));
+}
+
+/* makesymbol - make a new symbol */
+LOCAL LVAL makesymbol(int iflag)
+{
+    LVAL pname;
+
+    /* get the print name of the symbol to intern */
+    pname = xlgastring();
+    xllastarg();
+
+    /* make the symbol */
+    return (iflag ? xlenter((char *) getstring(pname))
+                      : xlmakesym((char *) getstring(pname)));
+}
+
+/* xsymname - get the print name of a symbol */
+LVAL xsymname(void)
+{
+    LVAL sym;
+
+    /* get the symbol */
+    sym = xlgasymbol();
+    xllastarg();
+
+    /* return the print name */
+    return (getpname(sym));
+}
+
+/* xsymvalue - get the value of a symbol */
+LVAL xsymvalue(void)
+{
+    LVAL sym,val;
+
+    /* get the symbol */
+    sym = xlgasymbol();
+    xllastarg();
+
+    /* get the global value */
+    while ((val = getvalue(sym)) == s_unbound)
+        xlunbound(sym);
+
+    /* return its value */
+    return (val);
+}
+
+/* xsymfunction - get the functional value of a symbol */
+LVAL xsymfunction(void)
+{
+    LVAL sym,val;
+
+    /* get the symbol */
+    sym = xlgasymbol();
+    xllastarg();
+
+    /* get the global value */
+    while ((val = getfunction(sym)) == s_unbound)
+        xlfunbound(sym);
+
+    /* return its value */
+    return (val);
+}
+
+/* xsymplist - get the property list of a symbol */
+LVAL xsymplist(void)
+{
+    LVAL sym;
+
+    /* get the symbol */
+    sym = xlgasymbol();
+    xllastarg();
+
+    /* return the property list */
+    return (getplist(sym));
+}
+
+/* xget - get the value of a property */
+LVAL xget(void)
+{
+    LVAL sym,prp;
+
+    /* get the symbol and property */
+    sym = xlgasymbol();
+    prp = xlgasymbol();
+    xllastarg();
+
+    /* retrieve the property value */
+    return (xlgetprop(sym,prp));
+}
+
+/* xputprop - set the value of a property */
+LVAL xputprop(void)
+{
+    LVAL sym,val,prp;
+
+    /* get the symbol and property */
+    sym = xlgasymbol();
+    val = xlgetarg();
+    prp = xlgasymbol();
+    xllastarg();
+
+    /* set the property value */
+    xlputprop(sym,val,prp);
+
+    /* return the value */
+    return (val);
+}
+
+/* xremprop - remove a property value from a property list */
+LVAL xremprop(void)
+{
+    LVAL sym,prp;
+
+    /* get the symbol and property */
+    sym = xlgasymbol();
+    prp = xlgasymbol();
+    xllastarg();
+
+    /* remove the property */
+    xlremprop(sym,prp);
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xhash - compute the hash value of a string or symbol */
+LVAL xhash(void)
+{
+    unsigned char *str;
+    LVAL len,val;
+    int n;
+
+    /* get the string and the table length */
+    val = xlgetarg();
+    len = xlgafixnum(); n = (int)getfixnum(len);
+    xllastarg();
+
+    /* get the string */
+    if (symbolp(val))
+        str = getstring(getpname(val));
+    else if (stringp(val))
+        str = getstring(val);
+    else {
+        xlerror("bad argument type",val);
+        str = NULL;
+    }
+
+    /* return the hash index */
+    return (cvfixnum((FIXTYPE)hash((char *) str, n)));
+}
+
+/* xaref - array reference function */
+LVAL xaref(void)
+{
+    LVAL array,index;
+    int i;
+
+    /* get the array and the index */
+    array = xlgavector();
+    index = xlgafixnum(); i = (int)getfixnum(index);
+    xllastarg();
+
+    /* range check the index */
+    if (i < 0 || i >= getsize(array))
+        xlerror("array index out of bounds",index);
+
+    /* return the array element */
+    return (getelement(array,i));
+}
+
+/* xmkarray - make a new array */
+LVAL xmkarray(void)
+{
+    LVAL size;
+    int n;
+
+    /* get the size of the array */
+    size = xlgafixnum() ; n = (int)getfixnum(size);
+    xllastarg();
+
+    /* create the array */
+    return (newvector(n));
+}
+
+/* xvector - make a vector */
+LVAL xvector(void)
+{
+    LVAL val;
+    int i;
+
+    /* make the vector */
+    val = newvector(xlargc);
+
+    /* store each argument */
+    for (i = 0; moreargs(); ++i)
+        setelement(val,i,nextarg());
+    xllastarg();
+
+    /* return the vector */
+    return (val);
+}
+
+/* allow xerror, xcleanup, xtoplevel, and xcontinue to return nothing */
+/* #pragma warning(disable: 4035)*/
+
+/* xerror - special form 'error' */
+LVAL xerror(void)
+{
+    LVAL emsg,arg;
+
+    /* get the error message and the argument */
+    emsg = xlgastring();
+    arg = (moreargs() ? xlgetarg() : s_unbound);
+    xllastarg();
+
+    /* signal the error */
+    xlerror((char *) getstring(emsg),arg);
+    return NIL; /* won't ever happen */
+}
+
+/* xcerror - special form 'cerror' */
+LVAL xcerror(void)
+{
+    LVAL cmsg,emsg,arg;
+
+    /* get the correction message, the error message, and the argument */
+    cmsg = xlgastring();
+    emsg = xlgastring();
+    arg = (moreargs() ? xlgetarg() : s_unbound);
+    xllastarg();
+
+    /* signal the error */
+    xlcerror((char *) getstring(cmsg), (char *) getstring(emsg),arg);
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xbreak - special form 'break' */
+LVAL xbreak(void)
+{
+    LVAL emsg,arg;
+
+    /* get the error message */
+    emsg = (moreargs() ? xlgastring() : NIL);
+    arg = (moreargs() ? xlgetarg() : s_unbound);
+    xllastarg();
+
+    /* enter the break loop */
+    xlbreak((emsg ? (char *) getstring(emsg) : "**BREAK**"),arg);
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xcleanup - special form 'clean-up' */
+LVAL xcleanup(void)
+{
+    xllastarg();
+    xlcleanup();
+}
+
+/* xtoplevel - special form 'top-level' */
+LVAL xtoplevel(void)
+{
+    xllastarg();
+    xltoplevel();
+}
+
+/* xcontinue - special form 'continue' */
+LVAL xcontinue(void)
+{
+    xllastarg();
+    xlcontinue();
+}
+
+/* xevalhook - eval hook function */
+LVAL xevalhook(void)
+{
+    LVAL expr,newehook,newahook,newenv,oldenv,oldfenv,olddenv,val;
+
+    /* protect some pointers */
+    xlstkcheck(3);
+    xlsave(oldenv);
+    xlsave(oldfenv);
+    xlsave(newenv);
+
+    /* get the expression, the new hook functions and the environment */
+    expr = xlgetarg();
+    newehook = xlgetarg();
+    newahook = xlgetarg();
+    newenv = (moreargs() ? xlgalist() : NIL);
+    xllastarg();
+
+    /* bind *evalhook* and *applyhook* to the hook functions */
+    olddenv = xldenv;
+    xldbind(s_evalhook,newehook);
+    xldbind(s_applyhook,newahook);
+
+    /* establish the environment for the hook function */
+    if (newenv) {
+        oldenv = xlenv;
+        oldfenv = xlfenv;
+        xlenv = car(newenv);
+        xlfenv = cdr(newenv);
+    }
+
+    /* evaluate the expression (bypassing *evalhook*) */
+    val = xlxeval(expr);
+
+    /* restore the old environment */
+    xlunbind(olddenv);
+    if (newenv) {
+        xlenv = oldenv;
+        xlfenv = oldfenv;
+    }
+
+    /* restore the stack */
+    xlpopn(3);
+
+    /* return the result */
+    return (val);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlcont.c b/lib-src/libnyquist/nyquist/xlisp/xlcont.c
new file mode 100644
index 0000000..1bc1e8f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlcont.c
@@ -0,0 +1,1427 @@
+/* xlcont - xlisp special forms */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL xlvalue;
+extern LVAL s_setf,s_car,s_cdr,s_nth,s_aref,s_get;
+extern LVAL s_svalue,s_sfunction,s_splist;
+extern LVAL s_lambda,s_macro;
+
+/* forward declarations */
+FORWARD LOCAL LVAL bquote1(LVAL expr);
+FORWARD LOCAL void placeform(LVAL place, LVAL value);
+FORWARD LOCAL LVAL let(int pflag);
+FORWARD LOCAL LVAL flet(LVAL type, int letflag);
+FORWARD LOCAL LVAL prog(int pflag);
+FORWARD LOCAL LVAL progx(int n);
+FORWARD LOCAL LVAL doloop(int pflag);
+FORWARD LOCAL LVAL evarg(LVAL *pargs);
+FORWARD LOCAL LVAL match(int type, LVAL *pargs);
+FORWARD LOCAL LVAL evmatch(int type, LVAL *pargs);
+FORWARD LOCAL void toofew(LVAL args);
+FORWARD LOCAL void toomany(LVAL args);
+FORWARD LOCAL void setffunction(LVAL fun, LVAL place, LVAL value);
+FORWARD LOCAL int keypresent(LVAL key, LVAL list);
+FORWARD LOCAL void dobindings(LVAL list, LVAL env);
+FORWARD LOCAL void tagbody(void);
+FORWARD LOCAL void doupdates(LVAL list, int pflag);
+
+
+/* dummy node type for a list */
+#define LIST	-1
+
+/* xquote - special form 'quote' */
+LVAL xquote(void)
+{
+    LVAL val;
+    val = xlgetarg();
+    xllastarg();
+    return (val);
+}
+
+/* xfunction - special form 'function' */
+LVAL xfunction(void)
+{
+    LVAL val;
+
+    /* get the argument */
+    val = xlgetarg();
+    xllastarg();
+
+    /* create a closure for lambda expressions */
+    if (consp(val) && car(val) == s_lambda && consp(cdr(val)))
+        val = xlclose(NIL,s_lambda,car(cdr(val)),cdr(cdr(val)),xlenv,xlfenv);
+
+    /* otherwise, get the value of a symbol */
+    else if (symbolp(val))
+        val = xlgetfunction(val);
+
+    /* otherwise, its an error */
+    else
+        xlerror("not a function",val);
+
+    /* return the function */
+    return (val);
+}
+
+/* xbquote - back quote special form */
+LVAL xbquote(void)
+{
+    LVAL expr;
+
+    /* get the expression */
+    expr = xlgetarg();
+    xllastarg();
+
+    /* fill in the template */
+    return (bquote1(expr));
+}
+
+/* bquote1 - back quote helper function */
+LOCAL LVAL bquote1(LVAL expr)
+{
+    LVAL val,list,last,new;
+
+    /* handle atoms */
+    if (atomp(expr))
+        val = expr;
+
+    /* handle (comma <expr>) */
+    else if (car(expr) == s_comma) {
+        if (atomp(cdr(expr)))
+            xlfail("bad comma expression");
+        val = xleval(car(cdr(expr)));
+    }
+
+    /* handle ((comma-at <expr>) ... ) */
+    else if (consp(car(expr)) && car(car(expr)) == s_comat) {
+        xlstkcheck(2);
+        xlsave(list);
+        xlsave(val);
+        if (atomp(cdr(car(expr))))
+            xlfail("bad comma-at expression");
+        list = xleval(car(cdr(car(expr))));
+        for (last = NIL; consp(list); list = cdr(list)) {
+            new = consa(car(list));
+            if (last)
+                rplacd(last,new);
+            else
+                val = new;
+            last = new;
+        }
+        if (last)
+            rplacd(last,bquote1(cdr(expr)));
+        else
+            val = bquote1(cdr(expr));
+        xlpopn(2);
+    }
+
+    /* handle any other list */
+    else {
+        xlsave1(val);
+        val = consa(NIL);
+        rplaca(val,bquote1(car(expr)));
+        rplacd(val,bquote1(cdr(expr)));
+        xlpop();
+    }
+
+    /* return the result */
+    return (val);
+}
+
+/* xlambda - special form 'lambda' */
+LVAL xlambda(void)
+{
+    LVAL fargs,arglist,val;
+
+    /* get the formal argument list and function body */
+    xlsave1(arglist);
+    fargs = xlgalist();
+    arglist = makearglist(xlargc,xlargv);
+
+    /* create a new function definition */
+    val = xlclose(NIL,s_lambda,fargs,arglist,xlenv,xlfenv);
+
+    /* restore the stack and return the closure */
+    xlpop();
+    return (val);
+}
+
+/* xgetlambda - get the lambda expression associated with a closure */
+LVAL xgetlambda(void)
+{
+    LVAL closure;
+    closure = xlgaclosure();
+    return (cons(gettype(closure),
+                 cons(getlambda(closure),getbody(closure))));
+}
+
+/* xsetq - special form 'setq' */
+LVAL xsetq(void)
+{
+    LVAL sym,val;
+
+    /* handle each pair of arguments */
+    for (val = NIL; moreargs(); ) {
+        sym = xlgasymbol();
+        val = xleval(nextarg());
+        xlsetvalue(sym,val);
+    }
+
+    /* return the result value */
+    return (val);
+}
+
+/* xpsetq - special form 'psetq' */
+LVAL xpsetq(void)
+{
+    LVAL plist,sym,val;
+
+    /* protect some pointers */
+    xlsave1(plist);
+
+    /* handle each pair of arguments */
+    for (val = NIL; moreargs(); ) {
+        sym = xlgasymbol();
+        val = xleval(nextarg());
+        plist = cons(cons(sym,val),plist);
+    }
+
+    /* do parallel sets */
+    for (; plist; plist = cdr(plist))
+        xlsetvalue(car(car(plist)),cdr(car(plist)));
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result value */
+    return (val);
+}
+
+/* xsetf - special form 'setf' */
+LVAL xsetf(void)
+{
+    LVAL place,value;
+
+    /* protect some pointers */
+    xlsave1(value);
+
+    /* handle each pair of arguments */
+    while (moreargs()) {
+
+        /* get place and value */
+        place = xlgetarg();
+        value = xleval(nextarg());
+
+        /* expand macros in the place form */
+        if (consp(place))
+            place = xlexpandmacros(place);
+        
+        /* check the place form */
+        if (symbolp(place))
+            xlsetvalue(place,value);
+        else if (consp(place))
+            placeform(place,value);
+        else
+            xlfail("bad place form");
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the value */
+    return (value);
+}
+
+/* placeform - handle a place form other than a symbol */
+LOCAL void placeform(LVAL place, LVAL value)
+{
+    LVAL fun,arg1,arg2;
+    int i;
+
+    /* check the function name */
+    if ((fun = match(SYMBOL,&place)) == s_get) {
+        xlstkcheck(2);
+        xlsave(arg1);
+        xlsave(arg2);
+        arg1 = evmatch(SYMBOL,&place);
+        arg2 = evmatch(SYMBOL,&place);
+        if (place) toomany(place);
+        xlputprop(arg1,value,arg2);
+        xlpopn(2);
+    }
+    else if (fun == s_svalue) {
+        arg1 = evmatch(SYMBOL,&place);
+        if (place) toomany(place);
+        setvalue(arg1,value);
+    }
+    else if (fun == s_sfunction) {
+        arg1 = evmatch(SYMBOL,&place);
+        if (place) toomany(place);
+        setfunction(arg1,value);
+    }
+    else if (fun == s_splist) {
+        arg1 = evmatch(SYMBOL,&place);
+        if (place) toomany(place);
+        setplist(arg1,value);
+    }
+    else if (fun == s_car) {
+        arg1 = evmatch(CONS,&place);
+        if (place) toomany(place);
+        rplaca(arg1,value);
+    }
+    else if (fun == s_cdr) {
+        arg1 = evmatch(CONS,&place);
+        if (place) toomany(place);
+        rplacd(arg1,value);
+    }
+    else if (fun == s_nth) {
+        xlsave1(arg1);
+        arg1 = evmatch(FIXNUM,&place);
+        arg2 = evmatch(LIST,&place);
+        if (place) toomany(place);
+        for (i = (int)getfixnum(arg1); i > 0 && consp(arg2); --i)
+            arg2 = cdr(arg2);
+        if (consp(arg2))
+            rplaca(arg2,value);
+        xlpop();
+    }
+    else if (fun == s_aref) {
+        xlsave1(arg1);
+        arg1 = evmatch(VECTOR,&place);
+        arg2 = evmatch(FIXNUM,&place); i = (int)getfixnum(arg2);
+        if (place) toomany(place);
+        if (i < 0 || i >= getsize(arg1))
+            xlerror("index out of range",arg2);
+        setelement(arg1,i,value);
+        xlpop();
+    }
+    else if ((fun = xlgetprop(fun,s_setf)))
+        setffunction(fun,place,value);
+    else
+        xlfail("bad place form");
+}
+
+/* setffunction - call a user defined setf function */
+LOCAL void setffunction(LVAL fun, LVAL place, LVAL value)
+{
+    LVAL *newfp;
+    int argc;
+
+    /* create the new call frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(fun);
+    pusharg(NIL);
+
+    /* push the values of all of the place expressions and the new value */
+    for (argc = 1; consp(place); place = cdr(place), ++argc)
+        pusharg(xleval(car(place)));
+    pusharg(value);
+
+    /* insert the argument count and establish the call frame */
+    newfp[2] = cvfixnum((FIXTYPE)argc);
+    xlfp = newfp;
+
+    /* apply the function */
+    xlapply(argc);
+}
+                       
+/* xdefun - special form 'defun' */
+LVAL xdefun(void)
+{
+    LVAL sym,fargs,arglist;
+
+    /* get the function symbol and formal argument list */
+    xlsave1(arglist);
+    sym = xlgasymbol();
+    fargs = xlgalist();
+    arglist = makearglist(xlargc,xlargv);
+
+    /* make the symbol point to a new function definition */
+    xlsetfunction(sym,xlclose(sym,s_lambda,fargs,arglist,xlenv,xlfenv));
+
+    /* restore the stack and return the function symbol */
+    xlpop();
+    return (sym);
+}
+
+/* xdefmacro - special form 'defmacro' */
+LVAL xdefmacro(void)
+{
+    LVAL sym,fargs,arglist;
+
+    /* get the function symbol and formal argument list */
+    xlsave1(arglist);
+    sym = xlgasymbol();
+    fargs = xlgalist();
+    arglist = makearglist(xlargc,xlargv);
+
+    /* make the symbol point to a new function definition */
+    xlsetfunction(sym,xlclose(sym,s_macro,fargs,arglist,NIL,NIL));
+
+    /* restore the stack and return the function symbol */
+    xlpop();
+    return (sym);
+}
+
+/* xcond - special form 'cond' */
+LVAL xcond(void)
+{
+    LVAL list,val;
+
+    /* find a predicate that is true */
+    for (val = NIL; moreargs(); ) {
+
+        /* get the next conditional */
+        list = nextarg();
+
+        /* evaluate the predicate part */
+        if (consp(list) && (val = xleval(car(list)))) {
+
+            /* evaluate each expression */
+            for (list = cdr(list); consp(list); list = cdr(list))
+                val = xleval(car(list));
+
+            /* exit the loop */
+            break;
+        }
+    }
+
+    /* return the value */
+    return (val);
+}
+
+/* xwhen - special form 'when' */
+LVAL xwhen(void)
+{
+    LVAL val;
+
+    /* check the test expression */
+    if ((val = xleval(xlgetarg())))
+        while (moreargs())
+            val = xleval(nextarg());
+
+    /* return the value */
+    return (val);
+}
+
+/* xunless - special form 'unless' */
+LVAL xunless(void)
+{
+    LVAL val=NIL;
+
+    /* check the test expression */
+    if (xleval(xlgetarg()) == NIL)
+        while (moreargs())
+            val = xleval(nextarg());
+
+    /* return the value */
+    return (val);
+}
+
+/* xcase - special form 'case' */
+LVAL xcase(void)
+{
+    LVAL key,list,cases,val;
+
+    /* protect some pointers */
+    xlsave1(key);
+
+    /* get the key expression */
+    key = xleval(nextarg());
+
+    /* find a case that matches */
+    for (val = NIL; moreargs(); ) {
+
+        /* get the next case clause */
+        list = nextarg();
+
+        /* make sure this is a valid clause */
+        if (consp(list)) {
+
+            /* compare the key list against the key */
+            if ((cases = car(list)) == s_true ||
+                (listp(cases) && keypresent(key,cases)) ||
+                eql(key,cases)) {
+
+                /* evaluate each expression */
+                for (list = cdr(list); consp(list); list = cdr(list))
+                    val = xleval(car(list));
+
+                /* exit the loop */
+                break;
+            }
+        }
+        else
+            xlerror("bad case clause",list);
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the value */
+    return (val);
+}
+
+/* keypresent - check for the presence of a key in a list */
+LOCAL int keypresent(LVAL key, LVAL list)
+{
+    for (; consp(list); list = cdr(list))
+        if (eql(car(list),key))
+            return (TRUE);
+    return (FALSE);
+}
+
+/* xand - special form 'and' */
+LVAL xand(void)
+{
+    LVAL val;
+
+    /* evaluate each argument */
+    for (val = s_true; moreargs(); )
+        if ((val = xleval(nextarg())) == NIL)
+            break;
+
+    /* return the result value */
+    return (val);
+}
+
+/* x_or - special form 'or' */
+/* this was named xor, but that caused problems with c++ under gcc */
+LVAL x_or(void)
+{
+    LVAL val;
+
+    /* evaluate each argument */
+    for (val = NIL; moreargs(); )
+        if ((val = xleval(nextarg())))
+            break;
+
+    /* return the result value */
+    return (val);
+}
+
+/* xif - special form 'if' */
+LVAL xif(void)
+{
+    LVAL testexpr,thenexpr,elseexpr;
+
+    /* get the test expression, then clause and else clause */
+    testexpr = xlgetarg();
+    thenexpr = xlgetarg();
+    elseexpr = (moreargs() ? xlgetarg() : NIL);
+    xllastarg();
+
+    /* evaluate the appropriate clause */
+    return (xleval(xleval(testexpr) ? thenexpr : elseexpr));
+}
+
+/* xlet - special form 'let' */
+LVAL xlet(void)
+{
+    return (let(TRUE));
+}
+
+/* xletstar - special form 'let*' */
+LVAL xletstar(void)
+{
+    return (let(FALSE));
+}
+
+/* let - common let routine */
+LOCAL LVAL let(int pflag)
+{
+    LVAL newenv,val;
+
+    /* protect some pointers */
+    xlsave1(newenv);
+
+    /* create a new environment frame */
+    newenv = xlframe(xlenv);
+
+    /* get the list of bindings and bind the symbols */
+    if (!pflag) {
+        xlenv = newenv;
+    }
+    dobindings(xlgalist(),newenv);
+    if (pflag) {
+        xlenv = newenv;
+    }
+
+    /* execute the code */
+    for (val = NIL; moreargs(); )
+        val = xleval(nextarg());
+
+    /* unbind the arguments */
+    xlenv = cdr(xlenv);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xflet - built-in function 'flet' */
+LVAL xflet(void)
+{
+    return (flet(s_lambda,TRUE));
+}
+
+/* xlabels - built-in function 'labels' */
+LVAL xlabels(void)
+{
+    return (flet(s_lambda,FALSE));
+}
+
+/* xmacrolet - built-in function 'macrolet' */
+LVAL xmacrolet(void)
+{
+    return (flet(s_macro,TRUE));
+}
+
+/* flet - common flet/labels/macrolet routine */
+LOCAL LVAL flet(LVAL type, int letflag)
+{
+    LVAL list,bnd,sym,fargs,val;
+
+    /* create a new environment frame */
+    xlfenv = xlframe(xlfenv);
+
+    /* bind each symbol in the list of bindings */
+    for (list = xlgalist(); consp(list); list = cdr(list)) {
+
+        /* get the next binding */
+        bnd = car(list);
+
+        /* get the symbol and the function definition */
+        sym = match(SYMBOL,&bnd);
+        fargs = match(LIST,&bnd);
+        val = xlclose(sym,type,fargs,bnd,xlenv,(letflag?cdr(xlfenv):xlfenv));
+
+        /* bind the value to the symbol */
+        xlfbind(sym,val);
+    }
+
+    /* execute the code */
+    for (val = NIL; moreargs(); )
+        val = xleval(nextarg());
+
+    /* unbind the arguments */
+    xlfenv = cdr(xlfenv);
+
+    /* return the result */
+    return (val);
+}
+
+/* xprog - special form 'prog' */
+LVAL xprog(void)
+{
+    return (prog(TRUE));
+}
+
+/* xprogstar - special form 'prog*' */
+LVAL xprogstar(void)
+{
+    return (prog(FALSE));
+}
+
+/* prog - common prog routine */
+LOCAL LVAL prog(int pflag)
+{
+    LVAL newenv,val;
+    XLCONTEXT cntxt;
+
+    /* protect some pointers */
+    xlsave1(newenv);
+
+    /* create a new environment frame */
+    newenv = xlframe(xlenv);
+
+    /* establish a new execution context */
+    xlbegin(&cntxt,CF_RETURN,NIL);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else {
+
+        /* get the list of bindings and bind the symbols */
+        if (!pflag) {
+            xlenv = newenv;
+        }
+        dobindings(xlgalist(),newenv);
+        if (pflag) {
+            xlenv = newenv;
+        }
+
+        /* execute the code */
+        tagbody();
+        val = NIL;
+
+        /* unbind the arguments */
+        xlenv = cdr(xlenv);
+    }
+    xlend(&cntxt);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* 4035 is the "no return value" warning message */
+/* xgo, xreturn, xrtnfrom, and xthrow don't return anything */
+/* #pragma warning(disable: 4035) */
+/* xgo - special form 'go' */
+LVAL xgo(void)
+{
+    LVAL label;
+
+    /* get the target label */
+    label = xlgetarg();
+    xllastarg();
+
+    /* transfer to the label */
+    xlgo(label);
+    return NIL; /* never happens */
+}
+
+/* xreturn - special form 'return' */
+LVAL xreturn(void)
+{
+    LVAL val;
+
+    /* get the return value */
+    val = (moreargs() ? xleval(nextarg()) : NIL);
+    xllastarg();
+
+    /* return from the inner most block */
+    xlreturn(NIL,val);
+    return NIL; /* never happens */
+}
+
+/* xrtnfrom - special form 'return-from' */
+LVAL xrtnfrom(void)
+{
+    LVAL name,val;
+
+    /* get the return value */
+    name = xlgasymbol();
+    val = (moreargs() ? xleval(nextarg()) : NIL);
+    xllastarg();
+
+    /* return from the inner most block */
+    xlreturn(name,val);
+    return NIL; /* never happens */
+}
+
+/* xprog1 - special form 'prog1' */
+LVAL xprog1(void)
+{
+    return (progx(1));
+}
+
+/* xprog2 - special form 'prog2' */
+LVAL xprog2(void)
+{
+    return (progx(2));
+}
+
+/* progx - common progx code */
+LOCAL LVAL progx(int n)
+{
+    LVAL val;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* evaluate the first n expressions */
+    while (moreargs() && --n >= 0)
+        val = xleval(nextarg());
+
+    /* evaluate each remaining argument */
+    while (moreargs())
+        xleval(nextarg());
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the last test expression value */
+    return (val);
+}
+
+/* xprogn - special form 'progn' */
+LVAL xprogn(void)
+{
+    LVAL val;
+
+    /* evaluate each expression */
+    for (val = NIL; moreargs(); )
+        val = xleval(nextarg());
+
+    /* return the last test expression value */
+    return (val);
+}
+
+/* xprogv - special form 'progv' */
+LVAL xprogv(void)
+{
+    LVAL olddenv,vars,vals,val;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(vars);
+    xlsave(vals);
+
+    /* get the list of variables and the list of values */
+    vars = xlgetarg(); vars = xleval(vars);
+    vals = xlgetarg(); vals = xleval(vals);
+
+    /* bind the values to the variables */
+    for (olddenv = xldenv; consp(vars); vars = cdr(vars)) {
+        if (!symbolp(car(vars)))
+            xlerror("expecting a symbol",car(vars));
+        if (consp(vals)) {
+            xldbind(car(vars),car(vals));
+            vals = cdr(vals);
+        }
+        else
+            xldbind(car(vars),s_unbound);
+    }
+
+    /* evaluate each expression */
+    for (val = NIL; moreargs(); )
+        val = xleval(nextarg());
+
+    /* restore the previous environment and the stack */
+    xlunbind(olddenv);
+    xlpopn(2);
+
+    /* return the last test expression value */
+    return (val);
+}
+
+/* xloop - special form 'loop' */
+LVAL xloop(void)
+{
+    LVAL *argv,arg,val;
+    XLCONTEXT cntxt;
+    int argc;
+
+    /* protect some pointers */
+    xlsave1(arg);
+
+    /* establish a new execution context */
+    xlbegin(&cntxt,CF_RETURN,NIL);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else
+        for (argv = xlargv, argc = xlargc; ; xlargv = argv, xlargc = argc)
+            while (moreargs()) {
+                arg = nextarg();
+                if (consp(arg))
+                    xleval(arg);
+            }
+    xlend(&cntxt);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xdo - special form 'do' */
+LVAL xdo(void)
+{
+    return (doloop(TRUE));
+}
+
+/* xdostar - special form 'do*' */
+LVAL xdostar(void)
+{
+    return (doloop(FALSE));
+}
+
+/* doloop - common do routine */
+LOCAL LVAL doloop(int pflag)
+{
+    LVAL newenv,*argv,blist,clist,test,val;
+    XLCONTEXT cntxt;
+    int argc;
+
+    /* protect some pointers */
+    xlsave1(newenv);
+
+    /* get the list of bindings, the exit test and the result forms */
+    blist = xlgalist();
+    clist = xlgalist();
+    test = (consp(clist) ? car(clist) : NIL);
+    argv = xlargv;
+    argc = xlargc;
+
+    /* create a new environment frame */
+    newenv = xlframe(xlenv);
+
+    /* establish a new execution context */
+    xlbegin(&cntxt,CF_RETURN,NIL);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else {
+
+        /* bind the symbols */
+        if (!pflag) {
+            xlenv = newenv;
+        }
+        dobindings(blist,newenv);
+        if (pflag) {
+            xlenv = newenv;
+        }
+
+        /* execute the loop as long as the test is false */
+        for (val = NIL; xleval(test) == NIL; doupdates(blist,pflag)) {
+            xlargv = argv;
+            xlargc = argc;
+            tagbody();
+        }
+
+        /* evaluate the result expression */
+        if (consp(clist))
+            for (clist = cdr(clist); consp(clist); clist = cdr(clist))
+                val = xleval(car(clist));
+
+        /* unbind the arguments */
+        xlenv = cdr(xlenv);
+    }
+    xlend(&cntxt);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xdolist - special form 'dolist' */
+LVAL xdolist(void)
+{
+    LVAL list,*argv,clist,sym,val;
+    XLCONTEXT cntxt;
+    int argc;
+
+    /* protect some pointers */
+    xlsave1(list);
+
+    /* get the control list (sym list result-expr) */
+    clist = xlgalist();
+    sym = match(SYMBOL,&clist);
+    list = evmatch(LIST,&clist);
+    argv = xlargv;
+    argc = xlargc;
+
+    /* initialize the local environment */
+    xlenv = xlframe(xlenv);
+    xlbind(sym,NIL);
+
+    /* establish a new execution context */
+    xlbegin(&cntxt,CF_RETURN,NIL);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else {
+
+        /* loop through the list */
+        for (val = NIL; consp(list); list = cdr(list)) {
+
+            /* bind the symbol to the next list element */
+            xlsetvalue(sym,car(list));
+
+            /* execute the loop body */
+            xlargv = argv;
+            xlargc = argc;
+            tagbody();
+        }
+
+        /* evaluate the result expression */
+        xlsetvalue(sym,NIL);
+        val = (consp(clist) ? xleval(car(clist)) : NIL);
+
+        /* unbind the arguments */
+        xlenv = cdr(xlenv);
+    }
+    xlend(&cntxt);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xdotimes - special form 'dotimes' */
+LVAL xdotimes(void)
+{
+    LVAL *argv,clist,sym,cnt,val;
+    XLCONTEXT cntxt;
+    int argc,n,i;
+
+    /* get the control list (sym list result-expr) */
+    clist = xlgalist();
+    sym = match(SYMBOL,&clist);
+    cnt = evmatch(FIXNUM,&clist); n = getfixnum(cnt);
+    argv = xlargv;
+    argc = xlargc;
+
+    /* initialize the local environment */
+    xlenv = xlframe(xlenv);
+    xlbind(sym,NIL);
+
+    /* establish a new execution context */
+    xlbegin(&cntxt,CF_RETURN,NIL);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else {
+
+        /* loop through for each value from zero to n-1 */
+        for (val = NIL, i = 0; i < n; ++i) {
+
+            /* bind the symbol to the next list element */
+            xlsetvalue(sym,cvfixnum((FIXTYPE)i));
+
+            /* execute the loop body */
+            xlargv = argv;
+            xlargc = argc;
+            tagbody();
+        }
+
+        /* evaluate the result expression */
+        xlsetvalue(sym,cnt);
+        val = (consp(clist) ? xleval(car(clist)) : NIL);
+
+        /* unbind the arguments */
+        xlenv = cdr(xlenv);
+    }
+    xlend(&cntxt);
+
+    /* return the result */
+    return (val);
+}
+
+/* xblock - special form 'block' */
+LVAL xblock(void)
+{
+    LVAL name,val;
+    XLCONTEXT cntxt;
+
+    /* get the block name */
+    name = xlgetarg();
+    if (name && !symbolp(name))
+        xlbadtype(name);
+
+    /* execute the block */
+    xlbegin(&cntxt,CF_RETURN,name);
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else
+        for (val = NIL; moreargs(); )
+            val = xleval(nextarg());
+    xlend(&cntxt);
+
+    /* return the value of the last expression */
+    return (val);
+}
+
+/* xtagbody - special form 'tagbody' */
+LVAL xtagbody(void)
+{
+    tagbody();
+    return (NIL);
+}
+
+/* xcatch - special form 'catch' */
+LVAL xcatch(void)
+{
+    XLCONTEXT cntxt;
+    LVAL tag,val;
+
+    /* protect some pointers */
+    xlsave1(tag);
+
+    /* get the tag */
+    tag = xleval(nextarg());
+
+    /* establish an execution context */
+    xlbegin(&cntxt,CF_THROW,tag);
+
+    /* check for 'throw' */
+    if (setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+
+    /* otherwise, evaluate the remainder of the arguments */
+    else {
+        for (val = NIL; moreargs(); )
+            val = xleval(nextarg());
+    }
+    xlend(&cntxt);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xthrow - special form 'throw' */
+LVAL xthrow(void)
+{
+    LVAL tag,val;
+
+    /* get the tag and value */
+    tag = xleval(nextarg());
+    val = (moreargs() ? xleval(nextarg()) : NIL);
+    xllastarg();
+
+    /* throw the tag */
+    xlthrow(tag,val);
+    return NIL; /* never happens */
+}
+
+/* xunwindprotect - special form 'unwind-protect' */
+LVAL xunwindprotect(void)
+{
+    extern XLCONTEXT *xltarget;
+    extern int xlmask;
+    XLCONTEXT cntxt;
+    XLCONTEXT *target = NULL;
+    int mask = 0;
+    int sts;
+    LVAL val;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* get the expression to protect */
+    val = xlgetarg();
+
+    /* evaluate the protected expression */
+    xlbegin(&cntxt,CF_UNWIND,NIL);
+    if ((sts = setjmp(cntxt.c_jmpbuf))) {
+        target = xltarget;
+        mask = xlmask;
+        val = xlvalue;
+    }
+    else
+        val = xleval(val);
+    xlend(&cntxt);
+        
+    /* evaluate the cleanup expressions */
+    while (moreargs())
+        xleval(nextarg());
+
+    /* if unwinding, continue unwinding */
+    if (sts)
+        xljump(target,mask,val);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the value of the protected expression */
+    return (val);
+}
+
+/* xerrset - special form 'errset' */
+LVAL xerrset(void)
+{
+    LVAL expr,flag,val;
+    XLCONTEXT cntxt;
+
+    /* get the expression and the print flag */
+    expr = xlgetarg();
+    flag = (moreargs() ? xlgetarg() : s_true);
+    xllastarg();
+
+    /* establish an execution context */
+    xlbegin(&cntxt,CF_ERROR,flag);
+
+    /* check for error */
+    if (setjmp(cntxt.c_jmpbuf))
+        val = NIL;
+
+    /* otherwise, evaluate the expression */
+    else {
+        expr = xleval(expr);
+        val = consa(expr);
+    }
+    xlend(&cntxt);
+
+    /* return the result */
+    return (val);
+}
+
+/* xtrace - special form 'trace' */
+LVAL xtrace(void)
+{
+    LVAL sym,fun,this;
+
+    /* loop through all of the arguments */
+    sym = xlenter("*TRACELIST*");
+    while (moreargs()) {
+        fun = xlgasymbol();
+
+        /* check for the function name already being in the list */
+        for (this = getvalue(sym); consp(this); this = cdr(this))
+            if (car(this) == fun)
+                break;
+
+        /* add the function name to the list */
+        if (null(this))
+            setvalue(sym,cons(fun,getvalue(sym)));
+    }
+    return (getvalue(sym));
+}
+
+/* xuntrace - special form 'untrace' */
+LVAL xuntrace(void)
+{
+    LVAL sym,fun,this,last;
+
+    /* loop through all of the arguments */
+    sym = xlenter("*TRACELIST*");
+    while (moreargs()) {
+        fun = xlgasymbol();
+
+        /* remove the function name from the list */
+        last = NIL;
+        for (this = getvalue(sym); consp(this); this = cdr(this)) {
+            if (car(this) == fun) {
+                if (last)
+                    rplacd(last,cdr(this));
+                else
+                    setvalue(sym,cdr(this));
+                break;
+            }
+            last = this;
+        }
+    }
+    return (getvalue(sym));
+}
+
+/* dobindings - handle bindings for let/let*, prog/prog*, do/do* */
+LOCAL void dobindings(LVAL list, LVAL env)
+{
+    LVAL bnd, val;
+    LVAL sym = NULL;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* bind each symbol in the list of bindings */
+    for (; consp(list); list = cdr(list)) {
+
+        /* get the next binding */
+        bnd = car(list);
+
+        /* handle a symbol */
+        if (symbolp(bnd)) {
+            sym = bnd;
+            val = NIL;
+        }
+
+        /* handle a list of the form (symbol expr) */
+        else if (consp(bnd)) {
+            sym = match(SYMBOL,&bnd);
+            val = evarg(&bnd);
+        }
+        else
+            xlfail("bad binding");
+
+        /* bind the value to the symbol */
+        xlpbind(sym,val,env);
+    }
+
+    /* restore the stack */
+    xlpop();
+}
+
+/* doupdates - handle updates for do/do* */
+LOCAL void doupdates(LVAL list, int pflag)
+{
+    LVAL plist,bnd,sym,val;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(plist);
+    xlsave(val);
+
+    /* bind each symbol in the list of bindings */
+    for (; consp(list); list = cdr(list)) {
+
+        /* get the next binding */
+        bnd = car(list);
+
+        /* handle a list of the form (symbol expr) */
+        if (consp(bnd)) {
+            sym = match(SYMBOL,&bnd);
+            bnd = cdr(bnd);
+            if (bnd) {
+                val = evarg(&bnd);
+                if (pflag)
+                    plist = cons(cons(sym,val),plist);
+                else
+                    xlsetvalue(sym,val);
+            }
+        }
+    }
+
+    /* set the values for parallel updates */
+    for (; plist; plist = cdr(plist))
+        xlsetvalue(car(car(plist)),cdr(car(plist)));
+
+    /* restore the stack */
+    xlpopn(2);
+}
+
+/* tagbody - execute code within a block and tagbody */
+LOCAL void tagbody(void)
+{
+    LVAL *argv,arg;
+    XLCONTEXT cntxt;
+    int argc;
+
+    /* establish an execution context */
+    xlbegin(&cntxt,CF_GO,NIL);
+    argc = xlargc;
+    argv = xlargv;
+
+    /* check for a 'go' */
+    if (setjmp(cntxt.c_jmpbuf)) {
+        cntxt.c_xlargc = argc;
+        cntxt.c_xlargv = argv;
+    }
+
+    /* execute the body */
+    while (moreargs()) {
+        arg = nextarg();
+        if (consp(arg))
+            xleval(arg);
+    }
+    xlend(&cntxt);
+}
+
+/* match - get an argument and match its type */
+LOCAL LVAL match(int type, LVAL *pargs)
+{
+    LVAL arg;
+
+    /* make sure the argument exists */
+    if (!consp(*pargs))
+        toofew(*pargs);
+
+    /* get the argument value */
+    arg = car(*pargs);
+
+    /* move the argument pointer ahead */
+    *pargs = cdr(*pargs);
+
+    /* check its type */
+    if (type == LIST) {
+        if (arg && ntype(arg) != CONS)
+            xlerror("bad argument type",arg);
+    }
+    else {
+        if (arg == NIL || ntype(arg) != type)
+            xlerror("bad argument type",arg);
+    }
+
+    /* return the argument */
+    return (arg);
+}
+
+/* evarg - get the next argument and evaluate it */
+LOCAL LVAL evarg(LVAL *pargs)
+{
+    LVAL arg;
+
+    /* protect some pointers */
+    xlsave1(arg);
+
+    /* make sure the argument exists */
+    if (!consp(*pargs))
+        toofew(*pargs);
+
+    /* get the argument value */
+    arg = car(*pargs);
+
+    /* move the argument pointer ahead */
+    *pargs = cdr(*pargs);
+
+    /* evaluate the argument */
+    arg = xleval(arg);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the argument */
+    return (arg);
+}
+
+/* evmatch - get an evaluated argument and match its type */
+LOCAL LVAL evmatch(int type, LVAL *pargs)
+{
+    LVAL arg;
+
+    /* protect some pointers */
+    xlsave1(arg);
+
+    /* make sure the argument exists */
+    if (!consp(*pargs))
+        toofew(*pargs);
+
+    /* get the argument value */
+    arg = car(*pargs);
+
+    /* move the argument pointer ahead */
+    *pargs = cdr(*pargs);
+
+    /* evaluate the argument */
+    arg = xleval(arg);
+
+    /* check its type */
+    if (type == LIST) {
+        if (arg && ntype(arg) != CONS)
+            xlerror("bad argument type",arg);
+    }
+    else {
+        if (arg == NIL || ntype(arg) != type)
+            xlerror("bad argument type",arg);
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the argument */
+    return (arg);
+}
+
+/* toofew - too few arguments */
+LOCAL void toofew(LVAL args)
+{
+    xlerror("too few arguments",args);
+}
+
+/* toomany - too many arguments */
+LOCAL void toomany(LVAL args)
+{
+    xlerror("too many arguments",args);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xldbug.c b/lib-src/libnyquist/nyquist/xlisp/xldbug.c
new file mode 100644
index 0000000..5467e66
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xldbug.c
@@ -0,0 +1,218 @@
+/* xldebug - xlisp debugging support */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+
+#include "stdlib.h"
+#include "xlisp.h"
+
+
+/* forward declarations */
+FORWARD LVAL stacktop(void);
+FORWARD LOCAL void breakloop(char *hdr, char *cmsg, char *emsg, LVAL arg, int cflag);
+
+/* xlabort - xlisp serious error handler */
+void xlabort(char *emsg)
+{
+    xlsignal(emsg,s_unbound);
+    xlerrprint("error",(char *) NULL,emsg,s_unbound);
+    xlbrklevel();
+}
+
+/* xlbreak - enter a break loop */
+void xlbreak(char *emsg, LVAL arg)
+{
+    breakloop("break","return from BREAK",emsg,arg,TRUE);
+}
+
+/* xlfail - xlisp error handler */
+void xlfail(char *emsg)
+{
+    xlerror(emsg,s_unbound);
+}
+
+/* close_loadingfiles - close files we were loading from */
+void close_loadingfiles()
+{
+    /* close open files that are being loaded so that user can
+       overwrite bug fixes immediately. (Windows locks files
+       until they are closed.)
+     */
+    while (consp(getvalue(s_loadingfiles)) && 
+           consp(cdr(getvalue(s_loadingfiles))) &&
+           streamp(car(cdr(getvalue(s_loadingfiles)))) &&
+		   getfile(car(cdr(getvalue(s_loadingfiles))))) {
+        osclose(getfile(car(cdr(getvalue(s_loadingfiles)))));
+        /* make the file NULL so GC will not close it again */
+        setfile(car(cdr(getvalue(s_loadingfiles))), NULL);
+        setvalue(s_loadingfiles, cdr(cdr(getvalue(s_loadingfiles))));
+    }
+}
+
+/* xlerror - handle a fatal error */
+void xlerror(char *emsg, LVAL arg)
+{
+    close_loadingfiles();
+    if (getvalue(s_breakenable) != NIL)
+        breakloop("error",NULL,emsg,arg,FALSE);
+    else {
+        xlsignal(emsg,arg);
+        xlerrprint("error",NULL,emsg,arg);
+        xlbrklevel();
+    }
+}
+
+/* xlcerror - handle a recoverable error */
+void xlcerror(char *cmsg, char *emsg, LVAL arg)
+{
+    if (getvalue(s_breakenable) != NIL)
+        breakloop("error",cmsg,emsg,arg,TRUE);
+    else {
+        xlsignal(emsg,arg);
+        xlerrprint("error",NULL,emsg,arg);
+        xlbrklevel();
+    }
+}
+
+/* xlerrprint - print an error message */
+void xlerrprint(char *hdr, char *cmsg, char *emsg, LVAL arg)
+{
+    /* print the error message */
+    sprintf(buf,"%s: %s",hdr,emsg);
+    errputstr(buf);
+
+    /* print the argument */
+    if (arg != s_unbound) {
+        errputstr(" - ");
+        errprint(arg);
+    }
+
+    /* no argument, just end the line */
+    else
+        errputstr("\n");
+
+    /* print the continuation message */
+    if (cmsg) {
+        sprintf(buf,"if continued: %s\n",cmsg);
+        errputstr(buf);
+    }
+}
+
+/* breakloop - the debug read-eval-print loop */
+LOCAL void breakloop(char *hdr, char *cmsg, char *emsg, LVAL arg, int cflag)
+{
+    LVAL expr,val;
+    XLCONTEXT cntxt;
+    int type;
+
+    /* print the error message */
+    xlerrprint(hdr,cmsg,emsg,arg);
+
+    /* flush the input buffer */
+    xlflush();
+
+    /* do the back trace */
+    if (getvalue(s_tracenable)) {
+        val = getvalue(s_tlimit);
+        xlbaktrace(fixp(val) ? (int)getfixnum(val) : -1);
+    }
+
+    /* protect some pointers */
+    xlsave1(expr);
+
+    /* increment the debug level */
+    ++xldebug;
+
+    /* debug command processing loop */
+    xlbegin(&cntxt,CF_BRKLEVEL|CF_CLEANUP|CF_CONTINUE,s_true);
+    for (type = 0; type == 0; ) {
+
+        /* setup the continue trap */
+        if ((type = setjmp(cntxt.c_jmpbuf)))
+            switch (type) {
+            case CF_CLEANUP:
+                continue;
+            case CF_BRKLEVEL:
+                type = 0;
+                break;
+            case CF_CONTINUE:
+                if (cflag) {
+                    dbgputstr("[ continue from break loop ]\n");
+                    continue;
+                }
+                else xlabort("this error can't be continued");
+            }
+
+        #ifndef READ_LINE
+        /* print a prompt */
+        sprintf(buf,"%d> ",xldebug);
+        dbgputstr(buf);
+        #endif
+
+        /* read an expression and check for eof */
+        if (!xlread(getvalue(s_debugio),&expr,FALSE)) {
+            type = CF_CLEANUP;
+
+            #ifdef READ_LINE
+            dbgputstr("\n");
+            #endif
+
+            break;
+        }
+
+        /* save the input expression */
+        xlrdsave(expr);
+
+        /* evaluate the expression */
+        expr = xleval(expr);
+
+        /* save the result */
+        xlevsave(expr);
+
+        /* print it */
+        dbgprint(expr);
+    }
+    xlend(&cntxt);
+
+    /* decrement the debug level */
+    --xldebug;
+
+    /* restore the stack */
+    xlpop();
+
+    /* check for aborting to the previous level */
+    if (type == CF_CLEANUP)
+        xlbrklevel();
+}
+
+/* baktrace - do a back trace */
+void xlbaktrace(int n)
+{
+    LVAL *fp,*p;
+    int argc;
+    for (fp = xlfp; (n < 0 || n--) && *fp; fp = fp - (int)getfixnum(*fp)) {
+        p = fp + 1;
+        errputstr("Function: ");
+        errprint(*p++);
+        if ((argc = (int)getfixnum(*p++)))
+            errputstr("Arguments:\n");
+        while (--argc >= 0) {
+            errputstr("  ");
+            errprint(*p++);
+        }
+    }
+}
+
+/* xldinit - debug initialization routine */
+void xldinit(void)
+{
+    xlsample = 0;
+    xldebug = 0;
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xldmem.c b/lib-src/libnyquist/nyquist/xlisp/xldmem.c
new file mode 100644
index 0000000..cc363cb
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xldmem.c
@@ -0,0 +1,762 @@
+/* xldmem - xlisp dynamic memory management routines */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use
+
+ * HISTORY
+ * 28-Apr-03    Mazzoni
+ *  eliminate some compiler warnings
+ * 14-Apr-88	Dannenberg
+ *	Call free method when an EXTERN node is garbage collected
+ */
+
+
+/* #define DEBUG_MEM 1 */
+
+#include "stdlib.h"
+#include "string.h"
+#include "xlisp.h"
+
+#ifdef WIN32
+#include "malloc.h" // defines alloca()
+#endif
+
+/* node flags */
+#define MARK	1
+#define LEFT	2
+
+/* macro to compute the size of a segment */
+#define segsize(n) (sizeof(SEGMENT)+((n)-1)*sizeof(struct node))
+
+
+#ifdef DEBUG_INPUT
+extern FILE *debug_input_fp;
+#endif
+
+/* variables local to xldmem.c and xlimage.c */
+SEGMENT *segs,*lastseg,*fixseg,*charseg;
+int anodes,nsegs,gccalls;
+long nnodes,nfree,total;
+LVAL fnodes;
+
+#ifdef DEBUG_MEM
+long xldmem_trace = 0;	/* debugging */
+#endif
+
+/* forward declarations */
+FORWARD LOCAL void findmem(void);
+FORWARD LVAL newnode(int type);
+FORWARD LOCAL unsigned char *stralloc(int size);
+FORWARD LOCAL int addseg(void);
+FORWARD void mark(LVAL ptr);
+FORWARD LOCAL void sweep(void);
+
+#ifdef DEBUG_GC
+static long dbg_gc_n = 0;	/* counts save operations */
+long dbg_gc_count = 0;	        /* says when to stop */
+LVAL *dbg_gc_addr = NULL;	/* says what we're looking for */
+
+void dbg_gc_xlsave(LVAL *n)
+{
+    dbg_gc_n++;
+    if (n == dbg_gc_addr) {
+        printf("dbg_gc_xlsave: %x at count %d\n",
+               dbg_gc_addr, dbg_gc_n);
+    }
+    if (dbg_gc_count == dbg_gc_n) {
+        printf("dbg_gc_xlsave: reached %d\n",
+               dbg_gc_count);
+    }
+}
+
+
+#endif
+
+
+/* cons - construct a new cons node */
+LVAL cons(LVAL x, LVAL y)
+{
+    LVAL nnode;
+    /* get a free node */
+    if ((nnode = fnodes) == NIL) {
+        xlstkcheck(2);
+        xlprotect(x);
+        xlprotect(y);
+        findmem();
+        if ((nnode = fnodes) == NIL)
+            xlabort("insufficient node space");
+        xlpop();
+        xlpop();
+    }
+
+    /* unlink the node from the free list */
+    fnodes = cdr(nnode);
+    --nfree;
+
+    /* initialize the new node */
+    nnode->n_type = CONS;
+    rplaca(nnode,x);
+    rplacd(nnode,y);
+
+    /* return the new node */
+    return (nnode);
+}
+
+/* cvstring - convert a string to a string node */
+LVAL cvstring(const char *str)
+{
+    LVAL val;
+    xlsave1(val);
+    val = newnode(STRING);
+    val->n_strlen = strlen(str) + 1;
+    val->n_string = stralloc(getslength(val));
+    strcpy((char *) getstring(val),str);
+    xlpop();
+    return (val);
+}
+
+/* new_string - allocate and initialize a new string */
+LVAL new_string(int size)
+{
+    LVAL val;
+    xlsave1(val);
+    val = newnode(STRING);
+    val->n_strlen = size;
+    val->n_string = stralloc(getslength(val));
+    strcpy((char *) getstring(val),"");
+    xlpop();
+    return (val);
+}
+
+/* cvsymbol - convert a string to a symbol */
+LVAL cvsymbol(char *pname)
+{
+    /* pname points to a global buffer space. This is ok unless you have
+     * a gc hook that writes things and therefore uses the buffer. Then
+     * if newvector causes a GC, pname is overwritten before cvstring is
+     * called and the symbol will have the wrong name!
+     * The bug is fixed by copying pname to the stack.
+     */
+    LVAL val;
+    int len = strlen(pname) + 1; /* don't forget the terminating zero */
+    char *local_pname_copy = (char *) alloca(len);
+    memcpy(local_pname_copy, pname, len);
+    xlsave1(val);
+    val = newvector(SYMSIZE);
+    val->n_type = SYMBOL;
+    setvalue(val,s_unbound);
+    setfunction(val,s_unbound);
+    setpname(val,cvstring(local_pname_copy));
+    xlpop();
+    return (val);
+}
+
+/* cvsubr - convert a function to a subr or fsubr */
+LVAL cvsubr(LVAL (*fcn)(void), int type, int offset)
+{
+    LVAL val;
+    val = newnode(type);
+    val->n_subr = fcn;
+    val->n_offset = offset;
+    return (val);
+}
+
+/* cvfile - convert a file pointer to a stream */
+LVAL cvfile(FILE *fp)
+{
+    LVAL val;
+    val = newnode(STREAM);
+    setfile(val,fp);
+    setsavech(val,'\0');
+    return (val);
+}
+
+/* cvfixnum - convert an integer to a fixnum node */
+LVAL cvfixnum(FIXTYPE n)
+{
+    LVAL val;
+    if (n >= SFIXMIN && n <= SFIXMAX)
+        return (&fixseg->sg_nodes[(int)n-SFIXMIN]);
+    val = newnode(FIXNUM);
+    val->n_fixnum = n;
+    return (val);
+}
+
+/* cvflonum - convert a floating point number to a flonum node */
+LVAL cvflonum(FLOTYPE n)
+{
+    LVAL val;
+    val = newnode(FLONUM);
+    val->n_flonum = n;
+    return (val);
+}
+
+/* cvchar - convert an integer to a character node */
+LVAL cvchar(int n)
+{
+    if (n >= CHARMIN && n <= CHARMAX)
+        return (&charseg->sg_nodes[n-CHARMIN]);
+    xlerror("character code out of range",cvfixnum((FIXTYPE)n));
+    return NIL; /* won't reach this line */
+}
+
+/* newustream - create a new unnamed stream */
+LVAL newustream(void)
+{
+    LVAL val;
+    val = newnode(USTREAM);
+    sethead(val,NIL);
+    settail(val,NIL);
+    return (val);
+}
+
+/* newobject - allocate and initialize a new object */
+LVAL newobject(LVAL cls, int size)
+{
+    LVAL val;
+    val = newvector(size+1);
+    val->n_type = OBJECT;
+    setelement(val,0,cls);
+    return (val);
+}
+
+/* newclosure - allocate and initialize a new closure */
+LVAL newclosure(LVAL name, LVAL type, LVAL env, LVAL fenv)
+{
+    LVAL val;
+    val = newvector(CLOSIZE);
+    val->n_type = CLOSURE;
+    setname(val,name);
+    settype(val,type);
+    setenv(val,env);
+    setfenv(val,fenv);
+    return (val);
+}
+
+/* newvector - allocate and initialize a new vector node */
+LVAL newvector(int size)
+{
+    LVAL vect;
+    int bsize;
+    xlsave1(vect);
+    vect = newnode(VECTOR);
+    vect->n_vsize = 0;
+    if ((bsize = size * sizeof(LVAL))) {
+        if ((vect->n_vdata = (LVAL *)calloc(1,bsize)) == NULL) {
+            findmem();
+            if ((vect->n_vdata = (LVAL *)calloc(1,bsize)) == NULL)
+                xlfail("insufficient vector space");
+        }
+        vect->n_vsize = size;
+        total += (long) bsize;
+    }
+    xlpop();
+    return (vect);
+}
+
+/* newnode - allocate a new node */
+LVAL newnode(int type)
+{
+    LVAL nnode;
+
+    /* get a free node */
+    if ((nnode = fnodes) == NIL) {
+        findmem();
+        if ((nnode = fnodes) == NIL)
+            xlabort("insufficient node space");
+    }
+
+    /* unlink the node from the free list */
+    fnodes = cdr(nnode);
+    nfree -= 1L;
+
+    /* initialize the new node */
+    nnode->n_type = type;
+    rplacd(nnode,NIL);
+
+    /* return the new node */
+    return (nnode);
+}
+
+/* stralloc - allocate memory for a string adding a byte for the terminator */
+LOCAL unsigned char *stralloc(int size)
+{
+    unsigned char *sptr;
+
+    /* allocate memory for the string copy */
+    if ((sptr = (unsigned char *)malloc(size)) == NULL) {
+        gc();  
+        if ((sptr = (unsigned char *)malloc(size)) == NULL)
+            xlfail("insufficient string space");
+    }
+    total += (long)size;
+
+    /* return the new string memory */
+    return (sptr);
+}
+
+/* findmem - find more memory by collecting then expanding */
+LOCAL void findmem(void)
+{
+    gc();
+    if (nfree < (long)anodes)
+        addseg();
+}
+
+/* gc - garbage collect (only called here and in xlimage.c) */
+void gc(void)
+{
+    register LVAL **p,*ap,tmp;
+    char buf[STRMAX+1];
+    LVAL *newfp,fun;
+    extern LVAL profile_fixnum;
+
+    /* print the start of the gc message */
+    if (s_gcflag && getvalue(s_gcflag)) {
+        sprintf(buf,"[ gc: total %ld, ",nnodes);
+        stdputstr(buf);
+    }
+
+    /* mark the fixnum used by profiler */
+    if (!null(profile_fixnum)) mark(profile_fixnum);
+
+    /* mark the obarray, the argument list and the current environment */
+    if (obarray)
+        mark(obarray);
+    if (xlenv)
+        mark(xlenv);
+    if (xlfenv)
+        mark(xlfenv);
+    if (xldenv)
+        mark(xldenv);
+
+    /* mark the evaluation stack */
+    for (p = xlstack; p < xlstktop; ++p)
+        if ((tmp = **p))
+            mark(tmp);
+
+    /* mark the argument stack */
+    for (ap = xlargstkbase; ap < xlsp; ++ap)
+        if ((tmp = *ap))
+            mark(tmp);
+
+    /* sweep memory collecting all unmarked nodes */
+    sweep();
+
+    /* count the gc call */
+    ++gccalls;
+
+    /* call the *gc-hook* if necessary */
+    if (s_gchook && (fun = getvalue(s_gchook))) {
+        newfp = xlsp;
+        pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+        pusharg(fun);
+        pusharg(cvfixnum((FIXTYPE)2));
+        pusharg(cvfixnum((FIXTYPE)nnodes));
+        pusharg(cvfixnum((FIXTYPE)nfree));
+        xlfp = newfp;
+        xlapply(2);
+    }
+
+    /* print the end of the gc message */
+    if (s_gcflag && getvalue(s_gcflag)) {
+        sprintf(buf,"%ld free", nfree);
+        stdputstr(buf);
+        /* print additional info (e.g. sound blocks in Nyquist) */
+        print_local_gc_info();
+        stdputstr(" ]\n");
+        stdflush(); /* output in a timely fashion so user sees progress */
+    }
+#ifdef DEBUG_INPUT
+    if (debug_input_fp) {
+        int c = getc(debug_input_fp);
+        ungetc(c, debug_input_fp);
+    }
+#endif
+}
+
+/* mark - mark all accessible nodes */
+void mark(LVAL ptr)
+{
+    register LVAL this,prev,tmp;
+    int type,i,n;
+
+    /* initialize */
+    prev = NIL;
+    this = ptr;
+
+    /* mark this list */
+    for (;;) {
+
+        /* descend as far as we can */
+        while (!(this->n_flags & MARK))
+
+            /* check cons and symbol nodes */
+            if (((type = ntype(this))) == CONS || type == USTREAM) {
+                if ((tmp = car(this))) {
+                    this->n_flags |= MARK|LEFT;
+                    rplaca(this,prev);
+                }
+                else if ((tmp = cdr(this))) {
+                    this->n_flags |= MARK;
+                    rplacd(this,prev);
+                }
+                else {				/* both sides nil */
+                    this->n_flags |= MARK;
+                    break;
+                }
+                prev = this;			/* step down the branch */
+                this = tmp;
+            }
+
+            /* mark other node types */
+            else {
+                this->n_flags |= MARK;
+                switch (type) {
+                case SYMBOL:
+                case OBJECT:
+                case VECTOR:
+                case CLOSURE:
+                    for (i = 0, n = getsize(this); --n >= 0; ++i)
+                        if ((tmp = getelement(this,i)))
+                            mark(tmp);
+                    break;
+                case EXTERN:
+                    if (getdesc(this)->mark_meth) { (*(getdesc(this)->mark_meth))(getinst(this));
+                    }
+                }
+                break;
+            }
+
+        /* backup to a point where we can continue descending */
+        for (;;)
+
+            /* make sure there is a previous node */
+            if (prev) {
+                if (prev->n_flags & LEFT) {	/* came from left side */
+                    prev->n_flags &= ~LEFT;
+                    tmp = car(prev);
+                    rplaca(prev,this);
+                    if ((this = cdr(prev))) {
+                        rplacd(prev,tmp);			
+                        break;
+                    }
+                }
+                else {				/* came from right side */
+                    tmp = cdr(prev);
+                    rplacd(prev,this);
+                }
+                this = prev;			/* step back up the branch */
+                prev = tmp;
+            }
+
+            /* no previous node, must be done */
+            else
+                return;
+    }
+}
+
+/* sweep - sweep all unmarked nodes and add them to the free list */
+LOCAL void sweep(void)
+{
+    SEGMENT *seg;
+    LVAL p;
+    int n;
+
+    /* empty the free list */
+    fnodes = NIL;
+    nfree = 0L;
+
+    /* add all unmarked nodes */
+    for (seg = segs; seg; seg = seg->sg_next) {
+        if (seg == fixseg)	 /* don't sweep the fixnum segment */
+            continue;
+        else if (seg == charseg) /* don't sweep the character segment */
+            continue;
+        p = &seg->sg_nodes[0];
+        for (n = seg->sg_size; --n >= 0; ++p) {
+#ifdef DEBUG_MEM
+            if (xldmem_trace &&
+                  ntype(p) == EXTERN &&
+                  xldmem_trace == getinst(p)) {
+                printf("sweep: EXTERN node %lx is %smarked, points to %lx\n",
+                       p, (p->n_flags & MARK ? "" : "un"), getinst(p));
+            }
+#endif
+            if (!(p->n_flags & MARK)) {
+                switch (ntype(p)) {
+                case STRING:
+                        if (getstring(p) != NULL) {
+                            total -= (long)getslength(p);
+                            free(getstring(p));
+                        }
+                        break;
+                case STREAM:
+                        if (getfile(p))
+                            osclose(getfile(p));
+                        break;
+                case SYMBOL:
+                case OBJECT:
+                case VECTOR:
+                case CLOSURE:
+                        if (p->n_vsize) {
+                            total -= (long) (p->n_vsize * sizeof(LVAL));
+                            free((void *) p->n_vdata);
+                        }
+                        break;
+                case EXTERN:
+                        /* printf("GC about to free %x\n", p);  
+                         * fflush(stdout);
+                         */
+                        if (getdesc(p)) { (*(getdesc(p)->free_meth))(getinst(p));
+                        }
+                        break;
+                }
+                p->n_type = FREE_NODE;
+                rplaca(p,NIL);
+                rplacd(p,fnodes);
+                fnodes = p;
+                nfree += 1L;
+            }
+            else
+                p->n_flags &= ~MARK;
+        }
+    }
+}
+
+/* addseg - add a segment to the available memory */
+LOCAL int addseg(void)
+{
+    SEGMENT *newseg;
+    LVAL p;
+    int n;
+
+    /* allocate the new segment */
+    if (anodes == 0 || (newseg = newsegment(anodes)) == NULL)
+        return (FALSE);
+
+    /* add each new node to the free list */
+    p = &newseg->sg_nodes[0];
+    for (n = anodes; --n >= 0; ++p) {
+        rplacd(p,fnodes);
+        fnodes = p;
+    }
+
+    /* return successfully */
+    return (TRUE);
+}
+
+/* newsegment - create a new segment (only called here and in xlimage.c) */
+SEGMENT *newsegment(int n)
+{
+    SEGMENT *newseg;
+
+    /* allocate the new segment */
+    if ((newseg = (SEGMENT *)calloc(1,segsize(n))) == NULL)
+        return (NULL);
+
+    /* initialize the new segment */
+    newseg->sg_size = n;
+    newseg->sg_next = NULL;
+    if (segs)
+        lastseg->sg_next = newseg;
+    else
+        segs = newseg;
+    lastseg = newseg;
+
+    /* update the statistics */
+    total += (long)segsize(n);
+    nnodes += (long)n;
+    nfree += (long)n;
+    ++nsegs;
+
+    /* return the new segment */
+    return (newseg);
+}
+ 
+/* stats - print memory statistics */
+LOCAL void stats(void)
+{
+    sprintf(buf,"Nodes:       %ld\n",nnodes); stdputstr(buf);
+    sprintf(buf,"Free nodes:  %ld\n",nfree);  stdputstr(buf);
+    sprintf(buf,"Segments:    %d\n",nsegs);   stdputstr(buf);
+    sprintf(buf,"Allocate:    %d\n",anodes);  stdputstr(buf);
+    sprintf(buf,"Total:       %ld\n",total);  stdputstr(buf);
+    sprintf(buf,"Collections: %d\n",gccalls); stdputstr(buf);
+}
+
+/* xgc - xlisp function to force garbage collection */
+LVAL xgc(void)
+{
+    /* make sure there aren't any arguments */
+    xllastarg();
+
+    /* garbage collect */
+    gc();
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xexpand - xlisp function to force memory expansion */
+LVAL xexpand(void)
+{
+    LVAL num;
+    int n,i;
+
+    /* get the new number to allocate */
+    if (moreargs()) {
+        num = xlgafixnum();
+        n = getfixnum(num);
+    }
+    else
+        n = 1;
+    xllastarg();
+
+    /* allocate more segments */
+    for (i = 0; i < n; i++)
+        if (!addseg())
+            break;
+
+    /* return the number of segments added */
+    return (cvfixnum((FIXTYPE)i));
+}
+
+/* xalloc - xlisp function to set the number of nodes to allocate */
+LVAL xalloc(void)
+{
+    int n,oldn;
+    LVAL num;
+
+    /* get the new number to allocate */
+    num = xlgafixnum();
+    n = getfixnum(num);
+
+    /* make sure there aren't any more arguments */
+    xllastarg();
+
+    /* set the new number of nodes to allocate */
+    oldn = anodes;
+    anodes = n;
+
+    /* return the old number */
+    return (cvfixnum((FIXTYPE)oldn));
+}
+
+/* xmem - xlisp function to print memory statistics */
+LVAL xmem(void)
+{
+    /* allow one argument for compatiblity with common lisp */
+    if (moreargs()) xlgetarg();
+    xllastarg();
+
+    /* print the statistics */
+    stats();
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xinfo - show information on control-t */
+LVAL xinfo()
+{
+    char buf[80];
+
+    sprintf(buf,"\n[ Free: %d, GC calls: %d, Total: %d",
+            (int)nfree, (int)gccalls, (int)total);
+    stdputstr(buf);
+    print_local_gc_info();
+    stdputstr("]\n");
+    return NULL;
+}
+
+
+#ifdef SAVERESTORE
+/* xsave - save the memory image */
+LVAL xsave(void)
+{
+    unsigned char *name;
+
+    /* get the file name, verbose flag and print flag */
+    name = getstring(xlgetfname());
+    xllastarg();
+
+    /* save the memory image */
+    return (xlisave((char *) name) ? s_true : NIL);
+}
+
+/* xrestore - restore a saved memory image */
+LVAL xrestore(void)
+{
+    extern jmp_buf top_level;
+    unsigned char *name;
+
+    /* get the file name, verbose flag and print flag */
+    name = getstring(xlgetfname());
+    xllastarg();
+
+    /* restore the saved memory image */
+    if (!xlirestore((char *) name))
+        return (NIL);
+
+    /* return directly to the top level */
+    stdputstr("[ returning to the top level ]\n");
+    longjmp(top_level,1);
+}
+#endif
+
+/* xlminit - initialize the dynamic memory module */
+void xlminit(void)
+{
+    LVAL p;
+    int i;
+
+    /* initialize our internal variables */
+    segs = lastseg = NULL;
+    nnodes = nfree = total = 0L;
+    nsegs = gccalls = 0;
+    anodes = NNODES;
+    fnodes = NIL;
+
+    /* allocate the fixnum segment */
+    if ((fixseg = newsegment(SFIXSIZE)) == NULL)
+        xlfatal("insufficient memory");
+
+    /* initialize the fixnum segment */
+    p = &fixseg->sg_nodes[0];
+    for (i = SFIXMIN; i <= SFIXMAX; ++i) {
+        p->n_type = FIXNUM;
+        p->n_fixnum = i;
+        ++p;
+    }
+
+    /* allocate the character segment */
+    if ((charseg = newsegment(CHARSIZE)) == NULL)
+        xlfatal("insufficient memory");
+
+    /* initialize the character segment */
+    p = &charseg->sg_nodes[0];
+    for (i = CHARMIN; i <= CHARMAX; ++i) {
+        p->n_type = CHAR;
+        p->n_chcode = i;
+        ++p;
+    }
+
+    /* initialize structures that are marked by the collector */
+    obarray = xlenv = xlfenv = xldenv = NIL;
+    s_gcflag = s_gchook = NIL;
+
+    /* allocate the evaluation stack */
+    if ((xlstkbase = (LVAL **)malloc(EDEPTH * sizeof(LVAL *))) == NULL)
+        xlfatal("insufficient memory");
+    xlstack = xlstktop = xlstkbase + EDEPTH;
+
+    /* allocate the argument stack */
+    if ((xlargstkbase = (LVAL *)malloc(ADEPTH * sizeof(LVAL))) == NULL)
+        xlfatal("insufficient memory");
+    // printf("ADEPTH is %d\n", ADEPTH);
+    xlargstktop = xlargstkbase + ADEPTH;
+    xlfp = xlsp = xlargstkbase;
+    *xlsp++ = NIL;
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xldmem.h b/lib-src/libnyquist/nyquist/xlisp/xldmem.h
new file mode 100644
index 0000000..1710f1f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xldmem.h
@@ -0,0 +1,215 @@
+/* xldmem.h - dynamic memory definitions */
+/*	Copyright (c) 1987, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* small fixnum range */
+#define SFIXMIN		(-128)
+#define SFIXMAX		255
+#define SFIXSIZE	384
+
+/* character range */
+#define CHARMIN		0
+#define CHARMAX		255
+#define CHARSIZE	256
+
+/* new node access macros */
+#define ntype(x)	((x)->n_type)
+
+/* cons access macros */
+#define car(x)		((x)->n_car)
+#define cdr(x)		((x)->n_cdr)
+#define rplaca(x,y)	((x)->n_car = (y))
+#define rplacd(x,y)	((x)->n_cdr = (y))
+
+/* symbol access macros */
+#define getvalue(x)	 ((x)->n_vdata[0])
+#define setvalue(x,v)	 ((x)->n_vdata[0] = (v))
+#define getfunction(x)	 ((x)->n_vdata[1])
+#define setfunction(x,v) ((x)->n_vdata[1] = (v))
+#define getplist(x)	 ((x)->n_vdata[2])
+#define setplist(x,v)	 ((x)->n_vdata[2] = (v))
+#define getpname(x)	 ((x)->n_vdata[3])
+#define setpname(x,v)	 ((x)->n_vdata[3] = (v))
+#define SYMSIZE		4
+
+/* closure access macros */
+#define getname(x)     	((x)->n_vdata[0])
+#define setname(x,v)   	((x)->n_vdata[0] = (v))
+#define gettype(x)    	((x)->n_vdata[1])
+#define settype(x,v)  	((x)->n_vdata[1] = (v))
+#define getargs(x)     	((x)->n_vdata[2])
+#define setargs(x,v)   	((x)->n_vdata[2] = (v))
+#define getoargs(x)    	((x)->n_vdata[3])
+#define setoargs(x,v)  	((x)->n_vdata[3] = (v))
+#define getrest(x)     	((x)->n_vdata[4])
+#define setrest(x,v)   	((x)->n_vdata[4] = (v))
+#define getkargs(x)    	((x)->n_vdata[5])
+#define setkargs(x,v)  	((x)->n_vdata[5] = (v))
+#define getaargs(x)    	((x)->n_vdata[6])
+#define setaargs(x,v)  	((x)->n_vdata[6] = (v))
+#define getbody(x)     	((x)->n_vdata[7])
+#define setbody(x,v)   	((x)->n_vdata[7] = (v))
+/* use closure_getenv to avoid Unix getenv conflict */
+#define closure_getenv(x)	((x)->n_vdata[8])
+#define setenv(x,v)	((x)->n_vdata[8] = (v))
+#define getfenv(x)	((x)->n_vdata[9])
+#define setfenv(x,v)	((x)->n_vdata[9] = (v))
+#define getlambda(x)	((x)->n_vdata[10])
+#define setlambda(x,v)	((x)->n_vdata[10] = (v))
+#define CLOSIZE		11
+
+/* vector access macros */
+#define getsize(x)	((x)->n_vsize)
+#define getelement(x,i)	((x)->n_vdata[i])
+#define setelement(x,i,v) ((x)->n_vdata[i] = (v))
+
+/* object access macros */
+#define getclass(x)	((x)->n_vdata[0])
+#define getivar(x,i)	((x)->n_vdata[i+1])
+#define setivar(x,i,v)	((x)->n_vdata[i+1] = (v))
+
+/* subr/fsubr access macros */
+#define getsubr(x)	((x)->n_subr)
+#define getoffset(x)	((x)->n_offset)
+
+/* fixnum/flonum/char access macros */
+#define getfixnum(x)    ((x)->n_fixnum)
+#define getflonum(x)	((x)->n_flonum)
+#define getchcode(x)	((x)->n_chcode)
+
+/* string access macros */
+#define getstring(x)	((x)->n_string)
+#define getslength(x)	((x)->n_strlen)
+
+/* file stream access macros */
+#define getfile(x)	((x)->n_fp)
+#define setfile(x,v)	((x)->n_fp = (v))
+#define getsavech(x)	((x)->n_savech)
+#define setsavech(x,v)	((x)->n_savech = (v))
+
+/* unnamed stream access macros */
+#define gethead(x)	((x)->n_car)
+#define sethead(x,v)	((x)->n_car = (v))
+#define gettail(x)	((x)->n_cdr)
+#define settail(x,v)	((x)->n_cdr = (v))
+
+/* extern access macros */
+#define getdesc(x)	((x)->n_desc)
+#define setdesc(x,d)	((x)->n_desc = (d))
+#define getinst(x)	((x)->n_inst)
+#define setinst(x,i)	((x)->n_inst = (i))
+
+/* node types */
+#define FREE_NODE	0
+#define SUBR	1
+#define FSUBR	2
+#define CONS	3
+#define SYMBOL	4
+#define FIXNUM	5
+#define FLONUM	6
+#define STRING	7
+#define OBJECT	8
+#define STREAM	9
+#define VECTOR	10
+#define CLOSURE	11
+#define CHAR	12
+#define USTREAM	13
+#define EXTERN  14
+
+/* node flags */
+#define WATCH   4
+
+/* subr/fsubr node */
+#define n_subr		n_info.n_xsubr.xs_subr
+#define n_offset	n_info.n_xsubr.xs_offset
+
+/* cons node */
+#define n_car		n_info.n_xcons.xc_car
+#define n_cdr		n_info.n_xcons.xc_cdr
+
+/* fixnum node */
+#define n_fixnum	n_info.n_xfixnum.xf_fixnum
+
+/* flonum node */
+#define n_flonum	n_info.n_xflonum.xf_flonum
+/* character node */
+#define n_chcode	n_info.n_xchar.xc_chcode
+
+/* string node */
+#define n_string	n_info.n_xstring.xs_string
+#define n_strlen	n_info.n_xstring.xs_length
+
+/* stream node */
+#define n_fp		n_info.n_xstream.xs_fp
+#define n_savech	n_info.n_xstream.xs_savech
+
+/* vector/object node */
+#define n_vsize		n_info.n_xvector.xv_size
+#define n_vdata		n_info.n_xvector.xv_data
+
+/* extern node */
+#define n_desc		n_info.n_xextern.xe_desc
+#define n_inst		n_info.n_xextern.xe_inst
+
+/* xtype_desc structure */
+typedef struct xtype_desc_struct {
+    char *type_name;
+    struct node *type_symbol;
+    void (*free_meth)();
+    void (*print_meth)();
+    void (*save_meth)();
+    unsigned char * (*restore_meth)();
+    void (*mark_meth)();
+} *xtype_desc;
+
+/* node structure */
+typedef struct node {
+    char n_type;		/* type of node */
+    char n_flags;		/* flag bits */
+    union ninfo { 		/* value */
+        struct xsubr {		/* subr/fsubr node */
+            struct node *(*xs_subr)(void);	/* function pointer */
+            int xs_offset;		/* offset into funtab */
+        } n_xsubr;
+        struct xcons {		/* cons node */
+            struct node *xc_car;	/* the car pointer */
+            struct node *xc_cdr;	/* the cdr pointer */
+        } n_xcons;
+        struct xfixnum {	/* fixnum node */
+            FIXTYPE xf_fixnum;		/* fixnum value */
+        } n_xfixnum;
+        struct xflonum {	/* flonum node */
+            FLOTYPE xf_flonum;		/* flonum value */
+        } n_xflonum;
+        struct xchar {		/* character node */
+            int xc_chcode;		/* character code */
+        } n_xchar;
+        struct xstring {	/* string node */
+            int xs_length;		/* string length */
+            unsigned char *xs_string;	/* string pointer */
+        } n_xstring;
+        struct xstream { 	/* stream node */
+            FILE *xs_fp;		/* the file pointer */
+            int xs_savech;		/* lookahead character */
+        } n_xstream;
+        struct xvector {	/* vector/object/symbol/structure node */
+            int xv_size;		/* vector size */
+            struct node **xv_data;	/* vector data */
+        } n_xvector;
+        struct xextern {	/* external data type */
+            struct xtype_desc_struct *xe_desc;	/* ptr to type descriptor */
+            unsigned char *xe_inst;		/* pointer to external data */
+        } n_xextern;
+    } n_info;
+} *LVAL;
+
+/* memory segment structure definition */
+typedef struct segment {
+    int sg_size;
+    struct segment *sg_next;
+    struct node sg_nodes[1];
+} SEGMENT;
+
+extern xtype_desc create_desc();	/* initialize a type descriptor */
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xleval.c b/lib-src/libnyquist/nyquist/xlisp/xleval.c
new file mode 100644
index 0000000..d708d14
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xleval.c
@@ -0,0 +1,885 @@
+/* xleval - xlisp evaluator */
+/*      Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use       */
+
+/* HISTORY 
+  28 Apr 03  DM   eliminated some compiler warnings
+  12 Oct 90  RBD  added profiling support 
+ */
+
+#include "string.h"
+#include "xlisp.h"
+
+/* macro to check for lambda list keywords */
+#define iskey(s) ((s) == lk_optional \
+               || (s) == lk_rest \
+               || (s) == lk_key \
+               || (s) == lk_aux \
+               || (s) == lk_allow_other_keys)
+
+/* macros to handle tracing */
+#define trenter(sym,argc,argv) {if (sym) doenter(sym,argc,argv);}
+#define trexit(sym,val) {if (sym) doexit(sym,val);}
+
+
+
+/* forward declarations */
+FORWARD LOCAL LVAL evalhook(LVAL expr);
+FORWARD LOCAL LVAL evform(LVAL form);
+FORWARD LOCAL LVAL evfun(LVAL fun, int argc, LVAL *argv);
+FORWARD LVAL xlclose(LVAL name, LVAL type, LVAL fargs, LVAL body, LVAL env, LVAL fenv);
+FORWARD LOCAL int member( LVAL x,  LVAL list);
+FORWARD LOCAL int evpushargs(LVAL fun, LVAL args);
+FORWARD LOCAL void doenter(LVAL sym, int argc, LVAL *argv);
+FORWARD LOCAL void doexit(LVAL sym, LVAL val);
+FORWARD LOCAL void badarglist(void);
+
+/* profiling extensions by RBD */
+extern LVAL s_profile, profile_fixnum;
+extern FIXTYPE *profile_count_ptr, profile_flag;
+
+/* xleval - evaluate an xlisp expression (checking for *evalhook*) */
+LVAL xleval(LVAL expr)
+{
+    /* check for control codes */
+    if (--xlsample <= 0) {
+        xlsample = SAMPLE;
+        oscheck();
+    }
+
+    /* check for *evalhook* */
+    if (getvalue(s_evalhook))
+        return (evalhook(expr));
+
+    /* check for nil */
+    if (null(expr))
+        return (NIL);
+
+    /* dispatch on the node type */
+    switch (ntype(expr)) {
+    case CONS:
+        return (evform(expr));
+    case SYMBOL:
+        return (xlgetvalue(expr));
+    default:
+        return (expr);
+    }
+}
+
+/* xlxeval - evaluate an xlisp expression (bypassing *evalhook*) */
+LVAL xlxeval(LVAL expr)
+{
+    /* check for nil */
+    if (null(expr))
+        return (NIL);
+
+    /* dispatch on node type */
+    switch (ntype(expr)) {
+    case CONS:
+        return (evform(expr));
+    case SYMBOL:
+        return (xlgetvalue(expr));
+    default:
+        return (expr);
+    }
+}
+
+/* xlapply - apply a function to arguments (already on the stack) */
+LVAL xlapply(int argc)
+{
+    LVAL *oldargv,fun,val=NULL;
+    LVAL funname;
+    LVAL old_profile_fixnum = profile_fixnum;
+    FIXTYPE *old_profile_count_ptr = profile_count_ptr;
+    int oldargc;
+
+    /* get the function */
+    fun = xlfp[1];
+
+    /* get the functional value of symbols */
+    if (symbolp(fun)) {
+        funname = fun;  /* save it */
+        while ((val = getfunction(fun)) == s_unbound)
+            xlfunbound(fun);
+        fun = xlfp[1] = val;
+
+        if (profile_flag && atomp(funname)) {
+            LVAL profile_prop = findprop(funname, s_profile);
+            if (null(profile_prop)) {
+                /* make a new fixnum, don't use cvfixnum because
+                   it would return shared pointer to zero, but we
+                   are going to modify this integer in place --
+                   dangerous but efficient.
+                 */
+                profile_fixnum = newnode(FIXNUM);
+                profile_fixnum->n_fixnum = 0;
+                setplist(funname, cons(s_profile,
+                                       cons(profile_fixnum,
+                                            getplist(funname))));
+                setvalue(s_profile, cons(funname, getvalue(s_profile)));
+            } else profile_fixnum = car(profile_prop);
+            profile_count_ptr = &getfixnum(profile_fixnum);
+        }
+    }
+
+    /* check for nil */
+    if (null(fun))
+        xlerror("bad function",fun);
+
+    /* dispatch on node type */
+    switch (ntype(fun)) {
+    case SUBR:
+        oldargc = xlargc;
+        oldargv = xlargv;
+        xlargc = argc;
+        xlargv = xlfp + 3;
+        val = (*getsubr(fun))();
+        xlargc = oldargc;
+        xlargv = oldargv;
+        break;
+    case CONS:
+        if (!consp(cdr(fun)))
+            xlerror("bad function",fun);
+        if (car(fun) == s_lambda) {
+            fun = xlclose(NIL,
+                          s_lambda,
+                          car(cdr(fun)),
+                          cdr(cdr(fun)),
+                          xlenv,xlfenv);
+        } else
+            xlerror("bad function",fun);
+        /**** fall through into the next case ****/
+    case CLOSURE:
+        if (gettype(fun) != s_lambda)
+            xlerror("bad function",fun);
+        val = evfun(fun,argc,xlfp+3);
+        break;
+    default:
+        xlerror("bad function",fun);
+    }
+
+    /* restore original profile counting state */
+    profile_fixnum = old_profile_fixnum;
+    profile_count_ptr = old_profile_count_ptr;
+
+    /* remove the call frame */
+    xlsp = xlfp;
+    xlfp = xlfp - (int)getfixnum(*xlfp);
+
+    /* return the function value */
+    return (val);
+}
+
+/* evform - evaluate a form */
+LOCAL LVAL evform(LVAL form)
+{
+    LVAL fun,args,val=NULL,type;
+    LVAL tracing=NIL;
+    LVAL *argv;
+    LVAL old_profile_fixnum = profile_fixnum;
+    FIXTYPE *old_profile_count_ptr = profile_count_ptr;
+    LVAL funname;
+    int argc;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(fun);
+    xlsave(args);
+
+    (*profile_count_ptr)++; /* increment profile counter */
+
+    /* get the function and the argument list */
+    fun = car(form);
+    args = cdr(form);
+
+    funname = fun;
+
+    /* get the functional value of symbols */
+    if (symbolp(fun)) {
+        if (getvalue(s_tracelist) && member(fun,getvalue(s_tracelist)))
+            tracing = fun;
+        fun = xlgetfunction(fun);
+    }
+
+    /* check for nil */
+    if (null(fun))
+        xlerror("bad function",NIL);
+
+    /* dispatch on node type */
+    switch (ntype(fun)) {
+    case SUBR:
+        argv = xlargv;
+        argc = xlargc;
+        xlargc = evpushargs(fun,args);
+        xlargv = xlfp + 3;
+        trenter(tracing,xlargc,xlargv);
+        val = (*getsubr(fun))();
+        trexit(tracing,val);
+        xlsp = xlfp;
+        xlfp = xlfp - (int)getfixnum(*xlfp);
+        xlargv = argv;
+        xlargc = argc;
+        break;
+    case FSUBR:
+        argv = xlargv;
+        argc = xlargc;
+        xlargc = pushargs(fun,args);
+        xlargv = xlfp + 3;
+        val = (*getsubr(fun))();
+        xlsp = xlfp;
+        xlfp = xlfp - (int)getfixnum(*xlfp);
+        xlargv = argv;
+        xlargc = argc;
+        break;
+    case CONS:
+        if (!consp(cdr(fun)))
+            xlerror("bad function",fun);
+        if ((type = car(fun)) == s_lambda)
+             fun = xlclose(NIL,
+                           s_lambda,
+                           car(cdr(fun)),
+                           cdr(cdr(fun)),
+                           xlenv,xlfenv);
+        else
+            xlerror("bad function",fun);
+        /**** fall through into the next case ****/
+    case CLOSURE:
+        /* do profiling */
+        if (profile_flag && atomp(funname)) {
+            LVAL profile_prop = findprop(funname, s_profile);
+            if (null(profile_prop)) {
+                /* make a new fixnum, don't use cvfixnum because
+                   it would return shared pointer to zero, but we
+                   are going to modify this integer in place --
+                   dangerous but efficient.
+                 */
+                profile_fixnum = newnode(FIXNUM);
+                profile_fixnum->n_fixnum = 0;
+                setplist(funname, cons(s_profile,
+                                       cons(profile_fixnum,
+                                            getplist(funname))));
+                setvalue(s_profile, cons(funname, getvalue(s_profile)));
+            } else profile_fixnum = car(profile_prop);
+            profile_count_ptr = &getfixnum(profile_fixnum);
+        }
+
+        if (gettype(fun) == s_lambda) {
+            argc = evpushargs(fun,args);
+            argv = xlfp + 3;
+            trenter(tracing,argc,argv);
+            val = evfun(fun,argc,argv);
+            trexit(tracing,val);
+            xlsp = xlfp;
+            xlfp = xlfp - (int)getfixnum(*xlfp);
+        }
+        else {
+            macroexpand(fun,args,&fun);
+            val = xleval(fun);
+        }
+        profile_fixnum = old_profile_fixnum;
+        profile_count_ptr = old_profile_count_ptr;
+        break;
+    default:
+        xlerror("bad function",fun);
+    }
+
+    /* restore the stack */
+    xlpopn(2);
+
+    /* return the result value */
+    return (val);
+}
+
+/* xlexpandmacros - expand macros in a form */
+LVAL xlexpandmacros(LVAL form)
+{
+    LVAL fun,args;
+    
+    /* protect some pointers */
+    xlstkcheck(3);
+    xlprotect(form);
+    xlsave(fun);
+    xlsave(args);
+
+    /* expand until the form isn't a macro call */
+    while (consp(form)) {
+        fun = car(form);                /* get the macro name */
+        args = cdr(form);               /* get the arguments */
+        if (!symbolp(fun) || !fboundp(fun))
+            break;
+        fun = xlgetfunction(fun);       /* get the expansion function */
+        if (!macroexpand(fun,args,&form))
+            break;
+    }
+
+    /* restore the stack and return the expansion */
+    xlpopn(3);
+    return (form);
+}
+
+/* macroexpand - expand a macro call */
+int macroexpand(LVAL fun, LVAL args, LVAL *pval)
+{
+    LVAL *argv;
+    int argc;
+    
+    /* make sure it's really a macro call */
+    if (!closurep(fun) || gettype(fun) != s_macro)
+        return (FALSE);
+        
+    /* call the expansion function */
+    argc = pushargs(fun,args);
+    argv = xlfp + 3;
+    *pval = evfun(fun,argc,argv);
+    xlsp = xlfp;
+    xlfp = xlfp - (int)getfixnum(*xlfp);
+    return (TRUE);
+}
+
+/* evalhook - call the evalhook function */
+LOCAL LVAL evalhook(LVAL expr)
+{
+    LVAL *newfp,olddenv,val;
+
+    /* create the new call frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(getvalue(s_evalhook));
+    pusharg(cvfixnum((FIXTYPE)2));
+    pusharg(expr);
+    pusharg(cons(xlenv,xlfenv));
+    xlfp = newfp;
+
+    /* rebind the hook functions to nil */
+    olddenv = xldenv;
+    xldbind(s_evalhook,NIL);
+    xldbind(s_applyhook,NIL);
+
+    /* call the hook function */
+    val = xlapply(2);
+
+    /* unbind the symbols */
+    xlunbind(olddenv);
+
+    /* return the value */
+    return (val);
+}
+
+/* evpushargs - evaluate and push a list of arguments */
+LOCAL int evpushargs(LVAL fun, LVAL args)
+{
+    LVAL *newfp;
+    int argc;
+    
+    /* protect the argument list */
+    xlprot1(args);
+
+    /* build a new argument stack frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(fun);
+    pusharg(NIL); /* will be argc */
+    /* evaluate and push each argument */
+    for (argc = 0; consp(args); args = cdr(args), ++argc) {
+        pusharg(xleval(car(args)));
+    }
+    /* establish the new stack frame */
+    newfp[2] = cvfixnum((FIXTYPE)argc);
+    xlfp = newfp;
+    
+    /* restore the stack */
+    xlpop();
+
+    /* return the number of arguments */
+    return (argc);
+}
+
+/* pushargs - push a list of arguments */
+int pushargs(LVAL fun, LVAL args)
+{
+    LVAL *newfp;
+    int argc;
+    
+    /* build a new argument stack frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(fun);
+    pusharg(NIL); /* will be argc */
+
+    /* push each argument */
+    for (argc = 0; consp(args); args = cdr(args), ++argc)
+        pusharg(car(args));
+
+    /* establish the new stack frame */
+    newfp[2] = cvfixnum((FIXTYPE)argc);
+    xlfp = newfp;
+
+    /* return the number of arguments */
+    return (argc);
+}
+
+/* makearglist - make a list of the remaining arguments */
+LVAL makearglist(int argc, LVAL *argv)
+{
+    LVAL list,this,last;
+    xlsave1(list);
+    for (last = NIL; --argc >= 0; last = this) {
+        this = cons(*argv++,NIL);
+        if (last) rplacd(last,this);
+        else list = this;
+        last = this;
+    }
+    xlpop();
+    return (list);
+}
+
+/* evfun - evaluate a function */
+LOCAL LVAL evfun(LVAL fun, int argc, LVAL *argv)
+{
+    LVAL oldenv,oldfenv,cptr,name,val;
+    XLCONTEXT cntxt;
+
+    /* protect some pointers */
+    xlstkcheck(4);
+    xlsave(oldenv);
+    xlsave(oldfenv);
+    xlsave(cptr);
+    xlprotect(fun);     /* (RBD) Otherwise, fun is unprotected */
+
+    /* create a new environment frame */
+    oldenv = xlenv;
+    oldfenv = xlfenv;
+    xlenv = xlframe(closure_getenv(fun));
+    xlfenv = getfenv(fun);
+
+    /* bind the formal parameters */
+    xlabind(fun,argc,argv);
+
+    /* setup the implicit block */
+    if ((name = getname(fun)))
+        xlbegin(&cntxt,CF_RETURN,name);
+
+    /* execute the block */
+    if (name && setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else
+        for (val = NIL, cptr = getbody(fun); consp(cptr); cptr = cdr(cptr))
+            val = xleval(car(cptr));
+
+    /* finish the block context */
+    if (name)
+        xlend(&cntxt);
+
+    /* restore the environment */
+    xlenv = oldenv;
+    xlfenv = oldfenv;
+
+    /* restore the stack */
+    xlpopn(4);
+
+    /* return the result value */
+    return (val);
+}
+
+/* xlclose - create a function closure */
+LVAL xlclose(LVAL name, LVAL type, LVAL fargs, LVAL body, LVAL env, LVAL fenv)
+{
+    LVAL closure,key=NULL,arg,def,svar,new,last;
+    char keyname[STRMAX+2];
+
+    /* protect some pointers */
+    xlsave1(closure);
+
+    /* create the closure object */
+    closure = newclosure(name,type,env,fenv);
+    setlambda(closure,fargs);
+    setbody(closure,body);
+
+    /* handle each required argument */
+    last = NIL;
+    while (consp(fargs) && (arg = car(fargs)) && !iskey(arg)) {
+
+        /* make sure the argument is a symbol */
+        if (!symbolp(arg))
+            badarglist();
+
+        /* create a new argument list entry */
+        new = cons(arg,NIL);
+
+        /* link it into the required argument list */
+        if (last)
+            rplacd(last,new);
+        else
+            setargs(closure,new);
+        last = new;
+
+        /* move the formal argument list pointer ahead */
+        fargs = cdr(fargs);
+    }
+
+    /* check for the '&optional' keyword */
+    if (consp(fargs) && car(fargs) == lk_optional) {
+        fargs = cdr(fargs);
+
+        /* handle each optional argument */
+        last = NIL;
+        while (consp(fargs) && (arg = car(fargs)) && !iskey(arg)) {
+
+            /* get the default expression and specified-p variable */
+            def = svar = NIL;
+            if (consp(arg)) {
+                if ((def = cdr(arg))) {
+                    if (consp(def)) {
+                        if ((svar = cdr(def))) {
+                            if (consp(svar)) {
+                                svar = car(svar);
+                                if (!symbolp(svar))
+                                    badarglist();
+                            }
+                            else
+                                badarglist();
+                        }
+                        def = car(def);
+                    }
+                    else
+                        badarglist();
+                }
+                arg = car(arg);
+            }
+
+            /* make sure the argument is a symbol */
+            if (!symbolp(arg))
+                badarglist();
+
+            /* create a fully expanded optional expression */
+            new = cons(cons(arg,cons(def,cons(svar,NIL))),NIL);
+
+            /* link it into the optional argument list */
+            if (last)
+                rplacd(last,new);
+            else
+                setoargs(closure,new);
+            last = new;
+                
+            /* move the formal argument list pointer ahead */
+            fargs = cdr(fargs);
+        }
+    }
+
+    /* check for the '&rest' keyword */
+    if (consp(fargs) && car(fargs) == lk_rest) {
+        fargs = cdr(fargs);
+
+        /* get the &rest argument */
+        if (consp(fargs) && (arg = car(fargs)) && !iskey(arg) && symbolp(arg))
+            setrest(closure,arg);
+        else
+            badarglist();
+
+        /* move the formal argument list pointer ahead */
+        fargs = cdr(fargs);
+    }
+
+    /* check for the '&key' keyword */
+    if (consp(fargs) && car(fargs) == lk_key) {
+        fargs = cdr(fargs);
+
+         /* handle each key argument */
+        last = NIL;
+        while (consp(fargs) && (arg = car(fargs)) && !iskey(arg)) {
+
+            /* get the default expression and specified-p variable */
+            def = svar = NIL;
+            if (consp(arg)) {
+                if ((def = cdr(arg))) {
+                    if (consp(def)) {
+                        if ((svar = cdr(def))) {
+                            if (consp(svar)) {
+                                svar = car(svar);
+                                if (!symbolp(svar))
+                                    badarglist();
+                            }
+                            else
+                                badarglist();
+                        }
+                        def = car(def);
+                    }
+                    else
+                        badarglist();
+                }
+                arg = car(arg);
+            }
+
+            /* get the keyword and the variable */
+            if (consp(arg)) {
+                key = car(arg);
+                if (!symbolp(key))
+                    badarglist();
+                if ((arg = cdr(arg))) {
+                    if (consp(arg))
+                        arg = car(arg);
+                    else
+                        badarglist();
+                }
+            }
+            else if (symbolp(arg)) {
+                strcpy(keyname,":");
+                strcat(keyname,(char *) getstring(getpname(arg)));
+                key = xlenter(keyname);
+            }
+
+            /* make sure the argument is a symbol */
+            if (!symbolp(arg))
+                badarglist();
+
+            /* create a fully expanded key expression */
+            new = cons(cons(key,cons(arg,cons(def,cons(svar,NIL)))),NIL);
+
+            /* link it into the optional argument list */
+            if (last)
+                rplacd(last,new);
+            else
+                setkargs(closure,new);
+            last = new;
+
+            /* move the formal argument list pointer ahead */
+            fargs = cdr(fargs);
+        }
+    }
+
+    /* check for the '&allow-other-keys' keyword */
+    if (consp(fargs) && car(fargs) == lk_allow_other_keys)
+        fargs = cdr(fargs);     /* this is the default anyway */
+
+    /* check for the '&aux' keyword */
+    if (consp(fargs) && car(fargs) == lk_aux) {
+        fargs = cdr(fargs);
+
+        /* handle each aux argument */
+        last = NIL;
+        while (consp(fargs) && (arg = car(fargs)) && !iskey(arg)) {
+
+            /* get the initial value */
+            def = NIL;
+            if (consp(arg)) {
+                if ((def = cdr(arg))) {
+                    if (consp(def))
+                        def = car(def);
+                    else
+                        badarglist();
+                }
+                arg = car(arg);
+            }
+
+            /* make sure the argument is a symbol */
+            if (!symbolp(arg))
+                badarglist();
+
+            /* create a fully expanded aux expression */
+            new = cons(cons(arg,cons(def,NIL)),NIL);
+
+            /* link it into the aux argument list */
+            if (last)
+                rplacd(last,new);
+            else
+                setaargs(closure,new);
+            last = new;
+
+            /* move the formal argument list pointer ahead */
+            fargs = cdr(fargs);
+        }
+    }
+
+    /* make sure this is the end of the formal argument list */
+    if (fargs)
+        badarglist();
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the new closure */
+    return (closure);
+}
+
+/* xlabind - bind the arguments for a function */
+void xlabind(LVAL fun, int argc, LVAL *argv)
+{
+    LVAL *kargv,fargs,key,arg,def,svar,p;
+    int rargc,kargc;
+    /* protect some pointers */
+    xlsave1(def);
+
+    /* bind each required argument */
+    for (fargs = getargs(fun); fargs; fargs = cdr(fargs)) {
+        /* make sure there is an actual argument */
+        if (--argc < 0)
+            xlfail("too few arguments");
+        
+        /* bind the formal variable to the argument value */
+        xlbind(car(fargs),*argv++);
+    }
+
+    /* bind each optional argument */
+    for (fargs = getoargs(fun); fargs; fargs = cdr(fargs)) {
+
+        /* get argument, default and specified-p variable */
+        p = car(fargs);
+        arg = car(p); p = cdr(p);
+        def = car(p); p = cdr(p);
+        svar = car(p);
+
+        /* bind the formal variable to the argument value */
+        if (--argc >= 0) {
+            xlbind(arg,*argv++);
+            if (svar) xlbind(svar,s_true);
+        }
+
+        /* bind the formal variable to the default value */
+        else {
+            if (def) def = xleval(def);
+            xlbind(arg,def);
+            if (svar) xlbind(svar,NIL);
+        }
+    }
+
+    /* save the count of the &rest of the argument list */
+    rargc = argc;
+    
+    /* handle '&rest' argument */
+    if ((arg = getrest(fun))) {
+        def = makearglist(argc,argv);
+        xlbind(arg,def);
+        argc = 0;
+    }
+
+    /* handle '&key' arguments */
+    if ((fargs = getkargs(fun))) {
+        for (; fargs; fargs = cdr(fargs)) {
+
+            /* get keyword, argument, default and specified-p variable */
+            p = car(fargs);
+            key = car(p); p = cdr(p);
+            arg = car(p); p = cdr(p);
+            def = car(p); p = cdr(p);
+            svar = car(p);
+
+            /* look for the keyword in the actual argument list */
+            for (kargv = argv, kargc = rargc; (kargc -= 2) >= 0; kargv += 2)
+                if (*kargv == key)
+                    break;
+
+            /* bind the formal variable to the argument value */
+            if (kargc >= 0) {
+                xlbind(arg,*++kargv);
+                if (svar) xlbind(svar,s_true);
+            }
+
+            /* bind the formal variable to the default value */
+            else {
+                if (def) def = xleval(def);
+                xlbind(arg,def);
+                if (svar) xlbind(svar,NIL);
+            }
+        }
+        argc = 0;
+    }
+
+    /* check for the '&aux' keyword */
+    for (fargs = getaargs(fun); fargs; fargs = cdr(fargs)) {
+
+        /* get argument and default */
+        p = car(fargs);
+        arg = car(p); p = cdr(p);
+        def = car(p);
+
+        /* bind the auxiliary variable to the initial value */
+        if (def) def = xleval(def);
+        xlbind(arg,def);
+    }
+
+    /* make sure there aren't too many arguments */
+    if (argc > 0)
+        xlfail("too many arguments");
+
+    /* restore the stack */
+    xlpop();
+}
+
+/* doenter - print trace information on function entry */
+LOCAL void doenter(LVAL sym, int argc, LVAL *argv)
+{
+    extern int xltrcindent;
+    int i;
+    
+    /* indent to the current trace level */
+    for (i = 0; i < xltrcindent; ++i)
+        trcputstr(" ");
+    ++xltrcindent;
+
+    /* display the function call */
+    sprintf(buf,"Entering: %s, Argument list: (",getstring(getpname(sym)));
+    trcputstr(buf);
+    while (--argc >= 0) {
+        trcprin1(*argv++);
+        if (argc) trcputstr(" ");
+    }
+    trcputstr(")\n");
+}
+
+/* doexit - print trace information for function/macro exit */
+LOCAL void doexit(LVAL sym, LVAL val)
+{
+    extern int xltrcindent;
+    int i;
+    
+    /* indent to the current trace level */
+    --xltrcindent;
+    for (i = 0; i < xltrcindent; ++i)
+        trcputstr(" ");
+    
+    /* display the function value */
+    sprintf(buf,"Exiting: %s, Value: ",getstring(getpname(sym)));
+    trcputstr(buf);
+    trcprin1(val);
+    trcputstr("\n");
+}
+
+/* member - is 'x' a member of 'list'? */
+LOCAL int member( LVAL x,  LVAL list)
+{
+    for (; consp(list); list = cdr(list))
+        if (x == car(list))
+            return (TRUE);
+    return (FALSE);
+}
+
+/* xlunbound - signal an unbound variable error */
+void xlunbound(LVAL sym)
+{
+    xlcerror("try evaluating symbol again","unbound variable",sym);
+}
+
+/* xlfunbound - signal an unbound function error */
+void xlfunbound(LVAL sym)
+{
+    xlcerror("try evaluating symbol again","unbound function",sym);
+}
+
+/* xlstkoverflow - signal a stack overflow error */
+void xlstkoverflow(void)
+{
+    xlabort("evaluation stack overflow");
+}
+
+/* xlargstkoverflow - signal an argument stack overflow error */
+void xlargstkoverflow(void)
+{
+    xlabort("argument stack overflow");
+}
+
+/* badarglist - report a bad argument list error */
+LOCAL void badarglist(void)
+{
+    xlfail("bad formal argument list");
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlfio.c b/lib-src/libnyquist/nyquist/xlisp/xlfio.c
new file mode 100644
index 0000000..9e6df84
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlfio.c
@@ -0,0 +1,734 @@
+/* xlfio.c - xlisp file i/o */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 30Sep06  rbd added xbigendianp
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+
+#include "switches.h"
+
+#include <string.h>
+
+#include "xlisp.h"
+
+/* do some sanity checking: */
+#ifndef XL_BIG_ENDIAN
+#ifndef XL_LITTLE_ENDIAN
+configuration error -- either XL_BIG_ or XL_LITTLE_ENDIAN must be defined
+in xlisp.h
+#endif
+#endif
+#ifdef XL_BIG_ENDIAN
+#ifdef XL_LITTLE_ENDIAN
+configuration error -- both XL_BIG_ and XL_LITTLE_ENDIAN are defined!
+#endif
+#endif
+
+/* forward declarations */
+FORWARD LOCAL LVAL getstroutput(LVAL stream);
+FORWARD LOCAL LVAL printit(int pflag, int tflag);
+FORWARD LOCAL LVAL flatsize(int pflag);
+
+/* xread - read an expression */
+LVAL xread(void)
+{
+    LVAL fptr,eof,rflag,val;
+
+    /* get file pointer and eof value */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    eof = (moreargs() ? xlgetarg() : NIL);
+    rflag = (moreargs() ? xlgetarg() : NIL);
+    xllastarg();
+
+    /* read an expression */
+    if (!xlread(fptr,&val,rflag != NIL))
+        val = eof;
+
+    /* return the expression */
+    return (val);
+}
+
+/* xprint - built-in function 'print' */
+LVAL xprint(void)
+{
+    return (printit(TRUE,TRUE));
+}
+
+/* xprin1 - built-in function 'prin1' */
+LVAL xprin1(void)
+{
+    return (printit(TRUE,FALSE));
+}
+
+/* xprinc - built-in function princ */
+LVAL xprinc(void)
+{
+    return (printit(FALSE,FALSE));
+}
+
+/* xterpri - terminate the current print line */
+LVAL xterpri(void)
+{
+    LVAL fptr;
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* terminate the print line and return nil */
+    xlterpri(fptr);
+    return (NIL);
+}
+
+/* printit - common print function */
+LOCAL LVAL printit(int pflag, int tflag)
+{
+    LVAL fptr,val;
+
+    /* get expression to print and file pointer */
+    val = xlgetarg();
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* print the value */
+    xlprint(fptr,val,pflag);
+
+    /* terminate the print line if necessary */
+    if (tflag)
+        xlterpri(fptr);
+
+    /* return the result */
+    return (val);
+}
+
+/* xflatsize - compute the size of a printed representation using prin1 */
+LVAL xflatsize(void)
+{
+    return (flatsize(TRUE));
+}
+
+/* xflatc - compute the size of a printed representation using princ */
+LVAL xflatc(void)
+{
+    return (flatsize(FALSE));
+}
+
+/* flatsize - compute the size of a printed expression */
+LOCAL LVAL flatsize(int pflag)
+{
+    LVAL val;
+
+    /* get the expression */
+    val = xlgetarg();
+    xllastarg();
+
+    /* print the value to compute its size */
+    xlfsize = 0;
+    xlprint(NIL,val,pflag);
+
+    /* return the length of the expression */
+    return (cvfixnum((FIXTYPE)xlfsize));
+}
+
+/* xlopen - open a text or binary file */
+LVAL xlopen(int binaryflag)
+{
+    char *name,*mode=NULL;
+    FILE *fp;
+    LVAL dir;
+
+    /* get the file name and direction */
+    name = (char *)getstring(xlgetfname());
+    if (!xlgetkeyarg(k_direction,&dir))
+        dir = k_input;
+
+    /* get the mode */
+    if (dir == k_input)
+        mode = "r";
+    else if (dir == k_output)
+        mode = "w";
+    else
+        xlerror("bad direction",dir);
+
+    /* try to open the file */
+    if (binaryflag) {
+        fp = osbopen(name,mode);
+    } else {
+        fp = osaopen(name,mode);
+    }
+    return (fp ? cvfile(fp) : NIL);
+}
+
+
+/* xopen - open a file */
+LVAL xopen(void)
+{
+    return xlopen(FALSE);
+}
+
+/* xbopen - open a binary file */
+LVAL xbopen(void)
+{
+        return xlopen(TRUE);
+}
+
+/* xclose - close a file */
+LVAL xclose(void)
+{
+    LVAL fptr;
+
+    /* get file pointer */
+    fptr = xlgastream();
+    xllastarg();
+
+    /* make sure the file exists */
+    if (getfile(fptr) == NULL)
+        xlfail("file not open");
+
+    /* close the file */
+    osclose(getfile(fptr));
+    setfile(fptr,NULL);
+
+    /* return nil */
+    return (NIL);
+}
+
+/* xrdchar - read a character from a file */
+LVAL xrdchar(void)
+{
+    LVAL fptr;
+    int ch;
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    xllastarg();
+
+    /* get character and check for eof */
+    return ((ch = xlgetc(fptr)) == EOF ? NIL : cvchar(ch));
+}
+
+/* xrdint - read an integer from a file */
+/* positive byte count means big-endian, negative is little-endian */
+LVAL xrdint(void)
+{
+    LVAL fptr;
+    unsigned char b[4];
+    long i;
+    int n = 4;
+    int index = 0; /* where to start in array */
+    int incr = 1;  /* how to step through array */
+    int rslt;
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    /* get byte count */
+    if (moreargs()) {
+        LVAL count = typearg(fixp);
+        n = getfixnum(count);
+        if (n < 0) {
+            n = -n;
+            index = n - 1;
+            incr = -1;
+        }
+        if (n > 4) {
+            xlerror("4-byte limit", count);
+        }
+    }
+    xllastarg();
+    for (i = 0; i < n; i++) {
+        int ch = xlgetc(fptr);
+        if (ch == EOF) return NIL;
+        b[index] = ch;
+        index += incr;
+    }
+    /* build result, b is now big-endian */
+    /* extend sign bit for short integers */
+    rslt = ((b[0] & 0x80) ? -1 : 0);
+    for (i = 0; i < n; i++) {
+        rslt = (rslt << 8) + b[i];
+    }
+    /* return integer result */
+    return cvfixnum(rslt);
+}
+
+
+/* xrdfloat - read a float from a file */
+LVAL xrdfloat(void)
+{
+    LVAL fptr;
+    union {
+        char b[8];
+        float f;
+        double d;
+    } rslt;
+    int n = 4;
+    int i;
+    int index = 3;  /* where to start in array */
+    int incr = -1;  /* how to step through array */
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    /* get byte count */
+    if (moreargs()) {
+        LVAL count =  typearg(fixp);
+        n = getfixnum(count);
+        if (n < 0) {
+            n = -n;
+            index = 0;
+            incr = 1;
+        }
+        if (n != 4 && n != 8) {
+            xlerror("must be 4 or 8 bytes", count);
+        }
+    }
+    xllastarg();
+
+#ifdef XL_BIG_ENDIAN
+    /* flip the bytes */
+    index = n - 1 - index;
+    incr = -incr;
+#endif
+    for (i = 0; i < n; i++) {
+        int ch = xlgetc(fptr);
+        if (ch == EOF) return NIL;
+        rslt.b[index] = ch;
+        index += incr;
+    }
+    /* return result */
+    return cvflonum(n == 4 ? rslt.f : rslt.d);
+}
+
+
+/* xrdbyte - read a byte from a file */
+LVAL xrdbyte(void)
+{
+    LVAL fptr;
+    int ch;
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    xllastarg();
+
+    /* get character and check for eof */
+    return ((ch = xlgetc(fptr)) == EOF ? NIL : cvfixnum((FIXTYPE)ch));
+}
+
+/* xpkchar - peek at a character from a file */
+LVAL xpkchar(void)
+{
+    LVAL flag,fptr;
+    int ch;
+
+    /* peek flag and get file pointer */
+    flag = (moreargs() ? xlgetarg() : NIL);
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    xllastarg();
+
+    /* skip leading white space and get a character */
+    if (flag)
+        while ((ch = xlpeek(fptr)) != EOF && isspace(ch))
+            xlgetc(fptr);
+    else
+        ch = xlpeek(fptr);
+
+    /* return the character */
+    return (ch == EOF ? NIL : cvchar(ch));
+}
+
+/* xwrchar - write a character to a file */
+LVAL xwrchar(void)
+{
+    LVAL fptr,chr;
+
+    /* get the character and file pointer */
+    chr = xlgachar();
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* put character to the file */
+    xlputc(fptr,getchcode(chr));
+
+    /* return the character */
+    return (chr);
+}
+
+/* xwrbyte - write a byte to a file */
+LVAL xwrbyte(void)
+{
+    LVAL fptr,chr;
+
+    /* get the byte and file pointer */
+    chr = xlgafixnum();
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* put byte to the file */
+    xlputc(fptr,(int)getfixnum(chr));
+
+    /* return the character */
+    return (chr);
+}
+
+/* xwrint - write an integer to a file */
+/* positive count means write big-endian */
+LVAL xwrint(void)
+{
+    LVAL val, fptr;
+    unsigned char b[4];
+    long i;
+    int n = 4;
+    int index = 3;     /* where to start in array */
+    int incr = -1;  /* how to step through array */
+    int v;
+    /* get the int and file pointer and optional byte count */
+    val = xlgafixnum();
+    v = getfixnum(val);
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    if (moreargs()) {
+        LVAL count = typearg(fixp);
+        n = getfixnum(count);
+        index = n - 1;
+        if (n < 0) {
+            n = -n;
+            index = 0;
+            incr = 1;
+        }
+        if (n > 4) {
+            xlerror("4-byte limit", count);
+        }
+    }
+    xllastarg();
+    /* build output b as little-endian */
+    for (i = 0; i < n; i++) {
+        b[i] = (unsigned char) v;
+        v = v >> 8;
+    }
+
+    /* put bytes to the file */
+    while (n) {
+        n--;
+        xlputc(fptr, b[index]);
+        index += incr;
+    }
+
+    /* return the integer */
+    return val;
+}
+
+/* xwrfloat - write a float to a file */
+LVAL xwrfloat(void)
+{
+    LVAL val, fptr;
+    union {
+        char b[8];
+        float f;
+        double d;
+    } v;
+    int n = 4;
+    int i;
+    int index = 3;  /* where to start in array */
+    int incr = -1;  /* how to step through array */
+
+    /* get the float and file pointer and optional byte count */
+    val = xlgaflonum();
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    if (moreargs()) {
+        LVAL count = typearg(fixp);
+        n = getfixnum(count);
+        if (n < 0) {
+            n = -n;
+            index = 0;
+            incr = 1;
+        }
+        if (n != 4 && n != 8) {
+            xlerror("must be 4 or 8 bytes", count);
+        }
+    }
+    xllastarg();
+
+#ifdef XL_BIG_ENDIAN
+    /* flip the bytes */
+    index = n - 1 - index;
+    incr = -incr;
+#endif
+    /* build output v.b */
+    if (n == 4) v.f = (float) getflonum(val);
+    else v.d = getflonum(val);
+
+    /* put bytes to the file */
+    for (i = 0; i < n; i++) {
+        xlputc(fptr, v.b[index]);
+        index += incr;
+    }
+
+    /* return the flonum */
+    return val;
+}
+
+/* xreadline - read a line from a file */
+LVAL xreadline(void)
+{
+    unsigned char buf[STRMAX+1],*p,*sptr;
+    LVAL fptr,str,newstr;
+    int len,blen,ch;
+
+    /* protect some pointers */
+    xlsave1(str);
+
+    /* get file pointer */
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdin));
+    xllastarg();
+
+    /* get character and check for eof */
+    len = blen = 0; p = buf;
+    while ((ch = xlgetc(fptr)) != EOF && ch != '\n') {
+
+        /* check for buffer overflow */
+        if (blen >= STRMAX) {
+             newstr = new_string(len + STRMAX + 1);
+            sptr = getstring(newstr); *sptr = '\0';
+            if (str) strcat((char *) sptr, (char *) getstring(str));
+            *p = '\0'; strcat((char *) sptr, (char *) buf);
+            p = buf; blen = 0;
+            len += STRMAX;
+            str = newstr;
+        }
+
+        /* store the character */
+        *p++ = ch; ++blen;
+    }
+
+    /* check for end of file */
+    if (len == 0 && p == buf && ch == EOF) {
+        xlpop();
+        return (NIL);
+    }
+
+    /* append the last substring */
+    if (str == NIL || blen) {
+        newstr = new_string(len + blen + 1);
+        sptr = getstring(newstr); *sptr = '\0';
+        if (str) strcat((char *) sptr, (char *) getstring(str));
+        *p = '\0'; strcat((char *) sptr, (char *) buf);
+        str = newstr;
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the string */
+    return (str);
+}
+
+
+/* xmkstrinput - make a string input stream */
+LVAL xmkstrinput(void)
+{
+    int start,end,len,i;
+    unsigned char *str;
+    LVAL string,val;
+
+    /* protect the return value */
+    xlsave1(val);
+    
+    /* get the string and length */
+    string = xlgastring();
+    str = getstring(string);
+    len = getslength(string) - 1;
+
+    /* get the starting offset */
+    if (moreargs()) {
+        val = xlgafixnum();
+        start = (int)getfixnum(val);
+    }
+    else start = 0;
+
+    /* get the ending offset */
+    if (moreargs()) {
+        val = xlgafixnum();
+        end = (int)getfixnum(val);
+    }
+    else end = len;
+    xllastarg();
+
+    /* check the bounds */
+    if (start < 0 || start > len)
+        xlerror("string index out of bounds",cvfixnum((FIXTYPE)start));
+    if (end < 0 || end > len)
+        xlerror("string index out of bounds",cvfixnum((FIXTYPE)end));
+
+    /* make the stream */
+    val = newustream();
+
+    /* copy the substring into the stream */
+    for (i = start; i < end; ++i)
+        xlputc(val,str[i]);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the new stream */
+    return (val);
+}
+
+/* xmkstroutput - make a string output stream */
+LVAL xmkstroutput(void)
+{
+    return (newustream());
+}
+
+/* xgetstroutput - get output stream string */
+LVAL xgetstroutput(void)
+{
+    LVAL stream;
+    stream = xlgaustream();
+    xllastarg();
+    return (getstroutput(stream));
+}
+
+/* xgetlstoutput - get output stream list */
+LVAL xgetlstoutput(void)
+{
+    LVAL stream,val;
+
+    /* get the stream */
+    stream = xlgaustream();
+    xllastarg();
+
+    /* get the output character list */
+    val = gethead(stream);
+
+    /* empty the character list */
+    sethead(stream,NIL);
+    settail(stream,NIL);
+
+    /* return the list */
+    return (val);
+}
+
+/* xformat - formatted output function */
+LVAL xformat(void)
+{
+    unsigned char *fmt;
+    LVAL stream,val;
+    int ch;
+
+    /* protect stream in case it is a new ustream */
+    xlsave1(stream);
+
+    /* get the stream and format string */
+    stream = xlgetarg();
+    if (stream == NIL)
+        val = stream = newustream();
+    else {
+        if (stream == s_true)
+            stream = getvalue(s_stdout);
+        else if (!streamp(stream) && !ustreamp(stream))
+            xlbadtype(stream);
+        val = NIL;
+    }
+    fmt = getstring(xlgastring());
+
+    /* process the format string */
+    while ((ch = *fmt++))
+        if (ch == '~') {
+            switch (*fmt++) {
+            case '\0':
+                xlerror("expecting a format directive",cvstring((char *) (fmt-1)));
+            case 'a': case 'A':
+                xlprint(stream,xlgetarg(),FALSE);
+                break;
+            case 's': case 'S':
+                xlprint(stream,xlgetarg(),TRUE);
+                break;
+            case '%':
+                xlterpri(stream);
+                break;
+            case '~':
+                xlputc(stream,'~');
+                break;
+            case '\n':
+			case '\r':
+				/* mac may read \r -- this should be ignored */
+				if (*fmt == '\r') *fmt++;  
+                while (*fmt && *fmt != '\n' && isspace(*fmt))
+                    ++fmt;
+                break;
+            default:
+                xlerror("unknown format directive",cvstring((char *) (fmt-1)));
+            }
+        }
+        else
+            xlputc(stream,ch);
+        
+    /* return the value */
+    if (val) val = getstroutput(val);
+    xlpop();
+    return val;
+}
+
+/* getstroutput - get the output stream string (internal) */
+LOCAL LVAL getstroutput(LVAL stream)
+{
+    unsigned char *str;
+    LVAL next,val;
+    int len,ch;
+
+    /* compute the length of the stream */
+    for (len = 0, next = gethead(stream); next != NIL; next = cdr(next))
+        ++len;
+
+    /* create a new string */
+    val = new_string(len + 1);
+    
+    /* copy the characters into the new string */
+    str = getstring(val);
+    while ((ch = xlgetc(stream)) != EOF)
+        *str++ = ch;
+    *str = '\0';
+
+    /* return the string */
+    return (val);
+}
+
+
+LVAL xlistdir(void)
+{
+    char *path;
+    LVAL result = NULL;
+    LVAL *tail;
+    /* get the path */
+    path = (char *)getstring(xlgetfname());
+    /* try to start listing */
+    if (osdir_list_start(path)) {
+        char *filename;
+        xlsave1(result);
+        tail = &result;
+        while (filename = osdir_list_next()) {
+            *tail = cons(NIL, NIL);
+            rplaca(*tail, cvstring(filename));
+            tail = &cdr(*tail);
+        }
+        osdir_list_finish();
+        xlpop();
+    }
+    return result;
+}
+
+
+/* xbigendianp -- is this a big-endian machine? T or NIL */
+LVAL xbigendianp() 
+{
+#ifdef XL_BIG_ENDIAN
+    return s_true;
+#else
+    return NIL;
+#endif
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlftab.c b/lib-src/libnyquist/nyquist/xlisp/xlftab.c
new file mode 100644
index 0000000..074deba
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlftab.c
@@ -0,0 +1,512 @@
+/* xlftab.c - xlisp function table */
+/*	Copyright (c) 1985, by David Michael Betz
+    All Rights Reserved
+    Permission is granted for unrestricted non-commercial use
+
+HISTORY
+23-Apr-03   Mazzoni
+        Eliminated some compiler warnings
+ 1-Apr-88	Dale Amon at CSD
+        Added include file hook for local language extensions:
+        localdefs.h and localptrs.h
+
+*/
+
+#include "switches.h"
+#include "xlisp.h"
+#ifndef NO_PROTOTYPES_IN_XLISP_H
+/* external functions */
+extern LVAL
+    xbisubr(void),xbifsubr(void),
+    rmhash(void),rmquote(void),rmdquote(void),rmbquote(void),rmcomma(void),
+    clnew(void),clisnew(void),clanswer(void),
+    obisnew(void),obclass(void),obshow(void),obisa(void),
+    rmlpar(void),rmrpar(void),rmsemi(void),
+    xeval(void),xapply(void),xfuncall(void),xquote(void),xfunction(void),xbquote(void),
+    xlambda(void),xset(void),xsetq(void),xsetf(void),xdefun(void),xdefmacro(void),
+    xgensym(void),xmakesymbol(void),xintern(void),
+    xsymname(void),xsymvalue(void),xsymplist(void),
+    xget(void),xputprop(void),xremprop(void),
+    xhash(void),xmkarray(void),xaref(void),
+    xcar(void),xcdr(void),
+    xcaar(void),xcadr(void),xcdar(void),xcddr(void),
+    xcaaar(void),xcaadr(void),xcadar(void),xcaddr(void),
+    xcdaar(void),xcdadr(void),xcddar(void),xcdddr(void),
+    xcaaaar(void),xcaaadr(void),xcaadar(void),xcaaddr(void),
+    xcadaar(void),xcadadr(void),xcaddar(void),xcadddr(void),
+    xcdaaar(void),xcdaadr(void),xcdadar(void),xcdaddr(void),
+    xcddaar(void),xcddadr(void),xcdddar(void),xcddddr(void),
+    xcons(void),xlist(void),xappend(void),xreverse(void),xlast(void),xnth(void),xnthcdr(void),
+    xmember(void),xassoc(void),xsubst(void),xsublis(void),xlength(void),xsort(void),
+    xremove(void),xremif(void),xremifnot(void),
+    xmapc(void),xmapcar(void),xmapl(void),xmaplist(void),
+    xrplca(void),xrplcd(void),xnconc(void),
+    xdelete(void),xdelif(void),xdelifnot(void),
+    xatom(void),xsymbolp(void),xnumberp(void),xboundp(void),xnull(void),xlistp(void),xendp(void),xconsp(void),
+    xeq(void),xeql(void),xequal(void),
+    xcond(void),xcase(void),xand(void),x_or(void),xlet(void),xletstar(void),xif(void),
+    xprog(void),xprogstar(void),xprog1(void),xprog2(void),xprogn(void),xgo(void),xreturn(void),
+    xcatch(void),xthrow(void),
+    xerror(void),xcerror(void),xbreak(void),
+    xcleanup(void),xtoplevel(void),xcontinue(void),xerrset(void),
+    xbaktrace(void),xevalhook(void),
+    xdo(void),xdostar(void),xdolist(void),xdotimes(void),
+    xminusp(void),xzerop(void),xplusp(void),xevenp(void),xoddp(void),
+    xfix(void),xfloat(void),
+    xgcd(void),xadd(void),xsub(void),xmul(void),xdiv(void),xrem(void),xmin(void),xmax(void),xabs(void),
+    xadd1(void),xsub1(void),xlogand(void),xlogior(void),xlogxor(void),xlognot(void),
+    xsin(void),xcos(void),xtan(void),xatan(void),xexpt(void),xexp(void),xsqrt(void),xrand(void), xrealrand(void),
+    xlss(void),xleq(void),xequ(void),xneq(void),xgeq(void),xgtr(void),
+    xstrcat(void),xsubseq(void),xstring(void),xchar(void),
+    xread(void),xprint(void),xprin1(void),xprinc(void),xterpri(void),
+    xflatsize(void),xflatc(void),
+    xopen(void),xbopen(void),xclose(void),xrdchar(void),xpkchar(void),xwrchar(void),xreadline(void),
+    xrdint(void),xwrint(void),xrdfloat(void),xwrfloat(void),
+    xload(void),xtranscript(void),
+    xtype(void),xquit(void),xexit(void),xpeek(void),xpoke(void),xaddrs(void),
+    xvector(void),xblock(void),xrtnfrom(void),xtagbody(void),
+    xpsetq(void),xflet(void),xlabels(void),xmacrolet(void),xunwindprotect(void),xpp(void),
+    xstrlss(void),xstrleq(void),xstreql(void),xstrneq(void),xstrgeq(void),xstrgtr(void),
+    xstrilss(void),xstrileq(void),xstrieql(void),xstrineq(void),xstrigeq(void),xstrigtr(void),
+    xupcase(void),xdowncase(void),xnupcase(void),xndowncase(void),
+    xtrim(void),xlefttrim(void),xrighttrim(void),
+    xuppercasep(void),xlowercasep(void),xbothcasep(void),xdigitp(void),xalphanumericp(void),
+    xcharcode(void),xcodechar(void),xchupcase(void),xchdowncase(void),xdigitchar(void),
+    xchrlss(void),xchrleq(void),xchreql(void),xchrneq(void),xchrgeq(void),xchrgtr(void),
+    xchrilss(void),xchrileq(void),xchrieql(void),xchrineq(void),xchrigeq(void),xchrigtr(void),
+    xintegerp(void),xfloatp(void),xstringp(void),xarrayp(void),xstreamp(void),xobjectp(void),
+    xwhen(void),xunless(void),xloop(void),
+    xsymfunction(void),xfboundp(void),xsend(void),xsendsuper(void),
+    xprogv(void),xrdbyte(void),xwrbyte(void),xformat(void),
+    xcharp(void),xcharint(void),xintchar(void),
+    xmkstrinput(void),xmkstroutput(void),xgetstroutput(void),xgetlstoutput(void),
+    xgetlambda(void),xmacroexpand(void),x1macroexpand(void),
+    xinfo(void),					//Added by Ning Hu	Apr.2001
+    xsetdir(void),					//Added by Ning Hu	May.2001
+    xbigendianp(void),
+    xtrace(void),xuntrace(void),xprofile(void),xstrsearch(void), xsetupconsole(void),
+    xechoenabled(void),xslider_read(void),
+    xget_user(void), // added by RBD, Jul 2007
+    xfind_in_xlisp_path(void); // added by RBD, Jan 2008
+#endif
+
+/* functions specific to xldmem.c */
+LVAL xgc(void),xexpand(void),xalloc(void),xmem(void);
+#ifdef SAVERESTORE
+LVAL xsave(void),xrestore(void);
+#endif
+
+/* include system dependant definitions */
+#include "osdefs.h"
+#include "localdefs.h"
+
+/* SUBR/FSUBR indicator */
+#define S	SUBR
+#define F	FSUBR
+
+/* forward declarations */
+LOCAL LVAL xnotimp(void);
+
+/* debugging functions */
+#ifdef DEBUG_INPUT
+LVAL xstartrecordio(void);
+LVAL xstoprecordio(void);
+#endif
+
+/* the function table */
+FUNDEF funtab[] = {
+
+    /* read macro functions */
+{	NULL,				S, rmhash		}, /*   0 */
+{	NULL,				S, rmquote		}, /*   1 */
+{	NULL,				S, rmdquote		}, /*   2 */
+{	NULL,				S, rmbquote		}, /*   3 */
+{	NULL,				S, rmcomma		}, /*   4 */
+{	NULL,				S, rmlpar		}, /*   5 */
+{	NULL,				S, rmrpar		}, /*   6 */
+{	NULL,				S, rmsemi		}, /*   7 */
+{	NULL,				S, xnotimp		}, /*   8 */
+{	NULL,				S, xnotimp		}, /*   9 */
+
+    /* methods */
+{	NULL,				S, clnew		}, /*  10 */
+{	NULL,				S, clisnew		}, /*  11 */
+{	NULL,				S, clanswer		}, /*  12 */
+{	NULL,				S, obisnew		}, /*  13 */
+{	NULL,				S, obclass		}, /*  14 */
+{	NULL,				S, obshow		}, /*  15 */
+{	NULL,				S, obisa		}, /*  16 */
+{	NULL,				S, xnotimp		}, /*  17 */
+{	NULL,				S, xnotimp		}, /*  18 */
+{	NULL,				S, xnotimp		}, /*  19 */
+
+    /* evaluator functions */
+{	"EVAL",				S, xeval		}, /*  20 */
+{	"APPLY",			S, xapply		}, /*  21 */
+{	"FUNCALL",			S, xfuncall		}, /*  22 */
+{	"QUOTE",			F, xquote		}, /*  23 */
+{	"FUNCTION",			F, xfunction		}, /*  24 */
+{	"BACKQUOTE",			F, xbquote		}, /*  25 */
+{	"LAMBDA",			F, xlambda		}, /*  26 */
+
+    /* symbol functions */
+{	"SET",				S, xset			}, /*  27 */
+{	"SETQ",				F, xsetq		}, /*  28 */
+{	"SETF",				F, xsetf		}, /*  29 */
+{	"DEFUN",			F, xdefun		}, /*  30 */
+{	"DEFMACRO",			F, xdefmacro		}, /*  31 */
+{	"GENSYM",			S, xgensym		}, /*  32 */
+{	"MAKE-SYMBOL",			S, xmakesymbol		}, /*  33 */
+{	"INTERN", 			S, xintern		}, /*  34 */
+{	"SYMBOL-NAME",			S, xsymname		}, /*  35 */
+{	"SYMBOL-VALUE",			S, xsymvalue		}, /*  36 */
+{	"SYMBOL-PLIST",			S, xsymplist		}, /*  37 */
+{	"GET",				S, xget			}, /*  38 */
+{	"PUTPROP", 			S, xputprop		}, /*  39 */
+{	"REMPROP",			S, xremprop		}, /*  40 */
+{	"HASH",				S, xhash		}, /*  41 */
+
+    /* array functions */
+{	"MAKE-ARRAY",			S, xmkarray		}, /*  42 */
+{	"AREF",				S, xaref		}, /*  43 */
+            
+    /* list functions */
+{	"CAR",				S, xcar			}, /*  44 */
+{	"CDR",				S, xcdr			}, /*  45 */
+            
+{	"CAAR",				S, xcaar		}, /*  46 */
+{	"CADR",				S, xcadr		}, /*  47 */
+{	"CDAR",				S, xcdar		}, /*  48 */
+{	"CDDR",				S, xcddr		}, /*  49 */
+
+{	"CAAAR",			S, xcaaar		}, /*  50 */
+{	"CAADR",			S, xcaadr		}, /*  51 */
+{	"CADAR",			S, xcadar		}, /*  52 */
+{	"CADDR",			S, xcaddr		}, /*  53 */
+{	"CDAAR",			S, xcdaar		}, /*  54 */
+{	"CDADR",			S, xcdadr		}, /*  55 */
+{	"CDDAR",			S, xcddar		}, /*  56 */
+{	"CDDDR",			S, xcdddr		}, /*  57 */
+
+{	"CAAAAR", 			S, xcaaaar		}, /*  58 */
+{	"CAAADR",			S, xcaaadr		}, /*  59 */
+{	"CAADAR",			S, xcaadar		}, /*  60 */
+{	"CAADDR",			S, xcaaddr		}, /*  61 */
+{	"CADAAR",		 	S, xcadaar		}, /*  62 */
+{	"CADADR",			S, xcadadr		}, /*  63 */
+{	"CADDAR",			S, xcaddar		}, /*  64 */
+{	"CADDDR",			S, xcadddr		}, /*  65 */
+{	"CDAAAR",			S, xcdaaar		}, /*  66 */
+{	"CDAADR",			S, xcdaadr		}, /*  67 */
+{	"CDADAR",			S, xcdadar		}, /*  68 */
+{	"CDADDR",			S, xcdaddr		}, /*  69 */
+{	"CDDAAR",			S, xcddaar		}, /*  70 */
+{	"CDDADR",			S, xcddadr		}, /*  71 */
+{	"CDDDAR",			S, xcdddar		}, /*  72 */
+{	"CDDDDR",			S, xcddddr		}, /*  73 */
+
+{	"CONS",				S, xcons		}, /*  74 */
+{	"LIST",				S, xlist		}, /*  75 */
+{	"APPEND",			S, xappend		}, /*  76 */
+{	"REVERSE",			S, xreverse		}, /*  77 */
+{	"LAST",				S, xlast		}, /*  78 */
+{	"NTH",				S, xnth			}, /*  79 */
+{	"NTHCDR",			S, xnthcdr		}, /*  80 */
+{	"MEMBER",			S, xmember		}, /*  81 */
+{	"ASSOC",			S, xassoc		}, /*  82 */
+{	"SUBST", 			S, xsubst		}, /*  83 */
+{	"SUBLIS",			S, xsublis		}, /*  84 */
+{	"REMOVE",			S, xremove		}, /*  85 */
+{	"LENGTH",			S, xlength		}, /*  86 */
+{	"MAPC",				S, xmapc		}, /*  87 */
+{	"MAPCAR",			S, xmapcar		}, /*  88 */
+{	"MAPL",				S, xmapl		}, /*  89 */
+{	"MAPLIST",			S, xmaplist		}, /*  90 */
+            
+    /* destructive list functions */
+{	"RPLACA",			S, xrplca		}, /*  91 */
+{	"RPLACD",			S, xrplcd		}, /*  92 */
+{	"NCONC",			S, xnconc		}, /*  93 */
+{	"DELETE",			S, xdelete		}, /*  94 */
+
+    /* predicate functions */
+{	"ATOM",				S, xatom		}, /*  95 */
+{	"SYMBOLP",			S, xsymbolp		}, /*  96 */
+{	"NUMBERP",			S, xnumberp		}, /*  97 */
+{	"BOUNDP",			S, xboundp 		}, /*  98 */
+{	"NULL",				S, xnull		}, /*  99 */
+{	"LISTP",			S, xlistp		}, /* 100 */
+{	"CONSP",			S, xconsp		}, /* 101 */
+{	"MINUSP",			S, xminusp 		}, /* 102 */
+{	"ZEROP",			S, xzerop		}, /* 103 */
+{	"PLUSP",			S, xplusp		}, /* 104 */
+{	"EVENP",			S, xevenp		}, /* 105 */
+{	"ODDP",				S, xoddp		}, /* 106 */
+{	"EQ",				S, xeq			}, /* 107 */
+{	"EQL",				S, xeql			}, /* 108 */
+{	"EQUAL",			S, xequal		}, /* 109 */
+
+    /* special forms */
+{	"COND",				F, xcond		}, /* 110 */
+{	"CASE",				F, xcase		}, /* 111 */
+{	"AND",				F, xand			}, /* 112 */
+{	"OR",				F, x_or			}, /* 113 */
+{	"LET",				F, xlet			}, /* 114 */
+{	"LET*",				F, xletstar		}, /* 115 */
+{	"IF",				F, xif			}, /* 116 */
+{	"PROG",				F, xprog		}, /* 117 */
+{	"PROG*",			F, xprogstar		}, /* 118 */
+{	"PROG1",			F, xprog1		}, /* 119 */
+{	"PROG2",			F, xprog2		}, /* 120 */
+{	"PROGN",			F, xprogn		}, /* 121 */
+{	"GO",				F, xgo			}, /* 122 */
+{	"RETURN",			F, xreturn  		}, /* 123 */
+{	"DO",				F, xdo			}, /* 124 */
+{	"DO*",				F, xdostar  		}, /* 125 */
+{	"DOLIST",			F, xdolist  		}, /* 126 */
+{	"DOTIMES",			F, xdotimes		}, /* 127 */
+{	"CATCH",			F, xcatch		}, /* 128 */
+{	"THROW",			F, xthrow		}, /* 129 */
+    
+    /* debugging and error handling functions */
+{	"ERROR",			S, xerror		}, /* 130 */
+{	"CERROR",			S, xcerror  		}, /* 131 */
+{	"BREAK",			S, xbreak		}, /* 132 */
+{	"CLEAN-UP",			S, xcleanup		}, /* 133 */
+{	"TOP-LEVEL",			S, xtoplevel		}, /* 134 */
+{	"CONTINUE",			S, xcontinue		}, /* 135 */
+{	"ERRSET", 			F, xerrset  		}, /* 136 */
+{	"BAKTRACE",			S, xbaktrace		}, /* 137 */
+{	"EVALHOOK",			S, xevalhook		}, /* 138 */
+
+    /* arithmetic functions */
+{	"TRUNCATE",			S, xfix			}, /* 139 */
+{	"FLOAT",			S, xfloat		}, /* 140 */
+{	"+",				S, xadd			}, /* 141 */
+{	"-",				S, xsub			}, /* 142 */
+{	"*",				S, xmul			}, /* 143 */
+{	"/",				S, xdiv			}, /* 144 */
+{	"1+",				S, xadd1		}, /* 145 */
+{	"1-",				S, xsub1		}, /* 146 */
+{	"REM",				S, xrem			}, /* 147 */
+{	"MIN",				S, xmin			}, /* 148 */
+{	"MAX",				S, xmax			}, /* 149 */
+{	"ABS",				S, xabs			}, /* 150 */
+{	"SIN",				S, xsin			}, /* 151 */
+{	"COS",				S, xcos			}, /* 152 */
+{	"TAN",				S, xtan			}, /* 153 */
+{	"EXPT",				S, xexpt		}, /* 154 */
+{	"EXP",				S, xexp			}, /* 155 */
+{	"SQRT",		  		S, xsqrt		}, /* 156 */
+{	"RANDOM",			S, xrand		}, /* 157 */
+            
+    /* bitwise logical functions */
+{	"LOGAND",			S, xlogand  		}, /* 158 */
+{	"LOGIOR",			S, xlogior  		}, /* 159 */
+{	"LOGXOR",			S, xlogxor  		}, /* 160 */
+{	"LOGNOT",			S, xlognot  		}, /* 161 */
+
+    /* numeric comparison functions */
+{	"<",				S, xlss			}, /* 162 */
+{	"<=",				S, xleq			}, /* 163 */
+{	"=",				S, xequ			}, /* 164 */
+{	"/=",				S, xneq			}, /* 165 */
+{	">=",				S, xgeq			}, /* 166 */
+{	">",				S, xgtr			}, /* 167 */
+            
+    /* string functions */
+{	"STRCAT",			S, xstrcat  		}, /* 168 */
+{	"SUBSEQ",			S, xsubseq  		}, /* 169 */
+{	"STRING",			S, xstring  		}, /* 170 */
+{	"CHAR",				S, xchar		}, /* 171 */
+
+    /* I/O functions */
+{	"READ",				S, xread		}, /* 172 */
+{	"PRINT",			S, xprint		}, /* 173 */
+{	"PRIN1",			S, xprin1		}, /* 174 */
+{	"PRINC",			S, xprinc		}, /* 175 */
+{	"TERPRI",			S, xterpri  		}, /* 176 */
+{	"FLATSIZE",			S, xflatsize		}, /* 177 */
+{	"FLATC",			S, xflatc		}, /* 178 */
+            
+    /* file I/O functions */
+{	"OPEN",				S, xopen		}, /* 179 */
+{	"FORMAT",			S, xformat  		}, /* 180 */
+{	"CLOSE",			S, xclose		}, /* 181 */
+{	"READ-CHAR",			S, xrdchar  		}, /* 182 */
+{	"PEEK-CHAR",			S, xpkchar  		}, /* 183 */
+{	"WRITE-CHAR",			S, xwrchar  		}, /* 184 */
+{	"READ-LINE",			S, xreadline		}, /* 185 */
+
+    /* system functions */
+{	"LOAD",				S, xload		}, /* 186 */
+{	"DRIBBLE",			S, xtranscript		}, /* 187 */
+
+/* functions specific to xldmem.c */
+{	"GC",				S, xgc			}, /* 188 */
+{	"EXPAND",			S, xexpand  		}, /* 189 */
+{	"ALLOC",			S, xalloc		}, /* 190 */
+{	"ROOM",				S, xmem			}, /* 191 */
+#ifdef SAVERESTORE
+{	"SAVE",				S, xsave		}, /* 192 */
+{	"RESTORE",			S, xrestore		}, /* 193 */
+#else
+{	NULL,				S, xnotimp		}, /* 192 */
+{	NULL,				S, xnotimp		}, /* 193 */
+#endif
+/* end of functions specific to xldmem.c */
+
+{	"TYPE-OF",			S, xtype		}, /* 194 */
+{	"EXIT",				S, xexit		}, /* 195 */
+#ifdef PEEK_AND_POKE
+{	"PEEK",				S, xpeek		}, /* 196 */
+{	"POKE",				S, xpoke		}, /* 197 */
+{	"ADDRESS-OF",			S, xaddrs		}, /* 198 */
+#else
+{	NULL,				S, xnotimp		}, /* 196 */
+{	NULL,				S, xnotimp		}, /* 197 */
+{	NULL,				S, xnotimp		}, /* 198 */
+#endif
+    /* new functions and special forms */
+{	"VECTOR",			S, xvector  		}, /* 199 */
+{	"BLOCK",			F, xblock		}, /* 200 */
+{	"RETURN-FROM",			F, xrtnfrom		}, /* 201 */
+{	"TAGBODY",			F, xtagbody		}, /* 202 */
+{	"PSETQ",			F, xpsetq		}, /* 203 */
+{	"FLET",				F, xflet		}, /* 204 */
+{	"LABELS",			F, xlabels  		}, /* 205 */
+{	"MACROLET",			F, xmacrolet		}, /* 206 */
+{	"UNWIND-PROTECT",		F, xunwindprotect	}, /* 207 */
+{	"PPRINT",			S, xpp			}, /* 208 */
+{	"STRING<",			S, xstrlss  		}, /* 209 */
+{	"STRING<=",			S, xstrleq  		}, /* 210 */
+{	"STRING=",			S, xstreql  		}, /* 211 */
+{	"STRING/=",			S, xstrneq  		}, /* 212 */
+{	"STRING>=",			S, xstrgeq  		}, /* 213 */
+{	"STRING>",			S, xstrgtr  		}, /* 214 */
+{	"STRING-LESSP",			S, xstrilss		}, /* 215 */
+{	"STRING-NOT-GREATERP",		S, xstrileq		}, /* 216 */
+{	"STRING-EQUAL",			S, xstrieql		}, /* 217 */
+{	"STRING-NOT-EQUAL",		S, xstrineq		}, /* 218 */
+{	"STRING-NOT-LESSP",		S, xstrigeq		}, /* 219 */
+{	"STRING-GREATERP",		S, xstrigtr		}, /* 220 */
+{	"INTEGERP",			S, xintegerp		}, /* 221 */
+{	"FLOATP",			S, xfloatp  		}, /* 222 */
+{	"STRINGP",			S, xstringp		}, /* 223 */
+{	"ARRAYP",			S, xarrayp  		}, /* 224 */
+{	"STREAMP",			S, xstreamp		}, /* 225 */
+{	"OBJECTP",			S, xobjectp		}, /* 226 */
+{	"STRING-UPCASE",		S, xupcase  		}, /* 227 */
+{	"STRING-DOWNCASE",		S, xdowncase		}, /* 228 */
+{	"NSTRING-UPCASE",		S, xnupcase		}, /* 229 */
+{	"NSTRING-DOWNCASE",		S, xndowncase		}, /* 230 */
+{	"STRING-TRIM",			S, xtrim		}, /* 231 */
+{	"STRING-LEFT-TRIM",		S, xlefttrim		}, /* 232 */
+{	"STRING-RIGHT-TRIM",		S, xrighttrim		}, /* 233 */
+{	"WHEN",				F, xwhen		}, /* 234 */
+{	"UNLESS",			F, xunless  		}, /* 235 */
+{	"LOOP",				F, xloop		}, /* 236 */
+{	"SYMBOL-FUNCTION",		S, xsymfunction		}, /* 237 */
+{	"FBOUNDP",			S, xfboundp		}, /* 238 */
+{	"SEND",				S, xsend		}, /* 239 */
+{	"SEND-SUPER",			S, xsendsuper		}, /* 240 */
+{	"PROGV",			F, xprogv		}, /* 241 */
+{	"CHARACTERP",			S, xcharp		}, /* 242 */
+{	"CHAR-INT",			S, xcharint		}, /* 243 */
+{	"INT-CHAR",			S, xintchar		}, /* 244 */
+{	"READ-BYTE",			S, xrdbyte  		}, /* 245 */
+{	"WRITE-BYTE",			S, xwrbyte  		}, /* 246 */
+{	"MAKE-STRING-INPUT-STREAM", 	S, xmkstrinput		}, /* 247 */
+{	"MAKE-STRING-OUTPUT-STREAM",	S, xmkstroutput		}, /* 248 */
+{	"GET-OUTPUT-STREAM-STRING",	S, xgetstroutput	}, /* 249 */
+{	"GET-OUTPUT-STREAM-LIST",	S, xgetlstoutput	}, /* 250 */
+{	"GCD",				S, xgcd			}, /* 251 */
+{	"GET-LAMBDA-EXPRESSION", 	S, xgetlambda		}, /* 252 */
+{	"MACROEXPAND",			S, xmacroexpand		}, /* 253 */
+{	"MACROEXPAND-1",		S, x1macroexpand	}, /* 254 */
+{	"CHAR<",			S, xchrlss  		}, /* 255 */
+{	"CHAR<=",			S, xchrleq  		}, /* 256 */
+{	"CHAR=",			S, xchreql  		}, /* 257 */
+{	"CHAR/=",			S, xchrneq  		}, /* 258 */
+{	"CHAR>=",			S, xchrgeq  		}, /* 259 */
+{	"CHAR>",			S, xchrgtr  		}, /* 260 */
+{	"CHAR-LESSP",			S, xchrilss		}, /* 261 */
+{	"CHAR-NOT-GREATERP",		S, xchrileq		}, /* 262 */
+{	"CHAR-EQUAL",			S, xchrieql		}, /* 263 */
+{	"CHAR-NOT-EQUAL",		S, xchrineq		}, /* 264 */
+{	"CHAR-NOT-LESSP",		S, xchrigeq		}, /* 265 */
+{	"CHAR-GREATERP",		S, xchrigtr		}, /* 266 */
+{	"UPPER-CASE-P",			S, xuppercasep		}, /* 267 */
+{	"LOWER-CASE-P",			S, xlowercasep		}, /* 268 */
+{	"BOTH-CASE-P",			S, xbothcasep		}, /* 269 */
+{	"DIGIT-CHAR-P",			S, xdigitp		}, /* 270 */
+{	"ALPHANUMERICP",		S, xalphanumericp	}, /* 271 */
+{	"CHAR-UPCASE",			S, xchupcase		}, /* 272 */
+{	"CHAR-DOWNCASE",		S, xchdowncase		}, /* 273 */
+{	"DIGIT-CHAR",			S, xdigitchar		}, /* 274 */
+{	"CHAR-CODE",			S, xcharcode		}, /* 275 */
+{	"CODE-CHAR",			S, xcodechar		}, /* 276 */
+{	"ENDP",  			S, xendp		}, /* 277 */
+{	"REMOVE-IF",			S, xremif	    	}, /* 278 */
+{	"REMOVE-IF-NOT",		S, xremifnot		}, /* 279 */
+{	"DELETE-IF",			S, xdelif		}, /* 280 */
+{	"DELETE-IF-NOT",		S, xdelifnot		}, /* 281 */
+{	"TRACE",			F, xtrace		}, /* 282 */
+{	"UNTRACE",			F, xuntrace		}, /* 283 */
+{	"SORT",				S, xsort		}, /* 284 */
+
+
+    /* extra table entries */
+{	"PROFILE",   			S, xprofile		}, /* 285 */
+{	"STRING-SEARCH",		S, xstrsearch		}, /* 286 */
+{	"QUIT",		    		S, xquit		}, /* 287 */
+{	"OPEN-BINARY",			S, xbopen		}, /* 288 */
+{	"SETUP-CONSOLE",		S, xsetupconsole	}, /* 289 */
+{       "READ-INT",                     S, xrdint               }, /* 290 */
+{	"READ-FLOAT",			S, xrdfloat		}, /* 291 */
+{	"WRITE-INT",			S, xwrint		}, /* 292 */
+{	"WRITE-FLOAT",			S, xwrfloat		}, /* 293 */
+{	"INFO",			    	S, xinfo		}, /* 294 */ /* Ning Hu, Apr 2001 */
+{	"RRANDOM",  		        S, xrealrand	        }, /* 295 */
+#ifdef DEBUG_INPUT
+{	"START-RECORD-IO",  	        S, xstartrecordio       }, /* 296 */
+{	"STOP-RECORD-IO",   	        S, xstoprecordio	}, /* 297 */
+#else
+{	NULL,				S, xnotimp		}, /* 296 */
+{	NULL,				S, xnotimp		}, /* 297 */
+#endif
+{	"ATAN",				S, xatan		}, /* 298 */
+{	"BIGENDIANP",		        S, xbigendianp	        }, /* 299 */
+{	"SETDIR",                       S, xsetdir		}, /* 300 */    //Added by Ning Hu May.2001
+{       "LISTDIR",                      S, xlistdir             }, /* 301 */   // Added by RBD, Mar 2005
+{       "ECHOENABLED",                  S, xechoenabled         }, /* 302 */   // Added by RBD, Dec 2005
+{       "GET-SLIDER-VALUE",             S, xslider_read         }, /* 303 */
+{       "OSC-ENABLE",                   S, xosc_enable          }, /* 304 */
+{       "GET-TEMP-PATH",                S, xget_temp_path       }, /* 305 */
+{       "GET-USER",                     S, xget_user            }, /* 306 */
+{       "FIND-IN-XLISP-PATH",           S, xfind_in_xlisp_path  }, /* 307 */
+
+#ifdef MACINTOSH
+#include "macptrs.h"
+#endif
+
+    /* include system dependant function pointers */
+#include "osptrs.h"
+#include "localptrs.h"
+
+{0,0,0} /* end of table marker */
+
+};			
+
+/* xnotimp does not return anything on purpose, so disable
+ * "no return value" warning
+ */
+/* #pragma warning(disable: 4716)*/
+
+/* xnotimp - function table entries that are currently not implemented */
+LOCAL LVAL xnotimp(void)
+{
+    xlfail("function not implemented");
+    return NIL; /* never happens */
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlglob.c b/lib-src/libnyquist/nyquist/xlisp/xlglob.c
new file mode 100644
index 0000000..18a4386
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlglob.c
@@ -0,0 +1,95 @@
+/* xlglobals - xlisp global variables */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use
+
+ * 3-Apr-88	Dale Amon at CMU-CSD
+ *	Added a_extern to xlisp 2.0
+ *
+ * 18-Oct-87	Dale Amon at CMU-CSD
+ *	Added global pointer a_extern for node defining new EXTERN
+ *	node type.
+ *
+ * 12 Oct 90	RBD Added s_profile, profile_fixnum
+ */
+
+
+#include "xlisp.h"
+
+/* symbols */
+LVAL s_true=NIL,obarray=NIL;
+LVAL s_unbound=NIL,s_dot=NIL;
+LVAL s_quote=NIL,s_function=NIL;
+LVAL s_bquote=NIL,s_comma=NIL,s_comat=NIL;
+LVAL s_evalhook=NIL,s_applyhook=NIL,s_tracelist;
+LVAL s_lambda=NIL,s_macro=NIL;
+LVAL s_stdin=NIL,s_stdout=NIL,s_stderr=NIL,s_debugio=NIL,s_traceout=NIL;
+LVAL s_rtable=NIL;
+LVAL s_tracenable=NIL,s_tlimit=NIL,s_breakenable=NIL;
+LVAL s_loadingfiles=NIL;
+LVAL s_profile = NIL, profile_fixnum = NIL;
+LVAL s_setf=NIL,s_car=NIL,s_cdr=NIL,s_nth=NIL,s_aref=NIL,s_get=NIL;
+LVAL s_svalue=NIL,s_sfunction=NIL,s_splist=NIL;
+LVAL s_eql=NIL,s_gcflag=NIL,s_gchook=NIL;
+LVAL s_ifmt=NIL,s_ffmt=NIL;
+LVAL s_1plus=NIL,s_2plus=NIL,s_3plus=NIL;
+LVAL s_1star=NIL,s_2star=NIL,s_3star=NIL;
+LVAL s_minus=NIL,s_printcase=NIL;
+LVAL s_search_path=NIL;
+
+/* keywords */
+LVAL k_test=NIL,k_tnot=NIL;
+LVAL k_wspace=NIL,k_const=NIL,k_nmacro=NIL,k_tmacro=NIL;
+LVAL k_sescape=NIL,k_mescape=NIL;
+LVAL k_direction=NIL,k_input=NIL,k_output=NIL;
+LVAL k_start=NIL,k_end=NIL,k_1start=NIL,k_1end=NIL;
+LVAL k_2start=NIL,k_2end=NIL,k_count=NIL,k_key=NIL;
+LVAL k_verbose=NIL,k_print=NIL;
+LVAL k_upcase=NIL,k_downcase=NIL;
+
+/* lambda list keywords */
+LVAL lk_optional=NIL,lk_rest=NIL,lk_key=NIL,lk_aux=NIL;
+LVAL lk_allow_other_keys=NIL;
+
+/* type names */
+LVAL a_subr=NIL,a_fsubr=NIL;
+LVAL a_cons=NIL,a_symbol=NIL,a_fixnum=NIL,a_flonum=NIL;
+LVAL a_string=NIL,a_object=NIL,a_stream=NIL,a_vector=NIL;
+LVAL a_extern = NIL;
+LVAL a_closure=NIL,a_char=NIL,a_ustream=NIL;
+
+/* evaluation variables */
+LVAL **xlstack = NULL,**xlstkbase = NULL,**xlstktop = NULL;
+LVAL xlenv=NIL,xlfenv=NIL,xldenv=NIL;
+
+/* argument stack */
+LVAL *xlargstkbase = NULL;	/* argument stack base */
+LVAL *xlargstktop = NULL;	/* argument stack top */
+LVAL *xlfp = NULL;		/* argument frame pointer */
+LVAL *xlsp = NULL;		/* argument stack pointer */
+LVAL *xlargv = NULL;		/* current argument vector */
+int xlargc = 0;			/* current argument count */
+
+/* exception handling variables */
+XLCONTEXT *xlcontext = NULL;	/* current exception handler */
+XLCONTEXT *xltarget = NULL;	/* target context (for xljump) */
+LVAL xlvalue=NIL;		/* exception value (for xljump) */
+int xlmask=0;			/* exception type (for xljump) */
+
+/* debugging variables */
+int xldebug = 0;		/* debug level */
+int xlsample = 0;		/* control character sample rate */
+int xltrcindent = 0;		/* trace indent level */
+
+/* gensym variables */
+char gsprefix[STRMAX+1] = { 'G',0 };	/* gensym prefix string */
+int gsnumber = 1;		/* gensym number */
+
+/* i/o variables */
+int xlfsize = 0;		/* flat size of current print call */
+FILE *tfp = NULL;		/* transcript file pointer */
+
+/* general purpose string buffer */
+char buf[STRMAX+1] = { 0 };
+
+int xlatomcount	= 0;	/* how many atoms are there? */
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlimage.c b/lib-src/libnyquist/nyquist/xlisp/xlimage.c
new file mode 100644
index 0000000..6ed6ace
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlimage.c
@@ -0,0 +1,403 @@
+/* xlimage - xlisp memory image save/restore functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+#include "stdlib.h"
+#include "string.h"
+#include "xlisp.h"
+
+#ifdef SAVERESTORE
+
+/* external variables */
+extern LVAL obarray,s_gchook,s_gcflag;
+extern long nnodes,nfree,total;
+extern int anodes,nsegs,gccalls;
+extern struct segment *segs,*lastseg,*fixseg,*charseg;
+extern XLCONTEXT *xlcontext;
+extern LVAL fnodes;
+extern struct xtype_desc_struct desc_table[NTYPES];
+
+/* local variables */
+static OFFTYPE off,foff;
+static FILE *fp;
+
+/* forward declarations */
+LOCAL OFFTYPE readptr(void);
+LOCAL OFFTYPE cvoptr(LVAL p);
+LOCAL LVAL cviptr(OFFTYPE o);
+LOCAL void writeptr(OFFTYPE off);
+LOCAL void setoffset(void);
+LOCAL void writenode(LVAL node);
+LOCAL void freeimage(void);
+LOCAL void readnode(int type, LVAL node);
+
+
+/* xlisave - save the memory image */
+int xlisave(char *fname)
+{
+    char fullname[STRMAX+1];
+    unsigned char *cp;
+    SEGMENT *seg;
+    int n,i,max;
+    LVAL p;
+
+    /* default the extension */
+    if (needsextension(fname)) {
+        strcpy(fullname,fname);
+        strcat(fullname,".wks");
+        fname = fullname;
+    }
+
+    /* open the output file */
+    if ((fp = osbopen(fname,"w")) == NULL)
+        return (FALSE);
+
+    /* first call the garbage collector to clean up memory */
+    gc();
+
+    /* invalidate extern type descriptor symbol caches */
+    inval_caches();	
+
+    /* write out the pointer to the *obarray* symbol */
+    writeptr(cvoptr(obarray));
+
+    /* setup the initial file offsets */
+    off = foff = (OFFTYPE)2;
+
+    /* write out all nodes that are still in use */
+    for (seg = segs; seg != NULL; seg = seg->sg_next) {
+        p = &seg->sg_nodes[0];
+        for (n = seg->sg_size; --n >= 0; ++p, off += 2)
+            switch (ntype(p)) {
+            case FREE_NODE:
+                break;
+            case CONS:
+            case USTREAM:
+                setoffset();
+                osbputc(p->n_type,fp);
+                writeptr(cvoptr(car(p)));
+                writeptr(cvoptr(cdr(p)));
+                foff += 2;
+                break;
+            case EXTERN:
+                setoffset();
+                osbputc(EXTERN, fp);
+/*		printf("saving EXTERN p = %x, desc %x\n", p, getdesc(p)); fflush(stdout);*/
+                writeptr((OFFTYPE) (getdesc(p) - desc_table)); /* write type index */
+                writeptr((OFFTYPE) 0); /* pointer gets reconstructed on input */
+                foff += 2;
+                break;
+            default:
+                setoffset();
+                writenode(p);
+                break;
+            }
+    }
+
+    /* write the terminator */
+    osbputc(FREE_NODE,fp);
+    writeptr((OFFTYPE)0);
+
+    /* write out data portion of SYMBOL/VECTOR/OBJECT/STRING/CLOSURE nodes */
+    for (seg = segs; seg != NULL; seg = seg->sg_next) {
+        p = &seg->sg_nodes[0];
+        for (n = seg->sg_size; --n >= 0; ++p)
+            switch (ntype(p)) {
+            case SYMBOL:
+            case OBJECT:
+            case VECTOR:
+            case CLOSURE:
+                max = getsize(p);
+                for (i = 0; i < max; ++i)
+                    writeptr(cvoptr(getelement(p,i)));
+                break;
+            case STRING:
+                max = getslength(p);
+                for (cp = getstring(p); --max >= 0; )
+                    osbputc(*cp++,fp);
+                break;
+            case EXTERN:
+/*		printf("saving extern data for p = %x\n", p);*/
+                (*(getdesc(p)->save_meth))(fp, getinst(p));
+                break;
+            }
+    }
+
+    /* close the output file */
+    osclose(fp);
+
+    /* return successfully */
+    return (TRUE);
+}
+
+/* xlirestore - restore a saved memory image */
+int xlirestore(char *fname)
+{
+    extern FUNDEF funtab[];
+    char fullname[STRMAX+1];
+    unsigned char *cp;
+    int n,i,max,type;
+    SEGMENT *seg;
+    LVAL p;
+
+    /* default the extension */
+    if (needsextension(fname)) {
+        strcpy(fullname,fname);
+        strcat(fullname,".wks");
+        fname = fullname;
+    }
+
+   /* open the file */
+    if ((fp = osbopen(fname,"r")) == NULL)
+        return (FALSE);
+
+    /* free the old memory image */
+    freeimage();
+
+    /* initialize */
+    off = (OFFTYPE)2;
+    total = nnodes = nfree = 0L;
+    fnodes = NIL;
+    segs = lastseg = NULL;
+    nsegs = gccalls = 0;
+    xlenv = xlfenv = xldenv = s_gchook = s_gcflag = NIL;
+    xlstack = xlstkbase + EDEPTH;
+    xlcontext = NULL;
+
+    /* create the fixnum segment */
+    if ((fixseg = newsegment(SFIXSIZE)) == NULL)
+        xlfatal("insufficient memory - fixnum segment");
+
+    /* create the character segment */
+    if ((charseg = newsegment(CHARSIZE)) == NULL)
+        xlfatal("insufficient memory - character segment");
+
+    /* read the pointer to the *obarray* symbol */
+    obarray = cviptr(readptr());
+
+    /* read each node */
+    while ((type = osbgetc(fp)) >= 0)
+        switch (type) {
+        case FREE_NODE:
+            if ((off = readptr()) == (OFFTYPE)0)
+                goto done;
+            break;
+        case CONS:
+        case USTREAM:
+            p = cviptr(off);
+            p->n_type = type;
+            p->n_flags = 0;
+            rplaca(p,cviptr(readptr()));
+            rplacd(p,cviptr(readptr()));
+            off += 2;
+            break;
+        case EXTERN:
+            p = cviptr(off);
+/*	    printf("reading extern node p = %x\n", p);*/
+            p->n_type = EXTERN;
+            setdesc(p, desc_table + (int) readptr());
+/*	    printf("type desc is %x\n", getdesc(p));*/
+            setinst(p, (unsigned char *) readptr());
+/*	    printf("initial inst is %x\n", getinst(p));*/
+            off += 2;
+            break;
+        default:
+            readnode(type,cviptr(off));
+            off += 2;
+            break;
+        }
+done:
+
+    /* read the data portion of SYMBOL/VECTOR/OBJECT/STRING/CLOSURE nodes */
+    for (seg = segs; seg != NULL; seg = seg->sg_next) {
+        p = &seg->sg_nodes[0];
+        for (n = seg->sg_size; --n >= 0; ++p)
+            switch (ntype(p)) {
+            case SYMBOL:
+            case OBJECT:
+            case VECTOR:
+            case CLOSURE:
+                max = getsize(p);
+                if ((p->n_vdata = (LVAL *)malloc(max * sizeof(LVAL))) == NULL)
+                    xlfatal("insufficient memory - vector");
+                total += (long)(max * sizeof(LVAL));
+                for (i = 0; i < max; ++i)
+                    setelement(p,i,cviptr(readptr()));
+                break;
+            case STRING:
+                max = getslength(p);
+                if ((p->n_string = (unsigned char *)malloc(max)) == NULL)
+                    xlfatal("insufficient memory - string");
+                total += (long)max;
+                for (cp = getstring(p); --max >= 0; )
+                    *cp++ = osbgetc(fp);
+                break;
+            case STREAM:
+                setfile(p,NULL);
+                break;
+            case SUBR:
+            case FSUBR:
+                p->n_subr = funtab[getoffset(p)].fd_subr;
+                break;
+            case EXTERN:
+/*		printf("restoring extern %x\n", p); fflush(stdout); */
+                setinst(p, (*(getdesc(p)->restore_meth))(fp));
+                break;
+            }
+    }
+
+    /* close the input file */
+    osclose(fp);
+
+    /* collect to initialize the free space */
+    gc();
+
+    /* lookup all of the symbols the interpreter uses */
+    xlsymbols();
+
+    /* return successfully */
+    return (TRUE);
+}
+
+/* freeimage - free the current memory image */
+LOCAL void freeimage(void)
+{
+    SEGMENT *seg,*next;
+    FILE *fp;
+    LVAL p;
+    int n;
+
+    /* free the data portion of SYMBOL/VECTOR/OBJECT/STRING nodes */
+    for (seg = segs; seg != NULL; seg = next) {
+        p = &seg->sg_nodes[0];
+        for (n = seg->sg_size; --n >= 0; ++p)
+            switch (ntype(p)) {
+            case SYMBOL:
+            case OBJECT:
+            case VECTOR:
+            case CLOSURE:
+                if (p->n_vsize)
+                    free(p->n_vdata);
+                break;
+            case STRING:
+                if (getslength(p))
+                    free((void *) getstring(p));
+                break;
+            case STREAM:
+                if ((fp = getfile(p)) && (fp != stdin && fp != stdout && fp != STDERR))
+                    osclose(getfile(p));
+                break;
+            }
+        next = seg->sg_next;
+        free((void *) seg);
+    }
+}
+
+/* setoffset - output a positioning command if nodes have been skipped */
+LOCAL void setoffset(void)
+{
+    if (off != foff) {
+        osbputc(FREE_NODE,fp);
+        writeptr(off);
+        foff = off;
+    }
+}
+
+/* writenode - write a node to a file */
+LOCAL void writenode(LVAL node)
+{
+    char *p = (char *)&node->n_info;
+    int n = sizeof(union ninfo);
+    osbputc(node->n_type,fp);
+    while (--n >= 0)
+        osbputc(*p++,fp);
+    foff += 2;
+}
+
+/* writeptr - write a pointer to a file */
+LOCAL void writeptr(OFFTYPE off)
+{
+    char *p = (char *)&off;
+    int n = sizeof(OFFTYPE);
+    while (--n >= 0)
+        osbputc(*p++,fp);
+}
+
+/* readnode - read a node */
+LOCAL void readnode(int type, LVAL node)
+{
+    char *p = (char *)&node->n_info;
+    int n = sizeof(union ninfo);
+    node->n_type = type;
+    node->n_flags = 0;
+    while (--n >= 0)
+        *p++ = osbgetc(fp);
+}
+
+/* readptr - read a pointer */
+LOCAL OFFTYPE readptr(void)
+{
+    OFFTYPE off;
+    char *p = (char *)&off;
+    int n = sizeof(OFFTYPE);
+    while (--n >= 0)
+        *p++ = osbgetc(fp);
+    return (off);
+}
+
+/* cviptr - convert a pointer on input */
+LOCAL LVAL cviptr(OFFTYPE o)
+{
+    OFFTYPE off = (OFFTYPE)2;
+    SEGMENT *seg;
+
+    /* check for nil */
+    if (o == (OFFTYPE)0)
+        return ((LVAL)o);
+
+    /* compute a pointer for this offset */
+    for (seg = segs; seg != NULL; seg = seg->sg_next) {
+        if (o >= off && o < off + (OFFTYPE)(seg->sg_size << 1))
+            return (seg->sg_nodes + ((int)(o - off) >> 1));
+        off += (OFFTYPE)(seg->sg_size << 1);
+    }
+
+    /* create new segments if necessary */
+    for (;;) {
+
+        /* create the next segment */
+        if ((seg = newsegment(anodes)) == NULL)
+            xlfatal("insufficient memory - segment");
+
+        /* check to see if the offset is in this segment */
+        if (o >= off && o < off + (OFFTYPE)(seg->sg_size << 1))
+            return (seg->sg_nodes + ((int)(o - off) >> 1));
+        off += (OFFTYPE)(seg->sg_size << 1);
+    }
+}
+
+/* cvoptr - convert a pointer on output */
+LOCAL OFFTYPE cvoptr(LVAL p)
+{
+    OFFTYPE off = (OFFTYPE)2;
+    SEGMENT *seg;
+
+    /* check for nil and small fixnums */
+    if (p == NIL)
+        return ((OFFTYPE)p);
+
+    /* compute an offset for this pointer */
+    for (seg = segs; seg != NULL; seg = seg->sg_next) {
+        if (CVPTR(p) >= CVPTR(&seg->sg_nodes[0]) &&
+            CVPTR(p) <  CVPTR(&seg->sg_nodes[0] + seg->sg_size))
+            return (off + (OFFTYPE)((p - seg->sg_nodes) << 1));
+        off += (OFFTYPE)(seg->sg_size << 1);
+    }
+
+    /* pointer not within any segment */
+    xlerror("bad pointer found during image save",p);
+}
+
+#endif
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlinit.c b/lib-src/libnyquist/nyquist/xlisp/xlinit.c
new file mode 100644
index 0000000..eea2799
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlinit.c
@@ -0,0 +1,264 @@
+/* xlinit.c - xlisp initialization module */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use
+
+ * HISTORY
+ * 3-Apr-88	Dale Amon at CMU-CSD
+ *	Added EXTERN to xlisp 2.0
+ *
+ * 18-Oct-87	Dale Amon at CMU-CSD
+ *	Added initialization for new EXTERN node type.
+ *
+ * 12 Oct 90	RBD Added s_profile declaration
+ *
+ *  5 Jun 95    EAD took out extern init (put back when building nyquest)
+ */
+
+
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL s_true,s_dot,s_unbound;
+extern LVAL s_quote,s_function,s_bquote,s_comma,s_comat;
+extern LVAL s_lambda,s_macro;
+extern LVAL s_stdin,s_stdout,s_stderr,s_debugio,s_traceout;
+extern LVAL s_evalhook,s_applyhook,s_tracelist;
+extern LVAL s_tracenable,s_tlimit,s_breakenable, s_profile;
+extern LVAL s_setf,s_car,s_cdr,s_nth,s_aref,s_get,s_eql;
+extern LVAL s_svalue,s_sfunction,s_splist;
+extern LVAL s_rtable,k_wspace,k_const,k_nmacro,k_tmacro;
+extern LVAL k_sescape,k_mescape;
+extern LVAL s_ifmt,s_ffmt,s_printcase;
+extern LVAL s_1plus,s_2plus,s_3plus,s_1star,s_2star,s_3star,s_minus;
+extern LVAL k_test,k_tnot;
+extern LVAL k_direction,k_input,k_output;
+extern LVAL k_start,k_end,k_1start,k_1end,k_2start,k_2end;
+extern LVAL k_verbose,k_print,k_count,k_key,k_upcase,k_downcase;
+extern LVAL lk_optional,lk_rest,lk_key,lk_aux,lk_allow_other_keys;
+extern LVAL a_subr,a_fsubr,a_cons,a_symbol;
+extern LVAL a_fixnum,a_flonum,a_string,a_stream,a_object;
+extern LVAL a_vector,a_closure,a_char,a_ustream,a_extern;
+extern LVAL s_gcflag,s_gchook;
+extern LVAL s_search_path;
+extern FUNDEF funtab[];
+
+/* forward declarations */
+FORWARD LOCAL void initwks();
+
+
+/* xlinit - xlisp initialization routine */
+void xlinit(void)
+{
+    /* initialize xlisp (must be in this order) */
+    xlminit();	/* initialize xldmem.c */
+    xldinit();	/* initialize xldbug.c */
+
+    /* finish initializing */
+#ifdef SAVERESTORE
+    if (!xlirestore("xlisp.wks"))
+#endif
+	{
+        initwks();
+	}
+    /* note: localinit creates type descriptors, but these
+       may be necessary for xlirestore to work.  On the other
+       hand, localinit creates atoms, so it needs obarray to
+       be in place, and obarray is created by initwks.  We may
+       have a circular dependency to break before xlirestore
+       will work
+     */
+    localinit();	 /* initialize lisp extensions */ 
+}
+
+/* initwks - build an initial workspace */
+LOCAL void initwks(void)
+{
+    FUNDEF *p;
+    int i;
+    
+    xlsinit();	/* initialize xlsym.c */
+    xlsymbols();/* enter all symbols used by the interpreter */
+    xlrinit();	/* initialize xlread.c */
+    xloinit();	/* initialize xlobj.c */
+
+    /* setup defaults */
+    setvalue(s_evalhook,NIL);		/* no evalhook function */
+    setvalue(s_applyhook,NIL);		/* no applyhook function */
+    setvalue(s_tracelist,NIL);		/* no functions being traced */
+    setvalue(s_tracenable,NIL);		/* traceback disabled */
+    setvalue(s_tlimit,NIL); 		/* trace limit infinite */
+    setvalue(s_breakenable,NIL);	/* don't enter break loop on errors */
+    setvalue(s_loadingfiles,NIL);       /* not loading any files initially */
+    setvalue(s_profile,NIL);		/* don't do profiling */
+    setvalue(s_gcflag,NIL);		/* don't show gc information */
+    setvalue(s_gchook,NIL);		/* no gc hook active */
+    setvalue(s_ifmt,cvstring(IFMT));	/* integer print format */
+    setvalue(s_ffmt,cvstring("%g"));	/* float print format */
+    setvalue(s_printcase,k_upcase);	/* upper case output of symbols */
+
+    /* install the built-in functions and special forms */
+    for (i = 0, p = funtab; p->fd_subr != NULL; ++i, ++p)
+        if (p->fd_name)
+            xlsubr(p->fd_name,p->fd_type,p->fd_subr,i);
+
+    /* add some synonyms */
+    setfunction(xlenter("NOT"),getfunction(xlenter("NULL")));
+    setfunction(xlenter("FIRST"),getfunction(xlenter("CAR")));
+    setfunction(xlenter("SECOND"),getfunction(xlenter("CADR")));
+    setfunction(xlenter("THIRD"),getfunction(xlenter("CADDR")));
+    setfunction(xlenter("FOURTH"),getfunction(xlenter("CADDDR")));
+    setfunction(xlenter("REST"),getfunction(xlenter("CDR")));
+}
+
+/* xlsymbols - enter all of the symbols used by the interpreter */
+void xlsymbols(void)
+{
+    LVAL sym;
+
+    /* enter the unbound variable indicator (must be first) */
+    s_unbound = xlenter("*UNBOUND*");
+    setvalue(s_unbound,s_unbound);
+
+    /* enter the 't' symbol */
+    s_true = xlenter("T");
+    setvalue(s_true,s_true);
+
+    /* enter some important symbols */
+    s_dot	= xlenter(".");
+    s_quote	= xlenter("QUOTE");
+    s_function	= xlenter("FUNCTION");
+    s_bquote	= xlenter("BACKQUOTE");
+    s_comma	= xlenter("COMMA");
+    s_comat	= xlenter("COMMA-AT");
+    s_lambda	= xlenter("LAMBDA");
+    s_macro	= xlenter("MACRO");
+    s_eql	= xlenter("EQL");
+    s_ifmt	= xlenter("*INTEGER-FORMAT*");
+    s_ffmt	= xlenter("*FLOAT-FORMAT*");
+
+    /* symbols set by the read-eval-print loop */
+    s_1plus	= xlenter("+");
+    s_2plus	= xlenter("++");
+    s_3plus	= xlenter("+++");
+    s_1star	= xlenter("*");
+    s_2star	= xlenter("**");
+    s_3star	= xlenter("***");
+    s_minus	= xlenter("-");
+
+    /* enter setf place specifiers */
+    s_setf	= xlenter("*SETF*");
+    s_car	= xlenter("CAR");
+    s_cdr	= xlenter("CDR");
+    s_nth	= xlenter("NTH");
+    s_aref	= xlenter("AREF");
+    s_get	= xlenter("GET");
+    s_svalue	= xlenter("SYMBOL-VALUE");
+    s_sfunction	= xlenter("SYMBOL-FUNCTION");
+    s_splist	= xlenter("SYMBOL-PLIST");
+
+    /* enter the readtable variable and keywords */
+    s_rtable	= xlenter("*READTABLE*");
+    k_wspace	= xlenter(":WHITE-SPACE");
+    k_const	= xlenter(":CONSTITUENT");
+    k_nmacro	= xlenter(":NMACRO");
+    k_tmacro	= xlenter(":TMACRO");
+    k_sescape	= xlenter(":SESCAPE");
+    k_mescape	= xlenter(":MESCAPE");
+
+    /* enter parameter list keywords */
+    k_test	= xlenter(":TEST");
+    k_tnot	= xlenter(":TEST-NOT");
+
+    /* "open" keywords */
+    k_direction = xlenter(":DIRECTION");
+    k_input     = xlenter(":INPUT");
+    k_output    = xlenter(":OUTPUT");
+
+    /* enter *print-case* symbol and keywords */
+    s_printcase = xlenter("*PRINT-CASE*");
+    k_upcase	= xlenter(":UPCASE");
+    k_downcase  = xlenter(":DOWNCASE");
+
+    /* other keywords */
+    k_start	= xlenter(":START");
+    k_end	= xlenter(":END");
+    k_1start	= xlenter(":START1");
+    k_1end	= xlenter(":END1");
+    k_2start	= xlenter(":START2");
+    k_2end	= xlenter(":END2");
+    k_verbose	= xlenter(":VERBOSE");
+    k_print	= xlenter(":PRINT");
+    k_count	= xlenter(":COUNT");
+    k_key	= xlenter(":KEY");
+
+    /* enter lambda list keywords */
+    lk_optional	= xlenter("&OPTIONAL");
+    lk_rest	= xlenter("&REST");
+    lk_key	= xlenter("&KEY");
+    lk_aux	= xlenter("&AUX");
+    lk_allow_other_keys = xlenter("&ALLOW-OTHER-KEYS");
+
+    /* enter *standard-input*, *standard-output* and *error-output* */
+    s_stdin = xlenter("*STANDARD-INPUT*");
+    setvalue(s_stdin,cvfile(stdin));
+    s_stdout = xlenter("*STANDARD-OUTPUT*");
+    setvalue(s_stdout,cvfile(stdout));
+    s_stderr = xlenter("*ERROR-OUTPUT*");
+    setvalue(s_stderr,cvfile(STDERR));
+
+    /* enter *debug-io* and *trace-output* */
+    s_debugio = xlenter("*DEBUG-IO*");
+    setvalue(s_debugio,getvalue(s_stderr));
+    s_traceout = xlenter("*TRACE-OUTPUT*");
+    setvalue(s_traceout,getvalue(s_stderr));
+
+    /* enter the eval and apply hook variables */
+    s_evalhook = xlenter("*EVALHOOK*");
+    s_applyhook = xlenter("*APPLYHOOK*");
+
+    /* enter the symbol pointing to the list of functions being traced */
+    s_tracelist = xlenter("*TRACELIST*");
+
+    /* enter the error traceback and the error break enable flags */
+    s_tracenable = xlenter("*TRACENABLE*");
+    s_tlimit = xlenter("*TRACELIMIT*");
+    s_breakenable = xlenter("*BREAKENABLE*");
+    s_profile = xlenter("*PROFILE*");
+
+    /* enter the symbol pointing to the list of loading files */
+    s_loadingfiles = xlenter("*LOADINGFILES*");
+
+    /* enter a symbol to control printing of garbage collection messages */
+    s_gcflag = xlenter("*GC-FLAG*");
+    s_gchook = xlenter("*GC-HOOK*");
+
+    /* enter the symbol for the search path */
+    s_search_path = xlenter("*SEARCH-PATH*");
+
+    /* enter a copyright notice into the oblist */
+    sym = xlenter("**Copyright-1988-by-David-Betz**");
+    setvalue(sym,s_true);
+
+    /* enter type names */
+    a_subr	= xlenter("SUBR");
+    a_fsubr	= xlenter("FSUBR");
+    a_cons	= xlenter("CONS");
+    a_symbol	= xlenter("SYMBOL");
+    a_fixnum	= xlenter("FIXNUM");
+    a_flonum	= xlenter("FLONUM");
+    a_string	= xlenter("STRING");
+    a_object	= xlenter("OBJECT");
+    a_stream	= xlenter("FILE-STREAM");
+    a_vector	= xlenter("ARRAY");
+    a_extern	= xlenter("EXTERN");
+    a_closure	= xlenter("CLOSURE");
+    a_char      = xlenter("CHARACTER");
+    a_ustream	= xlenter("UNNAMED-STREAM");
+
+    /* add the object-oriented programming symbols and os specific stuff */
+    obsymbols();	/* object-oriented programming symbols */
+    ossymbols();	/* os specific symbols */
+    localsymbols();	/*  lisp extension symbols */
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlio.c b/lib-src/libnyquist/nyquist/xlisp/xlio.c
new file mode 100644
index 0000000..c2c0d0e
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlio.c
@@ -0,0 +1,242 @@
+/* xlio - xlisp i/o routines */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL s_stdin,s_stdout,s_stderr,s_debugio,s_traceout,s_unbound;
+extern int xlfsize;
+
+#ifdef DEBUG_INPUT
+extern FILE *read_by_xlisp;
+#endif
+
+/* xlgetc - get a character from a file or stream */
+int xlgetc(LVAL fptr)
+{
+    LVAL lptr, cptr=NULL;
+    FILE *fp;
+    int ch;
+
+    /* check for input from nil */
+    if (fptr == NIL)
+        ch = EOF;
+
+    /* otherwise, check for input from a stream */
+    else if (ustreamp(fptr)) {
+        if ((lptr = gethead(fptr)) == NIL)
+            ch = EOF;
+        else {
+            if (!consp(lptr) || (cptr = car(lptr)) == NIL || !charp(cptr))
+                xlfail("bad stream");
+            sethead(fptr,lptr = cdr(lptr));
+            if (lptr == NIL)
+                settail(fptr,NIL);
+            ch = getchcode(cptr);
+        }
+    }
+
+    /* otherwise, check for a buffered character */
+    else if ((ch = getsavech(fptr)))
+        setsavech(fptr,'\0');
+
+    /* otherwise, check for terminal input or file input */
+    else {
+        fp = getfile(fptr);
+        if (fp == stdin || fp == STDERR)
+            ch = ostgetc();
+        else
+            ch = osagetc(fp);
+#ifdef DEBUG_INPUT
+        if (read_by_xlisp && ch != -1) {
+			putc(ch, read_by_xlisp);
+		}
+#endif
+    }
+
+    /* return the character */
+    return (ch);
+}
+
+/* xlungetc - unget a character */
+void xlungetc(LVAL fptr, int ch)
+{
+    LVAL lptr;
+    
+    /* check for ungetc from nil */
+    if (fptr == NIL)
+        ;
+        
+    /* otherwise, check for ungetc to a stream */
+    if (ustreamp(fptr)) {
+        if (ch != EOF) {
+            lptr = cons(cvchar(ch),gethead(fptr));
+            if (gethead(fptr) == NIL)
+                settail(fptr,lptr);
+            sethead(fptr,lptr);
+        }
+    }
+    
+    /* otherwise, it must be a file */
+    else
+        setsavech(fptr,ch);
+}
+
+/* xlpeek - peek at a character from a file or stream */
+int xlpeek(LVAL fptr)
+{
+    LVAL lptr, cptr=NULL;
+    int ch;
+
+    /* check for input from nil */
+    if (fptr == NIL)
+        ch = EOF;
+
+    /* otherwise, check for input from a stream */
+    else if (ustreamp(fptr)) {
+        if ((lptr = gethead(fptr)) == NIL)
+            ch = EOF;
+        else {
+            if (!consp(lptr) || (cptr = car(lptr)) == NIL || !charp(cptr))
+                xlfail("bad stream");
+            ch = getchcode(cptr);
+        }
+    }
+
+    /* otherwise, get the next file character and save it */
+    else {
+        ch = xlgetc(fptr);
+        setsavech(fptr,ch);
+    }
+
+    /* return the character */
+    return (ch);
+}
+
+/* xlputc - put a character to a file or stream */
+void xlputc(LVAL fptr, int ch)
+{
+    LVAL lptr;
+    FILE *fp;
+
+    /* count the character */
+    ++xlfsize;
+
+    /* check for output to nil */
+    if (fptr == NIL)
+        ;
+
+    /* otherwise, check for output to an unnamed stream */
+    else if (ustreamp(fptr)) {
+        lptr = consa(cvchar(ch));
+        if (gettail(fptr))
+            rplacd(gettail(fptr),lptr);
+        else
+            sethead(fptr,lptr);
+        settail(fptr,lptr);
+    }
+
+    /* otherwise, check for terminal output or file output */
+    else {
+        fp = getfile(fptr);
+        if (!fp)
+            xlfail("file not open");
+        else if (fp == stdout || fp == STDERR)
+            ostputc(ch);
+        else
+            osaputc(ch,fp);
+    }
+}
+
+/* xloutflush -- flush output buffer */
+void xloutflush(LVAL fptr)
+{
+    FILE *fp;
+
+    /* check for output to nil or unnamed stream */
+    if (fptr == NIL || ustreamp(fptr))
+        ;
+
+    /* otherwise, check for terminal output or file output */
+    else {
+        fp = getfile(fptr);
+        if (!fp)
+            xlfail("file not open");
+        else if (fp == stdout || fp == STDERR)
+            ostoutflush();
+        else
+            osoutflush(fp);
+    }    
+}
+
+/* xlflush - flush the input buffer */
+void xlflush(void)
+{
+    osflush();
+}
+
+/* stdprint - print to *standard-output* */
+void stdprint(LVAL expr)
+{
+    xlprint(getvalue(s_stdout),expr,TRUE);
+    xlterpri(getvalue(s_stdout));
+}
+
+/* stdputstr - print a string to *standard-output* */
+void stdputstr(char *str)
+{
+    xlputstr(getvalue(s_stdout),str);
+}
+
+/* stdflush - flush the *standard-output* buffer */
+void stdflush()
+{
+    xloutflush(getvalue(s_stdout));
+}
+
+/* errprint - print to *error-output* */
+void errprint(LVAL expr)
+{
+    xlprint(getvalue(s_stderr),expr,TRUE);
+    xlterpri(getvalue(s_stderr));
+}
+
+/* errputstr - print a string to *error-output* */
+void errputstr(char *str)
+{
+    xlputstr(getvalue(s_stderr),str);
+}
+
+/* dbgprint - print to *debug-io* */
+void dbgprint(LVAL expr)
+{
+    xlprint(getvalue(s_debugio),expr,TRUE);
+    xlterpri(getvalue(s_debugio));
+}
+
+/* dbgputstr - print a string to *debug-io* */
+void dbgputstr(char *str)
+{
+    xlputstr(getvalue(s_debugio),str);
+}
+
+/* trcprin1 - print to *trace-output* */
+void trcprin1(LVAL expr)
+{
+    xlprint(getvalue(s_traceout),expr,TRUE);
+}
+
+/* trcputstr - print a string to *trace-output* */
+void trcputstr(char *str)
+{
+    xlputstr(getvalue(s_traceout),str);
+}
+
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.c b/lib-src/libnyquist/nyquist/xlisp/xlisp.c
new file mode 100644
index 0000000..8b2a395
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.c
@@ -0,0 +1,302 @@
+/* xlisp.c - a small implementation of lisp with object-oriented programming */
+/*	Copyright (c) 1987, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGELOG:
+  8 Oct 90 (Dannenberg) changed main() to xlisp_main_init and xlisp_main.
+               made xlisp run as a module that evaluates expressions and
+               retains state
+ */
+
+#include "switches.h"
+#include "stdlib.h"	/* declares exit() */
+#include "cext.h"
+#include "xlisp.h"
+#ifdef MACINTOSH
+#include "Memory.h"
+#endif
+
+FORWARD void xlisp_wrapup(void);
+
+/* define the banner line string */
+#ifdef EXT
+#ifdef NYQUIST
+#define BANNER "XLISP version 2.0, Copyright (c) 1986, by David Betz"
+#else
+#define BANNER "Music Editor, Copyright (c) 1987, by Roger B. Dannenberg\n\
+XLISP version 2.0, Copyright (c) 1986, by David Betz"
+#endif
+#else
+#ifdef CMTSTUFF
+#define BANNER "XLISP version 2.0, Copyright (c) 1986, by David Betz\n\
+CMU MIDI Toolkit, Copyright (c) 1993,1994, by Roger B. Dannenberg"
+#else
+#define BANNER "XLISP version 2.0, Copyright (c) 1986, by David Betz"
+#endif
+#endif
+
+/* global variables */
+jmp_buf top_level;
+int in_a_context = FALSE;
+int xl_main_loop = FALSE;
+
+/* external variables */
+extern LVAL s_stdin,s_evalhook,s_applyhook;
+extern LVAL s_1plus,s_2plus,s_3plus,s_1star,s_2star,s_3star,s_minus;
+extern int xltrcindent;
+extern int xldebug;
+extern LVAL s_true;
+extern char buf[];
+extern FILE *tfp;
+
+/* external routines */
+extern FILE *osaopen();
+
+#ifdef USE_RANDOM
+
+/* use a fast (but not particularly good) random number generator */
+
+long randomseed = 1L;
+
+long random() {
+// note that this takes a seed and returns a big number,
+// whereas I think XLisp's RANDOM is defined differently
+    long k1;
+
+    /* algorithm taken from Dr. Dobbs Journal, November 1985, page 91 */
+    k1 = randomseed / 127773L;
+    if ((randomseed = 16807L * (randomseed - k1 * 127773L) - k1 * 2836L) < 0L)
+      randomseed += 2147483647L;
+
+    /* return a random number between 0 and MAXFIX */
+    return randomseed;
+}
+#endif
+
+/* xlrand - return next random number in sequence */
+long xlrand (long range) {
+#ifdef USE_RAND
+    return rand() % range;
+#endif
+#ifdef USE_RANDOM
+    return random() % range;
+#endif
+}
+
+/* xlrealrand - return random number in [0, 1] */
+double xlrealrand() {
+    /* always use the random generator from the C library,
+       (do not use random() even if USE_RANDOM is defined */
+    return (double) rand() / RAND_MAX;
+}
+
+/* xlisp_main_init - the main initialization routine */
+void xlisp_main_init(int argc, char *argv[])
+{
+    char *transcript;
+    XLCONTEXT cntxt;
+    int verbose,i;
+         
+    /* setup default argument values */
+    transcript = NULL;
+    verbose = FALSE;
+
+    /* parse the argument list switches */
+#ifndef LSC
+    for (i = 1; i < argc; ++i)
+        if (argv[i][0] == '-')
+            switch(argv[i][1]) {
+            case 't':
+            case 'T':
+                transcript = &argv[i][2];
+                break;
+            case 'v':
+            case 'V':
+                verbose = TRUE;
+                break;
+            }
+#endif
+
+    /* initialize and print the banner line */
+    osinit(BANNER);
+
+    /* setup initialization error handler */
+    xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,(LVAL)1);
+    if (setjmp(cntxt.c_jmpbuf))
+        xlfatal("fatal initialization error");
+    if (setjmp(top_level))
+        xlfatal("RESTORE not allowed during initialization");
+
+    /* initialize xlisp */
+    xlinit();
+    xlend(&cntxt);
+
+#ifdef EXT
+    /* special initialization */
+#include "xlextstart.c"
+#endif
+
+    /* reset the error handler */
+    xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,s_true);
+
+    /* open the transcript file */
+    if (transcript && (tfp = osaopen(transcript,"w")) == NULL) {
+        sprintf(buf,"error: can't open transcript file: %s",transcript);
+        stdputstr(buf);
+    }
+
+    /* load "init.lsp" */
+	if (setjmp(cntxt.c_jmpbuf) == 0) {
+        xlload("init.lsp",TRUE,FALSE);
+	}
+
+    /* load any files mentioned on the command line */
+    if (setjmp(cntxt.c_jmpbuf) == 0)
+        for (i = 1; i < argc; i++)
+            if (argv[i][0] != '-' && !xlload(argv[i],TRUE,verbose))
+                xlerror("can't load file",cvstring(argv[i]));
+    xlend(&cntxt);
+    if (setjmp(top_level))
+        xlfatal("RESTORE not allowed out of read-eval-print loop");
+}
+
+
+/* xlisp_eval -- evaluate an expression created externally */
+LVAL xlisp_eval(LVAL expr)
+{
+    int was_in_a_context = in_a_context;
+    XLCONTEXT cntxt;
+
+    if (in_a_context == FALSE) {
+        /* create an execution context */
+        xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,s_true);
+        if (setjmp(cntxt.c_jmpbuf)) {
+            setvalue(s_evalhook,NIL);
+            setvalue(s_applyhook,NIL);
+            xltrcindent = 0;
+            xldebug = 0;
+            xlflush();
+            oserror("xlisp_eval returning NIL to caller");
+            in_a_context = FALSE;
+            return NIL;
+        }
+        in_a_context = TRUE;
+    }
+
+    expr = xleval(expr);
+
+    if (!was_in_a_context) {
+        xlend(&cntxt);
+        in_a_context = FALSE;
+    }
+    return expr;
+}
+
+
+/* xlisp_main -- run normal lisp read-eval-print loop */
+void xlisp_main()
+{
+    LVAL expr;
+    XLCONTEXT cntxt;
+
+    /* build an outer-most context */
+    xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,s_true);
+    in_a_context = TRUE;
+
+    /* target for restore */
+    if (setjmp(top_level))
+        xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,s_true);
+
+    /* protect some pointers */
+    xlsave1(expr);
+
+    /* main command processing loop */
+    for (xl_main_loop = TRUE; xl_main_loop;) {
+
+        /* setup the error return */
+        if (setjmp(cntxt.c_jmpbuf)) {
+            setvalue(s_evalhook,NIL);
+            setvalue(s_applyhook,NIL);
+            xltrcindent = 0;
+            xldebug = 0;
+            xlflush();
+        }
+
+        #ifndef READ_LINE
+        /* print a prompt */
+        stdputstr("> ");
+        #endif
+
+        /* read an expression */
+        if (!xlread(getvalue(s_stdin),&expr,FALSE))
+            break;
+
+        /* save the input expression */
+        xlrdsave(expr);
+
+        /* evaluate the expression */
+        expr = xleval(expr);
+
+        /* save the result */
+        xlevsave(expr);
+
+        /* print it */
+        stdprint(expr);
+    }
+    xlend(&cntxt);
+    in_a_context = FALSE;
+}
+
+/* #include "alloca.h" -- what was this for? -RBD */
+
+#ifndef EXT
+int main(int argc, char *argv[])
+{
+    xlisp_main_init(argc,argv);
+    xlisp_main();
+
+    /* clean up */
+    xlisp_wrapup();
+    return 0;
+}
+#endif
+
+
+/* xlrdsave - save the last expression returned by the reader */
+void xlrdsave(LVAL expr)
+{
+    setvalue(s_3plus,getvalue(s_2plus));
+    setvalue(s_2plus,getvalue(s_1plus));
+    setvalue(s_1plus,getvalue(s_minus));
+    setvalue(s_minus,expr);
+}
+
+/* xlevsave - save the last expression returned by the evaluator */
+void xlevsave(LVAL expr)
+{
+    setvalue(s_3star,getvalue(s_2star));
+    setvalue(s_2star,getvalue(s_1star));
+    setvalue(s_1star,expr);
+}
+
+/* xlfatal - print a fatal error message and exit */
+void xlfatal(char *msg)
+{
+    oserror(msg);
+    xlisp_wrapup();
+}
+
+/* wrapup - clean up and exit to the operating system */
+void xlisp_wrapup(void)
+{
+    if (tfp)
+        osclose(tfp);
+    osfinish();
+#ifdef CMTSTUFF
+    EXIT(0);
+#else
+    exit(0);
+#endif
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.h b/lib-src/libnyquist/nyquist/xlisp/xlisp.h
new file mode 100644
index 0000000..6b89fe6
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h
@@ -0,0 +1,1012 @@
+/* xlisp - a small subset of lisp */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use
+
+HISTORY
+28-Apr-03   Mazzoni
+                Added declarations for path.c (new file)
+30-Mar-88	Dale Amon CMU-CSD
+                Set it up for unix. Picked _TURBOC_  because defs
+                are reasonable.
+*/
+
+/* system specific definitions */
+
+#include <stdlib.h> /* needed for getenv(); note that this was a problem
+    for PMAX implementation, but I assume PMAX is obsolete now. 
+    - RBD 16apr04 */
+#include <stdio.h>
+#include <ctype.h>
+#include <setjmp.h>
+
+/* NNODES	number of nodes to allocate in each request (1000) */
+/* EDEPTH	evaluation stack depth (2000) */
+/* ADEPTH	argument stack depth (1000) */
+/* FORWARD	type of a forward declaration () */
+/* LOCAL	type of a local function (static) */
+/* AFMT		printf format for addresses ("%x") */
+/* FIXTYPE	data type for fixed point numbers (long) */
+/* ITYPE	fixed point input conversion routine type (long atol()) */
+/* ICNV		fixed point input conversion routine (atol) */
+/* IFMT		printf format for fixed point numbers ("%ld") */
+/* FLOTYPE	data type for floating point numbers (float) */
+/* OFFTYPE	number the size of an address (int) */
+
+/* for the Win32 environment */
+#ifdef WIN32
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define SAVERESTORE
+#define XL_LITTLE_ENDIAN 
+#endif
+
+/* for the Turbo C compiler - MS-DOS, large model */
+#ifdef _TURBOC_
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define SAVERESTORE
+#define XL_LITTLE_ENDIAN
+#endif
+
+/* for the AZTEC C compiler - MS-DOS, large model */
+#ifdef AZTEC_LM
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define CVPTR(x)	ptrtoabs(x)
+#define NIL		(void *)0
+extern long ptrtoabs();
+#define SAVERESTORE
+#define XL_LITTLE_ENDIAN
+#endif
+
+/* for the AZTEC C compiler - Macintosh */
+#ifdef AZTEC_MAC
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define NIL		(void *)0
+#define SAVERESTORE
+#define XL_BIG_ENDIAN
+#endif
+
+/* for the AZTEC C compiler - Amiga */
+#ifdef AZTEC_AMIGA
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define NIL		(void *)0
+#define SAVERESTORE
+#define XL_BIG_ENDIAN
+#endif
+
+/* for the Lightspeed C compiler - Macintosh */
+#ifdef LSC
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define NIL		(void *)0
+#define SAVERESTORE
+#define XL_BIG_ENDIAN
+#endif
+
+/* for the Microsoft C compiler - MS-DOS, large model */
+#ifdef MSC
+#define NNODES		2000
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define XL_LITTLE_ENDIAN
+#endif
+
+/* for the Mark Williams C compiler - Atari ST */
+#ifdef MWC
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#define XL_BIG_ENDIAN
+#endif
+
+/* for the Lattice C compiler - Atari ST */
+#ifdef LATTICE
+#define FIXTYPE		int
+#define ITYPE		int atoi()
+#define ICNV(n)		atoi(n)
+#define IFMT		"%d"
+#define XL_BIG_ENDIAN
+#endif
+
+/* for the Digital Research C compiler - Atari ST */
+#ifdef DR
+#define LOCAL
+#define AFMT		"%lx"
+#define OFFTYPE		long
+#undef NULL
+#define NULL		0L
+#define XL_BIG_ENDIAN
+#endif
+
+/* Mac Metrowerks CW 6 */
+#ifdef __MWERKS__
+#define LSC
+#undef PATHNAMES
+#undef FILETABLE
+#undef SAVERESTORE
+#undef MEDMEM
+#define EDEPTH 4000
+#define ADEPTH 3000
+#define OSAOPEN osaopen
+#define OSBOPEN osbopen
+#define NO_EXTENSIONS  /* don't add ".lsp" onto filenames */
+#define XL_BIG_ENDIAN
+#endif
+
+/* Linux on Pentium */
+#ifdef __linux__
+#include <endian.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define XL_LITTLE_ENDIAN
+#else
+#define XL_BIG_ENDIAN
+#endif
+#endif
+
+/* Apple CC */
+#ifdef __APPLE__
+#define NNODES 2000
+#define AFMT "%lx"
+#define OFFTYPE long
+#define NIL (void *)0
+#define SAVERESTORE
+#include <sys/types.h>
+/* #if __BYTE_ORDER == __LITTLE_ENDIAN */
+#if defined(__LITTLE_ENDIAN__)
+#define XL_LITTLE_ENDIAN
+#else
+#define XL_BIG_ENDIAN
+#endif
+#endif
+
+/* default important definitions */
+#ifndef NNODES
+#define NNODES		1000
+#endif
+#ifndef NTYPES
+#define NTYPES		20
+#endif
+#ifndef EDEPTH
+/* originally was 2000 */
+#define EDEPTH		4000
+#endif
+#ifndef ADEPTH
+/* originally was 1000 */
+#define ADEPTH		2000
+#endif
+#ifndef FORWARD
+#define FORWARD
+#endif
+#ifndef LOCAL
+#define LOCAL		static
+#endif
+#ifndef AFMT
+#define AFMT		"%x"
+#endif
+#ifndef FIXTYPE
+#define FIXTYPE		long
+#endif
+#ifndef ITYPE
+#ifndef atol  /* if atol is a macro, this will mess things up */
+#define ITYPE		long atol()
+#endif
+#endif
+#ifndef ICNV
+#define ICNV(n)		atol(n)
+#endif
+#ifndef IFMT
+#define IFMT		"%ld"
+#endif
+#ifndef FLOTYPE
+#define FLOTYPE		double
+#endif
+#ifndef OFFTYPE
+#define OFFTYPE		int
+#endif
+#ifndef CVPTR
+#define CVPTR(x)	(x)
+#endif
+#ifndef UCHAR
+#define UCHAR		unsigned char
+#endif
+
+#ifndef STDERR
+#define STDERR stderr
+#endif
+
+/* useful definitions */
+#ifndef TRUE
+#define TRUE	1
+#define FALSE	0
+#endif
+#define externp(x) ((x) && ntype(x) == EXTERN)
+#ifndef NIL
+#define NIL	(LVAL )0
+#endif
+
+/* include the dynamic memory definitions */
+#include "xldmem.h"
+
+/* program limits */
+#define STRMAX		250		/* maximum length of a string constant */
+/* this was 100 -- I had a perfectly good full path to init.lsp using
+   a directory structure created by Apple's Xcode that was about 108
+   characters, so I picked a bigger value. -RBD */
+
+#define HSIZE		1499		/* symbol hash table size */
+#define SAMPLE		1000		/* control character sample rate */
+
+/* function table offsets for the initialization functions */
+#define FT_RMHASH	0
+#define FT_RMQUOTE	1
+#define FT_RMDQUOTE	2
+#define FT_RMBQUOTE	3
+#define FT_RMCOMMA	4
+#define FT_RMLPAR	5
+#define FT_RMRPAR	6
+#define FT_RMSEMI	7
+#define FT_CLNEW	10
+#define FT_CLISNEW	11
+#define FT_CLANSWER	12
+#define FT_OBISNEW	13
+#define FT_OBCLASS	14
+#define FT_OBSHOW	15
+#define FT_OBISA        16
+        
+/* macro to push a value onto the argument stack */
+#define pusharg(x)	{if (xlsp >= xlargstktop) xlargstkoverflow();\
+                         *xlsp++ = (x);}
+
+/* #define DEBUG_GC */
+
+/* macros to protect pointers */
+#ifdef DEBUG_GC
+void dbg_gc_xlsave(LVAL *n);
+
+#define xlstkcheck(n)	{if (xlstack - (n) < xlstkbase) xlstkoverflow();}
+#define xlsave(n)	{*--xlstack = &n; n = NIL; dbg_gc_xlsave(&n);}
+#define xlprotect(n)	{*--xlstack = &n; dbg_gc_xlsave(&n);}
+
+/* check the stack and protect a single pointer */
+#define xlsave1(n)	{if (xlstack <= xlstkbase) xlstkoverflow();\
+                         *--xlstack = &n; n = NIL; dbg_gc_xlsave(&n);}
+#define xlprot1(n)	{if (xlstack <= xlstkbase) xlstkoverflow();\
+                         *--xlstack = &n; dbg_gc_xlsave(&n);}
+
+/* macros to pop pointers off the stack */
+#define xlpop()		{++xlstack;}
+#define xlpopn(n)	{xlstack+=(n);}
+
+#else
+
+#define xlstkcheck(n)	{if (xlstack - (n) < xlstkbase) xlstkoverflow();}
+#define xlsave(n)	{*--xlstack = &n; n = NIL;}
+#define xlprotect(n)	{*--xlstack = &n;}
+
+/* check the stack and protect a single pointer */
+#define xlsave1(n)	{if (xlstack <= xlstkbase) xlstkoverflow();\
+                         *--xlstack = &n; n = NIL;}
+#define xlprot1(n)	{if (xlstack <= xlstkbase) xlstkoverflow();\
+                         *--xlstack = &n;}
+
+/* macros to pop pointers off the stack */
+#define xlpop()		{++xlstack;}
+#define xlpopn(n)	{xlstack+=(n);}
+#endif
+
+/* macros to manipulate the lexical environment */
+#define xlframe(e)	cons(NIL,e)
+#define xlbind(s,v)	xlpbind(s,v,xlenv)
+#define xlfbind(s,v)	xlpbind(s,v,xlfenv);
+#define xlpbind(s,v,e)	{rplaca(e,cons(cons(s,v),car(e)));}
+
+/* macros to manipulate the dynamic environment */
+#define xldbind(s,v)	{xldenv = cons(cons(s,getvalue(s)),xldenv);\
+                         setvalue(s,v);}
+#define xlunbind(e)	{for (; xldenv != (e); xldenv = cdr(xldenv))\
+                           setvalue(car(car(xldenv)),cdr(car(xldenv)));}
+
+/* type predicates */			       
+#define atomp(x)		((x) == NIL || ntype(x) != CONS)
+#define null(x)		((x) == NIL)
+#define listp(x)	((x) == NIL || ntype(x) == CONS)
+#define consp(x)	((x) && ntype(x) == CONS)
+#define subrp(x)	((x) && ntype(x) == SUBR)
+#define fsubrp(x)	((x) && ntype(x) == FSUBR)
+#define stringp(x)	((x) && ntype(x) == STRING)
+#define symbolp(x)	((x) && ntype(x) == SYMBOL)
+#define streamp(x)	((x) && ntype(x) == STREAM)
+#define objectp(x)	((x) && ntype(x) == OBJECT)
+#define fixp(x)		((x) && ntype(x) == FIXNUM)
+#define floatp(x)	((x) && ntype(x) == FLONUM)
+#define vectorp(x)	((x) && ntype(x) == VECTOR)
+#define closurep(x)	((x) && ntype(x) == CLOSURE)
+#define charp(x)	((x) && ntype(x) == CHAR)
+#define ustreamp(x)	((x) && ntype(x) == USTREAM)
+#define boundp(x)	(getvalue(x) != s_unbound)
+#define fboundp(x)	(getfunction(x) != s_unbound)
+
+/* shorthand functions */
+#define consa(x)	cons(x,NIL)
+#define consd(x)	cons(NIL,x)
+
+/* argument list parsing macros */
+#define xlgetarg()	(testarg(nextarg()))
+#define xllastarg()	{if (xlargc != 0) xltoomany();}
+#define testarg(e)	(moreargs() ? (e) : xltoofew())
+#define typearg(tp)	(tp(*xlargv) ? nextarg() : xlbadtype(*xlargv))
+#define nextarg()	(--xlargc, *xlargv++)
+#define moreargs()	(xlargc > 0)
+
+/* macros to get arguments of a particular type */
+#define xlgacons()	(testarg(typearg(consp)))
+#define xlgalist()	(testarg(typearg(listp)))
+#define xlgasymbol()	(testarg(typearg(symbolp)))
+#define xlgastring()	(testarg(typearg(stringp)))
+#define xlgaobject()	(testarg(typearg(objectp)))
+#define xlgafixnum()	(testarg(typearg(fixp)))
+#define xlgaflonum()	(testarg(typearg(floatp)))
+#define xlgachar()	(testarg(typearg(charp)))
+#define xlgavector()	(testarg(typearg(vectorp)))
+#define xlgastream()	(testarg(typearg(streamp)))
+#define xlgaustream()	(testarg(typearg(ustreamp)))
+#define xlgaclosure()	(testarg(typearg(closurep)))
+
+/* function definition structure */
+typedef struct {
+    char *fd_name;	/* function name */
+    int fd_type;	/* function type */
+    LVAL (*fd_subr)(void);	/* function entry point */
+} FUNDEF;
+
+/* execution context flags */
+#define CF_GO		0x0001
+#define CF_RETURN	0x0002
+#define CF_THROW	0x0004
+#define CF_ERROR	0x0008
+#define CF_CLEANUP	0x0010
+#define CF_CONTINUE	0x0020
+#define CF_TOPLEVEL	0x0040
+#define CF_BRKLEVEL	0x0080
+#define CF_UNWIND	0x0100
+
+
+/* execution context */
+typedef struct context {
+    int c_flags;			/* context type flags */
+    LVAL c_expr;			/* expression (type dependant) */
+    jmp_buf c_jmpbuf;			/* longjmp context */
+    struct context *c_xlcontext;	/* old value of xlcontext */
+    LVAL **c_xlstack;			/* old value of xlstack */
+    LVAL *c_xlargv;			/* old value of xlargv */
+    int c_xlargc;			/* old value of xlargc */
+    LVAL *c_xlfp;			/* old value of xlfp */
+    LVAL *c_xlsp;			/* old value of xlsp */
+    LVAL c_xlenv;			/* old value of xlenv */
+    LVAL c_xlfenv;			/* old value of xlfenv */
+    LVAL c_xldenv;			/* old value of xldenv */
+} XLCONTEXT;
+
+/* external variables */
+extern LVAL **xlstktop;       	/* top of the evaluation stack */
+extern LVAL **xlstkbase;	/* base of the evaluation stack */
+extern LVAL **xlstack;		/* evaluation stack pointer */
+extern LVAL *xlargstkbase;	/* base of the argument stack */
+extern LVAL *xlargstktop;	/* top of the argument stack */
+extern LVAL *xlfp;		/* argument frame pointer */
+extern LVAL *xlsp;		/* argument stack pointer */
+extern LVAL *xlargv;		/* current argument vector */
+extern int xlargc;		/* current argument count */
+
+/* more external variables */
+extern LVAL xlenv,xlfenv,xldenv,xlvalue,s_true;
+extern LVAL lk_optional,lk_rest,lk_key,lk_aux,lk_allow_other_keys;
+extern LVAL s_evalhook,s_applyhook,s_tracelist;
+extern LVAL s_lambda,s_macro;
+extern LVAL s_unbound;
+extern int xlsample;
+extern char buf[];
+extern LVAL obarray,s_gcflag,s_gchook;
+extern int xldebug;
+extern LVAL s_debugio;
+extern LVAL s_tracenable,s_tlimit,s_breakenable;
+extern LVAL s_loadingfiles;
+extern LVAL k_direction,k_input,k_output;
+extern LVAL s_stdin,s_stdout;
+extern int xlfsize;
+/* external variables */
+extern LVAL s_car,s_cdr,s_nth,s_get,s_svalue,s_splist,s_aref;
+extern LVAL s_comma,s_comat;
+extern char gsprefix[];
+extern int gsnumber;
+
+
+/* additional prototypes */
+
+extern FILE *osaopen (char *name, char *mode);
+extern FILE *osbopen (char *name, char *mode);
+
+#ifdef __MWERKS__
+/* macfun.c */
+
+LVAL xptsize(void);
+LVAL xhidepen(void);
+LVAL xshowpen(void);
+LVAL xgetpen(void);
+LVAL xpenmode(void);
+LVAL xpensize(void);
+LVAL xpenpat(void);
+LVAL xpennormal(void);
+LVAL xmoveto(void);
+LVAL xmove(void);
+LVAL xdrawto(void);
+LVAL xdraw(void);
+LVAL xshowgraphics(void);
+LVAL xhidegraphics(void);
+LVAL xcleargraphics(void);
+LVAL xtool(void);
+LVAL xtool16(void);
+LVAL xtool32(void);
+LVAL xnewhandle(void);
+LVAL xnewptr(void);
+LVAL xhiword(void);
+LVAL xloword(void);
+LVAL xrdnohang(void);
+/* #include "macstuff.h" */
+#endif
+
+/* for extern.c */
+
+void inval_caches();
+
+
+/* for xlbfun.c */
+
+LVAL xeval(void);
+LVAL xapply(void);
+LVAL xfuncall(void);
+LVAL xmacroexpand(void);
+LVAL x1macroexpand(void);
+LVAL xatom(void);
+LVAL xsymbolp(void);
+LVAL xnumberp(void);
+LVAL xintegerp(void);
+LVAL xfloatp(void);
+LVAL xcharp(void);
+LVAL xstringp(void);
+LVAL xarrayp(void);
+LVAL xstreamp(void);
+LVAL xobjectp(void);
+LVAL xboundp(void);
+LVAL xfboundp(void);
+LVAL xnull(void);
+LVAL xlistp(void);
+LVAL xendp(void);
+LVAL xconsp(void);
+LVAL xeq(void);
+LVAL xeql(void);
+LVAL xequal(void);
+LVAL xset(void);
+LVAL xgensym(void);
+LVAL xmakesymbol(void);
+LVAL xintern(void);
+LVAL xsymname(void);
+LVAL xsymvalue(void);
+LVAL xsymfunction(void);
+LVAL xsymplist(void);
+LVAL xget(void);
+LVAL xputprop(void);
+LVAL xremprop(void);
+LVAL xhash(void);
+LVAL xaref(void);
+LVAL xmkarray(void);
+LVAL xvector(void);
+LVAL xerror(void);
+LVAL xcerror(void);
+LVAL xbreak(void);
+LVAL xcleanup(void);
+LVAL xtoplevel(void);
+LVAL xcontinue(void);
+LVAL xevalhook(void);
+
+
+/* xlcont.c */
+
+LVAL xquote(void);
+LVAL xfunction(void);
+LVAL xbquote(void);
+LVAL xlambda(void);
+LVAL xgetlambda(void);
+LVAL xsetq(void);
+LVAL xpsetq(void);
+LVAL xsetf(void);
+LVAL xdefun(void);
+LVAL xdefmacro(void);
+LVAL xcond(void);
+LVAL xwhen(void);
+LVAL xunless(void);
+LVAL xcase(void);
+LVAL xand(void);
+LVAL x_or(void); // xor causes problems for gcc, so I renamed it. -RBD
+LVAL xif(void);
+LVAL xlet(void);
+LVAL xletstar(void);
+LVAL xflet(void);
+LVAL xlabels(void);
+LVAL xmacrolet(void);
+LVAL xprog(void);
+LVAL xprogstar(void);
+LVAL xgo(void);
+LVAL xreturn(void);
+LVAL xrtnfrom(void);
+LVAL xprog1(void);
+LVAL xprog2(void);
+LVAL xprogn(void);
+LVAL xprogv(void);
+LVAL xloop(void);
+LVAL xdo(void);
+LVAL xdostar(void);
+LVAL xdolist(void);
+LVAL xdotimes(void);
+LVAL xblock(void);
+LVAL xtagbody(void);
+LVAL xcatch(void);
+LVAL xthrow(void);
+LVAL xunwindprotect(void);
+LVAL xerrset(void);
+LVAL xtrace(void);
+LVAL xuntrace(void);
+
+
+/* xldbug.c */
+
+void xlabort(char *emsg);
+void xlbreak(char *emsg, LVAL arg);
+void xlfail(char *emsg);
+void xlerror(char *emsg, LVAL arg);
+void xlcerror(char *cmsg, char *emsg, LVAL arg);
+void xlerrprint(char *hdr, char *cmsg, char *emsg, LVAL arg);
+void xlbaktrace(int n);
+void xldinit(void);
+void close_loadingfiles(void);
+
+/* xldmem.c */
+
+LVAL cons(LVAL x, LVAL y);
+LVAL cvstring(const char *str);
+LVAL new_string(int size);
+LVAL cvsymbol(char *pname);
+LVAL cvsubr(LVAL (*fcn)(void), int type, int offset);
+LVAL cvfile(FILE *fp);
+LVAL cvfixnum(FIXTYPE n);
+LVAL cvflonum(FLOTYPE n);
+LVAL cvchar(int n);
+LVAL newustream(void);
+LVAL newobject(LVAL cls, int size);
+LVAL newclosure(LVAL name, LVAL type, LVAL env, LVAL fenv);
+LVAL newvector(int size);
+void gc(void);
+SEGMENT *newsegment(int n);
+LVAL xgc(void);
+LVAL xexpand(void);
+LVAL xalloc(void);
+LVAL xmem(void);
+LVAL xsave(void);
+LVAL xrestore(void);
+void xlminit(void);
+LVAL cvextern(xtype_desc typeptr, unsigned char *instptr);		/* convert an external type */
+LVAL newnode(int type);
+void mark(LVAL ptr);
+
+
+/* xleval.c */
+
+LVAL xleval(LVAL expr);
+LVAL xlxeval(LVAL expr);
+LVAL xlapply(int argc);
+LVAL xlexpandmacros(LVAL form);
+int macroexpand(LVAL fun, LVAL args, LVAL *pval);
+int pushargs(LVAL fun, LVAL args);
+LVAL makearglist(int argc, LVAL *argv);
+LVAL xlclose(LVAL name, LVAL type, LVAL fargs, LVAL body, LVAL env, LVAL fenv);
+void xlabind(LVAL fun, int argc, LVAL *argv);
+void xlunbound(LVAL sym);
+void xlfunbound(LVAL sym);
+void xlstkoverflow(void);
+void xlargstkoverflow(void);
+
+
+/* xlfio.c */
+
+LVAL xread(void);
+LVAL xprint(void);
+LVAL xprin1(void);
+LVAL xprinc(void);
+LVAL xterpri(void);
+LVAL xflatsize(void);
+LVAL xflatc(void);
+LVAL xopen(void);
+LVAL xbopen(void);
+LVAL xclose(void);
+LVAL xrdchar(void);
+LVAL xrdbyte(void);
+LVAL xpkchar(void);
+LVAL xwrchar(void);
+LVAL xwrbyte(void);
+LVAL xrdint(void);
+LVAL xwrint(void);
+LVAL xrdfloat(void);
+LVAL xwrfloat(void);
+LVAL xreadline(void);
+LVAL xmkstrinput(void);
+LVAL xmkstroutput(void);
+LVAL xgetstroutput(void);
+LVAL xgetlstoutput(void);
+LVAL xformat(void);
+LVAL xlistdir(void);
+
+
+/* xlimage.c */
+
+int xlisave(char *fname);
+int xlirestore(char *fname);
+
+
+/* xlinit.c */
+
+void xlinit(void);
+void xlsymbols(void);
+
+
+/* xlio.c */
+
+int xlgetc(LVAL fptr);
+void xlungetc(LVAL fptr, int ch);
+int xlpeek(LVAL fptr);
+void xlputc(LVAL fptr, int ch);
+void xloutflush(LVAL fptr);
+void xlflush(void);
+void stdprint(LVAL expr);
+void stdputstr(char *str);
+void stdflush();
+void errprint(LVAL expr);
+void errputstr(char *str);
+void dbgprint(LVAL expr);
+void dbgputstr(char *str);
+void trcprin1(LVAL expr);
+void trcputstr(char *str);
+
+
+/* xlisp.c */
+long xlrand(long range);
+double xlrealrand(void);
+void xlrdsave(LVAL expr);
+void xlevsave(LVAL expr);
+void xlfatal(char *msg);
+void xlisp_main_init(int, char **);
+void xlisp_main(void);
+void xlisp_wrapup(void);
+
+
+/* xljump.c */
+
+void xlbegin(XLCONTEXT *cptr, int flags, LVAL expr);
+void xlend(XLCONTEXT *cptr);
+void xlgo(LVAL label);
+void xlreturn(LVAL name, LVAL val);
+void xlthrow(LVAL tag, LVAL val);
+void xlsignal(char *emsg, LVAL arg);
+void xltoplevel(void);
+void xlbrklevel(void);
+void xlcleanup(void);
+void xlcontinue(void);
+void xljump(XLCONTEXT *target, int mask, LVAL val);
+
+
+/* xllist.c */
+
+LVAL xcar(void);
+LVAL xcdr(void);
+LVAL xcaar(void);
+LVAL xcadr(void);
+LVAL xcdar(void);
+LVAL xcddr(void);
+LVAL xcaaar(void);
+LVAL xcaadr(void);
+LVAL xcadar(void);
+LVAL xcaddr(void);
+LVAL xcdaar(void);
+LVAL xcdadr(void);
+LVAL xcddar(void);
+LVAL xcdddr(void);
+
+/* cxxxxr functions */
+LVAL xcaaaar(void);
+LVAL xcaaadr(void);
+LVAL xcaadar(void);
+LVAL xcaaddr(void);
+LVAL xcadaar(void);
+LVAL xcadadr(void);
+LVAL xcaddar(void);
+LVAL xcadddr(void);
+LVAL xcdaaar(void);
+LVAL xcdaadr(void);
+LVAL xcdadar(void);
+LVAL xcdaddr(void);
+LVAL xcddaar(void);
+LVAL xcddadr(void);
+LVAL xcdddar(void);
+LVAL xcddddr(void);
+LVAL xcons(void);
+LVAL xlist(void);
+LVAL xappend(void);
+LVAL xreverse(void);
+LVAL xlast(void);
+LVAL xmember(void);
+LVAL xassoc(void);
+LVAL xsubst(void);
+LVAL xsublis(void);
+LVAL xremove(void);
+LVAL xremif(void);
+LVAL xremifnot(void);
+int dotest1(LVAL arg, LVAL fun);
+int dotest2(LVAL arg1, LVAL arg2, LVAL fun);
+LVAL xnth(void);
+LVAL xnthcdr(void);
+LVAL xlength(void);
+LVAL xmapc(void);
+LVAL xmapcar(void);
+LVAL xmapl(void);
+LVAL xmaplist(void);
+LVAL xrplca(void);
+LVAL xrplcd(void);
+LVAL xnconc(void);
+LVAL xdelete(void);
+LVAL xdelif(void);
+LVAL xdelifnot(void);
+LVAL xsort(void);
+
+
+/* xlmath.c */
+
+LVAL xadd(void);
+LVAL xsub(void);
+LVAL xmul(void);
+LVAL xdiv(void);
+LVAL xrem(void);
+LVAL xmin(void);
+LVAL xmax(void);
+LVAL xexpt(void);
+LVAL xlogand(void);
+LVAL xlogior(void);
+LVAL xlogxor(void);
+LVAL xgcd(void);
+void checkizero(FIXTYPE iarg);
+void checkfzero(FLOTYPE farg);
+void checkfneg(FLOTYPE farg);
+LVAL xlognot(void);
+LVAL xabs(void);
+LVAL xadd1(void);
+LVAL xsub1(void);
+LVAL xsin(void);
+LVAL xcos(void);
+LVAL xtan(void);
+LVAL xexp(void);
+LVAL xsqrt(void);
+LVAL xfix(void);
+LVAL xfloat(void);
+LVAL xrand(void);
+LVAL xminusp(void);
+LVAL xzerop(void);
+LVAL xplusp(void);
+LVAL xevenp(void);
+LVAL xoddp(void);
+LVAL xlss(void);
+LVAL xleq(void);
+LVAL xequ(void);
+LVAL xneq(void);
+LVAL xgeq(void);
+LVAL xgtr(void);
+
+
+/* xlobj.c */
+
+LVAL xsend(void);
+LVAL xsendsuper(void);
+LVAL xlclass(char *name, int vcnt);
+void xladdivar(LVAL cls, char *var);
+void xladdmsg(LVAL cls, char *msg, int offset);
+int xlobgetvalue(LVAL pair, LVAL sym, LVAL *pval);
+int xlobsetvalue(LVAL pair, LVAL sym, LVAL val);
+LVAL obisnew(void);
+LVAL obclass(void);
+LVAL obshow(void);
+LVAL obisa(void);
+LVAL clnew(void);
+LVAL clisnew(void);
+LVAL clanswer(void);
+void obsymbols(void);
+void xloinit(void);
+
+
+/* xlpp.c */
+
+LVAL xpp(void);
+
+
+/* xlprin.c */
+
+void xlprint(LVAL fptr, LVAL vptr, int flag);
+void xlterpri(LVAL fptr);
+void xlputstr(LVAL fptr, char *str);
+void putatm(LVAL fptr, char *tag, LVAL val);
+
+
+/* xlread.c */
+
+int xlload(char *fname, int vflag, int pflag);
+int xlread(LVAL fptr, LVAL *pval, int rflag);
+int readone(LVAL fptr, LVAL *pval);
+LVAL rmhash(void);
+LVAL rmquote(void);
+LVAL rmdquote(void);
+LVAL rmbquote(void);
+LVAL rmcomma(void);
+LVAL rmlpar(void);
+LVAL rmrpar(void);
+LVAL rmsemi(void);
+LVAL tentry(int ch);
+int xlisnumber(char *str, LVAL *pval);
+void defmacro(int ch, LVAL type, int offset);
+LVAL callmacro(LVAL fptr, int ch);
+void xlrinit(void);
+
+
+/* xlstr.c */
+
+LVAL xstrlss(void);
+LVAL xstrleq(void);
+LVAL xstreql(void);
+LVAL xstrneq(void);
+LVAL xstrgeq(void);
+LVAL xstrgtr(void);
+LVAL xstrilss(void);
+LVAL xstrileq(void);
+LVAL xstrieql(void);
+LVAL xstrineq(void);
+LVAL xstrigeq(void);
+LVAL xstrigtr(void);
+LVAL xupcase(void);
+LVAL xdowncase(void);
+LVAL xnupcase(void);
+LVAL xndowncase(void);
+LVAL xstrsearch(void);
+LVAL xtrim(void);
+LVAL xlefttrim(void);
+LVAL xrighttrim(void);
+LVAL xstrcat(void);
+LVAL xsubseq(void);
+LVAL xstring(void);
+LVAL xchar(void);
+LVAL xcharint(void);
+LVAL xintchar(void);
+LVAL xuppercasep(void);
+LVAL xlowercasep(void);
+LVAL xbothcasep(void);
+LVAL xdigitp(void);
+LVAL xcharcode(void);
+LVAL xcodechar(void);
+LVAL xchupcase(void);
+LVAL xchdowncase(void);
+LVAL xdigitchar(void);
+LVAL xalphanumericp(void);
+LVAL xchrlss(void);
+LVAL xchrleq(void);
+LVAL xchreql(void);
+LVAL xchrneq(void);
+LVAL xchrgeq(void);
+LVAL xchrgtr(void);
+LVAL xchrilss(void);
+LVAL xchrileq(void);
+LVAL xchrieql(void);
+LVAL xchrineq(void);
+LVAL xchrigeq(void);
+LVAL xchrigtr(void);
+LVAL xinfo(void);
+
+/* xlsubr.c */
+
+LVAL xlsubr(char *sname, int type, LVAL (*fcn)(void), int offset);
+int xlgetkeyarg(LVAL key, LVAL *pval);
+void xltest(LVAL *pfcn, int *ptresult);
+int xlgkfixnum(LVAL key, LVAL *pval);
+/* argument list parsing functions */
+extern LVAL xlgetfile(void);  	/* get a file/stream argument */
+extern LVAL xlgetfname(void);	/* get a filename argument */
+int needsextension(char *name);
+/* error reporting functions (don't *really* return at all) */
+extern LVAL xlbadtype(LVAL arg);	/* report "bad argument type" error */
+extern LVAL xltoofew(void);		/* report "too few arguments" error */
+extern LVAL xltoomany(void);
+int eq(LVAL arg1, LVAL arg2);
+int eql(LVAL arg1, LVAL arg2);
+int lval_equal(LVAL arg1, LVAL arg2);
+
+
+/* xlsym.c */
+
+LVAL xlenter(char *name);	/* enter a symbol */
+LVAL xlmakesym(char *name);	/* make an uninterned symbol */
+LVAL xlgetvalue(LVAL sym);	/* get value of a symbol (checked) */
+LVAL xlxgetvalue(LVAL sym);	/* get value of a symbol */
+void xlsetvalue(LVAL sym, LVAL val);
+LVAL xlgetfunction(LVAL sym);	/* get functional value of a symbol */
+LVAL xlxgetfunction(LVAL sym);	/* get functional value of a symbol (checked) */
+void xlsetfunction(LVAL sym, LVAL val);
+LVAL xlgetprop(LVAL sym, LVAL prp);
+void xlputprop(LVAL sym, LVAL val, LVAL prp);
+void xlremprop(LVAL sym, LVAL prp);
+int hash(char *str, int len);
+void xlsinit(void);
+LVAL findprop(LVAL sym, LVAL prp);
+
+/* xlsys.c */
+
+LVAL xload(void);
+LVAL xtranscript(void);
+LVAL xtype(void);
+LVAL xbaktrace(void);
+LVAL xexit(void);
+LVAL xpeek(void);
+LVAL xpoke(void);
+LVAL xaddrs(void);
+
+/* macstuff, unixstuff, winstuff */
+
+extern const char os_pathchar;
+extern const char os_sepchar;
+
+void osinit(char *banner);
+void oserror(char *msg);
+void osfinish(void);
+int osclose(FILE *fp);
+void osflush(void);
+void oscheck(void);
+int osaputc(int ch, FILE *fp);
+void osoutflush(FILE *fp);
+int osbputc(int ch, FILE *fp);
+void ostputc(int ch);
+void ostoutflush();
+int osagetc(FILE *fp);
+int osbgetc(FILE *fp);
+int ostgetc(void);
+void ossymbols(void);
+LVAL xlinfo(void);
+LVAL xsetdir(void);
+int osdir_list_start(char *path);
+char *osdir_list_next();
+void osdir_list_finish();
+LVAL xosc_enable();
+LVAL xget_temp_path();
+LVAL xfind_in_xlisp_path();
+
+/* These are now implemented in path.c   -dmazzoni */
+const char *return_xlisp_path();
+const char *find_in_xlisp_path(const char *fname);
+void set_xlisp_path(const char *p);
+
+/* local.c - these procedures are specific to each implementation */
+
+void localinit(void);
+void localsymbols(void);
+void print_local_gc_info(void);
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xljump.c b/lib-src/libnyquist/nyquist/xlisp/xljump.c
new file mode 100644
index 0000000..14a941a
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xljump.c
@@ -0,0 +1,165 @@
+/* xljump - execution context routines */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+#include "xlisp.h"
+
+/* external variables */
+extern XLCONTEXT *xlcontext,*xltarget;
+extern LVAL xlvalue,xlenv,xlfenv,xldenv;
+extern int xlmask;
+
+LOCAL void findandjump(int mask, char *error);
+
+
+/* xlbegin - beginning of an execution context */
+void xlbegin(XLCONTEXT *cptr, int flags, LVAL expr)
+{
+    cptr->c_flags = flags;
+    cptr->c_expr = expr;
+    cptr->c_xlstack = xlstack;
+    cptr->c_xlenv = xlenv;
+    cptr->c_xlfenv = xlfenv;
+    cptr->c_xldenv = xldenv;
+    cptr->c_xlcontext = xlcontext;
+    cptr->c_xlargv = xlargv;
+    cptr->c_xlargc = xlargc;
+    cptr->c_xlfp = xlfp;
+    cptr->c_xlsp = xlsp;
+    xlcontext = cptr;
+}
+
+/* xlend - end of an execution context */
+void xlend(XLCONTEXT *cptr)
+{
+    xlcontext = cptr->c_xlcontext;
+}
+
+/* xlgo - go to a label */
+void xlgo(LVAL label)
+{
+    XLCONTEXT *cptr;
+    LVAL *argv;
+    int argc;
+
+    /* find a tagbody context */
+    for (cptr = xlcontext; cptr; cptr = cptr->c_xlcontext)
+        if (cptr->c_flags & CF_GO) {
+            argc = cptr->c_xlargc;
+            argv = cptr->c_xlargv;
+            while (--argc >= 0)
+                if (*argv++ == label) {
+                    cptr->c_xlargc = argc;
+                    cptr->c_xlargv = argv;
+                    xljump(cptr,CF_GO,NIL);
+                }
+        }
+    xlfail("no target for GO");
+}
+
+/* xlreturn - return from a block */
+void xlreturn(LVAL name, LVAL val)
+{
+    XLCONTEXT *cptr;
+
+    /* find a block context */
+    for (cptr = xlcontext; cptr; cptr = cptr->c_xlcontext)
+        if (cptr->c_flags & CF_RETURN && cptr->c_expr == name)
+            xljump(cptr,CF_RETURN,val);
+    xlfail("no target for RETURN");
+}
+
+/* xlthrow - throw to a catch */
+void xlthrow(LVAL tag, LVAL val)
+{
+    XLCONTEXT *cptr;
+
+    /* find a catch context */
+    for (cptr = xlcontext; cptr; cptr = cptr->c_xlcontext)
+        if ((cptr->c_flags & CF_THROW) && cptr->c_expr == tag)
+            xljump(cptr,CF_THROW,val);
+    xlfail("no target for THROW");
+}
+
+/* xlsignal - signal an error */
+void xlsignal(char *emsg, LVAL arg)
+{
+    XLCONTEXT *cptr;
+
+    /* find an error catcher */
+    for (cptr = xlcontext; cptr; cptr = cptr->c_xlcontext)
+        if (cptr->c_flags & CF_ERROR) {
+            if (cptr->c_expr && emsg)
+                xlerrprint("error",NULL,emsg,arg);
+            xljump(cptr,CF_ERROR,NIL);
+        }
+}
+
+/* xltoplevel - go back to the top level */
+void xltoplevel(void)
+{
+    close_loadingfiles();
+    stdputstr("[ back to top level ]\n");
+    findandjump(CF_TOPLEVEL,"no top level");
+}
+
+/* xlbrklevel - go back to the previous break level */
+void xlbrklevel(void)
+{
+    findandjump(CF_BRKLEVEL,"no previous break level");
+}
+
+/* xlcleanup - clean-up after an error */
+void xlcleanup(void)
+{
+    stdputstr("[ back to previous break level ]\n");
+    findandjump(CF_CLEANUP,"not in a break loop");
+}
+
+/* xlcontinue - continue from an error */
+void xlcontinue(void)
+{
+    findandjump(CF_CONTINUE,"not in a break loop");
+}
+
+/* xljump - jump to a saved execution context */
+void xljump(XLCONTEXT *target, int mask, LVAL val)
+{
+    /* unwind the execution stack */
+    for (; xlcontext != target; xlcontext = xlcontext->c_xlcontext)
+
+        /* check for an UNWIND-PROTECT */
+        if ((xlcontext->c_flags & CF_UNWIND)) {
+            xltarget = target;
+            xlmask = mask;
+            break;
+        }
+           
+    /* restore the state */
+    xlstack = xlcontext->c_xlstack;
+    xlenv = xlcontext->c_xlenv;
+    xlfenv = xlcontext->c_xlfenv;
+    xlunbind(xlcontext->c_xldenv);
+    xlargv = xlcontext->c_xlargv;
+    xlargc = xlcontext->c_xlargc;
+    xlfp = xlcontext->c_xlfp;
+    xlsp = xlcontext->c_xlsp;
+    xlvalue = val;
+
+    /* call the handler */
+    longjmp(xlcontext->c_jmpbuf,mask);
+}
+
+/* findandjump - find a target context frame and jump to it */
+LOCAL void findandjump(int mask, char *error)
+{
+    XLCONTEXT *cptr;
+
+    /* find a block context */
+    for (cptr = xlcontext; cptr; cptr = cptr->c_xlcontext)
+        if (cptr->c_flags & mask)
+            xljump(cptr,mask,NIL);
+    xlabort(error);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xllist.c b/lib-src/libnyquist/nyquist/xlisp/xllist.c
new file mode 100644
index 0000000..510e59f
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xllist.c
@@ -0,0 +1,927 @@
+/* xllist.c - xlisp built-in list functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ * 28Apr03 rbd  fix check in sort routine
+ */
+
+
+#include "xlisp.h"
+
+/* forward declarations */
+FORWARD LOCAL LVAL cxr(char *adstr);
+FORWARD LOCAL LVAL nth(int carflag);
+FORWARD LOCAL LVAL assoc(LVAL expr, LVAL alist, LVAL fcn, int tresult);
+FORWARD LOCAL LVAL subst(LVAL to, LVAL from, LVAL expr, LVAL fcn, int tresult);
+FORWARD LOCAL LVAL sublis(LVAL alist, LVAL expr, LVAL fcn, int tresult);
+FORWARD LOCAL LVAL map(int carflag, int valflag);
+FORWARD LOCAL LVAL remif(int tresult);
+FORWARD LOCAL LVAL delif(int tresult);
+FORWARD LOCAL LVAL sortlist(LVAL list, LVAL fcn);
+FORWARD LOCAL void splitlist(LVAL pivot, LVAL list, LVAL *psmaller, LVAL *plarger, LVAL fcn);
+FORWARD LOCAL LVAL gluelists(LVAL smaller, LVAL pivot, LVAL larger);
+
+
+/* xcar - take the car of a cons cell */
+LVAL xcar(void)
+{
+    LVAL list;
+    list = xlgalist();
+    xllastarg();
+    return (list ? car(list) : NIL);
+}
+
+/* xcdr - take the cdr of a cons cell */
+LVAL xcdr(void)
+{
+    LVAL list;
+    list = xlgalist();
+    xllastarg();
+    return (list ? cdr(list) : NIL);
+}
+
+/* cxxr functions */
+LVAL xcaar(void) { return (cxr("aa")); }
+LVAL xcadr(void) { return (cxr("da")); }
+LVAL xcdar(void) { return (cxr("ad")); }
+LVAL xcddr(void) { return (cxr("dd")); }
+
+/* cxxxr functions */
+LVAL xcaaar(void) { return (cxr("aaa")); }
+LVAL xcaadr(void) { return (cxr("daa")); }
+LVAL xcadar(void) { return (cxr("ada")); }
+LVAL xcaddr(void) { return (cxr("dda")); }
+LVAL xcdaar(void) { return (cxr("aad")); }
+LVAL xcdadr(void) { return (cxr("dad")); }
+LVAL xcddar(void) { return (cxr("add")); }
+LVAL xcdddr(void) { return (cxr("ddd")); }
+
+/* cxxxxr functions */
+LVAL xcaaaar(void) { return (cxr("aaaa")); }
+LVAL xcaaadr(void) { return (cxr("daaa")); }
+LVAL xcaadar(void) { return (cxr("adaa")); }
+LVAL xcaaddr(void) { return (cxr("ddaa")); }
+LVAL xcadaar(void) { return (cxr("aada")); }
+LVAL xcadadr(void) { return (cxr("dada")); }
+LVAL xcaddar(void) { return (cxr("adda")); }
+LVAL xcadddr(void) { return (cxr("ddda")); }
+LVAL xcdaaar(void) { return (cxr("aaad")); }
+LVAL xcdaadr(void) { return (cxr("daad")); }
+LVAL xcdadar(void) { return (cxr("adad")); }
+LVAL xcdaddr(void) { return (cxr("ddad")); }
+LVAL xcddaar(void) { return (cxr("aadd")); }
+LVAL xcddadr(void) { return (cxr("dadd")); }
+LVAL xcdddar(void) { return (cxr("addd")); }
+LVAL xcddddr(void) { return (cxr("dddd")); }
+
+/* cxr - common car/cdr routine */
+LOCAL LVAL cxr(char *adstr)
+{
+    LVAL list;
+
+    /* get the list */
+    list = xlgalist();
+    xllastarg();
+
+    /* perform the car/cdr operations */
+    while (*adstr && consp(list))
+        list = (*adstr++ == 'a' ? car(list) : cdr(list));
+
+    /* make sure the operation succeeded */
+    if (*adstr && list)
+        xlfail("bad argument");
+
+    /* return the result */
+    return (list);
+}
+
+/* xcons - construct a new list cell */
+LVAL xcons(void)
+{
+    LVAL arg1,arg2;
+
+    /* get the two arguments */
+    arg1 = xlgetarg();
+    arg2 = xlgetarg();
+    xllastarg();
+
+    /* construct a new list element */
+    return (cons(arg1,arg2));
+}
+
+/* xlist - built a list of the arguments */
+LVAL xlist(void)
+{
+    LVAL last=NULL,next,val;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* add each argument to the list */
+    for (val = NIL; moreargs(); ) {
+
+        /* append this argument to the end of the list */
+        next = consa(nextarg());
+        if (val) rplacd(last,next);
+        else val = next;
+        last = next;
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the list */
+    return (val);
+}
+
+/* xappend - built-in function append */
+LVAL xappend(void)
+{
+    LVAL list,last=NULL,next,val;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* initialize */
+    val = NIL;
+    
+    /* append each argument */
+    if (moreargs()) {
+        while (xlargc > 1) {
+
+            /* append each element of this list to the result list */
+            for (list = nextarg(); consp(list); list = cdr(list)) {
+                next = consa(car(list));
+                if (val) rplacd(last,next);
+                else val = next;
+                last = next;
+            }
+        }
+
+        /* handle the last argument */
+        if (val) rplacd(last,nextarg());
+        else val = nextarg();
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the list */
+    return (val);
+}
+
+/* xreverse - built-in function reverse */
+LVAL xreverse(void)
+{
+    LVAL list,val;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* get the list to reverse */
+    list = xlgalist();
+    xllastarg();
+
+    /* append each element to the head of the result list */
+    for (val = NIL; consp(list); list = cdr(list))
+        val = cons(car(list),val);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the list */
+    return (val);
+}
+
+/* xlast - return the last cons of a list */
+LVAL xlast(void)
+{
+    LVAL list;
+
+    /* get the list */
+    list = xlgalist();
+    xllastarg();
+
+    /* find the last cons */
+    while (consp(list) && cdr(list))
+        list = cdr(list);
+
+    /* return the last element */
+    return (list);
+}
+
+/* xmember - built-in function 'member' */
+LVAL xmember(void)
+{
+    LVAL x,list,fcn,val;
+    int tresult;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the expression to look for and the list */
+    x = xlgetarg();
+    list = xlgalist();
+    xltest(&fcn,&tresult);
+
+    /* look for the expression */
+    for (val = NIL; consp(list); list = cdr(list))
+        if (dotest2(x,car(list),fcn) == tresult) {
+            val = list;
+            break;
+        }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* xassoc - built-in function 'assoc' */
+LVAL xassoc(void)
+{
+    LVAL x,alist,fcn,pair,val;
+    int tresult;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the expression to look for and the association list */
+    x = xlgetarg();
+    alist = xlgalist();
+    xltest(&fcn,&tresult);
+
+    /* look for the expression */
+    for (val = NIL; consp(alist); alist = cdr(alist))
+        if ((pair = car(alist)) && consp(pair))
+            if (dotest2(x,car(pair),fcn) == tresult) {
+                val = pair;
+                break;
+            }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return result */
+    return (val);
+}
+
+/* xsubst - substitute one expression for another */
+LVAL xsubst(void)
+{
+    LVAL to,from,expr,fcn,val;
+    int tresult;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the to value, the from value and the expression */
+    to = xlgetarg();
+    from = xlgetarg();
+    expr = xlgetarg();
+    xltest(&fcn,&tresult);
+
+    /* do the substitution */
+    val = subst(to,from,expr,fcn,tresult);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* subst - substitute one expression for another */
+LOCAL LVAL subst(LVAL to, LVAL from, LVAL expr, LVAL fcn, int tresult)
+{
+    LVAL carval,cdrval;
+
+    if (dotest2(expr,from,fcn) == tresult)
+        return (to);
+    else if (consp(expr)) {
+        xlsave1(carval);
+        carval = subst(to,from,car(expr),fcn,tresult);
+        cdrval = subst(to,from,cdr(expr),fcn,tresult);
+        xlpop();
+        return (cons(carval,cdrval));
+    }
+    else
+        return (expr);
+}
+
+/* xsublis - substitute using an association list */
+LVAL xsublis(void)
+{
+    LVAL alist,expr,fcn,val;
+    int tresult;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the assocation list and the expression */
+    alist = xlgalist();
+    expr = xlgetarg();
+    xltest(&fcn,&tresult);
+
+    /* do the substitution */
+    val = sublis(alist,expr,fcn,tresult);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the result */
+    return (val);
+}
+
+/* sublis - substitute using an association list */
+LOCAL LVAL sublis(LVAL alist, LVAL expr, LVAL fcn, int tresult)
+{
+    LVAL carval,cdrval,pair;
+
+    if ((pair = assoc(expr,alist,fcn,tresult)))
+        return (cdr(pair));
+    else if (consp(expr)) {
+        xlsave1(carval);
+        carval = sublis(alist,car(expr),fcn,tresult);
+        cdrval = sublis(alist,cdr(expr),fcn,tresult);
+        xlpop();
+        return (cons(carval,cdrval));
+    }
+    else
+        return (expr);
+}
+
+/* assoc - find a pair in an association list */
+LOCAL LVAL assoc(LVAL expr, LVAL alist, LVAL fcn, int tresult)
+{
+    LVAL pair;
+
+    for (; consp(alist); alist = cdr(alist))
+        if ((pair = car(alist)) && consp(pair))
+            if (dotest2(expr,car(pair),fcn) == tresult)
+                return (pair);
+    return (NIL);
+}
+
+/* xremove - built-in function 'remove' */
+LVAL xremove(void)
+{
+    LVAL x,list,fcn,val,last=NULL,next;
+    int tresult;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(fcn);
+    xlsave(val);
+
+    /* get the expression to remove and the list */
+    x = xlgetarg();
+    list = xlgalist();
+    xltest(&fcn,&tresult);
+
+    /* remove matches */
+    for (; consp(list); list = cdr(list))
+
+        /* check to see if this element should be deleted */
+        if (dotest2(x,car(list),fcn) != tresult) {
+            next = consa(car(list));
+            if (val) rplacd(last,next);
+            else val = next;
+            last = next;
+        }
+
+    /* restore the stack */
+    xlpopn(2);
+
+    /* return the updated list */
+    return (val);
+}
+
+/* xremif - built-in function 'remove-if' */
+LVAL xremif(void)
+{
+    LVAL remif();
+    return (remif(TRUE));
+}
+
+/* xremifnot - built-in function 'remove-if-not' */
+LVAL xremifnot(void)
+{
+    LVAL remif();
+    return (remif(FALSE));
+}
+
+/* remif - common code for 'remove-if' and 'remove-if-not' */
+LOCAL LVAL remif(int tresult)
+{
+    LVAL list,fcn,val,last=NULL,next;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(fcn);
+    xlsave(val);
+
+    /* get the expression to remove and the list */
+    fcn = xlgetarg();
+    list = xlgalist();
+    xllastarg();
+
+    /* remove matches */
+    for (; consp(list); list = cdr(list))
+
+        /* check to see if this element should be deleted */
+        if (dotest1(car(list),fcn) != tresult) {
+            next = consa(car(list));
+            if (val) rplacd(last,next);
+            else val = next;
+            last = next;
+        }
+
+    /* restore the stack */
+    xlpopn(2);
+
+    /* return the updated list */
+    return (val);
+}
+
+/* dotest1 - call a test function with one argument */
+int dotest1(LVAL arg, LVAL fun)
+{
+    LVAL *newfp;
+
+    /* create the new call frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(fun);
+    pusharg(cvfixnum((FIXTYPE)1));
+    pusharg(arg);
+    xlfp = newfp;
+
+    /* return the result of applying the test function */
+    return (xlapply(1) != NIL);
+
+}
+
+/* dotest2 - call a test function with two arguments */
+int dotest2(LVAL arg1, LVAL arg2, LVAL fun)
+{
+    LVAL *newfp;
+
+    /* create the new call frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(fun);
+    pusharg(cvfixnum((FIXTYPE)2));
+    pusharg(arg1);
+    pusharg(arg2);
+    xlfp = newfp;
+
+    /* return the result of applying the test function */
+    return (xlapply(2) != NIL);
+
+}
+
+/* xnth - return the nth element of a list */
+LVAL xnth(void)
+{
+    return (nth(TRUE));
+}
+
+/* xnthcdr - return the nth cdr of a list */
+LVAL xnthcdr(void)
+{
+    return (nth(FALSE));
+}
+
+/* nth - internal nth function */
+LOCAL LVAL nth(int carflag)
+{
+    LVAL list,num;
+    FIXTYPE n;
+
+    /* get n and the list */
+    num = xlgafixnum();
+    list = xlgacons();
+    xllastarg();
+
+    /* make sure the number isn't negative */
+    if ((n = getfixnum(num)) < 0)
+        xlfail("bad argument");
+
+    /* find the nth element */
+    while (consp(list) && --n >= 0)
+        list = cdr(list);
+
+    /* return the list beginning at the nth element */
+    return (carflag && consp(list) ? car(list) : list);
+}
+
+/* xlength - return the length of a list or string */
+LVAL xlength(void)
+{
+    FIXTYPE n=0;
+    LVAL arg;
+
+    /* get the list or string */
+    arg = xlgetarg();
+    xllastarg();
+
+    /* find the length of a list */
+    if (listp(arg))
+        for (n = 0; consp(arg); n++)
+            arg = cdr(arg);
+
+    /* find the length of a string */
+    else if (stringp(arg))
+        n = (FIXTYPE)getslength(arg)-1;
+
+    /* find the length of a vector */
+    else if (vectorp(arg))
+        n = (FIXTYPE)getsize(arg);
+
+    /* otherwise, bad argument type */
+    else
+        xlerror("bad argument type",arg);
+
+    /* return the length */
+    return (cvfixnum(n));
+}
+
+/* xmapc - built-in function 'mapc' */
+LVAL xmapc(void)
+{
+    return (map(TRUE,FALSE));
+}
+
+/* xmapcar - built-in function 'mapcar' */
+LVAL xmapcar(void)
+{
+    return (map(TRUE,TRUE));
+}
+
+/* xmapl - built-in function 'mapl' */
+LVAL xmapl(void)
+{
+    return (map(FALSE,FALSE));
+}
+
+/* xmaplist - built-in function 'maplist' */
+LVAL xmaplist(void)
+{
+    return (map(FALSE,TRUE));
+}
+
+/* map - internal mapping function */
+LOCAL LVAL map(int carflag, int valflag)
+{
+    LVAL *newfp,fun,lists,val,last,p,x,y;
+    int argc;
+
+    /* protect some pointers */
+    xlstkcheck(3);
+    xlsave(fun);
+    xlsave(lists);
+    xlsave(val);
+
+    /* get the function to apply and the first list */
+    fun = xlgetarg();
+    lists = xlgalist();
+
+    /* initialize the result list */
+    val = (valflag ? NIL : lists);
+
+    /* build a list of argument lists */
+    for (lists = last = consa(lists); moreargs(); last = cdr(last))
+        rplacd(last,cons(xlgalist(),NIL));
+
+    /* loop through each of the argument lists */
+    for (;;) {
+        /* build an argument list from the sublists */
+        newfp = xlsp;
+        pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+        pusharg(fun);
+        pusharg(NIL);
+        argc = 0;
+        for (x = lists; x && (y = car(x)) && consp(y); x = cdr(x)) {
+            pusharg(carflag ? car(y) : y);
+            rplaca(x,cdr(y));
+            ++argc;
+        }
+
+        /* quit if any of the lists were empty */
+        if (x) {
+            xlsp = newfp;
+            break;
+        }
+
+        /* apply the function to the arguments */
+        newfp[2] = cvfixnum((FIXTYPE)argc);
+        xlfp = newfp;
+        if (valflag) {
+            p = consa(xlapply(argc));
+            if (val) rplacd(last,p);
+            else val = p;
+            last = p;
+        }
+        else
+            xlapply(argc);
+    }
+
+    /* restore the stack */
+    xlpopn(3);
+
+    /* return the last test expression value */
+    return (val);
+}
+
+/* xrplca - replace the car of a list node */
+LVAL xrplca(void)
+{
+    LVAL list,newcar;
+
+    /* get the list and the new car */
+    list = xlgacons();
+    newcar = xlgetarg();
+    xllastarg();
+
+    /* replace the car */
+    rplaca(list,newcar);
+
+    /* return the list node that was modified */
+    return (list);
+}
+
+/* xrplcd - replace the cdr of a list node */
+LVAL xrplcd(void)
+{
+    LVAL list,newcdr;
+
+    /* get the list and the new cdr */
+    list = xlgacons();
+    newcdr = xlgetarg();
+    xllastarg();
+
+    /* replace the cdr */
+    rplacd(list,newcdr);
+
+    /* return the list node that was modified */
+    return (list);
+}
+
+/* xnconc - destructively append lists */
+LVAL xnconc(void)
+{
+    LVAL next,last=NULL,val;
+
+    /* initialize */
+    val = NIL;
+    
+    /* concatenate each argument */
+    if (moreargs()) {
+        while (xlargc > 1) {
+
+            /* ignore everything except lists */
+            if ((next = nextarg()) && consp(next)) {
+
+                /* concatenate this list to the result list */
+                if (val) rplacd(last,next);
+                else val = next;
+
+                /* find the end of the list */
+                while (consp(cdr(next)))
+                    next = cdr(next);
+                last = next;
+            }
+        }
+
+        /* handle the last argument */
+        if (val) rplacd(last,nextarg());
+        else val = nextarg();
+    }
+
+    /* return the list */
+    return (val);
+}
+
+/* xdelete - built-in function 'delete' */
+LVAL xdelete(void)
+{
+    LVAL x,list,fcn,last,val;
+    int tresult;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the expression to delete and the list */
+    x = xlgetarg();
+    list = xlgalist();
+    xltest(&fcn,&tresult);
+
+    /* delete leading matches */
+    while (consp(list)) {
+        if (dotest2(x,car(list),fcn) != tresult)
+            break;
+        list = cdr(list);
+    }
+    val = last = list;
+
+    /* delete embedded matches */
+    if (consp(list)) {
+
+        /* skip the first non-matching element */
+        list = cdr(list);
+
+        /* look for embedded matches */
+        while (consp(list)) {
+
+            /* check to see if this element should be deleted */
+            if (dotest2(x,car(list),fcn) == tresult)
+                rplacd(last,cdr(list));
+            else
+                last = list;
+
+            /* move to the next element */
+            list = cdr(list);
+         }
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the updated list */
+    return (val);
+}
+
+/* xdelif - built-in function 'delete-if' */
+LVAL xdelif(void)
+{
+    LVAL delif();
+    return (delif(TRUE));
+}
+
+/* xdelifnot - built-in function 'delete-if-not' */
+LVAL xdelifnot(void)
+{
+    LVAL delif();
+    return (delif(FALSE));
+}
+
+/* delif - common routine for 'delete-if' and 'delete-if-not' */
+LOCAL LVAL delif(int tresult)
+{
+    LVAL list,fcn,last,val;
+
+    /* protect some pointers */
+    xlsave1(fcn);
+
+    /* get the expression to delete and the list */
+    fcn = xlgetarg();
+    list = xlgalist();
+    xllastarg();
+
+    /* delete leading matches */
+    while (consp(list)) {
+        if (dotest1(car(list),fcn) != tresult)
+            break;
+        list = cdr(list);
+    }
+    val = last = list;
+
+    /* delete embedded matches */
+    if (consp(list)) {
+
+        /* skip the first non-matching element */
+        list = cdr(list);
+
+        /* look for embedded matches */
+        while (consp(list)) {
+
+            /* check to see if this element should be deleted */
+            if (dotest1(car(list),fcn) == tresult)
+                rplacd(last,cdr(list));
+            else
+                last = list;
+
+            /* move to the next element */
+            list = cdr(list);
+         }
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the updated list */
+    return (val);
+}
+
+/* xsort - built-in function 'sort' */
+LVAL xsort(void)
+{
+    LVAL sortlist();
+    LVAL list,fcn;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(list);
+    xlsave(fcn);
+
+    /* get the list to sort and the comparison function */
+    list = xlgalist();
+    fcn = xlgetarg();
+    xllastarg();
+
+    /* sort the list */
+    list = sortlist(list,fcn);
+
+    if (list && (ntype(list) == FREE_NODE)) {
+        stdputstr("error in sort 2");
+    }
+
+    /* restore the stack and return the sorted list */
+    xlpopn(2);
+    return (list);
+}
+
+/*
+    This sorting algorithm is based on a Modula-2 sort written by
+    Richie Bielak and published in the February 1988 issue of
+    "Computer Language" magazine in a letter to the editor.
+*/
+
+/* sortlist - sort a list using quicksort */
+LOCAL LVAL sortlist(LVAL list, LVAL fcn)
+{
+    LVAL gluelists();
+    LVAL smaller,pivot,larger;
+    
+    /* protect some pointers */
+    xlstkcheck(3);
+    xlsave(smaller);
+    xlsave(pivot);
+    xlsave(larger);
+    
+    /* lists with zero or one element are already sorted */
+    if (consp(list) && consp(cdr(list))) {
+        pivot = list; list = cdr(list);
+        splitlist(pivot,list,&smaller,&larger,fcn);
+        smaller = sortlist(smaller,fcn);
+        larger = sortlist(larger,fcn);
+        list = gluelists(smaller,pivot,larger);
+    }
+
+    /* cleanup the stack and return the sorted list */
+    xlpopn(3);
+    return (list);
+}
+
+/* splitlist - split the list around the pivot */
+LOCAL void splitlist(LVAL pivot, LVAL list, LVAL *psmaller, LVAL *plarger, LVAL fcn)
+{
+    LVAL next;
+
+    xlprot1(list); // protect list from gc
+    // the rplacd disconnects list, and next is the only 
+    // reference to it, but next is immediately assigned to list
+    // before dotest2 which is where gc might run.
+    
+    /* initialize the result lists */
+    *psmaller = *plarger = NIL;
+    
+    /* split the list */
+    for (; consp(list); list = next) {
+        next = cdr(list);
+        if (dotest2(car(list),car(pivot),fcn)) {
+            rplacd(list,*psmaller);
+            *psmaller = list;
+        }
+        else {
+            rplacd(list,*plarger);
+            *plarger = list;
+        }
+    }
+    xlpop();
+}
+
+/* gluelists - glue the smaller and larger lists with the pivot */
+LOCAL LVAL gluelists(LVAL smaller, LVAL pivot, LVAL larger)
+{
+    LVAL last;
+    
+    /* larger always goes after the pivot */
+    rplacd(pivot,larger);
+
+    /* if the smaller list is empty, we're done */
+    if (null(smaller)) return (pivot);
+
+    /* append the smaller to the front of the resulting list */
+    for (last = smaller; consp(cdr(last)); last = cdr(last))
+        ;
+    rplacd(last,pivot);
+
+    return (smaller);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlmath.c b/lib-src/libnyquist/nyquist/xlisp/xlmath.c
new file mode 100644
index 0000000..72cf1c1
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlmath.c
@@ -0,0 +1,451 @@
+/* xlmath - xlisp built-in arithmetic functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+#include "xlisp.h"
+#include <math.h>
+
+/* external variables */
+extern LVAL s_true;
+
+/* forward declarations */
+FORWARD LOCAL LVAL unary(int fcn);
+FORWARD LOCAL LVAL binary(int fcn);
+FORWARD LOCAL LVAL predicate(int fcn);
+FORWARD LOCAL LVAL compare(int fcn);
+FORWARD LOCAL void badiop(void);
+FORWARD LOCAL void badfop(void);
+
+
+/* binary functions */
+LVAL xadd(void)    { return (binary('+')); } /* + */
+LVAL xsub(void)    { return (binary('-')); } /* - */
+LVAL xmul(void)    { return (binary('*')); } /* * */
+LVAL xdiv(void)    { return (binary('/')); } /* / */
+LVAL xrem(void)    { return (binary('%')); } /* rem */
+LVAL xmin(void)    { return (binary('m')); } /* min */
+LVAL xmax(void)    { return (binary('M')); } /* max */
+LVAL xexpt(void)   { return (binary('E')); } /* expt */
+LVAL xlogand(void) { return (binary('&')); } /* logand */
+LVAL xlogior(void) { return (binary('|')); } /* logior */
+LVAL xlogxor(void) { return (binary('^')); } /* logxor */
+LVAL xatan(void)   { return (binary('A')); } /* atan */
+
+/* xgcd - greatest common divisor */
+LVAL xgcd(void)
+{
+    FIXTYPE m,n,r;
+    LVAL arg;
+
+    if (!moreargs())			/* check for identity case */
+        return (cvfixnum((FIXTYPE)0));
+    arg = xlgafixnum();
+    n = getfixnum(arg);
+    if (n < (FIXTYPE)0) n = -n;		/* absolute value */
+    while (moreargs()) {
+        arg = xlgafixnum();
+        m = getfixnum(arg);
+        if (m < (FIXTYPE)0) m = -m;	/* absolute value */
+        for (;;) {			/* euclid's algorithm */
+            r = m % n;
+            if (r == (FIXTYPE)0)
+                break;
+            m = n;
+            n = r;
+        }
+    }
+    return (cvfixnum(n));
+}
+
+/* binary - handle binary operations */
+LOCAL LVAL binary(int fcn)
+{
+    FIXTYPE ival=0,iarg=0;
+    FLOTYPE fval=0,farg=0;
+    LVAL arg;
+    int mode=0;
+
+    /* get the first argument */
+    arg = xlgetarg();
+
+    /* set the type of the first argument */
+    if (fixp(arg)) {
+        ival = getfixnum(arg);
+        mode = 'I';
+    }
+    else if (floatp(arg)) {
+        fval = getflonum(arg);
+        mode = 'F';
+    }
+    else
+        xlerror("bad argument type",arg);
+
+    /* treat a single argument as a special case */
+    if (!moreargs()) {
+        switch (fcn) {
+        case '-':
+            switch (mode) {
+            case 'I':
+                ival = -ival;
+                break;
+            case 'F':
+                fval = -fval;
+                break;
+            }
+            break;
+        case '/':
+            switch (mode) {
+            case 'I':
+                checkizero(ival);
+                ival = 1 / ival;
+                break;
+            case 'F':
+                checkfzero(fval);
+                fval = 1.0 / fval;
+                break;
+            }
+            break;
+        case 'A':
+            switch (mode) {
+            case 'I':
+                mode = 'F';
+                fval = ival;
+            case 'F':
+                fval = atan(fval);
+                break;
+            }
+            break;
+        }
+    }
+
+    /* handle each remaining argument */
+    while (moreargs()) {
+
+        /* get the next argument */
+        arg = xlgetarg();
+
+        /* check its type */
+        if (fixp(arg)) {
+            switch (mode) {
+            case 'I':
+                iarg = getfixnum(arg);
+                break;
+            case 'F':
+                farg = (FLOTYPE)getfixnum(arg);
+                break;
+            }
+        }
+        else if (floatp(arg)) {
+            switch (mode) {
+            case 'I':
+                fval = (FLOTYPE)ival;
+                farg = getflonum(arg);
+                mode = 'F';
+                break;
+            case 'F':
+                farg = getflonum(arg);
+                break;
+            }
+        }
+        else
+            xlerror("bad argument type",arg);
+
+        /* accumulate the result value */
+        switch (mode) {
+        case 'I':
+            switch (fcn) {
+            case '+':	ival += iarg; break;
+            case '-':	ival -= iarg; break;
+            case '*':	ival *= iarg; break;
+            case '/':	checkizero(iarg); ival /= iarg; break;
+            case '%':	checkizero(iarg); ival %= iarg; break;
+            case 'M':	if (iarg > ival) ival = iarg; break;
+            case 'm':	if (iarg < ival) ival = iarg; break;
+            case '&':	ival &= iarg; break;
+            case '|':	ival |= iarg; break;
+            case '^':	ival ^= iarg; break;
+            case 'A':   fval = atan2((double) ival, (double) iarg);
+                        mode = 'F';
+                        xllastarg();
+                        break;
+            default:	badiop();
+            }
+            break;
+        case 'F':
+            switch (fcn) {
+            case '+':	fval += farg; break;
+            case '-':	fval -= farg; break;
+            case '*':	fval *= farg; break;
+            case '/':	checkfzero(farg); fval /= farg; break;
+            case 'M':	if (farg > fval) fval = farg; break;
+            case 'm':	if (farg < fval) fval = farg; break;
+            case 'E':	fval = pow(fval,farg); break;
+            case 'A':   fval = atan2(fval, farg);
+	                xllastarg();
+			break;
+            default:	badfop();
+            }
+                break;
+        }
+    }
+
+    /* return the result */
+    switch (mode) {
+    case 'I':	return (cvfixnum(ival));
+    case 'F':	return (cvflonum(fval));
+    }
+
+    /* This shouldn't fall through, but just in case, this will
+       catch it and make the compiler happy... */
+    xlerror("bad argument type",arg);
+    return NULL;
+}
+
+/* checkizero - check for integer division by zero */
+void checkizero(FIXTYPE iarg)
+{
+    if (iarg == 0)
+        xlfail("division by zero");
+}
+
+/* checkfzero - check for floating point division by zero */
+void checkfzero(FLOTYPE farg)
+{
+    if (farg == 0.0)
+        xlfail("division by zero");
+}
+
+/* checkfneg - check for square root of a negative number */
+void checkfneg(FLOTYPE farg)
+{
+    if (farg < 0.0)
+        xlfail("square root of a negative number");
+}
+
+/* real-random */
+LVAL xrealrand(void)
+{
+    xllastarg();
+    return cvflonum(xlrealrand());
+}
+
+/* unary functions */
+LVAL xlognot(void) { return (unary('~')); } /* lognot */
+LVAL xabs(void)    { return (unary('A')); } /* abs */
+LVAL xadd1(void)   { return (unary('+')); } /* 1+ */
+LVAL xsub1(void)   { return (unary('-')); } /* 1- */
+LVAL xsin(void)    { return (unary('S')); } /* sin */
+LVAL xcos(void)    { return (unary('C')); } /* cos */
+LVAL xtan(void)    { return (unary('T')); } /* tan */
+LVAL xexp(void)    { return (unary('E')); } /* exp */
+LVAL xsqrt(void)   { return (unary('R')); } /* sqrt */
+LVAL xfix(void)    { return (unary('I')); } /* truncate */
+LVAL xfloat(void)  { return (unary('F')); } /* float */
+LVAL xrand(void)   { return (unary('?')); } /* random */
+
+/* unary - handle unary operations */
+LOCAL LVAL unary(int fcn)
+{
+    FLOTYPE fval;
+    FIXTYPE ival;
+    LVAL arg;
+
+    /* get the argument */
+    arg = xlgetarg();
+    xllastarg();
+
+    /* check its type */
+    if (fixp(arg)) {
+        ival = getfixnum(arg);
+        switch (fcn) {
+        case '~':	ival = ~ival; break;
+        case 'A':	ival = (ival < 0 ? -ival : ival); break;
+        case '+':	ival++; break;
+        case '-':	ival--; break;
+        case 'I':	break;
+        case 'F':	return (cvflonum((FLOTYPE)ival));
+        case '?':	ival = (FIXTYPE)xlrand((int)ival); break;
+        default:	badiop();
+        }
+        return (cvfixnum(ival));
+    }
+    else if (floatp(arg)) {
+        fval = getflonum(arg);
+        switch (fcn) {
+        case 'A':	fval = (fval < 0.0 ? -fval : fval); break;
+        case '+':	fval += 1.0; break;
+        case '-':	fval -= 1.0; break;
+        case 'S':	fval = sin(fval); break;
+        case 'C':	fval = cos(fval); break;
+        case 'T':	fval = tan(fval); break;
+        case 'E':	fval = exp(fval); break;
+        case 'R':	checkfneg(fval); fval = sqrt(fval); break;
+        case 'I':	return (cvfixnum((FIXTYPE)fval));
+        case 'F':	break;
+        default:	badfop();
+        }
+        return (cvflonum(fval));
+    }
+    else {
+        xlerror("bad argument type",arg);
+        return NULL;
+    }
+}
+
+/* unary predicates */
+LVAL xminusp(void) { return (predicate('-')); } /* minusp */
+LVAL xzerop(void)  { return (predicate('Z')); } /* zerop */
+LVAL xplusp(void)  { return (predicate('+')); } /* plusp */
+LVAL xevenp(void)  { return (predicate('E')); } /* evenp */
+LVAL xoddp(void)   { return (predicate('O')); } /* oddp */
+
+/* predicate - handle a predicate function */
+LOCAL LVAL predicate(int fcn)
+{
+    FLOTYPE fval;
+    FIXTYPE ival=0;
+    LVAL arg;
+
+    /* get the argument */
+    arg = xlgetarg();
+    xllastarg();
+
+    /* check the argument type */
+    if (fixp(arg)) {
+        ival = getfixnum(arg);
+        switch (fcn) {
+        case '-':	ival = (ival < 0); break;
+        case 'Z':	ival = (ival == 0); break;
+        case '+':	ival = (ival > 0); break;
+        case 'E':	ival = ((ival & 1) == 0); break;
+        case 'O':	ival = ((ival & 1) != 0); break;
+        default:	badiop();
+        }
+    }
+    else if (floatp(arg)) {
+        fval = getflonum(arg);
+        switch (fcn) {
+        case '-':	ival = (fval < 0); break;
+        case 'Z':	ival = (fval == 0); break;
+        case '+':	ival = (fval > 0); break;
+        default:	badfop();
+        }
+    }
+    else
+        xlerror("bad argument type",arg);
+
+    /* return the result value */
+    return (ival ? s_true : NIL);
+}
+
+/* comparison functions */
+LVAL xlss(void) { return (compare('<')); } /* < */
+LVAL xleq(void) { return (compare('L')); } /* <= */
+LVAL xequ(void) { return (compare('=')); } /* = */
+LVAL xneq(void) { return (compare('#')); } /* /= */
+LVAL xgeq(void) { return (compare('G')); } /* >= */
+LVAL xgtr(void) { return (compare('>')); } /* > */
+
+/* compare - common compare function */
+LOCAL LVAL compare(int fcn)
+{
+    FIXTYPE icmp,ival=0,iarg=0;
+    FLOTYPE fcmp,fval=0,farg=0;
+    LVAL arg;
+    int mode=0;
+
+    /* get the first argument */
+    arg = xlgetarg();
+
+    /* set the type of the first argument */
+    if (fixp(arg)) {
+        ival = getfixnum(arg);
+        mode = 'I';
+    }
+    else if (floatp(arg)) {
+        fval = getflonum(arg);
+        mode = 'F';
+    }
+    else
+        xlerror("bad argument type",arg);
+
+    /* handle each remaining argument */
+    for (icmp = TRUE; icmp && moreargs(); ival = iarg, fval = farg) {
+
+        /* get the next argument */
+        arg = xlgetarg();
+
+        /* check its type */
+        if (fixp(arg)) {
+            switch (mode) {
+            case 'I':
+                iarg = getfixnum(arg);
+                break;
+            case 'F':
+                farg = (FLOTYPE)getfixnum(arg);
+                break;
+            }
+        }
+        else if (floatp(arg)) {
+            switch (mode) {
+            case 'I':
+                fval = (FLOTYPE)ival;
+                farg = getflonum(arg);
+                mode = 'F';
+                break;
+            case 'F':
+                farg = getflonum(arg);
+                break;
+            }
+        }
+        else
+            xlerror("bad argument type",arg);
+
+        /* compute result of the compare */
+        switch (mode) {
+        case 'I':
+            icmp = ival - iarg;
+            switch (fcn) {
+            case '<':	icmp = (icmp < 0); break;
+            case 'L':	icmp = (icmp <= 0); break;
+            case '=':	icmp = (icmp == 0); break;
+            case '#':	icmp = (icmp != 0); break;
+            case 'G':	icmp = (icmp >= 0); break;
+            case '>':	icmp = (icmp > 0); break;
+            }
+            break;
+        case 'F':
+            fcmp = fval - farg;
+            switch (fcn) {
+            case '<':	icmp = (fcmp < 0.0); break;
+            case 'L':	icmp = (fcmp <= 0.0); break;
+            case '=':	icmp = (fcmp == 0.0); break;
+            case '#':	icmp = (fcmp != 0.0); break;
+            case 'G':	icmp = (fcmp >= 0.0); break;
+            case '>':	icmp = (fcmp > 0.0); break;
+            }
+            break;
+        }
+    }
+
+    /* return the result */
+    return (icmp ? s_true : NIL);
+}
+
+/* badiop - bad integer operation */
+LOCAL void badiop(void)
+{
+    xlfail("bad integer operation");
+}
+
+/* badfop - bad floating point operation */
+LOCAL void badfop(void)
+{
+    xlfail("bad floating point operation");
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlobj.c b/lib-src/libnyquist/nyquist/xlisp/xlobj.c
new file mode 100644
index 0000000..23a8214
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlobj.c
@@ -0,0 +1,489 @@
+/* xlobj - xlisp object functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL s_stdout,s_lambda;
+
+/* local variables */
+static LVAL s_self,k_new,k_isnew;
+static LVAL class,object;
+
+/* instance variable numbers for the class 'Class' */
+#define MESSAGES	0	/* list of messages */
+#define IVARS		1	/* list of instance variable names */
+#define CVARS		2	/* list of class variable names */
+#define CVALS		3	/* list of class variable values */
+#define SUPERCLASS	4	/* pointer to the superclass */
+#define IVARCNT		5	/* number of class instance variables */
+#define IVARTOTAL	6	/* total number of instance variables */
+
+/* number of instance variables for the class 'Class' */
+#define CLASSSIZE	7
+
+/* forward declarations */
+FORWARD LOCAL LVAL entermsg(LVAL cls, LVAL msg);
+FORWARD LOCAL LVAL xsendmsg(LVAL obj, LVAL cls, LVAL sym);
+FORWARD LOCAL LVAL evmethod(LVAL obj, LVAL msgcls, LVAL method);
+FORWARD LOCAL int getivcnt(LVAL cls, int ivar);
+FORWARD LOCAL int listlength(LVAL list);
+
+
+/* xsend - send a message to an object */
+LVAL xsend(void)
+{
+    LVAL obj;
+    obj = xlgaobject();
+    return (xsendmsg(obj,getclass(obj),xlgasymbol()));
+}
+
+/* xsendsuper - send a message to the superclass of an object */
+LVAL xsendsuper(void)
+{
+    LVAL env,p;
+    for (env = xlenv; env; env = cdr(env))
+        if ((p = car(env)) && objectp(car(p)))
+            return (xsendmsg(car(p),
+                            getivar(cdr(p),SUPERCLASS),
+                            xlgasymbol()));
+    xlfail("not in a method");
+    return NULL; /* never called */
+}
+
+/* xlclass - define a class */
+LVAL xlclass(char *name, int vcnt)
+{
+    LVAL sym,cls;
+
+    /* create the class */
+    sym = xlenter(name);
+    cls = newobject(class,CLASSSIZE);
+    setvalue(sym,cls);
+
+    /* set the instance variable counts */
+    setivar(cls,IVARCNT,cvfixnum((FIXTYPE)vcnt));
+    setivar(cls,IVARTOTAL,cvfixnum((FIXTYPE)vcnt));
+
+    /* set the superclass to 'Object' */
+    setivar(cls,SUPERCLASS,object);
+
+    /* return the new class */
+    return (cls);
+}
+
+/* xladdivar - enter an instance variable */
+void xladdivar(LVAL cls, char *var)
+{
+    setivar(cls,IVARS,cons(xlenter(var),getivar(cls,IVARS)));
+}
+
+/* xladdmsg - add a message to a class */
+void xladdmsg(LVAL cls, char *msg, int offset)
+{
+    extern FUNDEF funtab[];
+    LVAL mptr;
+
+    /* enter the message selector */
+    mptr = entermsg(cls,xlenter(msg));
+
+    /* store the method for this message */
+    rplacd(mptr,cvsubr(funtab[offset].fd_subr,funtab[offset].fd_type,offset));
+}
+
+/* xlobgetvalue - get the value of an instance variable */
+int xlobgetvalue(LVAL pair, LVAL sym, LVAL *pval)
+{
+    LVAL cls,names;
+    int ivtotal,n;
+
+    /* find the instance or class variable */
+    for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
+
+        /* check the instance variables */
+        names = getivar(cls,IVARS);
+        ivtotal = getivcnt(cls,IVARTOTAL);
+        for (n = ivtotal - getivcnt(cls,IVARCNT); n < ivtotal; ++n) {
+            if (car(names) == sym) {
+                *pval = getivar(car(pair),n);
+                return (TRUE);
+            }
+            names = cdr(names);
+        }
+
+        /* check the class variables */
+        names = getivar(cls,CVARS);
+        for (n = 0; consp(names); ++n) {
+            if (car(names) == sym) {
+                *pval = getelement(getivar(cls,CVALS),n);
+                return (TRUE);
+            }
+            names = cdr(names);
+        }
+    }
+
+    /* variable not found */
+    return (FALSE);
+}
+
+/* xlobsetvalue - set the value of an instance variable */
+int xlobsetvalue(LVAL pair, LVAL sym, LVAL val)
+{
+    LVAL cls,names;
+    int ivtotal,n;
+
+    /* find the instance or class variable */
+    for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
+
+        /* check the instance variables */
+        names = getivar(cls,IVARS);
+        ivtotal = getivcnt(cls,IVARTOTAL);
+        for (n = ivtotal - getivcnt(cls,IVARCNT); n < ivtotal; ++n) {
+            if (car(names) == sym) {
+                setivar(car(pair),n,val);
+                return (TRUE);
+            }
+            names = cdr(names);
+        }
+
+        /* check the class variables */
+        names = getivar(cls,CVARS);
+        for (n = 0; consp(names); ++n) {
+            if (car(names) == sym) {
+                setelement(getivar(cls,CVALS),n,val);
+                return (TRUE);
+            }
+            names = cdr(names);
+        }
+    }
+
+    /* variable not found */
+    return (FALSE);
+}
+
+/* obisnew - default 'isnew' method */
+LVAL obisnew(void)
+{
+    LVAL self;
+    self = xlgaobject();
+    xllastarg();
+    return (self);
+}
+
+/* obclass - get the class of an object */
+LVAL obclass(void)
+{
+    LVAL self;
+    self = xlgaobject();
+    xllastarg();
+    return (getclass(self));
+}
+
+/* obshow - show the instance variables of an object */
+LVAL obshow(void)
+{
+    LVAL self,fptr,cls,names;
+    int ivtotal,n;
+
+    /* get self and the file pointer */
+    self = xlgaobject();
+    fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* get the object's class */
+    cls = getclass(self);
+
+    /* print the object and class */
+    xlputstr(fptr,"Object is ");
+    xlprint(fptr,self,TRUE);
+    xlputstr(fptr,", Class is ");
+    xlprint(fptr,cls,TRUE);
+    xlterpri(fptr);
+
+    /* print the object's instance variables */
+    for (; cls; cls = getivar(cls,SUPERCLASS)) {
+        names = getivar(cls,IVARS);
+        ivtotal = getivcnt(cls,IVARTOTAL);
+        for (n = ivtotal - getivcnt(cls,IVARCNT); n < ivtotal; ++n) {
+            xlputstr(fptr,"  ");
+            xlprint(fptr,car(names),TRUE);
+            xlputstr(fptr," = ");
+            xlprint(fptr,getivar(self,n),TRUE);
+            xlterpri(fptr);
+            names = cdr(names);
+        }
+    }
+
+    /* return the object */
+    return (self);
+}
+
+/* obisa - does an object inherit from class? */
+LVAL obisa(void)
+{
+    LVAL self, cl, obcl;
+    self = xlgaobject();
+    cl = xlgaobject();
+    xllastarg();
+    obcl = getclass(self);
+    while (obcl) {
+        if (obcl == cl) return s_true;
+        obcl = getivar(obcl, SUPERCLASS);
+    }
+    return NIL;
+}
+
+/* clnew - create a new object instance */
+LVAL clnew(void)
+{
+    LVAL self;
+    self = xlgaobject();
+    return (newobject(self,getivcnt(self,IVARTOTAL)));
+}
+
+/* clisnew - initialize a new class */
+LVAL clisnew(void)
+{
+    LVAL self,ivars,cvars,super;
+    int n;
+
+    /* get self, the ivars, cvars and superclass */
+    self = xlgaobject();
+    ivars = xlgalist();
+    cvars = (moreargs() ? xlgalist() : NIL);
+    super = (moreargs() ? xlgaobject() : object);
+    xllastarg();
+
+    /* store the instance and class variable lists and the superclass */
+    setivar(self,IVARS,ivars);
+    setivar(self,CVARS,cvars);
+    setivar(self,CVALS,(cvars ? newvector(listlength(cvars)) : NIL));
+    setivar(self,SUPERCLASS,super);
+
+    /* compute the instance variable count */
+    n = listlength(ivars);
+    setivar(self,IVARCNT,cvfixnum((FIXTYPE)n));
+    n += getivcnt(super,IVARTOTAL);
+    setivar(self,IVARTOTAL,cvfixnum((FIXTYPE)n));
+
+    /* return the new class object */
+    return (self);
+}
+
+/* clanswer - define a method for answering a message */
+LVAL clanswer(void)
+{
+    LVAL self,msg,fargs,code,mptr;
+
+    /* message symbol, formal argument list and code */
+    self = xlgaobject();
+    msg = xlgasymbol();
+    fargs = xlgalist();
+    code = xlgalist();
+    xllastarg();
+
+    /* make a new message list entry */
+    mptr = entermsg(self,msg);
+
+    /* setup the message node */
+    xlprot1(fargs);
+    fargs = cons(s_self,fargs); /* add 'self' as the first argument */
+    rplacd(mptr,xlclose(msg,s_lambda,fargs,code,NIL,NIL));
+    xlpop();
+
+    /* return the object */
+    return (self);
+}
+
+/* entermsg - add a message to a class */
+LOCAL LVAL entermsg(LVAL cls, LVAL msg)
+{
+    LVAL lptr,mptr;
+
+    /* lookup the message */
+    for (lptr = getivar(cls,MESSAGES); lptr; lptr = cdr(lptr))
+        if (car(mptr = car(lptr)) == msg)
+            return (mptr);
+
+    /* allocate a new message entry if one wasn't found */
+    xlsave1(mptr);
+    mptr = consa(msg);
+    setivar(cls,MESSAGES,cons(mptr,getivar(cls,MESSAGES)));
+    xlpop();
+
+    /* return the symbol node */
+    return (mptr);
+}
+
+/* xsendmsg - send a message to an object */
+LOCAL LVAL xsendmsg(LVAL obj, LVAL cls, LVAL sym)
+{
+    LVAL msg=NULL,msgcls,method,val,p;
+
+    /* look for the message in the class or superclasses */
+    for (msgcls = cls; msgcls; ) {
+
+        /* lookup the message in this class */
+        for (p = getivar(msgcls,MESSAGES); p; p = cdr(p))
+            if ((msg = car(p)) && car(msg) == sym)
+                goto send_message;
+
+        /* look in class's superclass */
+        msgcls = getivar(msgcls,SUPERCLASS);
+    }
+
+    /* message not found */
+    xlerror("no method for this message",sym);
+
+send_message:
+
+    /* insert the value for 'self' (overwrites message selector) */
+    *--xlargv = obj;
+    ++xlargc;
+    
+    /* invoke the method */
+    if ((method = cdr(msg)) == NULL)
+        xlerror("bad method",method);
+    switch (ntype(method)) {
+    case SUBR:
+        val = (*getsubr(method))();
+        break;
+    case CLOSURE:
+        if (gettype(method) != s_lambda)
+            xlerror("bad method",method);
+        val = evmethod(obj,msgcls,method);
+        break;
+    default:
+        xlerror("bad method",method);
+    }
+
+    /* after creating an object, send it the ":isnew" message */
+    if (car(msg) == k_new && val) {
+        xlprot1(val);
+        xsendmsg(val,getclass(val),k_isnew);
+        xlpop();
+    }
+    
+    /* return the result value */
+    return (val);
+}
+
+/* evmethod - evaluate a method */
+LOCAL LVAL evmethod(LVAL obj, LVAL msgcls, LVAL method)
+{
+    LVAL oldenv,oldfenv,cptr,name,val=NULL;
+    XLCONTEXT cntxt;
+
+    /* protect some pointers */
+    xlstkcheck(3);
+    xlsave(oldenv);
+    xlsave(oldfenv);
+    xlsave(cptr);
+
+    /* create an 'object' stack entry and a new environment frame */
+    oldenv = xlenv;
+    oldfenv = xlfenv;
+    xlenv = cons(cons(obj,msgcls),closure_getenv(method));
+    xlenv = xlframe(xlenv);
+    xlfenv = getfenv(method);
+
+    /* bind the formal parameters */
+    xlabind(method,xlargc,xlargv);
+
+    /* setup the implicit block */
+    if ((name = getname(method)))
+        xlbegin(&cntxt,CF_RETURN,name);
+
+    /* execute the block */
+    if (name && setjmp(cntxt.c_jmpbuf))
+        val = xlvalue;
+    else
+        for (cptr = getbody(method); consp(cptr); cptr = cdr(cptr))
+            val = xleval(car(cptr));
+
+    /* finish the block context */
+    if (name)
+        xlend(&cntxt);
+
+    /* restore the environment */
+    xlenv = oldenv;
+    xlfenv = oldfenv;
+
+    /* restore the stack */
+    xlpopn(3);
+
+    /* return the result value */
+    return (val);
+}
+
+/* getivcnt - get the number of instance variables for a class */
+LOCAL int getivcnt(LVAL cls, int ivar)
+{
+    LVAL cnt;
+    if ((cnt = getivar(cls,ivar)) == NIL || !fixp(cnt))
+        xlfail("bad value for instance variable count");
+    return ((int)getfixnum(cnt));
+}
+
+/* listlength - find the length of a list */
+LOCAL int listlength(LVAL list)
+{
+    int len;
+    for (len = 0; consp(list); len++)
+        list = cdr(list);
+    return (len);
+}
+
+
+/* obsymbols - initialize symbols */
+void obsymbols(void)
+{
+    /* enter the object related symbols */
+    s_self  = xlenter("SELF");
+    k_new   = xlenter(":NEW");
+    k_isnew = xlenter(":ISNEW");
+
+    /* get the Object and Class symbol values */
+    object = getvalue(xlenter("OBJECT"));
+    class  = getvalue(xlenter("CLASS"));
+}
+
+
+/* xloinit - object function initialization routine */
+void xloinit(void)
+{
+    /* create the 'Class' object */
+    class = xlclass("CLASS",CLASSSIZE);
+    setelement(class,0,class);
+
+    /* create the 'Object' object */
+    object = xlclass("OBJECT",0);
+
+    /* finish initializing 'class' */
+    setivar(class,SUPERCLASS,object);
+    xladdivar(class,"IVARTOTAL");	/* ivar number 6 */
+    xladdivar(class,"IVARCNT");		/* ivar number 5 */
+    xladdivar(class,"SUPERCLASS");	/* ivar number 4 */
+    xladdivar(class,"CVALS");		/* ivar number 3 */
+    xladdivar(class,"CVARS");		/* ivar number 2 */
+    xladdivar(class,"IVARS");		/* ivar number 1 */
+    xladdivar(class,"MESSAGES");	/* ivar number 0 */
+    xladdmsg(class,":NEW",FT_CLNEW);
+    xladdmsg(class,":ISNEW",FT_CLISNEW);
+    xladdmsg(class,":ANSWER",FT_CLANSWER);
+
+    /* finish initializing 'object' */
+    setivar(object,SUPERCLASS,NIL);
+    xladdmsg(object,":ISNEW",FT_OBISNEW);
+    xladdmsg(object,":CLASS",FT_OBCLASS);
+    xladdmsg(object,":SHOW",FT_OBSHOW);
+    xladdmsg(object,":ISA",FT_OBISA);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlpp.c b/lib-src/libnyquist/nyquist/xlisp/xlpp.c
new file mode 100644
index 0000000..43a7089
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlpp.c
@@ -0,0 +1,115 @@
+/* xlpp.c - xlisp pretty printer */
+/*	Copyright (c) 1985, by David Betz
+        All Rights Reserved			*/
+
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL s_stdout;
+extern int xlfsize;
+
+/* local variables */
+static int pplevel,ppmargin,ppmaxlen;
+static LVAL ppfile;
+
+LOCAL void pp(LVAL expr);
+LOCAL void ppterpri(void);
+LOCAL void pplist(LVAL expr);
+LOCAL void ppexpr(LVAL expr);
+LOCAL int flatsize(LVAL expr);
+LOCAL void ppputc(int ch);
+
+
+/* xpp - pretty-print an expression */
+LVAL xpp(void)
+{
+    LVAL expr;
+
+    /* get expression to print and file pointer */
+    expr = xlgetarg();
+    ppfile = (moreargs() ? xlgetfile() : getvalue(s_stdout));
+    xllastarg();
+
+    /* pretty print the expression */
+    pplevel = ppmargin = 0; ppmaxlen = 40;
+    pp(expr); ppterpri();
+
+    /* return nil */
+    return (NIL);
+}
+
+/* pp - pretty print an expression */
+LOCAL void pp(LVAL expr)
+{
+    if (consp(expr))
+        pplist(expr);
+    else
+        ppexpr(expr);
+}
+
+/* pplist - pretty print a list */
+LOCAL void pplist(LVAL expr)
+{
+    int n;
+
+    /* if the expression will fit on one line, print it on one */
+    if ((n = flatsize(expr)) < ppmaxlen) {
+        xlprint(ppfile,expr,TRUE);
+        pplevel += n;
+    }
+
+    /* otherwise print it on several lines */
+    else {
+        n = ppmargin;
+        ppputc('(');
+        if (atomp(car(expr))) {
+            ppexpr(car(expr));
+            ppputc(' ');
+            ppmargin = pplevel;
+            expr = cdr(expr);
+        }
+        else
+            ppmargin = pplevel;
+        for (; consp(expr); expr = cdr(expr)) {
+            pp(car(expr));
+            if (consp(cdr(expr)))
+                ppterpri();
+        }
+        if (expr != NIL) {
+            ppputc(' '); ppputc('.'); ppputc(' ');
+            ppexpr(expr);
+        }
+        ppputc(')');
+        ppmargin = n;
+    }
+}
+
+/* ppexpr - print an expression and update the indent level */
+LOCAL void ppexpr(LVAL expr)
+{
+    xlprint(ppfile,expr,TRUE);
+    pplevel += flatsize(expr);
+}
+
+/* ppputc - output a character and update the indent level */
+LOCAL void ppputc(int ch)
+{
+    xlputc(ppfile,ch);
+    pplevel++;
+}
+
+/* ppterpri - terminate the print line and indent */
+LOCAL void ppterpri(void)
+{
+    xlterpri(ppfile);
+    for (pplevel = 0; pplevel < ppmargin; pplevel++)
+        xlputc(ppfile,' ');
+}
+
+/* flatsize - compute the flat size of an expression */
+LOCAL int flatsize(LVAL expr)
+{
+    xlfsize = 0;
+    xlprint(NIL,expr,TRUE);
+    return (xlfsize);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlprin.c b/lib-src/libnyquist/nyquist/xlisp/xlprin.c
new file mode 100644
index 0000000..60339be
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlprin.c
@@ -0,0 +1,338 @@
+/* xlprint - xlisp print routine */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use
+
+ * HISTORY
+ * 28-Apr-03    Mazzoni
+ *  Eliminated some compiler warnings
+ *
+ *  3-Apr-88	Dale Amon at CMU-CSD
+ *	Added extern support to xlisp 2.0
+ *
+ * 18-Oct-87	Dale Amon at CMU-CSD
+ *	Added print support for EXTERN nodes
+ */
+
+
+#include "string.h"
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL s_printcase,k_downcase,k_const,k_nmacro;
+extern LVAL s_ifmt,s_ffmt;
+extern FUNDEF funtab[];
+extern char buf[];
+
+LOCAL void putsymbol(LVAL fptr, char *str, int escflag);
+LOCAL void putsubr(LVAL fptr, char *tag, LVAL val);
+LOCAL void putfixnum(LVAL fptr, FIXTYPE n);
+LOCAL void putflonum(LVAL fptr, FLOTYPE n);
+LOCAL void putchcode(LVAL fptr, int ch, int escflag);
+LOCAL void putstring(LVAL fptr, LVAL str);
+LOCAL void putqstring(LVAL fptr, LVAL str);
+LOCAL void putclosure(LVAL fptr, LVAL val);
+LOCAL void putoct(LVAL fptr, int n);
+
+
+/* xlprint - print an xlisp value */
+void xlprint(LVAL fptr, LVAL vptr, int flag)
+{
+    LVAL nptr,next;
+    int n,i;
+
+    /* print nil */
+    if (vptr == NIL) {
+        putsymbol(fptr,"NIL",flag);
+        return;
+    }
+
+    /* check value type */
+    switch (ntype(vptr)) {
+    case SUBR:
+            putsubr(fptr,"Subr",vptr);
+            break;
+    case FSUBR:
+            putsubr(fptr,"FSubr",vptr);
+            break;
+    case CONS:
+            xlputc(fptr,'(');
+            for (nptr = vptr; nptr != NIL; nptr = next) {
+                xlprint(fptr,car(nptr),flag);
+                if ((next = cdr(nptr))) {
+                    if (consp(next))
+                        xlputc(fptr,' ');
+                    else {
+                        xlputstr(fptr," . ");
+                        xlprint(fptr,next,flag);
+                        break;
+                    }
+                }
+            }
+            xlputc(fptr,')');
+            break;
+    case SYMBOL:
+            putsymbol(fptr,(char *) getstring(getpname(vptr)),flag);
+            break;
+    case FIXNUM:
+            putfixnum(fptr,getfixnum(vptr));
+            break;
+    case FLONUM:
+            putflonum(fptr,getflonum(vptr));
+            break;
+    case CHAR:
+            putchcode(fptr,getchcode(vptr),flag);
+            break;
+    case STRING:
+            if (flag)
+                putqstring(fptr,vptr);
+            else
+                putstring(fptr,vptr);
+            break;
+    case STREAM:
+            putatm(fptr,"File-Stream",vptr);
+            break;
+    case USTREAM:
+            putatm(fptr,"Unnamed-Stream",vptr);
+            break;
+    case OBJECT:
+            putatm(fptr,"Object",vptr);
+            break;
+    case VECTOR:
+            xlputc(fptr,'#'); xlputc(fptr,'(');
+            for (i = 0, n = getsize(vptr); n-- > 0; ) {
+                xlprint(fptr,getelement(vptr,i++),flag);
+                if (n) xlputc(fptr,' ');
+            }
+            xlputc(fptr,')');
+            break;
+    case CLOSURE:
+            putclosure(fptr,vptr);
+            break;
+    case EXTERN:
+            if (getdesc(vptr)) {
+                (*(getdesc(vptr)->print_meth))(fptr, getinst(vptr));
+            }
+            break;
+    case FREE_NODE:
+            putatm(fptr,"Free",vptr);
+            break;
+    default:
+            putatm(fptr,"Foo",vptr);
+            break;
+    }
+}
+
+/* xlterpri - terminate the current print line */
+void xlterpri(LVAL fptr)
+{
+    xlputc(fptr,'\n');
+}
+
+/* xlputstr - output a string */
+void xlputstr(LVAL fptr, char *str)
+{
+    while (*str)
+        xlputc(fptr,*str++);
+}
+
+/* putsymbol - output a symbol */
+LOCAL void putsymbol(LVAL fptr, char *str, int escflag)
+{
+    int downcase;
+    LVAL type;
+    char *p;
+
+    /* check for printing without escapes */
+    if (!escflag) {
+        xlputstr(fptr,str);
+        return;
+    }
+
+    /* check to see if symbol needs escape characters */
+    if (tentry(*str) == k_const) {
+        for (p = str; *p; ++p)
+            if (islower(*p)
+            ||  ((type = tentry(*p)) != k_const
+              && (!consp(type) || car(type) != k_nmacro))) {
+                xlputc(fptr,'|');
+                while (*str) {
+                    if (*str == '\\' || *str == '|')
+                        xlputc(fptr,'\\');
+                    xlputc(fptr,*str++);
+                }
+                xlputc(fptr,'|');
+                return;
+            }
+    }
+
+    /* get the case translation flag */
+    downcase = (getvalue(s_printcase) == k_downcase);
+
+    /* check for the first character being '#' */
+    if (*str == '#' || *str == '.' || xlisnumber(str,NULL))
+        xlputc(fptr,'\\');
+
+    /* output each character */
+    while (*str) {
+        /* don't escape colon until we add support for packages */
+        if (*str == '\\' || *str == '|' /* || *str == ':' */)
+            xlputc(fptr,'\\');
+        xlputc(fptr,(downcase && isupper(*str) ? tolower(*str++) : *str++));
+    }
+}
+
+/* putstring - output a string */
+LOCAL void putstring(LVAL fptr, LVAL str)
+{
+    unsigned char *p;
+    int ch;
+
+    /* output each character */
+    for (p = getstring(str); (ch = *p) != '\0'; ++p)
+        xlputc(fptr,ch);
+}
+
+/* putqstring - output a quoted string */
+LOCAL void putqstring(LVAL fptr, LVAL str)
+{
+    unsigned char *p;
+    int ch;
+
+    /* get the string pointer */
+    p = getstring(str);
+
+    /* output the initial quote */
+    xlputc(fptr,'"');
+
+    /* output each character in the string */
+    for (p = getstring(str); (ch = *p) != '\0'; ++p)
+
+        /* check for a control character */
+        if (ch < 040 || ch == '\\' || ch > 0176) {
+            xlputc(fptr,'\\');
+            switch (ch) {
+            case '\011':
+                    xlputc(fptr,'t');
+                    break;
+            case '\012':
+                    xlputc(fptr,'n');
+                    break;
+            case '\014':
+                    xlputc(fptr,'f');
+                    break;
+            case '\015':
+                    xlputc(fptr,'r');
+                    break;
+            case '\\':
+                    xlputc(fptr,'\\');
+                    break;
+            default:
+                    putoct(fptr,ch);
+                    break;
+            }
+        }
+
+        /* output a normal character */
+        else
+            xlputc(fptr,ch);
+
+    /* output the terminating quote */
+    xlputc(fptr,'"');
+}
+
+/* putatm - output an atom */
+void putatm(LVAL fptr, char *tag, LVAL val)
+{
+    sprintf(buf,"#<%s: #",tag); xlputstr(fptr,buf);
+    sprintf(buf,AFMT,(long unsigned int)val); xlputstr(fptr,buf);
+    xlputc(fptr,'>');
+}
+
+/* putsubr - output a subr/fsubr */
+LOCAL void putsubr(LVAL fptr, char *tag, LVAL val)
+{
+    sprintf(buf,"#<%s-%s: #",tag,funtab[getoffset(val)].fd_name);
+    xlputstr(fptr,buf);
+    sprintf(buf,AFMT,(long unsigned int)val); xlputstr(fptr,buf);
+    xlputc(fptr,'>');
+}
+
+/* putclosure - output a closure */
+LOCAL void putclosure(LVAL fptr, LVAL val)
+{
+    LVAL name;
+    if ((name = getname(val)))
+        sprintf(buf,"#<Closure-%s: #",getstring(getpname(name)));
+    else
+        strcpy(buf,"#<Closure: #");
+    xlputstr(fptr,buf);
+    sprintf(buf,AFMT,(long unsigned int)val); xlputstr(fptr,buf);
+    xlputc(fptr,'>');
+/*
+    xlputstr(fptr,"\nName:   "); xlprint(fptr,getname(val),TRUE);
+    xlputstr(fptr,"\nType:   "); xlprint(fptr,gettype(val),TRUE);
+    xlputstr(fptr,"\nLambda: "); xlprint(fptr,getlambda(val),TRUE);
+    xlputstr(fptr,"\nArgs:   "); xlprint(fptr,getargs(val),TRUE);
+    xlputstr(fptr,"\nOargs:  "); xlprint(fptr,getoargs(val),TRUE);
+    xlputstr(fptr,"\nRest:   "); xlprint(fptr,getrest(val),TRUE);
+    xlputstr(fptr,"\nKargs:  "); xlprint(fptr,getkargs(val),TRUE);
+    xlputstr(fptr,"\nAargs:  "); xlprint(fptr,getaargs(val),TRUE);
+    xlputstr(fptr,"\nBody:   "); xlprint(fptr,getbody(val),TRUE);
+    xlputstr(fptr,"\nEnv:    "); xlprint(fptr,closure_getenv(val),TRUE);
+    xlputstr(fptr,"\nFenv:   "); xlprint(fptr,getfenv(val),TRUE);
+*/
+}
+
+/* putfixnum - output a fixnum */
+LOCAL void putfixnum(LVAL fptr, FIXTYPE n)
+{
+    unsigned char *fmt;
+    LVAL val;
+    fmt = ((val = getvalue(s_ifmt)) && stringp(val) ? getstring(val)
+                                                    : (unsigned char *)IFMT);
+    sprintf(buf, (char *) fmt,n);
+    xlputstr(fptr,buf);
+}
+
+/* putflonum - output a flonum */
+LOCAL void putflonum(LVAL fptr, FLOTYPE n)
+{
+    unsigned char *fmt;
+    LVAL val;
+    fmt = ((val = getvalue(s_ffmt)) && stringp(val) ? getstring(val)
+                                                    : (unsigned char *)"%g");
+    sprintf(buf,(char *) fmt,n);
+    xlputstr(fptr,buf);
+}
+
+/* putchcode - output a character */
+LOCAL void putchcode(LVAL fptr, int ch, int escflag)
+{
+    if (escflag) {
+        switch (ch) {
+        case '\n':
+            xlputstr(fptr,"#\\Newline");
+            break;
+        case ' ':
+            xlputstr(fptr,"#\\Space");
+            break;
+        case '\t':
+            xlputstr(fptr, "#\\Tab");
+            break;
+        default:
+            sprintf(buf,"#\\%c",ch);
+            xlputstr(fptr,buf);
+            break;
+        }
+    }
+    else
+        xlputc(fptr,ch);
+}
+
+/* putoct - output an octal byte value */
+LOCAL void putoct(LVAL fptr, int n)
+{
+    sprintf(buf,"%03o",n);
+    xlputstr(fptr,buf);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlread.c b/lib-src/libnyquist/nyquist/xlisp/xlread.c
new file mode 100644
index 0000000..f9dd889
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlread.c
@@ -0,0 +1,986 @@
+/* xlread - xlisp expression input routine */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ *              replaced system-specific code with generic calls (see path.c)
+ */
+
+
+#include "stdlib.h"
+#include "string.h"
+#include "switches.h"
+#include "xlisp.h"
+#ifdef WINDOWS
+#include "winfun.h"
+#endif
+#ifdef MACINTOSH
+#include "macstuff.h"
+#endif
+
+#ifdef DEBUG_INPUT
+extern FILE *debug_input_fp;
+#endif
+
+/* symbol parser modes */
+#define DONE	0
+#define NORMAL	1
+#define ESCAPE	2
+
+/* external variables */
+extern LVAL s_stdout,s_true,s_dot;
+extern LVAL s_quote,s_function,s_bquote,s_comma,s_comat;
+extern LVAL s_rtable,k_wspace,k_const,k_nmacro,k_tmacro;
+extern LVAL k_sescape,k_mescape;
+extern char buf[];
+
+/* external routines */
+extern FILE *osaopen();
+/* on the NeXT, atof is a macro in stdlib.h */
+#ifndef atof
+extern double atof();
+#endif
+#ifndef __MWERKS__
+#ifdef ITYPE
+extern ITYPE;
+#endif
+#endif
+
+#define WSPACE "\t \f\r\n"
+#define CONST1 "!$%&*+-./0123456789:<=>?@[]^_{}~"
+#define CONST2 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+
+/* forward declarations */
+FORWARD LVAL callmacro(LVAL fptr, int ch);
+FORWARD LOCAL LVAL psymbol(LVAL fptr);
+FORWARD LOCAL LVAL punintern(LVAL fptr);
+FORWARD LOCAL LVAL pnumber(LVAL fptr, int radix);
+FORWARD LOCAL LVAL pquote(LVAL fptr, LVAL sym);
+FORWARD LOCAL LVAL plist(LVAL fptr);
+FORWARD LOCAL LVAL pvector(LVAL fptr);
+FORWARD LOCAL void upcase(char *str);
+FORWARD LOCAL int pname(LVAL fptr,int *pescflag);
+FORWARD LOCAL void pcomment(LVAL fptr);
+FORWARD LOCAL int checkeof(LVAL fptr);
+FORWARD LOCAL int nextch(LVAL fptr);
+FORWARD LOCAL void badeof(LVAL fptr);
+FORWARD LOCAL int storech(char *buf, int i, int ch);
+
+#ifdef WINDOWS
+static char save_file_name[STRMAX+1]; /* keeps files opened by prompt */
+static int sfn_valid = FALSE;
+#endif
+
+#ifdef DEBUG_INPUT
+extern FILE *read_by_xlisp;
+#endif
+
+
+/* xlload - load a file of xlisp expressions */
+int xlload(char *fname, int vflag, int pflag)
+{
+    char fullname[STRMAX+1];
+#ifdef WINDOWS
+    char *ptr;
+#endif
+    LVAL fptr,expr;
+    XLCONTEXT cntxt;
+    FILE *fp;
+    int sts;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(fptr);
+    xlsave(expr);
+
+    /* space for copy + extension? */
+    if (strlen(fname) > STRMAX - 4) {
+	    expr = cvstring(fname);
+		goto toolong;
+	}
+    strcpy(fullname,fname);
+#ifdef WINDOWS
+#ifdef WINGUI
+    if (strcmp(fullname, "*") == 0) {
+        if (sfn_valid) {
+            strcpy(fullname, save_file_name);
+        } else {
+            strcpy(fullname, "*.*");
+        }
+    }
+    if (strcmp(fullname, "*.*") == 0) {
+        char *name = getfilename(NULL, "lsp", "r", "Load file");
+        if (name) {
+            strcpy(fullname, name);
+            strcpy(save_file_name, name);
+            sfn_valid = TRUE;
+        } else {
+            xlpopn(2);
+            return FALSE;
+        }
+    }
+#endif
+    /* replace "/" with "\" so that (current-path) will work */
+    for (ptr = fullname; *ptr; ptr++) {
+        if (*ptr == '/') *ptr = '\\';
+    }
+#endif
+
+    /* allocate a file node */
+    fptr = cvfile(NULL);
+
+    /* open the file */
+    fp = osaopen(fullname, "r");
+    if (fp == NULL) {
+        /* default the extension if there is room */
+        if (needsextension(fullname)) {
+            char fullname_plus[STRMAX+1];
+            strcpy(fullname_plus, fullname);
+            strcat(fullname_plus, ".lsp");
+            fp = osaopen(fullname_plus, "r");
+            if (fp) strcpy(fullname, fullname_plus);
+        }
+    }
+    if (fp == NULL) {
+        /* new cross-platform code by dmazzoni - new xlisp_path
+           implementation is in path.c */
+        const char *newname = find_in_xlisp_path(fullname);
+        if (newname && newname[0]) {
+            if (strlen(newname) > STRMAX) {
+			    expr = cvstring(newname);
+                goto toolong;
+			}
+            strcpy(fullname, newname);
+            fp = osaopen(fullname, "r");
+        }
+    }
+    if (fp == NULL) {
+        /* the file STILL wasn't found */
+#ifdef DEBUG_INPUT
+        if (read_by_xlisp) {
+		    fprintf(read_by_xlisp, ";;;;xlload: failed to open %s\n", fullname);
+	    }
+#endif
+        xlpopn(2);
+        return (FALSE);
+    }
+
+    setfile(fptr,fp);
+    setvalue(s_loadingfiles, cons(fptr, getvalue(s_loadingfiles)));
+    setvalue(s_loadingfiles, cons(cvstring(fullname), getvalue(s_loadingfiles)));
+
+    /* print the information line */
+    if (vflag)
+        { sprintf(buf,"; loading \"%s\"\n",fullname); stdputstr(buf); }
+
+#ifdef DEBUG_INPUT
+	if (read_by_xlisp) {
+		fprintf(read_by_xlisp, ";;;;xlload: begin loading %s\n", fullname);
+	}
+#endif
+
+    /* read, evaluate and possibly print each expression in the file */
+    xlbegin(&cntxt,CF_ERROR,s_true);
+    if (setjmp(cntxt.c_jmpbuf))
+        sts = FALSE;
+        #ifdef DEBUG_INPUT
+            if (read_by_xlisp) {
+		fprintf(read_by_xlisp, ";;;;xlload: catch longjump, back to %s\n", fullname);
+            }
+        #endif
+    else {
+        #ifdef DEBUG_INPUT
+            if (read_by_xlisp) {
+		fprintf(read_by_xlisp, ";;;;xlload: about to read from %s (%x)\n", fullname, fptr);
+            }
+        #endif
+        /* a nested load that fails will cause all loading files to be closed,
+         * so check to make sure fptr is still valid each time through the loop */
+        while (getfile(fptr) && xlread(fptr,&expr,FALSE)) {
+            #ifdef DEBUG_INPUT
+                if (debug_input_fp) {
+                    int c = getc(debug_input_fp);
+                    ungetc(c, debug_input_fp);
+                }
+            #endif
+            
+            expr = xleval(expr);
+            
+            #ifdef DEBUG_INPUT
+                if (debug_input_fp) {
+                    int c = getc(debug_input_fp);
+                    ungetc(c, debug_input_fp);
+                }
+            #endif
+            
+            if (pflag)
+                stdprint(expr);
+                
+            #ifdef DEBUG_INPUT
+                if (debug_input_fp) {
+                    int c = getc(debug_input_fp);
+                    ungetc(c, debug_input_fp);
+                }
+            #endif
+            #ifdef DEBUG_INPUT
+                if (read_by_xlisp) {
+                    fprintf(read_by_xlisp, ";;;;xlload: about to read from %s (%x)\n", fullname, fptr);
+                }
+            #endif
+        }
+        #ifdef DEBUG_INPUT
+            if (read_by_xlisp) {
+                fprintf(read_by_xlisp, ";;;;xlload: xlread returned false for %s (%x)\n", fullname, fptr);
+            }
+        #endif
+        /* return success only if file did not disappear out from under us */
+        sts = (getfile(fptr) != NULL);
+    }
+    xlend(&cntxt);
+
+    /* close the file */
+    if (getfile(fptr)) { /* test added by RBD, see close_loadingfiles() */
+        osclose(getfile(fptr));
+        setfile(fptr,NULL);
+    }
+    if (consp(getvalue(s_loadingfiles)) && 
+        consp(cdr(getvalue(s_loadingfiles))) &&
+        car(cdr(getvalue(s_loadingfiles))) == fptr) {
+        setvalue(s_loadingfiles, cdr(cdr(getvalue(s_loadingfiles))));
+    }
+
+    /* restore the stack */
+    xlpopn(2);
+
+#ifdef DEBUG_INPUT
+	if (read_by_xlisp) {
+		fprintf(read_by_xlisp, ";;;;xlload: finished loading %s\n", fullname);
+	}
+#endif
+
+    /* return status */
+    return (sts);
+
+toolong:
+    xlcerror("ignore file", "file name too long", expr);
+    xlpopn(2);
+    return FALSE;
+}
+
+/* xlread - read an xlisp expression */
+int xlread(LVAL fptr, LVAL *pval, int rflag)
+{
+    int sts;
+
+    /* read an expression */
+    while ((sts = readone(fptr,pval)) == FALSE)
+#ifdef DEBUG_INPUT
+    if (debug_input_fp) {
+        int c = getc(debug_input_fp);
+        ungetc(c, debug_input_fp);
+    }
+#endif
+        ;
+
+    /* return status */
+    return (sts == EOF ? FALSE : TRUE);
+}
+
+/* readone - attempt to read a single expression */
+int readone(LVAL fptr, LVAL *pval)
+{
+    LVAL val,type;
+    int ch;
+
+#ifdef DEBUG_INPUT
+    if (debug_input_fp) {
+        int c = getc(debug_input_fp);
+        ungetc(c, debug_input_fp);
+    }
+#endif
+    /* get a character and check for EOF */
+    if ((ch = xlgetc(fptr)) == EOF)
+        return (EOF);
+
+    /* handle white space */
+    if ((type = tentry(ch)) == k_wspace)
+        return (FALSE);
+
+    /* handle symbol constituents */
+    else if (type == k_const) {
+        xlungetc(fptr,ch);
+        *pval = psymbol(fptr);
+        return (TRUE);	    
+    }
+
+    /* handle single and multiple escapes */
+    else if (type == k_sescape || type == k_mescape) {
+        xlungetc(fptr,ch);
+        *pval = psymbol(fptr);
+        return (TRUE);
+    }
+    
+    /* handle read macros */
+    else if (consp(type)) {
+        if ((val = callmacro(fptr,ch)) && consp(val)) {
+            *pval = car(val);
+            return (TRUE);
+        }
+        else
+            return (FALSE);
+    }
+
+    /* handle illegal characters */
+    else
+        xlerror("illegal character",cvfixnum((FIXTYPE)ch));
+}
+
+/* rmhash - read macro for '#' */
+LVAL rmhash(void)
+{
+    LVAL fptr,mch,val;
+    int escflag,ch;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* make the return value */
+    val = consa(NIL);
+
+    /* check the next character */
+    switch (ch = xlgetc(fptr)) {
+    case '\'':
+                rplaca(val,pquote(fptr,s_function));
+                break;
+    case '(':
+                rplaca(val,pvector(fptr));
+                break;
+    case 'b':
+    case 'B':
+                rplaca(val,pnumber(fptr,2));
+                break;
+    case 'o':
+    case 'O':
+                rplaca(val,pnumber(fptr,8));
+                break;
+    case 'x':
+    case 'X':
+                    rplaca(val,pnumber(fptr,16));
+                break;
+    case '\\':
+                xlungetc(fptr,ch);
+                pname(fptr,&escflag);
+                ch = buf[0];
+                if (strlen(buf) > 1) {
+                    upcase((char *) buf);
+                    if (strcmp(buf,"NEWLINE") == 0)
+                        ch = '\n';
+                    else if (strcmp(buf,"SPACE") == 0)
+                        ch = ' ';
+                    else if (strcmp(buf,"TAB") == 0)
+                        ch = '\t';
+                    else
+                        xlerror("unknown character name",cvstring(buf));
+                }
+                rplaca(val,cvchar(ch));
+                break;
+    case ':':
+                rplaca(val,punintern(fptr));
+                break;
+    case '|':
+                    pcomment(fptr);
+                val = NIL;
+                break;
+    default:
+                xlerror("illegal character after #",cvfixnum((FIXTYPE)ch));
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the value */
+    return (val);
+}
+
+/* rmquote - read macro for '\'' */
+LVAL rmquote(void)
+{
+    LVAL fptr,mch;
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* parse the quoted expression */
+    return (consa(pquote(fptr,s_quote)));
+}
+
+/* rmdquote - read macro for '"' */
+LVAL rmdquote(void)
+{
+    unsigned char buf[STRMAX+1],*p,*sptr;
+    LVAL fptr,str,newstr,mch;
+    int len,blen,ch,d2,d3;
+
+    /* protect some pointers */
+    xlsave1(str);
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* loop looking for a closing quote */
+    len = blen = 0; p = buf;
+    while ((ch = checkeof(fptr)) != '"') {
+
+        /* handle escaped characters */
+        switch (ch) {
+        case '\\':
+                switch (ch = checkeof(fptr)) {
+                case 't':
+                        ch = '\011';
+                        break;
+                case 'n':
+                        ch = '\012';
+                        break;
+                case 'f':
+                        ch = '\014';
+                        break;
+                case 'r':
+                        ch = '\015';
+                        break;
+                default:
+                        if (ch >= '0' && ch <= '7') {
+                            d2 = checkeof(fptr);
+                            d3 = checkeof(fptr);
+                            if (d2 < '0' || d2 > '7'
+                             || d3 < '0' || d3 > '7')
+                                xlfail("invalid octal digit");
+                            ch -= '0'; d2 -= '0'; d3 -= '0';
+                            ch = (ch << 6) | (d2 << 3) | d3;
+                        }
+                        break;
+                }
+        }
+
+        /* check for buffer overflow */
+        if (blen >= STRMAX) {
+             newstr = new_string(len + STRMAX + 1);
+            sptr = getstring(newstr); *sptr = '\0';
+            if (str) strcat((char *) sptr, (char *) getstring(str));
+            *p = '\0'; strcat((char *) sptr, (char *) buf);
+            p = buf; blen = 0;
+            len += STRMAX;
+            str = newstr;
+        }
+
+        /* store the character */
+        *p++ = ch; ++blen;
+    }
+
+    /* append the last substring */
+    if (str == NIL || blen) {
+        newstr = new_string(len + blen + 1);
+        sptr = getstring(newstr); *sptr = '\0';
+        if (str) strcat((char *) sptr, (char *) getstring(str));
+        *p = '\0'; strcat((char *) sptr, (char *) buf);
+        str = newstr;
+    }
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the new string */
+    return (consa(str));
+}
+
+/* rmbquote - read macro for '`' */
+LVAL rmbquote(void)
+{
+    LVAL fptr,mch;
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* parse the quoted expression */
+    return (consa(pquote(fptr,s_bquote)));
+}
+
+/* rmcomma - read macro for ',' */
+LVAL rmcomma(void)
+{
+    LVAL fptr,mch,sym;
+    int ch;
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* check the next character */
+    if ((ch = xlgetc(fptr)) == '@')
+        sym = s_comat;
+    else {
+        xlungetc(fptr,ch);
+        sym = s_comma;
+    }
+
+    /* make the return value */
+    return (consa(pquote(fptr,sym)));
+}
+
+/* rmlpar - read macro for '(' */
+LVAL rmlpar(void)
+{
+    LVAL fptr,mch;
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* make the return value */
+    return (consa(plist(fptr)));
+}
+
+/* 4035 is the "no return value" warning message */
+/* rmrpar, pcomment, badeof, and upcase don't return anything */
+/* #pragma warning(disable: 4035) */
+
+/* rmrpar - read macro for ')' */
+LVAL rmrpar(void)
+{
+    xlfail("misplaced right paren");
+    return NULL; /* never used */
+}
+
+/* rmsemi - read macro for ';' */
+LVAL rmsemi(void)
+{
+    LVAL fptr,mch;
+    int ch;
+
+    /* get the file and macro character */
+    fptr = xlgetfile();
+    mch = xlgachar();
+    xllastarg();
+
+    /* skip to end of line */
+    while ((ch = xlgetc(fptr)) != EOF && ch != '\n')
+        ;
+
+    /* return nil (nothing read) */
+    return (NIL);
+}
+
+/* pcomment - parse a comment delimited by #| and |# */
+LOCAL void pcomment(LVAL fptr)
+{
+    int lastch,ch,n;
+
+    /* look for the matching delimiter (and handle nesting) */
+    for (n = 1, lastch = -1; n > 0 && (ch = xlgetc(fptr)) != EOF; ) {
+        if (lastch == '|' && ch == '#')
+            { --n; ch = -1; }
+        else if (lastch == '#' && ch == '|')
+            { ++n; ch = -1; }
+        lastch = ch;
+    }
+}
+
+/* pnumber - parse a number */
+LOCAL LVAL pnumber(LVAL fptr, int radix)
+{
+    int digit,ch;
+    long num;
+    
+    for (num = 0L; (ch = xlgetc(fptr)) != EOF; ) {
+        if (islower(ch)) ch = toupper(ch);
+        if (!('0' <= ch && ch <= '9') && !('A' <= ch && ch <= 'F'))
+            break;
+        if ((digit = (ch <= '9' ? ch - '0' : ch - 'A' + 10)) >= radix)
+            break;
+        num = num * (long)radix + (long)digit;
+    }
+    xlungetc(fptr,ch);
+    return (cvfixnum((FIXTYPE)num));
+}
+
+/* plist - parse a list */
+LOCAL LVAL plist(LVAL fptr)
+{
+    LVAL val,expr,lastnptr,nptr;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(val);
+    xlsave(expr);
+
+    /* keep appending nodes until a closing paren is found */
+    for (lastnptr = NIL; nextch(fptr) != ')'; )
+
+        /* get the next expression */
+        switch (readone(fptr,&expr)) {
+        case EOF:
+            badeof(fptr);
+        case TRUE:
+
+            /* check for a dotted tail */
+            if (expr == s_dot) {
+                /* make sure there's a node */
+                if (lastnptr == NIL)
+                    xlfail("invalid dotted pair");
+
+                /* parse the expression after the dot */
+                if (!xlread(fptr,&expr,TRUE))
+                    badeof(fptr);
+                rplacd(lastnptr,expr);
+
+                /* make sure its followed by a close paren */
+                if (nextch(fptr) != ')')
+                    xlfail("invalid dotted pair");
+            }
+
+            /* otherwise, handle a normal list element */
+            else {
+                nptr = consa(expr);
+                if (lastnptr == NIL)
+                    val = nptr;
+                else
+                    rplacd(lastnptr,nptr);
+                lastnptr = nptr;
+            }
+            break;
+        }
+
+    /* skip the closing paren */
+    xlgetc(fptr);
+
+    /* restore the stack */
+    xlpopn(2);
+
+    /* return successfully */
+    return (val);
+}
+
+/* pvector - parse a vector */
+LOCAL LVAL pvector(LVAL fptr)
+{
+    LVAL list,expr,val,lastnptr,nptr;
+    int len,ch,i;
+
+    /* protect some pointers */
+    xlstkcheck(2);
+    xlsave(list);
+    xlsave(expr);
+
+    /* keep appending nodes until a closing paren is found */
+    for (lastnptr = NIL, len = 0; (ch = nextch(fptr)) != ')'; ) {
+
+        /* check for end of file */
+        if (ch == EOF)
+            badeof(fptr);
+
+        /* get the next expression */
+        switch (readone(fptr,&expr)) {
+        case EOF:
+            badeof(fptr);
+        case TRUE:
+            nptr = consa(expr);
+            if (lastnptr == NIL)
+                list = nptr;
+            else
+                rplacd(lastnptr,nptr);
+            lastnptr = nptr;
+            len++;
+            break;
+        }
+    }
+
+    /* skip the closing paren */
+    xlgetc(fptr);
+
+    /* make a vector of the appropriate length */
+    val = newvector(len);
+
+    /* copy the list into the vector */
+    for (i = 0; i < len; ++i, list = cdr(list))
+        setelement(val,i,car(list));
+
+    /* restore the stack */
+    xlpopn(2);
+
+    /* return successfully */
+    return (val);
+}
+
+/* pquote - parse a quoted expression */
+LOCAL LVAL pquote(LVAL fptr, LVAL sym)
+{
+    LVAL val,p;
+
+    /* protect some pointers */
+    xlsave1(val);
+
+    /* allocate two nodes */
+    val = consa(sym);
+    rplacd(val,consa(NIL));
+
+    /* initialize the second to point to the quoted expression */
+    if (!xlread(fptr,&p,TRUE))
+        badeof(fptr);
+    rplaca(cdr(val),p);
+
+    /* restore the stack */
+    xlpop();
+
+    /* return the quoted expression */
+    return (val);
+}
+
+/* psymbol - parse a symbol name */
+LOCAL LVAL psymbol(LVAL fptr)
+{
+    int escflag;
+    LVAL val;
+    pname(fptr,&escflag);
+    return (escflag || !xlisnumber(buf,&val) ? xlenter(buf) : val);
+}
+
+/* punintern - parse an uninterned symbol */
+LOCAL LVAL punintern(LVAL fptr)
+{
+    int escflag;
+    pname(fptr,&escflag);
+    return (xlmakesym(buf));
+}
+
+/* pname - parse a symbol/package name */
+LOCAL int pname(LVAL fptr,int *pescflag)
+{
+    int mode,ch=0,i;
+    LVAL type;
+
+    /* initialize */
+    *pescflag = FALSE;
+    mode = NORMAL;
+    i = 0;
+
+    /* accumulate the symbol name */
+    while (mode != DONE) {
+
+        /* handle normal mode */
+        while (mode == NORMAL)
+            if ((ch = xlgetc(fptr)) == EOF)
+                mode = DONE;
+            else if ((type = tentry(ch)) == k_sescape) {
+                i = storech(buf,i,checkeof(fptr));
+                *pescflag = TRUE;
+            }
+            else if (type == k_mescape) {
+                *pescflag = TRUE;
+                mode = ESCAPE;
+            }
+            else if (type == k_const
+                 ||  (consp(type) && car(type) == k_nmacro))
+                i = storech(buf,i,islower(ch) ? toupper(ch) : ch);
+            else
+                mode = DONE;
+
+        /* handle multiple escape mode */
+        while (mode == ESCAPE)
+            if ((ch = xlgetc(fptr)) == EOF)
+                badeof(fptr);
+            else if ((type = tentry(ch)) == k_sescape)
+                i = storech(buf,i,checkeof(fptr));
+            else if (type == k_mescape)
+                mode = NORMAL;
+            else
+                i = storech(buf,i,ch);
+    }
+    buf[i] = 0;
+
+    /* check for a zero length name */
+    if (i == 0)
+        xlerror("zero length name", s_unbound);
+
+    /* unget the last character and return it */
+    xlungetc(fptr,ch);
+    return (ch);
+}
+
+/* storech - store a character in the print name buffer */
+LOCAL int storech(char *buf, int i, int ch)
+{
+    if (i < STRMAX)
+        buf[i++] = ch;
+    return (i);
+}
+
+/* tentry - get a readtable entry */
+LVAL tentry(int ch)
+{
+    LVAL rtable;
+    rtable = getvalue(s_rtable);
+    if (!vectorp(rtable) || ch < 0 || ch >= getsize(rtable))
+        return (NIL);
+    return (getelement(rtable,ch));
+}
+
+/* nextch - look at the next non-blank character */
+LOCAL int nextch(LVAL fptr)
+{
+    int ch;
+
+    /* return and save the next non-blank character */
+    while ((ch = xlgetc(fptr)) != EOF && isspace(ch))
+        ;
+    xlungetc(fptr,ch);
+    return (ch);
+}
+
+/* checkeof - get a character and check for end of file */
+LOCAL int checkeof(LVAL fptr)
+{
+    int ch;
+
+    if ((ch = xlgetc(fptr)) == EOF)
+        badeof(fptr);
+    return (ch);
+}
+
+/* badeof - unexpected eof */
+LOCAL void badeof(LVAL fptr)
+{
+    xlgetc(fptr);
+    xlfail("unexpected EOF");
+}
+
+/* xlisnumber - check if this string is a number */
+int xlisnumber(char *str, LVAL *pval)
+{
+    int dl,dr;
+    char *p;
+
+    /* initialize */
+    p = str; dl = dr = 0;
+
+    /* check for a sign */
+    if (*p == '+' || *p == '-')
+        p++;
+
+    /* check for a string of digits */
+    while (isdigit(*p))
+        p++, dl++;
+
+    /* check for a decimal point */
+    if (*p == '.') {
+        p++;
+        while (isdigit(*p))
+            p++, dr++;
+    }
+
+    /* check for an exponent */
+    if ((dl || dr) && *p == 'E') {
+        p++;
+
+        /* check for a sign */
+        if (*p == '+' || *p == '-')
+            p++;
+
+        /* check for a string of digits */
+        while (isdigit(*p))
+            p++, dr++;
+    }
+
+    /* make sure there was at least one digit and this is the end */
+    if ((dl == 0 && dr == 0) || *p)
+        return (FALSE);
+
+    /* convert the string to an integer and return successfully */
+    if (pval) {
+        if (*str == '+') ++str;
+        if (str[strlen(str)-1] == '.') str[strlen(str)-1] = 0;
+        *pval = (dr ? cvflonum(atof(str)) : cvfixnum(ICNV(str)));
+    }
+    return (TRUE);
+}
+
+/* defmacro - define a read macro */
+void defmacro(int ch, LVAL type, int offset)
+{
+    extern FUNDEF funtab[];
+    LVAL subr;
+    subr = cvsubr(funtab[offset].fd_subr,funtab[offset].fd_type,offset);
+    setelement(getvalue(s_rtable),ch,cons(type,subr));
+}
+
+/* callmacro - call a read macro */
+LVAL callmacro(LVAL fptr, int ch)
+{
+    LVAL *newfp;
+
+    /* create the new call frame */
+    newfp = xlsp;
+    pusharg(cvfixnum((FIXTYPE)(newfp - xlfp)));
+    pusharg(cdr(getelement(getvalue(s_rtable),ch)));
+    pusharg(cvfixnum((FIXTYPE)2));
+    pusharg(fptr);
+    pusharg(cvchar(ch));
+    xlfp = newfp;
+    return (xlapply(2));
+}
+
+/* upcase - translate a string to upper case */
+LOCAL void upcase(char *str)
+{
+    for (; *str != '\0'; ++str)
+        if (islower(*str))
+            *str = toupper(*str);
+}
+
+/* xlrinit - initialize the reader */
+void xlrinit(void)
+{
+    LVAL rtable;
+    char *p;
+    int ch;
+
+    /* create the read table */
+    rtable = newvector(256);
+    setvalue(s_rtable,rtable);
+
+    /* initialize the readtable */
+    for (p = WSPACE; (ch = *p++); )
+        setelement(rtable,ch,k_wspace);
+    for (p = CONST1; (ch = *p++); )
+        setelement(rtable,ch,k_const);
+    for (p = CONST2; (ch = *p++); )
+        setelement(rtable,ch,k_const);
+
+    /* setup the escape characters */
+    setelement(rtable,'\\',k_sescape);
+    setelement(rtable,'|', k_mescape);
+
+    /* install the read macros */
+    defmacro('#', k_nmacro,FT_RMHASH);
+    defmacro('\'',k_tmacro,FT_RMQUOTE);
+    defmacro('"', k_tmacro,FT_RMDQUOTE);
+    defmacro('`', k_tmacro,FT_RMBQUOTE);
+    defmacro(',', k_tmacro,FT_RMCOMMA);
+    defmacro('(', k_tmacro,FT_RMLPAR);
+    defmacro(')', k_tmacro,FT_RMRPAR);
+    defmacro(';', k_tmacro,FT_RMSEMI);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlstr.c b/lib-src/libnyquist/nyquist/xlisp/xlstr.c
new file mode 100644
index 0000000..fe51234
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlstr.c
@@ -0,0 +1,561 @@
+/* xlstr - xlisp string and character built-in functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+#include "string.h"
+#include "xlisp.h"
+
+/* local definitions */
+#define fix(n)	cvfixnum((FIXTYPE)(n))
+#define TLEFT	1
+#define TRIGHT	2
+
+/* external variables */
+extern LVAL k_start,k_end,k_1start,k_1end,k_2start,k_2end;
+extern LVAL s_true;
+extern char buf[];
+
+/* forward declarations */
+FORWARD LOCAL LVAL strcompare(int fcn, int icase);
+FORWARD LOCAL LVAL chrcompare(int fcn, int icase);
+FORWARD LOCAL LVAL changecase(int fcn, int destructive);
+FORWARD LOCAL LVAL trim(int fcn);
+FORWARD LOCAL void getbounds(LVAL str, LVAL skey, LVAL ekey, int *pstart, int *pend);
+FORWARD LOCAL int inbag(int ch, LVAL bag);
+
+/* string comparision functions */
+LVAL xstrlss(void) { return (strcompare('<',FALSE)); } /* string< */
+LVAL xstrleq(void) { return (strcompare('L',FALSE)); } /* string<= */
+LVAL xstreql(void) { return (strcompare('=',FALSE)); } /* string= */
+LVAL xstrneq(void) { return (strcompare('#',FALSE)); } /* string/= */
+LVAL xstrgeq(void) { return (strcompare('G',FALSE)); } /* string>= */
+LVAL xstrgtr(void) { return (strcompare('>',FALSE)); } /* string> */
+
+/* string comparison functions (not case sensitive) */
+LVAL xstrilss(void) { return (strcompare('<',TRUE)); } /* string-lessp */
+LVAL xstrileq(void) { return (strcompare('L',TRUE)); } /* string-not-greaterp */
+LVAL xstrieql(void) { return (strcompare('=',TRUE)); } /* string-equal */
+LVAL xstrineq(void) { return (strcompare('#',TRUE)); } /* string-not-equal */
+LVAL xstrigeq(void) { return (strcompare('G',TRUE)); } /* string-not-lessp */
+LVAL xstrigtr(void) { return (strcompare('>',TRUE)); } /* string-greaterp */
+
+/* strcompare - compare strings */
+LOCAL LVAL strcompare(int fcn, int icase)
+{
+    int start1,end1,start2,end2,ch1,ch2;
+    unsigned char *p1,*p2;
+    LVAL str1,str2;
+
+    /* get the strings */
+    str1 = xlgastring();
+    str2 = xlgastring();
+
+    /* get the substring specifiers */
+    getbounds(str1,k_1start,k_1end,&start1,&end1);
+    getbounds(str2,k_2start,k_2end,&start2,&end2);
+
+    /* setup the string pointers */
+    p1 = &getstring(str1)[start1];
+    p2 = &getstring(str2)[start2];
+
+    /* compare the strings */
+    for (; start1 < end1 && start2 < end2; ++start1,++start2) {
+        ch1 = *p1++;
+        ch2 = *p2++;
+        if (icase) {
+            if (isupper(ch1)) ch1 = tolower(ch1);
+            if (isupper(ch2)) ch2 = tolower(ch2);
+        }
+        if (ch1 != ch2)
+            switch (fcn) {
+            case '<':	return (ch1 < ch2 ? fix(start1) : NIL);
+            case 'L':	return (ch1 <= ch2 ? fix(start1) : NIL);
+            case '=':	return (NIL);
+            case '#':	return (fix(start1));
+            case 'G':	return (ch1 >= ch2 ? fix(start1) : NIL);
+            case '>':	return (ch1 > ch2 ? fix(start1) : NIL);
+            }
+    }
+
+    /* check the termination condition */
+    switch (fcn) {
+    case '<':	return (start1 >= end1 && start2 < end2 ? fix(start1) : NIL);
+    case 'L':	return (start1 >= end1 ? fix(start1) : NIL);
+    case '=':	return (start1 >= end1 && start2 >= end2 ? s_true : NIL);
+    case '#':	return (start1 >= end1 && start2 >= end2 ? NIL : fix(start1));
+    case 'G':	return (start2 >= end2 ? fix(start1) : NIL);
+    case '>':	return (start2 >= end2 && start1 < end1 ? fix(start1) : NIL);
+    }
+
+    return NIL; /* Normally shouldn't happen */
+}
+
+/* case conversion functions */
+LVAL xupcase(void)   { return (changecase('U',FALSE)); }
+LVAL xdowncase(void) { return (changecase('D',FALSE)); }
+
+/* destructive case conversion functions */
+LVAL xnupcase(void)   { return (changecase('U',TRUE)); }
+LVAL xndowncase(void) { return (changecase('D',TRUE)); }
+
+/* changecase - change case */
+LOCAL LVAL changecase(int fcn, int destructive)
+{
+    unsigned char *srcp,*dstp;
+    int start,end,len,ch,i;
+    LVAL src,dst;
+
+    /* get the string */
+    src = xlgastring();
+
+    /* get the substring specifiers */
+    getbounds(src,k_start,k_end,&start,&end);
+    len = getslength(src) - 1;
+
+    /* make a destination string */
+    dst = (destructive ? src : new_string(len+1));
+
+    /* setup the string pointers */
+    srcp = getstring(src);
+    dstp = getstring(dst);
+
+    /* copy the source to the destination */
+    for (i = 0; i < len; ++i) {
+        ch = *srcp++;
+        if (i >= start && i < end)
+            switch (fcn) {
+            case 'U':	if (islower(ch)) ch = toupper(ch); break;
+            case 'D':	if (isupper(ch)) ch = tolower(ch); break;
+            }
+        *dstp++ = ch;
+    }
+    *dstp = '\0';
+
+    /* return the new string */
+    return (dst);
+}
+
+/* search for string within a string */
+LVAL xstrsearch(void)
+{
+    int start,end,pat_len,str_len;
+    unsigned char *pat,*str,*patptr,*strptr,*patend;
+    LVAL str1,str2;
+
+    /* get the strings */
+    str1 = xlgastring(); /* the pat */
+    str2 = xlgastring(); /* the string */
+
+    /* get the substring specifiers */
+    getbounds(str2, k_start, k_end, &start, &end);    
+
+    /* setup the string pointers */
+    pat = getstring(str1);
+    str = &getstring(str2)[start];
+
+    pat_len = getslength(str1) - 1;
+    str_len = end - start;
+    patend = pat + pat_len;
+    for (; pat_len <= str_len; str_len--) {
+        patptr = pat;
+        strptr = str;
+        /* two outcomes: (1) no match, goto step (2) match, return */
+        while (patptr < patend) {
+            if (*patptr++ != *strptr++) goto step;
+        }
+        /* compute match index */
+        return cvfixnum(str - getstring(str2));
+    step:
+        str++;
+    }
+    /* no match */
+    return NIL;
+}
+    
+
+/* trim functions */
+LVAL xtrim(void)      { return (trim(TLEFT|TRIGHT)); }
+LVAL xlefttrim(void)  { return (trim(TLEFT)); }
+LVAL xrighttrim(void) { return (trim(TRIGHT)); }
+
+/* trim - trim character from a string */
+LOCAL LVAL trim(int fcn)
+{
+    unsigned char *leftp,*rightp,*dstp;
+    LVAL bag,src,dst;
+
+    /* get the bag and the string */
+    bag = xlgastring();
+    src = xlgastring();
+    xllastarg();
+
+    /* setup the string pointers */
+    leftp = getstring(src);
+    rightp = leftp + getslength(src) - 2;
+
+    /* trim leading characters */
+    if (fcn & TLEFT)
+        while (leftp <= rightp && inbag(*leftp,bag))
+            ++leftp;
+
+    /* trim character from the right */
+    if (fcn & TRIGHT)
+        while (rightp >= leftp && inbag(*rightp,bag))
+            --rightp;
+
+    /* make a destination string and setup the pointer */
+    dst = new_string((int)(rightp-leftp+2));
+    dstp = getstring(dst);
+
+    /* copy the source to the destination */
+    while (leftp <= rightp)
+        *dstp++ = *leftp++;
+    *dstp = '\0';
+
+    /* return the new string */
+    return (dst);
+}
+
+/* getbounds - get the start and end bounds of a string */
+LOCAL void getbounds(LVAL str, LVAL skey, LVAL ekey, int *pstart, int *pend)
+{
+    LVAL arg;
+    int len;
+
+    /* get the length of the string */
+    len = getslength(str) - 1;
+
+    /* get the starting index */
+    if (xlgkfixnum(skey,&arg)) {
+        *pstart = (int)getfixnum(arg);
+        if (*pstart < 0 || *pstart > len)
+            xlerror("string index out of bounds",arg);
+    }
+    else
+        *pstart = 0;
+
+    /* get the ending index */
+    if (xlgkfixnum(ekey,&arg)) {
+        *pend = (int)getfixnum(arg);
+        if (*pend < 0 || *pend > len)
+            xlerror("string index out of bounds",arg);
+    }
+    else
+        *pend = len;
+
+    /* make sure the start is less than or equal to the end */
+    if (*pstart > *pend)
+        xlerror("starting index error",cvfixnum((FIXTYPE)*pstart));
+}
+
+/* inbag - test if a character is in a bag */
+LOCAL int inbag(int ch, LVAL bag)
+{
+    unsigned char *p;
+    for (p = getstring(bag); *p != '\0'; ++p)
+        if (*p == ch)
+            return (TRUE);
+    return (FALSE);
+}
+
+/* xstrcat - concatenate a bunch of strings */
+LVAL xstrcat(void)
+{
+    LVAL *saveargv,tmp,val;
+    unsigned char *str;
+    int saveargc,len;
+
+    /* save the argument list */
+    saveargv = xlargv;
+    saveargc = xlargc;
+
+    /* find the length of the new string */
+    for (len = 0; moreargs(); ) {
+        tmp = xlgastring();
+        len += (int)getslength(tmp) - 1;
+    }
+
+    /* create the result string */
+    val = new_string(len+1);
+    str = getstring(val);
+
+    /* restore the argument list */
+    xlargv = saveargv;
+    xlargc = saveargc;
+    
+    /* combine the strings */
+    for (*str = '\0'; moreargs(); ) {
+        tmp = nextarg();
+        strcat((char *) str, (char *) getstring(tmp));
+    }
+
+    /* return the new string */
+    return (val);
+}
+
+/* xsubseq - return a subsequence */
+LVAL xsubseq(void)
+{
+    unsigned char *srcp,*dstp;
+    int start,end,len;
+    LVAL src,dst;
+
+    /* get string and starting and ending positions */
+    src = xlgastring();
+
+    /* get the starting position */
+    dst = xlgafixnum(); start = (int)getfixnum(dst);
+    if (start < 0 || start > getslength(src) - 1)
+        xlerror("string index out of bounds",dst);
+
+    /* get the ending position */
+    if (moreargs()) {
+        dst = xlgafixnum(); end = (int)getfixnum(dst);
+        if (end < 0 || end > getslength(src) - 1)
+            xlerror("string index out of bounds",dst);
+    }
+    else
+        end = getslength(src) - 1;
+    xllastarg();
+
+    /* setup the source pointer */
+    srcp = getstring(src) + start;
+    len = end - start;
+
+    /* make a destination string and setup the pointer */
+    dst = new_string(len+1);
+    dstp = getstring(dst);
+
+    /* copy the source to the destination */
+    while (--len >= 0)
+        *dstp++ = *srcp++;
+    *dstp = '\0';
+
+    /* return the substring */
+    return (dst);
+}
+
+/* xstring - return a string consisting of a single character */
+LVAL xstring(void)
+{
+    LVAL arg;
+
+    /* get the argument */
+    arg = xlgetarg();
+    xllastarg();
+
+    /* make sure its not NIL */
+    if (null(arg))
+        xlbadtype(arg);
+
+    /* check the argument type */
+    switch (ntype(arg)) {
+    case STRING:
+        return (arg);
+    case SYMBOL:
+        return (getpname(arg));
+    case CHAR:
+        buf[0] = (int)getchcode(arg);
+        buf[1] = '\0';
+        return (cvstring(buf));
+    case FIXNUM:
+        buf[0] = getfixnum(arg);
+        buf[1] = '\0';
+        return (cvstring(buf));
+    default:
+        xlbadtype(arg);
+        return NIL; /* never happens */
+    }
+}
+
+/* xchar - extract a character from a string */
+LVAL xchar(void)
+{
+    LVAL str,num;
+    int n;
+
+    /* get the string and the index */
+    str = xlgastring();
+    num = xlgafixnum();
+    xllastarg();
+
+    /* range check the index */
+    if ((n = (int)getfixnum(num)) < 0 || n >= getslength(str) - 1)
+        xlerror("index out of range",num);
+
+    /* return the character */
+    return (cvchar(getstring(str)[n]));
+}
+
+/* xcharint - convert an integer to a character */
+LVAL xcharint(void)
+{
+    LVAL arg;
+    arg = xlgachar();
+    xllastarg();
+    return (cvfixnum((FIXTYPE)getchcode(arg)));
+}
+
+/* xintchar - convert a character to an integer */
+LVAL xintchar(void)
+{
+    LVAL arg;
+    arg = xlgafixnum();
+    xllastarg();
+    return (cvchar((int)getfixnum(arg)));
+}
+
+/* xuppercasep - built-in function 'upper-case-p' */
+LVAL xuppercasep(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (isupper(ch) ? s_true : NIL);
+}
+
+/* xlowercasep - built-in function 'lower-case-p' */
+LVAL xlowercasep(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (islower(ch) ? s_true : NIL);
+}
+
+/* xbothcasep - built-in function 'both-case-p' */
+LVAL xbothcasep(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (isupper(ch) || islower(ch) ? s_true : NIL);
+}
+
+/* xdigitp - built-in function 'digit-char-p' */
+LVAL xdigitp(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (isdigit(ch) ? cvfixnum((FIXTYPE)(ch - '0')) : NIL);
+}
+
+/* xcharcode - built-in function 'char-code' */
+LVAL xcharcode(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (cvfixnum((FIXTYPE)ch));
+}
+
+/* xcodechar - built-in function 'code-char' */
+LVAL xcodechar(void)
+{
+    LVAL arg;
+    int ch;
+    arg = xlgafixnum(); ch = getfixnum(arg);
+    xllastarg();
+    return (ch >= 0 && ch <= 127 ? cvchar(ch) : NIL);
+}
+
+/* xchupcase - built-in function 'char-upcase' */
+LVAL xchupcase(void)
+{
+    LVAL arg;
+    int ch;
+    arg = xlgachar(); ch = getchcode(arg);
+    xllastarg();
+    return (islower(ch) ? cvchar(toupper(ch)) : arg);
+}
+
+/* xchdowncase - built-in function 'char-downcase' */
+LVAL xchdowncase(void)
+{
+    LVAL arg;
+    int ch;
+    arg = xlgachar(); ch = getchcode(arg);
+    xllastarg();
+    return (isupper(ch) ? cvchar(tolower(ch)) : arg);
+}
+
+/* xdigitchar - built-in function 'digit-char' */
+LVAL xdigitchar(void)
+{
+    LVAL arg;
+    int n;
+    arg = xlgafixnum(); n = getfixnum(arg);
+    xllastarg();
+    return (n >= 0 && n <= 9 ? cvchar(n + '0') : NIL);
+}
+
+/* xalphanumericp - built-in function 'alphanumericp' */
+LVAL xalphanumericp(void)
+{
+    int ch;
+    ch = getchcode(xlgachar());
+    xllastarg();
+    return (isupper(ch) || islower(ch) || isdigit(ch) ? s_true : NIL);
+}
+
+/* character comparision functions */
+LVAL xchrlss(void) { return (chrcompare('<',FALSE)); } /* char< */
+LVAL xchrleq(void) { return (chrcompare('L',FALSE)); } /* char<= */
+LVAL xchreql(void) { return (chrcompare('=',FALSE)); } /* char= */
+LVAL xchrneq(void) { return (chrcompare('#',FALSE)); } /* char/= */
+LVAL xchrgeq(void) { return (chrcompare('G',FALSE)); } /* char>= */
+LVAL xchrgtr(void) { return (chrcompare('>',FALSE)); } /* char> */
+
+/* character comparision functions (case insensitive) */
+LVAL xchrilss(void) { return (chrcompare('<',TRUE)); } /* char-lessp */
+LVAL xchrileq(void) { return (chrcompare('L',TRUE)); } /* char-not-greaterp */
+LVAL xchrieql(void) { return (chrcompare('=',TRUE)); } /* char-equal */
+LVAL xchrineq(void) { return (chrcompare('#',TRUE)); } /* char-not-equal */
+LVAL xchrigeq(void) { return (chrcompare('G',TRUE)); } /* char-not-lessp */
+LVAL xchrigtr(void) { return (chrcompare('>',TRUE)); } /* char-greaterp */
+
+/* chrcompare - compare characters */
+LOCAL LVAL chrcompare(int fcn, int icase)
+{
+    int ch1,ch2,icmp;
+    LVAL arg;
+    
+    /* get the characters */
+    arg = xlgachar(); ch1 = getchcode(arg);
+
+    /* convert to lowercase if case insensitive */
+    if (icase && isupper(ch1))
+        ch1 = tolower(ch1);
+
+    /* handle each remaining argument */
+    for (icmp = TRUE; icmp && moreargs(); ch1 = ch2) {
+
+        /* get the next argument */
+        arg = xlgachar(); ch2 = getchcode(arg);
+
+        /* convert to lowercase if case insensitive */
+        if (icase && isupper(ch2))
+            ch2 = tolower(ch2);
+
+        /* compare the characters */
+        switch (fcn) {
+        case '<':	icmp = (ch1 < ch2); break;
+        case 'L':	icmp = (ch1 <= ch2); break;
+        case '=':	icmp = (ch1 == ch2); break;
+        case '#':	icmp = (ch1 != ch2); break;
+        case 'G':	icmp = (ch1 >= ch2); break;
+        case '>':	icmp = (ch1 > ch2); break;
+        }
+    }
+
+    /* return the result */
+    return (icmp ? s_true : NIL);
+}
+
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlsubr.c b/lib-src/libnyquist/nyquist/xlisp/xlsubr.c
new file mode 100644
index 0000000..cc729ef
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlsubr.c
@@ -0,0 +1,192 @@
+/* xlsubr - xlisp builtin function support routines */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* CHANGE LOG
+ * --------------------------------------------------------------------
+ * 28Apr03  dm  eliminate some compiler warnings
+ */
+
+#include "string.h"
+#include "xlisp.h"
+
+/* external variables */
+extern LVAL k_test,k_tnot,s_eql;
+
+/* xlsubr - define a builtin function */
+LVAL xlsubr(char *sname, int type, LVAL (*fcn)(void), int offset)
+{
+    LVAL sym;
+    sym = xlenter(sname);
+    setfunction(sym,cvsubr(fcn,type,offset));
+    return (sym);
+}
+
+/* xlgetkeyarg - get a keyword argument */
+int xlgetkeyarg(LVAL key, LVAL *pval)
+{
+    LVAL *argv=xlargv;
+    int argc=xlargc;
+    for (argv = xlargv, argc = xlargc; (argc -= 2) >= 0; argv += 2) {
+        if (*argv == key) {
+            *pval = *++argv;
+            return (TRUE);
+        }
+    }
+    return (FALSE);
+}
+
+/* xlgkfixnum - get a fixnum keyword argument */
+int xlgkfixnum(LVAL key, LVAL *pval)
+{
+    if (xlgetkeyarg(key,pval)) {
+        if (!fixp(*pval))
+            xlbadtype(*pval);
+        return (TRUE);
+    }
+    return (FALSE);
+}
+
+/* xltest - get the :test or :test-not keyword argument */
+void xltest(LVAL *pfcn, int *ptresult)
+{
+    if (xlgetkeyarg(k_test,pfcn))	/* :test */
+        *ptresult = TRUE;
+    else if (xlgetkeyarg(k_tnot,pfcn))	/* :test-not */
+        *ptresult = FALSE;
+    else {
+        *pfcn = getfunction(s_eql);
+        *ptresult = TRUE;
+    }
+}
+
+/* xlgetfile - get a file or stream */
+LVAL xlgetfile(void)
+{
+    LVAL arg;
+
+    /* get a file or stream (cons) or nil */
+    if ((arg = xlgetarg())) {
+        if (streamp(arg)) {
+            if (getfile(arg) == NULL)
+                xlfail("file not open");
+        }
+        else if (!ustreamp(arg))
+            xlerror("bad argument type",arg);
+    }
+    return (arg);
+}
+
+/* xlgetfname - get a filename */
+LVAL xlgetfname(void)
+{
+    LVAL name;
+
+    /* get the next argument */
+    name = xlgetarg();
+
+    /* get the filename string */
+    if (symbolp(name))
+        name = getpname(name);
+    else if (!stringp(name))
+        xlerror("bad argument type",name);
+
+    /* return the name */
+    return (name);
+}
+
+/* needsextension - check if a filename needs an extension */
+int needsextension(char *name)
+{
+    char *p;
+
+    /* check for an extension */
+    for (p = &name[strlen(name)]; --p >= &name[0]; )
+        if (*p == '.')
+            return (FALSE);
+        else if (!islower(*p) && !isupper(*p) && !isdigit(*p))
+            return (TRUE);
+
+    /* no extension found */
+    return (TRUE);
+}
+
+/* the next three functions must be declared as LVAL because they
+ * are used in LVAL expressions, but they do not return anything
+ * warning 4035 is "no return value"
+ */
+/* #pragma warning(disable: 4035) */
+
+/* xlbadtype - report a "bad argument type" error */
+LVAL xlbadtype(LVAL arg)
+{
+    xlerror("bad argument type",arg);
+    return NIL; /* never happens */
+}
+
+/* xltoofew - report a "too few arguments" error */
+LVAL xltoofew(void)
+{
+    xlfail("too few arguments");
+    return NIL; /* never happens */
+}
+
+/* xltoomany - report a "too many arguments" error */
+LVAL xltoomany(void)
+{
+    xlfail("too many arguments");
+    return NIL; /* never happens */
+}
+
+/* eq - internal eq function */
+int eq(LVAL arg1, LVAL arg2)
+{
+    return (arg1 == arg2);
+}
+
+/* eql - internal eql function */
+int eql(LVAL arg1, LVAL arg2)
+{
+    /* compare the arguments */
+    if (arg1 == arg2)
+        return (TRUE);
+    else if (arg1) {
+        switch (ntype(arg1)) {
+        case FIXNUM:
+            return (fixp(arg2) ? getfixnum(arg1)==getfixnum(arg2) : FALSE);
+        case FLONUM:
+            return (floatp(arg2) ? getflonum(arg1)==getflonum(arg2) : FALSE);
+        default:
+            return (FALSE);
+        }
+    }
+    else
+        return (FALSE);
+}
+
+/* lval_equal - internal equal function */
+int lval_equal(LVAL arg1, LVAL arg2)
+{
+    /* compare the arguments */
+    if (arg1 == arg2)
+        return (TRUE);
+    else if (arg1) {
+        switch (ntype(arg1)) {
+        case FIXNUM:
+            return (fixp(arg2) ? getfixnum(arg1)==getfixnum(arg2) : FALSE);
+        case FLONUM:
+            return (floatp(arg2) ? getflonum(arg1)==getflonum(arg2) : FALSE);
+        case STRING:
+            return (stringp(arg2) ? strcmp((char *) getstring(arg1),
+                                           (char *) getstring(arg2)) == 0 : FALSE);
+        case CONS:
+            return (consp(arg2) ? lval_equal(car(arg1),car(arg2))
+                               && lval_equal(cdr(arg1),cdr(arg2)) : FALSE);
+        default:
+            return (FALSE);
+        }
+    }
+    else
+        return (FALSE);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlsym.c b/lib-src/libnyquist/nyquist/xlisp/xlsym.c
new file mode 100644
index 0000000..8932377
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlsym.c
@@ -0,0 +1,370 @@
+/* xlsym - symbol handling routines */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* HISTORY
+ * 28-apr-03 DM  eliminate some compiler warnings
+ * 12-oct-90 RBD added xlatomcount to keep track of how many atoms there are.
+ *	(something I need for writing out score files).
+ */
+
+#include "string.h"
+#include "xlisp.h"
+
+extern int xlatomcount;
+
+/* forward declarations */
+FORWARD LVAL findprop(LVAL sym, LVAL prp);
+
+#ifdef FRAME_DEBUG
+/* these routines were used to debug a missing call to protect().
+ * The routines can check for a consistent set of frames.  Note
+ * that frames must be pushed on the stack declared here because
+ * XLisp keeps frame pointers as local variables in C routines.
+ * I deleted the calls to push_xlenv etc throughout the XLisp
+ * sources, but decided to leave the following code for possible
+ * future debugging. - RBD
+ */
+int envstack_top = 0;
+LVAL envstack[envstack_max];
+LVAL *fpstack[envstack_max];
+extern long cons_count;
+
+FORWARD LOCAL void test_one_env(LVAL environment, int i, char *s);
+
+void push_xlenv(void)
+{
+    char s[10];
+    /* sprintf(s, "<%d ", envstack_top);
+    stdputstr(s); */
+    if (envstack_top >= envstack_max) {
+            xlabort("envstack overflow");
+    } else {
+            fpstack[envstack_top] = xlfp;
+            envstack[envstack_top++] = xlenv;
+    }
+}
+
+
+void pop_xlenv(void)
+{
+    char s[10];
+    if (envstack_top <= 0) {
+            sprintf(s, ", %d! ", envstack_top);
+            stdputstr(s);
+            xlabort("envstack underflow!");
+    } else envstack_top--;
+    /* sprintf(s, "%d> ", envstack_top);
+    stdputstr(s); */
+}
+
+
+void pop_multiple_xlenv(void)
+{
+    int i;
+    for (i = envstack_top - 1; i >= 0; i--) {
+            if (envstack[i] == xlenv) {
+                char s[10];
+                envstack_top = i + 1;
+                /* sprintf(s, "%d] ", envstack_top);
+                stdputstr(s); */
+                return;
+            }
+    }
+}
+
+
+void testenv(char *s)
+{
+    int i;
+    
+    for (i = envstack_top - 1; i >= 0; i--) {
+        test_one_env(envstack[i], i, s);
+    }
+}
+
+LOCAL void report_exit(char *msg, int i)
+{
+    sprintf(buf, "env stack index: %d, cons_count %ld, Function: ", i, cons_count);
+    errputstr(buf);
+    stdprint(fpstack[i][1]);
+    xlabort(msg);
+}
+
+LOCAL void test_one_env(LVAL environment, int i, char *s)
+{
+    register LVAL fp,ep;
+    LVAL val;
+
+    /* check the environment list */
+    for (fp = environment; fp; fp = cdr(fp)) {
+            /* check that xlenv is good */
+            if (!consp(fp)) {
+                sprintf(buf,"%s: xlenv 0x%lx, frame 0x%lx, type(frame) %d\n",
+                        s, xlenv, fp, ntype(fp));
+            errputstr(buf);
+            report_exit("xlenv points to a bad list", i);
+        }
+        
+        /* check for an instance variable */
+        if ((ep = car(fp)) && objectp(car(ep))) {
+            /* do nothing */
+        }
+
+        /* check an environment stack frame */
+        else {
+            for (; ep; ep = cdr(ep)) {
+                    /* check that ep is good */
+                    if (!consp(ep)) {
+                         sprintf(buf,"%s: fp 0x%lx, ep 0x%lx, type(ep) %d\n",
+                                s, fp, ep, ntype(ep));
+                    errputstr(buf);
+                    report_exit("car(fp) points to a bad list", i);
+                }
+                
+                    /* check that car(ep) is nonnull */
+                    if (!car(ep)) {
+                         sprintf(buf,"%s: ep 0x%lx, car(ep) 0x%lx\n",
+                                s, ep, car(ep));
+                    errputstr(buf);
+                    report_exit("car(ep) (an association) is NULL", i);
+                }
+                    /* check that car(ep) is a cons */
+                    if (!consp(car(ep))) {
+                         sprintf(buf,"%s: ep 0x%lx, car(ep) 0x%lx, type(car(ep)) %d\n",
+                                s, ep, car(ep), ntype(car(ep)));
+                    errputstr(buf);
+                    report_exit("car(ep) (an association) is not a cons", i);
+                }
+
+                    /* check that car(car(ep)) is a symbol */
+                    if (!symbolp(car(car(ep)))) {
+                         sprintf(buf,"%s: ep 0x%lx, car(ep) 0x%lx, car(car(ep)) 0x%lx, type(car(car(ep))) %d\n",
+                                s, ep, car(ep), car(car(ep)), ntype(car(car(ep))));
+                    errputstr(buf);
+                    report_exit("car(car(ep)) is not a symbol", i);
+                }
+            }
+        }
+    }
+}
+#endif
+
+
+/* xlenter - enter a symbol into the obarray */
+LVAL xlenter(char *name)
+{
+    LVAL sym,array;
+    int i;
+
+    /* check for nil */
+    if (strcmp(name,"NIL") == 0)
+        return (NIL);
+
+    /* check for symbol already in table */
+    array = getvalue(obarray);
+    i = hash(name,HSIZE);
+    for (sym = getelement(array,i); sym; sym = cdr(sym))
+        if (strcmp(name,(char *) getstring(getpname(car(sym)))) == 0)
+            return (car(sym));
+
+    /* make a new symbol node and link it into the list */
+    xlsave1(sym);
+    sym = consd(getelement(array,i));
+    rplaca(sym,xlmakesym(name));
+    setelement(array,i,sym);
+    xlpop();
+
+    /* return the new symbol */
+    return (car(sym));
+}
+
+/* xlmakesym - make a new symbol node */
+LVAL xlmakesym(char *name)
+{
+    LVAL sym;
+    sym = cvsymbol(name);
+    if (*name == ':')
+        setvalue(sym,sym);
+    return (sym);
+}
+
+/* xlgetvalue - get the value of a symbol (with check) */
+LVAL xlgetvalue(LVAL sym)
+{
+    LVAL val;
+
+    /* look for the value of the symbol */
+    while ((val = xlxgetvalue(sym)) == s_unbound)
+        xlunbound(sym);
+
+    /* return the value */
+    return (val);
+}
+
+/* xlxgetvalue - get the value of a symbol */
+LVAL xlxgetvalue(LVAL sym)
+{
+    register LVAL fp,ep;
+    LVAL val;
+
+    /* check the environment list */
+    for (fp = xlenv; fp; fp = cdr(fp))
+
+        /* check for an instance variable */
+        if ((ep = car(fp)) && objectp(car(ep))) {
+            if (xlobgetvalue(ep,sym,&val))
+                return (val);
+        }
+
+        /* check an environment stack frame */
+        else {
+            for (; ep; ep = cdr(ep))
+                if (sym == car(car(ep)))
+                    return (cdr(car(ep)));
+        }
+
+    /* return the global value */
+    return (getvalue(sym));
+}
+
+/* xlsetvalue - set the value of a symbol */
+void xlsetvalue(LVAL sym, LVAL val)
+{
+    register LVAL fp,ep;
+
+    /* look for the symbol in the environment list */
+    for (fp = xlenv; fp; fp = cdr(fp))
+
+        /* check for an instance variable */
+        if ((ep = car(fp)) && objectp(car(ep))) {
+            if (xlobsetvalue(ep,sym,val))
+                return;
+        }
+
+        /* check an environment stack frame */
+        else {
+            for (; ep; ep = cdr(ep))
+                if (sym == car(car(ep))) {
+                    rplacd(car(ep),val);
+                    return;
+                }
+        }
+
+    /* store the global value */
+    setvalue(sym,val);
+}
+
+/* xlgetfunction - get the functional value of a symbol (with check) */
+LVAL xlgetfunction(LVAL sym)
+{
+    LVAL val;
+
+    /* look for the functional value of the symbol */
+    while ((val = xlxgetfunction(sym)) == s_unbound)
+        xlfunbound(sym);
+
+    /* return the value */
+    return (val);
+}
+
+/* xlxgetfunction - get the functional value of a symbol */
+LVAL xlxgetfunction(LVAL sym)
+{
+    register LVAL fp,ep;
+
+    /* check the environment list */
+    for (fp = xlfenv; fp; fp = cdr(fp))
+        for (ep = car(fp); ep; ep = cdr(ep))
+            if (sym == car(car(ep)))
+                return (cdr(car(ep)));
+
+    /* return the global value */
+    return (getfunction(sym));
+}
+
+/* xlsetfunction - set the functional value of a symbol */
+void xlsetfunction(LVAL sym, LVAL val)
+{
+    register LVAL fp,ep;
+
+    /* look for the symbol in the environment list */
+    for (fp = xlfenv; fp; fp = cdr(fp))
+        for (ep = car(fp); ep; ep = cdr(ep))
+            if (sym == car(car(ep))) {
+                rplacd(car(ep),val);
+                return;
+            }
+
+    /* store the global value */
+    setfunction(sym,val);
+}
+
+/* xlgetprop - get the value of a property */
+LVAL xlgetprop(LVAL sym, LVAL prp)
+{
+    LVAL p;
+    return ((p = findprop(sym,prp)) ? car(p) : NIL);
+}
+
+/* xlputprop - put a property value onto the property list */
+void xlputprop(LVAL sym, LVAL val, LVAL prp)
+{
+    LVAL pair;
+    if ((pair = findprop(sym,prp)))
+        rplaca(pair,val);
+    else
+        setplist(sym,cons(prp,cons(val,getplist(sym))));
+}
+
+/* xlremprop - remove a property from a property list */
+void xlremprop(LVAL sym, LVAL prp)
+{
+    LVAL last,p;
+    last = NIL;
+    for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(last)) {
+        if (car(p) == prp) {
+            if (last)
+                rplacd(last,cdr(cdr(p)));
+            else
+                setplist(sym,cdr(cdr(p)));
+        }
+        last = cdr(p);
+    }
+}
+
+/* findprop - find a property pair */
+LVAL findprop(LVAL sym, LVAL prp)
+{
+    LVAL p;
+    for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(cdr(p)))
+        if (car(p) == prp)
+            return (cdr(p));
+    return (NIL);
+}
+
+/* hash - hash a symbol name string */
+int hash(char *str, int len)
+{
+    int i;
+    for (i = 0; *str; )
+        i = (i << 2) ^ *str++;
+    i %= len;
+    return (i < 0 ? -i : i);
+}
+
+/* xlsinit - symbol initialization routine */
+void xlsinit(void)
+{
+    LVAL array,p;
+
+    /* initialize the obarray */
+    obarray = xlmakesym("*OBARRAY*");
+    array = newvector(HSIZE);
+    setvalue(obarray,array);
+
+    /* add the symbol *OBARRAY* to the obarray */
+    p = consa(obarray);
+    setelement(array,hash("*OBARRAY*",HSIZE),p);
+}
diff --git a/lib-src/libnyquist/nyquist/xlisp/xlsys.c b/lib-src/libnyquist/nyquist/xlisp/xlsys.c
new file mode 100644
index 0000000..630a7b4
--- /dev/null
+++ b/lib-src/libnyquist/nyquist/xlisp/xlsys.c
@@ -0,0 +1,254 @@
+/* xlsys.c - xlisp builtin system functions */
+/*	Copyright (c) 1985, by David Michael Betz
+        All Rights Reserved
+        Permission is granted for unrestricted non-commercial use	*/
+
+/* HISTORY
+ *
+ * 28-Apr-03	Dominic Mazzoni
+ *  Eliminated some compiler warnings
+ *
+ * 25-Oct-87	Roger Dannenberg at NeXT
+ *  profiling code added: enable with (PROFILE t), disable with
+ *  (PROFILE nil).  While enabled, the profile code counts evals
+ *  within functions and macros.  The count is only for evals
+ *  directly within the form; i.e. only the count of the most
+ *  top-most function or macro form on the stack is incremented.
+ *  Also, counts are only maintained for named functions and macros
+ *  because the count itself is on the property list of the function
+ *  or macro name under the *PROFILE* property.  If a function or
+ *  macro is entered and the *PROFILE* does not exist, the property
+ *  is created with initial value 0, and the name is inserted at the
+ *  head of the list stored as the value of *PROFILE*.  Thus, *PROFILE*
+ *  will list the functions that were touched, and the *PROFILE* property
+ *  of each function gives some idea of how much time it consumed.
+ *  See the file profile.lsp for helpful profiling functions.
+ */
+
+#include "xlisp.h"
+
+/* profile variables */
+static int invisible_counter;
+int *profile_count_ptr = &invisible_counter;
+int profile_flag = FALSE;
+
+
+/* external variables */
+extern jmp_buf top_level;
+extern FILE *tfp;
+extern int xl_main_loop;
+
+/* external symbols */
+extern LVAL a_subr,a_fsubr,a_cons,a_symbol;
+extern LVAL a_fixnum,a_flonum,a_string,a_object,a_stream;
+extern LVAL a_vector,a_closure,a_char,a_ustream;
+extern LVAL k_verbose,k_print;
+extern LVAL s_true;
+
+/* external routines */
+extern FILE *osaopen();
+extern LVAL exttype();
+
+/* xload - read and evaluate expressions from a file */
+LVAL xload(void)
+{
+    unsigned char *name;
+    int vflag,pflag;
+    LVAL arg;
+
+    /* get the file name */
+    name = getstring(xlgetfname());
+
+    /* get the :verbose flag */
+    if (xlgetkeyarg(k_verbose,&arg))
+        vflag = (arg != NIL);
+    else
+        vflag = TRUE;
+
+    /* get the :print flag */
+    if (xlgetkeyarg(k_print,&arg))
+        pflag = (arg != NIL);
+    else
+        pflag = FALSE;
+
+    /* load the file */
+    return (xlload((char *) name, vflag, pflag) ? s_true : NIL);
+}
+
+/* xtranscript - open or close a transcript file */
+LVAL xtranscript(void)
+{
+    unsigned char *name;
+
+    /* get the transcript file name */
+    name = (moreargs() ? getstring(xlgetfname()) : NULL);
+    xllastarg();
+
+    /* close the current transcript */
+    if (tfp) osclose(tfp);
+
+    /* open the new transcript */
+    tfp = (name ? osaopen((char *) name,"w") : NULL);
+
+    /* return T if a transcript is open, NIL otherwise */
+    return (tfp ? s_true : NIL);
+}
+
+/* xtype - return type of a thing */
+LVAL xtype(void)
+{
+    LVAL arg;
+
+    if (!(arg = xlgetarg()))
+        return (NIL);
+
+    switch (ntype(arg)) {
+    case SUBR:		return (a_subr);
+    case FSUBR:		return (a_fsubr);
+    case CONS:		return (a_cons);
+    case SYMBOL:	return (a_symbol);
+    case FIXNUM:	return (a_fixnum);
+    case FLONUM:	return (a_flonum);
+    case STRING:	return (a_string);
+    case OBJECT:	return (a_object);
+    case STREAM:	return (a_stream);
+    case VECTOR:	return (a_vector);
+    case CLOSURE:	return (a_closure);
+    case CHAR:		return (a_char);
+    case USTREAM:	return (a_ustream);
+    case EXTERN:	return (exttype(arg));
+    default:		xlfail("bad node type");
+       return NIL; /* never happens */    
+    }
+}
+
+/* xbaktrace - print the trace back stack */
+LVAL xbaktrace(void)
+{
+    LVAL num;
+    int n;
+
+    if (moreargs()) {
+        num = xlgafixnum();
+        n = getfixnum(num);
+    }
+    else
+        n = -1;
+    xllastarg();
+    xlbaktrace(n);
+    return (NIL);
+}
+
+/* xquit - get out of read/eval/print loop */
+LVAL xquit()
+{
+    xllastarg();
+    xl_main_loop = FALSE;
+    return NIL;
+}
+
+
+/* xexit does not return anything, so turn off "no return value" warning" */
+/* #pragma warning(disable: 4035) */
+
+/* xexit - get out of xlisp */
+LVAL xexit(void)
+{
+    xllastarg();
+    xlisp_wrapup();
+    return NIL; /* never happens */
+}
+
+#ifdef PEEK_AND_POKE
+/* xpeek - peek at a location in memory */
+LVAL xpeek(void)
+{
+    LVAL num;
+    int *adr;
+
+    /* get the address */
+    num = xlgafixnum(); adr = (int *)getfixnum(num);
+    xllastarg();
+
+    /* return the value at that address */
+    return (cvfixnum((FIXTYPE)*adr));
+}
+
+/* xpoke - poke a value into memory */
+LVAL xpoke(void)
+{
+    LVAL val;
+    int *adr;
+
+    /* get the address and the new value */
+    val = xlgafixnum(); adr = (int *)getfixnum(val);
+    val = xlgafixnum();
+    xllastarg();
+
+    /* store the new value */
+    *adr = (int)getfixnum(val);
+
+    /* return the new value */
+    return (val);
+}
+
+/* xaddrs - get the address of an XLISP node */
+LVAL xaddrs(void)
+{
+    LVAL val;
+
+    /* get the node */
+    val = xlgetarg();
+    xllastarg();
+
+    /* return the address of the node */
+    return (cvfixnum((FIXTYPE)val));
+}
+#endif PEEK_AND_POKE
+
+/* xprofile - turn profiling on and off */
+LVAL xprofile()
+{
+    LVAL flag, result;
+
+    /* get the argument */
+    flag = xlgetarg();
+    xllastarg();
+
+    result = (profile_flag ? s_true : NIL);
+    profile_flag = !null(flag);
+    /* turn off profiling right away: */
+    if (!profile_flag) profile_count_ptr = &invisible_counter;
+    return result;
+}
+
+
+#ifdef DEBUG_INPUT
+FILE *debug_input_fp = NULL;
+
+FILE *to_input_buffer = NULL;
+FILE *read_by_xlisp = NULL;
+
+LVAL xstartrecordio()
+{
+	to_input_buffer = fopen("to-input-buffer.txt", "w");
+	read_by_xlisp = fopen("read-by-xlisp.txt", "w");
+	if (!to_input_buffer || !read_by_xlisp) {
+		return NIL;
+	}
+	return s_true;
+}
+
+
+LVAL xstoprecordio()
+{
+	if (to_input_buffer) fclose(to_input_buffer);
+	if (read_by_xlisp) fclose(read_by_xlisp);
+	to_input_buffer = NULL;
+	read_by_xlisp = NULL;
+	return NIL;
+}
+
+#endif
+
+
diff --git a/lib-src/libnyquist/nyx.c b/lib-src/libnyquist/nyx.c
new file mode 100644
index 0000000..35cd02a
--- /dev/null
+++ b/lib-src/libnyquist/nyx.c
@@ -0,0 +1,1409 @@
+/**********************************************************************
+
+  nyx.c
+
+  Nyx: A very simple external interface to Nyquist
+
+  Dominic Mazzoni
+
+**********************************************************************/
+
+/* system includes */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+#ifndef WIN32
+#include <unistd.h>
+#else
+#include <direct.h>
+#endif
+
+/* nyx includes */
+#include "nyx.h"
+
+/* xlisp includes */
+#include "switches.h"
+#include "xlisp.h"
+#include "cext.h"
+
+/* nyquist includes */
+#include "sound.h"
+#include "samples.h"
+#include "falloc.h"
+
+/* use full copy */
+#define NYX_FULL_COPY 1
+
+/* show memory stats */
+// #define NYX_MEMORY_STATS 1
+
+/* show details of obarray copy */
+// #define NYX_DEBUG_COPY 1
+
+/* macro to compute the size of a segment (taken from xldmem.h) */
+#define segsize(n) (sizeof(SEGMENT)+((n)-1)*sizeof(struct node))
+
+/* xldmem external variables */
+extern long nnodes;
+extern long nfree;
+extern long total;
+extern int nsegs;
+extern SEGMENT *segs;
+extern SEGMENT *lastseg;
+extern LVAL fnodes;
+
+/* nyquist externs */
+extern LVAL a_sound;
+extern snd_list_type zero_snd_list;
+
+/* globals */
+LOCAL nyx_os_callback     nyx_os_cb = NULL;
+LOCAL void               *nyx_os_ud;
+LOCAL nyx_output_callback nyx_output_cb;
+LOCAL void               *nyx_output_ud;
+LOCAL int                 nyx_expr_pos;
+LOCAL int                 nyx_expr_len;
+LOCAL const char         *nyx_expr_string;
+LOCAL LVAL                nyx_result;
+LOCAL nyx_rval            nyx_result_type = nyx_error;
+LOCAL XLCONTEXT           nyx_cntxt;
+LOCAL int                 nyx_first_time = 1;
+LOCAL LVAL                nyx_obarray;
+LOCAL FLOTYPE             nyx_warp_stretch;
+
+/* Suspension node */
+typedef struct nyx_susp_struct {
+   snd_susp_node       susp;        // Must be first
+   nyx_audio_callback  callback;
+   void               *userdata;
+   long                len;
+   int                 channel;
+} nyx_susp_node, *nyx_susp_type;
+
+#if defined(NYX_DEBUG_COPY) && NYX_DEBUG_COPY
+static const char *_types_[] = 
+{
+   "FREE_NODE",
+   "SUBR",
+   "FSUBR",
+   "CONS",
+   "SYMBOL",
+   "FIXNUM",
+   "FLONUM",
+   "STRING",
+   "OBJECT",
+   "STREAM",
+   "VECTOR",
+   "CLOSURE",
+   "CHAR",
+   "USTREAM",
+   "EXTERN"
+};
+
+// Dump the contents of the obarray
+LOCAL void nyx_show_obarray()
+{
+   LVAL array = getvalue(obarray);
+   LVAL sym;
+   int i;
+
+   for (i = 0; i < HSIZE; i++) {
+      for (sym = getelement(array, i); sym; sym = cdr(sym)) {
+         LVAL syma = car(sym);
+
+         printf("_sym_ = ");
+         xlprint(getvalue(s_stdout), syma, TRUE);
+
+         if (getvalue(syma)) {
+            printf(" _type_ = %s _val_ = ", _types_[ntype(getvalue(syma))]);
+            xlprint(getvalue(s_stdout), getvalue(syma), TRUE);
+         }
+
+         if (getfunction(syma)) {
+            printf(" _type_ = %s _fun_ = ", _types_[ntype(getfunction(syma))]);
+            xlprint(getvalue(s_stdout), getfunction(syma), TRUE);
+         }
+
+         printf("\n");
+      }
+   }
+}
+#endif
+
+//
+// Free empty segments
+//
+LOCAL void freesegs()
+{
+   SEGMENT *seg;
+   SEGMENT *next;
+
+   // Free up as many nodes as possible
+   gc();
+
+   // Reset free node tracking
+   fnodes = NIL;
+   nfree = 0L;
+
+   // Reset the last segment pointer
+   lastseg = NULL;
+
+   // Scan all segments
+   for (seg = segs; seg != NULL; seg = next) {
+      int n = seg->sg_size;
+      int empty = TRUE;
+      int i;
+      LVAL p;
+
+      // Check this segment for in-use nodes
+      p = &seg->sg_nodes[0];
+      for (i = n; --i >= 0; ++p) {
+         if (ntype(p) != FREE_NODE) {
+            empty = FALSE;
+            break;
+         }
+      }
+
+      // Retain pointer to next segment
+      next = seg->sg_next;
+
+      // Was the current segment empty?
+      if (empty) {
+         // Free the segment;
+         free((void *) seg);
+
+         // Unlink it from the list.  No need to worry about a NULL lastseg
+         // pointer here since the fixnum and char segments will always exist
+         // at the head of the list and they will always have nodes.  So, lastseg
+         // will have been set before we find any empty nodes.
+         lastseg->sg_next = next;
+
+         // Reduce the stats
+         total -= (long) segsize(n);
+         nsegs--;
+         nnodes -= n;
+      }
+      else {
+         // Not empty, so remember this node as the last segment
+         lastseg = seg;
+
+         // Add all of the free nodes in this segment to the free list
+         p = &seg->sg_nodes[0];
+         for (i = n; --i >= 0; ++p) {
+            if (ntype(p) == FREE_NODE) {
+               rplaca(p, NIL);
+               rplacd(p, fnodes);
+               fnodes = p;
+               nfree++;
+            }
+         }
+      }
+   }
+}
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+
+// Copy a node (recursively if appropriate)
+LOCAL LVAL nyx_dup_value(LVAL val)
+{
+   LVAL nval = val;
+
+   // Protect old and new values
+   xlprot1(val);
+   xlprot1(nval);
+
+   // Copy the node
+   if (val != NIL) {
+      switch (ntype(val))
+      {
+         case FIXNUM:
+            nval = cvfixnum(getfixnum(val));
+         break;
+
+         case FLONUM:
+            nval = cvflonum(getflonum(val));
+         break;
+
+         case CHAR:
+            nval = cvchar(getchcode(val));
+         break;
+
+         case STRING:
+            nval = cvstring((char *) getstring(val));
+         break;
+
+         case VECTOR:
+         {
+            int len = getsize(val);
+            int i;
+
+            nval = newvector(len);
+            nval->n_type = ntype(val);
+
+            for (i = 0; i < len; i++) {
+               if (getelement(val, i) == val) {
+                  setelement(nval, i, val);
+               }
+               else {
+                  setelement(nval, i, nyx_dup_value(getelement(val, i)));
+               }
+            }
+         }
+         break;
+
+         case CONS:
+            nval = nyx_dup_value(cdr(val));
+            nval = cons(nyx_dup_value(car(val)), nval);
+         break;
+
+         case SUBR:
+         case FSUBR:
+            nval = cvsubr(getsubr(val), ntype(val), getoffset(val));
+         break;
+
+         // Symbols should never be copied since their addresses are cached
+         // all over the place.
+         case SYMBOL:
+            nval = val;
+         break;
+
+         // Streams are not copied (although USTREAM could be) and reference
+         // the original value.
+         case USTREAM:
+         case STREAM:
+            nval = val;
+         break;
+
+         // Externals aren't copied because I'm not entirely certain they can be.
+         case EXTERN:
+            nval = val;
+         break;
+
+         // For all other types, just allow them to reference the original
+         // value.  Probably not the right thing to do, but easier.
+         case OBJECT:
+         case CLOSURE:
+         default:
+            nval = val;
+         break;
+      }
+   }
+
+   xlpop();
+   xlpop();
+
+   return nval;
+}
+
+// Make a copy of the original obarray, leaving the original in place
+LOCAL void nyx_save_obarray()
+{
+   LVAL newarray;
+   int i;
+
+   // This provide permanent protection for nyx_obarray as we do not want it
+   // to be garbage-collected.
+   xlprot1(nyx_obarray);
+   nyx_obarray = getvalue(obarray);
+
+   // Create and set the new vector.  This allows us to use xlenter() to
+   // properly add the new symbol.  Probably slower than adding directly,
+   // but guarantees proper hashing.
+   newarray = newvector(HSIZE);
+   setvalue(obarray, newarray);
+
+   // Scan all obarray vectors
+   for (i = 0; i < HSIZE; i++) {
+      LVAL sym;
+
+      // Scan all elements
+      for (sym = getelement(nyx_obarray, i); sym; sym = cdr(sym)) {
+         LVAL syma = car(sym);
+         char *name = (char *) getstring(getpname(syma));
+         LVAL nsym = xlenter(name);
+
+         // Ignore *OBARRAY* since there's no need to copy it
+         if (strcmp(name, "*OBARRAY*") == 0) {
+            continue;
+         }
+
+         // Ignore *SCRATCH* since it's allowed to be updated
+         if (strcmp(name, "*SCRATCH*") == 0) {
+            continue;
+         }
+
+         // Duplicate the symbol's values
+         setvalue(nsym, nyx_dup_value(getvalue(syma)));
+         setplist(nsym, nyx_dup_value(getplist(syma)));
+         setfunction(nsym, nyx_dup_value(getfunction(syma)));
+      }
+   }
+
+   // Swap the obarrays, so that the original is put back into service
+   setvalue(obarray, nyx_obarray);
+   nyx_obarray = newarray;
+}
+
+// Restore the symbol values to their original value and remove any added
+// symbols.
+LOCAL void nyx_restore_obarray()
+{
+   LVAL obvec = getvalue(obarray);
+   int i;
+
+   // Scan all obarray vectors
+   for (i = 0; i < HSIZE; i++) {
+      LVAL last = NULL;
+      LVAL dcon;
+
+      // Scan all elements
+      for (dcon = getelement(obvec, i); dcon; dcon = cdr(dcon)) {
+         LVAL dsym = car(dcon);
+         char *name = (char *)getstring(getpname(dsym));
+         LVAL scon;
+
+         // Ignore *OBARRAY* since setting it causes the input array to be
+         // truncated.
+         if (strcmp(name, "*OBARRAY*") == 0) {
+            continue;
+         }
+
+         // Ignore *SCRATCH* since it's allowed to be updated
+         if (strcmp(name, "*SCRATCH*") == 0) {
+            continue;
+         }
+
+         // Find the symbol in the original obarray.
+         for (scon = getelement(nyx_obarray, hash(name, HSIZE)); scon; scon = cdr(scon)) {
+            LVAL ssym = car(scon);
+
+            // If found, then set the current symbols value to the original.
+            if (strcmp(name, (char *)getstring(getpname(ssym))) == 0) {
+               setvalue(dsym, nyx_dup_value(getvalue(ssym)));
+               setplist(dsym, nyx_dup_value(getplist(ssym)));
+               setfunction(dsym, nyx_dup_value(getfunction(ssym)));
+               break;
+            }
+         }
+
+         // If we didn't find the symbol in the original obarray, then it must've
+         // been added and must be removed from the current obarray.
+         if (scon == NULL) {
+            if (last) {
+               rplacd(last, cdr(dcon));
+            }
+            else {
+               setelement(obvec, i, cdr(dcon));
+            }
+         }
+
+         // Must track the last dcon for symbol removal
+         last = dcon;
+      }
+   }
+}
+
+#else
+
+LOCAL LVAL copylist(LVAL from)
+{
+   if (from == NULL) {
+      return NULL;
+   }
+
+   return cons(car(from), copylist(cdr(from)));
+}
+
+/* Make a copy of the obarray so that we can erase any
+   changes the user makes to global variables */
+LOCAL void nyx_copy_obarray()
+{
+   LVAL newarray;
+   int i;
+
+   // Create and set the new vector.
+   newarray = newvector(HSIZE);
+   setvalue(obarray, newarray);
+
+   for (i = 0; i < HSIZE; i++) {
+      LVAL from = getelement(nyx_obarray, i);
+      if (from) {
+         setelement(newarray, i, copylist(from));
+      }
+   }
+}
+
+#endif
+
+void nyx_init()
+{
+   if (nyx_first_time) {
+      char *argv[1];
+      argv[0] = "nyquist";
+      xlisp_main_init(1, argv);
+
+      nyx_os_cb = NULL;
+      nyx_output_cb = NULL;
+      
+      nyx_first_time = 0;
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+      // Save a copy of the original obarray's contents.
+      nyx_save_obarray();
+#else
+      // Permanently protect the original obarray value.  This is needed since
+      // it would be unreferenced in the new obarray and would be garbage
+      // collected.  We want to keep it around so we can make copies of it to 
+      // refresh the execution state.
+      xlprot1(nyx_obarray);
+      nyx_obarray = getvalue(obarray);
+#endif
+   }
+
+#if !defined(NYX_FULL_COPY) || !NYX_FULL_COPY
+   // Create a copy of the original obarray
+   nyx_copy_obarray();
+#endif
+
+   // Keep nyx_result from being garbage-collected
+   xlprot1(nyx_result);
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_init\n");
+   xmem();
+#endif
+}
+
+void nyx_cleanup()
+{
+   // Garbage-collect nyx_result
+   xlpop();
+
+#if defined(NYX_FULL_COPY) && NYX_FULL_COPY
+
+   // Restore the original symbol values
+   nyx_restore_obarray();
+
+#else
+
+   // Restore obarray to original state...but not the values
+   setvalue(obarray, nyx_obarray);
+
+#endif
+
+   // Make sure the sound nodes can be garbage-collected.  Sounds are EXTERN
+   // nodes whose value does not get copied during a full copy of the obarray.
+   setvalue(xlenter("S"), NIL);
+
+   // Free excess memory segments - does a gc()
+   freesegs();
+
+   // Free unused memory pools
+   falloc_gc();
+
+   // No longer need the callbacks
+   nyx_output_cb = NULL;
+   nyx_os_cb = NULL;
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_cleanup\n");
+   xmem();
+#endif
+}
+
+void nyx_set_xlisp_path(const char *path)
+{
+   set_xlisp_path(path);
+}
+
+LOCAL void nyx_susp_fetch(register nyx_susp_type susp, snd_list_type snd_list)
+{
+   sample_block_type         out;
+   sample_block_values_type  out_ptr;
+   long                      n;
+   int                       err;
+
+   falloc_sample_block(out, "nyx_susp_fetch");
+   out_ptr = out->samples;
+   snd_list->block = out;
+
+   n = max_sample_block_len;
+   if (susp->susp.current + n > susp->len) {
+      n = susp->len - susp->susp.current;
+   }
+
+   err = susp->callback(out_ptr, susp->channel,
+                        susp->susp.current, n, 0, susp->userdata);
+   if (err) {
+      // The user canceled or some other error occurred, so we use
+      // xlsignal() to jump back to our error handler.
+      xlsignal(NULL, NULL);
+      // never get here.
+   }
+
+   snd_list->block_len = (short)n;
+   susp->susp.current += n;
+
+   if (n == 0) {
+      /* we didn't read anything, but can't return length zero, so
+         convert snd_list to pointer to zero block */
+      snd_list_terminate(snd_list);
+   }
+   else if (n < max_sample_block_len) {
+      /* should free susp */
+      snd_list_unref(snd_list->u.next);
+      /* if something is in buffer, terminate by pointing to zero block */
+      snd_list->u.next = zero_snd_list;
+   }
+}
+
+LOCAL void nyx_susp_free(nyx_susp_type susp)
+{
+   ffree_generic(susp, sizeof(nyx_susp_node), "nyx_susp_free");
+}
+
+LOCAL void nyx_susp_print_tree(nyx_susp_type susp, int n)
+{
+}
+
+void nyx_capture_output(nyx_output_callback callback, void *userdata)
+{
+   nyx_output_cb = callback;
+   nyx_output_ud = userdata;
+}
+
+void nyx_set_audio_params(double rate, long len)
+{
+   LVAL flo;
+   LVAL con;
+
+   xlstkcheck(2);
+   xlsave(flo);
+   xlsave(con);
+
+   /* Bind the sample rate to the "*sound-srate*" global */
+   flo = cvflonum(rate);
+   setvalue(xlenter("*SOUND-SRATE*"), flo);
+
+   /* Bind selection len to "len" global */
+   flo = cvflonum(len);
+   setvalue(xlenter("LEN"), flo);
+
+   /* Set the "*warp*" global based on the length of the audio */
+   con = cons(NULL, NULL);
+   flo = cvflonum(len > 0 ? (double) len / rate : 1.0);
+   con = cons(flo, con);
+   flo = cvflonum(0);
+   con = cons(flo, con);
+   setvalue(xlenter("*WARP*"), con);
+
+   xlpopn(2);
+}
+
+void nyx_set_input_audio(nyx_audio_callback callback,
+                         void *userdata,
+                         int num_channels,
+                         long len, double rate)
+{
+   LVAL val;
+   int ch;
+
+   nyx_set_audio_params(rate, len);
+
+   if (num_channels > 1) {
+      val = newvector(num_channels);
+   }
+
+   xlprot1(val);
+
+   for (ch = 0; ch < num_channels; ch++) {
+      nyx_susp_type susp;
+      sound_type snd;
+
+      falloc_generic(susp, nyx_susp_node, "nyx_set_input_audio");
+
+      susp->callback = callback;
+      susp->userdata = userdata;
+      susp->len = len;
+      susp->channel = ch;
+
+      susp->susp.fetch = nyx_susp_fetch;
+      susp->susp.keep_fetch = NULL;
+      susp->susp.free = nyx_susp_free;
+      susp->susp.mark = NULL;
+      susp->susp.print_tree = nyx_susp_print_tree;
+      susp->susp.name = "nyx";
+      susp->susp.toss_cnt = 0;
+      susp->susp.current = 0;
+      susp->susp.sr = rate;
+      susp->susp.t0 = 0.0;
+      susp->susp.log_stop_cnt = 0;
+      
+      snd = sound_create((snd_susp_type) susp, 0.0, rate, 1.0);
+      if (num_channels > 1) {
+         setelement(val, ch, cvsound(snd));
+      }
+      else {
+         val = cvsound(snd);
+      }
+   }
+
+   setvalue(xlenter("S"), val);
+
+   xlpop();
+}
+
+LOCAL int nyx_is_labels(LVAL expr)
+{
+   /* make sure that we have a list whose first element is a
+      list of the form (time "label") */
+
+   LVAL label;
+   LVAL first;
+   LVAL second;
+   LVAL third;
+
+   if (expr == NULL) {
+      return 0;
+   }
+
+   while (expr != NULL) {
+      if (!consp(expr)) {
+         return 0;
+      }
+
+      label = car(expr);
+
+      if (!consp(label)) {
+         return 0;
+      }
+
+      first = car(label);
+      if (!(floatp(first) || fixp(first))) {
+         return 0;
+      }
+
+      if (!consp(cdr(label))) {
+         return 0;
+      }
+
+      second = car(cdr(label));
+
+      if (floatp(second) || fixp(second)) {
+         if (!consp(cdr(cdr(label)))) {
+            return 0;
+         }
+         third = car(cdr(cdr(label)));
+         if (!(stringp(third))) {
+            return 0;
+         }
+      }
+      else {
+         if (!(stringp(second))) {
+            return 0;
+         }
+      }
+
+      expr = cdr(expr);
+   }
+
+   return 1;
+}
+
+nyx_rval nyx_get_type(LVAL expr)
+{
+   if (nyx_result_type != nyx_error) {
+      return nyx_result_type;
+   }
+
+   nyx_result_type = nyx_error;
+
+   if (expr == NULL) {
+      return nyx_result_type;
+   }
+
+   switch (ntype(expr))
+   {
+      case FIXNUM:
+         nyx_result_type = nyx_int;
+      break;
+         
+      case FLONUM:
+         nyx_result_type = nyx_double;
+      break;
+
+      case STRING:
+         nyx_result_type = nyx_string;
+      break;
+
+      case VECTOR:
+      {
+         /* make sure it's a vector of sounds */
+         int i;
+         nyx_result_type = nyx_audio;
+         for (i = 0; i < getsize(expr); i++) {
+            if (!soundp(getelement(expr, i))) {
+               nyx_result_type = nyx_error;
+               break;
+            }
+         }
+      }
+      break;
+
+      case CONS:
+      {
+         /* see if it's a list of time/string pairs representing a
+            label track */
+         if (nyx_is_labels(expr)) {
+            nyx_result_type = nyx_labels;
+         }
+      }
+      break;
+
+      case EXTERN:
+      {
+         if (soundp(expr)) {
+            nyx_result_type = nyx_audio;
+         }
+      }
+      break;
+   } /* switch */
+
+   return nyx_result_type;
+}
+
+nyx_rval nyx_eval_expression(const char *expr_string)
+{
+   LVAL expr = NULL;
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_eval_expression before\n");
+   xmem();
+#endif
+
+   nyx_result = NULL;
+   nyx_result_type = nyx_error;
+
+   // Check argument
+   if (!expr_string || !strlen(expr_string)) {
+      return nyx_get_type(nyx_result);
+   }
+
+   nyx_expr_string = expr_string;
+   nyx_expr_len = strlen(nyx_expr_string);
+   nyx_expr_pos = 0;
+
+   // Protect the expression from being garbage collected
+   xlprot1(expr);
+
+   // Setup a new context
+   xlbegin(&nyx_cntxt, CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL|CF_ERROR, s_true);
+
+   // Set the context jump destination
+   if (setjmp(nyx_cntxt.c_jmpbuf)) {
+      // If the script is cancelled or some other condition occurs that causes
+      // the script to exit and return to this level, then we don't need to
+      // restore the previous context.
+      goto finish;
+   }
+
+   while (nyx_expr_pos < nyx_expr_len) {
+      expr = NULL;
+
+      // Read an expression
+      if (!xlread(getvalue(s_stdin), &expr, FALSE)) {
+         break;
+      }
+
+      #if 0
+      /* save the input expression (so the user can refer to it
+         as +, ++, or +++) */
+      xlrdsave(expr);
+      #endif
+
+      // Evaluate the expression
+      nyx_result = xleval(expr);
+   }
+
+   // This will unwind the xlisp context and restore internals to a point just
+   // before we issued our xlbegin() above.  This is important since the internal
+   // xlisp stacks will contain pointers to invalid objects otherwise.
+   //
+   // Also note that execution will jump back up to the statement following the
+   // setjmp() above.
+   xljump(&nyx_cntxt, CF_TOPLEVEL, NIL);
+   // Never reached
+
+ finish:
+
+   xlflush();
+
+   xlpop(); // unprotect expr
+
+   gc();
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_eval_expression after\n");
+   xmem();
+#endif
+
+   return nyx_get_type(nyx_result);
+}
+
+int nyx_get_audio_num_channels()
+{
+   if (nyx_get_type(nyx_result) != nyx_audio) {
+      return 0;
+   }
+
+   if (vectorp(nyx_result)) {
+      return getsize(nyx_result);
+   }
+
+   return 1;
+}
+
+int nyx_get_audio(nyx_audio_callback callback, void *userdata)
+{
+   float *buffer = NULL;
+   sound_type *snds = NULL;
+   long *totals = NULL;
+   long *lens = NULL;
+   sound_type snd;
+   int result = 0;
+   int num_channels;
+   int ch;
+
+   // Any variable whose value is set between the setjmp() and the "finish" label
+   // and that is used after the "finish" label, must be marked volatile since
+   // any routine outside of the current one that calls longjmp() will cause values
+   // cached in registers to be lost.
+   volatile int success = FALSE;
+
+   if (nyx_get_type(nyx_result) != nyx_audio) {
+      return FALSE;
+   }
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_get_audio before\n");
+   xmem();
+#endif
+
+   num_channels = nyx_get_audio_num_channels();
+
+   buffer = (sample_type *) malloc(max_sample_block_len * sizeof(sample_type));
+   if (buffer == NULL) {
+      goto finish;
+   }
+
+   snds = (sound_type *) malloc(num_channels * sizeof(sound_type));
+   if (snds == NULL) {
+      goto finish;
+   }
+
+   totals = (long *) malloc(num_channels * sizeof(long));
+   if (totals == NULL) {
+      goto finish;
+   }
+
+   lens = (long *) malloc(num_channels * sizeof(long));
+   if (lens == NULL) {
+      goto finish;
+   }
+
+   // Setup a new context
+   xlbegin(&nyx_cntxt, CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL|CF_ERROR, s_true);
+
+   // Set the context jump destination
+   if (setjmp(nyx_cntxt.c_jmpbuf)) {
+      // If the script is cancelled or some other condition occurs that causes
+      // the script to exit and return to this level, then we don't need to
+      // restore the previous context.
+      goto finish;
+   }
+
+   for (ch = 0; ch < num_channels; ch++) {
+      if (num_channels == 1) {
+         snd = getsound(nyx_result);
+      }
+      else {
+         snd = getsound(getelement(nyx_result, ch));
+      }
+      snds[ch] = snd;
+      totals[ch] = 0;
+      lens[ch] = snd_length(snd, snd->stop);
+   }
+
+   while (result == 0) {
+      for (ch =0 ; ch < num_channels; ch++) {
+         sample_block_type block;
+         long cnt;
+         int i;
+
+         snd = snds[ch];
+
+         cnt = 0;
+         block = sound_get_next(snd, &cnt);
+         if (block == zero_block || cnt == 0) {
+            success = TRUE;
+            result = -1;
+            break;
+         }
+
+         // Copy and scale the samples
+         for (i = 0; i < cnt; i++) {
+            buffer[i] = block->samples[i] * snd->scale;
+         }
+
+         result = callback((float *)buffer, ch,
+                           totals[ch], cnt, lens[ch], userdata);
+
+         if (result != 0) {
+            result = -1;
+            break;
+         }
+
+         totals[ch] += cnt;
+      }
+   }
+
+   // This will unwind the xlisp context and restore internals to a point just
+   // before we issued our xlbegin() above.  This is important since the internal
+   // xlisp stacks will contain pointers to invalid objects otherwise.
+   //
+   // Also note that execution will jump back up to the statement following the
+   // setjmp() above.
+   xljump(&nyx_cntxt, CF_TOPLEVEL, NIL);
+   // Never reached
+
+ finish:
+
+   if (buffer) {
+      free(buffer);
+   }
+
+   if (lens) {
+      free(lens);
+   }
+
+   if (totals) {
+      free(totals);
+   }
+
+   if (snds) {
+      free(snds);
+   }
+
+   gc();
+
+#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
+   printf("\nnyx_get_audio after\n");
+   xmem();
+#endif
+
+   return success;
+}
+
+int nyx_get_int()
+{
+   if (nyx_get_type(nyx_result) != nyx_int) {
+      return -1;
+   }
+
+   return getfixnum(nyx_result);
+}
+
+double nyx_get_double()
+{
+   if (nyx_get_type(nyx_result) != nyx_double) {
+      return -1.0;
+   }
+
+   return getflonum(nyx_result);
+}
+
+const char *nyx_get_string()
+{
+   if (nyx_get_type(nyx_result) != nyx_string) {
+      return NULL;
+   }
+
+   return (const char *)getstring(nyx_result);
+}
+
+unsigned int nyx_get_num_labels()
+{
+   LVAL s;
+   int count = 0;
+
+   if (nyx_get_type(nyx_result) != nyx_labels) {
+      return 0;
+   }
+
+   for (s = nyx_result; s; s = cdr(s)) {
+      count++;
+   }
+
+   return count;
+}
+
+void nyx_get_label(unsigned int index,
+                   double *start_time,
+                   double *end_time,
+                   const char **label)
+{
+   LVAL s = nyx_result;
+   LVAL label_expr;
+   LVAL t0_expr;
+   LVAL t1_expr;
+   LVAL str_expr;
+
+   if (nyx_get_type(nyx_result) != nyx_labels) {
+      return;
+   }
+
+   while (index) {
+      index--;
+      s = cdr(s);
+      if (s == NULL) {
+         // index was larger than number of labels
+         return;
+      }
+   }
+
+   /* We either have (t0 "label") or (t0 t1 "label") */
+
+   label_expr = car(s);
+   t0_expr = car(label_expr);
+   t1_expr = car(cdr(label_expr));
+   if (stringp(t1_expr)) {
+      str_expr = t1_expr;
+      t1_expr = t0_expr;
+   }
+   else {
+      str_expr = car(cdr(cdr(label_expr)));
+   }
+
+   if (floatp(t0_expr)) {
+      *start_time = getflonum(t0_expr);
+   }
+   else if (fixp(t0_expr)) {
+      *start_time = (double)getfixnum(t0_expr);
+   }
+
+   if (floatp(t1_expr)) {
+      *end_time = getflonum(t1_expr);
+   }
+   else if (fixp(t1_expr)) {
+      *end_time = (double)getfixnum(t1_expr);
+   }
+
+   *label = (const char *)getstring(str_expr);
+}
+
+const char *nyx_get_error_str()
+{
+   return NULL;
+}
+
+void nyx_set_os_callback(nyx_os_callback callback, void *userdata)
+{
+   nyx_os_cb = callback;
+   nyx_os_ud = userdata;
+}
+
+void nyx_stop()
+{
+   xlflush();
+   xltoplevel();
+}
+
+void nyx_break()
+{
+   xlflush();
+   xlbreak("BREAK", s_unbound);
+}
+
+void nyx_continue()
+{
+   xlflush();
+   xlcontinue();
+}
+
+int ostgetc()
+{
+   if (nyx_expr_pos < nyx_expr_len) {
+      fflush(stdout);
+      return (nyx_expr_string[nyx_expr_pos++]);
+   }
+   else if (nyx_expr_pos == nyx_expr_len) {
+      /* Add whitespace at the end so that the parser
+         knows that this is the end of the expression */
+      nyx_expr_pos++;
+      return '\n';
+   }
+
+   return EOF;
+}
+
+/* osinit - initialize */
+void osinit(char *banner)
+{
+}
+
+/* osfinish - clean up before returning to the operating system */
+void osfinish(void) 
+{
+}
+
+/* oserror - print an error message */
+void oserror(char *msg)
+{
+   errputstr(msg);
+}
+
+long osrand(long n)
+{
+   return (((int) rand()) % n);
+}
+
+/* cd ..
+open - open an ascii file */
+FILE *osaopen(char *name, char *mode)
+{
+   return fopen(name, mode);
+}
+
+/* osbopen - open a binary file */
+FILE *osbopen(char *name, char *mode)
+{
+   char bmode[10];
+   
+   strncpy(bmode, mode, 8);
+   strcat(bmode, "b");
+
+   return fopen(name,bmode);
+}
+
+/* osclose - close a file */
+int osclose(FILE *fp)
+{
+   return fclose(fp);
+}
+
+/* osagetc - get a character from an ascii file */
+int osagetc(FILE *fp)
+{
+   return getc(fp);
+}
+
+/* osaputc - put a character to an ascii file */
+int osaputc(int ch, FILE *fp)
+{
+   return putc(ch,fp);
+}
+
+/* osoutflush - flush output to a file */
+void osoutflush(FILE *fp)
+{
+   fflush(fp);
+}
+
+/* osbgetc - get a character from a binary file */
+int osbgetc(FILE *fp)
+{
+   return getc(fp);
+}
+
+/* osbputc - put a character to a binary file */
+int osbputc(int ch, FILE *fp)
+{
+   return putc(ch, fp);
+}
+
+/* ostputc - put a character to the terminal */
+void ostputc(int ch)
+{     
+   oscheck();		/* check for control characters */
+   
+   if (nyx_output_cb) {
+      nyx_output_cb(ch, nyx_output_ud);
+   }
+   else {
+      putchar((char) ch);
+   }
+}
+
+/* ostoutflush - flush output buffer */
+void ostoutflush()
+{
+   if (!nyx_output_cb) {
+      fflush(stdout);
+   }
+}
+
+/* osflush - flush the terminal input buffer */
+void osflush(void)
+{
+}
+
+/* oscheck - check for control characters during execution */
+void oscheck(void)
+{
+   if (nyx_os_cb) {
+      nyx_os_cb(nyx_os_ud);
+   }
+   /* if they hit control-c:
+      xflush(); xltoplevel(); return;
+   */
+}
+
+/* xsystem - execute a system command */
+LVAL xsystem()
+{
+   if (moreargs()) {
+      unsigned char *cmd;
+      cmd = (unsigned char *)getstring(xlgastring());
+      fprintf(stderr, "Will not execute system command: %s\n", cmd);
+   }
+   return s_true;
+}
+
+/* xsetdir -- set current directory of the process */
+LVAL xsetdir()
+{
+   char *dir = (char *)getstring(xlgastring());
+   int result;
+   LVAL cwd = NULL;
+
+   xllastarg();
+
+   result = chdir(dir);
+   if (result) {
+      perror("SETDIR");
+   }
+
+   dir = getcwd(NULL, 1000);
+   if (dir) {
+      cwd = cvstring(dir);
+      free(dir);
+   }
+
+   return cwd;
+}
+
+/* xgetkey - get a key from the keyboard */
+LVAL xgetkey()
+{
+   xllastarg();
+   return (cvfixnum((FIXTYPE)getchar()));
+}
+
+/* ossymbols - enter os specific symbols */
+void ossymbols(void)
+{
+}
+
+/* xsetupconsole -- used to configure window in Win32 version */
+LVAL xsetupconsole()
+{
+   return NULL;
+}
+
+#if defined(WIN32)
+const char os_pathchar = '\\';
+const char os_sepchar = ',';
+#else
+const char os_pathchar = '/';
+const char os_sepchar = ':';
+#endif
+
+/* control-C handling */
+void ctcinit()
+{
+}
+
+/* xechoenabled -- set/clear echo_enabled flag (unix only) */
+LVAL xechoenabled()
+{
+   return NULL;
+}
+
+/* osdir_list_start -- open a directory listing */
+int osdir_list_start(char *path)
+{
+   return FALSE;
+}
+
+/* osdir_list_next -- read the next entry from a directory */
+char *osdir_list_next()
+{
+   return NULL;
+}
+
+/* osdir_list_finish -- close an open directory */
+void osdir_list_finish()
+{
+   return;
+}
+
+/* xget_temp_path -- get a path to create temp files */
+LVAL xget_temp_path()
+{
+   char *tmp;
+
+#if defined(WINDOWS)
+   tmp = getenv("TEMP");
+#else
+   tmp = getenv("TMPDIR");
+#endif
+
+   if (!tmp || !*tmp) {
+      tmp = getenv("TMP");
+      if (!tmp || !*tmp) {
+#if defined(WINDOWS)
+         tmp = "/";
+#else
+         tmp = "/tmp/";
+#endif
+      }
+   }
+
+   return cvstring(tmp);
+}
+
+/* xget_user -- get a string identifying the user, for use in file names */
+LVAL xget_user()
+{
+   char *user = getenv("USER");
+
+   if (!user || !*user) {
+      user = getenv("USERNAME");
+      if (!user || !*user) {
+         errputstr("Warning: could not get user ID, using 'nyquist'\n");
+         user = "nyquist";
+      }
+   }
+
+   return cvstring(user);
+}
+
+#if defined(WINDOWS)
+/* get_xlisp_path -- return path to xlisp */
+void get_xlisp_path(char *p, long p_max)
+{
+   char *paths = getenv("XLISPPATH");
+
+   if (!paths || !*paths) {
+      *p = 0;
+      return;
+   }
+
+   strncpy(p, paths, p_max);
+   p[p_max] = 0;
+}
+#endif
+
diff --git a/lib-src/libnyquist/nyx.h b/lib-src/libnyquist/nyx.h
new file mode 100644
index 0000000..881f76d
--- /dev/null
+++ b/lib-src/libnyquist/nyx.h
@@ -0,0 +1,90 @@
+/**********************************************************************
+
+  nyx.h
+
+  Nyx: A very simple external interface to Nyquist
+
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#ifndef __NYX__
+#define __NYX__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+   #define nyx_returns_start_and_end_time 1
+
+   typedef enum {
+      nyx_error,
+      nyx_audio,
+      nyx_int,
+      nyx_double,
+      nyx_string,
+      nyx_labels
+   } nyx_rval;
+   
+   void        nyx_init();
+   void        nyx_cleanup();
+   void        nyx_set_xlisp_path(const char *path);
+
+   /* should return return 0 for success, -1 for error */
+   typedef int (*nyx_audio_callback)(float *buffer,
+                                     int channel,
+                                     long start, long len,
+                                     long totlen,
+                                     void *userdata);
+
+   typedef void (*nyx_output_callback)(int c,
+                                       void *userdata);
+
+   typedef void (*nyx_os_callback)(void *userdata);
+
+   /* Set to NULL to stop capturing output */
+   void        nyx_capture_output(nyx_output_callback callback,
+                                  void *userdata);
+
+   /* Set to NULL to stop checking */
+   void        nyx_set_os_callback(nyx_os_callback callback,
+                                   void *userdata);
+
+   void        nyx_stop();
+   void        nyx_break();
+   void        nyx_continue();
+
+   void        nyx_set_audio_params(double rate, long len);
+
+   void        nyx_set_input_audio(nyx_audio_callback callback,
+                                   void *userdata,
+                                   int num_channels,
+                                   long len, double rate);
+   
+   nyx_rval    nyx_eval_expression(const char *expr);
+   
+   int         nyx_get_audio_num_channels();
+   int         nyx_get_audio(nyx_audio_callback callback,
+                             void *userdata);
+
+   int         nyx_get_int();
+   double      nyx_get_double();
+   const char *nyx_get_string();
+
+   unsigned int nyx_get_num_labels();
+   void         nyx_get_label(unsigned int index,
+                              double *start_time,
+                              double *end_time,
+                              const char **label);
+
+   const char *nyx_get_error_str();
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+   
+#endif /* __NYX__ */
+
diff --git a/lib-src/libnyquist/xlextstart.c b/lib-src/libnyquist/xlextstart.c
new file mode 100644
index 0000000..be321fe
--- /dev/null
+++ b/lib-src/libnyquist/xlextstart.c
@@ -0,0 +1 @@
+/* nothing to do */
diff --git a/lib-src/mod-script-pipe/PipeServer.cpp b/lib-src/mod-script-pipe/PipeServer.cpp
new file mode 100644
index 0000000..949021c
--- /dev/null
+++ b/lib-src/mod-script-pipe/PipeServer.cpp
@@ -0,0 +1,198 @@
+#if defined(WIN32)
+
+#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+
+const int nBuff = 1024;
+
+extern "C" int DoSrv( char * pIn );
+extern "C" int DoSrvMore( char * pOut, int nMax );
+
+void PipeServer()
+{
+   HANDLE hPipeToSrv;
+   HANDLE hPipeFromSrv;
+
+   LPTSTR pipeNameToSrv= _T("\\\\.\\pipe\\ToSrvPipe");
+
+   hPipeToSrv = CreateNamedPipe( 
+      pipeNameToSrv ,
+      PIPE_ACCESS_DUPLEX,
+      PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT ,//| PIPE_REJECT_REMOTE_CLIENTS,
+      PIPE_UNLIMITED_INSTANCES,
+      nBuff,
+      nBuff,
+      50,//Timeout - always send straight away.
+      NULL);
+   if( hPipeToSrv == INVALID_HANDLE_VALUE)
+      return;
+
+   LPTSTR pipeNameFromSrv= __T("\\\\.\\pipe\\FromSrvPipe");
+
+   hPipeFromSrv = CreateNamedPipe( 
+      pipeNameFromSrv ,
+      PIPE_ACCESS_DUPLEX,
+      PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT ,//| PIPE_REJECT_REMOTE_CLIENTS,
+      PIPE_UNLIMITED_INSTANCES,
+      nBuff,
+      nBuff,
+      50,//Timeout - always send straight away.
+      NULL);
+   if( hPipeFromSrv == INVALID_HANDLE_VALUE)
+      return;
+
+   BOOL bConnected;
+   BOOL bSuccess;
+   DWORD cbBytesRead;
+   DWORD cbBytesWritten;
+   CHAR chRequest[ nBuff ];
+   CHAR chResponse[ nBuff ];
+
+   int jj=0;
+
+   for(;;)
+   {
+      printf( "Obtaining pipe\n" );
+      bConnected = ConnectNamedPipe(hPipeToSrv, NULL) ? 
+         TRUE : (GetLastError()==ERROR_PIPE_CONNECTED );
+      printf( "Obtained to-srv %i\n", bConnected );
+      bConnected = ConnectNamedPipe(hPipeFromSrv, NULL) ? 
+         TRUE : (GetLastError()==ERROR_PIPE_CONNECTED );
+      printf( "Obtained from-srv %i\n", bConnected );
+      if( bConnected )
+      {
+         for(;;)
+         {
+            printf( "About to read\n" );
+            bSuccess = ReadFile( hPipeToSrv, chRequest, nBuff, &cbBytesRead, NULL);
+
+            chRequest[ cbBytesRead] = '\0'; 
+
+            if( !bSuccess || cbBytesRead==0 )
+               break;
+
+            printf( "Rxd %s\n", chRequest );
+
+            DoSrv( chRequest );
+            jj++;
+            while( true )
+            {
+               int nWritten = DoSrvMore( chResponse, nBuff );
+               if( nWritten <= 1 )
+                  break;
+               WriteFile( hPipeFromSrv, chResponse, nWritten-1, &cbBytesWritten, NULL);
+            }
+            //FlushFileBuffers( hPipeFromSrv );
+         }
+         FlushFileBuffers( hPipeToSrv );
+         DisconnectNamedPipe( hPipeToSrv );
+         FlushFileBuffers( hPipeFromSrv );
+         DisconnectNamedPipe( hPipeFromSrv );
+         break;
+      }
+      else
+      {
+         CloseHandle( hPipeToSrv );
+         CloseHandle( hPipeFromSrv );
+      }
+   }
+   CloseHandle( hPipeToSrv );
+   CloseHandle( hPipeFromSrv );
+}
+
+#else
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+const char fifotmpl[] = "/tmp/audacity_script_pipe.%s.%d";
+
+const int nBuff = 1024;
+
+extern "C" int DoSrv( char * pIn );
+extern "C" int DoSrvMore( char * pOut, int nMax );
+
+void PipeServer()
+{
+   FILE *fromFifo = NULL;
+   FILE *toFifo = NULL;
+   int rc;
+   char buf[nBuff];
+   char toFifoName[nBuff];
+   char fromFifoName[nBuff];
+
+   sprintf(toFifoName, fifotmpl, "to", getuid());
+   sprintf(fromFifoName, fifotmpl, "from", getuid());
+
+   unlink(toFifoName);
+   unlink(fromFifoName);
+
+   // TODO avoid symlink security issues?
+
+   rc = mkfifo(fromFifoName, S_IRWXU) & mkfifo(toFifoName, S_IRWXU);
+   if (rc < 0)
+   {
+      perror("Unable to create fifos");
+      printf("Ignoring...");
+//      return;
+   }
+
+   fromFifo = fopen(fromFifoName, "w");
+   if (fromFifo == NULL)
+   {
+      perror("Unable to open fifo from server to script");
+      return;
+   }
+
+   toFifo = fopen(toFifoName, "r");
+   if (toFifo == NULL)
+   {
+      perror("Unable to open fifo to server from script");
+      return;
+   }
+
+   while (fgets(buf, sizeof(buf), toFifo) != NULL)
+   {
+      int len = strlen(buf);
+      if (len <= 1)
+      {
+         continue;
+      }
+
+      buf[len - 1] = '\0';
+
+      printf("Server received %s\n", buf);
+      DoSrv(buf);
+
+      while (true)
+      {
+         len = DoSrvMore(buf, nBuff);
+         if (len <= 1)
+         {
+            break;
+         }
+         printf("Server sending %s",buf);
+
+         // len - 1 because we do not send the null character
+         fwrite(buf, 1, len - 1, fromFifo);
+      }
+      fflush(fromFifo);
+   }
+
+   printf("Read failed on fifo, quitting\n");
+
+   if (toFifo != NULL)
+      fclose(toFifo);
+
+   if (fromFifo != NULL)
+      fclose(fromFifo);
+
+   unlink(toFifoName);
+   unlink(fromFifoName);
+}
+#endif
diff --git a/lib-src/mod-script-pipe/ScripterCallback.cpp b/lib-src/mod-script-pipe/ScripterCallback.cpp
new file mode 100644
index 0000000..2748259
--- /dev/null
+++ b/lib-src/mod-script-pipe/ScripterCallback.cpp
@@ -0,0 +1,183 @@
+// ScripterCallback.cpp : 
+//
+// A loadable module that connects a windows named pipe
+// to a registered service function that is able to
+// process a single command at a time.
+//
+// The service function is provided by the application
+// and not by libscript.  mod_script_pipe was developed for
+// Audacity.  Because it forwards commands
+// rather than handling them itself it can be used in
+// other projects too.  
+
+#include <wx/wx.h>
+#include "ScripterCallback.h"
+//#include "../lib_widget_extra/ShuttleGuiBase.h"
+#include "../../src/ShuttleGui.h"
+
+#ifdef NOT_DEFINED
+
+// This is 'traditional code' for DLLs, which we're not
+// using.
+
+//#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+#endif
+
+
+extern void PipeServer();
+
+
+extern "C" {
+
+   // This is an example of an exported variable
+
+typedef SCRIPT_PIPE_DLL_IMPORT int (*tpExecScriptServerFunc)( wxString * pIn, wxString * pOut);
+
+
+static tpExecScriptServerFunc pScriptServerFn=NULL;
+
+wxString Str2;
+wxArrayString aStr;
+unsigned int currentLine;
+size_t currentPosition;
+
+// Send the received command to Audacity and build an array of response lines.
+// The response lines can be retrieved by calling DoSrvMore repeatedly.
+int DoSrv(char *pIn)
+{
+   wxString Str1(pIn, wxConvISO8859_1);
+   Str1.Replace( wxT("\r"), wxT(""));
+   Str1.Replace( wxT("\n"), wxT(""));
+   (*pScriptServerFn)( &Str1 , &Str2);
+
+   Str2 += wxT('\n');
+   size_t outputLength = Str2.Length();
+   aStr.Clear();
+   size_t iStart = 0;
+   size_t i;
+   for(i = 0; i < outputLength; ++i)
+   {
+      if( Str2[i] == wxT('\n') )
+      {
+         aStr.Add( Str2.Mid( iStart, i-iStart) + wxT('\n') );
+         iStart = i+1;
+      }
+   }
+
+   // The end of the responses is signalled by an empty line.
+   aStr.Add(wxT('\n'));
+
+   currentLine     = 0;
+   currentPosition = 0;
+
+   return 1;
+}
+
+size_t smin(size_t a, size_t b) { return a < b ? a : b; }
+
+// Write up to nMax characters of the prepared (by DoSrv) response lines.
+// Returns the number of characters sent, including null.
+// Zero returned if and only if there's nothing else to send.
+int DoSrvMore(char *pOut, size_t nMax)
+{
+   wxASSERT(currentLine >= 0);
+   wxASSERT(currentPosition >= 0);
+
+   size_t totalLines = aStr.GetCount();
+   while (currentLine < totalLines)
+   {
+      wxString lineString    = aStr[currentLine];
+      size_t lineLength      = lineString.Length();
+      size_t charsLeftInLine = lineLength - currentPosition;
+
+      wxASSERT(charsLeftInLine >= 0);
+
+      if (charsLeftInLine == 0)
+      {
+         // Move to next line
+         ++currentLine;
+         currentPosition = 0;
+      }
+      else
+      {
+         // Write as much of the rest of the line as will fit in the buffer
+         size_t charsToWrite = smin(charsLeftInLine, nMax - 1);
+         memcpy(pOut, lineString.Right(charsToWrite).mb_str(), charsToWrite);
+         pOut[charsToWrite] = '\0';
+         currentPosition    += charsToWrite;
+         // Need to cast to prevent compiler warnings
+         int charsWritten = static_cast<int>(charsToWrite + 1);
+         // (Check cast was safe)
+         wxASSERT(static_cast<size_t>(charsWritten) == charsToWrite + 1);
+         return charsWritten;
+      }
+   }
+   return 0;
+}
+
+int SCRIPT_PIPE_DLL_API RegScriptServerFunc( tpExecScriptServerFunc pFn )
+{
+   if( pFn )
+   {
+      pScriptServerFn = pFn;
+      PipeServer();
+   }
+   return 4;
+}
+
+// This is an example of an exported function.
+int SCRIPT_PIPE_DLL_API ExtensionModuleInit(int ix)
+{
+//   pExecFunc = NULL;
+   ix;// compiler food.
+
+#if defined(_DEBUG)
+   wxLogDebug(wxT("Got into DLL"));
+#endif
+
+   // Here is proof that the DLL was dynamically loaded and this Init function
+   // called.
+   //wxDialog Dlg( (wxWindow*)NULL, (wxWindowID)-1, wxT("mod-script-pipe - Dialog Loaded by Plug In"), wxPoint(0,0));
+
+
+#if 0
+   ShuttleGui S( &Dlg, eIsCreating );
+   S.StartStatic( "Scripter Initialising" );
+   S.StartHorizontalLay();
+   S.Id(wxID_CANCEL).AddButton( "Cancel" ); 
+   S.Id(wxID_OK).AddButton( "OK" )->SetFocus(); 
+   S.EndHorizontalLay();
+   S.EndStatic();
+#endif
+
+   /*
+   Dlg.Fit();
+   Dlg.Move( 100,100 );
+   int id = Dlg.ShowModal();
+   */
+//printf("id = %d\n", id);
+   // return -1 for cancel, anything else for OK.
+//   return (id==wxID_CANCEL)?-1:42;
+   return 0;
+}
+
+
+}
+
diff --git a/lib-src/mod-script-pipe/ScripterCallback.h b/lib-src/mod-script-pipe/ScripterCallback.h
new file mode 100644
index 0000000..d126d27
--- /dev/null
+++ b/lib-src/mod-script-pipe/ScripterCallback.h
@@ -0,0 +1,38 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the LIBSCRIPT_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// SCRIPT_PIPE_DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+
+
+/* Magic for dynamic library import and export. This is unfortunately
+ * compiler-specific because there isn't a standard way to do it. Currently it
+ * works with the Visual Studio compiler for windows, and for GCC 4+. Anything
+ * else gets all symbols made public, which gets messy */
+/* The Visual Studio implementation */
+#ifdef _MSC_VER
+   #define SCRIPT_PIPE_DLL_IMPORT _declspec(dllimport)
+   #ifdef BUILDING_SCRIPT_PIPE
+      #define SCRIPT_PIPE_DLL_API _declspec(dllexport)
+   #elif _DLL
+      #define SCRIPT_PIPE_DLL_API _declspec(dllimport)
+   #else
+      #define AUDACITY_DLL_API
+   #endif
+#endif //_MSC_VER
+
+/* The GCC implementation */
+#ifdef CC_HASVISIBILITY // this is provided by the configure script, is only
+// enabled for suitable GCC versions
+/* The incantation is a bit weird here because it uses ELF symbol stuff. If we 
+ * make a symbol "default" it makes it visible (for import or export). Making it
+ * "hidden" means it is invisible outside the shared object. */
+   #define SCRIPT_PIPE_DLL_IMPORT __attribute__((visibility("default")))
+   #ifdef BUILDING_SCRIPT_PIPE
+      #define SCRIPT_PIPE_DLL_API __attribute__((visibility("default")))
+   #else
+      #define SCRIPT_PIPE_DLL_API __attribute__((visibility("default")))
+   #endif
+#endif
diff --git a/lib-src/mod-script-pipe/mod-script-pipe.vcproj b/lib-src/mod-script-pipe/mod-script-pipe.vcproj
new file mode 100644
index 0000000..0e1bd83
--- /dev/null
+++ b/lib-src/mod-script-pipe/mod-script-pipe.vcproj
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="mod-script-pipe"
+	ProjectGUID="{85774A29-EA2F-4A40-994F-6BE593D847A5}"
+	RootNamespace="mod-script-pipe"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug wx284|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(WXWIN)\lib\vc_dll\mswd&quot;;&quot;$(WXWIN)\include&quot;"
+				PreprocessorDefinitions="BUILDING_SCRIPT_PIPE;WXUSINGDLL;WIN32;_DEBUG;_WINDOWS;_USRDLL"
+				RuntimeLibrary="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="wxmsw28d_core.lib wxbase28d.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib"
+				OutputFile="$(OutDir)\modules\$(ProjectName).dll"
+				AdditionalLibraryDirectories="&quot;$(WXWIN)\lib\vc_dll&quot;"
+				GenerateDebugInformation="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Modular_Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(WXWIN)\lib\vc_dll\mswd&quot;;&quot;$(WXWIN)\include&quot;"
+				PreprocessorDefinitions="BUILDING_SCRIPT_PIPE;WXUSINGDLL;WIN32;_DEBUG;_WINDOWS;_USRDLL"
+				RuntimeLibrary="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="wxmsw28d_core.lib wxbase28d.lib odbc32.lib odbccp32.lib oldnames.lib comctl32.lib rpcrt4.lib wsock32.lib netapi32.lib"
+				OutputFile="$(OutDir)\modules\$(ProjectName).dll"
+				AdditionalLibraryDirectories="&quot;$(WXWIN)\lib\vc_dll&quot;"
+				GenerateDebugInformation="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;h;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\PipeServer.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\ScripterCallback.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\ScripterCallback.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portaudio-v19/libtool22.patch b/lib-src/portaudio-v19/libtool22.patch
new file mode 100644
index 0000000..4780c9d
--- /dev/null
+++ b/lib-src/portaudio-v19/libtool22.patch
@@ -0,0 +1,13 @@
+Index: audacity-src-1.3.5-beta/lib-src/portaudio-v19/Makefile.in
+===================================================================
+--- audacity-src-1.3.5-beta.orig/lib-src/portaudio-v19/Makefile.in
++++ audacity-src-1.3.5-beta/lib-src/portaudio-v19/Makefile.in
+@@ -39,7 +39,7 @@ OTHER_OBJS = @OTHER_OBJS@
+ PALIB = libportaudio.la
+ PAINC = include/portaudio.h
+ 
+-PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
++PA_LDFLAGS = $(LDFLAGS) -rpath $(libdir) -no-undefined \
+ 	     -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa)_.*" \
+ 	     -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+ 
diff --git a/lib-src/portmidi/CHANGELOG.txt b/lib-src/portmidi/CHANGELOG.txt
new file mode 100644
index 0000000..986137e
--- /dev/null
+++ b/lib-src/portmidi/CHANGELOG.txt
@@ -0,0 +1,168 @@
+/* CHANGELOG FOR PORTMIDI
+ *
+ * 02Jan09 Roger Dannenberg
+ * - Created Java interface and wrote PmDefaults application to set
+ *   values for Pm_GetDefaultInputDeviceID() and 
+ *   Pm_GetDefaultOutputDeviceID(). Other fixes.
+ *
+ * 19Jun08 Roger Dannenberg and Austin Sung
+ * - Removed USE_DLL_FOR_CLEANUP -- Windows 2000 through Vista seem to be
+ *   fixed now, and can recover if MIDI ports are left open
+ * - Various other minor patches
+ *
+ * 17Jan07 Roger Dannenberg
+ * - Lots more help for Common Lisp user in pm_cl
+ * - Minor fix to eliminate a compiler warning
+ * - Went back to single library in OS X for both portmidi and porttime
+ *
+ * 16Jan07 Roger Dannenberg
+ * - OOPS! fixed bug where short messages all had zero data
+ * - Makefile.osx static library build now makes universal (i386 + ppc)
+ *    binaries
+ *
+ * 15Jan07 Roger Dannenberg
+ *  - multiple rewrites of sysex handling code to take care of 
+ *     error-handling, embedded messages, message filtering,
+ *     driver bugs, and host limitations.
+ *  - fixed windows to use dwBufferLength rather than 
+ *     dwBytesRecorded for long buffer output (fix by Nigel Brown)
+ *  - Win32 MME code always appends an extra zero to long buffer
+ *     output to work around a problem with earlier versions of Midi Yoke
+ *  - Added mm, a command line Midi Monitor to pm_test suite
+ *  - Revised copyright notice to match PortAudio/MIT license (requests 
+ *     are moved out of the license proper and into a separate paragraph)
+ *
+ * 18Oct06 Roger Dannenberg
+ *  - replace FIFO in pmutil with Light Pipe-based multiprocessor-safe alg.
+ *  - replace FIFO in portmidi.c with PmQueue from pmutil
+ *
+ * 07Oct06 cpr & Roger Dannenberg
+ *  - overhaul of CoreMIDI input to handle running status and multiple
+ *  -    messages per packet, with additional error detection
+ *  - added Leigh Smith and Rick Taube support for Common Lisp and
+ *  -    dynamic link libraries in OSX
+ *  - initialize static global seq = NULL in pmlinuxalsa.c
+ *
+ * 05Sep06 Sebastien Frippiat
+ *  - check if (ALSA) seq exists before closing it in pm_linuxalsa_term()
+ *
+ * 05Sep06 Andreas Micheler and Cecilio
+ *  - fixed memory leak by freeing someo objects in pm_winmm_term()
+ *  - and another leak by freeing descriptors in Pm_Terminate()
+ *
+ * 23Aug06 RBD
+ *  - various minor fixes
+ *
+ * 04Nov05 Olivier Tristan
+ *  - changes to OS X to properly retrieve real device name on CoreMidi
+ *
+ * 19Jul05 Roger Dannenberg
+ *  - included pmBufferMaxSize in Pm_GetErrorText()
+ *
+ * 23Mar05 Torgier Strand Henriksen
+ *  - cleaner termination of porttime thread under Linux
+ *
+ * 15Nov04 Ben Allison
+ *  - sysex output now uses one buffer/message and reallocates buffer
+ *  -    if needed
+ *  - filters expanded for many message types and channels
+ *  - detailed changes are as follows:
+ *  ------------- in pmwinmm.c --------------
+ *  - new #define symbol: OUTPUT_BYTES_PER_BUFFER
+ *  - change SYSEX_BYTES_PER_BUFFER to 1024
+ *  - added MIDIHDR_BUFFER_LENGTH(x) to correctly count midihdr buffer length
+ *  - change MIDIHDR_SIZE(x) to (MIDIHDR_BUFFER_LENGTH(x) + sizeof(MIDIHDR))
+ *  - change allocate_buffer to use new MIDIHDR_BUFFER_LENGTH macro
+ *  - new macros for MIDIHDR_SYSEX_SIZE and MIDIHDR_SYSEX_BUFFER_LENGTH 
+ *  -    similar to above, but counts appropriately for sysex messages
+ *  - added the following members to midiwinmm_struct for sysex data:
+ *  -    LPMIDIHDR *sysex_buffers;   ** pool of buffers for sysex data **
+ *  -    int num_sysex_buffers;      ** how many sysex buffers **
+ *  -    int next_sysex_buffer;      ** index of next sysexbuffer to send **
+ *  -    HANDLE sysex_buffer_signal; ** to wait for free sysex buffer **
+ *  - duplicated allocate_buffer, alocate_buffers and get_free_output_buffer 
+ *  -    into equivalent sysex_buffer form
+ *  - changed winmm_in_open to initialize new midiwinmm_struct members and 
+ *  -    to use the new allocate_sysex_buffer() function instead of 
+ *  -    allocate_buffer()
+ *  - changed winmm_out_open to initialize new members, create sysex buffer 
+ *  -    signal, and allocate 2 sysex buffers
+ *  - changed winmm_out_delete to free sysex buffers and shut down the sysex
+ *  -    buffer signal
+ *  - create new function resize_sysex_buffer which resizes m->hdr to the 
+ *  -    passed size, and corrects the midiwinmm_struct accordingly.
+ *  - changed winmm_write_byte to use new resize_sysex_buffer function,
+ *  -    if resize fails, write current buffer to output and continue
+ *  - changed winmm_out_callback to use buffer_signal or sysex_buffer_signal
+ *  -    depending on which buffer was finished
+ *  ------------- in portmidi.h --------------
+ *  - added pmBufferMaxSize to PmError to indicate that the buffer would be
+ *  -    too large for the underlying API
+ *  - added additional filters
+ *  - added prototype, documentation, and helper macro for Pm_SetChannelMask
+ *  ------------- in portmidi.c --------------
+ *  - added pm_status_filtered() and pm_realtime_filtered() functions to
+ *       separate filtering logic from buffer logic in pm_read_short
+ *  - added Pm_SetChannelMask function
+ *  - added pm_channel_filtered() function
+ *  ------------- in pminternal.h --------------
+ *  - added member to PortMidiStream for channel mask
+ *
+ * 25May04 RBD
+ *  - removed support for MIDI THRU
+ *  - moved filtering from Pm_Read to pm_enqueue to avoid buffer ovfl
+ *  - extensive work on Mac OS X port, especially sysex and error handling
+ *
+ * 18May04 RBD
+ *  - removed side-effects from assert() calls. Now you can disable assert().
+ *  - no longer check pm_hosterror everywhere, fixing a bug where an open
+ *    failure could cause a write not to work on a previously opened port
+ *    until you call Pm_GetHostErrorText().
+ * 16May04 RBD and Chris Roberts
+ *  - Some documentation wordsmithing in portmidi.h
+ *  - Dynamically allocate port descriptor structures
+ *  - Fixed parameter error in midiInPrepareBuffer and midiInAddBuffer.
+ *
+ * 09Oct03 RBD
+ *  - Changed Thru handling. Now the client does all the work and the client
+ *    must poll or read to keep thru messages flowing.
+ *
+ * 31May03 RBD
+ *  - Fixed various bugs.
+ *  - Added linux ALSA support with help from Clemens Ladisch
+ *  - Added Mac OS X support, implemented by Jon Parise, updated and 
+ *       integrated by Andrew Zeldis and Zico Kolter
+ *  - Added latency program to build histogram of system latency using PortTime.
+ *
+ * 30Jun02 RBD Extensive rewrite of sysex handling. It works now.
+ *             Extensive reworking of error reporting and error text -- no
+ *             longer use dictionary call to delete data; instead, Pm_Open
+ *             and Pm_Close clean up before returning an error code, and 
+ *             error text is saved in a system-independent location.
+ *             Wrote sysex.c to test sysex message handling.
+ *
+ * 15Jun02 BCT changes:
+ *  - Added pmHostError text handling.
+ *  - For robustness, check PortMidi stream args not NULL.
+ *  - Re-C-ANSI-fied code (changed many C++ comments to C style)
+ *  - Reorganized code in pmwinmm according to input/output functionality (made
+ *    cleanup handling easier to reason about)
+ *  - Fixed Pm_Write calls (portmidi.h says these should not return length but Pm_Error)
+ *  - Cleaned up memory handling (now system specific data deleted via dictionary
+ *    call in PortMidi, allows client to query host errors).
+ *  - Added explicit asserts to verify various aspects of pmwinmm implementation behaves as
+ *    logic implies it should. Specifically: verified callback routines not reentrant and
+ *    all verified status for all unchecked Win32 MMedia API calls perform successfully
+ *  - Moved portmidi initialization and clean-up routines into DLL to fix Win32 MMedia API 
+ *    bug (i.e. if devices not explicitly closed, must reboot to debug application further).
+ *    With this change, clients no longer need explicitly call Pm_Initialize, Pm_Terminate, or
+ *    explicitly Pm_Close open devices when using WinMM version of PortMidi.
+ *
+ * 23Jan02 RBD Fixed bug in pmwinmm.c thru handling
+ *
+ * 21Jan02 RBD Added tests in Pm_OpenInput() and Pm_OpenOutput() to prevent 
+ *               opening an input as output and vice versa.
+ *             Added comments and documentation.
+ *             Implemented Pm_Terminate().
+ *
+ */
diff --git a/lib-src/portmidi/Doxyfile b/lib-src/portmidi/Doxyfile
new file mode 100644
index 0000000..0adb682
--- /dev/null
+++ b/lib-src/portmidi/Doxyfile
@@ -0,0 +1,1472 @@
+# Doxyfile 1.5.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = PortMidi
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 2.2.x
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, 
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), 
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, 
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, 
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter 
+# and setter methods for a property. Setting this option to YES (the default) 
+# will make doxygen to replace the get and set methods by a property in the 
+# documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
+# 1.5.7
+#IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is 
+# probably good enough. For larger projects a too small cache size can cause 
+# doxygen to be busy swapping symbols to and from disk most of the time 
+# causing a significant performance penality. 
+# If the system has enough physical memory increasing the cache will improve the 
+# performance by keeping more symbols in memory. Note that the value works on 
+# a logarithmic scale so increasing the size by one will rougly double the 
+# memory usage. The cache size is given by this formula: 
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols
+# 1.5.7
+# SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = NO
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
+# 1.5.7
+# SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page.  This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+# 1.5.7
+# SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
+# doxygen. The layout file controls the global structure of the generated output files 
+# in an output format independent way. The create the layout file that represents 
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
+# of the layout file.
+# 1.5.7
+# LAYOUT_FILE            = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = \
+		         pm_common/portmidi.h \
+		         pm_common/portmidi.c \
+
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          = *.h \
+                         *.c 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = ./pm_test
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *.cxx \
+                         *.h \
+                         *.H \
+                         *.fl
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = Pm_
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET        = YES
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+# 1.5.7
+# CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
+# are set, an additional index file will be generated that can be used as input for 
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
+# HTML documentation.
+# 1.5.7
+# GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+# 1.5.7
+# QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+# 1.5.7
+# QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+# 1.5.7
+# QHP_VIRTUAL_FOLDER     = doc
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file .
+# 1.5.7
+# QHG_LOCATION           = 
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature. Other possible values 
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW      = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 200
+
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
+# 1.5.7
+# FORMULA_FONTSIZE       = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = YES
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = FL_DOXYGEN \
+                         HAVE_CAIRO \
+                         HAVE_GL \
+                         HAVE_GL_OVERLAY \
+                         FL_EXPORT:=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
+# default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output 
+# directory and reference it in all dot files that doxygen generates. This 
+# font does not include all possible unicode characters however, so when you need 
+# these (or just want a differently looking font) you can specify the font name 
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
+# which can be done by putting it in a standard location or by setting the 
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
+# containing the font.
+# 1.5.7
+# DOT_FONTNAME           = FreeSans
+
+# By default doxygen will tell dot to use the output directory to look for the 
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
+# different font using DOT_FONTNAME you can set the path where dot 
+# can find it using this tag.
+# 1.5.7
+# DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
diff --git a/lib-src/portmidi/README.txt b/lib-src/portmidi/README.txt
new file mode 100644
index 0000000..96453be
--- /dev/null
+++ b/lib-src/portmidi/README.txt
@@ -0,0 +1,80 @@
+README for PortMidi
+
+Roger B. Dannenberg
+
+VERSION: please use "svn info" to get info.
+
+Documentation for PortMidi is found in pm_common/portmidi.h.
+
+Additional documentation:
+  - Windows: see pm_win/README_WIN.txt and pm_win/debugging_dlls.txt
+  - Linux: see pm_linux/README_LINUX.txt
+  - Mac OSX: see pm_mac/README_MAC.txt
+  - Common Lisp: see pm_cl/README_CL.txt
+
+---------- some notes on the design of PortMidi ----------
+
+POINTERS VS DEVICE NUMBERS
+
+When you open a MIDI port, PortMidi allocates a structure to
+maintain the state of the open device. Since every device is
+also listed in a table, you might think it would be simpler to
+use the table index rather than a pointer to identify a device.
+This would also help with error checking (it's hard to make
+sure a pointer is valid). PortMidi's design parallels that of
+PortAudio.
+
+ERROR HANDLING
+
+Error handling turned out to be much more complicated than expected.
+PortMidi functions return error codes that the caller can check.
+In addition, errors may occur asynchronously due to MIDI input.
+However, for Windows, there are virtually no errors that can
+occur if the code is correct and not passing bogus values. One
+exception is an error that the system is out of memory, but my
+guess is that one is unlikely to recover gracefully from that.
+Therefore, all errors in callbacks are guarded by assert(), which
+means not guarded at all in release configurations.
+
+Ordinarily, the caller checks for an error code. If the error is
+system-dependent, pmHostError is returned and the caller can
+call Pm_GetHostErrorText to get a text description of the error.
+
+Host error codes are system-specific and are recorded in the
+system-specific data allocated for each open MIDI port.
+However, if an error occurs on open or close,
+we cannot store the error with the device because there will be
+no device data (assuming PortMidi cleans up after devices that
+are not open). For open and close, we will convert the error
+to text, copy it to a global string, and set pm_hosterror, a
+global flag.
+
+Similarly, whenever a Read or Write operation returns pmHostError,
+the corresponding error string is copied to a global string
+and pm_hosterror is set. This makes getting error strings
+simple and uniform, although it does cost a string copy and some
+overhead even if the user does not want to look at the error data.
+
+The system-specific Read, Write, Poll, etc. implementations should
+check for asynchronous errors and return immediately if one is
+found so that these get reported. This happens in the Mac OS X
+code, where lots of things are happening in callbacks, but again,
+in Windows, there are no error codes recorded in callbacks.
+
+DEBUGGING
+
+If you are building a console application for research, we suggest
+compiling with the option PM_CHECK_ERRORS. This will insert a
+check for error return values at the end of each PortMidi
+function. If an error is encountered, a text message is printed
+using printf(), the user is asked to type ENTER, and then exit(-1)
+is called to clean up and terminate the program.
+
+You should not use PM_CHECK_ERRORS if printf() does not work
+(e.g. this is not a console application under Windows, or there
+is no visible console on some other OS), and you should not use
+PM_CHECK_ERRORS if you intend to recover from errors rather than
+abruptly terminate the program.
+
+The Windows version (and perhaps others) also offers a DEBUG
+compile-time option. See README_WIN.txt.
diff --git a/lib-src/portmidi/license.txt b/lib-src/portmidi/license.txt
new file mode 100644
index 0000000..c757b37
--- /dev/null
+++ b/lib-src/portmidi/license.txt
@@ -0,0 +1,40 @@
+/*
+ * PortMidi Portable Real-Time MIDI Library
+ *
+ * license.txt -- a copy of the PortMidi copyright notice and license information
+ *
+ * Latest version available at: http://sourceforge.net/projects/portmedia
+ *
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ * Copyright (c) 2001-2009 Roger B. Dannenberg
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortMidi license; however, 
+ * the PortMusic community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
diff --git a/lib-src/portmidi/pm_cl/README_CL.txt b/lib-src/portmidi/pm_cl/README_CL.txt
new file mode 100644
index 0000000..be4c635
--- /dev/null
+++ b/lib-src/portmidi/pm_cl/README_CL.txt
@@ -0,0 +1,104 @@
+README_CL.txt for PortMidi
+Roger B. Dannenberg
+17 Jan 2007
+
+This is a Common Lisp interface to PortMidi.
+
+On Mac OSX, you need to build PortMidi as a dynamic link library
+before you can use PortMidi from Common Lisp.
+
+You can build PortMidi as a dynamic link library by running this:
+
+cd portmidi
+make -F pm_mac/Makefile.osx install-with-xcode
+
+This is just a shortcut for:
+
+cd portmidi/pm_mac
+sudo xcodebuild -project pm_mac.xcodeproj -configuration Deployment install DSTROOT=/
+
+You can check the file and the architecture for which it is built using:
+    file /usr/local/lib/libportmidi.dylib
+
+If you've done this install of portmidi, then you should also have 
+   /usr/local/include/portmidi.h
+This will be necessary to successfully build the cffi interface below.
+
+To test PortMidi with Common Lisp, I (RBD) am using SBCL, which I 
+downloaded from http://prdownloads.sourceforge.net/sbcl. Currently, I use 
+    sbcl-0.9.17-x86-darwin-binary.tar.bz2
+To install this, I unpacked it by just double-clicking in the finder. Then, 
+from a command window, I became root using "sudo sh", and then typed:
+# INSTALL_ROOT=/usr/local
+# sh install.sh
+# exit
+
+I also downloaded cffi-061012.tar.gz from 
+    http://common-lisp.net/project/cffi/tarballs/?M=D
+
+To compile cffi, use the following, where "/Lisp/cffi/" is replaced by 
+the actual directory of cffi, e.g. 
+    "/Users/rbd/sbcl-0.9.17-x86-darwin/cffi-061012":
+
+% sbcl
+* (require 'asdf)
+* (push "/Lisp/cffi/" asdf:*central-registry*)
+* (asdf:oos 'asdf:load-op :cffi)
+* (quit)
+
+Download Common Music's portmidi module from cvs and build the c side:
+(Replace "/Lisp" with your lisp directory, e.g. 
+"/Users/rbd/sbcl-0.9.17-x86-darwin". These cvs commands will create
+a new directory, portmidi.)
+
+% cd /Lisp
+% export CVSROOT=:pserver:anonymous at commonmusic.cvs.sourceforge.net:/cvsroot/commonmusic
+% cvs login   # press Return at password prompt
+% cvs checkout portmidi
+% cd portmidi
+% ./configure
+% make
+% cd ..
+
+Now compile/load the portmidi module just like cffi. Again, change
+"/Lisp/cffi/" and "/Lisp/portmidi" to correspond to your local file system.
+(Note that /Lisp becomes your lisp directory, and "cffi" becomes your
+cffi folder name, e.g. "cffi-061012".
+
+% sbcl
+* (require 'asdf)
+* (push "/Lisp/cffi/" asdf:*central-registry*)
+* (asdf:oos 'asdf:load-op :cffi)
+* (push "/Lisp/portmidi/" asdf:*central-registry*)
+* (asdf:oos 'asdf:load-op :portmidi)
+
+Look in the file /Lisp/portmidi/test.lisp for a test of the lisp interface to
+portmidi. For example, while still running sbcl:
+
+* (pm:portmidi)  ; initialize portmidi
+* (pt:start) ; start time
+* (pt:time) ; get time
+* (pprint (pm:GetDeviceInfo)) ; get list of devices
+((:ID 0 :NAME "IAC Driver Bus 1" :TYPE :INPUT :OPEN NIL)
+ (:ID 1 :NAME "IAC Driver Bus 1" :TYPE :OUTPUT :OPEN NIL))
+
+Notice that test.lisp assumes MIDI input devices are connected
+and uses some hard-wired device numbers, so it may not run
+as is without error.
+
+Since test.lisp uses some Common Music calls, I (RBD) wrote a
+simpler test, test-no-cm.lisp, which is in the same folder as
+this (README_CL.txt) file. To use it, first check that the 
+values for outid (4) and inid (1) actually match PortMidi device
+id's for output and input devices, and make sure the input
+device is a keyboard that can generate a middle-C -- otherwise
+the program will hang waiting for input. Run sbcl from this
+pm_cl folder, and type:
+
+(load "test-no-cm.lisp")
+
+The program pauses frequently by calling (READ), so you
+should type t or something, then <RETURN> to continue.
+
+
+(Thanks to Leigh Smith and Rick Taube)
diff --git a/lib-src/portmidi/pm_cl/cffi-portmidi.lisp b/lib-src/portmidi/pm_cl/cffi-portmidi.lisp
new file mode 100644
index 0000000..a94c4fb
--- /dev/null
+++ b/lib-src/portmidi/pm_cl/cffi-portmidi.lisp
@@ -0,0 +1,387 @@
+;;; **********************************************************************
+;;; Copyright (C) 2005 Heinrich Taube, <taube (at) uiuc (dot) edu>
+;;;
+;;; This program is free software; you can redistribute it and/or
+;;; modify it under the terms of the Lisp Lesser Gnu Public License.
+;;; See http://www.cliki.net/LLGPL for the text of this agreement.
+;;; **********************************************************************
+
+;;; $Name:  $
+;;; $Revision: 1.1 $
+;;; $Date: 2009/06/24 20:37:25 $
+
+;;; A CFFI interface to Portmidi. Should run in most Common Lisp
+;;; implementations on Linux, OS X and Windows. For information about
+;;; CFFI see http://common-lisp.net/project/cffi/
+
+(in-package :cl-user)
+
+(defvar *libportmidi*
+  (let ((type #+(or darwin macos macosx) "dylib"
+              #+(or linux linux-target (and unix pc386) freebsd) "so"
+              #+(or win32 microsoft-32 cygwin) "dll")
+        (paths (list "/usr/lib/" "/usr/local/lib/" *load-pathname*)))
+    (loop for d in paths
+       for p = (make-pathname :name "libportmidi" :type type 
+                              :defaults d)
+       when (probe-file p) do (return p)
+       finally  
+         (error "Library \"portmidi.~A\" not found. Fix *libportmidi*."
+                type))))
+
+;;; linux: guess i need to load porttime.so first (?) osx doesnt seem
+;;; to need this lib at all...
+
+#+(or linux (and clisp unix (not macos)))
+(let ((lpt (merge-pathnames "libporttime" *libportmidi*)))
+  (if (probe-file lpt)
+      (cffi:load-foreign-library lpt)
+      (error "Porttime: ~a not found. Fix *libportmidi* path." lpt)))
+
+;;; load portmidi lib
+
+(cffi:load-foreign-library *libportmidi*)
+
+(defpackage :portmidi
+  (:use :common-lisp) 
+  (:nicknames :pm :pt)
+  (:shadow :initialize :terminate :time :start :stop :abort 
+           :close :read :write :poll)
+  (:export :Initialize :Terminate 
+           :HasHostError :GetErrorText :GetHostErrorText 
+           :CountDevices :GetDefaultInputDeviceID
+           :GetDefaultOutputDeviceID :GetDeviceInfo
+           :Message :Message.status :Message.data1 :Message.data2
+           :Event.message :Event.timestamp 
+           ;; event buffers added to api
+           :EventBufferNew :EventBufferFree :EventBufferElt
+           :EventBufferMap
+           :OpenInput :OpenOutput :SetFilter :SetChannelMask
+           :Abort :Close :Read :Write :Poll :WriteShort :WriteSysex
+           ;; filtering constants
+           :filt-active :filt-sysex :filt-clock :filt-play :filt-f9 
+           :filt-fd :filt-reset :filt-note :filt-channel-aftertouch
+           :filt-poly-aftertouch :filt-program :filt-control
+           :filt-pitchbend :filt-mtc :filt-song-position 
+           :filt-song-select :filt-tune :filt-tick :filt-undefined
+           :filt-realtime  :filt-aftertouch :filt-systemcommon
+           ;; porttime.
+           :Start :Stop :Started :Time
+           ;; initialization insurers added to api
+           :portmidi :*portmidi* ))
+
+(in-package :portmidi)
+
+(cffi:defcstruct pm-device-info 
+		 (struct-version :int) 
+		 (interf :pointer) 
+		 (name :pointer) 
+		 (input :int) 
+		 (output :int) 
+		 (opened :int))
+
+(cffi:define-foreign-type pm-message () ':long)
+(cffi:define-foreign-type pm-timestamp () ':long)
+(cffi:defcstruct pm-event 
+		 (message pm-message) 
+		 (timestamp pm-timestamp))
+(cffi:define-foreign-type pm-error () ':int)
+
+(cffi:define-foreign-type port-midi-stream () ':void)
+(cffi:define-foreign-type pm-device-id () ':int)
+(cffi:define-foreign-type pm-time-proc-ptr () ':pointer)
+(cffi:defcfun ("Pm_WriteSysEx" pm-write-sys-ex) pm-error (stream :pointer) (when pm-timestamp) (msg :pointer)) 
+(cffi:defcfun ("Pm_WriteShort" pm-write-short) pm-error (stream :pointer) (when pm-timestamp) (msg :long)) 
+(cffi:defcfun ("Pm_Write" pm-write) pm-error (stream :pointer) (buffer :pointer) (length :long)) 
+(cffi:defcfun ("Pm_Poll" pm-poll) pm-error (stream :pointer)) 
+(cffi:defcfun ("Pm_Read" pm-read) pm-error (stream :pointer) (buffer :pointer) (length :long)) 
+(cffi:defcfun ("Pm_Close" pm-close) pm-error (stream :pointer)) 
+(cffi:defcfun ("Pm_Abort" pm-abort) pm-error (stream :pointer)) 
+;(cffi:defcfun ("Pm_SetChannelMask" pm-set-channel-mask) pm-error (stream :pointer) (mask :int)) 
+(cffi:defcfun ("Pm_SetFilter" pm-set-filter) pm-error (stream :pointer) (filters :long)) 
+(cffi:defcfun ("Pm_OpenOutput" pm-open-output) pm-error (stream :pointer) (output-device pm-device-id) (output-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer) (latency :long)) 
+(cffi:defcfun ("Pm_OpenInput" pm-open-input) pm-error (stream :pointer) (input-device pm-device-id) (input-driver-info :pointer) (buffer-size :long) (time-proc pm-time-proc-ptr) (time-info :pointer)) 
+(cffi:defcfun ("Pm_GetDeviceInfo" pm-get-device-info) :pointer (id pm-device-id)) 
+(cffi:defcfun ("Pm_GetDefaultOutputDeviceID" pm-get-default-output-device-id) pm-device-id) 
+(cffi:defcfun ("Pm_GetDefaultInputDeviceID" pm-get-default-input-device-id) pm-device-id) 
+(cffi:defcfun ("Pm_CountDevices" pm-count-devices) :int) 
+(cffi:defcfun ("Pm_GetHostErrorText" pm-get-host-error-text) :void (msg :pointer) (len :unsigned-int)) 
+(cffi:defcfun ("Pm_GetErrorText" pm-get-error-text) :pointer (errnum pm-error)) 
+(cffi:defcfun ("Pm_HasHostError" pm-has-host-error) :int (stream :pointer)) 
+(cffi:defcfun ("Pm_Terminate" pm-terminate) pm-error) 
+(cffi:defcfun ("Pm_Initialize" pm-initialize) pm-error)
+
+;;; porttime.h
+
+(cffi:define-foreign-type pt-error () ':int)
+(cffi:define-foreign-type pt-timestamp () ':long)
+(cffi:defcfun ("Pt_Start" pt-start) pt-error (a :int) (b :pointer) (c :pointer))
+(cffi:defcfun ("Pt_Stop" pt-stop) pt-error )
+(cffi:defcfun ("Pt_Started" pt-started) :int)
+(cffi:defcfun ("Pt_Time" pt-time) pt-timestamp)
+ 
+(defconstant true 1) 
+(defconstant false 0)
+(defconstant pmNoError 0)
+(defconstant pmHostError -10000)
+(defconstant pm-no-device -1)
+(defconstant pm-default-sysex-buffer-size 1024) 
+(defconstant filt-active 1) 
+(defconstant filt-sysex 2) 
+(defconstant filt-clock 4) 
+(defconstant filt-play 8) 
+(defconstant filt-f9 16) 
+(defconstant filt-fd 32) 
+(defconstant filt-reset 64) 
+(defconstant filt-note 128) 
+(defconstant filt-channel-aftertouch 256) 
+(defconstant filt-poly-aftertouch 512) 
+(defconstant filt-program 1024) 
+(defconstant filt-control 2048) 
+(defconstant filt-pitchbend 4096) 
+(defconstant filt-mtc 8192) 
+(defconstant filt-song-position 16384) 
+(defconstant filt-song-select 32768) 
+(defconstant filt-tune 65536) 
+(defconstant filt-tick filt-f9)
+(defconstant filt-undefined (logior filt-f9 filt-fd))
+(defconstant filt-realtime (logior filt-active filt-sysex
+                                      filt-clock filt-play
+                                      filt-undefined filt-reset))
+(defconstant filt-aftertouch (logior filt-channel-aftertouch
+                                        filt-poly-aftertouch ))
+(defconstant filt-systemcommon (logior filt-mtc filt-song-position
+                                          filt-song-select filt-tune))
+(defvar *portmidi* nil) ; t if loaded
+
+;;;
+;;; utils
+;;;
+
+(defvar host-error-text (make-string 256 :initial-element #\*))
+
+(defmacro with-pm-error (form)
+  (let ((v (gensym)))
+    `(let ((,v ,form))
+       (if (not (= ,v pmNoError))
+	   (if (= ,v pmHostError)
+	       (cffi:with-foreign-string (host-error host-error-text)
+		 (pm-get-host-error-text host-error
+					 (length host-error-text))
+		 (error "Host error is: ~a"
+			(cffi:foreign-string-to-lisp host-error)))
+	       (error (cffi:foreign-string-to-lisp
+		       (pm-get-error-text ,v))))
+           ,v))))
+
+(defun portmidi ()
+  ;; initializer, call before using lib
+  (or *portmidi*
+      (progn (pm-initialize)
+             (setq *portmidi* t))))
+
+(defun Message (status data1 data2)
+  ;; portmidi messages are just unsigneds
+  (logior (logand (ash data2 16) #xFF0000)
+          (logand (ash data1 08) #xFF00)
+          (logand status #xFF)))
+
+(defun Message.status (m)
+  (logand m #xFF))
+
+(defun Message.data1 (m)
+  (logand (ash m -08) #xFF))
+
+(defun Message.data2 (m)
+  (logand (ash m -16) #xFF))
+
+;;; accessors 
+
+(defun DeviceInfo.interf (ptr)
+  (cffi:foreign-string-to-lisp 
+   (cffi:foreign-slot-value ptr 'pm-device-info 'interf)))
+
+(defun DeviceInfo.name (ptr)
+  (cffi:foreign-string-to-lisp
+   (cffi:foreign-slot-value ptr 'pm-device-info 'name)))
+
+(defun DeviceInfo.input (ptr)
+  (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'input) 0)
+      nil
+    t))
+
+(defun DeviceInfo.output (ptr)
+  (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'output) 0)
+      nil
+    t))
+
+(defun DeviceInfo.opened (ptr)
+  (if (= (cffi:foreign-slot-value ptr 'pm-device-info 'opened) 0)
+      nil
+    t))
+
+(defun Event.message (e &optional (v nil vp))
+  (if vp
+      (progn 
+	(setf (cffi:foreign-slot-value e 'pm-event 'message) v)
+	v)
+    (cffi:foreign-slot-value e 'pm-event 'message)))
+    
+(defun Event.timestamp (e &optional (v nil vp))
+  (if vp
+      (progn 
+	(setf (cffi:foreign-slot-value e 'pm-event 'timestamp) v)
+	v)
+    (cffi:foreign-slot-value e 'pm-event 'timestamp)))
+
+;;; functions
+
+(defun Initialize ()
+  (with-pm-error (pm-initialize)))
+
+(defun terminate ()
+  (with-pm-error (pm-terminate)))
+
+
+(defun HasHostError (pms) 
+  (pm-has-host-error pms))
+
+(defun GetErrorText (err) 
+  (pm-get-error-text err))
+
+; how do i do this?
+;(progn
+;  (defalien "pm-GetHostErrorText" void (a c-string) (b unsigned-int))
+;  (defun GetHostErrorText () 
+;    (pm-GetHostErrorText 256)))
+
+(defun CountDevices ()
+  (portmidi)
+  (pm-count-devices ))
+
+(defun GetDefaultInputDeviceID ()
+  (let ((id (pm-get-default-input-device-id )))
+    (if (= id pm-no-device) nil id)))
+
+(defun GetDefaultOutputDeviceID ()
+  (let ((id (pm-get-default-output-device-id )))
+    (if (= id pm-no-device) nil id)))
+
+;replaced by lispy version end of file.
+;(defun GetDeviceInfo (id) (pm-get-device-info id))
+
+(defun OpenInput (device bufsiz)
+  ;; portmidi: timer must be running before opening
+  (unless (Started) (Start))
+  (cffi:with-foreign-object (p1 :pointer)
+    (let ((err (pm-open-input p1 device (cffi:null-pointer)
+                              bufsiz (cffi:null-pointer) (cffi:null-pointer))))
+        (if (= err pmNoError)
+            (cffi:mem-ref p1 :pointer)
+            (error (pm-get-error-text err))))))
+
+(defun OpenOutput (device bufsiz latency)
+  (unless (Started) (Start))
+  (cffi:with-foreign-object (p1 :pointer) ;(p (* PortMidi))
+    (let ((err (pm-open-output p1 device (cffi:null-pointer)
+                               bufsiz (cffi:null-pointer) (cffi:null-pointer)
+                               latency)))
+      (if (= err pmNoError)
+          (cffi:mem-ref p1 :pointer)
+          (error (pm-get-error-text err))))))
+
+(defun SetFilter (a filts) 
+  (with-pm-error
+    (pm-set-filter a filts)))
+
+;(defun SetChannelMask (pms mask)
+;  (with-pm-error (pm-set-channel-mask pms mask)))
+
+(defun Abort (pms)
+  (with-pm-error (pm-abort pms)))
+
+(defun Close (pms)
+  (with-pm-error (pm-close pms)))
+
+(defun EventBufferFree (buf)
+  (cffi:foreign-free buf))
+
+(defun EventBufferNew (len)
+  (cffi:foreign-alloc 'pm-event :count len))
+
+(defun EventBufferElt (buf i)
+  ;; buf is POINTER to buf
+  (cffi:mem-aref buf 'pm-event i))
+
+(defun EventBufferSet (buffer index timestamp message)
+  (setf (cffi:foreign-slot-value
+         (cffi:mem-aref buffer 'pm-event index) 'pm-event 'timestamp)
+        timestamp)
+  (setf (cffi:foreign-slot-value
+         (cffi:mem-aref buffer 'pm-event index) 'pm-event 'message)
+        message)
+  (values))
+
+(defun EventBufferMap (fn buf end)
+  (loop for i below end
+     for e = (EventBufferElt buf i)
+     do (funcall fn (Event.message e) (Event.timestamp e)))
+ (values))
+
+(defun Read (pms *evbuf len) 
+  (let ((res (pm-read pms *evbuf len)))
+    (if (< res 0)
+        (error (pm-get-error-text res))
+        res)))
+
+(defun Poll (pms)
+  (let ((res (pm-poll pms)))
+    (cond ((= res 0) nil)
+          ((= res 1) t)
+          (t (error (pm-get-error-text res))))))
+
+(defun Write (pms *evbuf len)
+  (with-pm-error (pm-write pms *evbuf len)))
+
+(defun WriteShort (pms when msg)
+  (with-pm-error (pm-write-short pms when msg)))
+
+(defun WriteSysex (pms when string)
+  (cffi:with-foreign-string (ptr string)
+    (with-pm-error (pm-write-sys-ex pms when ptr))))
+
+;;; porttime.h
+
+(defun Started ()
+  (let ((res (pt-started)))
+    (if (= res false) nil t)))
+
+(defun Start ()
+  ;; NB: This has to be called before opening output or input.
+  ;; it seems that if its called 2x we get an error.
+  (unless (Started)
+    (with-pm-error (pt-start 1 (cffi:null-pointer) (cffi:null-pointer))))
+  (values))
+
+(defun Stop ()
+  (when (Started)
+    (with-pm-error (pt-stop)))
+  (values))
+
+(defun Time ()
+  (pt-time))
+
+(defun GetDeviceInfo (&optional id)
+  (flet ((getone (id)
+           (let ((d (pm-get-device-info id)))
+             (list :id id
+                   :name  (DeviceInfo.name d)
+                   :type (if (DeviceInfo.input d) ':input ':output)
+                   :open (DeviceInfo.opened d)))))
+    ;; make sure lib is initialized before checking devices
+    (portmidi)
+    (if id (getone id)
+        (loop for i below (CountDevices)
+           collect (getone i)))))
+
+(pushnew ':portmidi *features*)
diff --git a/lib-src/portmidi/pm_cl/test-no-cm.lisp b/lib-src/portmidi/pm_cl/test-no-cm.lisp
new file mode 100644
index 0000000..fd8527e
--- /dev/null
+++ b/lib-src/portmidi/pm_cl/test-no-cm.lisp
@@ -0,0 +1,112 @@
+;; this is a half-baked sequence of PortMidi calls to test the interface
+;; No calls to Common Music are made, hence test-no-cm.lisp
+
+; setup cffi if it has not been done already
+(if (not (boundp '*clpath*))
+    (load "setup-pm.lisp"))
+
+(defun println (s) (print s) (terpri))
+
+;; initialize portmidi lib
+(pm:portmidi)
+;; timer testing
+(pt:Start )
+(pt:Started)
+(format t "time is ~A, type something~%" (pt:Time))
+(read)
+(format t "time is ~A, type something~%" (pt:Time))
+(read)
+(pt:Time)
+(format t "time is ~A, type something~%" (pt:Time))
+
+;; device testing
+(pm:CountDevices)
+(pprint (pm:GetDeviceInfo ))
+(defparameter inid (pm:GetDefaultInputDeviceID ))
+(pm:GetDeviceInfo inid)
+(defparameter outid (pm:GetDefaultOutputDeviceID ))
+(pm:GetDeviceInfo outid)
+;; output testing
+(defparameter outid 4) ; 4 = my SimpleSynth
+(defparameter outdev (pm:OpenOutput outid 100 1000))
+(pm:getDeviceInfo outid) ; :OPEN should be T
+;; message tests
+(defun pm (m &optional (s t))
+  (format s "#<message :op ~2,'0x :ch ~2,'0d :data1 ~3,'0d :data2 ~3,'0d>"
+          (ash (logand (pm:Message.status m) #xf0) -4)
+          (logand (pm:Message.status m) #x0f)
+          (pm:Message.data1 m)
+          (pm:Message.data2 m)))
+(defparameter on (pm:message #b10010000 60 64))
+(terpri)
+(pm on)
+(pm:Message.status on)
+(logand (ash (pm:Message.status on) -4) #x0f)
+(pm:Message.data1 on)
+(pm:Message.data2 on)
+(pm:WriteShort outdev (+ (pm:time) 100) on)
+(defparameter off (pm:message #b10000000 60 64))
+(terpri)
+(pm off)
+(terpri)
+(println "type something for note off")
+(read)
+(pm:WriteShort outdev (+ (pm:time) 100) off)
+(println "type something to close output device")
+(read)
+(pm:Close outdev)
+;; event buffer testing
+(defparameter buff (pm:EventBufferNew 8))
+(loop for i below 8 for x = (pm:EventBufferElt buff i) 
+   ;; set buffer events
+   do
+     (pm:Event.message x (pm:message #b1001000 (+ 60 i) (+ 100 i)))
+     (pm:Event.timestamp x (* 1000 i)))
+(loop for i below 8 for x = (pm:EventBufferElt buff i) 
+   ;; check buffer contents
+   collect (list (pm:Event.timestamp x)
+                 (pm:Message.data1 (pm:Event.message x))
+                 (pm:Message.data2 (pm:Event.message x))))
+(pm:EventBufferFree buff)
+;; input testing -- requires external midi keyboard
+(println (pm:GetDeviceInfo ))
+(defparameter inid 1) ; 1 = my external keyboard
+(defparameter indev (pm:OpenInput inid 256)) 
+(pm:GetDeviceInfo inid) ; :OPEN should be T
+(pm:SetFilter indev pm:filt-realtime) ; ignore active sensing etc.
+(println "poll says:")
+(println (pm:Poll indev))
+(println "play midi keyboard and type something")
+(read)
+;;
+;; ...play midi keyboard, then ...
+;;
+(println "poll says")
+(println (pm:Poll indev))
+(defparameter buff (pm:EventBufferNew 32))
+(defparameter num (pm:Read indev buff 32))
+(println "pm:Read gets")
+(println num)
+(println "input messages:")
+(pm:EventBufferMap (lambda (a b) b (terpri) (pm a))
+                   buff num)
+(pm:Poll indev)
+
+(println "play keyboard, to stop, play middle-C")
+
+;;; recv testing
+
+(defparameter pitch 0)
+(loop while (/= pitch 60) do
+  (let ((n (pm:Read indev buff 1)))
+    (cond ((= n 1)
+           (pm:EventBufferMap
+                (lambda (a b) 
+                   b (pm a) (terpri)
+                   (setf pitch (pm:Message.data1 a)))
+                buff n)))))
+
+(pm:EventBufferFree buff)
+(pm:Close indev)
+
+
diff --git a/lib-src/portmidi/pm_common/pminternal.h b/lib-src/portmidi/pm_common/pminternal.h
new file mode 100644
index 0000000..9bfa76a
--- /dev/null
+++ b/lib-src/portmidi/pm_common/pminternal.h
@@ -0,0 +1,178 @@
+/* pminternal.h -- header for interface implementations */
+
+/* this file is included by files that implement library internals */
+/* Here is a guide to implementers:
+     provide an initialization function similar to pm_winmm_init()
+     add your initialization function to pm_init()
+     Note that your init function should never require not-standard
+         libraries or fail in any way. If the interface is not available,
+         simply do not call pm_add_device. This means that non-standard
+         libraries should try to do dynamic linking at runtime using a DLL
+         and return without error if the DLL cannot be found or if there
+         is any other failure.
+     implement functions as indicated in pm_fns_type to open, read, write,
+         close, etc.
+     call pm_add_device() for each input and output device, passing it a
+         pm_fns_type structure.
+     assumptions about pm_fns_type functions are given below.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int pm_initialized; /* see note in portmidi.c */
+
+/* these are defined in system-specific file */
+void *pm_alloc(size_t s);
+void pm_free(void *ptr);
+
+/* if an error occurs while opening or closing a midi stream, set these: */
+extern int pm_hosterror;
+extern char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
+ 
+struct pm_internal_struct;
+
+/* these do not use PmInternal because it is not defined yet... */
+typedef PmError (*pm_write_short_fn)(struct pm_internal_struct *midi, 
+                                     PmEvent *buffer);
+typedef PmError (*pm_begin_sysex_fn)(struct pm_internal_struct *midi,
+                                     PmTimestamp timestamp);
+typedef PmError (*pm_end_sysex_fn)(struct pm_internal_struct *midi,
+                                   PmTimestamp timestamp);
+typedef PmError (*pm_write_byte_fn)(struct pm_internal_struct *midi,
+                                    unsigned char byte, PmTimestamp timestamp);
+typedef PmError (*pm_write_realtime_fn)(struct pm_internal_struct *midi,
+                                        PmEvent *buffer);
+typedef PmError (*pm_write_flush_fn)(struct pm_internal_struct *midi,
+                                     PmTimestamp timestamp);
+typedef PmTimestamp (*pm_synchronize_fn)(struct pm_internal_struct *midi);
+/* pm_open_fn should clean up all memory and close the device if any part
+   of the open fails */
+typedef PmError (*pm_open_fn)(struct pm_internal_struct *midi,
+                              void *driverInfo);
+typedef PmError (*pm_abort_fn)(struct pm_internal_struct *midi);
+/* pm_close_fn should clean up all memory and close the device if any
+   part of the close fails. */
+typedef PmError (*pm_close_fn)(struct pm_internal_struct *midi);
+typedef PmError (*pm_poll_fn)(struct pm_internal_struct *midi);
+typedef void (*pm_host_error_fn)(struct pm_internal_struct *midi, char * msg,
+                                 unsigned int len);
+typedef unsigned int (*pm_has_host_error_fn)(struct pm_internal_struct *midi);
+
+typedef struct {
+    pm_write_short_fn write_short; /* output short MIDI msg */
+    pm_begin_sysex_fn begin_sysex; /* prepare to send a sysex message */
+    pm_end_sysex_fn end_sysex; /* marks end of sysex message */
+    pm_write_byte_fn write_byte; /* accumulate one more sysex byte */
+    pm_write_realtime_fn write_realtime; /* send real-time message within sysex */
+    pm_write_flush_fn write_flush; /* send any accumulated but unsent data */
+    pm_synchronize_fn synchronize; /* synchronize portmidi time to stream time */
+    pm_open_fn open;   /* open MIDI device */
+    pm_abort_fn abort; /* abort */
+    pm_close_fn close; /* close device */
+    pm_poll_fn poll;   /* read pending midi events into portmidi buffer */
+    pm_has_host_error_fn has_host_error; /* true when device has had host 
+                                            error message */
+    pm_host_error_fn host_error; /* provide text readable host error message
+                                    for device (clears and resets) */
+} pm_fns_node, *pm_fns_type;
+
+
+/* when open fails, the dictionary gets this set of functions: */
+extern pm_fns_node pm_none_dictionary;
+
+typedef struct {
+    PmDeviceInfo pub; /* some portmidi state also saved in here (for autmatic
+                         device closing (see PmDeviceInfo struct) */
+    void *descriptor; /* ID number passed to win32 multimedia API open */
+    void *internalDescriptor; /* points to PmInternal device, allows automatic 
+                                 device closing */
+    pm_fns_type dictionary;
+} descriptor_node, *descriptor_type;
+
+extern int pm_descriptor_max;
+extern descriptor_type descriptors;
+extern int pm_descriptor_index;
+
+typedef unsigned long (*time_get_proc_type)(void *time_info);
+
+typedef struct pm_internal_struct {
+    int device_id; /* which device is open (index to descriptors) */
+    short write_flag; /* MIDI_IN, or MIDI_OUT */
+    
+    PmTimeProcPtr time_proc; /* where to get the time */
+    void *time_info; /* pass this to get_time() */
+    long buffer_len; /* how big is the buffer or queue? */
+    PmQueue *queue;
+
+    long latency; /* time delay in ms between timestamps and actual output */
+                  /* set to zero to get immediate, simple blocking output */
+                  /* if latency is zero, timestamps will be ignored; */
+                  /* if midi input device, this field ignored */
+    
+    int sysex_in_progress; /* when sysex status is seen, this flag becomes
+        * true until EOX is seen. When true, new data is appended to the
+        * stream of outgoing bytes. When overflow occurs, sysex data is 
+        * dropped (until an EOX or non-real-timei status byte is seen) so
+        * that, if the overflow condition is cleared, we don't start 
+        * sending data from the middle of a sysex message. If a sysex
+        * message is filtered, sysex_in_progress is false, causing the
+        * message to be dropped. */
+    PmMessage sysex_message; /* buffer for 4 bytes of sysex data */
+    int sysex_message_count; /* how many bytes in sysex_message so far */
+
+    long filters; /* flags that filter incoming message classes */
+    int channel_mask; /* flter incoming messages based on channel */
+    PmTimestamp last_msg_time; /* timestamp of last message */
+    PmTimestamp sync_time; /* time of last synchronization */
+    PmTimestamp now; /* set by PmWrite to current time */
+    int first_message; /* initially true, used to run first synchronization */
+    pm_fns_type dictionary; /* implementation functions */
+    void *descriptor; /* system-dependent state */
+    /* the following are used to expedite sysex data */
+    /* on windows, in debug mode, based on some profiling, these optimizations
+     * cut the time to process sysex bytes from about 7.5 to 0.26 usec/byte,
+     * but this does not count time in the driver, so I don't know if it is
+     * important
+     */
+    unsigned char *fill_base; /* addr of ptr to sysex data */
+    unsigned long *fill_offset_ptr; /* offset of next sysex byte */
+    int fill_length; /* how many sysex bytes to write */
+} PmInternal;
+
+
+/* defined by system specific implementation, e.g. pmwinmm, used by PortMidi */
+void pm_init(void); 
+void pm_term(void); 
+
+/* defined by portMidi, used by pmwinmm */
+PmError none_write_short(PmInternal *midi, PmEvent *buffer);
+PmError none_write_byte(PmInternal *midi, unsigned char byte, 
+                        PmTimestamp timestamp);
+PmTimestamp none_synchronize(PmInternal *midi);
+
+PmError pm_fail_fn(PmInternal *midi);
+PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp);
+PmError pm_success_fn(PmInternal *midi);
+PmError pm_add_device(char *interf, char *name, int input, void *descriptor,
+                      pm_fns_type dictionary);
+unsigned int pm_read_bytes(PmInternal *midi, unsigned char *data, int len,
+                           PmTimestamp timestamp);
+void pm_read_short(PmInternal *midi, PmEvent *event);
+
+#define none_write_flush pm_fail_timestamp_fn
+#define none_sysex pm_fail_timestamp_fn
+#define none_poll pm_fail_fn
+#define success_poll pm_success_fn
+
+#define MIDI_REALTIME_MASK 0xf8
+#define is_real_time(msg) \
+    ((Pm_MessageStatus(msg) & MIDI_REALTIME_MASK) == MIDI_REALTIME_MASK)
+
+int pm_find_default_device(char *pattern, int is_input);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/lib-src/portmidi/pm_common/pmutil.c b/lib-src/portmidi/pm_common/pmutil.c
new file mode 100644
index 0000000..b83243f
--- /dev/null
+++ b/lib-src/portmidi/pm_common/pmutil.c
@@ -0,0 +1,289 @@
+/* pmutil.c -- some helpful utilities for building midi
+               applications that use PortMidi
+ */
+//#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+
+#ifdef WIN32
+#define bzero(addr, siz) memset(addr, 0, siz)
+#endif
+
+// #define QUEUE_DEBUG 1
+#ifdef QUEUE_DEBUG
+#include "stdio.h"
+#endif
+
+/* code is based on 4-byte words -- it should work on a 64-bit machine
+   as long as a "long" has 4 bytes. This code could be generalized to
+   be independent of the size of "long" */
+
+typedef long int32;
+
+typedef struct {
+    long head;
+    long tail;
+    long len;
+    long msg_size; /* number of int32 in a message including extra word */
+    long overflow;
+    long peek_overflow;
+    int32 *buffer;
+    int32 *peek;
+    int peek_flag;
+} PmQueueRep;
+
+
+PmQueue *Pm_QueueCreate(long num_msgs, long bytes_per_msg)
+{
+    int int32s_per_msg = ((bytes_per_msg + sizeof(int32) - 1) &
+                          ~(sizeof(int32) - 1)) / sizeof(int32);
+    PmQueueRep *queue = (PmQueueRep *) pm_alloc(sizeof(PmQueueRep));
+    if (!queue) /* memory allocation failed */
+        return NULL;
+
+    /* need extra word per message for non-zero encoding */
+    queue->len = num_msgs * (int32s_per_msg + 1);
+    queue->buffer = (int32 *) pm_alloc(queue->len * sizeof(int32));
+    bzero(queue->buffer, queue->len * sizeof(int32));
+    if (!queue->buffer) {
+        pm_free(queue);
+        return NULL;
+    } else { /* allocate the "peek" buffer */
+        queue->peek = (int32 *) pm_alloc(int32s_per_msg * sizeof(int32));
+        if (!queue->peek) {
+            /* free everything allocated so far and return */
+            pm_free(queue->buffer);
+            pm_free(queue);
+            return NULL;
+        }
+    }
+    bzero(queue->buffer, queue->len * sizeof(int32));
+    queue->head = 0;
+    queue->tail = 0;
+    /* msg_size is in words */
+    queue->msg_size = int32s_per_msg + 1; /* note extra word is counted */
+    queue->overflow = FALSE;
+    queue->peek_overflow = FALSE;
+    queue->peek_flag = FALSE;
+    return queue;
+}
+
+
+PmError Pm_QueueDestroy(PmQueue *q)
+{
+    PmQueueRep *queue = (PmQueueRep *) q;
+        
+    /* arg checking */
+    if (!queue || !queue->buffer || !queue->peek) 
+                return pmBadPtr;
+    
+    pm_free(queue->peek);
+    pm_free(queue->buffer);
+    pm_free(queue);
+    return pmNoError;
+}
+
+
+PmError Pm_Dequeue(PmQueue *q, void *msg)
+{
+    long head;
+    PmQueueRep *queue = (PmQueueRep *) q;
+    int i;
+    int32 *msg_as_int32 = (int32 *) msg;
+
+    /* arg checking */
+    if (!queue)
+        return pmBadPtr;
+    /* a previous peek operation encountered an overflow, but the overflow
+     * has not yet been reported to client, so do it now. No message is
+     * returned, but on the next call, we will return the peek buffer.
+     */
+    if (queue->peek_overflow) {
+        queue->peek_overflow = FALSE;
+        return pmBufferOverflow;
+    }
+    if (queue->peek_flag) {
+        memcpy(msg, queue->peek, (queue->msg_size - 1) * sizeof(int32));
+        queue->peek_flag = FALSE;
+        return pmGotData;
+    }
+
+    head = queue->head;
+    /* if writer overflows, it writes queue->overflow = tail+1 so that
+     * when the reader gets to that position in the buffer, it can 
+     * return the overflow condition to the reader. The problem is that
+     * at overflow, things have wrapped around, so tail == head, and the
+     * reader will detect overflow immediately instead of waiting until
+     * it reads everything in the buffer, wrapping around again to the
+     * point where tail == head. So the condition also checks that
+     * queue->buffer[head] is zero -- if so, then the buffer is now
+     * empty, and we're at the point in the msg stream where overflow
+     * occurred. It's time to signal overflow to the reader. If 
+     * queue->buffer[head] is non-zero, there's a message there and we
+     * should read all the way around the buffer before signalling overflow.
+     * There is a write-order dependency here, but to fail, the overflow
+     * field would have to be written while an entire buffer full of 
+     * writes are still pending. I'm assuming out-of-order writes are
+     * possible, but not that many.
+     */
+    if (queue->overflow == head + 1 && !queue->buffer[head]) {
+        queue->overflow = 0; /* non-overflow condition */
+        return pmBufferOverflow;
+    }
+
+    /* test to see if there is data in the queue -- test from back
+     * to front so if writer is simultaneously writing, we don't
+     * waste time discovering the write is not finished 
+     */
+    for (i = queue->msg_size - 1; i >= 0; i--) {
+        if (!queue->buffer[head + i]) {
+            return pmNoData;
+        }
+    }
+    memcpy(msg, (char *) &queue->buffer[head + 1], 
+           sizeof(int32) * (queue->msg_size - 1));
+    /* fix up zeros */
+    i = queue->buffer[head];
+    while (i < queue->msg_size) {
+        int32 j;
+        i--; /* msg does not have extra word so shift down */
+        j = msg_as_int32[i];
+        msg_as_int32[i] = 0;
+        i = j;
+    }
+    /* signal that data has been removed by zeroing: */
+    bzero((char *) &queue->buffer[head], sizeof(int32) * queue->msg_size);
+
+    /* update head */
+    head += queue->msg_size;
+    if (head == queue->len) head = 0;
+    queue->head = head;
+    return pmGotData; /* success */
+}
+
+
+
+PmError Pm_SetOverflow(PmQueue *q)
+{
+    PmQueueRep *queue = (PmQueueRep *) q;
+    long tail;
+    /* arg checking */
+    if (!queue)
+        return pmBadPtr;
+    /* no more enqueue until receiver acknowledges overflow */
+    if (queue->overflow) return pmBufferOverflow;
+    tail = queue->tail;
+    queue->overflow = tail + 1;
+    return pmBufferOverflow;
+}
+
+
+PmError Pm_Enqueue(PmQueue *q, void *msg)
+{
+    PmQueueRep *queue = (PmQueueRep *) q;
+    long tail;
+    int i;
+    int32 *src = (int32 *) msg;
+    int32 *ptr;
+    int32 *dest;
+    int rslt;
+    if (!queue) 
+        return pmBadPtr;
+    /* no more enqueue until receiver acknowledges overflow */
+    if (queue->overflow) return pmBufferOverflow;
+    rslt = Pm_QueueFull(q);
+    /* already checked above: if (rslt == pmBadPtr) return rslt; */
+    tail = queue->tail;
+    if (rslt) {
+        queue->overflow = tail + 1;
+        return pmBufferOverflow;
+    }
+
+    /* queue is has room for message, and overflow flag is cleared */
+    ptr = &queue->buffer[tail];
+    dest = ptr + 1;
+    for (i = 1; i < queue->msg_size; i++) {
+        int32 j = src[i - 1];
+        if (!j) {
+            *ptr = i;
+            ptr = dest;
+        } else {
+            *dest = j;
+        }
+        dest++;
+    }
+    *ptr = i;
+    tail += queue->msg_size;
+    if (tail == queue->len) tail = 0;
+    queue->tail = tail;
+    return pmNoError;
+}
+
+
+int Pm_QueueEmpty(PmQueue *q)
+{
+    PmQueueRep *queue = (PmQueueRep *) q;
+    return (!queue) ||  /* null pointer -> return "empty" */
+           (queue->buffer[queue->head] == 0 && !queue->peek_flag);
+}
+
+
+int Pm_QueueFull(PmQueue *q)
+{
+    int tail;
+    int i; 
+    PmQueueRep *queue = (PmQueueRep *) q;
+    /* arg checking */
+    if (!queue)
+        return pmBadPtr;
+    tail = queue->tail;
+    /* test to see if there is space in the queue */
+    for (i = 0; i < queue->msg_size; i++) {
+        if (queue->buffer[tail + i]) {
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+
+void *Pm_QueuePeek(PmQueue *q)
+{
+    PmError rslt;
+    long temp;
+    PmQueueRep *queue = (PmQueueRep *) q;
+    /* arg checking */
+    if (!queue)
+        return NULL;
+
+    if (queue->peek_flag) {
+        return queue->peek;
+    }
+    /* this is ugly: if peek_overflow is set, then Pm_Dequeue() 
+     * returns immediately with pmBufferOverflow, but here, we
+     * want Pm_Dequeue() to really check for data. If data is
+     * there, we can return it
+     */
+    temp = queue->peek_overflow;
+    queue->peek_overflow = FALSE;
+    rslt = Pm_Dequeue(q, queue->peek);
+    queue->peek_overflow = temp;
+
+    if (rslt == 1) {
+        queue->peek_flag = TRUE;
+        return queue->peek;
+    } else if (rslt == pmBufferOverflow) {
+        /* when overflow is indicated, the queue is empty and the 
+         * first message that was dropped by Enqueue (signalling
+         * pmBufferOverflow to its caller) would have been the next
+         * message in the queue. Pm_QueuePeek will return NULL, but
+         * remember that an overflow occurred. (see Pm_Dequeue)
+         */
+        queue->peek_overflow = TRUE;
+    }
+    return NULL;
+}
+
diff --git a/lib-src/portmidi/pm_common/pmutil.h b/lib-src/portmidi/pm_common/pmutil.h
new file mode 100644
index 0000000..bb5c586
--- /dev/null
+++ b/lib-src/portmidi/pm_common/pmutil.h
@@ -0,0 +1,127 @@
+/* pmutil.h -- some helpful utilities for building midi 
+               applications that use PortMidi 
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef void PmQueue;
+
+/*
+    A single-reader, single-writer queue is created by
+    Pm_QueueCreate(), which takes the number of messages and
+    the message size as parameters. The queue only accepts
+    fixed sized messages. Returns NULL if memory cannot be allocated.
+
+    This queue implementation uses the "light pipe" algorithm which
+    operates correctly even with multi-processors and out-of-order
+    memory writes. (see Alexander Dokumentov, "Lock-free Interprocess
+    Communication," Dr. Dobbs Portal, http://www.ddj.com/, 
+    articleID=189401457, June 15, 2006. This algorithm requires
+    that messages be translated to a form where no words contain
+    zeros. Each word becomes its own "data valid" tag. Because of
+    this translation, we cannot return a pointer to data still in 
+    the queue when the "peek" method is called. Instead, a buffer 
+    is preallocated so that data can be copied there. Pm_QueuePeek() 
+    dequeues a message into this buffer and returns a pointer to 
+    it. A subsequent Pm_Dequeue() will copy from this buffer.
+
+    This implementation does not try to keep reader/writer data in
+    separate cache lines or prevent thrashing on cache lines. 
+    However, this algorithm differs by doing inserts/removals in
+    units of messages rather than units of machine words. Some
+    performance improvement might be obtained by not clearing data
+    immediately after a read, but instead by waiting for the end
+    of the cache line, especially if messages are smaller than
+    cache lines. See the Dokumentov article for explanation.
+
+    The algorithm is extended to handle "overflow" reporting. To report
+    an overflow, the sender writes the current tail position to a field.
+    The receiver must acknowlege receipt by zeroing the field. The sender
+    will not send more until the field is zeroed.
+    
+    Pm_QueueDestroy() destroys the queue and frees its storage.
+ */
+
+PmQueue *Pm_QueueCreate(long num_msgs, long bytes_per_msg);
+PmError Pm_QueueDestroy(PmQueue *queue);
+
+/* 
+    Pm_Dequeue() removes one item from the queue, copying it into msg.
+    Returns 1 if successful, and 0 if the queue is empty.
+    Returns pmBufferOverflow if what would have been the next thing
+    in the queue was dropped due to overflow. (So when overflow occurs,
+    the receiver can receive a queue full of messages before getting the
+    overflow report. This protocol ensures that the reader will be 
+    notified when data is lost due to overflow.
+ */
+PmError Pm_Dequeue(PmQueue *queue, void *msg);
+
+
+/*
+    Pm_Enqueue() inserts one item into the queue, copying it from msg.
+    Returns pmNoError if successful and pmBufferOverflow if the queue was 
+    already full. If pmBufferOverflow is returned, the overflow flag is set.
+ */
+PmError Pm_Enqueue(PmQueue *queue, void *msg);
+
+
+/*
+    Pm_QueueFull() returns non-zero if the queue is full
+    Pm_QueueEmpty() returns non-zero if the queue is empty
+
+    Either condition may change immediately because a parallel
+    enqueue or dequeue operation could be in progress. Furthermore,
+    Pm_QueueEmpty() is optimistic: it may say false, when due to 
+    out-of-order writes, the full message has not arrived. Therefore,
+    Pm_Dequeue() could still return 0 after Pm_QueueEmpty() returns
+    false. On the other hand, Pm_QueueFull() is pessimistic: if it
+    returns false, then Pm_Enqueue() is guaranteed to succeed. 
+
+    Error conditions: Pm_QueueFull() returns pmBadPtr if queue is NULL.
+    Pm_QueueEmpty() returns FALSE if queue is NULL.
+ */
+int Pm_QueueFull(PmQueue *queue);
+int Pm_QueueEmpty(PmQueue *queue);
+
+
+/*
+    Pm_QueuePeek() returns a pointer to the item at the head of the queue,
+    or NULL if the queue is empty. The item is not removed from the queue.
+    Pm_QueuePeek() will not indicate when an overflow occurs. If you want
+    to get and check pmBufferOverflow messages, use the return value of
+    Pm_QueuePeek() *only* as an indication that you should call 
+    Pm_Dequeue(). At the point where a direct call to Pm_Dequeue() would
+    return pmBufferOverflow, Pm_QueuePeek() will return NULL but internally
+    clear the pmBufferOverflow flag, enabling Pm_Enqueue() to resume
+    enqueuing messages. A subsequent call to Pm_QueuePeek()
+    will return a pointer to the first message *after* the overflow. 
+    Using this as an indication to call Pm_Dequeue(), the first call
+    to Pm_Dequeue() will return pmBufferOverflow. The second call will
+    return success, copying the same message pointed to by the previous
+    Pm_QueuePeek().
+
+    When to use Pm_QueuePeek(): (1) when you need to look at the message
+    data to decide who should be called to receive it. (2) when you need
+    to know a message is ready but cannot accept the message.
+
+    Note that Pm_QueuePeek() is not a fast check, so if possible, you 
+    might as well just call Pm_Dequeue() and accept the data if it is there.
+ */
+void *Pm_QueuePeek(PmQueue *queue);
+
+/*
+    Pm_SetOverflow() allows the writer (enqueuer) to signal an overflow
+    condition to the reader (dequeuer). E.g. when transfering data from 
+    the OS to an application, if the OS indicates a buffer overrun,
+    Pm_SetOverflow() can be used to insure that the reader receives a
+    pmBufferOverflow result from Pm_Dequeue(). Returns pmBadPtr if queue
+    is NULL, returns pmBufferOverflow if buffer is already in an overflow
+    state, returns pmNoError if successfully set overflow state.
+ */
+PmError Pm_SetOverflow(PmQueue *queue);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/lib-src/portmidi/pm_common/portmidi.c b/lib-src/portmidi/pm_common/portmidi.c
new file mode 100644
index 0000000..7932983
--- /dev/null
+++ b/lib-src/portmidi/pm_common/portmidi.c
@@ -0,0 +1,1124 @@
+#ifdef _MSC_VER
+ #pragma warning(disable: 4244) // stop warnings about downsize typecasts
+ #pragma warning(disable: 4018) // stop warnings about signed/unsigned
+#endif
+
+#include "stdlib.h"
+#include "string.h"
+#include "portmidi.h"
+#include "porttime.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include <assert.h>
+
+#define MIDI_CLOCK      0xf8
+#define MIDI_ACTIVE     0xfe
+#define MIDI_STATUS_MASK 0x80
+#define MIDI_SYSEX      0xf0
+#define MIDI_EOX        0xf7
+#define MIDI_START      0xFA
+#define MIDI_STOP       0xFC
+#define MIDI_CONTINUE   0xFB
+#define MIDI_F9         0xF9
+#define MIDI_FD         0xFD
+#define MIDI_RESET      0xFF
+#define MIDI_NOTE_ON    0x90
+#define MIDI_NOTE_OFF   0x80
+#define MIDI_CHANNEL_AT 0xD0
+#define MIDI_POLY_AT    0xA0
+#define MIDI_PROGRAM    0xC0
+#define MIDI_CONTROL    0xB0
+#define MIDI_PITCHBEND  0xE0
+#define MIDI_MTC        0xF1
+#define MIDI_SONGPOS    0xF2
+#define MIDI_SONGSEL    0xF3
+#define MIDI_TUNE       0xF6
+
+#define is_empty(midi) ((midi)->tail == (midi)->head)
+
+/* this is not static so that pm_init can set it directly if
+ *   (see pmmac.c:pm_init())
+ */
+int pm_initialized = FALSE;
+
+int pm_hosterror;
+char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
+
+#ifdef PM_CHECK_ERRORS
+
+#include <stdio.h>
+
+#define STRING_MAX 80
+
+static void prompt_and_exit(void)
+{
+    char line[STRING_MAX];
+    printf("type ENTER...");
+    fgets(line, STRING_MAX, stdin);
+    /* this will clean up open ports: */
+    exit(-1);
+}
+
+
+static PmError pm_errmsg(PmError err)
+{
+    if (err == pmHostError) {
+        /* it seems pointless to allocate memory and copy the string,
+         * so I will do the work of Pm_GetHostErrorText directly
+         */
+        printf("PortMidi found host error...\n  %s\n", pm_hosterror_text);
+        pm_hosterror = FALSE;
+        pm_hosterror_text[0] = 0; /* clear the message */
+        prompt_and_exit();
+    } else if (err < 0) {
+        printf("PortMidi call failed...\n  %s\n", Pm_GetErrorText(err));
+        prompt_and_exit();
+    }
+    return err;
+}
+#else
+#define pm_errmsg(err) err
+#endif
+
+/*
+====================================================================
+system implementation of portmidi interface
+====================================================================
+*/
+
+int pm_descriptor_max = 0;
+int pm_descriptor_index = 0;
+descriptor_type descriptors = NULL;
+
+/* pm_add_device -- describe interface/device pair to library 
+ *
+ * This is called at intialization time, once for each 
+ * interface (e.g. DirectSound) and device (e.g. SoundBlaster 1)
+ * The strings are retained but NOT COPIED, so do not destroy them!
+ *
+ * returns pmInvalidDeviceId if device memory is exceeded
+ * otherwise returns pmNoError
+ */
+PmError pm_add_device(char *interf, char *name, int input, 
+                      void *descriptor, pm_fns_type dictionary) {
+    if (pm_descriptor_index >= pm_descriptor_max) {
+        // expand descriptors
+        descriptor_type new_descriptors = (descriptor_type) 
+            pm_alloc(sizeof(descriptor_node) * (pm_descriptor_max + 32));
+        if (!new_descriptors) return pmInsufficientMemory;
+        if (descriptors) {
+            memcpy(new_descriptors, descriptors, 
+                   sizeof(descriptor_node) * pm_descriptor_max);
+            free(descriptors);
+        }
+        pm_descriptor_max += 32;
+        descriptors = new_descriptors;
+    }
+    descriptors[pm_descriptor_index].pub.interf = interf;
+    descriptors[pm_descriptor_index].pub.name = name;
+    descriptors[pm_descriptor_index].pub.input = input;
+    descriptors[pm_descriptor_index].pub.output = !input;
+
+    /* default state: nothing to close (for automatic device closing) */
+    descriptors[pm_descriptor_index].pub.opened = FALSE;
+
+    /* ID number passed to win32 multimedia API open */
+    descriptors[pm_descriptor_index].descriptor = descriptor;
+    
+    /* points to PmInternal, allows automatic device closing */
+    descriptors[pm_descriptor_index].internalDescriptor = NULL;
+
+    descriptors[pm_descriptor_index].dictionary = dictionary;
+    
+    pm_descriptor_index++;
+    
+    return pmNoError;
+}
+
+
+/* utility to look up device, given a pattern, 
+   note: pattern is modified
+ */
+int pm_find_default_device(char *pattern, int is_input)
+{
+    int id = pmNoDevice;
+    int i;
+    /* first parse pattern into name, interf parts */
+    char *interf_pref = ""; /* initially assume it is not there */
+    char *name_pref = strstr(pattern, ", ");
+
+    if (name_pref) { /* found separator, adjust the pointer */
+        interf_pref = pattern;
+        name_pref[0] = 0;
+        name_pref += 2;
+    } else {
+        name_pref = pattern; /* whole string is the name pattern */
+    }
+    for (i = 0; i < pm_descriptor_index; i++) {
+        const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+        if (info->input == is_input &&
+            strstr(info->name, name_pref) &&
+            strstr(info->interf, interf_pref)) {
+            id = i;
+            break;
+        }
+    }    
+    return id;
+}
+
+
+/*
+====================================================================
+portmidi implementation
+====================================================================
+*/
+
+int Pm_CountDevices( void ) {
+    Pm_Initialize();
+    /* no error checking -- Pm_Initialize() does not fail */
+    return pm_descriptor_index;
+}
+
+
+const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id ) {
+    Pm_Initialize(); /* no error check needed */
+    if (id >= 0 && id < pm_descriptor_index) {
+        return &descriptors[id].pub;
+    }
+    return NULL;
+}
+
+/* pm_success_fn -- "noop" function pointer */
+PmError pm_success_fn(PmInternal *midi) {
+    return pmNoError;
+}
+
+/* none_write -- returns an error if called */
+PmError none_write_short(PmInternal *midi, PmEvent *buffer) {
+    return pmBadPtr;
+}
+
+/* pm_fail_timestamp_fn -- placeholder for begin_sysex and flush */
+PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp) {
+    return pmBadPtr;
+}
+
+PmError none_write_byte(PmInternal *midi, unsigned char byte, 
+                        PmTimestamp timestamp) {
+    return pmBadPtr;
+}
+
+/* pm_fail_fn -- generic function, returns error if called */
+PmError pm_fail_fn(PmInternal *midi) {
+    return pmBadPtr;
+}
+
+static PmError none_open(PmInternal *midi, void *driverInfo) {
+    return pmBadPtr;
+}
+static void none_get_host_error(PmInternal * midi, char * msg, unsigned int len) {
+    strcpy(msg, "");
+}
+static unsigned int none_has_host_error(PmInternal * midi) {
+    return FALSE;
+}
+PmTimestamp none_synchronize(PmInternal *midi) {
+    return 0;
+}
+
+#define none_abort pm_fail_fn
+#define none_close pm_fail_fn
+
+pm_fns_node pm_none_dictionary = {
+    none_write_short,
+    none_sysex,
+    none_sysex,
+    none_write_byte,
+    none_write_short,
+    none_write_flush,
+    none_synchronize,
+    none_open,
+    none_abort, 
+    none_close,
+    none_poll,
+    none_has_host_error,
+    none_get_host_error 
+};
+
+
+const char *Pm_GetErrorText( PmError errnum ) {
+    const char *msg;
+
+    switch(errnum)
+    {
+    case pmNoError:                  
+        msg = ""; 
+        break;
+    case pmHostError:                
+        msg = "PortMidi: `Host error'"; 
+        break;
+    case pmInvalidDeviceId:          
+        msg = "PortMidi: `Invalid device ID'"; 
+        break;
+    case pmInsufficientMemory:       
+        msg = "PortMidi: `Insufficient memory'"; 
+        break;
+    case pmBufferTooSmall:           
+        msg = "PortMidi: `Buffer too small'"; 
+        break;
+    case pmBadPtr:                   
+        msg = "PortMidi: `Bad pointer'"; 
+        break;
+    case pmInternalError:            
+        msg = "PortMidi: `Internal PortMidi Error'"; 
+        break;
+    case pmBufferOverflow:
+        msg = "PortMidi: `Buffer overflow'";
+        break;
+    case pmBadData:
+        msg = "PortMidi: `Invalid MIDI message Data'";
+        break;
+    case pmBufferMaxSize:
+        msg = "PortMidi: `Buffer cannot be made larger'";
+        break;
+    default:                         
+        msg = "PortMidi: `Illegal error number'"; 
+        break;
+    }
+    return msg;
+}
+
+
+/* This can be called whenever you get a pmHostError return value.
+ * The error will always be in the global pm_hosterror_text.
+ */
+void Pm_GetHostErrorText(char * msg, unsigned int len) {
+    assert(msg);
+    assert(len > 0);
+    if (pm_hosterror) {
+        strncpy(msg, (char *) pm_hosterror_text, len);
+        pm_hosterror = FALSE;
+        pm_hosterror_text[0] = 0; /* clear the message; not necessary, but it
+                                     might help with debugging */
+        msg[len - 1] = 0; /* make sure string is terminated */
+    } else {
+        msg[0] = 0; /* no string to return */
+    }
+}
+
+
+int Pm_HasHostError(PortMidiStream * stream) {
+    if (pm_hosterror) return TRUE;
+    if (stream) {
+        PmInternal * midi = (PmInternal *) stream;
+        pm_hosterror = (*midi->dictionary->has_host_error)(midi);
+        if (pm_hosterror) {
+            midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                         PM_HOST_ERROR_MSG_LEN);
+            /* now error message is global */
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+
+PmError Pm_Initialize( void ) {
+    if (!pm_initialized) {
+        pm_hosterror = FALSE;
+        pm_hosterror_text[0] = 0; /* the null string */
+        pm_init();
+        pm_initialized = TRUE;
+    }
+    return pmNoError;
+}
+
+
+PmError Pm_Terminate( void ) {
+    if (pm_initialized) {
+        pm_term();
+        // if there are no devices, descriptors might still be NULL
+        if (descriptors != NULL) {
+            free(descriptors);
+            descriptors = NULL;
+        }
+        pm_descriptor_index = 0;
+        pm_descriptor_max = 0;
+        pm_initialized = FALSE;
+    }
+    return pmNoError;
+}
+
+
+/* Pm_Read -- read up to length longs from source into buffer */
+/*
+ * returns number of longs actually read, or error code
+ */
+int Pm_Read(PortMidiStream *stream, PmEvent *buffer, long length) {
+    PmInternal *midi = (PmInternal *) stream;
+    int n = 0;
+    PmError err = pmNoError;
+    pm_hosterror = FALSE;
+    /* arg checking */
+    if(midi == NULL)
+        err = pmBadPtr;
+    else if(!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    else if(!descriptors[midi->device_id].pub.input)
+        err = pmBadPtr;    
+    /* First poll for data in the buffer...
+     * This either simply checks for data, or attempts first to fill the buffer
+     * with data from the MIDI hardware; this depends on the implementation.
+     * We could call Pm_Poll here, but that would redo a lot of redundant
+     * parameter checking, so I copied some code from Pm_Poll to here: */
+    else err = (*(midi->dictionary->poll))(midi);
+
+    if (err != pmNoError) {
+        if (err == pmHostError) {
+            midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                         PM_HOST_ERROR_MSG_LEN);
+          pm_hosterror = TRUE;
+        }
+        return pm_errmsg(err);
+    }
+
+    while (n < length) {
+        PmError err = Pm_Dequeue(midi->queue, buffer++);
+        if (err == pmBufferOverflow) {
+            /* ignore the data we have retreived so far */
+            return pm_errmsg(pmBufferOverflow);
+        } else if (err == 0) { /* empty queue */
+            break;
+        }
+        n++;
+    }
+    return n;
+}
+
+PmError Pm_Poll( PortMidiStream *stream )
+{
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err;
+
+    pm_hosterror = FALSE;
+    /* arg checking */
+    if(midi == NULL)
+        err = pmBadPtr;
+    else if (!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    else if (!descriptors[midi->device_id].pub.input)
+        err = pmBadPtr;
+    else
+        err = (*(midi->dictionary->poll))(midi);
+
+    if (err != pmNoError) {
+        if (err == pmHostError) {
+            midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                         PM_HOST_ERROR_MSG_LEN);
+           pm_hosterror = TRUE;
+        }
+        return pm_errmsg(err);
+    }
+
+    return !Pm_QueueEmpty(midi->queue);
+}
+
+
+/* this is called from Pm_Write and Pm_WriteSysEx to issue a
+ * call to the system-dependent end_sysex function and handle 
+ * the error return
+ */
+static PmError pm_end_sysex(PmInternal *midi)
+{
+    PmError err = (*midi->dictionary->end_sysex)(midi, 0);
+    midi->sysex_in_progress = FALSE;
+    if (err == pmHostError) {
+        midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                     PM_HOST_ERROR_MSG_LEN);
+        pm_hosterror = TRUE;
+    }
+    return err;
+}
+
+
+/* to facilitate correct error-handling, Pm_Write, Pm_WriteShort, and
+   Pm_WriteSysEx all operate a state machine that "outputs" calls to
+   write_short, begin_sysex, write_byte, end_sysex, and write_realtime */
+
+PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, long length)
+{
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err = pmNoError;
+    int i;
+    int bits;
+    
+    pm_hosterror = FALSE;
+    /* arg checking */
+    if(midi == NULL)
+        err = pmBadPtr;
+    else if(!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    else if(!descriptors[midi->device_id].pub.output)
+        err = pmBadPtr;
+    else
+        err = pmNoError;
+    
+    if (err != pmNoError) goto pm_write_error;
+    
+    if (midi->latency == 0) {
+        midi->now = 0;
+    } else {
+        midi->now = (*(midi->time_proc))(midi->time_info);
+        if (midi->first_message || midi->sync_time + 100 /*ms*/ < midi->now) {
+            /* time to resync */
+            midi->now = (*midi->dictionary->synchronize)(midi);
+            midi->first_message = FALSE;
+        }
+    }
+    /* error recovery: when a sysex is detected, we call
+     *   dictionary->begin_sysex() followed by calls to
+     *   dictionary->write_byte() and dictionary->write_realtime()
+     *   until an end-of-sysex is detected, when we call
+     *   dictionary->end_sysex(). After an error occurs, 
+     *   Pm_Write() continues to call functions. For example,
+     *   it will continue to call write_byte() even after
+     *   an error sending a sysex message, and end_sysex() will be
+     *   called when an EOX or non-real-time status is found.
+     * When errors are detected, Pm_Write() returns immediately, 
+     *   so it is possible that this will drop data and leave
+     *   sysex messages in a partially transmitted state.
+     */
+    for (i = 0; i < length; i++) {
+        unsigned long msg = buffer[i].message;
+        bits = 0;
+        /* is this a sysex message? */
+        if (Pm_MessageStatus(msg) == MIDI_SYSEX) {
+            if (midi->sysex_in_progress) {
+                /* error: previous sysex was not terminated by EOX */
+                midi->sysex_in_progress = FALSE;
+                err = pmBadData;
+                goto pm_write_error;
+            }
+            midi->sysex_in_progress = TRUE;
+            if ((err = (*midi->dictionary->begin_sysex)(midi, 
+                               buffer[i].timestamp)) != pmNoError)
+                goto pm_write_error;
+            if ((err = (*midi->dictionary->write_byte)(midi, MIDI_SYSEX,
+                               buffer[i].timestamp)) != pmNoError) 
+                goto pm_write_error;
+            bits = 8;
+            /* fall through to continue sysex processing */
+        } else if ((msg & MIDI_STATUS_MASK) && 
+                   (Pm_MessageStatus(msg) != MIDI_EOX)) {
+            /* a non-sysex message */
+            if (midi->sysex_in_progress) {
+                /* this should be a realtime message */
+                if (is_real_time(msg)) {
+                    if ((err = (*midi->dictionary->write_realtime)(midi, 
+                                       &(buffer[i]))) != pmNoError)
+                        goto pm_write_error;
+                } else {
+                    midi->sysex_in_progress = FALSE;
+                    err = pmBadData;
+                    /* ignore any error from this, because we already have one */
+                    /* pass 0 as timestamp -- it's ignored */
+                    (*midi->dictionary->end_sysex)(midi, 0);
+                    goto pm_write_error;
+                }
+            } else { /* regular short midi message */
+                if ((err = (*midi->dictionary->write_short)(midi, 
+                                   &(buffer[i]))) != pmNoError)
+                    goto pm_write_error;
+                continue;
+            }
+        }
+        if (midi->sysex_in_progress) { /* send sysex bytes until EOX */
+            /* see if we can accelerate data transfer */
+            if (bits == 0 && midi->fill_base && /* 4 bytes to copy */
+                (*midi->fill_offset_ptr) + 4 <= midi->fill_length &&
+                (msg & 0x80808080) == 0) { /* all data */
+                    /* copy 4 bytes from msg to fill_base + fill_offset */
+                    unsigned char *ptr = midi->fill_base + 
+                                         *(midi->fill_offset_ptr);
+                    ptr[0] = msg; ptr[1] = msg >> 8; 
+                    ptr[2] = msg >> 18; ptr[3] = msg >> 24;
+                    (*midi->fill_offset_ptr) += 4;
+                     continue;
+            }
+            /* no acceleration, so do byte-by-byte copying */
+            while (bits < 32) {
+                unsigned char midi_byte = (unsigned char) (msg >> bits);
+                if ((err = (*midi->dictionary->write_byte)(midi, midi_byte, 
+                                   buffer[i].timestamp)) != pmNoError)
+                    goto pm_write_error;
+                if (midi_byte == MIDI_EOX) {
+                    err = pm_end_sysex(midi);
+                    if (err != pmNoError) goto error_exit;
+                    break; /* from while loop */
+                }
+                bits += 8;
+            }
+        } else {
+            /* not in sysex mode, but message did not start with status */
+            err = pmBadData;
+            goto pm_write_error;
+        }
+    }
+    /* after all messages are processed, send the data */
+    if (!midi->sysex_in_progress)
+        err = (*midi->dictionary->write_flush)(midi, 0);
+pm_write_error:
+    if (err == pmHostError) {
+        midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                     PM_HOST_ERROR_MSG_LEN);
+        pm_hosterror = TRUE;
+    }
+error_exit:
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_WriteShort(PortMidiStream *stream, long when, long msg)
+{
+    PmEvent event;
+    
+    event.timestamp = when;
+    event.message = msg;
+    return Pm_Write(stream, &event, 1);
+}
+
+
+PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when, 
+                      unsigned char *msg)
+{
+    /* allocate buffer space for PM_DEFAULT_SYSEX_BUFFER_SIZE bytes */
+    /* each PmEvent holds sizeof(PmMessage) bytes of sysex data */
+    #define BUFLEN (PM_DEFAULT_SYSEX_BUFFER_SIZE / sizeof(PmMessage))
+    PmEvent buffer[BUFLEN];
+    int buffer_size = 1; /* first time, send 1. After that, it's BUFLEN */
+    PmInternal *midi = (PmInternal *) stream;
+    /* the next byte in the buffer is represented by an index, bufx, and
+       a shift in bits */
+    int shift = 0;
+    int bufx = 0;
+    buffer[0].message = 0;
+    buffer[0].timestamp = when;
+
+    while (1) {
+        /* insert next byte into buffer */
+        buffer[bufx].message |= ((*msg) << shift);
+        shift += 8;
+        if (*msg++ == MIDI_EOX) break;
+        if (shift == 32) {
+            shift = 0;
+            bufx++;
+            if (bufx == buffer_size) {
+                PmError err = Pm_Write(stream, buffer, buffer_size);
+                /* note: Pm_Write has already called errmsg() */
+                if (err) return err;
+                /* prepare to fill another buffer */
+                bufx = 0;
+                buffer_size = BUFLEN;
+                /* optimization: maybe we can just copy bytes */
+                if (midi->fill_base) {
+                    PmError err;
+                    while (*(midi->fill_offset_ptr) < midi->fill_length) {
+                        midi->fill_base[(*midi->fill_offset_ptr)++] = *msg;
+                        if (*msg++ == MIDI_EOX) {
+                            err = pm_end_sysex(midi);
+                            if (err != pmNoError) return pm_errmsg(err);
+                            goto end_of_sysex;
+                        }
+                    }
+                    /* I thought that I could do a pm_Write here and
+                     * change this if to a loop, avoiding calls in Pm_Write
+                     * to the slower write_byte, but since 
+                     * sysex_in_progress is true, this will not flush
+                     * the buffer, and we'll infinite loop: */
+                    /* err = Pm_Write(stream, buffer, 0);
+                       if (err) return err; */
+                    /* instead, the way this works is that Pm_Write calls
+                     * write_byte on 4 bytes. The first, since the buffer
+                     * is full, will flush the buffer and allocate a new
+                     * one. This primes the buffer so
+                     * that we can return to the loop above and fill it
+                     * efficiently without a lot of function calls.
+                     */
+                    buffer_size = 1; /* get another message started */
+                }
+            }
+            buffer[bufx].message = 0;
+            buffer[bufx].timestamp = when;
+        } 
+        /* keep inserting bytes until you find MIDI_EOX */
+    }
+end_of_sysex:
+    /* we're finished sending full buffers, but there may
+     * be a partial one left.
+     */
+    if (shift != 0) bufx++; /* add partial message to buffer len */
+    if (bufx) { /* bufx is number of PmEvents to send from buffer */
+        PmError err = Pm_Write(stream, buffer, bufx);
+        if (err) return err;
+    }
+    return pmNoError;
+}
+
+
+
+PmError Pm_OpenInput(PortMidiStream** stream,
+                     PmDeviceID inputDevice,
+                     void *inputDriverInfo,
+                     long bufferSize,
+                     PmTimeProcPtr time_proc,
+                     void *time_info)
+{
+    PmInternal *midi;
+    PmError err = pmNoError;
+    pm_hosterror = FALSE;
+    *stream = NULL;
+    
+    /* arg checking */
+    if (inputDevice < 0 || inputDevice >= pm_descriptor_index) 
+        err = pmInvalidDeviceId;
+    else if (!descriptors[inputDevice].pub.input) 
+        err =  pmInvalidDeviceId;
+    else if(descriptors[inputDevice].pub.opened)
+        err =  pmInvalidDeviceId;
+    
+    if (err != pmNoError) 
+        goto error_return;
+
+    /* create portMidi internal data */
+    midi = (PmInternal *) pm_alloc(sizeof(PmInternal)); 
+    *stream = midi;
+    if (!midi) {
+        err = pmInsufficientMemory;
+        goto error_return;
+    }
+    midi->device_id = inputDevice;
+    midi->write_flag = FALSE;
+    midi->time_proc = time_proc;
+    midi->time_info = time_info;
+    /* windows adds timestamps in the driver and these are more accurate than
+       using a time_proc, so do not automatically provide a time proc. Non-win
+       implementations may want to provide a default time_proc in their
+       system-specific midi_out_open() method.
+     */
+    if (bufferSize <= 0) bufferSize = 256; /* default buffer size */
+    midi->queue = Pm_QueueCreate(bufferSize, sizeof(PmEvent));
+    if (!midi->queue) {
+        /* free portMidi data */
+        *stream = NULL;
+        pm_free(midi); 
+        err = pmInsufficientMemory;
+        goto error_return;
+    }
+    midi->buffer_len = bufferSize; /* portMidi input storage */
+    midi->latency = 0; /* not used */
+    midi->sysex_in_progress = FALSE;
+    midi->sysex_message = 0; 
+    midi->sysex_message_count = 0; 
+    midi->filters = PM_FILT_ACTIVE;
+    midi->channel_mask = 0xFFFF;
+    midi->sync_time = 0;
+    midi->first_message = TRUE;
+    midi->dictionary = descriptors[inputDevice].dictionary;
+    midi->fill_base = NULL;
+    midi->fill_offset_ptr = NULL;
+    midi->fill_length = 0;
+    descriptors[inputDevice].internalDescriptor = midi;
+    /* open system dependent input device */
+    err = (*midi->dictionary->open)(midi, inputDriverInfo);
+    if (err) {
+        *stream = NULL;
+        descriptors[inputDevice].internalDescriptor = NULL;
+        /* free portMidi data */
+        Pm_QueueDestroy(midi->queue);
+        pm_free(midi);
+    } else {
+        /* portMidi input open successful */
+        descriptors[inputDevice].pub.opened = TRUE;
+    }
+error_return:
+    /* note: if there is a pmHostError, it is the responsibility
+     * of the system-dependent code (*midi->dictionary->open)()
+     * to set pm_hosterror and pm_hosterror_text
+     */
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_OpenOutput(PortMidiStream** stream,
+                      PmDeviceID outputDevice,
+                      void *outputDriverInfo,
+                      long bufferSize,
+                      PmTimeProcPtr time_proc,
+                      void *time_info,
+                      long latency ) 
+{
+    PmInternal *midi;
+    PmError err = pmNoError;
+    pm_hosterror = FALSE;
+    *stream =  NULL;
+    
+    /* arg checking */
+    if (outputDevice < 0 || outputDevice >= pm_descriptor_index)
+        err = pmInvalidDeviceId;
+    else if (!descriptors[outputDevice].pub.output) 
+        err = pmInvalidDeviceId;
+    else if (descriptors[outputDevice].pub.opened)
+        err = pmInvalidDeviceId;
+    if (err != pmNoError) 
+        goto error_return;
+
+    /* create portMidi internal data */
+    midi = (PmInternal *) pm_alloc(sizeof(PmInternal)); 
+    *stream = midi;                 
+    if (!midi) {
+        err = pmInsufficientMemory;
+        goto error_return;
+    }
+    midi->device_id = outputDevice;
+    midi->write_flag = TRUE;
+    midi->time_proc = time_proc;
+    /* if latency > 0, we need a time reference. If none is provided,
+       use PortTime library */
+    if (time_proc == NULL && latency != 0) {
+        if (!Pt_Started()) 
+            Pt_Start(1, 0, 0);
+        /* time_get does not take a parameter, so coerce */
+        midi->time_proc = (PmTimeProcPtr) Pt_Time;
+    }
+    midi->time_info = time_info;
+    midi->buffer_len = bufferSize;
+    midi->queue = NULL; /* unused by output */
+    /* if latency zero, output immediate (timestamps ignored) */
+    /* if latency < 0, use 0 but don't return an error */
+    if (latency < 0) latency = 0;
+    midi->latency = latency;
+    midi->sysex_in_progress = FALSE;
+    midi->sysex_message = 0; /* unused by output */
+    midi->sysex_message_count = 0; /* unused by output */
+    midi->filters = 0; /* not used for output */
+    midi->channel_mask = 0xFFFF;
+    midi->sync_time = 0;
+    midi->first_message = TRUE;
+    midi->dictionary = descriptors[outputDevice].dictionary;
+    midi->fill_base = NULL;
+    midi->fill_offset_ptr = NULL;
+    midi->fill_length = 0;
+    descriptors[outputDevice].internalDescriptor = midi;
+    /* open system dependent output device */
+    err = (*midi->dictionary->open)(midi, outputDriverInfo);
+    if (err) {
+        *stream = NULL;
+        descriptors[outputDevice].internalDescriptor = NULL;
+        /* free portMidi data */
+        pm_free(midi); 
+    } else {
+        /* portMidi input open successful */
+        descriptors[outputDevice].pub.opened = TRUE;
+    }
+error_return:
+    /* note: system-dependent code must set pm_hosterror and
+     * pm_hosterror_text if a pmHostError occurs
+     */
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_SetChannelMask(PortMidiStream *stream, int mask)
+{
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err = pmNoError;
+
+    if (midi == NULL)
+        err = pmBadPtr;
+    else
+        midi->channel_mask = mask;
+
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_SetFilter(PortMidiStream *stream, long filters) {
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err = pmNoError;
+
+    /* arg checking */
+    if (midi == NULL)
+        err = pmBadPtr;
+    else if (!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    else
+        midi->filters = filters;
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_Close( PortMidiStream *stream ) {
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err = pmNoError;
+
+    pm_hosterror = FALSE;
+    /* arg checking */
+    if (midi == NULL) /* midi must point to something */
+        err = pmBadPtr;
+    /* if it is an open device, the device_id will be valid */
+    else if (midi->device_id < 0 || midi->device_id >= pm_descriptor_index)
+        err = pmBadPtr;
+    /* and the device should be in the opened state */
+    else if (!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    
+    if (err != pmNoError) 
+        goto error_return;
+
+    /* close the device */
+    err = (*midi->dictionary->close)(midi);
+    /* even if an error occurred, continue with cleanup */
+    descriptors[midi->device_id].internalDescriptor = NULL;
+    descriptors[midi->device_id].pub.opened = FALSE;
+    if (midi->queue) Pm_QueueDestroy(midi->queue);
+    pm_free(midi); 
+error_return:
+    /* system dependent code must set pm_hosterror and
+     * pm_hosterror_text if a pmHostError occurs.
+     */
+    return pm_errmsg(err);
+}
+
+
+PmError Pm_Abort( PortMidiStream* stream ) {
+    PmInternal *midi = (PmInternal *) stream;
+    PmError err;
+    /* arg checking */
+    if (midi == NULL)
+        err = pmBadPtr;
+    else if (!descriptors[midi->device_id].pub.output)
+        err = pmBadPtr;
+    else if (!descriptors[midi->device_id].pub.opened)
+        err = pmBadPtr;
+    else
+        err = (*midi->dictionary->abort)(midi);
+
+    if (err == pmHostError) {
+        midi->dictionary->host_error(midi, pm_hosterror_text, 
+                                     PM_HOST_ERROR_MSG_LEN);
+        pm_hosterror = TRUE;
+    }
+    return pm_errmsg(err);
+}
+
+
+
+/* pm_channel_filtered returns non-zero if the channel mask is blocking the current channel */
+#define pm_channel_filtered(status, mask) \
+    ((((status) & 0xF0) != 0xF0) && (!(Pm_Channel((status) & 0x0F) & (mask))))
+
+
+/* The following two functions will checks to see if a MIDI message matches
+   the filtering criteria.  Since the sysex routines only want to filter realtime messages,
+   we need to have separate routines.
+ */
+
+
+/* pm_realtime_filtered returns non-zero if the filter will kill the current message.
+   Note that only realtime messages are checked here.
+ */
+#define pm_realtime_filtered(status, filters) \
+    ((((status) & 0xF0) == 0xF0) && ((1 << ((status) & 0xF)) & (filters)))
+
+/*
+    return ((status == MIDI_ACTIVE) && (filters & PM_FILT_ACTIVE))
+            ||  ((status == MIDI_CLOCK) && (filters & PM_FILT_CLOCK))
+            ||  ((status == MIDI_START) && (filters & PM_FILT_PLAY))
+            ||  ((status == MIDI_STOP) && (filters & PM_FILT_PLAY))
+            ||  ((status == MIDI_CONTINUE) && (filters & PM_FILT_PLAY))
+            ||  ((status == MIDI_F9) && (filters & PM_FILT_F9))
+            ||  ((status == MIDI_FD) && (filters & PM_FILT_FD))
+            ||  ((status == MIDI_RESET) && (filters & PM_FILT_RESET))
+            ||  ((status == MIDI_MTC) && (filters & PM_FILT_MTC))
+            ||  ((status == MIDI_SONGPOS) && (filters & PM_FILT_SONG_POSITION))
+            ||  ((status == MIDI_SONGSEL) && (filters & PM_FILT_SONG_SELECT))
+            ||  ((status == MIDI_TUNE) && (filters & PM_FILT_TUNE));
+}*/
+
+
+/* pm_status_filtered returns non-zero if a filter will kill the current message, based on status.
+   Note that sysex and real time are not checked.  It is up to the subsystem (winmm, core midi, alsa)
+   to filter sysex, as it is handled more easily and efficiently at that level.
+   Realtime message are filtered in pm_realtime_filtered.
+ */
+#define pm_status_filtered(status, filters) ((1 << (16 + ((status) >> 4))) & (filters))
+
+
+/*
+    return  ((status == MIDI_NOTE_ON) && (filters & PM_FILT_NOTE))
+            ||  ((status == MIDI_NOTE_OFF) && (filters & PM_FILT_NOTE))
+            ||  ((status == MIDI_CHANNEL_AT) && (filters & PM_FILT_CHANNEL_AFTERTOUCH))
+            ||  ((status == MIDI_POLY_AT) && (filters & PM_FILT_POLY_AFTERTOUCH))
+            ||  ((status == MIDI_PROGRAM) && (filters & PM_FILT_PROGRAM))
+            ||  ((status == MIDI_CONTROL) && (filters & PM_FILT_CONTROL))
+            ||  ((status == MIDI_PITCHBEND) && (filters & PM_FILT_PITCHBEND));
+
+}
+*/
+
+static void pm_flush_sysex(PmInternal *midi, PmTimestamp timestamp)
+{
+    PmEvent event;
+    
+    /* there may be nothing in the buffer */
+    if (midi->sysex_message_count == 0) return; /* nothing to flush */
+    
+    event.message = midi->sysex_message;
+    event.timestamp = timestamp;
+    /* copied from pm_read_short, avoids filtering */
+    if (Pm_Enqueue(midi->queue, &event) == pmBufferOverflow) {
+        midi->sysex_in_progress = FALSE;
+    }
+    midi->sysex_message_count = 0;
+    midi->sysex_message = 0;
+}
+
+
+/* pm_read_short and pm_read_bytes
+   are the interface between system-dependent MIDI input handlers
+   and the system-independent PortMIDI code.
+   The input handler MUST obey these rules:
+   1) all short input messages must be sent to pm_read_short, which
+      enqueues them to a FIFO for the application.
+   2) each buffer of sysex bytes should be reported by calling pm_read_bytes
+      (which sets midi->sysex_in_progress). After the eox byte, 
+      pm_read_bytes will clear sysex_in_progress
+ */
+
+/* pm_read_short is the place where all input messages arrive from 
+   system-dependent code such as pmwinmm.c. Here, the messages
+   are entered into the PortMidi input buffer. 
+ */
+void pm_read_short(PmInternal *midi, PmEvent *event)
+{ 
+    int status;
+    /* arg checking */
+    assert(midi != NULL);
+    /* midi filtering is applied here */
+    status = Pm_MessageStatus(event->message);
+    if (!pm_status_filtered(status, midi->filters)
+        && (!is_real_time(status) || 
+            !pm_realtime_filtered(status, midi->filters))
+        && !pm_channel_filtered(status, midi->channel_mask)) {
+        /* if sysex is in progress and we get a status byte, it had
+           better be a realtime message or the starting SYSEX byte;
+           otherwise, we exit the sysex_in_progress state
+         */
+        if (midi->sysex_in_progress && (status & MIDI_STATUS_MASK)) {
+            /* two choices: real-time or not. If it's real-time, then
+             * this should be delivered as a sysex byte because it is
+             * embedded in a sysex message
+             */
+            if (is_real_time(status)) {
+                midi->sysex_message |= 
+                        (status << (8 * midi->sysex_message_count++));
+                if (midi->sysex_message_count == 4) {
+                    pm_flush_sysex(midi, event->timestamp);
+                }
+            } else { /* otherwise, it's not real-time. This interrupts
+                      * a sysex message in progress */
+                midi->sysex_in_progress = FALSE;
+            }
+        } else if (Pm_Enqueue(midi->queue, event) == pmBufferOverflow) {
+            midi->sysex_in_progress = FALSE;
+        }
+    }
+}
+
+/* pm_read_bytes -- read one (partial) sysex msg from MIDI data */
+/*
+ * returns how many bytes processed
+ */
+unsigned int pm_read_bytes(PmInternal *midi, unsigned char *data, 
+                    int len, PmTimestamp timestamp)
+{
+    int i = 0; /* index into data, must not be unsigned (!) */
+    PmEvent event;
+    event.timestamp = timestamp;
+    assert(midi);
+    /* note that since buffers may not have multiples of 4 bytes,
+     * pm_read_bytes may be called in the middle of an outgoing
+     * 4-byte PortMidi message. sysex_in_progress indicates that
+     * a sysex has been sent but no eox.
+     */
+    if (len == 0) return 0; /* sanity check */
+    if (!midi->sysex_in_progress) {
+        while (i < len) { /* process all data */
+            unsigned char byte = data[i++];
+            if (byte == MIDI_SYSEX &&
+                !pm_realtime_filtered(byte, midi->filters)) {
+                midi->sysex_in_progress = TRUE;
+                i--; /* back up so code below will get SYSEX byte */
+                break; /* continue looping below to process msg */
+            } else if (byte == MIDI_EOX) {
+                midi->sysex_in_progress = FALSE;
+                return i; /* done with one message */
+            } else if (byte & MIDI_STATUS_MASK) {
+                /* We're getting MIDI but no sysex in progress.
+                 * Either the SYSEX status byte was dropped or
+                 * the message was filtered. Drop the data, but
+                 * send any embedded realtime bytes.
+                 */
+                /* assume that this is a real-time message:
+                 * it is an error to pass non-real-time messages
+                 * to pm_read_bytes
+                 */
+                event.message = byte;
+                pm_read_short(midi, &event);
+            }
+        } /* all bytes in the buffer are processed */
+    }
+    /* Now, i<len implies sysex_in_progress. If sysex_in_progress
+     * becomes false in the loop, there must have been an overflow
+     * and we can just drop all remaining bytes 
+     */
+    while (i < len && midi->sysex_in_progress) {
+        if (midi->sysex_message_count == 0 && i <= len - 4 &&
+            ((event.message = (((long) data[i]) | 
+                             (((long) data[i+1]) << 8) |
+                             (((long) data[i+2]) << 16) |
+                             (((long) data[i+3]) << 24))) &
+             0x80808080) == 0) { /* all data, no status */ 
+            if (Pm_Enqueue(midi->queue, &event) == pmBufferOverflow) {
+                midi->sysex_in_progress = FALSE;
+            }
+            i += 4;
+        } else {
+            while (i < len) {
+                /* send one byte at a time */
+                unsigned char byte = data[i++];
+                if (is_real_time(byte) && 
+                    pm_realtime_filtered(byte, midi->filters)) {
+                    continue; /* real-time data is filtered, so omit */
+                }
+                midi->sysex_message |= 
+                    (byte << (8 * midi->sysex_message_count++));
+                if (byte == MIDI_EOX) {
+                    midi->sysex_in_progress = FALSE;
+                    pm_flush_sysex(midi, event.timestamp);
+                    return i;
+                } else if (midi->sysex_message_count == 4) {
+                    pm_flush_sysex(midi, event.timestamp);
+                    /* after handling at least one non-data byte
+                     * and reaching a 4-byte message boundary,
+                     * resume trying to send 4 at a time in outer loop
+                     */
+                    break;
+                }
+            }
+        }
+    }
+    return i;
+}
+
+
diff --git a/lib-src/portmidi/pm_common/portmidi.h b/lib-src/portmidi/pm_common/portmidi.h
new file mode 100644
index 0000000..394a0f0
--- /dev/null
+++ b/lib-src/portmidi/pm_common/portmidi.h
@@ -0,0 +1,604 @@
+#ifndef PORT_MIDI_H
+#define PORT_MIDI_H
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * PortMidi Portable Real-Time MIDI Library
+ * PortMidi API Header File
+ * Latest version available at: http://sourceforge.net/projects/portmedia
+ *
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ * Copyright (c) 2001-2006 Roger B. Dannenberg
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortMidi license; however, 
+ * the PortMusic community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/* CHANGELOG FOR PORTMIDI
+ *     (see ../CHANGELOG.txt)
+ *
+ * NOTES ON HOST ERROR REPORTING: 
+ *
+ *    PortMidi errors (of type PmError) are generic, system-independent errors.
+ *    When an error does not map to one of the more specific PmErrors, the
+ *    catch-all code pmHostError is returned. This means that PortMidi has
+ *    retained a more specific system-dependent error code. The caller can
+ *    get more information by calling Pm_HasHostError() to test if there is
+ *    a pending host error, and Pm_GetHostErrorText() to get a text string
+ *    describing the error. Host errors are reported on a per-device basis 
+ *    because only after you open a device does PortMidi have a place to 
+ *    record the host error code. I.e. only 
+ *    those routines that receive a (PortMidiStream *) argument check and 
+ *    report errors. One exception to this is that Pm_OpenInput() and 
+ *    Pm_OpenOutput() can report errors even though when an error occurs,
+ *    there is no PortMidiStream* to hold the error. Fortunately, both
+ *    of these functions return any error immediately, so we do not really
+ *    need per-device error memory. Instead, any host error code is stored
+ *    in a global, pmHostError is returned, and the user can call 
+ *    Pm_GetHostErrorText() to get the error message (and the invalid stream
+ *    parameter will be ignored.) The functions 
+ *    pm_init and pm_term do not fail or raise
+ *    errors. The job of pm_init is to locate all available devices so that
+ *    the caller can get information via PmDeviceInfo(). If an error occurs,
+ *    the device is simply not listed as available.
+ *
+ *    Host errors come in two flavors:
+ *      a) host error 
+ *      b) host error during callback
+ *    These can occur w/midi input or output devices. (b) can only happen 
+ *    asynchronously (during callback routines), whereas (a) only occurs while
+ *    synchronously running PortMidi and any resulting system dependent calls.
+ *    Both (a) and (b) are reported by the next read or write call. You can
+ *    also query for asynchronous errors (b) at any time by calling
+ *    Pm_HasHostError().
+ *
+ * NOTES ON COMPILE-TIME SWITCHES
+ *
+ *    DEBUG assumes stdio and a console. Use this if you want automatic, simple
+ *        error reporting, e.g. for prototyping. If you are using MFC or some 
+ *        other graphical interface with no console, DEBUG probably should be
+ *        undefined.
+ *    PM_CHECK_ERRORS more-or-less takes over error checking for return values,
+ *        stopping your program and printing error messages when an error
+ *        occurs. This also uses stdio for console text I/O.
+ */ 
+
+#ifndef FALSE
+    #define FALSE 0
+#endif
+#ifndef TRUE
+    #define TRUE 1
+#endif
+
+/* default size of buffers for sysex transmission: */
+#define PM_DEFAULT_SYSEX_BUFFER_SIZE 1024
+
+/** List of portmidi errors.*/
+typedef enum {
+    pmNoError = 0,
+    pmNoData = 0, /**< A "no error" return that also indicates no data avail. */
+    pmGotData = 1, /**< A "no error" return that also indicates data available */
+    pmHostError = -10000,
+    pmInvalidDeviceId, /** out of range or 
+                        * output device when input is requested or 
+                        * input device when output is requested or
+                        * device is already opened 
+                        */
+    pmInsufficientMemory,
+    pmBufferTooSmall,
+    pmBufferOverflow,
+    pmBadPtr, /* PortMidiStream parameter is NULL or
+               * stream is not opened or
+               * stream is output when input is required or
+               * stream is input when output is required */
+    pmBadData, /** illegal midi data, e.g. missing EOX */
+    pmInternalError,
+    pmBufferMaxSize /** buffer is already as large as it can be */
+    /* NOTE: If you add a new error type, be sure to update Pm_GetErrorText() */
+} PmError;
+
+/**
+    Pm_Initialize() is the library initialisation function - call this before
+    using the library.
+*/
+PmError Pm_Initialize( void );
+
+/**
+    Pm_Terminate() is the library termination function - call this after
+    using the library.
+*/
+PmError Pm_Terminate( void );
+
+/**  A single PortMidiStream is a descriptor for an open MIDI device.
+*/
+typedef void PortMidiStream;
+#define PmStream PortMidiStream
+
+/**
+    Test whether stream has a pending host error. Normally, the client finds
+    out about errors through returned error codes, but some errors can occur
+    asynchronously where the client does not
+    explicitly call a function, and therefore cannot receive an error code.
+    The client can test for a pending error using Pm_HasHostError(). If true,
+    the error can be accessed and cleared by calling Pm_GetErrorText(). 
+    Errors are also cleared by calling other functions that can return
+    errors, e.g. Pm_OpenInput(), Pm_OpenOutput(), Pm_Read(), Pm_Write(). The
+    client does not need to call Pm_HasHostError(). Any pending error will be
+    reported the next time the client performs an explicit function call on 
+    the stream, e.g. an input or output operation. Until the error is cleared,
+    no new error codes will be obtained, even for a different stream.
+*/
+int Pm_HasHostError( PortMidiStream * stream );
+
+
+/**  Translate portmidi error number into human readable message.
+    These strings are constants (set at compile time) so client has 
+    no need to allocate storage
+*/
+const char *Pm_GetErrorText( PmError errnum );
+
+/**  Translate portmidi host error into human readable message.
+    These strings are computed at run time, so client has to allocate storage.
+    After this routine executes, the host error is cleared. 
+*/
+void Pm_GetHostErrorText(char * msg, unsigned int len);
+
+#define HDRLENGTH 50
+#define PM_HOST_ERROR_MSG_LEN 256u /* any host error msg will occupy less 
+                                      than this number of characters */
+
+/**
+    Device enumeration mechanism.
+
+    Device ids range from 0 to Pm_CountDevices()-1.
+
+*/
+typedef int PmDeviceID;
+#define pmNoDevice -1
+typedef struct {
+    int structVersion; /**< this internal structure version */ 
+    const char *interf; /**< underlying MIDI API, e.g. MMSystem or DirectX */
+    const char *name;   /**< device name, e.g. USB MidiSport 1x1 */
+    int input; /**< true iff input is available */
+    int output; /**< true iff output is available */
+    int opened; /**< used by generic PortMidi code to do error checking on arguments */
+
+} PmDeviceInfo;
+
+/**  Get devices count, ids range from 0 to Pm_CountDevices()-1. */
+int Pm_CountDevices( void );
+/**
+    Pm_GetDefaultInputDeviceID(), Pm_GetDefaultOutputDeviceID()
+
+    Return the default device ID or pmNoDevice if there are no devices.
+    The result (but not pmNoDevice) can be passed to Pm_OpenMidi().
+    
+    The default device can be specified using a small application
+    named pmdefaults that is part of the PortMidi distribution. This
+    program in turn uses the Java Preferences object created by
+    java.util.prefs.Preferences.userRoot().node("/PortMidi"); the
+    preference is set by calling 
+        prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName);
+    or  prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName);
+    
+    In the statements above, prefName is a string describing the
+    MIDI device in the form "interf, name" where interf identifies
+    the underlying software system or API used by PortMdi to access
+    devices and name is the name of the device. These correspond to 
+    the interf and name fields of a PmDeviceInfo. (Currently supported
+    interfaces are "MMSystem" for Win32, "ALSA" for Linux, and 
+    "CoreMIDI" for OS X, so in fact, there is no choice of interface.)
+    In "interf, name", the strings are actually substrings of 
+    the full interface and name strings. For example, the preference 
+    "Core, Sport" will match a device with interface "CoreMIDI"
+    and name "In USB MidiSport 1x1". It will also match "CoreMIDI"
+    and "In USB MidiSport 2x2". The devices are enumerated in device
+    ID order, so the lowest device ID that matches the pattern becomes
+    the default device. Finally, if the comma-space (", ") separator
+    between interface and name parts of the preference is not found,
+    the entire preference string is interpreted as a name, and the
+    interface part is the empty string, which matches anything.
+
+    On the MAC, preferences are stored in 
+      /Users/$NAME/Library/Preferences/com.apple.java.util.prefs.plist
+    which is a binary file. In addition to the pmdefaults program,
+    there are utilities that can read and edit this preference file.
+
+    On the PC, 
+
+    On Linux, 
+
+*/
+PmDeviceID Pm_GetDefaultInputDeviceID( void );
+/** see PmDeviceID Pm_GetDefaultInputDeviceID() */
+PmDeviceID Pm_GetDefaultOutputDeviceID( void );
+
+/**
+    PmTimestamp is used to represent a millisecond clock with arbitrary
+    start time. The type is used for all MIDI timestampes and clocks.
+*/
+typedef long PmTimestamp;
+typedef PmTimestamp (*PmTimeProcPtr)(void *time_info);
+
+/** TRUE if t1 before t2 */
+#define PmBefore(t1,t2) ((t1-t2) < 0)
+/** 
+    \defgroup grp_device Input/Output Devices Handling
+    @{
+*/
+/**
+    Pm_GetDeviceInfo() returns a pointer to a PmDeviceInfo structure
+    referring to the device specified by id.
+    If id is out of range the function returns NULL.
+
+    The returned structure is owned by the PortMidi implementation and must
+    not be manipulated or freed. The pointer is guaranteed to be valid
+    between calls to Pm_Initialize() and Pm_Terminate().
+*/
+const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id );
+
+/**
+    Pm_OpenInput() and Pm_OpenOutput() open devices.
+
+    stream is the address of a PortMidiStream pointer which will receive
+    a pointer to the newly opened stream.
+
+    inputDevice is the id of the device used for input (see PmDeviceID above).
+
+    inputDriverInfo is a pointer to an optional driver specific data structure
+    containing additional information for device setup or handle processing.
+    inputDriverInfo is never required for correct operation. If not used
+    inputDriverInfo should be NULL.
+
+    outputDevice is the id of the device used for output (see PmDeviceID above.)
+
+    outputDriverInfo is a pointer to an optional driver specific data structure
+    containing additional information for device setup or handle processing.
+    outputDriverInfo is never required for correct operation. If not used
+    outputDriverInfo should be NULL.
+
+    For input, the buffersize specifies the number of input events to be 
+    buffered waiting to be read using Pm_Read(). For output, buffersize 
+    specifies the number of output events to be buffered waiting for output. 
+    (In some cases -- see below -- PortMidi does not buffer output at all
+    and merely passes data to a lower-level API, in which case buffersize
+    is ignored.)
+    
+    latency is the delay in milliseconds applied to timestamps to determine 
+    when the output should actually occur. (If latency is < 0, 0 is assumed.) 
+    If latency is zero, timestamps are ignored and all output is delivered
+    immediately. If latency is greater than zero, output is delayed until the
+    message timestamp plus the latency. (NOTE: the time is measured relative 
+    to the time source indicated by time_proc. Timestamps are absolute,
+    not relative delays or offsets.) In some cases, PortMidi can obtain
+    better timing than your application by passing timestamps along to the
+    device driver or hardware. Latency may also help you to synchronize midi
+    data to audio data by matching midi latency to the audio buffer latency.
+
+    time_proc is a pointer to a procedure that returns time in milliseconds. It
+    may be NULL, in which case a default millisecond timebase (PortTime) is 
+    used. If the application wants to use PortTime, it should start the timer
+    (call Pt_Start) before calling Pm_OpenInput or Pm_OpenOutput. If the
+    application tries to start the timer *after* Pm_OpenInput or Pm_OpenOutput,
+    it may get a ptAlreadyStarted error from Pt_Start, and the application's
+    preferred time resolution and callback function will be ignored.
+    time_proc result values are appended to incoming MIDI data, and time_proc
+    times are used to schedule outgoing MIDI data (when latency is non-zero).
+
+    time_info is a pointer passed to time_proc.
+
+    Example: If I provide a timestamp of 5000, latency is 1, and time_proc
+    returns 4990, then the desired output time will be when time_proc returns
+    timestamp+latency = 5001. This will be 5001-4990 = 11ms from now.
+
+    return value:
+    Upon success Pm_Open() returns PmNoError and places a pointer to a
+    valid PortMidiStream in the stream argument.
+    If a call to Pm_Open() fails a nonzero error code is returned (see
+    PMError above) and the value of port is invalid.
+
+    Any stream that is successfully opened should eventually be closed
+    by calling Pm_Close().
+
+*/
+PmError Pm_OpenInput( PortMidiStream** stream,
+                PmDeviceID inputDevice,
+                void *inputDriverInfo,
+                long bufferSize,
+                PmTimeProcPtr time_proc,
+                void *time_info );
+
+PmError Pm_OpenOutput( PortMidiStream** stream,
+                PmDeviceID outputDevice,
+                void *outputDriverInfo,
+                long bufferSize,
+                PmTimeProcPtr time_proc,
+                void *time_info,
+                long latency );
+  /** @} */
+
+/**
+   \defgroup grp_events_filters Events and Filters Handling
+   @{
+*/
+
+/*  \function PmError Pm_SetFilter( PortMidiStream* stream, long filters )
+    Pm_SetFilter() sets filters on an open input stream to drop selected
+    input types. By default, only active sensing messages are filtered.
+    To prohibit, say, active sensing and sysex messages, call
+    Pm_SetFilter(stream, PM_FILT_ACTIVE | PM_FILT_SYSEX);
+
+    Filtering is useful when midi routing or midi thru functionality is being
+    provided by the user application.
+    For example, you may want to exclude timing messages (clock, MTC, start/stop/continue),
+    while allowing note-related messages to pass.
+    Or you may be using a sequencer or drum-machine for MIDI clock information but want to
+    exclude any notes it may play.
+ */
+    
+/* Filter bit-mask definitions */
+/** filter active sensing messages (0xFE): */
+#define PM_FILT_ACTIVE (1 << 0x0E)
+/** filter system exclusive messages (0xF0): */
+#define PM_FILT_SYSEX (1 << 0x00)
+/** filter MIDI clock message (0xF8) */
+#define PM_FILT_CLOCK (1 << 0x08)
+/** filter play messages (start 0xFA, stop 0xFC, continue 0xFB) */
+#define PM_FILT_PLAY ((1 << 0x0A) | (1 << 0x0C) | (1 << 0x0B))
+/** filter tick messages (0xF9) */
+#define PM_FILT_TICK (1 << 0x09)
+/** filter undefined FD messages */
+#define PM_FILT_FD (1 << 0x0D)
+/** filter undefined real-time messages */
+#define PM_FILT_UNDEFINED PM_FILT_FD
+/** filter reset messages (0xFF) */
+#define PM_FILT_RESET (1 << 0x0F)
+/** filter all real-time messages */
+#define PM_FILT_REALTIME (PM_FILT_ACTIVE | PM_FILT_SYSEX | PM_FILT_CLOCK | \
+    PM_FILT_PLAY | PM_FILT_UNDEFINED | PM_FILT_RESET | PM_FILT_TICK)
+/** filter note-on and note-off (0x90-0x9F and 0x80-0x8F */
+#define PM_FILT_NOTE ((1 << 0x19) | (1 << 0x18))
+/** filter channel aftertouch (most midi controllers use this) (0xD0-0xDF)*/
+#define PM_FILT_CHANNEL_AFTERTOUCH (1 << 0x1D)
+/** per-note aftertouch (0xA0-0xAF) */
+#define PM_FILT_POLY_AFTERTOUCH (1 << 0x1A)
+/** filter both channel and poly aftertouch */
+#define PM_FILT_AFTERTOUCH (PM_FILT_CHANNEL_AFTERTOUCH | PM_FILT_POLY_AFTERTOUCH)
+/** Program changes (0xC0-0xCF) */
+#define PM_FILT_PROGRAM (1 << 0x1C)
+/** Control Changes (CC's) (0xB0-0xBF)*/
+#define PM_FILT_CONTROL (1 << 0x1B)
+/** Pitch Bender (0xE0-0xEF*/
+#define PM_FILT_PITCHBEND (1 << 0x1E)
+/** MIDI Time Code (0xF1)*/
+#define PM_FILT_MTC (1 << 0x01)
+/** Song Position (0xF2) */
+#define PM_FILT_SONG_POSITION (1 << 0x02)
+/** Song Select (0xF3)*/
+#define PM_FILT_SONG_SELECT (1 << 0x03)
+/** Tuning request (0xF6)*/
+#define PM_FILT_TUNE (1 << 0x06)
+/** All System Common messages (mtc, song position, song select, tune request) */
+#define PM_FILT_SYSTEMCOMMON (PM_FILT_MTC | PM_FILT_SONG_POSITION | PM_FILT_SONG_SELECT | PM_FILT_TUNE)
+
+
+PmError Pm_SetFilter( PortMidiStream* stream, long filters );
+
+#define Pm_Channel(channel) (1<<(channel))
+/**
+    Pm_SetChannelMask() filters incoming messages based on channel.
+    The mask is a 16-bit bitfield corresponding to appropriate channels
+    The Pm_Channel macro can assist in calling this function.
+    i.e. to set receive only input on channel 1, call with
+    Pm_SetChannelMask(Pm_Channel(1));
+    Multiple channels should be OR'd together, like
+    Pm_SetChannelMask(Pm_Channel(10) | Pm_Channel(11))
+
+    All channels are allowed by default
+*/
+PmError Pm_SetChannelMask(PortMidiStream *stream, int mask);
+
+/**
+    Pm_Abort() terminates outgoing messages immediately
+    The caller should immediately close the output port;
+    this call may result in transmission of a partial midi message.
+    There is no abort for Midi input because the user can simply
+    ignore messages in the buffer and close an input device at
+    any time.
+ */
+PmError Pm_Abort( PortMidiStream* stream );
+     
+/**
+    Pm_Close() closes a midi stream, flushing any pending buffers.
+    (PortMidi attempts to close open streams when the application 
+    exits -- this is particularly difficult under Windows.)
+*/
+PmError Pm_Close( PortMidiStream* stream );
+
+/**
+    Pm_Message() encodes a short Midi message into a long word. If data1
+    and/or data2 are not present, use zero.
+
+    Pm_MessageStatus(), Pm_MessageData1(), and 
+    Pm_MessageData2() extract fields from a long-encoded midi message.
+*/
+#define Pm_Message(status, data1, data2) \
+         ((((data2) << 16) & 0xFF0000) | \
+          (((data1) << 8) & 0xFF00) | \
+          ((status) & 0xFF))
+#define Pm_MessageStatus(msg) ((msg) & 0xFF)
+#define Pm_MessageData1(msg) (((msg) >> 8) & 0xFF)
+#define Pm_MessageData2(msg) (((msg) >> 16) & 0xFF)
+
+typedef long PmMessage; /**< see PmEvent */
+/**
+   All midi data comes in the form of PmEvent structures. A sysex
+   message is encoded as a sequence of PmEvent structures, with each
+   structure carrying 4 bytes of the message, i.e. only the first
+   PmEvent carries the status byte.
+
+   Note that MIDI allows nested messages: the so-called "real-time" MIDI 
+   messages can be inserted into the MIDI byte stream at any location, 
+   including within a sysex message. MIDI real-time messages are one-byte
+   messages used mainly for timing (see the MIDI spec). PortMidi retains 
+   the order of non-real-time MIDI messages on both input and output, but 
+   it does not specify exactly how real-time messages are processed. This
+   is particulary problematic for MIDI input, because the input parser 
+   must either prepare to buffer an unlimited number of sysex message 
+   bytes or to buffer an unlimited number of real-time messages that 
+   arrive embedded in a long sysex message. To simplify things, the input
+   parser is allowed to pass real-time MIDI messages embedded within a 
+   sysex message, and it is up to the client to detect, process, and 
+   remove these messages as they arrive.
+
+   When receiving sysex messages, the sysex message is terminated
+   by either an EOX status byte (anywhere in the 4 byte messages) or
+   by a non-real-time status byte in the low order byte of the message.
+   If you get a non-real-time status byte but there was no EOX byte, it 
+   means the sysex message was somehow truncated. This is not
+   considered an error; e.g., a missing EOX can result from the user
+   disconnecting a MIDI cable during sysex transmission.
+
+   A real-time message can occur within a sysex message. A real-time 
+   message will always occupy a full PmEvent with the status byte in 
+   the low-order byte of the PmEvent message field. (This implies that
+   the byte-order of sysex bytes and real-time message bytes may not
+   be preserved -- for example, if a real-time message arrives after
+   3 bytes of a sysex message, the real-time message will be delivered
+   first. The first word of the sysex message will be delivered only
+   after the 4th byte arrives, filling the 4-byte PmEvent message field.
+   
+   The timestamp field is observed when the output port is opened with
+   a non-zero latency. A timestamp of zero means "use the current time",
+   which in turn means to deliver the message with a delay of
+   latency (the latency parameter used when opening the output port.)
+   Do not expect PortMidi to sort data according to timestamps -- 
+   messages should be sent in the correct order, and timestamps MUST 
+   be non-decreasing. See also "Example" for Pm_OpenOutput() above.
+
+   A sysex message will generally fill many PmEvent structures. On 
+   output to a PortMidiStream with non-zero latency, the first timestamp
+   on sysex message data will determine the time to begin sending the 
+   message. PortMidi implementations may ignore timestamps for the 
+   remainder of the sysex message. 
+   
+   On input, the timestamp ideally denotes the arrival time of the 
+   status byte of the message. The first timestamp on sysex message 
+   data will be valid. Subsequent timestamps may denote 
+   when message bytes were actually received, or they may be simply 
+   copies of the first timestamp.
+
+   Timestamps for nested messages: If a real-time message arrives in 
+   the middle of some other message, it is enqueued immediately with 
+   the timestamp corresponding to its arrival time. The interrupted 
+   non-real-time message or 4-byte packet of sysex data will be enqueued 
+   later. The timestamp of interrupted data will be equal to that of
+   the interrupting real-time message to insure that timestamps are
+   non-decreasing.
+ */
+typedef struct {
+    PmMessage      message;
+    PmTimestamp    timestamp;
+} PmEvent;
+
+/** 
+    @}
+*/
+/** \defgroup grp_io Reading and Writing Midi Messages
+    @{
+*/
+/**
+    Pm_Read() retrieves midi data into a buffer, and returns the number
+    of events read. Result is a non-negative number unless an error occurs, 
+    in which case a PmError value will be returned.
+
+    Buffer Overflow
+
+    The problem: if an input overflow occurs, data will be lost, ultimately 
+    because there is no flow control all the way back to the data source. 
+    When data is lost, the receiver should be notified and some sort of 
+    graceful recovery should take place, e.g. you shouldn't resume receiving 
+    in the middle of a long sysex message.
+
+    With a lock-free fifo, which is pretty much what we're stuck with to 
+    enable portability to the Mac, it's tricky for the producer and consumer 
+    to synchronously reset the buffer and resume normal operation.
+
+    Solution: the buffer managed by PortMidi will be flushed when an overflow
+    occurs. The consumer (Pm_Read()) gets an error message (pmBufferOverflow)
+    and ordinary processing resumes as soon as a new message arrives. The
+    remainder of a partial sysex message is not considered to be a "new
+    message" and will be flushed as well.
+
+*/
+int Pm_Read( PortMidiStream *stream, PmEvent *buffer, long length );
+
+/**
+    Pm_Poll() tests whether input is available, 
+    returning TRUE, FALSE, or an error value.
+*/
+PmError Pm_Poll( PortMidiStream *stream);
+
+/** 
+    Pm_Write() writes midi data from a buffer. This may contain:
+        - short messages 
+    or 
+        - sysex messages that are converted into a sequence of PmEvent
+          structures, e.g. sending data from a file or forwarding them
+          from midi input.
+
+    Use Pm_WriteSysEx() to write a sysex message stored as a contiguous 
+    array of bytes.
+
+    Sysex data may contain embedded real-time messages.
+*/
+PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, long length );
+
+/**
+    Pm_WriteShort() writes a timestamped non-system-exclusive midi message.
+    Messages are delivered in order as received, and timestamps must be 
+    non-decreasing. (But timestamps are ignored if the stream was opened
+    with latency = 0.)
+*/
+PmError Pm_WriteShort( PortMidiStream *stream, PmTimestamp when, long msg);
+
+/**
+    Pm_WriteSysEx() writes a timestamped system-exclusive midi message.
+*/
+PmError Pm_WriteSysEx( PortMidiStream *stream, PmTimestamp when, unsigned char *msg);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* PORT_MIDI_H */
diff --git a/lib-src/portmidi/pm_linux/README_LINUX.txt b/lib-src/portmidi/pm_linux/README_LINUX.txt
new file mode 100644
index 0000000..e928a1f
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/README_LINUX.txt
@@ -0,0 +1,61 @@
+README_LINUX.txt for PortMidi
+Roger Dannenberg
+29 Aug 2006
+
+To make PortMidi and PortTime, go back up to the portmidi
+directory and type 
+
+make -f pm_linux/Makefile
+
+(You can also copy pm_linux/Makefile to the portmidi
+directory and just type "make".)
+
+The Makefile will build all test programs and the portmidi
+library. You may want to modify the Makefile to remove the
+PM_CHECK_ERRORS definition. For experimental software,
+especially programs running from the command line, we 
+recommend using PM_CHECK_ERRORS -- it will terminate your
+program and print a helpful message if any PortMidi 
+function returns an error code.
+
+If you do not compile with PM_CHECK_ERRORS, you should 
+check for errors yourself.
+
+This code has not been carefully tested; however, 
+all test programs in pm_test seem to run properly.
+
+A NOTE ABOUT AMD64:
+
+When compiling portmidi under linux on an AMD64, I had to add the -fPIC
+flag to the gcc flags.
+
+Reason: when trying to build John Harrison's pyPortMidi gcc bailed out
+with this error:
+
+./linux/libportmidi.a(pmlinux.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
+./linux/libportmidi.a: could not read symbols: Bad value
+collect2: ld returned 1 exit status
+error: command 'gcc' failed with exit status 1
+
+What they said:
+http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
+On certain architectures (AMD64 amongst them), shared libraries *must* 
+be "PIC-enabled".
+
+CHANGELOG
+
+29-aug-2006 Roger B. Dannenberg
+   Fixed PortTime to join with time thread for clean exit.    
+
+28-aug-2006 Roger B. Dannenberg
+    Updated this documentation.
+ 
+08-Jun-2004 Roger B. Dannenberg
+      Updated code to use new system abstraction.
+
+12-Apr-2003 Roger B. Dannenberg
+      Fixed pm_test/test.c to filter clocks and active messages.
+      Integrated changes from Clemens Ladisch:
+          cleaned up pmlinuxalsa.c
+          record timestamp on sysex input
+          deallocate some resources previously left open
diff --git a/lib-src/portmidi/pm_linux/finddefault.c b/lib-src/portmidi/pm_linux/finddefault.c
new file mode 100644
index 0000000..6340316
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/finddefault.c
@@ -0,0 +1,92 @@
+/* finddefault.c -- find_default_device() implementation
+   Roger Dannenberg, Jan 2009
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "portmidi.h"
+
+#define STRING_MAX 256
+
+/* skip over spaces, return first non-space */
+void skip_spaces(FILE *inf)
+{
+    char c;
+    while (isspace(c = getc(inf))) ;
+    ungetc(c, inf);
+}
+
+/* trim leading spaces and match a string */
+int match_string(FILE *inf, char *s)
+{
+    skip_spaces(inf);
+    while (*s && *s == getc(inf)) s++;
+    return (*s == 0);
+} 
+
+
+/* 
+/* Parse preference files, find default device, search devices --
+ */
+PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
+/* path -- the name of the preference we are searching for
+   input -- true iff this is an input device
+   id -- current default device id
+   returns matching device id if found, otherwise id
+*/
+{
+    static char *pref_2 = "/.java/.userPrefs/";
+    static char *pref_3 = "prefs.xml";
+    char *pref_1 = getenv("HOME");
+    char *full_name, *path_ptr;
+    FILE *inf;
+    int c, i;
+    if (!pref_1) goto nopref; // cannot find preference file
+    // full_name will be larger than necessary
+    full_name  = malloc(strlen(pref_1) + strlen(pref_2) + strlen(pref_3) +
+                        strlen(path) + 2);
+    strcpy(full_name, pref_1); 
+    strcat(full_name, pref_2);
+    // copy all but last path segment to full_name
+    if (*path == '/') path++; // skip initial slash in path
+    path_ptr = strrchr(path, '/'); 
+    if (path_ptr) { // copy up to slash after full_name
+        path_ptr++;
+        int offset = strlen(full_name);
+        memcpy(full_name + offset, path, path_ptr - path);
+        full_name[offset + path_ptr - path] = 0; // end of string
+    } else {
+        path_ptr = path;
+    }
+    strcat(full_name, pref_3);
+    inf = fopen(full_name, "r");
+    if (!inf) goto nopref; // cannot open preference file
+    // We're not going to build or link in a full XML parser.
+    // Instead, find the path string and quoute. Then, look for
+    // "value", "=", quote. Then get string up to quote.
+    while ((c = getc(inf)) != EOF) {
+        char pref_str[STRING_MAX];
+        if (c != '"') continue; // scan up to quote
+        // look for quote string quote
+        if (!match_string(inf, path_ptr)) continue; // path not found
+        if (getc(inf) != '"') continue; // path not found, keep scanning
+        if (!match_string(inf, "value")) goto nopref; // value not found
+        if (!match_string(inf, "=")) goto nopref; // = not found
+        if (!match_string(inf, "\"")) goto nopref; // quote not found
+        // now read the value up to the close quote
+        for (i = 0; i < STRING_MAX; i++) {
+            if ((c = getc(inf)) == '"') break;
+            pref_str[i] = c;
+        }
+        if (i == STRING_MAX) continue; // value too long, ignore
+        pref_str[i] == 0;
+        i = pm_find_default_device(pref_str, input);
+        if (i != pmNoDevice) {
+            id = i;
+	}
+        break;
+    }
+ nopref:
+    return id;
+}
diff --git a/lib-src/portmidi/pm_linux/pmlinux.c b/lib-src/portmidi/pm_linux/pmlinux.c
new file mode 100644
index 0000000..d53e685
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/pmlinux.c
@@ -0,0 +1,60 @@
+/* pmlinux.c -- PortMidi os-dependent code */
+
+/* This file only needs to implement pm_init(), which calls various
+   routines to register the available midi devices. This file must
+   be separate from the main portmidi.c file because it is system
+   dependent, and it is separate from, pmlinuxalsa.c, because it
+   might need to register non-alsa devices as well.
+
+   NOTE: if you add non-ALSA support, you need to fix :alsa_poll()
+   in pmlinuxalsa.c, which assumes all input devices are ALSA.
+ */
+
+#include "stdlib.h"
+#include "portmidi.h"
+#ifdef PMALSA
+  #include "pmlinuxalsa.h"
+#endif
+
+#ifdef PMNULL
+  #include "pmlinuxnull.h"
+#endif
+
+PmError pm_init()
+{
+    /* Note: it is not an error for PMALSA to fail to initialize. 
+     * It may be a design error that the client cannot query what subsystems
+     * are working properly other than by looking at the list of available
+     * devices.
+     */
+    #ifdef PMALSA
+	pm_linuxalsa_init();
+    #endif
+    #ifdef PMNULL
+        pm_linuxnull_init();
+    #endif
+    return pmNoError;
+}
+
+void pm_term(void)
+{
+    #ifdef PMALSA
+        pm_linuxalsa_term();
+    #endif
+}
+
+PmDeviceID pm_default_input_device_id = -1;
+PmDeviceID pm_default_output_device_id = -1;
+
+PmDeviceID Pm_GetDefaultInputDeviceID() { 
+    return pm_default_input_device_id; 
+}
+
+PmDeviceID Pm_GetDefaultOutputDeviceID() { 
+    return pm_default_output_device_id; 
+}
+
+void *pm_alloc(size_t s) { return malloc(s); }
+
+void pm_free(void *ptr) { free(ptr); }
+
diff --git a/lib-src/portmidi/pm_linux/pmlinux.h b/lib-src/portmidi/pm_linux/pmlinux.h
new file mode 100644
index 0000000..4042cce
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/pmlinux.h
@@ -0,0 +1,5 @@
+/* pmlinux.h */
+
+extern PmDeviceID pm_default_input_device_id;
+extern PmDeviceID pm_default_output_device_id;
+
diff --git a/lib-src/portmidi/pm_linux/pmlinuxalsa.c b/lib-src/portmidi/pm_linux/pmlinuxalsa.c
new file mode 100644
index 0000000..2bee83d
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/pmlinuxalsa.c
@@ -0,0 +1,780 @@
+/*
+ * pmlinuxalsa.c -- system specific definitions
+ * 
+ * written by:
+ *  Roger Dannenberg (port to Alsa 0.9.x)
+ *  Clemens Ladisch (provided code examples and invaluable consulting)
+ *  Jason Cohen, Rico Colon, Matt Filippone (Alsa 0.5.x implementation)
+ */ 
+
+#include "stdlib.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include "pmlinuxalsa.h"
+#include "string.h"
+#include "porttime.h"
+#include "pmlinux.h"
+
+#include <alsa/asoundlib.h>
+
+/* I used many print statements to debug this code. I left them in the
+ * source, and you can turn them on by changing false to true below:
+ */
+#define VERBOSE_ON 0
+#define VERBOSE if (VERBOSE_ON)
+
+#define MIDI_SYSEX      0xf0
+#define MIDI_EOX        0xf7
+
+#if SND_LIB_MAJOR == 0 && SND_LIB_MINOR < 9
+#error needs ALSA 0.9.0 or later
+#endif
+
+/* to store client/port in the device descriptor */
+#define MAKE_DESCRIPTOR(client, port) ((void*)(((client) << 8) | (port)))
+#define GET_DESCRIPTOR_CLIENT(info) ((((int)(info)) >> 8) & 0xff)
+#define GET_DESCRIPTOR_PORT(info) (((int)(info)) & 0xff)
+
+#define BYTE unsigned char
+#define UINT unsigned long
+
+extern pm_fns_node pm_linuxalsa_in_dictionary;
+extern pm_fns_node pm_linuxalsa_out_dictionary;
+
+static snd_seq_t *seq = NULL; // all input comes here, 
+                              // output queue allocated on seq
+static int queue, queue_used; /* one for all ports, reference counted */
+
+typedef struct alsa_descriptor_struct {
+    int client;
+    int port;
+    int this_port;
+    int in_sysex;
+    snd_midi_event_t *parser;
+    int error; /* host error code */
+} alsa_descriptor_node, *alsa_descriptor_type;
+
+
+/* get_alsa_error_text -- copy error text to potentially short string */
+/**/
+static void get_alsa_error_text(char *msg, int len, int err)
+{
+    int errlen = strlen(snd_strerror(err));
+    if (errlen < len) {
+        strcpy(msg, snd_strerror(err));
+    } else if (len > 20) {
+        sprintf(msg, "Alsa error %d", err);
+    } else if (len > 4) {
+        strcpy(msg, "Alsa");
+    } else {
+        msg[0] = 0;
+    }
+}
+
+
+/* queue is shared by both input and output, reference counted */
+static PmError alsa_use_queue(void)
+{
+    if (queue_used == 0) {
+        snd_seq_queue_tempo_t *tempo;
+
+        queue = snd_seq_alloc_queue(seq);
+        if (queue < 0) {
+            pm_hosterror = queue;
+            return pmHostError;
+        }
+        snd_seq_queue_tempo_alloca(&tempo);
+        snd_seq_queue_tempo_set_tempo(tempo, 480000);
+        snd_seq_queue_tempo_set_ppq(tempo, 480);
+        pm_hosterror = snd_seq_set_queue_tempo(seq, queue, tempo);
+        if (pm_hosterror < 0)
+            return pmHostError;
+
+        snd_seq_start_queue(seq, queue, NULL);
+        snd_seq_drain_output(seq);
+    }
+    ++queue_used;
+    return pmNoError;
+}
+
+
+static void alsa_unuse_queue(void)
+{
+    if (--queue_used == 0) {
+        snd_seq_stop_queue(seq, queue, NULL);
+        snd_seq_drain_output(seq);
+        snd_seq_free_queue(seq, queue);
+        VERBOSE printf("queue freed\n");
+    }
+}
+
+
+/* midi_message_length -- how many bytes in a message? */
+static int midi_message_length(PmMessage message)
+{
+    message &= 0xff;
+    if (message < 0x80) {
+        return 0;
+    } else if (message < 0xf0) {
+        static const int length[] = {3, 3, 3, 3, 2, 2, 3};
+        return length[(message - 0x80) >> 4];
+    } else {
+        static const int length[] = {
+            -1, 2, 3, 2, 0, 0, 1, -1, 1, 0, 1, 1, 1, 0, 1, 1};
+        return length[message - 0xf0];
+    }
+}
+
+
+static PmError alsa_out_open(PmInternal *midi, void *driverInfo) 
+{
+    void *client_port = descriptors[midi->device_id].descriptor;
+    alsa_descriptor_type desc = (alsa_descriptor_type) 
+        pm_alloc(sizeof(alsa_descriptor_node));
+    snd_seq_port_info_t *info;
+    int err;
+
+    if (!desc) return pmInsufficientMemory;
+    
+    snd_seq_port_info_alloca(&info);
+    snd_seq_port_info_set_port(info, midi->device_id);
+    snd_seq_port_info_set_capability(info, SND_SEQ_PORT_CAP_WRITE |
+                                     SND_SEQ_PORT_CAP_READ);
+    snd_seq_port_info_set_type(info, SND_SEQ_PORT_TYPE_MIDI_GENERIC | 
+                                     SND_SEQ_PORT_TYPE_APPLICATION);
+    snd_seq_port_info_set_port_specified(info, 1);
+    err = snd_seq_create_port(seq, info);
+    if (err < 0) goto free_desc;
+
+    /* fill in fields of desc, which is passed to pm_write routines */
+    midi->descriptor = desc;
+    desc->client = GET_DESCRIPTOR_CLIENT(client_port);
+    desc->port = GET_DESCRIPTOR_PORT(client_port);
+    desc->this_port = midi->device_id;
+    desc->in_sysex = 0;
+
+    desc->error = 0;
+
+    err = snd_midi_event_new(PM_DEFAULT_SYSEX_BUFFER_SIZE, &desc->parser);
+    if (err < 0) goto free_this_port;
+
+    if (midi->latency > 0) { /* must delay output using a queue */
+        err = alsa_use_queue();
+        if (err < 0) goto free_parser;
+
+        err = snd_seq_connect_to(seq, desc->this_port, desc->client, desc->port);
+        if (err < 0) goto unuse_queue;  /* clean up and return on error */
+    } else {
+        err = snd_seq_connect_to(seq, desc->this_port, desc->client, desc->port);
+        if (err < 0) goto free_parser;  /* clean up and return on error */
+    }        
+    return pmNoError;
+
+ unuse_queue:
+    alsa_unuse_queue();
+ free_parser:
+    snd_midi_event_free(desc->parser);
+ free_this_port:
+    snd_seq_delete_port(seq, desc->this_port);
+ free_desc:
+    pm_free(desc);
+    pm_hosterror = err;
+    if (err < 0) {
+        get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, err);
+    }
+    return pmHostError;
+}
+    
+
+static PmError alsa_write_byte(PmInternal *midi, unsigned char byte, 
+                        PmTimestamp timestamp)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    snd_seq_event_t ev;
+    int err;
+
+    snd_seq_ev_clear(&ev);
+    if (snd_midi_event_encode_byte(desc->parser, byte, &ev) == 1) {
+        snd_seq_ev_set_dest(&ev, desc->client, desc->port);
+        snd_seq_ev_set_source(&ev, desc->this_port);
+        if (midi->latency > 0) {
+            /* compute relative time of event = timestamp - now + latency */
+            PmTimestamp now = (midi->time_proc ? 
+                               midi->time_proc(midi->time_info) : 
+                               Pt_Time(NULL));
+            int when = timestamp;
+            /* if timestamp is zero, send immediately */
+            /* otherwise compute time delay and use delay if positive */
+            if (when == 0) when = now;
+            when = (when - now) + midi->latency;
+            if (when < 0) when = 0;
+            VERBOSE printf("timestamp %d now %d latency %d, ", 
+                           (int) timestamp, (int) now, midi->latency);
+            VERBOSE printf("scheduling event after %d\n", when);
+            /* message is sent in relative ticks, where 1 tick = 1 ms */
+            snd_seq_ev_schedule_tick(&ev, queue, 1, when);
+            /* NOTE: for cases where the user does not supply a time function,
+               we could optimize the code by not starting Pt_Time and using
+               the alsa tick time instead. I didn't do this because it would
+               entail changing the queue management to start the queue tick
+               count when PortMidi is initialized and keep it running until
+               PortMidi is terminated. (This should be simple, but it's not
+               how the code works now.) -RBD */
+        } else { /* send event out without queueing */
+            VERBOSE printf("direct\n");
+            /* ev.queue = SND_SEQ_QUEUE_DIRECT;
+               ev.dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS; */
+            snd_seq_ev_set_direct(&ev);
+        }
+        VERBOSE printf("sending event\n");
+        err = snd_seq_event_output(seq, &ev);
+        if (err < 0) {
+            desc->error = err;
+            return pmHostError;
+        }
+    }
+    return pmNoError;
+}
+
+
+static PmError alsa_out_close(PmInternal *midi)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    if (!desc) return pmBadPtr;
+
+    if (pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port, 
+                                             desc->client, desc->port)) {
+        // if there's an error, try to delete the port anyway, but don't
+        // change the pm_hosterror value so we retain the first error
+        snd_seq_delete_port(seq, desc->this_port);
+    } else { // if there's no error, delete the port and retain any error
+        pm_hosterror = snd_seq_delete_port(seq, desc->this_port);
+    }
+    if (midi->latency > 0) alsa_unuse_queue();
+    snd_midi_event_free(desc->parser);
+    midi->descriptor = NULL; /* destroy the pointer to signify "closed" */
+    pm_free(desc);
+    if (pm_hosterror) {
+        get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, 
+                            pm_hosterror);
+        return pmHostError;
+    }
+    return pmNoError;
+}
+
+
+static PmError alsa_in_open(PmInternal *midi, void *driverInfo)
+{
+    void *client_port = descriptors[midi->device_id].descriptor;
+    alsa_descriptor_type desc = (alsa_descriptor_type) 
+        pm_alloc(sizeof(alsa_descriptor_node));
+    snd_seq_port_info_t *info;
+    snd_seq_port_subscribe_t *sub;
+    snd_seq_addr_t addr;
+    int err;
+
+    if (!desc) return pmInsufficientMemory;
+    
+    err = alsa_use_queue();
+    if (err < 0) goto free_desc;
+
+    snd_seq_port_info_alloca(&info);
+    snd_seq_port_info_set_port(info, midi->device_id);
+    snd_seq_port_info_set_capability(info, SND_SEQ_PORT_CAP_WRITE |
+                                     SND_SEQ_PORT_CAP_READ);
+    snd_seq_port_info_set_type(info, SND_SEQ_PORT_TYPE_MIDI_GENERIC | 
+                                     SND_SEQ_PORT_TYPE_APPLICATION);
+    snd_seq_port_info_set_port_specified(info, 1);
+    err = snd_seq_create_port(seq, info);
+    if (err < 0) goto free_queue;
+
+    /* fill in fields of desc, which is passed to pm_write routines */
+    midi->descriptor = desc;
+    desc->client = GET_DESCRIPTOR_CLIENT(client_port);
+    desc->port = GET_DESCRIPTOR_PORT(client_port);
+    desc->this_port = midi->device_id;
+    desc->in_sysex = 0;
+
+    desc->error = 0;
+
+    VERBOSE printf("snd_seq_connect_from: %d %d %d\n", 
+                   desc->this_port, desc->client, desc->port);
+    snd_seq_port_subscribe_alloca(&sub);
+    addr.client = snd_seq_client_id(seq);
+    addr.port = desc->this_port;
+    snd_seq_port_subscribe_set_dest(sub, &addr);
+    addr.client = desc->client;
+    addr.port = desc->port;
+    snd_seq_port_subscribe_set_sender(sub, &addr);
+    snd_seq_port_subscribe_set_time_update(sub, 1);
+    /* this doesn't seem to work: messages come in with real timestamps */
+    snd_seq_port_subscribe_set_time_real(sub, 0);
+    err = snd_seq_subscribe_port(seq, sub);
+    /* err = 
+       snd_seq_connect_from(seq, desc->this_port, desc->client, desc->port); */
+    if (err < 0) goto free_this_port;  /* clean up and return on error */
+    return pmNoError;
+
+ free_this_port:
+    snd_seq_delete_port(seq, desc->this_port);
+ free_queue:
+    alsa_unuse_queue();
+ free_desc:
+    pm_free(desc);
+    pm_hosterror = err;
+    if (err < 0) {
+        get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, err);
+    }
+    return pmHostError;
+}
+
+static PmError alsa_in_close(PmInternal *midi)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    if (!desc) return pmBadPtr;
+    if (pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port, 
+                                               desc->client, desc->port)) {
+        snd_seq_delete_port(seq, desc->this_port); /* try to close port */
+    } else {
+        pm_hosterror = snd_seq_delete_port(seq, desc->this_port);
+    }
+    alsa_unuse_queue();
+    pm_free(desc);
+    if (pm_hosterror) {
+        get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, 
+                            pm_hosterror);
+        return pmHostError;
+    }
+    return pmNoError;
+}
+        
+
+static PmError alsa_abort(PmInternal *midi)
+{
+    /* NOTE: ALSA documentation is vague. This is supposed to 
+     * remove any pending output messages. If you can test and 
+     * confirm this code is correct, please update this comment. -RBD
+     */
+    /* Unfortunately, I can't even compile it -- my ALSA version 
+     * does not implement snd_seq_remove_events_t, so this does
+     * not compile. I'll try again, but it looks like I'll need to
+     * upgrade my entire Linux OS -RBD
+     */
+    /*
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    snd_seq_remove_events_t info;
+    snd_seq_addr_t addr;
+    addr.client = desc->client;
+    addr.port = desc->port;
+    snd_seq_remove_events_set_dest(&info, &addr);
+    snd_seq_remove_events_set_condition(&info, SND_SEQ_REMOVE_DEST);
+    pm_hosterror = snd_seq_remove_events(seq, &info);
+    if (pm_hosterror) {
+        get_alsa_error_text(pm_hosterror_text, PM_HOST_ERROR_MSG_LEN, 
+                            pm_hosterror);
+        return pmHostError;
+    }
+    */
+    printf("WARNING: alsa_abort not implemented\n");
+    return pmNoError;
+}
+
+
+#ifdef GARBAGE
+This is old code here temporarily for reference
+static PmError alsa_write(PmInternal *midi, PmEvent *buffer, long length)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    int i, bytes;
+    unsigned char byte;
+    long msg;
+
+    desc->error = 0;
+    for (; length > 0; length--, buffer++) {
+        VERBOSE printf("message 0x%x\n", buffer->message);
+        if (Pm_MessageStatus(buffer->message) == MIDI_SYSEX)
+            desc->in_sysex = TRUE;
+        if (desc->in_sysex) {
+            msg = buffer->message;
+            for (i = 0; i < 4; i++) {
+                byte = msg;  /* extract next byte to send */
+                alsa_write_byte(midi, byte, buffer->timestamp);
+                if (byte == MIDI_EOX) {
+                    desc->in_sysex = FALSE;
+                    break;
+                }
+                if (desc->error < 0) break;
+                msg >>= 8; /* shift next byte into position */
+            }
+        } else {
+            bytes = midi_message_length(buffer->message);
+            msg = buffer->message;
+            for (i = 0; i < bytes; i++) {
+                byte = msg; /* extract next byte to send */
+                VERBOSE printf("sending 0x%x\n", byte);
+                alsa_write_byte(midi, byte, buffer->timestamp);
+                if (desc->error < 0) break;
+                msg >>= 8; /* shift next byte into position */
+            }
+        }
+    }
+    if (desc->error < 0) return pmHostError;
+
+    VERBOSE printf("snd_seq_drain_output: 0x%x\n", seq);
+    desc->error = snd_seq_drain_output(seq);
+    if (desc->error < 0) return pmHostError;
+
+    desc->error = pmNoError;
+    return pmNoError;
+}
+#endif
+
+
+static PmError alsa_write_flush(PmInternal *midi, PmTimestamp timestamp)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    VERBOSE printf("snd_seq_drain_output: 0x%x\n", (unsigned int) seq);
+    desc->error = snd_seq_drain_output(seq);
+    if (desc->error < 0) return pmHostError;
+
+    desc->error = pmNoError;
+    return pmNoError;
+}
+
+
+static PmError alsa_write_short(PmInternal *midi, PmEvent *event)
+{
+    int bytes = midi_message_length(event->message);
+    long msg = event->message;
+    int i;
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    for (i = 0; i < bytes; i++) {
+        unsigned char byte = msg;
+        VERBOSE printf("sending 0x%x\n", byte);
+        alsa_write_byte(midi, byte, event->timestamp);
+        if (desc->error < 0) break;
+        msg >>= 8; /* shift next byte into position */
+    }
+    if (desc->error < 0) return pmHostError;
+    desc->error = pmNoError;
+    return pmNoError;
+}
+
+
+/* alsa_sysex -- implements begin_sysex and end_sysex */
+PmError alsa_sysex(PmInternal *midi, PmTimestamp timestamp) {
+    return pmNoError;
+}
+
+
+static PmTimestamp alsa_synchronize(PmInternal *midi)
+{
+    return 0; /* linux implementation does not use this synchronize function */
+    /* Apparently, Alsa data is relative to the time you send it, and there
+       is no reference. If this is true, this is a serious shortcoming of
+       Alsa. If not true, then PortMidi has a serious shortcoming -- it 
+       should be scheduling relative to Alsa's time reference. */
+}
+
+
+static void handle_event(snd_seq_event_t *ev)
+{
+    int device_id = ev->dest.port;
+    PmInternal *midi = descriptors[device_id].internalDescriptor;
+    PmEvent pm_ev;
+    PmTimeProcPtr time_proc = midi->time_proc;
+    PmTimestamp timestamp;
+
+    /* time stamp should be in ticks, using our queue where 1 tick = 1ms */
+    assert((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_TICK);
+
+    /* if no time_proc, just return "native" ticks (ms) */
+    if (time_proc == NULL) {
+        timestamp = ev->time.tick;
+    } else { /* translate time to time_proc basis */
+        snd_seq_queue_status_t *queue_status;
+        snd_seq_queue_status_alloca(&queue_status);
+        snd_seq_get_queue_status(seq, queue, queue_status);
+        /* return (now - alsa_now) + alsa_timestamp */
+        timestamp = (*time_proc)(midi->time_info) + ev->time.tick -
+                    snd_seq_queue_status_get_tick_time(queue_status);
+    }
+    pm_ev.timestamp = timestamp;
+    switch (ev->type) {
+    case SND_SEQ_EVENT_NOTEON:
+        pm_ev.message = Pm_Message(0x90 | ev->data.note.channel,
+                                   ev->data.note.note & 0x7f,
+                                   ev->data.note.velocity & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_NOTEOFF:
+        pm_ev.message = Pm_Message(0x80 | ev->data.note.channel,
+                                   ev->data.note.note & 0x7f,
+                                   ev->data.note.velocity & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_KEYPRESS:
+        pm_ev.message = Pm_Message(0xa0 | ev->data.note.channel,
+                                   ev->data.note.note & 0x7f,
+                                   ev->data.note.velocity & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_CONTROLLER:
+        pm_ev.message = Pm_Message(0xb0 | ev->data.note.channel,
+                                   ev->data.control.param & 0x7f,
+                                   ev->data.control.value & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_PGMCHANGE:
+        pm_ev.message = Pm_Message(0xc0 | ev->data.note.channel,
+                                   ev->data.control.value & 0x7f, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_CHANPRESS:
+        pm_ev.message = Pm_Message(0xd0 | ev->data.note.channel,
+                                   ev->data.control.value & 0x7f, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_PITCHBEND:
+        pm_ev.message = Pm_Message(0xe0 | ev->data.note.channel,
+                            (ev->data.control.value + 0x2000) & 0x7f,
+                            ((ev->data.control.value + 0x2000) >> 7) & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_CONTROL14:
+        if (ev->data.control.param < 0x20) {
+            pm_ev.message = Pm_Message(0xb0 | ev->data.note.channel,
+                                       ev->data.control.param,
+                                       (ev->data.control.value >> 7) & 0x7f);
+            pm_read_short(midi, &pm_ev);
+            pm_ev.message = Pm_Message(0xb0 | ev->data.note.channel,
+                                       ev->data.control.param + 0x20,
+                                       ev->data.control.value & 0x7f);
+            pm_read_short(midi, &pm_ev);
+        } else {
+            pm_ev.message = Pm_Message(0xb0 | ev->data.note.channel,
+                                       ev->data.control.param & 0x7f,
+                                       ev->data.control.value & 0x7f);
+
+            pm_read_short(midi, &pm_ev);
+        }
+        break;
+    case SND_SEQ_EVENT_SONGPOS:
+        pm_ev.message = Pm_Message(0xf2,
+                                   ev->data.control.value & 0x7f,
+                                   (ev->data.control.value >> 7) & 0x7f);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_SONGSEL:
+        pm_ev.message = Pm_Message(0xf3,
+                                   ev->data.control.value & 0x7f, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_QFRAME:
+        pm_ev.message = Pm_Message(0xf1,
+                                   ev->data.control.value & 0x7f, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_START:
+        pm_ev.message = Pm_Message(0xfa, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_CONTINUE:
+        pm_ev.message = Pm_Message(0xfb, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_STOP:
+        pm_ev.message = Pm_Message(0xfc, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_CLOCK:
+        pm_ev.message = Pm_Message(0xf8, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_TUNE_REQUEST:
+        pm_ev.message = Pm_Message(0xf6, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_RESET:
+        pm_ev.message = Pm_Message(0xff, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_SENSING:
+        pm_ev.message = Pm_Message(0xfe, 0, 0);
+        pm_read_short(midi, &pm_ev);
+        break;
+    case SND_SEQ_EVENT_SYSEX: {
+        const BYTE *ptr = (const BYTE *) ev->data.ext.ptr;
+        /* assume there is one sysex byte to process */
+        pm_read_bytes(midi, ptr, ev->data.ext.len, timestamp);
+        break;
+    }
+    }
+}
+
+
+static PmError alsa_poll(PmInternal *midi)
+{
+    snd_seq_event_t *ev;
+    /* expensive check for input data, gets data from device: */
+    while (snd_seq_event_input_pending(seq, TRUE) > 0) {
+        /* cheap check on local input buffer */
+        while (snd_seq_event_input_pending(seq, FALSE) > 0) {
+            /* check for and ignore errors, e.g. input overflow */
+            /* note: if there's overflow, this should be reported
+             * all the way through to client. Since input from all
+             * devices is merged, we need to find all input devices
+             * and set all to the overflow state.
+             * NOTE: this assumes every input is ALSA based.
+             */
+            int rslt = snd_seq_event_input(seq, &ev);
+            if (rslt >= 0) {
+                handle_event(ev);
+            } else if (rslt == -ENOSPC) {
+                int i;
+                for (i = 0; i < pm_descriptor_index; i++) {
+                    if (descriptors[i].pub.input) {
+                        PmInternal *midi = (PmInternal *) 
+                                descriptors[i].internalDescriptor;
+                        /* careful, device may not be open! */
+                        if (midi) Pm_SetOverflow(midi->queue);
+                    }
+                }
+            }
+        }
+    }
+    return pmNoError;
+}
+
+
+static unsigned int alsa_has_host_error(PmInternal *midi)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    return desc->error;
+}
+
+
+static void alsa_get_host_error(PmInternal *midi, char *msg, unsigned int len)
+{
+    alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor;
+    int err = (pm_hosterror || desc->error);
+    get_alsa_error_text(msg, len, err);
+}
+
+
+pm_fns_node pm_linuxalsa_in_dictionary = {
+    none_write_short,
+    none_sysex,
+    none_sysex,
+    none_write_byte,
+    none_write_short,
+    none_write_flush,
+    alsa_synchronize,
+    alsa_in_open,
+    alsa_abort,
+    alsa_in_close,
+    alsa_poll,
+    alsa_has_host_error,
+    alsa_get_host_error
+};
+
+pm_fns_node pm_linuxalsa_out_dictionary = {
+    alsa_write_short,
+    alsa_sysex,
+    alsa_sysex,
+    alsa_write_byte,
+    alsa_write_short, /* short realtime message */
+    alsa_write_flush,
+    alsa_synchronize,
+    alsa_out_open, 
+    alsa_abort, 
+    alsa_out_close,
+    none_poll,
+    alsa_has_host_error,
+    alsa_get_host_error
+};
+
+
+/* pm_strdup -- copy a string to the heap. Use this rather than strdup so 
+ *    that we call pm_alloc, not malloc. This allows portmidi to avoid 
+ *    malloc which might cause priority inversion. Probably ALSA is going
+ *    to call malloc anyway, so this extra work here may be pointless.
+ */
+char *pm_strdup(const char *s)
+{
+    int len = strlen(s);
+    char *dup = (char *) pm_alloc(len + 1);
+    strcpy(dup, s);
+    return dup;
+}
+
+
+PmError pm_linuxalsa_init( void )
+{
+    int  err;
+    snd_seq_client_info_t *cinfo;
+    snd_seq_port_info_t *pinfo;
+    unsigned int caps;
+
+    /* Previously, the last parameter was SND_SEQ_NONBLOCK, but this 
+     * would cause messages to be dropped if the ALSA buffer fills up.
+     * The correct behavior is for writes to block until there is 
+     * room to send all the data. The client should normally allocate
+     * a large enough buffer to avoid blocking on output. 
+     * Now that blocking is enabled, the seq_event_input() will block
+     * if there is no input data. This is not what we want, so must
+     * call seq_event_input_pending() to avoid blocking.
+     */
+    err = snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0);
+    if (err < 0) return err;
+    
+    snd_seq_client_info_alloca(&cinfo);
+    snd_seq_port_info_alloca(&pinfo);
+
+    snd_seq_client_info_set_client(cinfo, -1);
+    while (snd_seq_query_next_client(seq, cinfo) == 0) {
+        snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
+        snd_seq_port_info_set_port(pinfo, -1);
+        while (snd_seq_query_next_port(seq, pinfo) == 0) {
+            if (snd_seq_port_info_get_client(pinfo) == SND_SEQ_CLIENT_SYSTEM)
+                continue; /* ignore Timer and Announce ports on client 0 */
+            caps = snd_seq_port_info_get_capability(pinfo);
+            if (!(caps & (SND_SEQ_PORT_CAP_SUBS_READ | SND_SEQ_PORT_CAP_SUBS_WRITE)))
+                continue; /* ignore if you cannot read or write port */
+            if (caps & SND_SEQ_PORT_CAP_SUBS_WRITE) {
+                if (pm_default_output_device_id == -1) 
+                    pm_default_output_device_id = pm_descriptor_index;
+                pm_add_device("ALSA",
+                              pm_strdup(snd_seq_port_info_get_name(pinfo)),
+                              FALSE,
+                              MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
+                                              snd_seq_port_info_get_port(pinfo)),
+                              &pm_linuxalsa_out_dictionary);
+            }
+            if (caps & SND_SEQ_PORT_CAP_SUBS_READ) {
+                if (pm_default_input_device_id == -1) 
+                    pm_default_input_device_id = pm_descriptor_index;
+                pm_add_device("ALSA",
+                              pm_strdup(snd_seq_port_info_get_name(pinfo)),
+                              TRUE,
+                              MAKE_DESCRIPTOR(snd_seq_port_info_get_client(pinfo),
+                                              snd_seq_port_info_get_port(pinfo)),
+                              &pm_linuxalsa_in_dictionary);
+            }
+        }
+    }
+    return pmNoError;
+}
+    
+
+void pm_linuxalsa_term(void)
+{
+    if (seq) {
+        snd_seq_close(seq);
+        pm_free(descriptors);
+        descriptors = NULL;
+        pm_descriptor_index = 0;
+        pm_descriptor_max = 0;
+    }
+}
diff --git a/lib-src/portmidi/pm_linux/pmlinuxalsa.h b/lib-src/portmidi/pm_linux/pmlinuxalsa.h
new file mode 100644
index 0000000..c16f61d
--- /dev/null
+++ b/lib-src/portmidi/pm_linux/pmlinuxalsa.h
@@ -0,0 +1,6 @@
+/* pmlinuxalsa.h -- system-specific definitions */
+
+PmError pm_linuxalsa_init(void);
+void pm_linuxalsa_term(void);
+
+
diff --git a/lib-src/portmidi/pm_mac/Makefile.osx b/lib-src/portmidi/pm_mac/Makefile.osx
new file mode 100644
index 0000000..cb229c5
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/Makefile.osx
@@ -0,0 +1,188 @@
+# MAKEFILE FOR PORTMIDI AND PORTTIME
+
+VFLAGS = -g
+
+
+# For debugging, define PM_CHECK_ERRORS
+PMFLAGS = -DPM_CHECK_ERRORS
+# Otherwise do not define PM_CHECK_ERRORS
+# PMFLAGS = 
+# Dynamic Lib is built without PM_CHECK_ERRORS
+PMDLFLAGS = 
+# Path for installation of dynamic libraries
+PF = /usr/local
+# Architecture for static libs
+ARCH = -arch ppc -arch i386
+
+pmlib = pm_mac/libportmidi.a
+
+CC = gcc $(VFLAGS) $(PMFLAGS) $(ARCH) -g -Ipm_common -Iporttime
+
+MACLIB = -framework CoreMIDI -framework CoreFoundation -framework CoreAudio \
+	 -framework CoreServices
+
+PMSRC =  pm_mac/pmmac.c pm_common/pmutil.c pm_common/portmidi.c \
+   pm_mac/pmmacosxcm.c pm_mac/readbinaryplist.c pm_mac/finddefault.c
+
+PTSRC = porttime/porttime.c porttime/ptmacosx_mach.c
+
+pmobjects = pm_common/pmutil.o pm_mac/pmmac.o  \
+	pm_common/portmidi.o pm_mac/pmmacosxcm.o \
+	pm_mac/finddefault.o pm_mac/readbinaryplist.o \
+	porttime/porttime.o porttime/ptmacosx_mach.o 
+
+current: all
+
+all: $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread \
+	pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm
+	echo $$'\n\
+**** For instructions: make -f pm_mac\Makefile.osx help ****\n'
+
+help:
+	echo $$'\n\n\
+This is help for portmidi/pm_mac/Makefile.osx\n\n\
+Flags for static library and apps are $(PMFLAGS)\n\
+Flags for dynamic library are $(PMDLFLAGS)\n\
+Installation path for dylib is $(PF)\n\
+You might want to change these.\n\n\
+To build a static library and test applications,\n        \
+make -f pm_mac/Makefile.osx\n\
+To build and install dynamic library, note you must use\n\
+"cleanest" to remove .o and dylib, especially if this\n\
+library uses different compiler flags:\n        \
+make -f pm_mac/Makefile.osx cleanest\n        \
+make -f pm_mac/Makefile.osx dylib\n\
+To install dynamic library to /usr/local,\n        \
+sudo make -f pm_mac/Makefile.osx install\n\
+To install universal dynamic library with xcode,\n        \
+make -f pm_mac/Makefile.osx install-with-xcode\n\
+To make dynamic library for Java,\n        \
+make -f pm_mac/Makefile.osx cleanest\n        \
+make -f pm_mac/Makefile.osx jni\n\
+To make PmDefaults Java application,\n        \
+make -f pm_mac/Makefile.osx pmdefaults\n\n'
+
+$(pmlib): pm_mac/Makefile.osx $(pmobjects)
+	rm -rf $(pmlib)
+	ar -crs $(pmlib) $(pmobjects)
+
+pm_mac/pmmacosxcm.o: pm_mac/Makefile.osx pm_mac/pmmacosxcm.c pm_mac/pmmacosxcm.h
+	$(CC) -c pm_mac/pmmacosxcm.c -o pm_mac/pmmacosxcm.o
+
+pm_mac/readbinaryplist.o: pm_mac/Makefile.osx pm_mac/readbinaryplist.c pm_mac/readbinaryplist.h
+	$(CC) -c -I/Developer/Headers/FlatCarbon \
+	pm_mac/readbinaryplist.c -o pm_mac/readbinaryplist.o
+
+pm_mac/finddefault.o: pm_mac/Makefile.osx pm_mac/finddefault.c pm_mac/pmmacosxcm.h
+	$(CC) -c pm_mac/finddefault.c -o pm_mac/finddefault.o
+
+pm_test/test: pm_mac/Makefile.osx pm_test/test.o $(pmlib)
+	$(CC) pm_test/test.o -o pm_test/test $(pmlib) $(MACLIB)
+
+pm_test/sysex: pm_mac/Makefile.osx pm_test/sysex.o $(pmlib)
+	$(CC) pm_test/sysex.o -o pm_test/sysex $(pmlib) $(MACLIB)
+
+pm_test/midithread: pm_mac/Makefile.osx pm_test/midithread.o $(pmlib)
+	$(CC) pm_test/midithread.o -o pm_test/midithread \
+        $(pmlib) $(MACLIB)
+
+pm_test/latency: pm_mac/Makefile.osx $(pmlib) pm_test/latency.o 
+	$(CC) pm_test/latency.o -o pm_test/latency $(pmlib) \
+        $(MACLIB) -lpthread -lm
+
+pm_test/midithru: pm_mac/Makefile.osx $(pmlib) pm_test/midithru.o 
+	$(CC) pm_test/midithru.o -o pm_test/midithru $(pmlib) \
+        $(MACLIB) -lpthread -lm
+
+pm_test/mm: pm_mac/Makefile.osx pm_test/mm.o $(pmlib)
+	$(CC) pm_test/mm.o -o pm_test/mm $(pmlib) $(MACLIB)
+
+porttime/ptlinux.o: pm_mac/Makefile.osx porttime/ptlinux.c
+	$(CC) -c porttime/ptlinux.c -o porttime/ptlinux.o
+
+pm_test/qtest: pm_mac/Makefile.osx pm_test/qtest.o $(pmlib)
+	$(CC) pm_test/qtest.o -o pm_test/qtest $(pmlib) $(MACLIB)
+
+clean:
+	rm -f *.o *~ core* */*.o */*~ */core* pm_test/*/pm_dll.dll 
+	rm -f *.opt *.ncb *.plg pm_win/Debug/pm_dll.lib pm_win/Release/pm_dll.lib
+	rm -f pm_test/*.opt pm_test/*.ncb
+	rm -f pm_java/pmjni/*.o pm_java/pmjni/*~ pm_java/*.h
+
+cleaner: clean
+	rm -rf pm_mac/build
+	rm -f *.dylib
+	rm -f pm_mac/*.dylib
+	rm -f pm_java/pmjni/*.jnilib
+
+cleanest: cleaner
+	rm -f $(pmlib) porttime/libporttime.dylib pm_mac/libportmidi.dylib
+	rm -f pm_test/test pm_test/sysex pm_test/midithread
+	rm -f pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm
+	rm -f pm_java/*/*.class
+	rm -f pm_java/pmjni/jportmidi_JPortMidiApi_PortMidiStream.h
+
+backup: cleanest
+	cd ..; zip -r portmidi.zip portmidi
+
+dylib: pm_mac/libportmidi.dylib
+
+pm_mac/libportmidi.dylib: $(PMSRC) $(PTSRC)
+	cc -single_module -g $(PMDLFLAGS) -Iporttime -Ipm_common $(ARCH) \
+          -dynamiclib $(PMSRC) $(PTSRC) -o pm_mac/libportmidi.dylib \
+	  -flat_namespace -undefined suppress \
+	  -framework CoreMIDI -framework CoreFoundation \
+	  -framework CoreAudio -framework CoreServices
+
+install: porttime/porttime.h pm_common/portmidi.h \
+	   pm_mac/libportmidi.dylib
+	install porttime/porttime.h  $(PF)/include/
+	install pm_common/portmidi.h $(PF)/include
+	install pm_mac/libportmidi.dylib $(PF)/lib/
+
+# note - this uses xcode to build and install portmidi universal binaries
+install-with-xcode:
+	sudo xcodebuild -project pm_mac/pm_mac.xcodeproj \
+		-configuration Deployment install DSTROOT=/
+
+##### build java interface and application ######
+
+jni: pm_java/pmjni/libpmjni.jnilib
+
+pm_java/pmjni/libpmjni.jnilib: $(PMSRC) pm_java/jportmidi/JPortMidiApi.class pm_java/pmjni/jportmidi_JPortMidiApi.h pm_java/pmjni/pmjni.c
+	cc -single_module -g -Iporttime -Ipm_common \
+          -Ipm_java/pmjni -I/System/Library/Frameworks/JavaVM.framework/Headers \
+	  -I/Developer/Headers/FlatCarbon \
+          $(ARCH) -dynamiclib $(PMSRC) $(PTSRC) pm_java/pmjni/pmjni.c \
+          -o pm_java/pmjni/libpmjni.jnilib \
+          -flat_namespace -undefined suppress \
+          -framework CoreMIDI -framework CoreFoundation -framework CoreAudio \
+          -framework JavaVM
+
+pm_java/pmjni/jportmidi_JPortMidiApi.h: pm_java/jportmidi/JPortMidiApi.class
+	cd pm_java; javah jportmidi.JPortMidiApi
+	mv pm_java/jportmidi_JportMidiApi.h pm_java/pmjni
+
+JAVASRC = pmdefaults/PmDefaultsFrame.java \
+	    pmdefaults/PmDefaults.java \
+	    jportmidi/JPortMidiApi.java jportmidi/JPortMidi.java \
+	    jportmidi/JPortMidiException.java
+
+# this compiles ALL of the java code
+pm_java/jportmidi/JPortMidiApi.class: $(JAVASRC:%=pm_java/%)
+	cd pm_java; javac $(JAVASRC)
+
+pmdefaults: pm_java/pmjni/libpmjni.jnilib pm_java/jportmidi/JPortMidiApi.class
+	echo "pmdefaults java application is made"
+
+###### test plist reader #######
+PLHDR = pm_mac/readbinaryplist.h
+PLSRC = pm_mac/plisttest.c pm_mac/readbinaryplist.c
+pm_mac/plisttest: $(PLHDR) $(PLSRC)
+	cc -g -Ipm_mac \
+	    -I/Developer/Headers/FlatCarbon \
+	    -I/System/Library/Frameworks/CoreFoundation.framework/Headers \
+	    -I/System/Library/Frameworks/CoreServices.framework/Headers \
+	    $(PLSRC) -o pm_mac/plisttest \
+	    -framework CoreFoundation -framework CoreServices
+
diff --git a/lib-src/portmidi/pm_mac/README_MAC.txt b/lib-src/portmidi/pm_mac/README_MAC.txt
new file mode 100644
index 0000000..fe8e404
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/README_MAC.txt
@@ -0,0 +1,52 @@
+README_MAC.txt for PortMidi
+Roger Dannenberg
+17 jan 2007
+
+To build PortMidi for Mac OS X:
+
+==== USING MAKE ====
+
+go back up to the portmidi
+directory and type 
+
+make -f pm_mac/Makefile.osx
+
+(You can also copy pm_mac/Makefile.osx to Makfile in the 
+portmidi directory and just type "make".)
+
+The Makefile.osx will build all test programs and the portmidi
+library. You may want to modify the Makefile.osx to remove the
+PM_CHECK_ERRORS definition. For experimental software,
+especially programs running from the command line, we 
+recommend using PM_CHECK_ERRORS -- it will terminate your
+program and print a helpful message if any PortMidi 
+function returns an error code.
+
+If you do not compile with PM_CHECK_ERRORS, you should 
+check for errors yourself.
+
+The make file will also build an OS X Universal (ppc and i386)
+dynamic link library using xcode. For instructions about this
+and other options, type
+
+make -f pm_mac/Makefile.osx help
+
+==== USING XCODE ====
+
+Open portmidi/pm_mac/pm_mac.xcode with Xcode and 
+build what you need: if you are just exploring, start with 
+the lib+test suite.
+
+[pm_mac.xcodeproj courtesy of Leigh Smith]
+
+CHANGELOG
+
+17-Jan-2007 Roger B. Dannenberg
+    Explicit instructions for Xcode
+15-Jan-2007 Roger B. Dannenberg
+    Changed instructions because of changes to Makefile.osx
+07-Oct-2006 Roger B. Dannenberg
+    Added directions for xcodebuild
+29-aug-2006 Roger B. Dannenberg
+    Updated this documentation.
+ 
diff --git a/lib-src/portmidi/pm_mac/finddefault.c b/lib-src/portmidi/pm_mac/finddefault.c
new file mode 100644
index 0000000..a155c9e
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/finddefault.c
@@ -0,0 +1,55 @@
+/* finddefault.c -- find_default_device() implementation
+   Roger Dannenberg, June 2008
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include "portmidi.h"
+#include "pmmacosxcm.h"
+#include "readbinaryplist.h"
+
+/* Parse preference files, find default device, search devices --
+   This parses the preference file(s) once for input and once for
+   output, which is inefficient but much simpler to manage. Note
+   that using the readbinaryplist.c module, you cannot keep two
+   plist files (user and system) open at once (due to a simple
+   memory management scheme).
+*/
+PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
+/* path -- the name of the preference we are searching for
+   input -- true iff this is an input device
+   id -- current default device id
+   returns matching device id if found, otherwise id
+*/
+{
+    static char *pref_file = "com.apple.java.util.prefs.plist";
+    char *pref_str = NULL;
+    // read device preferences
+    value_ptr prefs = bplist_read_user_pref(pref_file);
+    if (prefs) {
+        value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
+        if (pref_val) {
+            pref_str = value_get_asciistring(pref_val);
+        }
+    }
+    if (!pref_str) {
+        bplist_free_data(); /* look elsewhere */
+        prefs = bplist_read_system_pref(pref_file);
+        if (prefs) {
+            value_ptr pref_val = value_dict_lookup_using_path(prefs, path);
+            if (pref_val) {
+                pref_str = value_get_asciistring(pref_val);
+            }
+        }
+    }
+    if (pref_str) { /* search devices for match */
+        int i = pm_find_default_device(pref_str, input);
+        if (i != pmNoDevice) {
+            id = i;
+	}
+    }
+    if (prefs) {
+        bplist_free_data();
+    }
+    return id;
+}
diff --git a/lib-src/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj b/lib-src/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..20b9a0a
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/pm_mac.xcodeproj/project.pbxproj
@@ -0,0 +1,2211 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 42;
+	objects = {
+
+/* Begin PBXAggregateTarget section */
+		D8684B960ACBFB93009F6478 /* everything suite */ = {
+			isa = PBXAggregateTarget;
+			buildConfigurationList = D8684BAA0ACBFBDD009F6478 /* Build configuration list for PBXAggregateTarget "everything suite" */;
+			buildPhases = (
+			);
+			comments = "Builds the Library and all the test shell tools.";
+			dependencies = (
+				3D8DABA50D57B68A000FEBA8 /* PBXTargetDependency */,
+				3D4799D40F0E87350006C842 /* PBXTargetDependency */,
+				D8684B980ACBFB9D009F6478 /* PBXTargetDependency */,
+				D8684B9A0ACBFB9D009F6478 /* PBXTargetDependency */,
+				D8684B9C0ACBFB9D009F6478 /* PBXTargetDependency */,
+				D8684B9E0ACBFB9D009F6478 /* PBXTargetDependency */,
+				D8684BA00ACBFB9D009F6478 /* PBXTargetDependency */,
+				D8684BA20ACBFB9D009F6478 /* PBXTargetDependency */,
+				3D4799F50F0EE7D10006C842 /* PBXTargetDependency */,
+				D8E738E20ACDA3BD0030B95B /* PBXTargetDependency */,
+				3D3534900F0D2DB30059CD05 /* PBXTargetDependency */,
+			);
+			name = "everything suite";
+			productName = "lib+test suite";
+		};
+/* End PBXAggregateTarget section */
+
+/* Begin PBXApplicationTarget section */
+		3D9D57CD0E12E22800C4C68D /* PmDefaults */ = {
+			isa = PBXApplicationTarget;
+			buildConfigurationList = 3D9D57D00E12E24600C4C68D /* Build configuration list for PBXApplicationTarget "PmDefaults" */;
+			buildPhases = (
+				3D9D57C90E12E22800C4C68D /* Sources */,
+				3D9D57CA0E12E22800C4C68D /* Resources */,
+				3D9D57CB0E12E22800C4C68D /* JavaArchive */,
+				3D9D57CC0E12E22800C4C68D /* Frameworks */,
+			);
+			comments = "Application to set PortMidi default input and output devices.";
+			dependencies = (
+				3D4799F80F0EE7FB0006C842 /* PBXTargetDependency */,
+			);
+			name = PmDefaults;
+			productInstallPath = "$(USER_APPS_DIR)";
+			productName = pmdefaults;
+			productReference = 3D9D57CE0E12E22800C4C68D /* pmdefaults.app */;
+			productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>PmDefaults</string>
+	<key>CFBundleGetInfoString</key>
+	<string>1.00</string>
+	<key>CFBundleIconFile</key>
+	<string>pmdefaults</string>
+	<key>CFBundleIdentifier</key>
+	<string></string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>PmDefaults</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.00</string>
+	<key>Java</key>
+	<dict>
+		<key>ClassPath</key>
+		<array>
+			<string>$JAVAROOT/pmdefaults.jar</string>
+		</array>
+		<key>JVMVersion</key>
+		<string>1.5</string>
+		<key>MainClass</key>
+		<string>pmdefaults.PmDefaults</string>
+		<key>Properties</key>
+		<dict>
+			<key>apple.awt.textantialiasing</key>
+			<string>on</string>
+		</dict>
+		<key>VMOptions</key>
+		<string>-verbose</string>
+		<key>WorkingDirectory</key>
+		<string>$APP_PACKAGE/Contents/Resources/</string>
+	</dict>
+</dict>
+</plist>
+";
+		};
+/* End PBXApplicationTarget section */
+
+/* Begin PBXBuildFile section */
+		3D17A16A0E13D6B700930576 /* JPortMidi.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57DE0E12E39B00C4C68D /* JPortMidi.java */; };
+		3D17A16C0E13D70800930576 /* JPortMidiException.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57E40E12E39B00C4C68D /* JPortMidiException.java */; };
+		3D17A16D0E13D70E00930576 /* JPortMidiApi.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57E20E12E39B00C4C68D /* JPortMidiApi.java */; };
+		3D17A16E0E13D70E00930576 /* PmDefaults.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57EF0E12E3DE00C4C68D /* PmDefaults.java */; };
+		3D17A16F0E13D70E00930576 /* PmDefaultsFrame.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57F50E12E3DE00C4C68D /* PmDefaultsFrame.java */; };
+		3D17A1A20E13E30100930576 /* pmjni.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D17A1A10E13E30100930576 /* pmjni.c */; };
+		3D17A1A90E13E3B300930576 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		3D17A1AF0E13E3BC00930576 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		3D17A1DF0E13E3D800930576 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		3D17A1E80E13E57700930576 /* JavaVM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D17A1E70E13E57700930576 /* JavaVM.framework */; };
+		3D17A20A0E13E7E900930576 /* readbinaryplist.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C50E12E1E500C4C68D /* readbinaryplist.c */; };
+		3D17A20B0E13E7E900930576 /* finddefault.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C30E12E1CF00C4C68D /* finddefault.c */; };
+		3D17A20D0E13E88100930576 /* pmutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D524047955C800EE98CD /* pmutil.c */; };
+		3D17A20E0E13E88100930576 /* portmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D526047955C800EE98CD /* portmidi.c */; };
+		3D17A20F0E13E88100930576 /* pmmacosxcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5310479560B00EE98CD /* pmmacosxcm.c */; };
+		3D17A2100E13E88100930576 /* pmmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5740479613900EE98CD /* pmmac.c */; };
+		3D17A2110E13E88100930576 /* ptmacosx_mach.c in Sources */ = {isa = PBXBuildFile; fileRef = 58ED5B81047D41DB00B92E62 /* ptmacosx_mach.c */; };
+		3D17A2120E13E88100930576 /* readbinaryplist.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C50E12E1E500C4C68D /* readbinaryplist.c */; };
+		3D17A2130E13E88100930576 /* finddefault.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C30E12E1CF00C4C68D /* finddefault.c */; };
+		3D17A2290E13EF8000930576 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D17A2280E13EF8000930576 /* CoreServices.framework */; };
+		3D17A22D0E13EF9300930576 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D17A2280E13EF8000930576 /* CoreServices.framework */; };
+		3D17A4C40E14079000930576 /* pmdefaults.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3D17A4C30E14079000930576 /* pmdefaults.icns */; };
+		3D65FEE30ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE40ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE50ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE60ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE70ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE80ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D65FEE90ECB7548008083A3 /* CoreServices in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D65FEE20ECB7548008083A3 /* CoreServices */; };
+		3D9D57C40E12E1CF00C4C68D /* finddefault.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C30E12E1CF00C4C68D /* finddefault.c */; };
+		3D9D57C60E12E1E500C4C68D /* readbinaryplist.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57C50E12E1E500C4C68D /* readbinaryplist.c */; };
+		3D9D57E60E12E39B00C4C68D /* JPortMidi.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57DE0E12E39B00C4C68D /* JPortMidi.java */; };
+		3D9D57EA0E12E39B00C4C68D /* JPortMidiApi.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57E20E12E39B00C4C68D /* JPortMidiApi.java */; };
+		3D9D57EC0E12E39B00C4C68D /* JPortMidiException.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57E40E12E39B00C4C68D /* JPortMidiException.java */; };
+		3D9D57F80E12E3DE00C4C68D /* PmDefaults.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57EF0E12E3DE00C4C68D /* PmDefaults.java */; };
+		3D9D57FE0E12E3DE00C4C68D /* PmDefaultsFrame.java in Sources */ = {isa = PBXBuildFile; fileRef = 3D9D57F50E12E3DE00C4C68D /* PmDefaultsFrame.java */; };
+		3D9D57FF0E12E3DE00C4C68D /* portmusic_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D9D57F60E12E3DE00C4C68D /* portmusic_logo.png */; };
+		3DA60D640D3FBEA40036B654 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		3DA60D650D3FBEA40036B654 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		3DA60D660D3FBEA40036B654 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		3DA60D670D3FBEA40036B654 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		3DA60D720D3FBF160036B654 /* midiclock.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA60D710D3FBF160036B654 /* midiclock.c */; };
+		3DBF246D0B59686800DAD93B /* mm.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DBF246C0B59686800DAD93B /* mm.c */; };
+		3DBF24720B59691500DAD93B /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		3DBF24780B59691800DAD93B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		3DBF24A10B59691B00DAD93B /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		3DBF24A90B59692C00DAD93B /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D814404E0ACB2C1200515C41 /* pmutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D525047955C800EE98CD /* pmutil.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D814404F0ACB2C1200515C41 /* portmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D527047955C800EE98CD /* portmidi.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D81440510ACB2C1200515C41 /* porttime.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D51F047955B800EE98CD /* porttime.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		D81440540ACB2C1200515C41 /* pmutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D524047955C800EE98CD /* pmutil.c */; };
+		D81440550ACB2C1200515C41 /* portmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D526047955C800EE98CD /* portmidi.c */; };
+		D81440560ACB2C1200515C41 /* pmmacosxcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5310479560B00EE98CD /* pmmacosxcm.c */; };
+		D81440570ACB2C1200515C41 /* pmmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5740479613900EE98CD /* pmmac.c */; };
+		D81440580ACB2C1200515C41 /* ptmacosx_mach.c in Sources */ = {isa = PBXBuildFile; fileRef = 58ED5B81047D41DB00B92E62 /* ptmacosx_mach.c */; };
+		D84A40DC0ACD4A19001FC716 /* pmutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D525047955C800EE98CD /* pmutil.h */; };
+		D84A40DD0ACD4A19001FC716 /* portmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D527047955C800EE98CD /* portmidi.h */; };
+		D84A40DF0ACD4A19001FC716 /* porttime.h in Headers */ = {isa = PBXBuildFile; fileRef = 5851D51F047955B800EE98CD /* porttime.h */; };
+		D84A40E10ACD4A26001FC716 /* pmutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D524047955C800EE98CD /* pmutil.c */; };
+		D84A40E20ACD4A26001FC716 /* portmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D526047955C800EE98CD /* portmidi.c */; };
+		D84A40E30ACD4A26001FC716 /* pmmacosxcm.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5310479560B00EE98CD /* pmmacosxcm.c */; };
+		D84A40E40ACD4A26001FC716 /* pmmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 5851D5740479613900EE98CD /* pmmac.c */; };
+		D84A40E50ACD4A26001FC716 /* ptmacosx_mach.c in Sources */ = {isa = PBXBuildFile; fileRef = 58ED5B81047D41DB00B92E62 /* ptmacosx_mach.c */; };
+		D84A41220ACD4A92001FC716 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D84A41230ACD4A92001FC716 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D84A41240ACD4A92001FC716 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		D8684B370ACBF9AF009F6478 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D8684B380ACBF9B9009F6478 /* test.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA774260663E9DA0002CE69 /* test.c */; };
+		D8684B460ACBFA24009F6478 /* midithread.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA774160663E9DA0002CE69 /* midithread.c */; };
+		D8684B470ACBFA2D009F6478 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D8684B540ACBFA34009F6478 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D8684B550ACBFA34009F6478 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D8684B560ACBFA34009F6478 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		D8684B570ACBFA3E009F6478 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D8684B580ACBFA3E009F6478 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D8684B590ACBFA3E009F6478 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		D8684B650ACBFA9D009F6478 /* midithru.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA7741B0663E9DA0002CE69 /* midithru.c */; };
+		D8684B660ACBFAA5009F6478 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D8684B670ACBFAA5009F6478 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D8684B680ACBFAA5009F6478 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D8684B690ACBFAA5009F6478 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		D8684B790ACBFAF7009F6478 /* sysex.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA774210663E9DA0002CE69 /* sysex.c */; };
+		D8684B7A0ACBFAFD009F6478 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D8684B7B0ACBFAFD009F6478 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D8684B7C0ACBFAFD009F6478 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D8684B7D0ACBFAFD009F6478 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+		D8684B850ACBFB2C009F6478 /* latency.c in Sources */ = {isa = PBXBuildFile; fileRef = 3DA774110663E9DA0002CE69 /* latency.c */; };
+		D8684B860ACBFB33009F6478 /* libportmidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D81440D40ACB36E100515C41 /* libportmidi.a */; };
+		D8684B870ACBFB33009F6478 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774480663EAE60002CE69 /* CoreMIDI.framework */; };
+		D8684B880ACBFB33009F6478 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */; };
+		D8684B890ACBFB33009F6478 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DA774500663EBBF0002CE69 /* CoreAudio.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		3D17A1EB0E13E5D100930576 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3D17A13C0E13D47F00930576;
+			remoteInfo = JPortMidiHeaders;
+		};
+		3D35348F0F0D2DB30059CD05 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3D9D57CD0E12E22800C4C68D;
+			remoteInfo = PmDefaults;
+		};
+		3D4799D30F0E87350006C842 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3DBF24630B5967A500DAD93B /* mm */;
+			remoteInfo = mm;
+		};
+		3D4799F40F0EE7D10006C842 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3D17A1900E13E25E00930576 /* libpmjni.jnilib */;
+			remoteInfo = libpmjni.jnilib;
+		};
+		3D4799F70F0EE7FB0006C842 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3D17A1900E13E25E00930576 /* libpmjni.jnilib */;
+			remoteInfo = libpmjni.jnilib;
+		};
+		3D8DABA40D57B68A000FEBA8 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 3DA60D5E0D3FBEA40036B654;
+			remoteInfo = midiclock;
+		};
+		3DA60D600D3FBEA40036B654 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		3DBF24700B5968BC00DAD93B /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B080ACBF996009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B440ACBFA12009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B630ACBFA8D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B6F0ACBFAD0009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B830ACBFB13009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B970ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D814404B0ACB2C1200515C41;
+			remoteInfo = libportmidi.a;
+		};
+		D8684B990ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D8684B050ACBF977009F6478;
+			remoteInfo = test;
+		};
+		D8684B9B0ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D8684B410ACBFA09009F6478;
+			remoteInfo = midithread;
+		};
+		D8684B9D0ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D8684B600ACBFA75009F6478;
+			remoteInfo = midithru;
+		};
+		D8684B9F0ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D8684B6C0ACBFAB7009F6478;
+			remoteInfo = sysex;
+		};
+		D8684BA10ACBFB9D009F6478 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D8684B800ACBFB0B009F6478;
+			remoteInfo = latency;
+		};
+		D8E738E10ACDA3BD0030B95B /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 5851D5180479552300EE98CD /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = D84A40D90ACD4A08001FC716;
+			remoteInfo = portmidi;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		3D17A13D0E13D47F00930576 /* JPortMidiHeaders.jar */ = {isa = PBXFileReference; explicitFileType = archive.jar; includeInIndex = 0; path = JPortMidiHeaders.jar; sourceTree = BUILT_PRODUCTS_DIR; };
+		3D17A18C0E13E1EF00930576 /* jportmidi_JportMidiApi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = jportmidi_JportMidiApi.h; path = build/Development/jportmidi_JportMidiApi.h; sourceTree = "<group>"; };
+		3D17A1910E13E25E00930576 /* libpmjni.jnilib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libpmjni.jnilib; sourceTree = BUILT_PRODUCTS_DIR; };
+		3D17A1A10E13E30100930576 /* pmjni.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pmjni.c; path = ../pm_java/pmjni/pmjni.c; sourceTree = SOURCE_ROOT; };
+		3D17A1E70E13E57700930576 /* JavaVM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaVM.framework; path = /System/Library/Frameworks/JavaVM.framework; sourceTree = "<absolute>"; };
+		3D17A2280E13EF8000930576 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
+		3D17A4C30E14079000930576 /* pmdefaults.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = pmdefaults.icns; path = ../pm_java/pmdefaults/pmdefaults.icns; sourceTree = SOURCE_ROOT; };
+		3D65FEE20ECB7548008083A3 /* CoreServices */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = CoreServices; path = /System/Library/Frameworks/CoreServices.framework/CoreServices; sourceTree = "<absolute>"; };
+		3D9D57C30E12E1CF00C4C68D /* finddefault.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = finddefault.c; sourceTree = "<group>"; };
+		3D9D57C50E12E1E500C4C68D /* readbinaryplist.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readbinaryplist.c; sourceTree = "<group>"; };
+		3D9D57CE0E12E22800C4C68D /* pmdefaults.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = pmdefaults.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		3D9D57DE0E12E39B00C4C68D /* JPortMidi.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = JPortMidi.java; sourceTree = "<group>"; };
+		3D9D57E20E12E39B00C4C68D /* JPortMidiApi.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = JPortMidiApi.java; sourceTree = "<group>"; };
+		3D9D57E40E12E39B00C4C68D /* JPortMidiException.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = JPortMidiException.java; sourceTree = "<group>"; };
+		3D9D57EF0E12E3DE00C4C68D /* PmDefaults.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = PmDefaults.java; sourceTree = "<group>"; };
+		3D9D57F50E12E3DE00C4C68D /* PmDefaultsFrame.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = PmDefaultsFrame.java; sourceTree = "<group>"; };
+		3D9D57F60E12E3DE00C4C68D /* portmusic_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = portmusic_logo.png; sourceTree = "<group>"; };
+		3DA60D6C0D3FBEA40036B654 /* midiclock */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = midiclock; sourceTree = BUILT_PRODUCTS_DIR; };
+		3DA60D710D3FBF160036B654 /* midiclock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = midiclock.c; sourceTree = "<group>"; };
+		3DA774110663E9DA0002CE69 /* latency.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = latency.c; path = ../pm_test/latency.c; sourceTree = SOURCE_ROOT; };
+		3DA774160663E9DA0002CE69 /* midithread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = midithread.c; path = ../pm_test/midithread.c; sourceTree = SOURCE_ROOT; };
+		3DA7741B0663E9DA0002CE69 /* midithru.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = midithru.c; path = ../pm_test/midithru.c; sourceTree = SOURCE_ROOT; };
+		3DA774210663E9DA0002CE69 /* sysex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sysex.c; path = ../pm_test/sysex.c; sourceTree = SOURCE_ROOT; };
+		3DA774260663E9DA0002CE69 /* test.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = test.c; path = ../pm_test/test.c; sourceTree = SOURCE_ROOT; };
+		3DA7742B0663E9DA0002CE69 /* txdata.syx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = txdata.syx; path = ../pm_test/txdata.syx; sourceTree = SOURCE_ROOT; };
+		3DA774480663EAE60002CE69 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = "<absolute>"; };
+		3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+		3DA774500663EBBF0002CE69 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
+		3DBF24640B5967A500DAD93B /* mm */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mm; sourceTree = BUILT_PRODUCTS_DIR; };
+		3DBF246C0B59686800DAD93B /* mm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mm.c; sourceTree = "<group>"; };
+		5851D51E047955B800EE98CD /* porttime.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = porttime.c; path = ../porttime/porttime.c; sourceTree = SOURCE_ROOT; };
+		5851D51F047955B800EE98CD /* porttime.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = porttime.h; path = ../porttime/porttime.h; sourceTree = SOURCE_ROOT; };
+		5851D521047955B800EE98CD /* ptmacosx_cf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ptmacosx_cf.c; path = ../porttime/ptmacosx_cf.c; sourceTree = SOURCE_ROOT; };
+		5851D523047955C800EE98CD /* pminternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pminternal.h; path = ../pm_common/pminternal.h; sourceTree = SOURCE_ROOT; };
+		5851D524047955C800EE98CD /* pmutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pmutil.c; path = ../pm_common/pmutil.c; sourceTree = SOURCE_ROOT; };
+		5851D525047955C800EE98CD /* pmutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pmutil.h; path = ../pm_common/pmutil.h; sourceTree = SOURCE_ROOT; };
+		5851D526047955C800EE98CD /* portmidi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = portmidi.c; path = ../pm_common/portmidi.c; sourceTree = SOURCE_ROOT; };
+		5851D527047955C800EE98CD /* portmidi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = portmidi.h; path = ../pm_common/portmidi.h; sourceTree = SOURCE_ROOT; };
+		5851D528047955D700EE98CD /* pmlinux.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pmlinux.c; path = ../pm_linux/pmlinux.c; sourceTree = SOURCE_ROOT; };
+		5851D529047955D700EE98CD /* pmlinux.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pmlinux.h; path = ../pm_linux/pmlinux.h; sourceTree = SOURCE_ROOT; };
+		5851D52A047955D700EE98CD /* pmlinuxalsa.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pmlinuxalsa.c; path = ../pm_linux/pmlinuxalsa.c; sourceTree = SOURCE_ROOT; };
+		5851D52B047955D700EE98CD /* pmlinuxalsa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pmlinuxalsa.h; path = ../pm_linux/pmlinuxalsa.h; sourceTree = SOURCE_ROOT; };
+		5851D5310479560B00EE98CD /* pmmacosxcm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pmmacosxcm.c; sourceTree = SOURCE_ROOT; };
+		5851D5320479560B00EE98CD /* pmmacosxcm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pmmacosxcm.h; sourceTree = SOURCE_ROOT; };
+		5851D5730479613900EE98CD /* pmmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pmmac.h; sourceTree = SOURCE_ROOT; };
+		5851D5740479613900EE98CD /* pmmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pmmac.c; sourceTree = SOURCE_ROOT; };
+		58ED5B81047D41DB00B92E62 /* ptmacosx_mach.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ptmacosx_mach.c; path = ../porttime/ptmacosx_mach.c; sourceTree = SOURCE_ROOT; };
+		D81440D40ACB36E100515C41 /* libportmidi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libportmidi.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		D84A40DA0ACD4A08001FC716 /* libportmidi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libportmidi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		D8684B060ACBF977009F6478 /* test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test; sourceTree = BUILT_PRODUCTS_DIR; };
+		D8684B420ACBFA09009F6478 /* midithread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = midithread; sourceTree = BUILT_PRODUCTS_DIR; };
+		D8684B610ACBFA75009F6478 /* midithru */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = midithru; sourceTree = BUILT_PRODUCTS_DIR; };
+		D8684B6D0ACBFAB7009F6478 /* sysex */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sysex; sourceTree = BUILT_PRODUCTS_DIR; };
+		D8684B810ACBFB0B009F6478 /* latency */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = latency; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		3D17A13B0E13D47F00930576 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3D17A18F0E13E25E00930576 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D17A1DF0E13E3D800930576 /* CoreAudio.framework in Frameworks */,
+				3D17A1AF0E13E3BC00930576 /* CoreFoundation.framework in Frameworks */,
+				3D17A1A90E13E3B300930576 /* CoreMIDI.framework in Frameworks */,
+				3D17A1E80E13E57700930576 /* JavaVM.framework in Frameworks */,
+				3D17A2290E13EF8000930576 /* CoreServices.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3D9D57CC0E12E22800C4C68D /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3DA60D630D3FBEA40036B654 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3DA60D640D3FBEA40036B654 /* libportmidi.a in Frameworks */,
+				3DA60D650D3FBEA40036B654 /* CoreMIDI.framework in Frameworks */,
+				3DA60D660D3FBEA40036B654 /* CoreFoundation.framework in Frameworks */,
+				3DA60D670D3FBEA40036B654 /* CoreAudio.framework in Frameworks */,
+				3D65FEE90ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3DBF24620B5967A500DAD93B /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3DBF24A90B59692C00DAD93B /* libportmidi.a in Frameworks */,
+				3DBF24720B59691500DAD93B /* CoreMIDI.framework in Frameworks */,
+				3DBF24780B59691800DAD93B /* CoreFoundation.framework in Frameworks */,
+				3DBF24A10B59691B00DAD93B /* CoreAudio.framework in Frameworks */,
+				3D65FEE80ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D81440590ACB2C1200515C41 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D84A40D80ACD4A08001FC716 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D17A22D0E13EF9300930576 /* CoreServices.framework in Frameworks */,
+				D84A41220ACD4A92001FC716 /* CoreMIDI.framework in Frameworks */,
+				D84A41230ACD4A92001FC716 /* CoreFoundation.framework in Frameworks */,
+				D84A41240ACD4A92001FC716 /* CoreAudio.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B040ACBF977009F6478 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B370ACBF9AF009F6478 /* libportmidi.a in Frameworks */,
+				D8684B570ACBFA3E009F6478 /* CoreMIDI.framework in Frameworks */,
+				D8684B580ACBFA3E009F6478 /* CoreFoundation.framework in Frameworks */,
+				D8684B590ACBFA3E009F6478 /* CoreAudio.framework in Frameworks */,
+				3D65FEE30ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B400ACBFA09009F6478 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B470ACBFA2D009F6478 /* libportmidi.a in Frameworks */,
+				D8684B540ACBFA34009F6478 /* CoreMIDI.framework in Frameworks */,
+				D8684B550ACBFA34009F6478 /* CoreFoundation.framework in Frameworks */,
+				D8684B560ACBFA34009F6478 /* CoreAudio.framework in Frameworks */,
+				3D65FEE40ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B5F0ACBFA75009F6478 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B660ACBFAA5009F6478 /* libportmidi.a in Frameworks */,
+				D8684B670ACBFAA5009F6478 /* CoreMIDI.framework in Frameworks */,
+				D8684B680ACBFAA5009F6478 /* CoreFoundation.framework in Frameworks */,
+				D8684B690ACBFAA5009F6478 /* CoreAudio.framework in Frameworks */,
+				3D65FEE50ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B6B0ACBFAB7009F6478 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B7A0ACBFAFD009F6478 /* libportmidi.a in Frameworks */,
+				D8684B7B0ACBFAFD009F6478 /* CoreMIDI.framework in Frameworks */,
+				D8684B7C0ACBFAFD009F6478 /* CoreFoundation.framework in Frameworks */,
+				D8684B7D0ACBFAFD009F6478 /* CoreAudio.framework in Frameworks */,
+				3D65FEE60ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B7F0ACBFB0B009F6478 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B860ACBFB33009F6478 /* libportmidi.a in Frameworks */,
+				D8684B870ACBFB33009F6478 /* CoreMIDI.framework in Frameworks */,
+				D8684B880ACBFB33009F6478 /* CoreFoundation.framework in Frameworks */,
+				D8684B890ACBFB33009F6478 /* CoreAudio.framework in Frameworks */,
+				3D65FEE70ECB7548008083A3 /* CoreServices in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		3D9D57D90E12E35700C4C68D /* pm_java */ = {
+			isa = PBXGroup;
+			children = (
+				3D9D57ED0E12E3DE00C4C68D /* pmdefaults */,
+				3D9D57DC0E12E39B00C4C68D /* jportmidi */,
+			);
+			name = pm_java;
+			sourceTree = "<group>";
+		};
+		3D9D57DC0E12E39B00C4C68D /* jportmidi */ = {
+			isa = PBXGroup;
+			children = (
+				3D9D57DE0E12E39B00C4C68D /* JPortMidi.java */,
+				3D9D57E20E12E39B00C4C68D /* JPortMidiApi.java */,
+				3D9D57E40E12E39B00C4C68D /* JPortMidiException.java */,
+			);
+			name = jportmidi;
+			path = ../pm_java/jportmidi;
+			sourceTree = SOURCE_ROOT;
+		};
+		3D9D57ED0E12E3DE00C4C68D /* pmdefaults */ = {
+			isa = PBXGroup;
+			children = (
+				3D9D57EF0E12E3DE00C4C68D /* PmDefaults.java */,
+				3D9D57F50E12E3DE00C4C68D /* PmDefaultsFrame.java */,
+				3D9D57F60E12E3DE00C4C68D /* portmusic_logo.png */,
+			);
+			name = pmdefaults;
+			path = ../pm_java/pmdefaults;
+			sourceTree = SOURCE_ROOT;
+		};
+		3DA774100663E9DA0002CE69 /* pm_test */ = {
+			isa = PBXGroup;
+			children = (
+				3DA774110663E9DA0002CE69 /* latency.c */,
+				3DA60D710D3FBF160036B654 /* midiclock.c */,
+				3DA774160663E9DA0002CE69 /* midithread.c */,
+				3DA7741B0663E9DA0002CE69 /* midithru.c */,
+				3DBF246C0B59686800DAD93B /* mm.c */,
+				3DA774210663E9DA0002CE69 /* sysex.c */,
+				3DA774260663E9DA0002CE69 /* test.c */,
+				3DA7742B0663E9DA0002CE69 /* txdata.syx */,
+			);
+			name = pm_test;
+			path = ../pm_test;
+			sourceTree = SOURCE_ROOT;
+		};
+		5851D5140479552300EE98CD = {
+			isa = PBXGroup;
+			children = (
+				3D65FEE20ECB7548008083A3 /* CoreServices */,
+				3D17A4C30E14079000930576 /* pmdefaults.icns */,
+				3D17A2280E13EF8000930576 /* CoreServices.framework */,
+				3D17A1E70E13E57700930576 /* JavaVM.framework */,
+				3D17A1A10E13E30100930576 /* pmjni.c */,
+				3D9D57D90E12E35700C4C68D /* pm_java */,
+				5851D51D047955A100EE98CD /* porttime */,
+				5851D51C0479553600EE98CD /* pm_common */,
+				5851D51B0479553500EE98CD /* pm_linux */,
+				5851D5190479552E00EE98CD /* pm_mac */,
+				3DA774100663E9DA0002CE69 /* pm_test */,
+				5851D5390479562300EE98CD /* Products */,
+				3DA774480663EAE60002CE69 /* CoreMIDI.framework */,
+				3DA7744E0663EBB20002CE69 /* CoreFoundation.framework */,
+				3DA774500663EBBF0002CE69 /* CoreAudio.framework */,
+			);
+			sourceTree = "<group>";
+		};
+		5851D5190479552E00EE98CD /* pm_mac */ = {
+			isa = PBXGroup;
+			children = (
+				5851D5310479560B00EE98CD /* pmmacosxcm.c */,
+				5851D5320479560B00EE98CD /* pmmacosxcm.h */,
+				3D9D57C50E12E1E500C4C68D /* readbinaryplist.c */,
+				3D9D57C30E12E1CF00C4C68D /* finddefault.c */,
+				5851D5730479613900EE98CD /* pmmac.h */,
+				5851D5740479613900EE98CD /* pmmac.c */,
+			);
+			name = pm_mac;
+			sourceTree = "<group>";
+		};
+		5851D51B0479553500EE98CD /* pm_linux */ = {
+			isa = PBXGroup;
+			children = (
+				5851D528047955D700EE98CD /* pmlinux.c */,
+				5851D529047955D700EE98CD /* pmlinux.h */,
+				5851D52A047955D700EE98CD /* pmlinuxalsa.c */,
+				5851D52B047955D700EE98CD /* pmlinuxalsa.h */,
+			);
+			name = pm_linux;
+			sourceTree = "<group>";
+		};
+		5851D51C0479553600EE98CD /* pm_common */ = {
+			isa = PBXGroup;
+			children = (
+				5851D523047955C800EE98CD /* pminternal.h */,
+				5851D524047955C800EE98CD /* pmutil.c */,
+				5851D525047955C800EE98CD /* pmutil.h */,
+				5851D526047955C800EE98CD /* portmidi.c */,
+				5851D527047955C800EE98CD /* portmidi.h */,
+			);
+			name = pm_common;
+			sourceTree = SOURCE_ROOT;
+		};
+		5851D51D047955A100EE98CD /* porttime */ = {
+			isa = PBXGroup;
+			children = (
+				5851D51E047955B800EE98CD /* porttime.c */,
+				5851D51F047955B800EE98CD /* porttime.h */,
+				5851D521047955B800EE98CD /* ptmacosx_cf.c */,
+				58ED5B81047D41DB00B92E62 /* ptmacosx_mach.c */,
+			);
+			name = porttime;
+			sourceTree = "<group>";
+		};
+		5851D5390479562300EE98CD /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				D81440D40ACB36E100515C41 /* libportmidi.a */,
+				D84A40DA0ACD4A08001FC716 /* libportmidi.dylib */,
+				D8684B060ACBF977009F6478 /* test */,
+				D8684B420ACBFA09009F6478 /* midithread */,
+				D8684B610ACBFA75009F6478 /* midithru */,
+				D8684B6D0ACBFAB7009F6478 /* sysex */,
+				D8684B810ACBFB0B009F6478 /* latency */,
+				3DBF24640B5967A500DAD93B /* mm */,
+				3DA60D6C0D3FBEA40036B654 /* midiclock */,
+				3D9D57CE0E12E22800C4C68D /* pmdefaults.app */,
+				3D17A13D0E13D47F00930576 /* JPortMidiHeaders.jar */,
+				3D17A18C0E13E1EF00930576 /* jportmidi_JportMidiApi.h */,
+				3D17A1910E13E25E00930576 /* libpmjni.jnilib */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+		3D17A18D0E13E25E00930576 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D814404C0ACB2C1200515C41 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D814404E0ACB2C1200515C41 /* pmutil.h in Headers */,
+				D814404F0ACB2C1200515C41 /* portmidi.h in Headers */,
+				D81440510ACB2C1200515C41 /* porttime.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D84A40D60ACD4A08001FC716 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D84A40DC0ACD4A19001FC716 /* pmutil.h in Headers */,
+				D84A40DD0ACD4A19001FC716 /* portmidi.h in Headers */,
+				D84A40DF0ACD4A19001FC716 /* porttime.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXJavaArchiveBuildPhase section */
+		3D17A13A0E13D47F00930576 /* JavaArchive */ = {
+			isa = PBXJavaArchiveBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3D9D57CB0E12E22800C4C68D /* JavaArchive */ = {
+			isa = PBXJavaArchiveBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXJavaArchiveBuildPhase section */
+
+/* Begin PBXLibraryTarget section */
+		3D17A13C0E13D47F00930576 /* JPortMidiHeaders */ = {
+			isa = PBXLibraryTarget;
+			buildConfigurationList = 3D17A1470E13D48800930576 /* Build configuration list for PBXLibraryTarget "JPortMidiHeaders" */;
+			buildPhases = (
+				3D17A1390E13D47F00930576 /* Sources */,
+				3D17A13A0E13D47F00930576 /* JavaArchive */,
+				3D17A13B0E13D47F00930576 /* Frameworks */,
+				3D17A1560E13D4E400930576 /* ShellScript */,
+			);
+			dependencies = (
+			);
+			name = JPortMidiHeaders;
+			productInstallPath = /usr/local/lib;
+			productName = JPortMidiHeaders;
+			productReference = 3D17A13D0E13D47F00930576 /* JPortMidiHeaders.jar */;
+		};
+/* End PBXLibraryTarget section */
+
+/* Begin PBXNativeTarget section */
+		3D17A1900E13E25E00930576 /* libpmjni.jnilib */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 3D17A19B0E13E29800930576 /* Build configuration list for PBXNativeTarget "libpmjni.jnilib" */;
+			buildPhases = (
+				3D17A18D0E13E25E00930576 /* Headers */,
+				3D17A18E0E13E25E00930576 /* Sources */,
+				3D17A18F0E13E25E00930576 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				3D17A1EC0E13E5D100930576 /* PBXTargetDependency */,
+			);
+			name = libpmjni.jnilib;
+			productName = libpmjni.jnilib;
+			productReference = 3D17A1910E13E25E00930576 /* libpmjni.jnilib */;
+			productType = "com.apple.product-type.library.dynamic";
+		};
+		3DA60D5E0D3FBEA40036B654 /* midiclock */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 3DA60D680D3FBEA40036B654 /* Build configuration list for PBXNativeTarget "midiclock" */;
+			buildPhases = (
+				3DA60D610D3FBEA40036B654 /* Sources */,
+				3DA60D630D3FBEA40036B654 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "a MIDI clock and MIDI time code generator for testing";
+			dependencies = (
+				3DA60D5F0D3FBEA40036B654 /* PBXTargetDependency */,
+			);
+			name = midiclock;
+			productName = mm;
+			productReference = 3DA60D6C0D3FBEA40036B654 /* midiclock */;
+			productType = "com.apple.product-type.tool";
+		};
+		3DBF24630B5967A500DAD93B /* mm */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 3DBF24680B59681900DAD93B /* Build configuration list for PBXNativeTarget "mm" */;
+			buildPhases = (
+				3DBF24610B5967A500DAD93B /* Sources */,
+				3DBF24620B5967A500DAD93B /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "a midi monitor program";
+			dependencies = (
+				3DBF24710B5968BC00DAD93B /* PBXTargetDependency */,
+			);
+			name = mm;
+			productName = mm;
+			productReference = 3DBF24640B5967A500DAD93B /* mm */;
+			productType = "com.apple.product-type.tool";
+		};
+		D814404B0ACB2C1200515C41 /* libportmidi.a */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D814405B0ACB2C1200515C41 /* Build configuration list for PBXNativeTarget "libportmidi.a" */;
+			buildPhases = (
+				D814404C0ACB2C1200515C41 /* Headers */,
+				D81440530ACB2C1200515C41 /* Sources */,
+				D81440590ACB2C1200515C41 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = libportmidi.a;
+			productInstallPath = /usr/local/lib;
+			productName = libportmidi.a;
+			productReference = D81440D40ACB36E100515C41 /* libportmidi.a */;
+			productType = "com.apple.product-type.library.static";
+		};
+		D84A40D90ACD4A08001FC716 /* portmidi.dylib */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D84A40E70ACD4A56001FC716 /* Build configuration list for PBXNativeTarget "portmidi.dylib" */;
+			buildPhases = (
+				D84A40D60ACD4A08001FC716 /* Headers */,
+				D84A40D70ACD4A08001FC716 /* Sources */,
+				D84A40D80ACD4A08001FC716 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = portmidi.dylib;
+			productName = portmidi;
+			productReference = D84A40DA0ACD4A08001FC716 /* libportmidi.dylib */;
+			productType = "com.apple.product-type.library.dynamic";
+		};
+		D8684B050ACBF977009F6478 /* test */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D8684B390ACBF9CC009F6478 /* Build configuration list for PBXNativeTarget "test" */;
+			buildPhases = (
+				D8684B030ACBF977009F6478 /* Sources */,
+				D8684B040ACBF977009F6478 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "A PortMidi test program";
+			dependencies = (
+				D8684B090ACBF996009F6478 /* PBXTargetDependency */,
+			);
+			name = test;
+			productName = test;
+			productReference = D8684B060ACBF977009F6478 /* test */;
+			productType = "com.apple.product-type.tool";
+		};
+		D8684B410ACBFA09009F6478 /* midithread */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D8684B5A0ACBFA51009F6478 /* Build configuration list for PBXNativeTarget "midithread" */;
+			buildPhases = (
+				D8684B3F0ACBFA09009F6478 /* Sources */,
+				D8684B400ACBFA09009F6478 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "Demonstrates the use of a low-latency thread for midi processing";
+			dependencies = (
+				D8684B450ACBFA12009F6478 /* PBXTargetDependency */,
+			);
+			name = midithread;
+			productName = midithread;
+			productReference = D8684B420ACBFA09009F6478 /* midithread */;
+			productType = "com.apple.product-type.tool";
+		};
+		D8684B600ACBFA75009F6478 /* midithru */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D8684B710ACBFAE9009F6478 /* Build configuration list for PBXNativeTarget "midithru" */;
+			buildPhases = (
+				D8684B5E0ACBFA75009F6478 /* Sources */,
+				D8684B5F0ACBFA75009F6478 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "Demonstrates midi thru processing in a low-priority thread";
+			dependencies = (
+				D8684B640ACBFA8D009F6478 /* PBXTargetDependency */,
+			);
+			name = midithru;
+			productName = midithru;
+			productReference = D8684B610ACBFA75009F6478 /* midithru */;
+			productType = "com.apple.product-type.tool";
+		};
+		D8684B6C0ACBFAB7009F6478 /* sysex */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D8684B750ACBFAE9009F6478 /* Build configuration list for PBXNativeTarget "sysex" */;
+			buildPhases = (
+				D8684B6A0ACBFAB7009F6478 /* Sources */,
+				D8684B6B0ACBFAB7009F6478 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "System exclusive input and output test";
+			dependencies = (
+				D8684B700ACBFAD0009F6478 /* PBXTargetDependency */,
+			);
+			name = sysex;
+			productName = sysex;
+			productReference = D8684B6D0ACBFAB7009F6478 /* sysex */;
+			productType = "com.apple.product-type.tool";
+		};
+		D8684B800ACBFB0B009F6478 /* latency */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D8684B8A0ACBFB3D009F6478 /* Build configuration list for PBXNativeTarget "latency" */;
+			buildPhases = (
+				D8684B7E0ACBFB0B009F6478 /* Sources */,
+				D8684B7F0ACBFB0B009F6478 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			comments = "a test program to measure OS latency";
+			dependencies = (
+				D8684B840ACBFB13009F6478 /* PBXTargetDependency */,
+			);
+			name = latency;
+			productName = latency;
+			productReference = D8684B810ACBFB0B009F6478 /* latency */;
+			productType = "com.apple.product-type.tool";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		5851D5180479552300EE98CD /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = D814401B0ACB28B600515C41 /* Build configuration list for PBXProject "pm_mac" */;
+			hasScannedForEncodings = 1;
+			mainGroup = 5851D5140479552300EE98CD;
+			productRefGroup = 5851D5390479562300EE98CD /* Products */;
+			projectDirPath = "";
+			targets = (
+				D84A40D90ACD4A08001FC716 /* portmidi.dylib */,
+				D814404B0ACB2C1200515C41 /* libportmidi.a */,
+				3D17A1900E13E25E00930576 /* libpmjni.jnilib */,
+				D8684B050ACBF977009F6478 /* test */,
+				D8684B410ACBFA09009F6478 /* midithread */,
+				D8684B600ACBFA75009F6478 /* midithru */,
+				D8684B6C0ACBFAB7009F6478 /* sysex */,
+				D8684B800ACBFB0B009F6478 /* latency */,
+				3DBF24630B5967A500DAD93B /* mm */,
+				3DA60D5E0D3FBEA40036B654 /* midiclock */,
+				D8684B960ACBFB93009F6478 /* everything suite */,
+				3D9D57CD0E12E22800C4C68D /* PmDefaults */,
+				3D17A13C0E13D47F00930576 /* JPortMidiHeaders */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		3D9D57CA0E12E22800C4C68D /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D9D57FF0E12E3DE00C4C68D /* portmusic_logo.png in Resources */,
+				3D17A4C40E14079000930576 /* pmdefaults.icns in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+		3D17A1560E13D4E400930576 /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			comments = "Build header for the JNI interface. The source that specifies the interface is JPortMidiApi.java. There may be multiple header files created since there are some subclasses contained in JPortMidiApi.java, but the headers we need are for the outer JPortMidi class. The header file should be called jportmidi_JportMidiApi.h because that's what javah creates by default.\n";
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "echo BUILT_PRODUCTS_DIR is ${BUILT_PRODUCTS_DIR}\njavah -classpath \"${BUILT_PRODUCTS_DIR}/JPortMidiHeaders.jar\" -force -o \"${BUILT_PRODUCTS_DIR}/jportmidi_JportMidiApi.h\" \"jportmidi.JPortMidiApi\"";
+		};
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		3D17A1390E13D47F00930576 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D17A16A0E13D6B700930576 /* JPortMidi.java in Sources */,
+				3D17A16C0E13D70800930576 /* JPortMidiException.java in Sources */,
+				3D17A16D0E13D70E00930576 /* JPortMidiApi.java in Sources */,
+				3D17A16E0E13D70E00930576 /* PmDefaults.java in Sources */,
+				3D17A16F0E13D70E00930576 /* PmDefaultsFrame.java in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3D17A18E0E13E25E00930576 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D17A20D0E13E88100930576 /* pmutil.c in Sources */,
+				3D17A20E0E13E88100930576 /* portmidi.c in Sources */,
+				3D17A20F0E13E88100930576 /* pmmacosxcm.c in Sources */,
+				3D17A2100E13E88100930576 /* pmmac.c in Sources */,
+				3D17A2110E13E88100930576 /* ptmacosx_mach.c in Sources */,
+				3D17A2120E13E88100930576 /* readbinaryplist.c in Sources */,
+				3D17A2130E13E88100930576 /* finddefault.c in Sources */,
+				3D17A1A20E13E30100930576 /* pmjni.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3D9D57C90E12E22800C4C68D /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3D9D57EC0E12E39B00C4C68D /* JPortMidiException.java in Sources */,
+				3D9D57E60E12E39B00C4C68D /* JPortMidi.java in Sources */,
+				3D9D57EA0E12E39B00C4C68D /* JPortMidiApi.java in Sources */,
+				3D9D57F80E12E3DE00C4C68D /* PmDefaults.java in Sources */,
+				3D9D57FE0E12E3DE00C4C68D /* PmDefaultsFrame.java in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3DA60D610D3FBEA40036B654 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3DA60D720D3FBF160036B654 /* midiclock.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		3DBF24610B5967A500DAD93B /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				3DBF246D0B59686800DAD93B /* mm.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D81440530ACB2C1200515C41 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D81440540ACB2C1200515C41 /* pmutil.c in Sources */,
+				D81440550ACB2C1200515C41 /* portmidi.c in Sources */,
+				D81440560ACB2C1200515C41 /* pmmacosxcm.c in Sources */,
+				D81440570ACB2C1200515C41 /* pmmac.c in Sources */,
+				D81440580ACB2C1200515C41 /* ptmacosx_mach.c in Sources */,
+				3D17A20A0E13E7E900930576 /* readbinaryplist.c in Sources */,
+				3D17A20B0E13E7E900930576 /* finddefault.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D84A40D70ACD4A08001FC716 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D84A40E10ACD4A26001FC716 /* pmutil.c in Sources */,
+				D84A40E20ACD4A26001FC716 /* portmidi.c in Sources */,
+				D84A40E30ACD4A26001FC716 /* pmmacosxcm.c in Sources */,
+				D84A40E40ACD4A26001FC716 /* pmmac.c in Sources */,
+				D84A40E50ACD4A26001FC716 /* ptmacosx_mach.c in Sources */,
+				3D9D57C40E12E1CF00C4C68D /* finddefault.c in Sources */,
+				3D9D57C60E12E1E500C4C68D /* readbinaryplist.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B030ACBF977009F6478 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B380ACBF9B9009F6478 /* test.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B3F0ACBFA09009F6478 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B460ACBFA24009F6478 /* midithread.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B5E0ACBFA75009F6478 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B650ACBFA9D009F6478 /* midithru.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B6A0ACBFAB7009F6478 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B790ACBFAF7009F6478 /* sysex.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		D8684B7E0ACBFB0B009F6478 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D8684B850ACBFB2C009F6478 /* latency.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+		3D17A1EC0E13E5D100930576 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3D17A13C0E13D47F00930576 /* JPortMidiHeaders */;
+			targetProxy = 3D17A1EB0E13E5D100930576 /* PBXContainerItemProxy */;
+		};
+		3D3534900F0D2DB30059CD05 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3D9D57CD0E12E22800C4C68D /* PmDefaults */;
+			targetProxy = 3D35348F0F0D2DB30059CD05 /* PBXContainerItemProxy */;
+		};
+		3D4799D40F0E87350006C842 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3DBF24630B5967A500DAD93B /* mm */;
+			targetProxy = 3D4799D30F0E87350006C842 /* PBXContainerItemProxy */;
+		};
+		3D4799F50F0EE7D10006C842 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3D17A1900E13E25E00930576 /* libpmjni.jnilib */;
+			targetProxy = 3D4799F40F0EE7D10006C842 /* PBXContainerItemProxy */;
+		};
+		3D4799F80F0EE7FB0006C842 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3D17A1900E13E25E00930576 /* libpmjni.jnilib */;
+			targetProxy = 3D4799F70F0EE7FB0006C842 /* PBXContainerItemProxy */;
+		};
+		3D8DABA50D57B68A000FEBA8 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 3DA60D5E0D3FBEA40036B654 /* midiclock */;
+			targetProxy = 3D8DABA40D57B68A000FEBA8 /* PBXContainerItemProxy */;
+		};
+		3DA60D5F0D3FBEA40036B654 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = 3DA60D600D3FBEA40036B654 /* PBXContainerItemProxy */;
+		};
+		3DBF24710B5968BC00DAD93B /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = 3DBF24700B5968BC00DAD93B /* PBXContainerItemProxy */;
+		};
+		D8684B090ACBF996009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B080ACBF996009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B450ACBFA12009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B440ACBFA12009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B640ACBFA8D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B630ACBFA8D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B700ACBFAD0009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B6F0ACBFAD0009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B840ACBFB13009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B830ACBFB13009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B980ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D814404B0ACB2C1200515C41 /* libportmidi.a */;
+			targetProxy = D8684B970ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B9A0ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D8684B050ACBF977009F6478 /* test */;
+			targetProxy = D8684B990ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B9C0ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D8684B410ACBFA09009F6478 /* midithread */;
+			targetProxy = D8684B9B0ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684B9E0ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D8684B600ACBFA75009F6478 /* midithru */;
+			targetProxy = D8684B9D0ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684BA00ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D8684B6C0ACBFAB7009F6478 /* sysex */;
+			targetProxy = D8684B9F0ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8684BA20ACBFB9D009F6478 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D8684B800ACBFB0B009F6478 /* latency */;
+			targetProxy = D8684BA10ACBFB9D009F6478 /* PBXContainerItemProxy */;
+		};
+		D8E738E20ACDA3BD0030B95B /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = D84A40D90ACD4A08001FC716 /* portmidi.dylib */;
+			targetProxy = D8E738E10ACDA3BD0030B95B /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+		3D17A1480E13D48800930576 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				JAVA_ARCHIVE_CLASSES = YES;
+				JAVA_ARCHIVE_TYPE = JAR;
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_STYLE = STATIC;
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = JPortMidiHeaders;
+				PURE_JAVA = YES;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+			};
+			name = Development;
+		};
+		3D17A1490E13D48800930576 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				JAVA_ARCHIVE_CLASSES = YES;
+				JAVA_ARCHIVE_TYPE = JAR;
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_STYLE = STATIC;
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = JPortMidiHeaders;
+				PURE_JAVA = YES;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		3D17A14A0E13D48800930576 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				JAVA_ARCHIVE_CLASSES = YES;
+				JAVA_ARCHIVE_TYPE = JAR;
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_STYLE = STATIC;
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = JPortMidiHeaders;
+				PURE_JAVA = YES;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+			};
+			name = Default;
+		};
+		3D17A19C0E13E29800930576 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				EXECUTABLE_EXTENSION = jnilib;
+				EXECUTABLE_PREFIX = lib;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				HEADER_SEARCH_PATHS = (
+					"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Headers",
+					/Developer/Headers/FlatCarbon,
+				);
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = pmjni;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		3D17A19D0E13E29800930576 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				EXECUTABLE_EXTENSION = jnilib;
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				HEADER_SEARCH_PATHS = (
+					"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Headers",
+					/Developer/Headers/FlatCarbon,
+				);
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = pmjni;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		3D17A19E0E13E29800930576 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				EXECUTABLE_EXTENSION = jnilib;
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				HEADER_SEARCH_PATHS = (
+					"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Headers",
+					/Developer/Headers/FlatCarbon,
+				);
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = pmjni;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		3D9D57D10E12E24600C4C68D /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				HEADER_SEARCH_PATHS = "";
+				INSTALL_PATH = Applications;
+				JAVA_CLASS_SEARCH_PATHS = /Users/rbd/portmedia/portmidi/pm_java/pmdefaults;
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_COMPILER_SOURCE_VERSION = 1.5;
+				JAVA_COMPILER_TARGET_VM_VERSION = 1.5;
+				JAVA_ONLY = YES;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(SRCROOT)/../pm_java/pmjni",
+				);
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = PmDefaults;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				WRAPPER_EXTENSION = app;
+			};
+			name = Development;
+		};
+		3D9D57D20E12E24600C4C68D /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_ONLY = YES;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(SRCROOT)/../pm_java/pmjni",
+				);
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = pmdefaults;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				WRAPPER_EXTENSION = app;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		3D9D57D30E12E24600C4C68D /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				JAVA_COMPILER = /usr/bin/javac;
+				JAVA_ONLY = YES;
+				JAVA_SOURCE_SUBDIR = .;
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(SRCROOT)/../pm_java/pmjni",
+				);
+				OPTIMIZATION_CFLAGS = "-O0";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = pmdefaults;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				WRAPPER_EXTENSION = app;
+			};
+			name = Default;
+		};
+		3DA60D690D3FBEA40036B654 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midiclock;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		3DA60D6A0D3FBEA40036B654 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midiclock;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		3DA60D6B0D3FBEA40036B654 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midiclock;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		3DBF24690B59681900DAD93B /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = mm;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		3DBF246A0B59681900DAD93B /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = mm;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		3DBF246B0B59681900DAD93B /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = mm;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D814401C0ACB28B600515C41 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Development;
+		};
+		D814401D0ACB28B600515C41 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				INSTALL_PATH = /usr/local/lib;
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Deployment;
+		};
+		D814401E0ACB28B600515C41 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Default;
+		};
+		D814405C0ACB2C1200515C41 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					PM_CHECK_ERRORS,
+					DEBUG,
+					NEWBUFFER,
+				);
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				LIBRARY_STYLE = STATIC;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = portmidi;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D814405D0ACB2C1200515C41 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					PM_CHECK_ERRORS,
+					DEBUG,
+					NEWBUFFER,
+				);
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				LIBRARY_STYLE = STATIC;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = portmidi;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				SKIP_INSTALL = NO;
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D814405E0ACB2C1200515C41 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					PM_CHECK_ERRORS,
+					DEBUG,
+					NEWBUFFER,
+				);
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				LIBRARY_STYLE = STATIC;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				OTHER_LIBTOOL_FLAGS = "";
+				OTHER_REZFLAGS = "";
+				PRODUCT_NAME = portmidi;
+				REZ_EXECUTABLE = YES;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = (
+					"-Wmost",
+					"-Wno-four-char-constants",
+					"-Wno-unknown-pragmas",
+				);
+			};
+			name = Default;
+		};
+		D84A40E80ACD4A56001FC716 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				EXECUTABLE_PREFIX = lib;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = portmidi;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D84A40E90ACD4A56001FC716 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = portmidi;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D84A40EA0ACD4A56001FC716 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon;
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = portmidi;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684B3A0ACBF9CC009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = test;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D8684B3B0ACBF9CC009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = test;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684B3C0ACBF9CC009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = test;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684B5B0ACBFA51009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithread;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D8684B5C0ACBFA51009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithread;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684B5D0ACBFA51009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithread;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684B720ACBFAE9009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithru;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D8684B730ACBFAE9009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithru;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684B740ACBFAE9009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = midithru;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684B760ACBFAE9009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = sysex;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D8684B770ACBFAE9009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = sysex;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684B780ACBFAE9009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = sysex;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684B8B0ACBFB3D009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = latency;
+				ZERO_LINK = YES;
+			};
+			name = Development;
+		};
+		D8684B8C0ACBFB3D009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = latency;
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684B8D0ACBFB3D009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_PREPROCESSOR_DEFINITIONS = NEWBUFFER;
+				INSTALL_PATH = "$(HOME)/bin";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework\"";
+				PREBINDING = NO;
+				PRODUCT_NAME = latency;
+				ZERO_LINK = YES;
+			};
+			name = Default;
+		};
+		D8684BAB0ACBFBDD009F6478 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				PRODUCT_NAME = "lib+test suite";
+			};
+			name = Development;
+		};
+		D8684BAC0ACBFBDD009F6478 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				PRODUCT_NAME = "lib+test suite";
+				ZERO_LINK = NO;
+			};
+			name = Deployment;
+		};
+		D8684BAD0ACBFBDD009F6478 /* Default */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				PRODUCT_NAME = "lib+test suite";
+			};
+			name = Default;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		3D17A1470E13D48800930576 /* Build configuration list for PBXLibraryTarget "JPortMidiHeaders" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				3D17A1480E13D48800930576 /* Development */,
+				3D17A1490E13D48800930576 /* Deployment */,
+				3D17A14A0E13D48800930576 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		3D17A19B0E13E29800930576 /* Build configuration list for PBXNativeTarget "libpmjni.jnilib" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				3D17A19C0E13E29800930576 /* Development */,
+				3D17A19D0E13E29800930576 /* Deployment */,
+				3D17A19E0E13E29800930576 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		3D9D57D00E12E24600C4C68D /* Build configuration list for PBXApplicationTarget "PmDefaults" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				3D9D57D10E12E24600C4C68D /* Development */,
+				3D9D57D20E12E24600C4C68D /* Deployment */,
+				3D9D57D30E12E24600C4C68D /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		3DA60D680D3FBEA40036B654 /* Build configuration list for PBXNativeTarget "midiclock" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				3DA60D690D3FBEA40036B654 /* Development */,
+				3DA60D6A0D3FBEA40036B654 /* Deployment */,
+				3DA60D6B0D3FBEA40036B654 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		3DBF24680B59681900DAD93B /* Build configuration list for PBXNativeTarget "mm" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				3DBF24690B59681900DAD93B /* Development */,
+				3DBF246A0B59681900DAD93B /* Deployment */,
+				3DBF246B0B59681900DAD93B /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D814401B0ACB28B600515C41 /* Build configuration list for PBXProject "pm_mac" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D814401C0ACB28B600515C41 /* Development */,
+				D814401D0ACB28B600515C41 /* Deployment */,
+				D814401E0ACB28B600515C41 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D814405B0ACB2C1200515C41 /* Build configuration list for PBXNativeTarget "libportmidi.a" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D814405C0ACB2C1200515C41 /* Development */,
+				D814405D0ACB2C1200515C41 /* Deployment */,
+				D814405E0ACB2C1200515C41 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D84A40E70ACD4A56001FC716 /* Build configuration list for PBXNativeTarget "portmidi.dylib" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D84A40E80ACD4A56001FC716 /* Development */,
+				D84A40E90ACD4A56001FC716 /* Deployment */,
+				D84A40EA0ACD4A56001FC716 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684B390ACBF9CC009F6478 /* Build configuration list for PBXNativeTarget "test" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684B3A0ACBF9CC009F6478 /* Development */,
+				D8684B3B0ACBF9CC009F6478 /* Deployment */,
+				D8684B3C0ACBF9CC009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684B5A0ACBFA51009F6478 /* Build configuration list for PBXNativeTarget "midithread" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684B5B0ACBFA51009F6478 /* Development */,
+				D8684B5C0ACBFA51009F6478 /* Deployment */,
+				D8684B5D0ACBFA51009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684B710ACBFAE9009F6478 /* Build configuration list for PBXNativeTarget "midithru" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684B720ACBFAE9009F6478 /* Development */,
+				D8684B730ACBFAE9009F6478 /* Deployment */,
+				D8684B740ACBFAE9009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684B750ACBFAE9009F6478 /* Build configuration list for PBXNativeTarget "sysex" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684B760ACBFAE9009F6478 /* Development */,
+				D8684B770ACBFAE9009F6478 /* Deployment */,
+				D8684B780ACBFAE9009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684B8A0ACBFB3D009F6478 /* Build configuration list for PBXNativeTarget "latency" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684B8B0ACBFB3D009F6478 /* Development */,
+				D8684B8C0ACBFB3D009F6478 /* Deployment */,
+				D8684B8D0ACBFB3D009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+		D8684BAA0ACBFBDD009F6478 /* Build configuration list for PBXAggregateTarget "everything suite" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D8684BAB0ACBFBDD009F6478 /* Development */,
+				D8684BAC0ACBFBDD009F6478 /* Deployment */,
+				D8684BAD0ACBFBDD009F6478 /* Default */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Default;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 5851D5180479552300EE98CD /* Project object */;
+}
diff --git a/lib-src/portmidi/pm_mac/pmmac.c b/lib-src/portmidi/pm_mac/pmmac.c
new file mode 100644
index 0000000..bcef0d1
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/pmmac.c
@@ -0,0 +1,59 @@
+/* pmmac.c -- PortMidi os-dependent code */
+
+/* This file only needs to implement:
+pm_init(), which calls various routines to register the 
+available midi devices,
+Pm_GetDefaultInputDeviceID(), and
+Pm_GetDefaultOutputDeviceID().
+It is seperate from pmmacosxcm because we might want to register
+non-CoreMIDI devices.
+*/
+
+#include "stdlib.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include "pmmacosxcm.h"
+
+PmDeviceID pm_default_input_device_id = -1;
+PmDeviceID pm_default_output_device_id = -1;
+
+void pm_init()
+{
+    PmError err = pm_macosxcm_init();
+    // this is set when we return to Pm_Initialize, but we need it
+    // now in order to (successfully) call Pm_CountDevices()
+    pm_initialized = TRUE;
+    if (!err) {
+        pm_default_input_device_id = find_default_device(
+                "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE, 
+                pm_default_input_device_id);
+        pm_default_output_device_id = find_default_device(
+                "/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE, 
+                pm_default_output_device_id);
+    }
+}
+
+
+void pm_term(void)
+{
+    pm_macosxcm_term();
+}
+
+
+PmDeviceID Pm_GetDefaultInputDeviceID()
+{
+    Pm_Initialize();
+    return pm_default_input_device_id;
+}
+
+PmDeviceID Pm_GetDefaultOutputDeviceID() {
+    Pm_Initialize();
+    return pm_default_output_device_id;
+}
+
+void *pm_alloc(size_t s) { return malloc(s); }
+
+void pm_free(void *ptr) { free(ptr); }
+
+
diff --git a/lib-src/portmidi/pm_mac/pmmac.h b/lib-src/portmidi/pm_mac/pmmac.h
new file mode 100644
index 0000000..6cc0392
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/pmmac.h
@@ -0,0 +1,4 @@
+/* pmmac.h */
+
+extern PmDeviceID pm_default_input_device_id;
+extern PmDeviceID pm_default_output_device_id;
\ No newline at end of file
diff --git a/lib-src/portmidi/pm_mac/pmmacosxcm.c b/lib-src/portmidi/pm_mac/pmmacosxcm.c
new file mode 100644
index 0000000..28b2d3a
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/pmmacosxcm.c
@@ -0,0 +1,946 @@
+/*
+ * Platform interface to the MacOS X CoreMIDI framework
+ * 
+ * Jon Parise <jparise at cmu.edu>
+ * and subsequent work by Andrew Zeldis and Zico Kolter
+ * and Roger B. Dannenberg
+ *
+ * $Id: pmmacosxcm.c,v 1.1 2009/06/24 20:37:25 gswillia Exp $
+ */
+ 
+/* Notes:
+    since the input and output streams are represented by MIDIEndpointRef
+    values and almost no other state, we store the MIDIEndpointRef on
+    descriptors[midi->device_id].descriptor. The only other state we need
+    is for errors: we need to know if there is an error and if so, what is
+    the error text. We use a structure with two kinds of
+    host error: "error" and "callback_error". That way, asynchronous callbacks
+    do not interfere with other error information.
+    
+    OS X does not seem to have an error-code-to-text function, so we will
+    just use text messages instead of error codes.
+ */
+
+#include <stdlib.h>
+
+//#define CM_DEBUG 1
+
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include "porttime.h"
+#include "pmmac.h"
+#include "pmmacosxcm.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <CoreServices/CoreServices.h>
+#include <CoreMIDI/MIDIServices.h>
+#include <CoreAudio/HostTime.h>
+
+#define PACKET_BUFFER_SIZE 1024
+
+/* this is very strange: if I put in a reasonable 
+   number here, e.g. 128, which would allow sysex data
+   to be sent 128 bytes at a time, then I lose sysex
+   data in my loopback test. With a buffer size of 4,
+   we put at most 4 bytes in a packet (but maybe many
+   packets in a packetList), and everything works fine.
+ */
+#define SYSEX_BUFFER_SIZE 4
+
+#define VERBOSE_ON 1
+#define VERBOSE if (VERBOSE_ON)
+
+#define MIDI_SYSEX      0xf0
+#define MIDI_EOX        0xf7
+#define MIDI_STATUS_MASK 0x80
+
+static MIDIClientRef	client = NULL;	/* Client handle to the MIDI server */
+static MIDIPortRef	portIn = NULL;	/* Input port handle */
+static MIDIPortRef	portOut = NULL;	/* Output port handle */
+
+extern pm_fns_node pm_macosx_in_dictionary;
+extern pm_fns_node pm_macosx_out_dictionary;
+
+typedef struct midi_macosxcm_struct {
+    unsigned long sync_time; /* when did we last determine delta? */
+    UInt64 delta;	/* difference between stream time and real time in ns */
+    UInt64 last_time;	/* last output time */
+    int first_message;  /* tells midi_write to sychronize timestamps */
+    int sysex_mode;     /* middle of sending sysex */
+    unsigned long sysex_word; /* accumulate data when receiving sysex */
+    unsigned int sysex_byte_count; /* count how many received */
+    char error[PM_HOST_ERROR_MSG_LEN];
+    char callback_error[PM_HOST_ERROR_MSG_LEN];
+    Byte packetBuffer[PACKET_BUFFER_SIZE];
+    MIDIPacketList *packetList; /* a pointer to packetBuffer */
+    MIDIPacket *packet;
+    Byte sysex_buffer[SYSEX_BUFFER_SIZE]; /* temp storage for sysex data */
+    MIDITimeStamp sysex_timestamp; /* timestamp to use with sysex data */
+    /* allow for running status (is running status possible here? -rbd): -cpr */
+    unsigned char last_command; 
+    long last_msg_length;
+} midi_macosxcm_node, *midi_macosxcm_type;
+
+/* private function declarations */
+MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp);
+PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp);
+
+char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint);
+
+
+static int
+midi_length(long msg)
+{
+    int status, high, low;
+    static int high_lengths[] = {
+        1, 1, 1, 1, 1, 1, 1, 1,         /* 0x00 through 0x70 */
+        3, 3, 3, 3, 2, 2, 3, 1          /* 0x80 through 0xf0 */
+    };
+    static int low_lengths[] = {
+        1, 2, 3, 2, 1, 1, 1, 1,         /* 0xf0 through 0xf8 */
+        1, 1, 1, 1, 1, 1, 1, 1          /* 0xf9 through 0xff */
+    };
+
+    status = msg & 0xFF;
+    high = status >> 4;
+    low = status & 15;
+
+    return (high != 0xF) ? high_lengths[high] : low_lengths[low];
+}
+
+static PmTimestamp midi_synchronize(PmInternal *midi)
+{
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    UInt64 pm_stream_time_2 = 
+            AudioConvertHostTimeToNanos(AudioGetCurrentHostTime());
+    PmTimestamp real_time;
+    UInt64 pm_stream_time;
+    /* if latency is zero and this is an output, there is no 
+       time reference and midi_synchronize should never be called */
+    assert(midi->time_proc);
+    assert(!(midi->write_flag && midi->latency == 0));
+    do {
+         /* read real_time between two reads of stream time */
+         pm_stream_time = pm_stream_time_2;
+         real_time = (*midi->time_proc)(midi->time_info);
+         pm_stream_time_2 = AudioConvertHostTimeToNanos(AudioGetCurrentHostTime());
+         /* repeat if more than 0.5 ms has elapsed */
+    } while (pm_stream_time_2 > pm_stream_time + 500000);
+    m->delta = pm_stream_time - ((UInt64) real_time * (UInt64) 1000000);
+    m->sync_time = real_time;
+    return real_time;
+}
+
+
+static void
+process_packet(MIDIPacket *packet, PmEvent *event, 
+	       PmInternal *midi, midi_macosxcm_type m)
+{
+    /* handle a packet of MIDI messages from CoreMIDI */
+    /* there may be multiple short messages in one packet (!) */
+    unsigned int remaining_length = packet->length;
+    unsigned char *cur_packet_data = packet->data;
+    while (remaining_length > 0) {
+        if (cur_packet_data[0] == MIDI_SYSEX ||
+            /* are we in the middle of a sysex message? */
+            (m->last_command == 0 &&
+             !(cur_packet_data[0] & MIDI_STATUS_MASK))) {
+            m->last_command = 0; /* no running status */
+            unsigned int amt = pm_read_bytes(midi, cur_packet_data, 
+                                             remaining_length, 
+                                             event->timestamp);
+            remaining_length -= amt;
+            cur_packet_data += amt;
+        } else if (cur_packet_data[0] == MIDI_EOX) {
+            /* this should never happen, because pm_read_bytes should
+             * get and read all EOX bytes*/
+            midi->sysex_in_progress = FALSE;
+            m->last_command = 0;
+        } else if (cur_packet_data[0] & MIDI_STATUS_MASK) {
+            /* compute the length of the next (short) msg in packet */
+	    unsigned int cur_message_length = midi_length(cur_packet_data[0]);
+            if (cur_message_length > remaining_length) {
+#ifdef DEBUG
+                printf("PortMidi debug msg: not enough data");
+#endif
+		/* since there's no more data, we're done */
+		return;
+	    }
+	    m->last_msg_length = cur_message_length;
+	    m->last_command = cur_packet_data[0];
+	    switch (cur_message_length) {
+	    case 1:
+	        event->message = Pm_Message(cur_packet_data[0], 0, 0);
+		break; 
+	    case 2:
+	        event->message = Pm_Message(cur_packet_data[0], 
+					    cur_packet_data[1], 0);
+		break;
+	    case 3:
+	        event->message = Pm_Message(cur_packet_data[0],
+					    cur_packet_data[1], 
+					    cur_packet_data[2]);
+		break;
+	    default:
+                /* PortMIDI internal error; should never happen */
+                assert(cur_message_length == 1);
+	        return; /* give up on packet if continued after assert */
+	    }
+	    pm_read_short(midi, event);
+	    remaining_length -= m->last_msg_length;
+	    cur_packet_data += m->last_msg_length;
+	} else if (m->last_msg_length > remaining_length + 1) {
+	    /* we have running status, but not enough data */
+#ifdef DEBUG
+	    printf("PortMidi debug msg: not enough data in CoreMIDI packet");
+#endif
+	    /* since there's no more data, we're done */
+	    return;
+	} else { /* output message using running status */
+	    switch (m->last_msg_length) {
+	    case 1:
+	        event->message = Pm_Message(m->last_command, 0, 0);
+		break;
+	    case 2:
+	        event->message = Pm_Message(m->last_command, 
+					    cur_packet_data[0], 0);
+		break;
+	    case 3:
+	        event->message = Pm_Message(m->last_command, 
+					    cur_packet_data[0], 
+					    cur_packet_data[1]);
+		break;
+	    default:
+	        /* last_msg_length is invalid -- internal PortMIDI error */
+	        assert(m->last_msg_length == 1);
+	    }
+	    pm_read_short(midi, event);
+	    remaining_length -= (m->last_msg_length - 1);
+	    cur_packet_data += (m->last_msg_length - 1);
+	}
+    }
+}
+
+
+
+/* called when MIDI packets are received */
+static void
+readProc(const MIDIPacketList *newPackets, void *refCon, void *connRefCon)
+{
+    PmInternal *midi;
+    midi_macosxcm_type m;
+    PmEvent event;
+    MIDIPacket *packet;
+    unsigned int packetIndex;
+    unsigned long now;
+    unsigned int status;
+    
+#ifdef CM_DEBUG
+    printf("readProc: numPackets %d: ", newPackets->numPackets);
+#endif
+
+    /* Retrieve the context for this connection */
+    midi = (PmInternal *) connRefCon;
+    m = (midi_macosxcm_type) midi->descriptor;
+    assert(m);
+    
+    /* synchronize time references every 100ms */
+    now = (*midi->time_proc)(midi->time_info);
+    if (m->first_message || m->sync_time + 100 /*ms*/ < now) { 
+        /* time to resync */
+        now = midi_synchronize(midi);
+        m->first_message = FALSE;
+    }
+    
+    packet = (MIDIPacket *) &newPackets->packet[0];
+    /* printf("readproc packet status %x length %d\n", packet->data[0], 
+               packet->length); */
+    for (packetIndex = 0; packetIndex < newPackets->numPackets; packetIndex++) {
+        /* Set the timestamp and dispatch this message */
+        event.timestamp = 
+                (AudioConvertHostTimeToNanos(packet->timeStamp) - m->delta) / 
+                (UInt64) 1000000;
+        status = packet->data[0];
+        /* process packet as sysex data if it begins with MIDI_SYSEX, or
+           MIDI_EOX or non-status byte with no running status */
+#ifdef CM_DEBUG
+        printf(" %d", packet->length);
+#endif
+        if (status == MIDI_SYSEX || status == MIDI_EOX || 
+            ((!(status & MIDI_STATUS_MASK)) && !m->last_command)) {
+	    /* previously was: !(status & MIDI_STATUS_MASK)) {
+             * but this could mistake running status for sysex data
+             */
+            /* reset running status data -cpr */
+	    m->last_command = 0;
+	    m->last_msg_length = 0;
+            /* printf("sysex packet length: %d\n", packet->length); */
+            pm_read_bytes(midi, packet->data, packet->length, event.timestamp);
+        } else {
+            process_packet(packet, &event, midi, m);
+	}
+        packet = MIDIPacketNext(packet);
+    }
+#ifdef CM_DEBUG
+    printf("\n");
+#endif
+}
+
+static PmError
+midi_in_open(PmInternal *midi, void *driverInfo)
+{
+    MIDIEndpointRef endpoint;
+    midi_macosxcm_type m;
+    OSStatus macHostError;
+    
+    /* insure that we have a time_proc for timing */
+    if (midi->time_proc == NULL) {
+        if (!Pt_Started()) 
+            Pt_Start(1, 0, 0);
+        /* time_get does not take a parameter, so coerce */
+        midi->time_proc = (PmTimeProcPtr) Pt_Time;
+    }
+    
+    endpoint = (MIDIEndpointRef) descriptors[midi->device_id].descriptor;
+    if (endpoint == NULL) {
+        return pmInvalidDeviceId;
+    }
+
+    m = (midi_macosxcm_type) pm_alloc(sizeof(midi_macosxcm_node)); /* create */
+    midi->descriptor = m;
+    if (!m) {
+        return pmInsufficientMemory;
+    }
+    m->error[0] = 0;
+    m->callback_error[0] = 0;
+    m->sync_time = 0;
+    m->delta = 0;
+    m->last_time = 0;
+    m->first_message = TRUE;
+    m->sysex_mode = FALSE;
+    m->sysex_word = 0;
+    m->sysex_byte_count = 0;
+    m->packetList = NULL;
+    m->packet = NULL;
+    m->last_command = 0;
+    m->last_msg_length = 0;
+
+    macHostError = MIDIPortConnectSource(portIn, endpoint, midi);
+    if (macHostError != noErr) {
+        pm_hosterror = macHostError;
+        sprintf(pm_hosterror_text, 
+                "Host error %ld: MIDIPortConnectSource() in midi_in_open()",
+                macHostError);
+        midi->descriptor = NULL;
+        pm_free(m);
+        return pmHostError;
+    }
+    
+    return pmNoError;
+}
+
+static PmError
+midi_in_close(PmInternal *midi)
+{
+    MIDIEndpointRef endpoint;
+    OSStatus macHostError;
+    PmError err = pmNoError;
+    
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    
+    if (!m) return pmBadPtr;
+
+    endpoint = (MIDIEndpointRef) descriptors[midi->device_id].descriptor;
+    if (endpoint == NULL) {
+        pm_hosterror = pmBadPtr;
+    }
+    
+    /* shut off the incoming messages before freeing data structures */
+    macHostError = MIDIPortDisconnectSource(portIn, endpoint);
+    if (macHostError != noErr) {
+        pm_hosterror = macHostError;
+        sprintf(pm_hosterror_text, 
+                "Host error %ld: MIDIPortDisconnectSource() in midi_in_close()",
+                macHostError);
+        err = pmHostError;
+    }
+    
+    midi->descriptor = NULL;
+    pm_free(midi->descriptor);
+    
+    return err;
+}
+
+
+static PmError
+midi_out_open(PmInternal *midi, void *driverInfo)
+{
+    midi_macosxcm_type m;
+
+    m = (midi_macosxcm_type) pm_alloc(sizeof(midi_macosxcm_node)); /* create */
+    midi->descriptor = m;
+    if (!m) {
+        return pmInsufficientMemory;
+    }
+    m->error[0] = 0;
+    m->callback_error[0] = 0;
+    m->sync_time = 0;
+    m->delta = 0;
+    m->last_time = 0;
+    m->first_message = TRUE;
+    m->sysex_mode = FALSE;
+    m->sysex_word = 0;
+    m->sysex_byte_count = 0;
+    m->packetList = (MIDIPacketList *) m->packetBuffer;
+    m->packet = NULL;
+    m->last_command = 0;
+    m->last_msg_length = 0;
+
+    return pmNoError;
+}
+
+
+static PmError
+midi_out_close(PmInternal *midi)
+{
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    if (!m) return pmBadPtr;
+    
+    midi->descriptor = NULL;
+    pm_free(midi->descriptor);
+    
+    return pmNoError;
+}
+
+static PmError
+midi_abort(PmInternal *midi)
+{
+    PmError err = pmNoError;
+    OSStatus macHostError;
+    MIDIEndpointRef endpoint =
+            (MIDIEndpointRef) descriptors[midi->device_id].descriptor;
+    macHostError = MIDIFlushOutput(endpoint);
+    if (macHostError != noErr) {
+        pm_hosterror = macHostError;
+        sprintf(pm_hosterror_text,
+                "Host error %ld: MIDIFlushOutput()", macHostError);
+        err = pmHostError;
+    }
+    return err;
+}
+
+
+static PmError
+midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
+{
+    OSStatus macHostError;
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    MIDIEndpointRef endpoint = 
+            (MIDIEndpointRef) descriptors[midi->device_id].descriptor;
+    assert(m);
+    assert(endpoint);
+    if (m->packet != NULL) {
+        /* out of space, send the buffer and start refilling it */
+        macHostError = MIDISend(portOut, endpoint, m->packetList);
+        m->packet = NULL; /* indicate no data in packetList now */
+        if (macHostError != noErr) goto send_packet_error;
+    }
+    return pmNoError;
+    
+send_packet_error:
+    pm_hosterror = macHostError;
+    sprintf(pm_hosterror_text, 
+            "Host error %ld: MIDISend() in midi_write()",
+            macHostError);
+    return pmHostError;
+
+}
+
+
+static PmError
+send_packet(PmInternal *midi, Byte *message, unsigned int messageLength, 
+            MIDITimeStamp timestamp)
+{
+    PmError err;
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    assert(m);
+    
+    /* printf("add %d to packet %lx len %d\n", message[0], m->packet, messageLength); */
+    m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer), 
+                                  m->packet, timestamp, messageLength, 
+                                  message);
+    if (m->packet == NULL) {
+        /* out of space, send the buffer and start refilling it */
+        /* make midi->packet non-null to fool midi_write_flush into sending */
+        m->packet = (MIDIPacket *) 4; 
+        if ((err = midi_write_flush(midi, timestamp)) != pmNoError) return err;
+        m->packet = MIDIPacketListInit(m->packetList);
+        assert(m->packet); /* if this fails, it's a programming error */
+        m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
+                                      m->packet, timestamp, messageLength, 
+                                      message);
+        assert(m->packet); /* can't run out of space on first message */           
+    }
+    return pmNoError;
+}    
+
+
+static PmError
+midi_write_short(PmInternal *midi, PmEvent *event)
+{
+    long when = event->timestamp;
+    long what = event->message;
+    MIDITimeStamp timestamp;
+    UInt64 when_ns;
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    Byte message[4];
+    unsigned int messageLength;
+
+    if (m->packet == NULL) {
+        m->packet = MIDIPacketListInit(m->packetList);
+        /* this can never fail, right? failure would indicate something 
+           unrecoverable */
+        assert(m->packet);
+    }
+    
+    /* compute timestamp */
+    if (when == 0) when = midi->now;
+    /* if latency == 0, midi->now is not valid. We will just set it to zero */
+    if (midi->latency == 0) when = 0;
+    when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + m->delta;
+    /* make sure we don't go backward in time */
+    if (when_ns < m->last_time) when_ns = m->last_time;
+    m->last_time = when_ns;
+    timestamp = (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns);
+
+    message[0] = Pm_MessageStatus(what);
+    message[1] = Pm_MessageData1(what);
+    message[2] = Pm_MessageData2(what);
+    messageLength = midi_length(what);
+        
+    /* Add this message to the packet list */
+    return send_packet(midi, message, messageLength, timestamp);
+}
+
+
+static PmError 
+midi_begin_sysex(PmInternal *midi, PmTimestamp when)
+{
+    UInt64 when_ns;
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    assert(m);
+    m->sysex_byte_count = 0;
+    
+    /* compute timestamp */
+    if (when == 0) when = midi->now;
+    /* if latency == 0, midi->now is not valid. We will just set it to zero */
+    if (midi->latency == 0) when = 0;
+    when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + m->delta;
+    m->sysex_timestamp = (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns);
+
+    if (m->packet == NULL) {
+        m->packet = MIDIPacketListInit(m->packetList);
+        /* this can never fail, right? failure would indicate something 
+           unrecoverable */
+        assert(m->packet);
+    }
+    return pmNoError;
+}
+
+
+static PmError
+midi_end_sysex(PmInternal *midi, PmTimestamp when)
+{
+    PmError err;
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    assert(m);
+    
+    /* make sure we don't go backward in time */
+    if (m->sysex_timestamp < m->last_time) m->sysex_timestamp = m->last_time;
+    
+    /* now send what's in the buffer */
+    err = send_packet(midi, m->sysex_buffer, m->sysex_byte_count,
+                      m->sysex_timestamp);
+    m->sysex_byte_count = 0;
+    if (err != pmNoError) {
+        m->packet = NULL; /* flush everything in the packet list */
+        return err;
+    }
+    return pmNoError;
+}
+
+
+static PmError
+midi_write_byte(PmInternal *midi, unsigned char byte, PmTimestamp timestamp)
+{
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    assert(m);
+    if (m->sysex_byte_count >= SYSEX_BUFFER_SIZE) {
+        PmError err = midi_end_sysex(midi, timestamp);
+        if (err != pmNoError) return err;
+    }
+    m->sysex_buffer[m->sysex_byte_count++] = byte;
+    return pmNoError;
+}
+
+
+static PmError
+midi_write_realtime(PmInternal *midi, PmEvent *event)
+{
+    /* to send a realtime message during a sysex message, first
+       flush all pending sysex bytes into packet list */
+    PmError err = midi_end_sysex(midi, 0);
+    if (err != pmNoError) return err;
+    /* then we can just do a normal midi_write_short */
+    return midi_write_short(midi, event);
+}
+
+static unsigned int midi_has_host_error(PmInternal *midi)
+{
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    return (m->callback_error[0] != 0) || (m->error[0] != 0);
+}
+
+
+static void midi_get_host_error(PmInternal *midi, char *msg, unsigned int len)
+{
+    midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
+    msg[0] = 0; /* initialize to empty string */
+    if (m) { /* make sure there is an open device to examine */
+        if (m->error[0]) {
+            strncpy(msg, m->error, len);
+            m->error[0] = 0; /* clear the error */
+        } else if (m->callback_error[0]) {
+            strncpy(msg, m->callback_error, len);
+            m->callback_error[0] = 0; /* clear the error */
+        }
+        msg[len - 1] = 0; /* make sure string is terminated */
+    }
+}
+
+
+MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp)
+{
+    UInt64 nanos;
+    if (timestamp <= 0) {
+        return (MIDITimeStamp)0;
+    } else {
+        nanos = (UInt64)timestamp * (UInt64)1000000;
+        return (MIDITimeStamp)AudioConvertNanosToHostTime(nanos);
+    }
+}
+
+PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp)
+{
+    UInt64 nanos;
+    nanos = AudioConvertHostTimeToNanos(timestamp);
+    return (PmTimestamp)(nanos / (UInt64)1000000);
+}
+
+
+//
+// Code taken from http://developer.apple.com/qa/qa2004/qa1374.html
+//////////////////////////////////////
+// Obtain the name of an endpoint without regard for whether it has connections.
+// The result should be released by the caller.
+CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal)
+{
+  CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
+  CFStringRef str;
+  
+  // begin with the endpoint's name
+  str = NULL;
+  MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &str);
+  if (str != NULL) {
+    CFStringAppend(result, str);
+    CFRelease(str);
+  }
+  
+  MIDIEntityRef entity = NULL;
+  MIDIEndpointGetEntity(endpoint, &entity);
+  if (entity == NULL)
+    // probably virtual
+    return result;
+  
+  if (CFStringGetLength(result) == 0) {
+    // endpoint name has zero length -- try the entity
+    str = NULL;
+    MIDIObjectGetStringProperty(entity, kMIDIPropertyName, &str);
+    if (str != NULL) {
+      CFStringAppend(result, str);
+      CFRelease(str);
+    }
+  }
+  // now consider the device's name
+  MIDIDeviceRef device = NULL;
+  MIDIEntityGetDevice(entity, &device);
+  if (device == NULL)
+    return result;
+  
+  str = NULL;
+  MIDIObjectGetStringProperty(device, kMIDIPropertyName, &str);
+  if (CFStringGetLength(result) == 0) {
+      CFRelease(result);
+      return str;
+  }
+  if (str != NULL) {
+    // if an external device has only one entity, throw away
+    // the endpoint name and just use the device name
+    if (isExternal && MIDIDeviceGetNumberOfEntities(device) < 2) {
+      CFRelease(result);
+      return str;
+    } else {
+      if (CFStringGetLength(str) == 0) {
+        CFRelease(str);
+        return result;
+      }
+      // does the entity name already start with the device name?
+      // (some drivers do this though they shouldn't)
+      // if so, do not prepend
+        if (CFStringCompareWithOptions( result, /* endpoint name */
+             str /* device name */,
+             CFRangeMake(0, CFStringGetLength(str)), 0) != kCFCompareEqualTo) {
+        // prepend the device name to the entity name
+        if (CFStringGetLength(result) > 0)
+          CFStringInsert(result, 0, CFSTR(" "));
+        CFStringInsert(result, 0, str);
+      }
+      CFRelease(str);
+    }
+  }
+  return result;
+}
+
+
+// Obtain the name of an endpoint, following connections.
+// The result should be released by the caller.
+static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
+{
+  CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
+  CFStringRef str;
+  OSStatus err;
+  int i;
+  
+  // Does the endpoint have connections?
+  CFDataRef connections = NULL;
+  int nConnected = 0;
+  bool anyStrings = false;
+  err = MIDIObjectGetDataProperty(endpoint, kMIDIPropertyConnectionUniqueID, &connections);
+  if (connections != NULL) {
+    // It has connections, follow them
+    // Concatenate the names of all connected devices
+    nConnected = CFDataGetLength(connections) / sizeof(MIDIUniqueID);
+    if (nConnected) {
+      const SInt32 *pid = (const SInt32 *)(CFDataGetBytePtr(connections));
+      for (i = 0; i < nConnected; ++i, ++pid) {
+        MIDIUniqueID id = EndianS32_BtoN(*pid);
+        MIDIObjectRef connObject;
+        MIDIObjectType connObjectType;
+        err = MIDIObjectFindByUniqueID(id, &connObject, &connObjectType);
+        if (err == noErr) {
+          if (connObjectType == kMIDIObjectType_ExternalSource  ||
+              connObjectType == kMIDIObjectType_ExternalDestination) {
+            // Connected to an external device's endpoint (10.3 and later).
+            str = EndpointName((MIDIEndpointRef)(connObject), true);
+          } else {
+            // Connected to an external device (10.2) (or something else, catch-all)
+            str = NULL;
+            MIDIObjectGetStringProperty(connObject, kMIDIPropertyName, &str);
+          }
+          if (str != NULL) {
+            if (anyStrings)
+              CFStringAppend(result, CFSTR(", "));
+            else anyStrings = true;
+            CFStringAppend(result, str);
+            CFRelease(str);
+          }
+        }
+      }
+    }
+    CFRelease(connections);
+  }
+  if (anyStrings)
+    return result;
+  
+  // Here, either the endpoint had no connections, or we failed to obtain names for any of them.
+  return EndpointName(endpoint, false);
+}
+
+
+char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
+{
+#ifdef OLDCODE
+    MIDIEntityRef entity;
+    MIDIDeviceRef device;
+
+    CFStringRef endpointName = NULL;
+    CFStringRef deviceName = NULL;
+#endif
+    CFStringRef fullName = NULL;
+    CFStringEncoding defaultEncoding;
+    char* newName;
+
+    /* get the default string encoding */
+    defaultEncoding = CFStringGetSystemEncoding();
+
+    fullName = ConnectedEndpointName(endpoint);
+    
+#ifdef OLDCODE
+    /* get the entity and device info */
+    MIDIEndpointGetEntity(endpoint, &entity);
+    MIDIEntityGetDevice(entity, &device);
+
+    /* create the nicely formated name */
+    MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &endpointName);
+    MIDIObjectGetStringProperty(device, kMIDIPropertyName, &deviceName);
+    if (deviceName != NULL) {
+        fullName = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@: %@"),
+                                            deviceName, endpointName);
+    } else {
+        fullName = endpointName;
+    }
+#endif    
+    /* copy the string into our buffer */
+    newName = (char *) malloc(CFStringGetLength(fullName) + 1);
+    CFStringGetCString(fullName, newName, CFStringGetLength(fullName) + 1,
+                       defaultEncoding);
+
+    /* clean up */
+#ifdef OLDCODE
+    if (endpointName) CFRelease(endpointName);
+    if (deviceName) CFRelease(deviceName);
+#endif
+    if (fullName) CFRelease(fullName);
+
+    return newName;
+}
+
+ 
+
+pm_fns_node pm_macosx_in_dictionary = {
+    none_write_short,
+    none_sysex,
+    none_sysex,
+    none_write_byte,
+    none_write_short,
+    none_write_flush,
+    none_synchronize,
+    midi_in_open,
+    midi_abort,
+    midi_in_close,
+    success_poll,
+    midi_has_host_error,
+    midi_get_host_error,
+};
+
+pm_fns_node pm_macosx_out_dictionary = {
+    midi_write_short,
+    midi_begin_sysex,
+    midi_end_sysex,
+    midi_write_byte,
+    midi_write_realtime,
+    midi_write_flush,
+    midi_synchronize,
+    midi_out_open,
+    midi_abort,
+    midi_out_close,
+    success_poll,
+    midi_has_host_error,
+    midi_get_host_error,
+};
+
+
+PmError pm_macosxcm_init(void)
+{
+    ItemCount numInputs, numOutputs, numDevices;
+    MIDIEndpointRef endpoint;
+    int i;
+    OSStatus macHostError;
+    char *error_text;
+
+    /* Determine the number of MIDI devices on the system */
+    numDevices = MIDIGetNumberOfDevices();
+    numInputs = MIDIGetNumberOfSources();
+    numOutputs = MIDIGetNumberOfDestinations();
+
+    /* Return prematurely if no devices exist on the system
+       Note that this is not an error. There may be no devices.
+       Pm_CountDevices() will return zero, which is correct and
+       useful information
+     */
+    if (numDevices <= 0) {
+        return pmNoError;
+    }
+
+
+    /* Initialize the client handle */
+    macHostError = MIDIClientCreate(CFSTR("PortMidi"), NULL, NULL, &client);
+    if (macHostError != noErr) {
+        error_text = "MIDIClientCreate() in pm_macosxcm_init()";
+        goto error_return;
+    }
+
+    /* Create the input port */
+    macHostError = MIDIInputPortCreate(client, CFSTR("Input port"), readProc,
+                                          NULL, &portIn);
+    if (macHostError != noErr) {
+        error_text = "MIDIInputPortCreate() in pm_macosxcm_init()";
+        goto error_return;
+    }
+        
+    /* Create the output port */
+    macHostError = MIDIOutputPortCreate(client, CFSTR("Output port"), &portOut);
+    if (macHostError != noErr) {
+        error_text = "MIDIOutputPortCreate() in pm_macosxcm_init()";
+        goto error_return;
+    }
+
+    /* Iterate over the MIDI input devices */
+    for (i = 0; i < numInputs; i++) {
+        endpoint = MIDIGetSource(i);
+        if (endpoint == NULL) {
+            continue;
+        }
+
+        /* set the first input we see to the default */
+        if (pm_default_input_device_id == -1)
+            pm_default_input_device_id = pm_descriptor_index;
+        
+        /* Register this device with PortMidi */
+        pm_add_device("CoreMIDI", cm_get_full_endpoint_name(endpoint),
+                      TRUE, (void*)endpoint, &pm_macosx_in_dictionary);
+    }
+
+    /* Iterate over the MIDI output devices */
+    for (i = 0; i < numOutputs; i++) {
+        endpoint = MIDIGetDestination(i);
+        if (endpoint == NULL) {
+            continue;
+        }
+
+        /* set the first output we see to the default */
+        if (pm_default_output_device_id == -1)
+            pm_default_output_device_id = pm_descriptor_index;
+
+        /* Register this device with PortMidi */
+        pm_add_device("CoreMIDI", cm_get_full_endpoint_name(endpoint),
+                      FALSE, (void*)endpoint, &pm_macosx_out_dictionary);
+    }
+    return pmNoError;
+    
+error_return:
+    pm_hosterror = macHostError;
+    sprintf(pm_hosterror_text, "Host error %ld: %s\n", macHostError, error_text);
+    pm_macosxcm_term(); /* clear out any opened ports */
+    return pmHostError;
+}
+
+void pm_macosxcm_term(void)
+{
+    if (client != NULL)	 MIDIClientDispose(client);
+    if (portIn != NULL)	 MIDIPortDispose(portIn);
+    if (portOut != NULL) MIDIPortDispose(portOut);
+}
diff --git a/lib-src/portmidi/pm_mac/pmmacosxcm.h b/lib-src/portmidi/pm_mac/pmmacosxcm.h
new file mode 100644
index 0000000..ea79902
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/pmmacosxcm.h
@@ -0,0 +1,6 @@
+/* system-specific definitions */
+
+PmError pm_macosxcm_init(void);
+void pm_macosxcm_term(void);
+
+PmDeviceID find_default_device(char *path, int input, PmDeviceID id);
diff --git a/lib-src/portmidi/pm_mac/readbinaryplist.c b/lib-src/portmidi/pm_mac/readbinaryplist.c
new file mode 100644
index 0000000..d696497
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/readbinaryplist.c
@@ -0,0 +1,1079 @@
+/*
+
+readbinaryplist.c -- Roger B. Dannenberg, Jun 2008
+Based on ReadBinaryPList.m by Jens Ayton, 2007
+
+Here are his comments:
+
+Reader for binary property list files (version 00).
+
+This has been found to work on all 566 binary plists in my ~/Library/Preferences/
+and /Library/Preferences/ directories. This probably does not provide full
+test coverage. It has also been found to provide different data to Apple's
+implementation when presented with a key-value archive. This is because Apple's
+implementation produces undocumented CFKeyArchiverUID objects. My implementation
+produces dictionaries instead, matching the in-file representation used in XML
+and OpenStep plists. See extract_uid().
+
+Full disclosure: in implementing this software, I read one comment and one
+struct defintion in CFLite, Apple's implementation, which is under the APSL
+license. I also deduced the information about CFKeyArchiverUID from that code.
+However, none of the implementation was copied.
+
+Copyright (C) 2007 Jens Ayton
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+*/
+
+/* A note about memory management:
+Strings and possibly other values are unique and because the values
+associated with IDs are cached, you end up with a directed graph rather
+than a tree. It is tricky to free the data because if you do a simple
+depth-first search to free nodes, you will free nodes twice. I decided
+to allocate memory from blocks of 1024 bytes and keep the blocks in a
+list associated with but private to this module. So the user should
+access this module by calling:
+    bplist_read_file() or bplist_read_user_pref() or 
+    bplist_read_system_pref()
+which returns a value. When you are done with the value, call
+    bplist_free_data()
+This will of course free the value_ptr returned by bplist_read_*()
+
+To deal with memory exhaustion (what happens when malloc returns
+NULL?), use setjmp/longjmp -- a single setjmp protects the whole
+parser, and allocate uses longjmp to abort. After abort, memory
+is freed and NULL is returned to caller. There is not much here
+in the way of error reporting.
+
+Memory is obtained by calling allocate which either returns the
+memory requested or calls longjmp, so callers don't have to check.
+
+*/
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include "readbinaryplist.h"
+#include <Carbon/Carbon.h>
+#define BPLIST_LOG_VERBOSE 1
+#define NO 0
+#define YES 1
+#define BOOL int
+
+#define MAXPATHLEN 256
+/* #define BPLIST_LOG_VERBOSE 1 */
+
+#if BPLIST_LOG_VERBOSE
+    #ifndef BPLIST_LOG
+        #define BPLIST_LOG 1
+    #endif
+#endif
+
+#if BPLIST_LOG
+    #define bplist_log printf
+#else
+    #define bplist_log(...)
+#endif
+
+#if BPLIST_LOG_VERBOSE
+    #define bplist_log_verbose bplist_log
+#else
+    #define bplist_log_verbose(...)
+#endif
+
+
+/********* MEMORY MANAGEMENT ********/
+#define BLOCK_SIZE 1024
+// memory is aligned to multiples of this; assume malloc automatically
+// aligns to this number and assume this number is > sizeof(void *)
+#define ALIGNMENT 8
+static void *block_list = NULL;
+static char *free_ptr = NULL;
+static char *end_ptr = NULL;
+static jmp_buf abort_parsing;
+
+static void *allocate(size_t size)
+{
+    void *result;
+    if (free_ptr + size > end_ptr) {
+        size_t how_much = BLOCK_SIZE;
+        // align everything to 8 bytes
+        if (size > BLOCK_SIZE - ALIGNMENT) {
+            how_much = size + ALIGNMENT;
+        }
+        result = malloc(how_much);
+        if (result == NULL) {
+            /* serious problem */
+            longjmp(abort_parsing, 1);
+        }
+        *((void **)result) = block_list;
+        block_list = result;
+        free_ptr = ((char *) result) + ALIGNMENT;
+        end_ptr = ((char *) result) + how_much;
+    }
+    // now, there is enough rooom at free_ptr
+    result = free_ptr;
+    free_ptr += size;
+    return result;
+}
+
+void bplist_free_data()
+{
+    while (block_list) {
+        void *next = *(void **)block_list;
+        free(block_list);
+        block_list = next;
+    }
+    free_ptr = NULL;
+    end_ptr = NULL;
+}
+
+// layout of trailer -- last 32 bytes in plist data
+    uint8_t unused[6];
+    uint8_t offset_int_size;
+    uint8_t object_ref_size;
+    uint64_t object_count;
+    uint64_t top_level_object;
+    uint64_t offset_table_offset;
+
+
+enum
+{
+    kHEADER_SIZE = 8,
+    kTRAILER_SIZE = 32, //sizeof(bplist_trailer_node),
+    kMINIMUM_SANE_SIZE = kHEADER_SIZE + kTRAILER_SIZE
+};
+
+
+static const char kHEADER_BYTES[kHEADER_SIZE] = "bplist00";
+
+// map from UID key to previously parsed value
+typedef struct cache_struct {
+    uint64_t key;
+    value_ptr value;
+    struct cache_struct *next;
+} cache_node, *cache_ptr;
+
+
+typedef struct bplist_info
+{
+    uint64_t object_count;
+    const uint8_t *data_bytes;
+    uint64_t length;
+    uint64_t offset_table_offset;
+    uint8_t offset_int_size;
+    uint8_t object_ref_size;
+    cache_ptr cache;
+} bplist_info_node, *bplist_info_ptr;
+
+
+static value_ptr bplist_read_pldata(pldata_ptr data);
+static value_ptr bplist_read_pref(char *filename, OSType folder_type);
+static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset, uint8_t size);
+static uint64_t read_offset(bplist_info_ptr bplist, uint64_t index);
+static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset, uint64_t *outValue, size_t *outSize);
+
+static value_ptr extract_object(bplist_info_ptr bplist, uint64_t objectRef);
+static value_ptr extract_simple(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_int(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_real(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_data(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_ascii_string(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_unicode_string(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_uid(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset);
+static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset);
+
+
+value_ptr value_create()
+{
+    value_ptr value = (value_ptr) allocate(sizeof(value_node));
+    return value;
+}
+
+
+void value_set_integer(value_ptr v, int64_t i) {
+    v->tag = kTAG_INT; v->integer = i;
+}
+
+void value_set_real(value_ptr v, double d) {
+    v->tag = kTAG_REAL; v->real = d;
+}
+
+// d is seconds since 1 January 2001
+void value_set_date(value_ptr v, double d) {
+    v->tag = kTAG_DATE; v->real = d;
+}
+
+void value_set_ascii_string(value_ptr v, const uint8_t *s, size_t len) {
+    v->tag = kTAG_ASCIISTRING;
+    v->string = (char *) allocate(len + 1);
+    memcpy(v->string, s, len);
+    v->string[len] = 0;
+}
+
+void value_set_unicode_string(value_ptr v, const uint8_t *s, size_t len) {
+    v->tag = kTAG_UNICODESTRING;
+    v->string = (char *) allocate(len + 1);
+    memcpy(v->string, s, len);
+    v->string[len] = 0;
+}
+
+void value_set_uid(value_ptr v, uint64_t uid)
+{
+    v->tag = kTAG_UID; v->uinteger = uid;
+}
+
+// value->data points to a pldata that points to the actual bytes
+// the bytes are copied, so caller must free byte source (*data)
+void value_set_data(value_ptr v, const uint8_t *data, size_t len) {
+    v->tag = kTAG_DATA;
+    pldata_ptr pldata = (pldata_ptr) allocate(sizeof(pldata_node));
+    pldata->data = (uint8_t *) allocate(len);
+    memcpy(pldata->data, data, len);
+    pldata->len = len;
+    v->data = pldata;
+    printf("value at %p gets data at %p\n", v, pldata);
+}
+
+// caller releases ownership of array to value_ptr v
+void value_set_array(value_ptr v, value_ptr *array, size_t length) {
+    array_ptr a = (array_ptr) allocate(sizeof(array_node));
+    a->array = array;
+    a->length = length;
+    v->tag = kTAG_ARRAY;
+    v->array = a;
+}
+
+// caller releases ownership of dict to value_ptr v
+void value_set_dict(value_ptr v, dict_ptr dict) {
+    v->tag = kTAG_DICTIONARY;
+    v->dict = dict;
+}
+
+
+// look up an objectref in the cache, a ref->value_ptr mapping
+value_ptr cache_lookup(cache_ptr cache, uint64_t ref)
+{
+    while (cache) {
+        if (cache->key == ref) {
+            return cache->value;
+        }
+        cache = cache->next;
+    }
+    return NULL;
+}
+
+
+// insert an objectref and value in the cache
+void cache_insert(cache_ptr *cache, uint64_t ref, value_ptr value)
+{
+    cache_ptr c = (cache_ptr) allocate(sizeof(cache_node));
+    c->key = ref;
+    c->value = value;
+    c->next = *cache;
+    *cache = c;
+}
+
+
+// insert an objectref and value in a dictionary
+void dict_insert(dict_ptr *dict, value_ptr key, value_ptr value)
+{
+    dict_ptr d = (dict_ptr) allocate(sizeof(dict_node));
+    d->key = key;
+    d->value = value;
+    d->next = *dict;
+    *dict = d;
+}
+
+
+BOOL is_binary_plist(pldata_ptr data)
+{
+    if (data->len < kMINIMUM_SANE_SIZE)  return NO;
+    return memcmp(data->data, kHEADER_BYTES, kHEADER_SIZE) == 0;
+}
+
+
+value_ptr bplist_read_file(char *filename)
+{
+    struct stat stbuf;
+    pldata_node pldata;
+    FILE *file;
+    size_t n;
+    value_ptr value;
+    int rslt = stat(filename, &stbuf);
+    if (rslt) {
+        perror("in stat: ");
+        bplist_log("Could not stat %s, error %d\n", filename, rslt);
+        return NULL;
+    }
+    pldata.len = stbuf.st_size;
+    // note: this is supposed to be malloc, not allocate. It is separate
+    // from the graph structure, large, and easy to free right after
+    // parsing.
+    pldata.data = (uint8_t *) malloc(pldata.len);
+    if (!pldata.data) {
+        bplist_log("Could not allocate %d bytes for %s\n",
+                   (long) pldata.len, filename);
+        return NULL;
+    }
+    file = fopen(filename, "rb");
+    if (!file) {
+        bplist_log("Could not open %s\n", filename);
+        return NULL;
+    }
+    n = fread(pldata.data, 1, pldata.len, file);
+    if (n != pldata.len) {
+        bplist_log("Error reading from %s\n", filename);
+        return NULL;
+    }
+    value = bplist_read_pldata(&pldata);
+    free(pldata.data);
+    return value;
+}
+
+
+value_ptr bplist_read_pref(char *filename, OSType folder_type)
+{
+    FSRef prefdir;
+    char cstr[MAXPATHLEN];
+
+    OSErr err = FSFindFolder(kOnAppropriateDisk, folder_type,
+                             FALSE, &prefdir);
+    if (err) {
+        bplist_log("Error finding preferences folder: %d\n", err);
+        return NULL;
+    }
+    err = FSRefMakePath(&prefdir, (UInt8 *) cstr, (UInt32) (MAXPATHLEN - 1));
+    if (err) {
+        bplist_log("Error making path name for preferences folder: %d\n", err);
+        return NULL;
+    }
+    strlcat(cstr, "/", MAXPATHLEN);
+    strlcat(cstr, filename, MAXPATHLEN);
+    return bplist_read_file(cstr);
+}
+
+
+value_ptr bplist_read_system_pref(char *filename) {
+    return bplist_read_pref(filename, kSystemPreferencesFolderType);
+}
+
+
+value_ptr bplist_read_user_pref(char *filename) {
+    return bplist_read_pref(filename, kPreferencesFolderType);
+}
+
+
+// data is stored with high-order bytes first.
+// read from plist data in a machine-independent fashion
+//
+uint64_t convert_uint64(uint8_t *ptr)
+{
+    uint64_t rslt = 0;
+    int i;
+    // shift in bytes, high-order first
+    for (i = 0; i < sizeof(uint64_t); i++) {
+        rslt <<= 8;
+        rslt += ptr[i];
+    }
+    return rslt;
+}
+
+
+value_ptr bplist_read_pldata(pldata_ptr data)
+{
+    value_ptr result = NULL;
+    bplist_info_node bplist;
+    uint8_t *ptr;
+    uint64_t top_level_object;
+    int i;
+
+    if (data == NULL)  return NULL;
+    if (!is_binary_plist(data)) {
+        bplist_log("Bad binary plist: too short or invalid header.\n");
+        return NULL;
+    }
+        
+    // read trailer
+    ptr = (uint8_t *) (data->data + data->len - kTRAILER_SIZE);
+    bplist.offset_int_size = ptr[6];
+    bplist.object_ref_size = ptr[7];
+    bplist.object_count = convert_uint64(ptr + 8);
+    top_level_object = convert_uint64(ptr + 16);
+    bplist.offset_table_offset = convert_uint64(ptr + 24);
+        
+    // Basic sanity checks
+    if (bplist.offset_int_size < 1 || bplist.offset_int_size > 8 ||
+        bplist.object_ref_size < 1 || bplist.object_ref_size > 8 ||
+        bplist.offset_table_offset < kHEADER_SIZE) {
+        bplist_log("Bad binary plist: trailer declared insane.\n");
+        return NULL;                
+    }
+        
+    // Ensure offset table is inside file
+    uint64_t offsetTableSize = bplist.offset_int_size * bplist.object_count;
+    if (offsetTableSize + bplist.offset_table_offset + kTRAILER_SIZE > 
+        data->len) {
+        bplist_log("Bad binary plist: offset table overlaps end of container.\n");
+        return NULL;
+    }
+        
+    bplist.data_bytes = data->data;
+    bplist.length = data->len;
+    bplist.cache = NULL; /* dictionary is empty */
+
+    bplist_log_verbose("Got a sane bplist with %llu items, offset_int_size: %u, object_ref_size: %u\n", 
+                      bplist.object_count, bplist.offset_int_size, 
+                      bplist.object_ref_size);
+    /* at this point, we are ready to do some parsing which allocates
+        memory for the result data structure. If memory allocation (using
+        allocate fails, a longjmp will return to here and we simply give up
+     */
+    i = setjmp(abort_parsing);
+    if (i == 0) {
+        result = extract_object(&bplist, top_level_object);
+    } else {
+        bplist_log("allocate() failed to allocate memory. Giving up.\n");
+        result = NULL;
+    }
+    if (!result) {
+        bplist_free_data();
+    }
+    return result;
+}
+
+
+static value_ptr extract_object(bplist_info_ptr bplist, uint64_t objectRef)
+{
+    uint64_t offset;
+    value_ptr result = NULL;
+    uint8_t objectTag;
+    
+    if (objectRef >= bplist->object_count) {
+        // Out-of-range object reference.
+        bplist_log("Bad binary plist: object index is out of range.\n");
+        return NULL;
+    }
+        
+    // Use cached object if it exists
+    result = cache_lookup(bplist->cache, objectRef);
+    if (result != NULL)  return result;
+        
+    // Otherwise, find object in file.
+    offset = read_offset(bplist, objectRef);
+    if (offset > bplist->length) {
+        // Out-of-range offset.
+        bplist_log("Bad binary plist: object outside container.\n");
+        return NULL;
+    }
+    objectTag = *(bplist->data_bytes + offset);
+    switch (objectTag & 0xF0) {
+    case kTAG_SIMPLE:
+        result = extract_simple(bplist, offset);
+        break;
+                
+    case kTAG_INT:
+        result = extract_int(bplist, offset);
+        break;
+                        
+    case kTAG_REAL:
+        result = extract_real(bplist, offset);
+        break;
+                        
+    case kTAG_DATE:
+        result = extract_date(bplist, offset);
+        break;
+                        
+    case kTAG_DATA:
+        result = extract_data(bplist, offset);
+        break;
+                        
+    case kTAG_ASCIISTRING:
+        result = extract_ascii_string(bplist, offset);
+        break;
+                        
+    case kTAG_UNICODESTRING:
+        result = extract_unicode_string(bplist, offset);
+        break;
+        
+    case kTAG_UID:
+        result = extract_uid(bplist, offset);
+        break;
+        
+    case kTAG_ARRAY:
+        result = extract_array(bplist, offset);
+        break;
+        
+    case kTAG_DICTIONARY:
+        result = extract_dictionary(bplist, offset);
+        break;
+        
+    default:
+        // Unknown tag.
+        bplist_log("Bad binary plist: unknown tag 0x%X.\n", 
+                   (objectTag & 0x0F) >> 4);
+        result = NULL;
+    }
+    
+    // Cache and return result.
+    if (result != NULL)  
+        cache_insert(&bplist->cache, objectRef, result);
+    return result;
+}
+
+
+static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset, 
+                               uint8_t size)
+{
+    assert(bplist->data_bytes != NULL && size >= 1 && size <= 8 && 
+           offset + size <= bplist->length);
+        
+    uint64_t result = 0;
+    const uint8_t *byte = bplist->data_bytes + offset;
+        
+    do {
+        // note that ints seem to be high-order first
+        result = (result << 8) | *byte++;
+    } while (--size);
+        
+    return result;
+}
+
+
+static uint64_t read_offset(bplist_info_ptr bplist, uint64_t index)
+{
+    assert(index < bplist->object_count);
+        
+    return read_sized_int(bplist, 
+            bplist->offset_table_offset + bplist->offset_int_size * index, 
+            bplist->offset_int_size);
+}
+
+
+static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset, 
+                             uint64_t *outValue, size_t *outSize)
+{
+    uint32_t size;
+    int64_t value;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    size = 1 << (bplist->data_bytes[offset] & 0x0F);
+    if (size > 8) {
+        // Maximum allowable size in this implementation is 1<<3 = 8 bytes.
+        // This also happens to be the biggest we can handle.
+        return NO;
+    }
+        
+    if (offset + 1 + size > bplist->length) {
+        // Out of range.
+        return NO;
+    }
+        
+    value = read_sized_int(bplist, offset + 1, size);
+    
+    if (outValue != NULL) *outValue = value;
+    if (outSize != NULL) *outSize = size + 1; // +1 for tag byte.
+    return YES;
+}
+
+
+static value_ptr extract_simple(bplist_info_ptr bplist, uint64_t offset)
+{
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+    value_ptr value = value_create();
+        
+    switch (bplist->data_bytes[offset]) {
+    case kVALUE_NULL:
+        value->tag = kVALUE_NULL;
+        return value;
+        
+    case kVALUE_TRUE:
+        value->tag = kVALUE_TRUE;
+        return value;
+                        
+    case kVALUE_FALSE:
+        value->tag = kVALUE_FALSE;
+        return value;
+    }
+        
+    // Note: kVALUE_FILLER is treated as invalid, because it, er, is.
+    bplist_log("Bad binary plist: invalid atom.\n");
+    free(value);
+    return NULL;
+}
+
+
+static value_ptr extract_int(bplist_info_ptr bplist, uint64_t offset)
+{
+    value_ptr value = value_create();
+    value->tag = kTAG_INT;
+
+    if (!read_self_sized_int(bplist, offset, &value->uinteger, NULL)) {
+        bplist_log("Bad binary plist: invalid integer object.\n");
+    }
+        
+    /* NOTE: originally, I sign-extended here. This was the wrong thing; it
+       turns out that negative ints are always stored as 64-bit, and smaller
+       ints are unsigned.
+    */
+    return value;
+}
+
+
+static value_ptr extract_real(bplist_info_ptr bplist, uint64_t offset)
+{
+    value_ptr value = value_create();
+    uint32_t size;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+    
+    size = 1 << (bplist->data_bytes[offset] & 0x0F);
+        
+    // FIXME: what to do if faced with other sizes for float/double?
+    assert (sizeof (float) == sizeof (uint32_t) && 
+            sizeof (double) == sizeof (uint64_t));
+        
+    if (offset + 1 + size > bplist->length) {
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                  "floating-point number");
+        free(value);
+        return NULL;
+    }
+        
+    if (size == sizeof (float)) {
+        uint32_t i = read_sized_int(bplist, offset + 1, size); 
+        // Note that this handles byte swapping.
+        value_set_real(value, *(float *)&i);
+        return value;
+    } else if (size == sizeof (double)) {
+        uint64_t i = read_sized_int(bplist, offset + 1, size);
+        // Note that this handles byte swapping.
+        value_set_real(value, *(double *)&i);
+        return value;
+    } else {
+        // Can't handle floats of other sizes.
+        bplist_log("Bad binary plist: can't handle %u-byte float.\n", size);
+        free(value);
+        return NULL;
+    }
+}
+
+
+static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset)
+{
+    value_ptr value;
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    // Data has size code like int and real, but only 3 (meaning 8 bytes) is valid.
+    if (bplist->data_bytes[offset] != kVALUE_FULLDATETAG) {
+        bplist_log("Bad binary plist: invalid size for date object.\n");
+        return NULL;
+    }
+        
+    if (offset + 1 + sizeof (double) > bplist->length) {
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                  "date");
+        return NULL;
+    }
+        
+    // FIXME: what to do if faced with other sizes for double?
+    assert (sizeof (double) == sizeof (uint64_t));
+        
+    uint64_t date = read_sized_int(bplist, offset + 1, sizeof(double));
+    // Note that this handles byte swapping.
+    value = value_create();
+    value_set_date(value, *(double *)&date);
+    return value;
+}
+
+
+uint64_t bplist_get_a_size(bplist_info_ptr bplist, 
+                           uint64_t *offset_ptr, char *msg)
+{
+    uint64_t size = bplist->data_bytes[*offset_ptr] & 0x0F;
+    (*offset_ptr)++;
+    if (size == 0x0F) {
+        // 0x0F means separate int size follows. 
+        // Smaller values are used for short data.
+        size_t extra; // the length of the data size we are about to read
+        if ((bplist->data_bytes[*offset_ptr] & 0xF0) != kTAG_INT) {
+            // Bad data, mistagged size int
+            bplist_log("Bad binary plist: %s object size is not tagged as int.\n",
+                       msg);
+            return UINT64_MAX; // error
+        }
+                
+        // read integer data as size, extra tells how many bytes to skip
+        if (!read_self_sized_int(bplist, *offset_ptr, &size, &extra)) {
+            bplist_log("Bad binary plist: invalid %s object size tag.\n", 
+                      "data");
+            return UINT64_MAX; // error
+        }
+        (*offset_ptr) += extra;
+    }
+
+    if (*offset_ptr + size > bplist->length) {
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                  "data");
+        return UINT64_MAX; // error
+    }
+    return size;
+}
+
+
+static value_ptr extract_data(bplist_info_ptr bplist, uint64_t offset)
+{
+    uint64_t size;
+    value_ptr value;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    if ((size = bplist_get_a_size(bplist, &offset, "data")) == UINT64_MAX) 
+        return NULL;
+        
+    value = value_create();
+    value_set_data(value, bplist->data_bytes + offset, size);
+    return value;
+}
+
+
+static value_ptr extract_ascii_string(bplist_info_ptr bplist, uint64_t offset)
+{
+    uint64_t size;
+    value_ptr value; // return value
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    if ((size = bplist_get_a_size(bplist, &offset, "ascii string")) ==
+        UINT64_MAX) 
+        return NULL;
+
+    value = value_create();
+    value_set_ascii_string(value, bplist->data_bytes + offset, size);
+    return value;
+}
+
+
+static value_ptr extract_unicode_string(bplist_info_ptr bplist, uint64_t offset)
+{
+    uint64_t size;
+    value_ptr value;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    if ((size = bplist_get_a_size(bplist, &offset, "unicode string")) == 
+        UINT64_MAX)
+        return NULL;
+        
+    value = value_create();
+    value_set_unicode_string(value, bplist->data_bytes + offset, size);
+    return value;
+}
+
+
+static value_ptr extract_uid(bplist_info_ptr bplist, uint64_t offset)
+{
+    /* UIDs are used by Cocoa's key-value coder.
+       When writing other plist formats, they are expanded to dictionaries of
+       the form <dict><key>CF$UID</key><integer>value</integer></dict>, so we
+       do the same here on reading. This results in plists identical to what
+       running plutil -convert xml1 gives us. However, this is not the same
+       result as [Core]Foundation's plist parser, which extracts them as un-
+       introspectable CF objects. In fact, it even seems to convert the CF$UID
+       dictionaries from XML plists on the fly.
+    */
+        
+    value_ptr value;
+    uint64_t uid;
+        
+    if (!read_self_sized_int(bplist, offset, &uid, NULL)) {
+        bplist_log("Bad binary plist: invalid UID object.\n");
+        return NULL;
+    }
+        
+    assert(NO); // original code suggests using a string for a key
+    // but our dictionaries all use big ints for keys, so I don't know
+    // what to do here
+
+    value = value_create();
+    value_set_uid(value, uid);
+    // return [NSDictionary dictionaryWithObject:
+    //         [NSNumber numberWithUnsignedLongLong:value] 
+    //         forKey:"CF$UID"];
+}
+
+
+static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset)
+{
+    uint64_t i, count;
+    uint64_t size;
+    uint64_t elementID;
+    value_ptr element = NULL;
+    value_ptr *array = NULL;
+    value_ptr value = NULL;
+    BOOL ok = YES;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+    if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
+        return NULL;
+        
+    if (count > UINT64_MAX / bplist->object_ref_size - offset) {
+        // Offset overflow.
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                   "array");
+        return NULL;
+    }
+        
+    size = bplist->object_ref_size * count;
+    if (size + offset > bplist->length) {
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                   "array");
+        return NULL;
+    }
+        
+    // got count, the number of array elements
+
+    value = value_create();
+    assert(value);
+
+    if (count == 0) {
+        value_set_array(value, array, count);
+        return value;
+    }
+        
+    array = allocate(sizeof(value_ptr) * count);
+        
+    for (i = 0; i != count; ++i) {
+        bplist_log_verbose("[%u]\n", i);
+        elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size, 
+                                 bplist->object_ref_size);
+        element = extract_object(bplist, elementID);
+        if (element != NULL) {
+            array[i] = element;
+        } else {
+            ok = NO;
+            break;
+        }
+    }
+    if (ok) {
+        value_set_array(value, array, count);
+    }
+
+    return value;
+}
+
+
+static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
+{
+    uint64_t i, count;
+    uint64_t size;
+    uint64_t elementID;
+    value_ptr value = NULL;
+    dict_ptr dict = NULL;
+    BOOL ok = YES;
+        
+    assert(bplist->data_bytes != NULL && offset < bplist->length);
+        
+        
+    if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
+        return NULL;
+
+    if (count > UINT64_MAX / (bplist->object_ref_size * 2) - offset) {
+        // Offset overflow.
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                   "dictionary");
+        return NULL;
+    }
+    
+    size = bplist->object_ref_size * count * 2;
+    if (size + offset > bplist->length) {
+        bplist_log("Bad binary plist: %s object overlaps end of container.\n", 
+                   "dictionary");
+        return NULL;
+    }
+    
+    value = value_create();
+    if (count == 0) {
+        value_set_dict(value, NULL);
+        return value;
+    }
+
+    for (i = 0; i != count; ++i) {
+        value_ptr key;
+        value_ptr val;
+        elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size, 
+                                 bplist->object_ref_size);
+        key = extract_object(bplist, elementID);
+        if (key != NULL) {
+            bplist_log_verbose("key: %p\n", key);
+        } else {
+            ok = NO;
+            break;
+        }
+                    
+        elementID = read_sized_int(bplist, 
+                            offset + (i + count) * bplist->object_ref_size, 
+                            bplist->object_ref_size);
+        val = extract_object(bplist, elementID);
+        if (val != NULL) {
+            dict_insert(&dict, key, val);
+        } else {
+            ok = NO;
+            break;
+        }
+    }
+    if (ok) {
+        value_set_dict(value, dict);
+    }
+    
+    return value;
+}
+
+/*************** functions for accessing values ****************/
+
+
+char *value_get_asciistring(value_ptr v)
+{
+    if (v->tag != kTAG_ASCIISTRING) return NULL;
+    return v->string;
+}
+
+
+value_ptr value_dict_lookup_using_string(value_ptr v, char *key)
+{
+    dict_ptr dict;
+    if (v->tag != kTAG_DICTIONARY) return NULL; // not a dictionary
+    dict = v->dict;
+    /* search for key */
+    while (dict) {
+        if (dict->key && dict->key->tag == kTAG_ASCIISTRING &&
+            strcmp(key, dict->key->string) == 0) { // found it
+            return dict->value;
+        }
+        dict = dict->next;
+    }
+    return NULL; /* not found */
+}
+
+value_ptr value_dict_lookup_using_path(value_ptr v, char *path)
+{
+    char key[MAX_KEY_SIZE];
+    while (*path) { /* more to the path */
+        int i = 0;
+        while (i < MAX_KEY_SIZE - 1) {
+            key[i] = *path++;
+            if (key[i] == '/') { /* end of entry in path */
+                key[i + 1] = 0;
+                break;
+            }
+            if (!key[i]) {
+                path--; /* back up to end of string char */
+                break;  /* this will cause outer loop to exit */
+            }
+            i++;
+        }
+        if (!v || v->tag != kTAG_DICTIONARY) return NULL;
+        /* now, look up the key to get next value */
+        v = value_dict_lookup_using_string(v, key);
+        if (v == NULL) return NULL;
+    }
+    return v;
+}
+                
+
+/*************** functions for debugging ***************/
+
+void plist_print(value_ptr v)
+{
+    size_t i;
+    int comma_needed;
+    dict_ptr dict;
+    if (!v) {
+        printf("NULL");
+        return;
+    }
+    switch (v->tag & 0xF0) {
+    case kTAG_SIMPLE:
+        switch (v->tag) {
+        case kVALUE_NULL: 
+            printf("NULL@%p", v); break;
+        case kVALUE_FALSE: 
+            printf("FALSE@%p", v); break;
+        case kVALUE_TRUE:
+            printf("TRUE@%p", v); break;
+        default:
+            printf("UNKNOWN tag=%x@%p", v->tag, v); break;
+        }
+        break;
+    case kTAG_INT:
+        printf("%lld@%p", v->integer, v); break;
+    case kTAG_REAL:
+        printf("%g@%p", v->real, v); break;
+    case kTAG_DATE:
+        printf("date:%g@%p", v->real, v); break;
+    case kTAG_DATA:
+        printf("data@%p->%p:[%p:", v, v->data, v->data->data);
+        for (i = 0; i < v->data->len; i++) {
+            printf(" %2x", v->data->data[i]);
+        }
+        printf("]"); break;
+    case kTAG_ASCIISTRING:
+        printf("%p:\"%s\"@%p", v->string, v->string, v); break;
+    case kTAG_UNICODESTRING:
+        printf("unicode:%p:\"%s\"@%p", v->string, v->string, v); break;
+    case kTAG_UID:
+        printf("UID:%llu@%p", v->uinteger, v); break;
+    case kTAG_ARRAY:
+        comma_needed = FALSE;
+        printf("%p->%p:[%p:", v, v->array, v->array->array);
+        for (i = 0; i < v->array->length; i++) {
+            if (comma_needed) printf(", ");
+            plist_print(v->array->array[i]);
+            comma_needed = TRUE;
+        }
+        printf("]"); break;
+    case kTAG_DICTIONARY:
+        comma_needed = FALSE;
+        printf("%p:[", v);
+        dict = v->dict;
+        while (dict) {
+            if (comma_needed) printf(", ");
+            printf("%p:", dict);
+            plist_print(dict->key);
+            printf("->");
+            plist_print(dict->value);
+            comma_needed = TRUE;
+            dict = dict->next;
+        }
+        printf("]"); break;
+    default:
+        printf("UNKNOWN tag=%x", v->tag);
+        break;
+    }
+}
+
+            
diff --git a/lib-src/portmidi/pm_mac/readbinaryplist.h b/lib-src/portmidi/pm_mac/readbinaryplist.h
new file mode 100644
index 0000000..c875920
--- /dev/null
+++ b/lib-src/portmidi/pm_mac/readbinaryplist.h
@@ -0,0 +1,86 @@
+/* readbinaryplist.h -- header to read preference files
+
+   Roger B. Dannenberg, Jun 2008
+*/
+
+#ifndef TRUE
+    #define TRUE 1
+    #define FALSE 0
+#endif
+
+#define MAX_KEY_SIZE 256
+
+enum
+{
+    // Object tags (high nybble)
+    kTAG_SIMPLE = 0x00,        // Null, true, false, filler, or invalid
+    kTAG_INT = 0x10,
+    kTAG_REAL = 0x20,
+    kTAG_DATE = 0x30,
+    kTAG_DATA = 0x40,
+    kTAG_ASCIISTRING = 0x50,
+    kTAG_UNICODESTRING = 0x60,
+    kTAG_UID = 0x80,
+    kTAG_ARRAY = 0xA0,
+    kTAG_DICTIONARY = 0xD0,
+    
+    // "simple" object values
+    kVALUE_NULL = 0x00,
+    kVALUE_FALSE = 0x08,
+    kVALUE_TRUE = 0x09,
+    kVALUE_FILLER = 0x0F,
+    
+    kVALUE_FULLDATETAG = 0x33        // Dates are tagged with a whole byte.
+};
+
+
+typedef struct {
+    uint8_t *data;
+    size_t len;
+} pldata_node, *pldata_ptr;
+
+
+typedef struct {
+    struct value_struct **array;
+    uint64_t length;
+} array_node, *array_ptr;
+
+
+// a dict_node is a list of <key, value> pairs
+typedef struct dict_struct {
+    struct value_struct *key;
+    struct value_struct *value;
+    struct dict_struct *next;
+} dict_node, *dict_ptr;
+
+
+// an value_node is a value with a tag telling the type
+typedef struct value_struct {
+    int tag;
+    union {
+        int64_t integer;
+        uint64_t uinteger;
+        double real;
+        char *string;
+        pldata_ptr data;
+        array_ptr array;
+        struct dict_struct *dict;
+    };
+} value_node, *value_ptr;
+
+
+value_ptr bplist_read_file(char *filename);
+value_ptr bplist_read_user_pref(char *filename);
+value_ptr bplist_read_system_pref(char *filename);
+void bplist_free_data();
+
+/*************** functions for accessing values ****************/
+
+char *value_get_asciistring(value_ptr v);
+value_ptr value_dict_lookup_using_string(value_ptr v, char *key);
+value_ptr value_dict_lookup_using_path(value_ptr v, char *path);
+
+/*************** functions for debugging ***************/
+
+void plist_print(value_ptr v);
+
diff --git a/lib-src/portmidi/pm_mingw/eclipse/README.txt b/lib-src/portmidi/pm_mingw/eclipse/README.txt
new file mode 100644
index 0000000..3eac003
--- /dev/null
+++ b/lib-src/portmidi/pm_mingw/eclipse/README.txt
@@ -0,0 +1,20 @@
+These files, dot-cproject and dot-project, come from Philip Martin
+(posted on Media_api mailing list on September 3, 2008).
+He writes: "I do not have a makefile. I used Eclipse + CDT to build
+PortMidi using MinGw. ... The two files .project and .cproject I 
+believe must be in the root of the portmidi tree to work with Eclipse.
+... I have only compiled the relevant sources into one .dll here."
+
+The .project and .cproject files have been renamed to dot-project and
+dot-cproject here to make them more visible. To use them, you will
+need to rename them to .project and .cproject, and probably move them
+to the portmidi tree root.
+
+At this time, no one is actively maintaining Eclipse or MinGw versions
+of PortMidi, so these files may be out-of-date or have other problems.
+Feel free to submit updates or discuss the possibility of maintaining
+these or some equivalent files for MinGw.
+
+Roger Dannenberg
+18-Oct-2008
+
diff --git a/lib-src/portmidi/pm_mingw/eclipse/dot-cproject b/lib-src/portmidi/pm_mingw/eclipse/dot-cproject
new file mode 100644
index 0000000..06b47e3
--- /dev/null
+++ b/lib-src/portmidi/pm_mingw/eclipse/dot-cproject
@@ -0,0 +1,710 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004">
+<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+<externalSettings>
+<externalSetting>
+<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PortMidi"/>
+<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PortMidi/Debug"/>
+</externalSetting>
+</externalSettings>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<configuration artifactExtension="dll" artifactName="PortMidi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.so.debug">
+<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004." name="/" resourcePath="">
+<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.debug.1545417885" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.debug">
+<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.debug.415542300" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.debug"/>
+<builder buildPath="${workspace_loc:/PortMidi/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.592172807" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug.1889129808" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug">
+<option id="gnu.both.asm.option.flags.1498736889" name="Assembler flags" superClass="gnu.both.asm.option.flags"/>
+<option id="gnu.both.asm.option.include.paths.1734867019" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
+</option>
+<option id="gnu.both.asm.option.warnings.nowarn.1657300607" name="Suppress warnings (-W)" superClass="gnu.both.asm.option.warnings.nowarn"/>
+<option id="gnu.both.asm.option.version.1995252368" name="Announce version (-v)" superClass="gnu.both.asm.option.version"/>
+<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1250436110" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1211487028" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.81091790" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug">
+<option id="gnu.cpp.compiler.mingw.so.debug.option.optimization.level.1750954034" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+<option id="gnu.cpp.compiler.mingw.so.debug.option.debugging.level.1357163228" name="Debug Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug">
+<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.so.debug.option.optimization.level.1361318269" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.debug.option.optimization.level" valueType="enumerated"/>
+<option id="gnu.c.compiler.mingw.so.debug.option.debugging.level.798971050" name="Debug Level" superClass="gnu.c.compiler.mingw.so.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+<option id="gnu.c.compiler.option.preprocessor.nostdinc.635731758" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc"/>
+<option id="gnu.c.compiler.option.preprocessor.preprocess.1129104455" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess"/>
+<option id="gnu.c.compiler.option.preprocessor.def.symbols.924940285" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"/>
+<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1996330931" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
+<listOptionValue builtIn="false" value="_STDCALL_SUPPORTED"/>
+</option>
+<option id="gnu.c.compiler.option.include.paths.276080219" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
+</option>
+<option id="gnu.c.compiler.option.optimization.flags.1032442929" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags"/>
+<option id="gnu.c.compiler.option.debugging.other.509079500" name="Other debugging flags" superClass="gnu.c.compiler.option.debugging.other"/>
+<option id="gnu.c.compiler.option.debugging.gprof.708510440" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof"/>
+<option id="gnu.c.compiler.option.debugging.prof.1379528770" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof"/>
+<option id="gnu.c.compiler.option.warnings.syntax.76950723" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax"/>
+<option id="gnu.c.compiler.option.warnings.pedantic.503180272" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic"/>
+<option id="gnu.c.compiler.option.warnings.pedantic.error.332437973" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error"/>
+<option id="gnu.c.compiler.option.warnings.nowarn.1830350073" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn"/>
+<option id="gnu.c.compiler.option.warnings.allwarn.77655170" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn"/>
+<option id="gnu.c.compiler.option.warnings.toerrors.1707691615" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors"/>
+<option id="gnu.c.compiler.option.misc.other.1929071594" name="Other flags" superClass="gnu.c.compiler.option.misc.other"/>
+<option id="gnu.c.compiler.option.misc.verbose.1368165423" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose"/>
+<option id="gnu.c.compiler.option.misc.ansi.1130235771" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi"/>
+<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.532732416" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.2093989251" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug">
+<option defaultValue="true" id="gnu.c.link.mingw.so.debug.option.shared.210833175" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.debug.option.shared" valueType="boolean"/>
+<option id="gnu.c.link.option.nostart.1109377759" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
+<option id="gnu.c.link.option.nodeflibs.1969639513" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
+<option id="gnu.c.link.option.nostdlibs.1939458836" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs"/>
+<option id="gnu.c.link.option.strip.1926939147" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
+<option id="gnu.c.link.option.noshared.1390204753" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
+<option id="gnu.c.link.option.libs.2043660134" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
+<listOptionValue builtIn="false" value="winmm"/>
+</option>
+<option id="gnu.c.link.option.paths.1702926265" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
+<option id="gnu.c.link.option.ldflags.1184725311" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-mwindows" valueType="string"/>
+<option id="gnu.c.link.option.other.2085141015" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other"/>
+<option id="gnu.c.link.option.userobjs.1490648701" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
+<option id="gnu.c.link.option.soname.437120219" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname" value="PortMidi.dll" valueType="string"/>
+<option id="gnu.c.link.option.implname.205634723" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="libPortMidi_dll.a" valueType="string"/>
+<option id="gnu.c.link.option.defname.571020719" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname" value="PortMidi_dll.def" valueType="string"/>
+<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.916986463" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+</inputType>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug.1822206806" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug">
+<option defaultValue="true" id="gnu.cpp.link.mingw.so.debug.option.shared.408251443" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.debug.option.shared" valueType="boolean"/>
+</tool>
+</toolChain>
+</folderInfo>
+<sourceEntries>
+<entry excluding="pm_cl/|pm_linux/|pm_mac/|pm_test/|porttime/ptlinux.c|porttime/ptmacosx_cf.c|porttime/ptmacosx_mach.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
+</sourceEntries>
+</configuration>
+</storageModule>
+<storageModule moduleId="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.413200248;cdt.managedbuild.config.gnu.mingw.so.release.413200248.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978;cdt.managedbuild.tool.gnu.c.compiler.input.611335297">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+</scannerConfigBuildInfo>
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004;cdt.managedbuild.config.gnu.mingw.so.debug.1580321004.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337;cdt.managedbuild.tool.gnu.c.compiler.input.532732416">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+</scannerConfigBuildInfo>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+</cconfiguration>
+<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.release.413200248">
+<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.release.413200248" moduleId="org.eclipse.cdt.core.settings" name="Release">
+<externalSettings>
+<externalSetting>
+<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PortMidi"/>
+<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PortMidi/Release"/>
+</externalSetting>
+</externalSettings>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<configuration artifactExtension="dll" artifactName="PortMidi" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.release.413200248" name="Release" parent="cdt.managedbuild.config.gnu.mingw.so.release">
+<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.release.413200248." name="/" resourcePath="">
+<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.release.965704931" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.release">
+<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.release.1343771960" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.release"/>
+<builder buildPath="${workspace_loc:/PortMidi/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1650720234" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
+<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.release.1392864745" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.release">
+<option id="gnu.both.asm.option.include.paths.591264871" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
+</option>
+<option id="gnu.both.asm.option.flags.1143807089" superClass="gnu.both.asm.option.flags"/>
+<option id="gnu.both.asm.option.warnings.nowarn.1142377463" superClass="gnu.both.asm.option.warnings.nowarn"/>
+<option id="gnu.both.asm.option.version.1007025248" superClass="gnu.both.asm.option.version"/>
+<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1754592443" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.503109969" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
+<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1693369280" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release">
+<option id="gnu.cpp.compiler.mingw.so.release.option.optimization.level.1169326010" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+<option id="gnu.cpp.compiler.mingw.so.release.option.debugging.level.1197288488" name="Debug Level" superClass="gnu.cpp.compiler.mingw.so.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release">
+<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.so.release.option.optimization.level.79718900" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.release.option.optimization.level" valueType="enumerated"/>
+<option id="gnu.c.compiler.mingw.so.release.option.debugging.level.778378875" name="Debug Level" superClass="gnu.c.compiler.mingw.so.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+<option id="gnu.c.compiler.option.include.paths.140256948" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_common}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/pm_win}&quot;"/>
+<listOptionValue builtIn="false" value="&quot;${workspace_loc:/PortMidi/porttime}&quot;"/>
+</option>
+<option id="gnu.c.compiler.option.preprocessor.def.symbols.960115196" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"/>
+<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1891593123" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
+<listOptionValue builtIn="false" value="_STDCALL_SUPPORTED"/>
+</option>
+<option id="gnu.c.compiler.option.preprocessor.nostdinc.824573539" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc"/>
+<option id="gnu.c.compiler.option.preprocessor.preprocess.2045908914" name="Preprocess only (-E)" superClass="gnu.c.compiler.option.preprocessor.preprocess"/>
+<option id="gnu.c.compiler.option.optimization.flags.1668114371" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags"/>
+<option id="gnu.c.compiler.option.debugging.other.26702882" name="Other debugging flags" superClass="gnu.c.compiler.option.debugging.other"/>
+<option id="gnu.c.compiler.option.debugging.gprof.1849481872" name="Generate gprof information (-pg)" superClass="gnu.c.compiler.option.debugging.gprof"/>
+<option id="gnu.c.compiler.option.debugging.prof.370891777" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof"/>
+<option id="gnu.c.compiler.option.warnings.syntax.814238128" name="Check syntax only (-fsyntax-only)" superClass="gnu.c.compiler.option.warnings.syntax"/>
+<option id="gnu.c.compiler.option.warnings.pedantic.1130364543" name="Pedantic (-pedantic)" superClass="gnu.c.compiler.option.warnings.pedantic"/>
+<option id="gnu.c.compiler.option.warnings.pedantic.error.1833423377" name="Pedantic warnings as errors (-pedantic-errors)" superClass="gnu.c.compiler.option.warnings.pedantic.error"/>
+<option id="gnu.c.compiler.option.warnings.nowarn.842847161" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn"/>
+<option id="gnu.c.compiler.option.warnings.allwarn.1245259653" name="All warnings (-Wall)" superClass="gnu.c.compiler.option.warnings.allwarn"/>
+<option id="gnu.c.compiler.option.warnings.toerrors.329299856" name="Warnings as errors (-Werror)" superClass="gnu.c.compiler.option.warnings.toerrors"/>
+<option id="gnu.c.compiler.option.misc.other.1436833008" name="Other flags" superClass="gnu.c.compiler.option.misc.other"/>
+<option id="gnu.c.compiler.option.misc.verbose.1418051288" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose"/>
+<option id="gnu.c.compiler.option.misc.ansi.592723919" name="Support ANSI programs (-ansi)" superClass="gnu.c.compiler.option.misc.ansi"/>
+<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.611335297" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.release.556134685" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.release">
+<option defaultValue="true" id="gnu.c.link.mingw.so.release.option.shared.1619560956" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.release.option.shared" valueType="boolean"/>
+<option id="gnu.c.link.option.ldflags.1804407715" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-mwindows" valueType="string"/>
+<option id="gnu.c.link.option.soname.621315524" name="Shared object name (-Wl,-soname=)" superClass="gnu.c.link.option.soname" value="PortMidi.dll" valueType="string"/>
+<option id="gnu.c.link.option.implname.236027258" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.c.link.option.implname" value="libPortMidi_dll.a" valueType="string"/>
+<option id="gnu.c.link.option.defname.1144978768" name="DEF file name (-Wl,--output-def=)" superClass="gnu.c.link.option.defname" value="PortMidi_dll.def" valueType="string"/>
+<option id="gnu.c.link.option.nostart.623404099" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart"/>
+<option id="gnu.c.link.option.nodeflibs.51119036" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs"/>
+<option id="gnu.c.link.option.nostdlibs.2099774502" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs"/>
+<option id="gnu.c.link.option.strip.1270839234" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip"/>
+<option id="gnu.c.link.option.noshared.715377715" name="No shared libraries (-static)" superClass="gnu.c.link.option.noshared"/>
+<option id="gnu.c.link.option.libs.246748928" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
+<listOptionValue builtIn="false" value="winmm"/>
+</option>
+<option id="gnu.c.link.option.paths.1166408208" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
+<option id="gnu.c.link.option.other.1932058041" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other"/>
+<option id="gnu.c.link.option.userobjs.1397357824" name="Other objects" superClass="gnu.c.link.option.userobjs"/>
+<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.363448189" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+</inputType>
+</tool>
+<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.release.1088983873" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.release">
+<option defaultValue="true" id="gnu.cpp.link.mingw.so.release.option.shared.2023092585" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.release.option.shared" valueType="boolean"/>
+</tool>
+</toolChain>
+</folderInfo>
+<sourceEntries>
+<entry excluding="pm_cl/|pm_linux/|pm_mac/|pm_test/|porttime/ptlinux.c|porttime/ptmacosx_cf.c|porttime/ptmacosx_mach.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
+</sourceEntries>
+</configuration>
+</storageModule>
+<storageModule moduleId="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.413200248;cdt.managedbuild.config.gnu.mingw.so.release.413200248.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.343495978;cdt.managedbuild.tool.gnu.c.compiler.input.611335297">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+</scannerConfigBuildInfo>
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1580321004;cdt.managedbuild.config.gnu.mingw.so.debug.1580321004.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.428547337;cdt.managedbuild.tool.gnu.c.compiler.input.532732416">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+</scannerConfigBuildInfo>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+</cconfiguration>
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<project id="PortMidi.cdt.managedbuild.target.gnu.mingw.so.812075522" name="Shared Library" projectType="cdt.managedbuild.target.gnu.mingw.so"/>
+</storageModule>
+</cproject>
diff --git a/lib-src/portmidi/pm_mingw/eclipse/dot-project b/lib-src/portmidi/pm_mingw/eclipse/dot-project
new file mode 100644
index 0000000..57b1a6a
--- /dev/null
+++ b/lib-src/portmidi/pm_mingw/eclipse/dot-project
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>PortMidi</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.contents</key>
+					<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildLocation</key>
+					<value>${workspace_loc:/PortMidi/Debug}</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+					<value>false</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.append_environment</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>?name?</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.stopOnError</key>
+					<value>true</value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildArguments</key>
+					<value></value>
+				</dictionary>
+				<dictionary>
+					<key>org.eclipse.cdt.make.core.buildCommand</key>
+					<value>make</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+	</natures>
+</projectDescription>
diff --git a/lib-src/portmidi/pm_mingw/msys/README.txt b/lib-src/portmidi/pm_mingw/msys/README.txt
new file mode 100644
index 0000000..02042e8
--- /dev/null
+++ b/lib-src/portmidi/pm_mingw/msys/README.txt
@@ -0,0 +1,3 @@
+The file SConstruct comes from Michael Gogins (24 Oct 2008). Although
+not currently maintained or tested (volunteers welcome!), this might
+be useful for anyone with MinGW/MSys installed. -RBD
diff --git a/lib-src/portmidi/pm_mingw/msys/SConstruct b/lib-src/portmidi/pm_mingw/msys/SConstruct
new file mode 100644
index 0000000..f02a8f0
Binary files /dev/null and b/lib-src/portmidi/pm_mingw/msys/SConstruct differ
diff --git a/lib-src/portmidi/pm_test/latency-VC9.vcproj b/lib-src/portmidi/pm_test/latency-VC9.vcproj
new file mode 100644
index 0000000..b565943
--- /dev/null
+++ b/lib-src/portmidi/pm_test/latency-VC9.vcproj
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Latency"
+	ProjectGUID="{EDC3A027-917B-4D23-AE70-73C409B47F85}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Latency Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\latency.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/verbose:lib"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\latency.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Latency Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\latency.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\latency.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="latency.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/latency.c b/lib-src/portmidi/pm_test/latency.c
new file mode 100644
index 0000000..8a7e005
--- /dev/null
+++ b/lib-src/portmidi/pm_test/latency.c
@@ -0,0 +1,290 @@
+/* latency.c -- measure latency of OS */
+
+#include "porttime.h"
+#include "portmidi.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+/* Latency is defined here to mean the time starting when a
+   process becomes ready to run, and ending when the process
+   actually runs. Latency is due to contention for the
+   processor, usually due to other processes, OS activity
+   including device drivers handling interrupts, and
+   waiting for the scheduler to suspend the currently running
+   process and activate the one that is waiting.
+
+   Latency can affect PortMidi applications: if a process fails
+   to wake up promptly, MIDI input may sit in the input buffer
+   waiting to be handled, and MIDI output may not be generated
+   with accurate timing. Using the latency parameter when 
+   opening a MIDI output port allows the caller to defer timing
+   to PortMidi, which in most implementations will pass the
+   data on to the OS. By passing timestamps and data to the
+   OS kernel, device driver, or even hardware, there are fewer
+   sources of latency that can affect the ultimate timing of
+   the data. On the other hand, the application must generate
+   and deliver the data ahead of the timestamp. The amount by 
+   which data is computed early must be at least as large as
+   the worst-case latency to avoid timing problems.
+
+   Latency is even more important in audio applications. If an
+   application lets an audio output buffer underflow, an audible
+   pop or click is produced. Audio input buffers can overflow,
+   causing data to be lost. In general the audio buffers must
+   be large enough to buffer the worst-case latency that the
+   application will encounter.
+
+   This program measures latency by recording the difference
+   between the scheduled callback time and the current real time.
+   We do not really know the scheduled callback time, so we will
+   record the differences between the real time of each callback
+   and the real time of the previous callback. Differences that
+   are larger than the scheduled difference are recorded. Smaller
+   differences indicate the system is recovering from an earlier
+   latency, so these are ignored.
+   Since printing by the callback process can cause all sorts of
+   delays, this program records latency observations in a
+   histogram. When the program is stopped, the histogram is
+   printed to the console.
+
+   Optionally the system can be tested under a load of MIDI input,
+   MIDI output, or both.  If MIDI input is selected, the callback
+   thread will read any waiting MIDI events each iteration.  You
+   must generate events on this interface for the test to actually
+   put any appreciable load on PortMidi.  If MIDI output is
+   selected, alternating note on and note off events are sent each
+   X iterations, where you specify X.  For example, with a timer
+   callback period of 2ms and X=1, a MIDI event is sent every 2ms.
+
+
+   INTERPRETING RESULTS: Time is quantized to 1ms, so there is
+   some uncertainty due to rounding. A microsecond latency that
+   spans the time when the clock is incremented will be reported
+   as a latency of 1. On the other hand, a latency of almost
+   1ms that falls between two clock ticks will be reported as 
+   zero. In general, if the highest nonzero bin is numbered N,
+   then the maximum latency is N+1.
+
+CHANGE LOG
+
+18-Jul-03 Mark Nelson -- Added code to generate MIDI or receive
+            MIDI during test, and made period user-settable.
+ */
+
+#define HIST_LEN 21 /* how many 1ms bins in the histogram */
+
+#define STRING_MAX 80 /* used for console input */
+
+#define INPUT_BUFFER_SIZE 100
+#define OUTPUT_BUFFER_SIZE 0
+
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef min
+#define min(a, b) ((a) <= (b) ? (a) : (b))
+#endif
+
+int get_number(char *prompt);
+
+PtTimestamp previous_callback_time = 0;
+
+int period;            /* milliseconds per callback */
+
+long histogram[HIST_LEN];
+long max_latency = 0;  /* worst latency observed */
+long out_of_range = 0; /* how many points outside of HIST_LEN? */
+
+int test_in, test_out; /* test MIDI in and/or out? */
+int output_period;     /* output MIDI every __ iterations if test_out true */
+int iteration = 0;
+PmStream *in, *out;
+int note_on = 0;       /* is the note currently on? */
+
+/* callback function for PortTime -- computes histogram */
+void pt_callback(PtTimestamp timestamp, void *userData)
+{
+    PtTimestamp difference = timestamp - previous_callback_time - period;
+    previous_callback_time = timestamp;
+
+    /* allow 5 seconds for the system to settle down */
+    if (timestamp < 5000) return;
+
+    iteration++;
+    /* send a note on/off if user requested it */
+    if (test_out && (iteration % output_period == 0)) {
+        PmEvent buffer[1];
+        buffer[0].timestamp = Pt_Time(NULL);
+        if (note_on) {
+            /* note off */
+            buffer[0].message = Pm_Message(0x90, 60, 0);
+            note_on = 0;
+        } else {
+            /* note on */
+            buffer[0].message = Pm_Message(0x90, 60, 100);
+            note_on = 1;
+        }
+        Pm_Write(out, buffer, 1);
+        iteration = 0;
+    }
+
+    /* read all waiting events (if user requested) */
+    if (test_in) {
+       PmError status;
+       PmEvent buffer[1];
+       do {
+          status = Pm_Poll(in);
+          if (status == TRUE) {
+              Pm_Read(in,buffer,1);
+          }
+       } while (status == TRUE);
+    }
+
+    if (difference < 0) return; /* ignore when system is "catching up" */
+
+    /* update the histogram */
+    if (difference < HIST_LEN) {
+        histogram[difference]++;
+    } else {
+        out_of_range++;
+    }
+
+    if (max_latency < difference) max_latency = difference;
+}
+
+
+int main()
+{
+    char line[STRING_MAX];
+    int i;
+    int len;
+    int choice;
+    PtTimestamp stop;
+    printf("Latency histogram.\n");
+    period = 0;
+    while (period < 1) {
+        period = get_number("Choose timer period (in ms, >= 1): ");
+    }
+    printf("Benchmark with:\n\t%s\n\t%s\n\t%s\n\t%s\n",
+           "1. No MIDI traffic",
+           "2. MIDI input",
+           "3. MIDI output",
+           "4. MIDI input and output");
+    choice = get_number("? ");
+    switch (choice) {
+      case 1: test_in = 0; test_out = 0; break;
+      case 2: test_in = 1; test_out = 0; break;
+      case 3: test_in = 0; test_out = 1; break;
+      case 4: test_in = 1; test_out = 1; break;
+      default: assert(0);
+    }
+    if (test_in || test_out) {
+        /* list device information */
+        for (i = 0; i < Pm_CountDevices(); i++) {
+            const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+            if ((test_in && info->input) ||
+                (test_out && info->output)) {
+                printf("%d: %s, %s", i, info->interf, info->name);
+                if (info->input) printf(" (input)");
+                if (info->output) printf(" (output)");
+                printf("\n");
+            }
+        }
+        /* open stream(s) */
+        if (test_in) {
+            int i = get_number("MIDI input device number: ");
+            Pm_OpenInput(&in, 
+                  i,
+                  NULL, 
+                  INPUT_BUFFER_SIZE, 
+                  (long (*)(void *)) Pt_Time, 
+                  NULL);
+            /* turn on filtering; otherwise, input might overflow in the 
+               5-second period before timer callback starts reading midi */
+            Pm_SetFilter(in, PM_FILT_ACTIVE | PM_FILT_CLOCK);
+        }
+        if (test_out) {
+            int i = get_number("MIDI output device number: ");
+            PmEvent buffer[1];
+            Pm_OpenOutput(&out, 
+                  i,
+                  NULL,
+                  OUTPUT_BUFFER_SIZE,
+                  (long (*)(void *)) Pt_Time,
+                  NULL, 
+                  0); /* no latency scheduling */
+
+            /* send a program change to force a status byte -- this fixes
+               a problem with a buggy linux MidiSport driver, and shouldn't
+               hurt anything else
+             */
+            buffer[0].timestamp = 0;
+            buffer[0].message = Pm_Message(0xC0, 0, 0); /* program change */
+            Pm_Write(out, buffer, 1);
+
+            output_period = get_number(
+                "MIDI out should be sent every __ callback iterations: ");
+
+            assert(output_period >= 1);
+        }
+    }
+
+    printf("%s%s", "Latency measurements will start in 5 seconds. ",
+                   "Type return to stop: ");
+    Pt_Start(period, &pt_callback, 0);
+    fgets(line, STRING_MAX, stdin);
+    stop = Pt_Time();
+    Pt_Stop();
+
+    /* courteously turn off the last note, if necessary */
+    if (note_on) {
+       PmEvent buffer[1];
+       buffer[0].timestamp = Pt_Time(NULL);
+       buffer[0].message = Pm_Message(0x90, 60, 0);
+       Pm_Write(out, buffer, 1);
+    }
+
+    /* print the histogram */
+    printf("Duration of test: %g seconds\n\n", max(0, stop - 5000) * 0.001);
+    printf("Latency(ms)  Number of occurrences\n");
+    /* avoid printing beyond last non-zero histogram entry */
+    len = min(HIST_LEN, max_latency + 1);
+    for (i = 0; i < len; i++) {
+        printf("%2d      %10ld\n", i, histogram[i]);
+    }
+    printf("Number of points greater than %dms: %ld\n", 
+           HIST_LEN - 1, out_of_range);
+    printf("Maximum latency: %ld milliseconds\n", max_latency);
+    printf("\nNote that due to rounding, actual latency can be 1ms higher\n");
+    printf("than the numbers reported here.\n");
+    printf("Type return to exit...");
+    fgets(line, STRING_MAX, stdin);
+
+	if(choice == 2)
+		Pm_Close(in);
+	else if(choice == 3)
+		Pm_Close(out);
+	else if(choice == 4)
+	{
+		Pm_Close(in);
+		Pm_Close(out);
+	}
+    return 0;
+}
+
+
+/* read a number from console */
+int get_number(char *prompt)
+{
+    char line[STRING_MAX];
+    int n = 0, i;
+    printf(prompt);
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+
+    }
+    return i;
+}
diff --git a/lib-src/portmidi/pm_test/latency.vcproj b/lib-src/portmidi/pm_test/latency.vcproj
new file mode 100644
index 0000000..776bc56
--- /dev/null
+++ b/lib-src/portmidi/pm_test/latency.vcproj
@@ -0,0 +1,443 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="latency"
+	ProjectGUID="{EDC3A027-917B-4D23-AE70-73C409B47F85}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\latencyDebug"
+			IntermediateDirectory=".\latencyDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\latencyDebug/latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\latencyDebug/latency.pch"
+				AssemblerListingLocation=".\latencyDebug/"
+				ObjectFile=".\latencyDebug/"
+				ProgramDataBaseFileName=".\latencyDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/verbose:lib"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\latencyDebug/latency.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\latencyDebug/latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\latencyDebug/latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\latencyRelease"
+			IntermediateDirectory=".\latencyRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\latencyRelease/latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\latencyRelease/latency.pch"
+				AssemblerListingLocation=".\latencyRelease/"
+				ObjectFile=".\latencyRelease/"
+				ProgramDataBaseFileName=".\latencyRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\latencyRelease/latency.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\latencyRelease/latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\latencyRelease/latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\latencyDebug/latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\latencyDebug/latency.pch"
+				AssemblerListingLocation=".\latencyDebug/"
+				ObjectFile=".\latencyDebug/"
+				ProgramDataBaseFileName=".\latencyDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/verbose:lib"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\latencyDebug/latency.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\latencyDebug/latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\latencyDebug/latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\latencyRelease/latency.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../porttime,../pm_common"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\latencyRelease/latency.pch"
+				AssemblerListingLocation=".\latencyRelease/"
+				ObjectFile=".\latencyRelease/"
+				ProgramDataBaseFileName=".\latencyRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\latencyRelease/latency.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\latencyRelease/latency.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\latencyRelease/latency.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="latency.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/midiclock.c b/lib-src/portmidi/pm_test/midiclock.c
new file mode 100644
index 0000000..43b16e1
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midiclock.c
@@ -0,0 +1,286 @@
+/* miditime.c -- a test program that sends midi clock and MTC */
+
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#ifndef false
+#define false 0
+#define true 1
+#endif
+
+#define private static
+typedef int boolean;
+
+#define MIDI_TIME_CLOCK 0xf8
+#define MIDI_START      0xfa
+#define MIDI_CONTINUE	0xfb
+#define MIDI_STOP       0xfc
+#define MIDI_Q_FRAME	0xf1
+
+#define OUTPUT_BUFFER_SIZE 0
+#define DRIVER_INFO NULL
+#define TIME_PROC ((long (*)(void *)) Pt_Time)
+#define TIME_INFO NULL
+#define LATENCY 0
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+
+/* to determine ms per clock:
+ *    time per beat in seconds =  60 / tempo
+ *    multiply by 1000 to get time per beat in ms: 60000 / tempo
+ *    divide by 24 CLOCKs per beat: (60000/24) / tempo
+ *    simplify: 2500 / tempo
+ */
+#define TEMPO_TO_CLOCK 2500.0
+
+boolean done = false;
+PmStream *midi;
+/* shared flags to control callback output generation: */
+boolean clock_running = false;
+boolean send_start_stop = false;
+boolean time_code_running = false;
+boolean active = false; /* tells callback to do its thing */
+float tempo = 60.0F;
+/* protocol for handing off portmidi to callback thread:
+    main owns portmidi
+    main sets active = true: ownership transfers to callback
+    main sets active = false: main requests ownership
+    callback sees active == false, yields ownership back to main
+    main waits 2ms to make sure callback has a chance to yield
+       (stop making PortMidi calls), then assumes it can close
+       PortMidi
+ */
+
+/* timer_poll -- the timer callback function */
+/*
+ * All MIDI sends take place here
+ */
+void timer_poll(PtTimestamp timestamp, void *userData)
+{
+    static int callback_owns_portmidi = false;
+    static long clock_start_time = 0;
+    static double next_clock_time = 0;
+    /* SMPTE time */
+    static int frames = 0;
+    static int seconds = 0;
+    static int minutes = 0;
+    static int hours = 0;
+    static int mtc_count = 0; /* where are we in quarter frame sequence? */
+    static int smpte_start_time = 0;
+    static double next_smpte_time = 0;
+    #define QUARTER_FRAME_PERIOD (1.0 / 120.0) /* 30fps, 1/4 frame */
+
+    if (callback_owns_portmidi && !active) {
+        /* main is requesting (by setting active to false) that we shut down */
+        callback_owns_portmidi = false;
+        return;
+    }
+    if (!active) return; /* main still getting ready or it's closing down */
+    callback_owns_portmidi = true; /* main is ready, we have portmidi */
+    if (send_start_stop) {
+        if (clock_running) {
+            Pm_WriteShort(midi, 0, MIDI_STOP);
+        } else {
+            Pm_WriteShort(midi, 0, MIDI_START);
+            clock_start_time = timestamp;
+            next_clock_time = TEMPO_TO_CLOCK / tempo;
+        }
+        clock_running = !clock_running;
+        send_start_stop = false; /* until main sets it again */
+        /* note that there's a slight race condition here: main could
+           set send_start_stop asynchronously, but we assume user is 
+           typing slower than the clock rate */
+    }
+    if (clock_running) {
+        if ((timestamp - clock_start_time) > next_clock_time) {
+            Pm_WriteShort(midi, 0, MIDI_TIME_CLOCK);
+            next_clock_time += TEMPO_TO_CLOCK / tempo;
+        }
+    }
+    if (time_code_running) {
+        int data;
+        if ((timestamp - smpte_start_time) < next_smpte_time) 
+            return;
+        switch (mtc_count) {
+        case 0: /* frames low nibble */
+            data = frames;
+            break;
+        case 1: /* frames high nibble */
+            data = frames >> 4;
+            break;
+        case 2: /* frames seconds low nibble */
+            data = seconds;
+            break;
+        case 3: /* frames seconds high nibble */
+            data = seconds >> 4;
+            break;
+        case 4: /* frames minutes low nibble */
+            data = minutes;
+            break;
+        case 5: /* frames minutes high nibble */
+            data = minutes >> 4;
+            break;
+        case 6: /* hours low nibble */
+            data = hours;
+            break;
+        case 7: /* hours high nibble */
+            data = hours >> 4;
+            break;
+        }
+        data &= 0xF; /* take only 4 bits */
+        Pm_WriteShort(midi, 0, 
+                      Pm_Message(MIDI_Q_FRAME, (mtc_count << 4) + data, 0));
+        mtc_count = (mtc_count + 1) & 7; /* wrap around */
+        if (mtc_count == 0) { /* update time by two frames */
+            frames += 2;
+            if (frames >= 30) {
+                frames = 0;
+                seconds++;
+                if (seconds >= 60) {
+                    seconds = 0;
+                    minutes++;
+                    if (minutes >= 60) {
+                        minutes = 0;
+                        hours++;
+                        /* just let hours wrap if it gets that far */
+                    }
+                }
+            }
+        }
+        next_smpte_time += QUARTER_FRAME_PERIOD;
+    } else { /* time_code_running is false */
+        smpte_start_time = timestamp;
+        /* so that when it finally starts, we'll be in sync */
+    }
+}
+
+
+/* read a number from console */
+/**/
+int get_number(char *prompt)
+{
+    char line[STRING_MAX];
+    int n = 0, i;
+    printf(prompt);
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+
+    }
+    return i;
+}
+
+/****************************************************************************
+*               showhelp
+* Effect: print help text
+****************************************************************************/
+
+private void showhelp()
+{
+    printf("\n");
+    printf("t toggles sending MIDI Time Code (MTC)\n");
+    printf("c toggles sending MIDI CLOCK (initially on)\n");
+    printf("m to set tempo (from 1bpm to 300bpm)\n");
+    printf("q quits\n");
+    printf("\n");
+}
+
+/****************************************************************************
+*               doascii
+* Inputs:
+*    char c: input character
+* Effect: interpret to control output
+****************************************************************************/
+
+private void doascii(char c)
+{
+    if (isupper(c)) c = tolower(c);
+    if (c == 'q') done = true;
+    else if (c == 'c') {
+        printf("%s MIDI CLOCKs\n", (clock_running ? "Stopping" : "Starting"));
+        send_start_stop = true;
+    } else if (c == 't') {
+        printf("%s MIDI Time Code\n", 
+               (time_code_running ? "Stopping" : "Starting"));
+        time_code_running = !time_code_running;
+    } else if (c == 'm') {
+        int input_tempo = get_number("Enter new tempo (bpm): ");
+        if (input_tempo >= 1 && input_tempo <= 300) {
+            printf("Changing tempo to %d\n", input_tempo);
+            tempo = input_tempo;
+        } else {
+            printf("Tempo range is 1 to 300, current tempo is %d bpm\n", 
+                   tempo);
+        }
+    } else {
+        showhelp();
+    }
+}
+
+
+/* main - prompt for parameters, start processing */
+/*
+ * Prompt user to type return.
+ * Then send START and MIDI CLOCK for 60 beats/min.
+ * Commands:
+ *     t - toggle sending MIDI Time Code (MTC)
+ *     c - toggle sending MIDI CLOCK
+ *     m - set tempo
+ *     q - quit
+ */
+int main(int argc, char **argv)
+{
+    char s[STRING_MAX]; /* console input */
+    int outp;
+    PmError err;
+    int i;
+    if (argc > 1) { 
+        printf("Warning: command line arguments ignored\n");
+    }
+    showhelp();
+    /* use porttime callback to send midi */
+    Pt_Start(1, timer_poll, 0);
+    /* list device information */
+    printf("MIDI output devices:\n");
+    for (i = 0; i < Pm_CountDevices(); i++) {
+        const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+        if (info->output) printf("%d: %s, %s\n", i, info->interf, info->name);
+    }
+    outp = get_number("Type output device number: ");
+    err = Pm_OpenOutput(&midi, outp, DRIVER_INFO, OUTPUT_BUFFER_SIZE, 
+                        TIME_PROC, TIME_INFO, LATENCY);
+    if (err) {
+        printf(Pm_GetErrorText(err));
+        goto error_exit_no_device;
+    }
+    active = true;
+
+    printf("Type RETURN to start MIDI CLOCK:\n");
+    if (!fgets(s, STRING_MAX, stdin)) goto error_exit;
+    send_start_stop = true; /* send START and then CLOCKs */
+
+    while (!done) {
+        if (fgets(s, STRING_MAX, stdin)) {
+            doascii(s[0]);
+        }
+    }
+
+ error_exit:
+    active = false;
+    Pt_Sleep(2); /* this is to allow callback to complete -- it's
+                    real time, so it's either ok and it runs on
+                    time, or there's no point to synchronizing
+                    with it */
+    /* now we "own" portmidi again */
+    Pm_Close(midi);
+ error_exit_no_device:
+    Pt_Stop();
+    Pm_Terminate();
+    exit(0);
+}
+
diff --git a/lib-src/portmidi/pm_test/midithread-VC9.vcproj b/lib-src/portmidi/pm_test/midithread-VC9.vcproj
new file mode 100644
index 0000000..99ab823
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithread-VC9.vcproj
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="MidiThread"
+	ProjectGUID="{4E555AA6-B348-41C9-A685-0B76149BBBAF}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="MidiThread Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\midithread.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\midithread.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="MidiThread Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\midithread.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\midithread.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="midithread.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/midithread.c b/lib-src/portmidi/pm_test/midithread.c
new file mode 100644
index 0000000..1e0a8cc
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithread.c
@@ -0,0 +1,326 @@
+/* midithread.c -- example program showing how to do midi processing 
+                   in a preemptive thread
+
+  Notes: if you handle midi I/O from your main program, there will be
+  some delay before handling midi messages whenever the program is
+  doing something like file I/O, graphical interface updates, etc.
+
+  To handle midi with minimal delay, you should do all midi processing
+  in a separate, high priority thread. A convenient way to get a high
+  priority thread in windows is to use the timer callback provided by
+  the PortTime library. That is what we show here.
+
+  If the high priority thread writes to a file, prints to the console,
+  or does just about anything other than midi processing, this may 
+  create delays, so all this processing should be off-loaded to the
+  "main" process or thread. Communication between threads can be tricky.
+  If one thread is writing at the same time the other is reading, very
+  tricky race conditions can arise, causing programs to behave
+  incorrectly, but only under certain timing conditions -- a terrible
+  thing to debug. Advanced programmers know this as a synchronization
+  problem. See any operating systems textbook for the complete story.
+
+  To avoid synchronization problems, a simple, reliable approach is
+  to communicate via messages. PortMidi offers a message queue as a
+  datatype, and operations to insert and remove messages. Use two 
+  queues as follows: midi_to_main transfers messages from the midi
+  thread to the main thread, and main_to_midi transfers messages from
+  the main thread to the midi thread. Queues are safe for use between
+  threads as long as ONE thread writes and ONE thread reads. You must 
+  NEVER allow two threads to write to the same queue.
+
+  This program transposes incoming midi data by an amount controlled
+  by the main program. To change the transposition, type an integer
+  followed by return. The main program sends this via a message queue
+  to the midi thread. To quit, type 'q' followed by return.
+
+  The midi thread can also send a pitch to the main program on request.
+  Type 'm' followed by return to wait for the next midi message and
+  print the pitch.
+
+  This program illustrates:
+    Midi processing in a high-priority thread.
+    Communication with a main process via message queues.
+
+ */
+
+#include "stdio.h"
+#include "stdlib.h"
+#include "string.h"
+#include "assert.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "porttime.h"
+
+/* if INPUT_BUFFER_SIZE is 0, PortMidi uses a default value */
+#define INPUT_BUFFER_SIZE 0
+
+#define OUTPUT_BUFFER_SIZE 100
+#define DRIVER_INFO NULL
+#define TIME_PROC NULL
+#define TIME_INFO NULL
+/* use zero latency because we want output to be immediate */
+#define LATENCY 0
+
+#define STRING_MAX 80
+
+/**********************************/
+/* DATA USED ONLY BY process_midi */
+/* (except during initialization) */
+/**********************************/
+
+int active = FALSE;
+int monitor = FALSE;
+int midi_thru = TRUE;
+
+long transpose;
+PmStream *midi_in;
+PmStream *midi_out;
+
+/****************************/
+/* END OF process_midi DATA */
+/****************************/
+
+/* shared queues */
+PmQueue *midi_to_main;
+PmQueue *main_to_midi;
+
+#define QUIT_MSG 1000
+#define MONITOR_MSG 1001
+#define THRU_MSG 1002
+
+/* timer interrupt for processing midi data */
+void process_midi(PtTimestamp timestamp, void *userData)
+{
+    PmError result;
+    PmEvent buffer; /* just one message at a time */
+    long msg;
+
+    /* do nothing until initialization completes */
+    if (!active) 
+        return;
+
+    /* check for messages */
+    do { 
+        result = Pm_Dequeue(main_to_midi, &msg); 
+        if (result) {
+            if (msg >= -127 && msg <= 127) 
+                transpose = msg;
+            else if (msg == QUIT_MSG) {
+                /* acknowledge receipt of quit message */
+                Pm_Enqueue(midi_to_main, &msg);
+                active = FALSE;
+                return;
+            } else if (msg == MONITOR_MSG) {
+                /* main has requested a pitch. monitor is a flag that
+                 * records the request:
+                 */
+                monitor = TRUE;
+            } else if (msg == THRU_MSG) {
+                /* toggle Thru on or off */
+                midi_thru = !midi_thru;
+            }
+        }
+    } while (result);         
+    
+    /* see if there is any midi input to process */
+    do {
+		result = Pm_Poll(midi_in);
+        if (result) {
+            long status, data1, data2;
+            if (Pm_Read(midi_in, &buffer, 1) == pmBufferOverflow) 
+                continue;
+            if (midi_thru) 
+                Pm_Write(midi_out, &buffer, 1);
+            /* unless there was overflow, we should have a message now */
+            status = Pm_MessageStatus(buffer.message);
+            data1 = Pm_MessageData1(buffer.message);
+            data2 = Pm_MessageData2(buffer.message);
+            if ((status & 0xF0) == 0x90 ||
+                (status & 0xF0) == 0x80) {
+                
+                /* this is a note-on or note-off, so transpose and send */
+                data1 += transpose;
+                
+                /* keep within midi pitch range, keep proper pitch class */
+                while (data1 > 127) 
+                    data1 -= 12;
+                while (data1 < 0) 
+                    data1 += 12;
+                
+                /* send the message */
+                buffer.message = Pm_Message(status, data1, data2);
+                Pm_Write(midi_out, &buffer, 1);
+                
+                /* if monitor is set, send the pitch to the main thread */
+                if (monitor) {
+                    Pm_Enqueue(midi_to_main, &data1);
+                    monitor = FALSE; /* only send one pitch per request */
+                }
+            }
+        }
+    } while (result);
+}
+
+void exit_with_message(char *msg)
+{
+    char line[STRING_MAX];
+    printf("%s\n", msg);
+    fgets(line, STRING_MAX, stdin);
+    exit(1);
+}
+
+int main()
+{
+    int id;
+    long n;
+    const PmDeviceInfo *info;
+    char line[STRING_MAX];
+    int spin;
+    int done = FALSE;
+
+    /* determine what type of test to run */
+    printf("begin PortMidi multithread test...\n");
+	
+    /* note that it is safe to call PortMidi from the main thread for
+       initialization and opening devices. You should not make any
+       calls to PortMidi from this thread once the midi thread begins.
+       to make PortMidi calls.
+     */
+
+    /* make the message queues */
+    /* messages can be of any size and any type, but all messages in
+     * a given queue must have the same size. We'll just use long's
+     * for our messages in this simple example
+     */
+    midi_to_main = Pm_QueueCreate(32, sizeof(long));
+    assert(midi_to_main != NULL);
+    main_to_midi = Pm_QueueCreate(32, sizeof(long));
+    assert(main_to_midi != NULL);
+
+    /* a little test of enqueue and dequeue operations. Ordinarily, 
+     * you would call Pm_Enqueue from one thread and Pm_Dequeue from
+     * the other. Since the midi thread is not running, this is safe.
+     */
+    n = 1234567890;
+    Pm_Enqueue(midi_to_main, &n);
+    n = 987654321;
+    Pm_Enqueue(midi_to_main, &n);
+	Pm_Dequeue(midi_to_main, &n);
+	if (n != 1234567890) {
+        exit_with_message("Pm_Dequeue produced unexpected result.");
+    }
+    Pm_Dequeue(midi_to_main, &n);
+	if(n != 987654321) {
+        exit_with_message("Pm_Dequeue produced unexpected result.");
+    }
+
+    /* always start the timer before you start midi */
+    Pt_Start(1, &process_midi, 0); /* start a timer with millisecond accuracy */
+    /* the timer will call our function, process_midi() every millisecond */
+    
+	Pm_Initialize();
+
+    id = Pm_GetDefaultOutputDeviceID();
+    info = Pm_GetDeviceInfo(id);
+    if (info == NULL) {
+        printf("Could not open default output device (%d).", id);
+        exit_with_message("");
+    }
+    printf("Opening output device %s %s\n", info->interf, info->name);
+
+    /* use zero latency because we want output to be immediate */
+    Pm_OpenOutput(&midi_out, 
+                  id, 
+                  DRIVER_INFO,
+                  OUTPUT_BUFFER_SIZE,
+                  TIME_PROC,
+                  TIME_INFO,
+                  LATENCY);
+
+    id = Pm_GetDefaultInputDeviceID();
+    info = Pm_GetDeviceInfo(id);
+    if (info == NULL) {
+        printf("Could not open default input device (%d).", id);
+        exit_with_message("");
+    }
+    printf("Opening input device %s %s\n", info->interf, info->name);
+    Pm_OpenInput(&midi_in, 
+                 id, 
+                 DRIVER_INFO,
+                 INPUT_BUFFER_SIZE,
+                 TIME_PROC,
+                 TIME_INFO);
+
+    active = TRUE; /* enable processing in the midi thread -- yes, this
+                      is a shared variable without synchronization, but
+                      this simple assignment is safe */
+
+    printf("Enter midi input; it will be transformed as specified by...\n");
+    printf("%s\n%s\n%s\n",
+           "Type 'q' to quit, 'm' to monitor next pitch, t to toggle thru or",
+           "type a number to specify transposition.",
+		   "Must terminate with [ENTER]");
+
+    while (!done) {
+        long msg;
+        int len;
+        fgets(line, STRING_MAX, stdin);
+        /* remove the newline: */
+        len = strlen(line);
+        if (len > 0) line[len - 1] = 0; /* overwrite the newline char */
+        if (strcmp(line, "q") == 0) {
+            msg = QUIT_MSG;
+            Pm_Enqueue(main_to_midi, &msg);
+            /* wait for acknowlegement */
+            do {
+                spin = Pm_Dequeue(midi_to_main, &msg);
+            } while (spin == 0); /* spin */ ;
+            done = TRUE; /* leave the command loop and wrap up */
+        } else if (strcmp(line, "m") == 0) {
+            msg = MONITOR_MSG;
+            Pm_Enqueue(main_to_midi, &msg);
+            printf("Waiting for note...\n");
+            do {
+                spin = Pm_Dequeue(midi_to_main, &msg);
+            } while (spin == 0); /* spin */ ;
+            printf("... pitch is %ld\n", msg);
+        } else if (strcmp(line, "t") == 0) {
+            /* reading midi_thru asynchronously could give incorrect results,
+               e.g. if you type "t" twice before the midi thread responds to
+               the first one, but we'll do it this way anyway. Perhaps a more
+               correct way would be to wait for an acknowledgement message
+               containing the new state. */
+            printf("Setting THRU %s\n", (midi_thru ? "off" : "on"));
+            msg = THRU_MSG;
+            Pm_Enqueue(main_to_midi, &msg);
+        } else if (sscanf(line, "%ld", &msg) == 1) {
+            if (msg >= -127 && msg <= 127) {
+                /* send transposition value */
+                printf("Transposing by %ld\n", msg);
+                Pm_Enqueue(main_to_midi, &msg);
+            } else {
+                printf("Transposition must be within -127...127\n");
+            }
+        } else {
+            printf("%s\n%s\n",
+              "Type 'q[ENTER]' to quit, 'm[ENTER]' to monitor next pitch, or",
+              "enter a number to specify transposition.");
+        }
+    }
+
+    /* at this point, midi thread is inactive and we need to shut down
+     * the midi input and output
+     */
+    Pt_Stop(); /* stop the timer */
+    Pm_QueueDestroy(midi_to_main);
+    Pm_QueueDestroy(main_to_midi);
+
+    /* Belinda! if close fails here, some memory is deleted, right??? */
+    Pm_Close(midi_in);
+    Pm_Close(midi_out);
+    
+    printf("finished portMidi multithread test...enter any character to quit [RETURN]...");
+    fgets(line, STRING_MAX, stdin);
+    return 0;
+}
diff --git a/lib-src/portmidi/pm_test/midithread.vcproj b/lib-src/portmidi/pm_test/midithread.vcproj
new file mode 100644
index 0000000..42d8f3e
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithread.vcproj
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="midithread"
+	ProjectGUID="{4E555AA6-B348-41C9-A685-0B76149BBBAF}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\midithreadDebug"
+			IntermediateDirectory=".\midithreadDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithreadDebug/midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\midithreadDebug/midithread.pch"
+				AssemblerListingLocation=".\midithreadDebug/"
+				ObjectFile=".\midithreadDebug/"
+				ProgramDataBaseFileName=".\midithreadDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\midithreadDebug/midithread.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\midithreadDebug/midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithreadDebug/midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\midithreadRelease"
+			IntermediateDirectory=".\midithreadRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithreadRelease/midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\midithreadRelease/midithread.pch"
+				AssemblerListingLocation=".\midithreadRelease/"
+				ObjectFile=".\midithreadRelease/"
+				ProgramDataBaseFileName=".\midithreadRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\midithreadRelease/midithread.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\midithreadRelease/midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithreadRelease/midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithreadDebug/midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\midithreadDebug/midithread.pch"
+				AssemblerListingLocation=".\midithreadDebug/"
+				ObjectFile=".\midithreadDebug/"
+				ProgramDataBaseFileName=".\midithreadDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\midithreadDebug/midithread.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\midithreadDebug/midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithreadDebug/midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithreadRelease/midithread.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\midithreadRelease/midithread.pch"
+				AssemblerListingLocation=".\midithreadRelease/"
+				ObjectFile=".\midithreadRelease/"
+				ProgramDataBaseFileName=".\midithreadRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\midithreadRelease/midithread.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\midithreadRelease/midithread.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithreadRelease/midithread.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="midithread.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/midithru-VC9.vcproj b/lib-src/portmidi/pm_test/midithru-VC9.vcproj
new file mode 100644
index 0000000..d709125
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithru-VC9.vcproj
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="MidiThru"
+	ProjectGUID="{B4B4240D-7022-4C47-838F-913B4878E938}"
+	RootNamespace="MidiThru"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="MidiThru Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\midithru.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\midithru.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="MidiThru Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\midithru.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib winmm.lib"
+				OutputFile=".\$(OutDir)\midithru.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="midithru.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/midithru.c b/lib-src/portmidi/pm_test/midithru.c
new file mode 100644
index 0000000..ffab64e
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithru.c
@@ -0,0 +1,366 @@
+/* midithru.c -- example program implementing background thru processing */
+
+/* suppose you want low-latency midi-thru processing, but your application
+   wants to take advantage of the input buffer and timestamped data so that
+   it does not have to operate with very low latency.
+
+   This program illustrates how to use a timer callback from PortTime to 
+   implement a low-latency process that handles midi thru, including correctly
+   merging midi data from the application with midi data from the input port.
+
+   The main application, which runs in the main program thread, will use an
+   interface similar to that of PortMidi, but since PortMidi does not allow
+   concurrent threads to share access to a stream, the application will
+   call private methods that transfer MIDI messages to and from the timer 
+   thread. All PortMidi API calls are made from the timer thread.
+ */
+
+/* DESIGN
+
+All setup will be done by the main thread. Then, all direct access to 
+PortMidi will be handed off to the timer callback thread.
+
+After this hand-off, the main thread will get/send messages via a queue.
+
+The goal is to send incoming messages to the midi output while merging
+any midi data generated by the application. Sysex is a problem here
+because you cannot insert (merge) a midi message while a sysex is in
+progress. There are at least three ways to implement midi thru with 
+sysex messages:
+
+1) Turn them off. If your application does not need them, turn them off
+   with Pm_SetFilter(midi_in, PM_FILT_ACTIVE | PM_FILT_SYSEX). You will
+   not receive sysex (or active sensing messages), so you will not have 
+   to handle them.
+
+2) Make them atomic. As you receive sysex messages, copy the data into
+   a (big) buffer. Ideally, expand the buffer as needed -- sysex messages
+   do not have any maximum length. Even more ideally, use a list structure
+   and real-time memory allocation to avoid latency in the timer thread.
+   When a full sysex message is received, send it to the midi output all
+   at once.
+
+3) Process sysex incrementally. Send sysex data to midi output as it
+   arrives. Block any non-real-time messages from the application until
+   the sysex message completes. There is the risk that an incomplete
+   sysex message will block messages forever, so implement a 5-second
+   timeout: if no sysex data is seen for 5 seconds, release the block,
+   possibly losing the rest of the sysex message. 
+
+   Application messages must be processed similarly: once started, a
+   sysex message will block MIDI THRU processing. We will assume that
+   the application will not abort a sysex message, so timeouts are not
+   necessary here.
+
+This code implements (3).
+
+Latency is also an issue. PortMidi requires timestamps to be in 
+non-decreasing order. Since we'll be operating with a low-latency
+timer thread, we can just set the latency to zero meaning timestamps
+are ignored by PortMidi. This will allow thru to go through with
+minimal latency. The application, however, needs to use timestamps
+because we assume it is high latency (the whole purpose of this
+example is to illustrate how to get low-latency thru with a high-latency
+application.) So the callback thread will implement midi timing by
+observing timestamps. The current timestamp will be available in the
+global variable current_timestamp.
+
+*/
+
+
+#include "stdio.h"
+#include "stdlib.h"
+#include "string.h"
+#include "assert.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "porttime.h"
+
+#define MIDI_SYSEX 0xf0
+#define MIDI_EOX 0xf7
+
+/* active is set true when midi processing should start */
+int active = FALSE;
+/* process_midi_exit_flag is set when the timer thread shuts down */
+int process_midi_exit_flag;
+
+PmStream *midi_in;
+PmStream *midi_out;
+
+/* shared queues */
+#define IN_QUEUE_SIZE 1024
+#define OUT_QUEUE_SIZE 1024
+PmQueue *in_queue;
+PmQueue *out_queue;
+PmTimestamp current_timestamp = 0;
+int thru_sysex_in_progress = FALSE;
+int app_sysex_in_progress = FALSE;
+PmTimestamp last_timestamp = 0;
+
+
+/* time proc parameter for Pm_MidiOpen */
+long midithru_time_proc(void *info)
+{
+    return current_timestamp;
+}
+
+
+/* timer interrupt for processing midi data.
+   Incoming data is delivered to main program via in_queue.
+   Outgoing data from main program is delivered via out_queue.
+   Incoming data from midi_in is copied with low latency to  midi_out.
+   Sysex messages from either source block messages from the other.
+ */
+void process_midi(PtTimestamp timestamp, void *userData)
+{
+    PmError result;
+    PmEvent buffer; /* just one message at a time */
+
+    current_timestamp++; /* update every millisecond */
+    /* if (current_timestamp % 1000 == 0) 
+        printf("time %d\n", current_timestamp); */
+
+    /* do nothing until initialization completes */
+    if (!active) {
+        /* this flag signals that no more midi processing will be done */
+        process_midi_exit_flag = TRUE;
+        return;
+    }
+
+    /* see if there is any midi input to process */
+    if (!app_sysex_in_progress) {
+        do {
+            result = Pm_Poll(midi_in);
+            if (result) {
+                long status;
+                PmError rslt = Pm_Read(midi_in, &buffer, 1);
+                if (rslt == pmBufferOverflow) 
+                    continue;
+                assert(rslt == 1);
+
+                /* record timestamp of most recent data */
+                last_timestamp = current_timestamp;
+
+                /* the data might be the end of a sysex message that
+                   has timed out, in which case we must ignore it.
+                   It's a continuation of a sysex message if status
+                   is actually a data byte (high-order bit is zero). */
+                status = Pm_MessageStatus(buffer.message);
+                if (((status & 0x80) == 0) && !thru_sysex_in_progress) {
+                    continue; /* ignore this data */
+                }
+
+                /* implement midi thru */
+                /* note that you could output to multiple ports or do other
+                   processing here if you wanted
+                 */
+                /* printf("thru: %x\n", buffer.message); */
+                Pm_Write(midi_out, &buffer, 1);
+
+                /* send the message to the application */
+                /* you might want to filter clock or active sense messages here
+                   to avoid sending a bunch of junk to the application even if
+                   you want to send it to MIDI THRU
+                 */
+                Pm_Enqueue(in_queue, &buffer);
+
+                /* sysex processing */
+                if (status == MIDI_SYSEX) thru_sysex_in_progress = TRUE;
+                else if ((status & 0xF8) != 0xF8) {
+                    /* not MIDI_SYSEX and not real-time, so */
+                    thru_sysex_in_progress = FALSE;
+                }
+                if (thru_sysex_in_progress && /* look for EOX */
+                    (((buffer.message & 0xFF) == MIDI_EOX) ||
+                     (((buffer.message >> 8) & 0xFF) == MIDI_EOX) ||
+                     (((buffer.message >> 16) & 0xFF) == MIDI_EOX) ||
+                     (((buffer.message >> 24) & 0xFF) == MIDI_EOX))) {
+                    thru_sysex_in_progress = FALSE;
+                }
+            }
+        } while (result);
+    }
+
+
+    /* see if there is application midi data to process */
+    while (!Pm_QueueEmpty(out_queue)) {
+        /* see if it is time to output the next message */
+        PmEvent *next = (PmEvent *) Pm_QueuePeek(out_queue);
+        assert(next); /* must be non-null because queue is not empty */
+        if (next->timestamp <= current_timestamp) {
+            /* time to send a message, first make sure it's not blocked */
+            long status = Pm_MessageStatus(next->message);
+            if ((status & 0xF8) == 0xF8) {
+                ; /* real-time messages are not blocked */
+            } else if (thru_sysex_in_progress) {
+                /* maybe sysex has timed out (output becomes unblocked) */
+                if (last_timestamp + 5000 < current_timestamp) {
+                    thru_sysex_in_progress = FALSE;
+                } else break; /* output is blocked, so exit loop */
+            }
+            Pm_Dequeue(out_queue, &buffer);
+            Pm_Write(midi_out, &buffer, 1);
+
+            /* inspect message to update app_sysex_in_progress */
+            if (status == MIDI_SYSEX) app_sysex_in_progress = TRUE;
+            else if ((status & 0xF8) != 0xF8) {
+                /* not MIDI_SYSEX and not real-time, so */
+                app_sysex_in_progress = FALSE;
+            }
+            if (app_sysex_in_progress && /* look for EOX */
+                (((buffer.message & 0xFF) == MIDI_EOX) ||
+                 (((buffer.message >> 8) & 0xFF) == MIDI_EOX) ||
+                 (((buffer.message >> 16) & 0xFF) == MIDI_EOX) ||
+                 (((buffer.message >> 24) & 0xFF) == MIDI_EOX))) {
+                app_sysex_in_progress = FALSE;
+            }
+        } else break; /* wait until indicated timestamp */
+    }
+}
+
+
+void exit_with_message(char *msg)
+{
+#define STRING_MAX 80
+    char line[STRING_MAX];
+    printf("%s\nType ENTER...", msg);
+    fgets(line, STRING_MAX, stdin);
+    exit(1);
+}
+
+
+void initialize()
+/* set up midi processing thread and open midi streams */
+{
+    /* note that it is safe to call PortMidi from the main thread for
+       initialization and opening devices. You should not make any
+       calls to PortMidi from this thread once the midi thread begins.
+       to make PortMidi calls.
+     */
+
+    /* note that this routine provides minimal error checking. If
+       you use the PortMidi library compiled with PM_CHECK_ERRORS,
+       then error messages will be printed and the program will exit
+       if an error is encountered. Otherwise, you should add some
+       error checking to this code.
+     */
+
+    const PmDeviceInfo *info;
+    int id;
+
+    /* make the message queues */
+    in_queue = Pm_QueueCreate(IN_QUEUE_SIZE, sizeof(PmEvent));
+    assert(in_queue != NULL);
+    out_queue = Pm_QueueCreate(OUT_QUEUE_SIZE, sizeof(PmEvent));
+    assert(out_queue != NULL);
+
+    /* always start the timer before you start midi */
+    Pt_Start(1, &process_midi, 0); /* start a timer with millisecond accuracy */
+    /* the timer will call our function, process_midi() every millisecond */
+    
+    Pm_Initialize();
+
+    id = Pm_GetDefaultOutputDeviceID();
+    info = Pm_GetDeviceInfo(id);
+    if (info == NULL) {
+        printf("Could not open default output device (%d).", id);
+        exit_with_message("");
+    }
+    printf("Opening output device %s %s\n", info->interf, info->name);
+
+    /* use zero latency because we want output to be immediate */
+    Pm_OpenOutput(&midi_out, 
+                  id, 
+                  NULL /* driver info */,
+                  OUT_QUEUE_SIZE,
+                  &midithru_time_proc,
+                  NULL /* time info */,
+                  0 /* Latency */);
+
+    id = Pm_GetDefaultInputDeviceID();
+    info = Pm_GetDeviceInfo(id);
+    if (info == NULL) {
+        printf("Could not open default input device (%d).", id);
+        exit_with_message("");
+    }
+    printf("Opening input device %s %s\n", info->interf, info->name);
+    Pm_OpenInput(&midi_in, 
+                 id, 
+                 NULL /* driver info */,
+                 0 /* use default input size */,
+                 &midithru_time_proc,
+                 NULL /* time info */);
+    /* Note: if you set a filter here, then this will filter what goes
+       to the MIDI THRU port. You may not want to do this.
+     */
+    Pm_SetFilter(midi_in, PM_FILT_ACTIVE | PM_FILT_CLOCK);
+
+    active = TRUE; /* enable processing in the midi thread -- yes, this
+                      is a shared variable without synchronization, but
+                      this simple assignment is safe */
+
+}
+
+
+void finalize()
+{
+    /* the timer thread could be in the middle of accessing PortMidi stuff */
+    /* to detect that it is done, we first clear process_midi_exit_flag and
+       then wait for the timer thread to set it
+     */
+    process_midi_exit_flag = FALSE;
+    active = FALSE;
+    /* busy wait for flag from timer thread that it is done */
+    while (!process_midi_exit_flag) ;
+    /* at this point, midi thread is inactive and we need to shut down
+     * the midi input and output
+     */
+    Pt_Stop(); /* stop the timer */
+    Pm_QueueDestroy(in_queue);
+    Pm_QueueDestroy(out_queue);
+
+    Pm_Close(midi_in);
+    Pm_Close(midi_out);
+
+    Pm_Terminate();    
+}
+
+
+int main(int argc, char *argv[])
+{
+    PmTimestamp last_time = 0;
+    PmEvent buffer;
+
+    /* determine what type of test to run */
+    printf("begin PortMidi midithru program...\n");
+
+    initialize(); /* set up and start midi processing */
+	
+    printf("%s\n%s\n",
+           "This program will run for 60 seconds, or until you play middle C,",
+           "echoing all input with a 2 second delay.");
+
+    while (current_timestamp < 60000) {
+        /* just to make the point that this is not a low-latency process,
+           spin until half a second has elapsed */
+        last_time = last_time + 500;
+        while (last_time > current_timestamp) ;
+
+        /* now read data and send it after changing timestamps */
+        while (Pm_Dequeue(in_queue, &buffer) == 1) {
+            /* printf("timestamp %d\n", buffer.timestamp); */
+            /* printf("message %x\n", buffer.message); */
+            buffer.timestamp = buffer.timestamp + 2000; /* delay */
+            Pm_Enqueue(out_queue, &buffer);
+            /* play middle C to break out of loop */
+            if (Pm_MessageStatus(buffer.message) == 0x90 &&
+                Pm_MessageData1(buffer.message) == 60) {
+                goto quit_now;
+            }
+        }
+    }
+quit_now:
+    finalize();
+    exit_with_message("finished PortMidi midithru program.");
+    return 0; /* never executed, but keeps the compiler happy */
+}
diff --git a/lib-src/portmidi/pm_test/midithru.vcproj b/lib-src/portmidi/pm_test/midithru.vcproj
new file mode 100644
index 0000000..8ddfc3a
--- /dev/null
+++ b/lib-src/portmidi/pm_test/midithru.vcproj
@@ -0,0 +1,442 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="midithru"
+	ProjectGUID="{B4B4240D-7022-4C47-838F-913B4878E938}"
+	RootNamespace="midithru"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\midithruDebug"
+			IntermediateDirectory=".\midithruDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithruDebug/midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\midithruDebug/midithru.pch"
+				AssemblerListingLocation=".\midithruDebug/"
+				ObjectFile=".\midithruDebug/"
+				ProgramDataBaseFileName=".\midithruDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\midithruDebug/midithru.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\midithruDebug/midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithruDebug/midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\midithruRelease"
+			IntermediateDirectory=".\midithruRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithruRelease/midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\midithruRelease/midithru.pch"
+				AssemblerListingLocation=".\midithruRelease/"
+				ObjectFile=".\midithruRelease/"
+				ProgramDataBaseFileName=".\midithruRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\midithruRelease/midithru.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\midithruRelease/midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithruRelease/midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithruDebug/midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\midithruDebug/midithru.pch"
+				AssemblerListingLocation=".\midithruDebug/"
+				ObjectFile=".\midithruDebug/"
+				ProgramDataBaseFileName=".\midithruDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib winmm.lib"
+				OutputFile=".\midithruDebug/midithru.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\midithruDebug/midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithruDebug/midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\midithruRelease/midithru.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\midithruRelease/midithru.pch"
+				AssemblerListingLocation=".\midithruRelease/"
+				ObjectFile=".\midithruRelease/"
+				ProgramDataBaseFileName=".\midithruRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib winmm.lib"
+				OutputFile=".\midithruRelease/midithru.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\midithruRelease/midithru.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\midithruRelease/midithru.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="midithru.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/mm-VC9.vcproj b/lib-src/portmidi/pm_test/mm-VC9.vcproj
new file mode 100644
index 0000000..9a04191
--- /dev/null
+++ b/lib-src/portmidi/pm_test/mm-VC9.vcproj
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="MidiMonitor"
+	ProjectGUID="{2FC1D7B8-E434-4D6F-A50D-AB262C825BCD}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="MidiMonitor Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\mm.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\mm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="MidiMonitor Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\mm.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\mm.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="mm.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/mm.c b/lib-src/portmidi/pm_test/mm.c
new file mode 100644
index 0000000..bbe69f6
--- /dev/null
+++ b/lib-src/portmidi/pm_test/mm.c
@@ -0,0 +1,567 @@
+/* mm.c -- midi monitor */
+
+/*****************************************************************************
+*       Change Log
+*  Date | Change
+*-----------+-----------------------------------------------------------------
+*  7-Apr-86 | Created changelog
+* 31-Jan-90 | GWL : use new cmdline
+*  5-Apr-91 | JDW : Further changes
+* 16-Feb-92 | GWL : eliminate label mmexit:; add error recovery
+* 18-May-92 | GWL : continuous clocks, etc.
+* 17-Jan-94 | GWL : option to display notes
+* 20-Nov-06 | RBD : port mm.c from CMU Midi Toolkit to PortMidi
+*           |       mm.c -- revealing MIDI secrets for over 20 years!
+*****************************************************************************/
+
+#include "stdlib.h"
+#include "ctype.h"
+#include "string.h"
+#include "stdio.h"
+#include "porttime.h"
+#include "portmidi.h"
+
+#define STRING_MAX 80
+
+#define MIDI_CODE_MASK  0xf0
+#define MIDI_CHN_MASK   0x0f
+/*#define MIDI_REALTIME   0xf8
+  #define MIDI_CHAN_MODE  0xfa */
+#define MIDI_OFF_NOTE   0x80
+#define MIDI_ON_NOTE    0x90
+#define MIDI_POLY_TOUCH 0xa0
+#define MIDI_CTRL       0xb0
+#define MIDI_CH_PROGRAM 0xc0
+#define MIDI_TOUCH      0xd0
+#define MIDI_BEND       0xe0
+
+#define MIDI_SYSEX      0xf0
+#define MIDI_Q_FRAME	0xf1
+#define MIDI_SONG_POINTER 0xf2
+#define MIDI_SONG_SELECT 0xf3
+#define MIDI_TUNE_REQ	0xf6
+#define MIDI_EOX        0xf7
+#define MIDI_TIME_CLOCK 0xf8
+#define MIDI_START      0xfa
+#define MIDI_CONTINUE	0xfb
+#define MIDI_STOP       0xfc
+#define MIDI_ACTIVE_SENSING 0xfe
+#define MIDI_SYS_RESET  0xff
+
+#define MIDI_RESET_CONTROLLERS 0x79
+#define MIDI_LOCAL	0x7a
+#define MIDI_ALL_OFF	0x7b
+#define MIDI_OMNI_OFF	0x7c
+#define MIDI_OMNI_ON	0x7d
+#define MIDI_MONO_ON	0x7e
+#define MIDI_POLY_ON	0x7f
+
+
+#define private static
+
+#ifndef false
+#define false 0
+#define true 1
+#endif
+
+typedef int boolean;
+
+int debug = false;	/* never set, but referenced by userio.c */
+PmStream *midi_in;      /* midi input */
+boolean active = false;     /* set when midi_in is ready for reading */
+boolean in_sysex = false;   /* we are reading a sysex message */
+boolean inited = false;     /* suppress printing during command line parsing */
+boolean done = false;       /* when true, exit */
+boolean notes = true;       /* show notes? */
+boolean controls = true;    /* show continuous controllers */
+boolean bender = true;      /* record pitch bend etc.? */
+boolean excldata = true;    /* record system exclusive data? */
+boolean verbose = true;     /* show text representation? */
+boolean realdata = true;    /* record real time messages? */
+boolean clksencnt = true;   /* clock and active sense count on */
+boolean chmode = true;      /* show channel mode messages */
+boolean pgchanges = true;   /* show program changes */
+boolean flush = false;	    /* flush all pending MIDI data */
+
+long filter = 0;            /* remember state of midi filter */
+
+long clockcount = 0;        /* count of clocks */
+long actsensecount = 0;     /* cout of active sensing bytes */
+long notescount = 0;        /* #notes since last request */
+long notestotal = 0;        /* total #notes */
+
+char val_format[] = "    Val %d\n";
+
+/*****************************************************************************
+*    Imported variables
+*****************************************************************************/
+
+extern  int     abort_flag;
+
+/*****************************************************************************
+*    Routines local to this module
+*****************************************************************************/
+
+private    void    mmexit();
+private    void    output(PmMessage data);
+private    int     put_pitch(int p);
+private    void    showhelp();
+private    void    showbytes(long data, int len, boolean newline);
+private    void    showstatus(boolean flag);
+private    void    doascii(char c);
+private    int     get_number(char *prompt);
+
+
+/* read a number from console */
+/**/
+int get_number(char *prompt)
+{
+    char line[STRING_MAX];
+    int n = 0, i;
+    printf(prompt);
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+
+    }
+    return i;
+}
+
+
+void receive_poll(PtTimestamp timestamp, void *userData)
+{
+    PmEvent event;
+    int count;
+    if (!active) return;
+    while (count = Pm_Read(midi_in, &event, 1)) {
+        if (count == 1) output(event.message);
+        else            printf(Pm_GetErrorText(count));
+    }
+}
+
+
+/****************************************************************************
+*               main
+* Effect: prompts for parameters, starts monitor
+****************************************************************************/
+
+int main(int argc, char **argv)
+{
+    char *argument;
+    int inp;
+    PmError err;
+    int i;
+    if (argc > 1) { /* first arg can change defaults */
+        argument = argv[1];
+        while (*argument) doascii(*argument++);
+    }
+    showhelp();
+    /* use porttime callback to empty midi queue and print */
+    Pt_Start(1, receive_poll, 0);
+    /* list device information */
+    printf("MIDI input devices:\n");
+    for (i = 0; i < Pm_CountDevices(); i++) {
+        const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+        if (info->input) printf("%d: %s, %s\n", i, info->interf, info->name);
+    }
+    inp = get_number("Type input device number: ");
+    err = Pm_OpenInput(&midi_in, inp, NULL, 512, NULL, NULL);
+    if (err) {
+        printf(Pm_GetErrorText(err));
+        Pt_Stop();
+        exit(1);
+    }
+    Pm_SetFilter(midi_in, filter);
+    inited = true; /* now can document changes, set filter */
+    printf("Midi Monitor ready.\n");
+    active = true;
+    while (!done) {
+        char s[100];
+        if (fgets(s, 100, stdin)) {
+            doascii(s[0]);
+        }
+    }
+    active = false;
+    Pm_Close(midi_in);
+    Pt_Stop();
+    Pm_Terminate();
+    exit(0);
+}
+
+
+/****************************************************************************
+*               doascii
+* Inputs:
+*    char c: input character
+* Effect: interpret to revise flags
+****************************************************************************/
+
+private void doascii(char c)
+{
+    if (isupper(c)) c = tolower(c);
+    if (c == 'q') done = true;
+    else if (c == 'b') {
+        bender = !bender;
+        filter ^= PM_FILT_PITCHBEND;
+        if (inited)
+            printf("Pitch Bend, etc. %s\n", (bender ? "ON" : "OFF"));
+    } else if (c == 'c') {
+        controls = !controls;
+        filter ^= PM_FILT_CONTROL;
+        if (inited)
+            printf("Control Change %s\n", (controls ? "ON" : "OFF"));
+    } else if (c == 'h') {
+        pgchanges = !pgchanges;
+        filter ^= PM_FILT_PROGRAM;
+        if (inited)
+            printf("Program Changes %s\n", (pgchanges ? "ON" : "OFF"));
+    } else if (c == 'n') {
+        notes = !notes;
+        filter ^= PM_FILT_NOTE;
+        if (inited)
+            printf("Notes %s\n", (notes ? "ON" : "OFF"));
+    } else if (c == 'x') {
+        excldata = !excldata;
+        filter ^= PM_FILT_SYSEX;
+        if (inited)
+            printf("System Exclusive data %s\n", (excldata ? "ON" : "OFF"));
+    } else if (c == 'r') {
+        realdata = !realdata;
+        filter ^= (PM_FILT_PLAY | PM_FILT_RESET | PM_FILT_TICK | PM_FILT_UNDEFINED);
+        if (inited)
+            printf("Real Time messages %s\n", (realdata ? "ON" : "OFF"));
+    } else if (c == 'k') {
+        clksencnt = !clksencnt;
+        filter ^= PM_FILT_CLOCK;
+        if (inited)
+            printf("Clock and Active Sense Counting %s\n", (clksencnt ? "ON" : "OFF"));
+        if (!clksencnt) clockcount = actsensecount = 0;
+    } else if (c == 's') {
+        if (clksencnt) {
+            if (inited)
+                printf("Clock Count %ld\nActive Sense Count %ld\n", 
+                        clockcount, actsensecount);
+        } else if (inited) {
+            printf("Clock Counting not on\n");
+        }
+    } else if (c == 't') {
+        notestotal+=notescount;
+        if (inited)
+            printf("This Note Count %ld\nTotal Note Count %ld\n",
+                    notescount, notestotal);
+        notescount=0;
+    } else if (c == 'v') {
+        verbose = !verbose;
+        if (inited)
+            printf("Verbose %s\n", (verbose ? "ON" : "OFF"));
+    } else if (c == 'm') {
+        chmode = !chmode;
+        if (inited)
+            printf("Channel Mode Messages %s", (chmode ? "ON" : "OFF"));
+    } else {
+        if (inited) {
+            if (c == ' ') {
+                PmEvent event;
+                while (Pm_Read(midi_in, &event, 1)) ;	/* flush midi input */
+                printf("...FLUSHED MIDI INPUT\n\n");
+            } else showhelp();
+        }
+    }
+    if (inited) Pm_SetFilter(midi_in, filter);
+}
+
+
+
+private void mmexit()
+{
+    /* if this is not being run from a console, maybe we should wait for
+     * the user to read error messages before exiting
+     */
+    exit(1);
+}
+
+
+/****************************************************************************
+*               output
+* Inputs:
+*    data: midi message buffer holding one command or 4 bytes of sysex msg
+* Effect: format and print  midi data
+****************************************************************************/
+
+char vel_format[] = "    Vel %d\n";
+
+private void output(PmMessage data)
+{
+    int command;    /* the current command */
+    int chan;   /* the midi channel of the current event */
+    int len;    /* used to get constant field width */
+
+    /* printf("output data %8x; ", data); */
+
+    command = Pm_MessageStatus(data) & MIDI_CODE_MASK;
+    chan = Pm_MessageStatus(data) & MIDI_CHN_MASK;
+
+    if (in_sysex || Pm_MessageStatus(data) == MIDI_SYSEX) {
+#define sysex_max 16
+        int i;
+        long data_copy = data;
+        in_sysex = true;
+        /* look for MIDI_EOX in first 3 bytes 
+         * if realtime messages are embedded in sysex message, they will
+         * be printed as if they are part of the sysex message
+         */
+        for (i = 0; (i < 4) && ((data_copy & 0xFF) != MIDI_EOX); i++) 
+            data_copy >>= 8;
+        if (i < 4) {
+            in_sysex = false;
+            i++; /* include the EOX byte in output */
+        }
+        showbytes(data, i, verbose);
+        if (verbose) printf("System Exclusive\n");
+    } else if (command == MIDI_ON_NOTE && Pm_MessageData2(data) != 0) {
+        notescount++;
+        if (notes) {
+            showbytes(data, 3, verbose);
+            if (verbose) {
+                printf("NoteOn  Chan %2d Key %3d ", chan, Pm_MessageData1(data));
+                len = put_pitch(Pm_MessageData1(data));
+                printf(vel_format + len, Pm_MessageData2(data));
+            }
+        }
+    } else if ((command == MIDI_ON_NOTE /* && Pm_MessageData2(data) == 0 */ ||
+               command == MIDI_OFF_NOTE) && notes) {
+        showbytes(data, 3, verbose);
+        if (verbose) {
+            printf("NoteOff Chan %2d Key %3d ", chan, Pm_MessageData1(data));
+            len = put_pitch(Pm_MessageData1(data));
+            printf(vel_format + len, Pm_MessageData2(data));
+        }
+    } else if (command == MIDI_CH_PROGRAM && pgchanges) {
+        showbytes(data, 2, verbose);
+        if (verbose) {
+            printf("  ProgChg Chan %2d Prog %2d\n", chan, Pm_MessageData1(data) + 1);
+        }
+    } else if (command == MIDI_CTRL) {
+               /* controls 121 (MIDI_RESET_CONTROLLER) to 127 are channel
+                * mode messages. */
+        if (Pm_MessageData1(data) < MIDI_RESET_CONTROLLERS) {
+            showbytes(data, 3, verbose);
+            if (verbose) {
+                printf("CtrlChg Chan %2d Ctrl %2d Val %2d\n",
+                       chan, Pm_MessageData1(data), Pm_MessageData2(data));
+            }
+        } else /* channel mode */ if (chmode) {
+            showbytes(data, 3, verbose);
+            if (verbose) {
+                switch (Pm_MessageData1(data)) {
+                  case MIDI_RESET_CONTROLLERS:
+                    printf("Reset All Controllers\n");
+                    break;
+                  case MIDI_LOCAL:
+                    printf("LocCtrl Chan %2d %s\n",
+                            chan, Pm_MessageData2(data) ? "On" : "Off");
+                    break;
+                  case MIDI_ALL_OFF:
+                    printf("All Off Chan %2d\n", chan);
+                    break;
+                  case MIDI_OMNI_OFF:
+                    printf("OmniOff Chan %2d\n", chan);
+                    break;
+                  case MIDI_OMNI_ON:
+                    printf("Omni On Chan %2d\n", chan);
+                    break;
+                  case MIDI_MONO_ON:
+                    printf("Mono On Chan %2d\n", chan);
+                    if (Pm_MessageData2(data))
+                        printf(" to %d received channels\n", Pm_MessageData2(data));
+                    else
+                        printf(" to all received channels\n");
+                    break;
+                  case MIDI_POLY_ON:
+                    printf("Poly On Chan %2d\n", chan);
+                    break;
+                }
+            }
+        }
+    } else if (command == MIDI_POLY_TOUCH && bender) {
+        showbytes(data, 3, verbose);
+        if (verbose) {
+            printf("P.Touch Chan %2d Key %2d ", chan, Pm_MessageData1(data));
+            len = put_pitch(Pm_MessageData1(data));
+            printf(val_format + len, Pm_MessageData2(data));
+        }
+    } else if (command == MIDI_TOUCH && bender) {
+        showbytes(data, 2, verbose);
+        if (verbose) {
+            printf("  A.Touch Chan %2d Val %2d\n", chan, Pm_MessageData1(data));
+        }
+    } else if (command == MIDI_BEND && bender) {
+        showbytes(data, 3, verbose);
+        if (verbose) {
+            printf("P.Bend  Chan %2d Val %2d\n", chan,
+                    (Pm_MessageData1(data) + (Pm_MessageData2(data)<<7)));
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_SONG_POINTER) {
+        showbytes(data, 3, verbose);
+        if (verbose) {
+            printf("    Song Position %d\n",
+                    (Pm_MessageData1(data) + (Pm_MessageData2(data)<<7)));
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_SONG_SELECT) {
+        showbytes(data, 2, verbose);
+        if (verbose) {
+            printf("    Song Select %d\n", Pm_MessageData1(data));
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_TUNE_REQ) {
+        showbytes(data, 1, verbose);
+        if (verbose) {
+            printf("    Tune Request\n");
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_Q_FRAME && realdata) {
+        showbytes(data, 2, verbose);
+        if (verbose) {
+            printf("    Time Code Quarter Frame Type %d Values %d\n",
+                    (Pm_MessageData1(data) & 0x70) >> 4, Pm_MessageData1(data) & 0xf);
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_START && realdata) {
+        showbytes(data, 1, verbose);
+        if (verbose) {
+            printf("    Start\n");
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_CONTINUE && realdata) {
+        showbytes(data, 1, verbose);
+        if (verbose) {
+            printf("    Continue\n");
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_STOP && realdata) {
+        showbytes(data, 1, verbose);
+        if (verbose) {
+            printf("    Stop\n");
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_SYS_RESET && realdata) {
+        showbytes(data, 1, verbose);
+        if (verbose) {
+            printf("    System Reset\n");
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_TIME_CLOCK) {
+        if (clksencnt) clockcount++;
+        else if (realdata) {
+            showbytes(data, 1, verbose);
+            if (verbose) {
+                printf("    Clock\n");
+            }
+        }
+    } else if (Pm_MessageStatus(data) == MIDI_ACTIVE_SENSING) {
+        if (clksencnt) actsensecount++;
+        else if (realdata) {
+            showbytes(data, 1, verbose);
+            if (verbose) {
+                printf("    Active Sensing\n");
+            }
+        }
+    } else showbytes(data, 3, verbose);
+    fflush(stdout);
+}
+
+
+/****************************************************************************
+*               put_pitch
+* Inputs:
+*    int p: pitch number
+* Effect: write out the pitch name for a given number
+****************************************************************************/
+
+private int put_pitch(int p)
+{
+    char result[8];
+    static char *ptos[] = {
+        "c", "cs", "d", "ef", "e", "f", "fs", "g",
+        "gs", "a", "bf", "b"    };
+    /* note octave correction below */
+    sprintf(result, "%s%d", ptos[p % 12], (p / 12) - 1);
+    printf(result);
+    return strlen(result);
+}
+
+
+/****************************************************************************
+*               showbytes
+* Effect: print hex data, precede with newline if asked
+****************************************************************************/
+
+char nib_to_hex[] = "0123456789ABCDEF";
+
+private void showbytes(long data, int len, boolean newline)
+{
+    int count = 0;
+    int i;
+
+/*    if (newline) {
+        putchar('\n');
+        count++;
+    } */
+    for (i = 0; i < len; i++) {
+        putchar(nib_to_hex[(data >> 4) & 0xF]);
+        putchar(nib_to_hex[data & 0xF]);
+        count += 2;
+        if (count > 72) {
+            putchar('.');
+            putchar('.');
+            putchar('.');
+            break;
+        }
+        data >>= 8;
+    }
+    putchar(' ');
+}
+
+
+
+/****************************************************************************
+*               showhelp
+* Effect: print help text
+****************************************************************************/
+
+private void showhelp()
+{
+    printf("\n");
+    printf("   Item Reported  Range     Item Reported  Range\n");
+    printf("   -------------  -----     -------------  -----\n");
+    printf("   Channels       1 - 16    Programs       1 - 128\n");
+    printf("   Controllers    0 - 127   After Touch    0 - 127\n");
+    printf("   Loudness       0 - 127   Pitch Bend     0 - 16383, center = 8192\n");
+    printf("   Pitches        0 - 127, 60 = c4 = middle C\n");
+    printf(" \n");
+    printf("n toggles notes");
+    showstatus(notes);
+    printf("t displays noteon count since last t\n");
+    printf("b toggles pitch bend, aftertouch");
+    showstatus(bender);
+    printf("c toggles continuous control");
+    showstatus(controls);
+    printf("h toggles program changes");
+    showstatus(pgchanges);
+    printf("x toggles system exclusive");
+    showstatus(excldata);
+    printf("k toggles clock and sense counting only");
+    showstatus(clksencnt);
+    printf("r toggles other real time messages & SMPTE");
+    showstatus(realdata);
+    printf("s displays clock and sense count since last k\n");
+    printf("m toggles channel mode messages");
+    showstatus(chmode);
+    printf("v toggles verbose text");
+    showstatus(verbose);
+    printf("q quits\n");
+    printf("\n");
+}
+
+/****************************************************************************
+*               showstatus
+* Effect: print status of flag
+****************************************************************************/
+
+private void showstatus(boolean flag)
+{
+    printf(", now %s\n", flag ? "ON" : "OFF" );
+}
diff --git a/lib-src/portmidi/pm_test/mm.vcproj b/lib-src/portmidi/pm_test/mm.vcproj
new file mode 100644
index 0000000..279a634
--- /dev/null
+++ b/lib-src/portmidi/pm_test/mm.vcproj
@@ -0,0 +1,445 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="mm"
+	ProjectGUID="{2FC1D7B8-E434-4D6F-A50D-AB262C825BCD}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\mmRelease"
+			IntermediateDirectory=".\mmRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\mmRelease/mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\mmRelease/mm.pch"
+				AssemblerListingLocation=".\mmRelease/"
+				ObjectFile=".\mmRelease/"
+				ProgramDataBaseFileName=".\mmRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\mmRelease/mm.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\mmRelease/mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\mmRelease/mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\mmDebug"
+			IntermediateDirectory=".\mmDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\mmDebug/mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\mmDebug/mm.pch"
+				AssemblerListingLocation=".\mmDebug/"
+				ObjectFile=".\mmDebug/"
+				ProgramDataBaseFileName=".\mmDebug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\mmDebug/mm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\mmDebug/mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\mmDebug/mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\mmDebug/mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\mmDebug/mm.pch"
+				AssemblerListingLocation=".\mmDebug/"
+				ObjectFile=".\mmDebug/"
+				ProgramDataBaseFileName=".\mmDebug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\mmDebug/mm.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\mmDebug/mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\mmDebug/mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\mmRelease/mm.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\mmRelease/mm.pch"
+				AssemblerListingLocation=".\mmRelease/"
+				ObjectFile=".\mmRelease/"
+				ProgramDataBaseFileName=".\mmRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\mmRelease/mm.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\mmRelease/mm.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\mmRelease/mm.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="mm.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/qtest-VC9.vcproj b/lib-src/portmidi/pm_test/qtest-VC9.vcproj
new file mode 100644
index 0000000..4ccc1a1
--- /dev/null
+++ b/lib-src/portmidi/pm_test/qtest-VC9.vcproj
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="QTest"
+	ProjectGUID="{8C30CCF4-0D5F-4CC0-9EF3-76D491B829DF}"
+	RootNamespace="QTest"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="QTest Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\qtest.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="QTest Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\qtest.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\qtest.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/qtest.c b/lib-src/portmidi/pm_test/qtest.c
new file mode 100644
index 0000000..c349133
--- /dev/null
+++ b/lib-src/portmidi/pm_test/qtest.c
@@ -0,0 +1,174 @@
+#include "portmidi.h"
+#include "pmutil.h"
+#include "stdlib.h"
+#include "stdio.h"
+
+
+/* make_msg -- make a psuedo-random message of length n whose content
+ *    is purely a function of i 
+ */
+void make_msg(long msg[], int n, int i)
+{
+    int j;
+    for (j = 0; j < n; j++) {
+        msg[j] = i % (j + 5);
+    }
+} 
+
+
+/* print_msg -- print the content of msg of length n to stdout */
+/**/
+void print_msg(long msg[], int n)
+{
+    int i;
+    for (i = 0; i < n; i++) {
+        printf(" %d", msg[i]);
+    }
+}
+
+
+/* cmp_msg -- compare two messages of length n */
+/**/
+int cmp_msg(long msg[], long msg2[], int n, int i)
+{
+    int j;
+    for (j = 0; j < n; j++) {
+        if (msg[j] != msg2[j]) {
+            printf("Received message %d doesn't match sent message\n", i);
+            printf("in: "); print_msg(msg, n); printf("\n");
+            printf("out:"); print_msg(msg2, n); printf("\n");
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
+
+int main()
+{
+    int msg_len;
+    for (msg_len = 4; msg_len < 100; msg_len += 5) {
+        PmQueue *queue = Pm_QueueCreate(100, msg_len * sizeof(long));
+        int i;
+        long msg[100];
+        long msg2[100];
+
+	printf("msg_len = %d\n", msg_len);
+        if (!queue) {
+            printf("Could not allocate queue\n");
+            return 1;
+        }
+    
+        /* insert/remove 1000 messages */
+        printf("test 1\n");
+        for (i = 0; i < 1357; i++) {
+            make_msg(msg, msg_len, i);
+            if (Pm_Enqueue(queue, msg)) {
+                printf("Pm_Enqueue error\n");
+                return 1;
+            }
+            if (Pm_Dequeue(queue, msg2) != 1) {
+                printf("Pm_Dequeue error\n");
+                return 1;
+            }
+            if (!cmp_msg(msg, msg2, msg_len, i)) {
+                return 1;
+            }
+        }
+    
+        /* make full */
+        printf("test 2\n");
+        for (i = 0; i < 100; i++) {
+            make_msg(msg, msg_len, i);
+            if (Pm_Enqueue(queue, msg)) {
+                printf("Pm_Enqueue error\n");
+                return 1;
+            }
+        }
+    
+        /* alternately remove and insert */
+        for (i = 100; i < 1234; i++) {
+            make_msg(msg, msg_len, i - 100); /* what we expect */
+            if (Pm_Dequeue(queue, msg2) != 1) {
+                printf("Pm_Dequeue error\n");
+                return 1;
+            }
+            if (!cmp_msg(msg, msg2, msg_len, i)) {
+                return 1;
+            }
+            make_msg(msg, msg_len, i);
+            if (Pm_Enqueue(queue, msg)) {
+                printf("Pm_Enqueue error\n");
+                return 1;
+            }
+        }
+    
+        /* remove all */
+        while (!Pm_QueueEmpty(queue)) {
+            make_msg(msg, msg_len, i - 100); /* what we expect */
+            if (Pm_Dequeue(queue, msg2) != 1) {
+                printf("Pm_Dequeue error\n");
+                return 1;
+            }
+            if (!cmp_msg(msg, msg2, msg_len, i)) {
+                return 1;
+            }
+            i++;
+        }
+        if (i != 1334) {
+            printf("Message count error\n");
+	    return 1;
+        }
+    
+        /* now test overflow */
+        printf("test 3\n");
+        for (i = 0; i < 110; i++) {
+            make_msg(msg, msg_len, i);
+            if (Pm_Enqueue(queue, msg) == pmBufferOverflow) {
+	        break; /* this is supposed to execute after 100 messages */
+            }
+        }
+        for (i = 0; i < 100; i++) {
+            make_msg(msg, msg_len, i);
+            if (Pm_Dequeue(queue, msg2) != 1) {
+                printf("Pm_Dequeue error\n");
+		return 1;
+            }
+            if (!cmp_msg(msg, msg2, msg_len, i)) {
+                return 1;
+            }
+        }
+	/* we should detect overflow after removing 100 messages */
+        if (Pm_Dequeue(queue, msg2) != pmBufferOverflow) {
+            printf("Pm_Dequeue overflow expected\n");
+	    return 1;
+        }
+    
+	/* after overflow is detected (and cleared), sender can
+	 * send again
+	 */
+        /* see if function is restored, also test peek */
+        printf("test 4\n");
+        for (i = 0; i < 1357; i++) {
+            long *peek;
+            make_msg(msg, msg_len, i);
+            if (Pm_Enqueue(queue, msg)) {
+                printf("Pm_Enqueue error\n");
+                return 1;
+            }
+            peek = (long *) Pm_QueuePeek(queue);
+            if (!cmp_msg(msg, peek, msg_len, i)) {
+	        return 1;
+            }
+            if (Pm_Dequeue(queue, msg2) != 1) {
+                printf("Pm_Dequeue error\n");
+	        return 1;
+            }
+            if (!cmp_msg(msg, msg2, msg_len, i)) {
+	        return 1;
+            }
+        }
+        Pm_QueueDestroy(queue);
+    }
+    return 0;
+}
diff --git a/lib-src/portmidi/pm_test/qtest.vcproj b/lib-src/portmidi/pm_test/qtest.vcproj
new file mode 100644
index 0000000..0e9b464
--- /dev/null
+++ b/lib-src/portmidi/pm_test/qtest.vcproj
@@ -0,0 +1,356 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="qtest"
+	ProjectGUID="{8C30CCF4-0D5F-4CC0-9EF3-76D491B829DF}"
+	RootNamespace="qtest"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\qtestDebug"
+			IntermediateDirectory=".\qtestDebug"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\qtestDebug\qtest.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\qtestRelease"
+			IntermediateDirectory=".\qtestRelease"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\qtestRelease\qtest.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\qtestDebug\qtest.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\qtestRelease\qtest.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\qtest.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/sysex-VC9.vcproj b/lib-src/portmidi/pm_test/sysex-VC9.vcproj
new file mode 100644
index 0000000..b2d90ab
--- /dev/null
+++ b/lib-src/portmidi/pm_test/sysex-VC9.vcproj
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Sysex"
+	ProjectGUID="{300F59F8-5E94-492B-A899-0EB2B1140E20}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Sysex Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\sysex.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\sysex.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+				Profile="false"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Sysex Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\sysex.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\sysex.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath="sysex.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/sysex.c b/lib-src/portmidi/pm_test/sysex.c
new file mode 100644
index 0000000..3138a6a
--- /dev/null
+++ b/lib-src/portmidi/pm_test/sysex.c
@@ -0,0 +1,519 @@
+/* sysex.c -- example program showing how to send and receive sysex
+    messages
+
+   Messages are stored in a file using 2-digit hexadecimal numbers,
+   one per byte, separated by blanks, with up to 32 numbers per line:
+   F0 14 A7 4B ...
+
+ */
+
+#include "stdio.h"
+#include "stdlib.h"
+#include "assert.h"
+#include "portmidi.h"
+#include "porttime.h"
+#include "string.h"
+#ifdef WIN32
+// need to get declaration for Sleep()
+#include "windows.h"
+#else
+#define Sleep(n) usleep(n * 1000)
+#endif
+
+#define MIDI_SYSEX 0xf0
+#define MIDI_EOX 0xf7
+
+#define STRING_MAX 80
+
+#ifndef true
+#define true 1
+#define false 0
+#endif
+
+int latency = 0;
+
+/* read a number from console */
+/**/
+int get_number(char *prompt)
+{
+    char line[STRING_MAX];
+    int n = 0, i;
+    printf(prompt);
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+
+    }
+    return i;
+}
+
+
+/* loopback test -- send/rcv from 2 to 1000 bytes of random midi data */
+/**/
+void loopback_test()
+{
+    int outp;
+    int inp;
+    PmStream *midi_in;
+    PmStream *midi_out;
+    unsigned char msg[1024];
+    char line[80];
+    long len;
+    int i;
+    int data;
+    PmEvent event;
+    int shift;
+
+    Pt_Start(1, 0, 0);
+    
+    printf("Connect a midi cable from an output port to an input port.\n");
+    printf("This test will send random data via sysex message from output\n");
+    printf("to input and check that the correct data was received.\n");
+    outp = get_number("Type output device number: ");
+    /* Open output with 1ms latency -- when latency is non-zero, the Win32
+       implementation supports sending sysex messages incrementally in a 
+       series of buffers. This is nicer than allocating a big buffer for the
+       message, and it also seems to work better. Either way works.
+     */
+    while ((latency = get_number(
+                     "Latency in milliseconds (0 to send data immediatedly,\n"
+                     "  >0 to send timestamped messages): ")) < 0);
+    Pm_OpenOutput(&midi_out, outp, NULL, 0, NULL, NULL, latency);
+    inp = get_number("Type input device number: ");
+    /* since we are going to send and then receive, make sure the input buffer
+       is large enough for the entire message */
+    Pm_OpenInput(&midi_in, inp, NULL, 512, NULL, NULL);
+
+    srand((unsigned int) Pt_Time()); /* seed for random numbers */
+
+    while (1) {
+        PmError count;
+        long start_time;
+        long error_position = -1; /* 0; -1; -1 for continuous */ 
+        long expected = 0;
+        long actual = 0;
+        /* this modification will run until an error is detected */
+        /* set error_position above to 0 for interactive, -1 for */
+        /* continuous */
+        if (error_position >= 0) {
+            printf("Type return to send message, q to quit: ");
+            fgets(line, STRING_MAX, stdin);
+            if (line[0] == 'q') goto cleanup;
+        }
+
+        /* compose the message */
+        len = rand() % 998 + 2; /* len only counts data bytes */
+        msg[0] = (char) MIDI_SYSEX; /* start of SYSEX message */
+        /* data bytes go from 1 to len */
+        for (i = 0; i < len; i++) {
+/* pick whether data is sequential or random... (docs say random) */
+#define DATA_EXPR (i+1)
+// #define DATA_EXPR rand()
+            msg[i + 1] = DATA_EXPR & 0x7f; /* MIDI data */
+        }
+        /* final EOX goes in len+1, total of len+2 bytes in msg */
+        msg[len + 1] = (char) MIDI_EOX;
+
+        /* sanity check: before we send, there should be no queued data */
+        count = Pm_Read(midi_in, &event, 1);
+
+        if (count != 0) {
+            printf("Before sending anything, a MIDI message was found in\n");
+            printf("the input buffer. Please try again.\n");
+            break;
+		}
+
+        /* send the message */
+        printf("Sending %ld byte sysex message.\n", len + 2);
+        Pm_WriteSysEx(midi_out, 0, msg);
+
+        /* receive the message and compare to msg[] */
+        data = 0;
+        shift = 0;
+        i = 0;
+        start_time = Pt_Time();
+        error_position = -1;
+        /* allow up to 2 seconds for transmission */
+        while (data != MIDI_EOX && start_time + 2000 > Pt_Time()) {
+            count = Pm_Read(midi_in, &event, 1);
+            if (count == 0) {
+                Sleep(1); /* be nice: give some CPU time to the system */
+                continue; /* continue polling for input */
+            }
+            
+            /* printf("read %lx ", event.message);
+               fflush(stdout); */
+            
+            /* compare 4 bytes of data until you reach an eox */
+            for (shift = 0; shift < 32 && (data != MIDI_EOX); shift += 8) {
+                data = (event.message >> shift) & 0xFF;
+                if (data != msg[i] && error_position < 0) {
+                    error_position = i;
+                    expected = msg[i];
+                    actual = data;
+                }
+                i++;
+            }
+        }
+        if (error_position >= 0) {
+            printf("Error at byte %ld: sent %lx recd %lx\n", error_position, 
+                   expected, actual);
+        } else if (i != len + 2) {
+            printf("Error: byte %d not received\n", i);
+        } else {
+            printf("Correctly ");
+        }
+        printf("received %d byte sysex message.\n", i);
+    }
+cleanup:
+    Pm_Close(midi_out);
+    Pm_Close(midi_in);
+    return;
+}
+
+
+/* send_multiple test -- send many sysex messages */
+/**/
+void send_multiple_test()
+{
+    int outp;
+    int length;
+    int num_msgs;
+    PmStream *midi_out;
+    unsigned char msg[1024];
+    int i;
+    PtTimestamp start_time;
+    PtTimestamp stop_time;
+
+    Pt_Start(1, 0, 0);
+    
+    printf("This is for performance testing. You should be sending to this\n");
+    printf("program running the receive multiple test. Do NOT send to\n");
+    printf("a synthesizer or you risk reprogramming it\n");
+    outp = get_number("Type output device number: ");
+    while ((latency = get_number(
+                     "Latency in milliseconds (0 to send data immediatedly,\n"
+                     "  >0 to send timestamped messages): ")) < 0);
+    Pm_OpenOutput(&midi_out, outp, NULL, 0, NULL, NULL, latency);
+    while ((length = get_number("Message length (7 - 1024): ")) < 7 ||
+           length > 1024) ;
+    while ((num_msgs = get_number("Number of messages: ")) < 1);
+    /* latency, length, and num_msgs should now all be valid */
+    /* compose the message except for sequence number in first 5 bytes */
+    msg[0] = (char) MIDI_SYSEX;
+    for (i = 6; i < length - 1; i++) {
+        msg[i] = i % 128; /* this is just filler */
+    }
+    msg[length - 1] = (char) MIDI_EOX;
+
+    start_time = Pt_Time();
+    /* send the messages */
+    for (i = num_msgs; i > 0; i--) {
+        /* insert sequence number into first 5 data bytes */
+        /* sequence counts down to zero */
+        int j;
+        int count = i;
+        /* 7 bits of message count i goes into each data byte */
+        for (j = 1; j <= 5; j++) {
+            msg[j] = count & 127;
+            count >>= 7;
+        }
+        /* send the message */
+        Pm_WriteSysEx(midi_out, 0, msg);
+    }
+    stop_time = Pt_Time();
+    Pm_Close(midi_out);
+    return;
+}
+
+#define MAX_MSG_LEN 1024
+static unsigned char receive_msg[MAX_MSG_LEN];
+static long receive_msg_index;
+static long receive_msg_length;
+static long receive_msg_count;
+static long receive_msg_error;
+static long receive_msg_messages;
+static PmStream *receive_msg_midi_in;
+static int receive_poll_running;
+
+/* receive_poll -- callback function to check for midi input */
+/**/
+void receive_poll(PtTimestamp timestamp, void *userData)
+{
+    PmError count;
+    PmEvent event;
+    int shift;
+    int data = 0;
+    int i;
+    
+    if (!receive_poll_running) return; /* wait until midi device is opened */
+    shift = 0;
+    while (data != MIDI_EOX) {
+        count = Pm_Read(receive_msg_midi_in, &event, 1);
+        if (count == 0) return;
+
+        /* compare 4 bytes of data until you reach an eox */
+        for (shift = 0; shift < 32 && (data != MIDI_EOX); shift += 8) {
+            receive_msg[receive_msg_index++] = data = 
+                (event.message >> shift) & 0xFF;
+            if (receive_msg_index >= MAX_MSG_LEN) {
+                printf("error: incoming sysex too long\n");
+                goto error;
+            }
+        }
+    }
+    /* check the message */
+    if (receive_msg_length == 0) {
+        receive_msg_length = receive_msg_index;
+    }
+    if (receive_msg_length != receive_msg_index) {
+        printf("error: incoming sysex wrong length\n");
+        goto error;
+    }
+    if (receive_msg[0] != MIDI_SYSEX) {
+        printf("error: incoming sysex missing status byte\n");
+        goto error;
+    }
+    /* get and check the count */
+    count = 0;
+    for (i = 0; i < 5; i++) {
+        count += receive_msg[i + 1] << (7 * i);
+    }
+    if (receive_msg_count == -1) {
+        receive_msg_count = count;
+        receive_msg_messages = count;
+    }
+    if (receive_msg_count != count) {
+        printf("error: incoming sysex has wrong count\n");
+        goto error;
+    }
+    for (i = 6; i < receive_msg_index - 1; i++) {
+        if (receive_msg[i] != i % 128) {
+            printf("error: incoming sysex has bad data\n");
+            goto error;
+        }
+    }
+    if (receive_msg[receive_msg_length - 1] != MIDI_EOX) goto error;
+    receive_msg_index = 0; /* get ready for next message */
+    receive_msg_count--;
+    return;
+ error:
+    receive_msg_error = 1;
+    return;
+}
+
+
+/* receive_multiple_test -- send/rcv from 2 to 1000 bytes of random midi data */
+/**/
+void receive_multiple_test()
+{
+    PmError err;
+    int inp;
+    
+    printf("This test expects to receive data sent by the send_multiple test\n");
+    printf("The test will check that correct data is received.\n");
+
+    /* Important: start PortTime first -- if it is not started first, it will
+       be started by PortMidi, and then our attempt to open again will fail */
+    receive_poll_running = false;
+    if (err = Pt_Start(1, receive_poll, 0)) {
+        printf("PortTime error code: %d\n", err);
+        goto cleanup;
+    }
+    inp = get_number("Type input device number: ");
+    Pm_OpenInput(&receive_msg_midi_in, inp, NULL, 512, NULL, NULL);
+    receive_msg_index = 0;
+    receive_msg_length = 0;
+    receive_msg_count = -1;
+    receive_msg_error = 0;
+    receive_poll_running = true;
+    while ((!receive_msg_error) && (receive_msg_count != 0)) {
+#ifdef WIN32
+        Sleep(1000);
+#else
+        sleep(1); /* block and wait */
+#endif
+    }
+    if (receive_msg_error) {
+        printf("Receive_multiple test encountered an error\n");
+    } else {
+        printf("Receive_multiple test successfully received %d sysex messages\n", 
+               receive_msg_messages);
+    }
+cleanup:
+    receive_poll_running = false;
+    Pm_Close(receive_msg_midi_in);
+    Pt_Stop();
+    return;
+}
+
+
+#define is_real_time_msg(msg) ((0xF0 & Pm_MessageStatus(msg)) == 0xF8)
+
+
+void receive_sysex()
+{
+    char line[80];
+    FILE *f;
+    PmStream *midi;
+    int shift = 0;
+    int data = 0;
+    int bytes_on_line = 0;
+    PmEvent msg;
+
+    /* determine which output device to use */
+    int i = get_number("Type input device number: ");
+
+    /* open input device */
+    Pm_OpenInput(&midi, i, NULL, 512, NULL, NULL);
+    printf("Midi Input opened, type file for sysex data: ");
+
+    /* open file */
+    fgets(line, STRING_MAX, stdin);
+    /* remove the newline character */
+    if (strlen(line) > 0) line[strlen(line) - 1] = 0;
+    f = fopen(line, "w");
+    if (!f) {
+        printf("Could not open %s\n", line);
+        Pm_Close(midi);
+        return;
+    }
+
+    printf("Ready to receive a sysex message\n");
+
+    /* read data and write to file */
+    while (data != MIDI_EOX) {
+        PmError count;
+        count = Pm_Read(midi, &msg, 1);
+        /* CAUTION: this causes busy waiting. It would be better to 
+           be in a polling loop to avoid being compute bound. PortMidi
+           does not support a blocking read since this is so seldom
+           useful.
+         */
+        if (count == 0) continue;
+        /* ignore real-time messages */
+        if (is_real_time_msg(Pm_MessageStatus(msg.message))) continue;
+
+        /* write 4 bytes of data until you reach an eox */
+        for (shift = 0; shift < 32 && (data != MIDI_EOX); shift += 8) {
+            data = (msg.message >> shift) & 0xFF;
+            /* if this is a status byte that's not MIDI_EOX, the sysex
+               message is incomplete and there is no more sysex data */
+            if (data & 0x80 && data != MIDI_EOX) break;
+            fprintf(f, "%2x ", data);
+            if (++bytes_on_line >= 16) {
+                fprintf(f, "\n");
+                bytes_on_line = 0;
+            }
+        }
+    }
+    fclose(f);
+    Pm_Close(midi);
+}
+
+
+void send_sysex()
+{
+    char line[80];
+    FILE *f;
+    PmStream *midi;
+    int data;
+    int shift = 0;
+    PmEvent msg;
+
+	/* determine which output device to use */
+    int i = get_number("Type output device number: ");
+    while ((latency = get_number(
+                     "Latency in milliseconds (0 to send data immediatedly,\n"
+                     "  >0 to send timestamped messages): ")) < 0);
+
+    msg.timestamp = 0; /* no need for timestamp */
+
+	/* open output device */
+    Pm_OpenOutput(&midi, i, NULL, 0, NULL, NULL, latency);
+	printf("Midi Output opened, type file with sysex data: ");
+
+    /* open file */
+    fgets(line, STRING_MAX, stdin);
+    /* remove the newline character */
+    if (strlen(line) > 0) line[strlen(line) - 1] = 0;
+    f = fopen(line, "r");
+    if (!f) {
+        printf("Could not open %s\n", line);
+        Pm_Close(midi);
+        return;
+    }
+
+    /* read file and send data */
+    msg.message = 0;
+    while (1) {
+        /* get next byte from file */
+
+        if (fscanf(f, "%x", &data) == 1) {
+            /* printf("read %x, ", data); */
+            /* OR byte into message at proper offset */
+            msg.message |= (data << shift);
+            shift += 8;
+        }
+        /* send the message if it's full (shift == 32) or if we are at end */
+        if (shift == 32 || data == MIDI_EOX) {
+            /* this will send sysex data 4 bytes at a time -- it would
+               be much more efficient to send multiple PmEvents at once
+               but this method is simpler. See Pm_WriteSysEx for a more
+               efficient code example.
+             */
+            Pm_Write(midi, &msg, 1);
+            msg.message = 0;
+            shift = 0;
+        }
+        if (data == MIDI_EOX) { /* end of message */
+            fclose(f);
+            Pm_Close(midi);
+            return;
+        }
+    }
+}
+
+
+int main()
+{
+    int i;
+    char line[80];
+    
+    /* list device information */
+    for (i = 0; i < Pm_CountDevices(); i++) {
+        const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+        printf("%d: %s, %s", i, info->interf, info->name);
+        if (info->input) printf(" (input)");
+        if (info->output) printf(" (output)");
+        printf("\n");
+    }
+    while (1) {
+        printf("Type r to receive sysex, s to send,"
+               " l for loopback test, m to send multiple,"
+               " n to receive multiple, q to quit: ");
+        fgets(line, STRING_MAX, stdin);
+        switch (line[0]) {
+          case 'r':
+            receive_sysex();
+            break;
+          case 's':
+            send_sysex();
+            break;
+          case 'l':
+            loopback_test();
+            break;
+          case 'm':
+            send_multiple_test();
+            break;
+          case 'n':
+            receive_multiple_test();
+            break;
+          case 'q':
+            exit(0);
+          default:
+            break;
+        }
+    }
+    return 0;
+}
diff --git a/lib-src/portmidi/pm_test/sysex.vcproj b/lib-src/portmidi/pm_test/sysex.vcproj
new file mode 100644
index 0000000..76a74c5
--- /dev/null
+++ b/lib-src/portmidi/pm_test/sysex.vcproj
@@ -0,0 +1,443 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="sysex"
+	ProjectGUID="{300F59F8-5E94-492B-A899-0EB2B1140E20}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\sysexDebug"
+			IntermediateDirectory=".\sysexDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\sysexDebug/sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\sysexDebug/sysex.pch"
+				AssemblerListingLocation=".\sysexDebug/"
+				ObjectFile=".\sysexDebug/"
+				ProgramDataBaseFileName=".\sysexDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\sysexDebug/sysex.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\sysexDebug/sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+				Profile="false"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\sysexDebug/sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\sysexRelease"
+			IntermediateDirectory=".\sysexRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\sysexRelease/sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\sysexRelease/sysex.pch"
+				AssemblerListingLocation=".\sysexRelease/"
+				ObjectFile=".\sysexRelease/"
+				ProgramDataBaseFileName=".\sysexRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\sysexRelease/sysex.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\sysexRelease/sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\sysexRelease/sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\sysexDebug/sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\sysexDebug/sysex.pch"
+				AssemblerListingLocation=".\sysexDebug/"
+				ObjectFile=".\sysexDebug/"
+				ProgramDataBaseFileName=".\sysexDebug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib"
+				OutputFile=".\sysexDebug/sysex.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\sysexDebug/sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+				Profile="false"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\sysexDebug/sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\sysexRelease/sysex.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\pm_common,..\porttime"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\sysexRelease/sysex.pch"
+				AssemblerListingLocation=".\sysexRelease/"
+				ObjectFile=".\sysexRelease/"
+				ProgramDataBaseFileName=".\sysexRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\sysexRelease/sysex.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\sysexRelease/sysex.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\sysexRelease/sysex.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="sysex.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/test-VC9.vcproj b/lib-src/portmidi/pm_test/test-VC9.vcproj
new file mode 100644
index 0000000..a341de9
--- /dev/null
+++ b/lib-src/portmidi/pm_test/test-VC9.vcproj
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Test"
+	ProjectGUID="{49FA3196-A8F8-4E22-98C3-F3A5197CD06D}"
+	RootNamespace="Test"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Test Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\test.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Debug VC9&quot;;&quot;..\porttime\Debug VC9&quot;"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\$(OutDir)\test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Test Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\$(OutDir)\test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\test.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="portmidi.lib porttime.lib odbc32.lib odbccp32.lib winmm.lib"
+				OutputFile=".\$(OutDir)\test.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="&quot;..\pm_win\Release VC9&quot;;&quot;..\porttime\Release VC9&quot;"
+				ProgramDatabaseFile=".\$(OutDir)\test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="test.c"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/test.c b/lib-src/portmidi/pm_test/test.c
new file mode 100644
index 0000000..0cd731a
--- /dev/null
+++ b/lib-src/portmidi/pm_test/test.c
@@ -0,0 +1,482 @@
+#include "portmidi.h"
+#include "porttime.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+#include "assert.h"
+
+#define INPUT_BUFFER_SIZE 100
+#define OUTPUT_BUFFER_SIZE 0
+#define DRIVER_INFO NULL
+#define TIME_PROC ((long (*)(void *)) Pt_Time)
+#define TIME_INFO NULL
+#define TIME_START Pt_Start(1, 0, 0) /* timer started w/millisecond accuracy */
+
+#define STRING_MAX 80 /* used for console input */
+
+long latency = 0;
+
+/* crash the program to test whether midi ports are closed */
+/**/
+void doSomethingReallyStupid() {
+	int * tmp = NULL;
+	*tmp = 5;
+}
+
+
+/* exit the program without any explicit cleanup */
+/**/
+void doSomethingStupid() {
+	assert(0);
+}
+
+
+/* read a number from console */
+/**/
+int get_number(char *prompt)
+{
+    char line[STRING_MAX];
+    int n = 0, i;
+    printf(prompt);
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+
+    }
+    return i;
+}
+
+
+/*
+ * the somethingStupid parameter can be set to simulate a program crash.
+ * We want PortMidi to close Midi ports automatically in the event of a
+ * crash because Windows does not (and this may cause an OS crash)
+ */
+void main_test_input(unsigned int somethingStupid) {
+    PmStream * midi;
+    PmError status, length;
+    PmEvent buffer[1];
+    int num = 10;
+    int i = get_number("Type input number: ");
+    /* It is recommended to start timer before Midi; otherwise, PortMidi may
+       start the timer with its (default) parameters
+     */
+    TIME_START;
+
+    /* open input device */
+    Pm_OpenInput(&midi, 
+                 i,
+                 DRIVER_INFO, 
+                 INPUT_BUFFER_SIZE, 
+                 TIME_PROC, 
+                 TIME_INFO);
+
+    printf("Midi Input opened. Reading %d Midi messages...\n", num);
+    Pm_SetFilter(midi, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);
+    /* empty the buffer after setting filter, just in case anything
+       got through */
+    while (Pm_Poll(midi)) {
+        Pm_Read(midi, buffer, 1);
+    }
+    /* now start paying attention to messages */
+    i = 0; /* count messages as they arrive */
+    while (i < num) {
+        status = Pm_Poll(midi);
+        if (status == TRUE) {
+            length = Pm_Read(midi,buffer, 1);
+            if (length > 0) {
+                printf("Got message %d: time %ld, %2lx %2lx %2lx\n",
+                       i,
+                       buffer[0].timestamp,
+                       Pm_MessageStatus(buffer[0].message),
+                       Pm_MessageData1(buffer[0].message),
+                       Pm_MessageData2(buffer[0].message));
+                i++;
+            } else {
+                assert(0);
+            }
+        }
+        /* simulate crash if somethingStupid is 1 or 2 */
+        if ((i > (num/2)) && (somethingStupid == 1)) {
+            doSomethingStupid();
+        } else if ((i > (num/2)) && (somethingStupid == 2)) {
+            doSomethingReallyStupid();
+        }
+    }
+
+    /* close device (this not explicitly needed in most implementations) */
+    printf("ready to close...");
+
+    Pm_Close(midi);
+    printf("done closing...");
+}
+
+
+
+void main_test_output() {
+    PmStream * midi;
+	char line[80];
+    long off_time;
+    int chord[] = { 60, 67, 76, 83, 90 };
+    #define chord_size 5 
+    PmEvent buffer[chord_size];
+    PmTimestamp timestamp;
+
+    /* determine which output device to use */
+    int i = get_number("Type output number: ");
+
+    /* It is recommended to start timer before PortMidi */
+    TIME_START;
+
+    /* open output device -- since PortMidi avoids opening a timer
+       when latency is zero, we will pass in a NULL timer pointer
+       for that case. If PortMidi tries to access the time_proc,
+       we will crash, so this test will tell us something. */
+    Pm_OpenOutput(&midi, 
+                  i, 
+                  DRIVER_INFO,
+                  OUTPUT_BUFFER_SIZE, 
+                  (latency == 0 ? NULL : TIME_PROC),
+                  (latency == 0 ? NULL : TIME_INFO), 
+                  latency);
+    printf("Midi Output opened with %ld ms latency.\n", latency);
+
+    /* output note on/off w/latency offset; hold until user prompts */
+    printf("ready to send program 1 change... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    /* if we were writing midi for immediate output, we could always use
+       timestamps of zero, but since we may be writing with latency, we
+       will explicitly set the timestamp to "now" by getting the time.
+       The source of timestamps should always correspond to the TIME_PROC
+       and TIME_INFO parameters used in Pm_OpenOutput(). */
+    buffer[0].timestamp = TIME_PROC(TIME_INFO);
+    /* Send a program change to increase the chances we will hear notes */
+    /* Program 0 is usually a piano, but you can change it here: */
+#define PROGRAM 0
+    buffer[0].message = Pm_Message(0xC0, PROGRAM, 0);
+    Pm_Write(midi, buffer, 1);
+
+    printf("ready to note-on... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    buffer[0].timestamp = TIME_PROC(TIME_INFO);
+    buffer[0].message = Pm_Message(0x90, 60, 100);
+    Pm_Write(midi, buffer, 1);
+    printf("ready to note-off... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    buffer[0].timestamp = TIME_PROC(TIME_INFO);
+    buffer[0].message = Pm_Message(0x90, 60, 0);
+    Pm_Write(midi, buffer, 1);
+
+    /* output short note on/off w/latency offset; hold until user prompts */
+    printf("ready to note-on (short form)... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    Pm_WriteShort(midi, TIME_PROC(TIME_INFO),
+                  Pm_Message(0x90, 60, 100));
+    printf("ready to note-off (short form)... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    Pm_WriteShort(midi, TIME_PROC(TIME_INFO),
+                  Pm_Message(0x90, 60, 0));
+
+    /* output several note on/offs to test timing. 
+       Should be 1s between notes */
+    printf("chord will arpeggiate if latency > 0\n");
+    printf("ready to chord-on/chord-off... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+    timestamp = TIME_PROC(TIME_INFO);
+    for (i = 0; i < chord_size; i++) {
+        buffer[i].timestamp = timestamp + 1000 * i;
+        buffer[i].message = Pm_Message(0x90, chord[i], 100);
+    }
+    Pm_Write(midi, buffer, chord_size);
+
+    off_time = timestamp + 1000 + chord_size * 1000; 
+    while (TIME_PROC(TIME_INFO) < off_time) 
+		/* busy wait */;
+    for (i = 0; i < chord_size; i++) {
+        buffer[i].timestamp = timestamp + 1000 * i;
+        buffer[i].message = Pm_Message(0x90, chord[i], 0);
+    }
+    Pm_Write(midi, buffer, chord_size);    
+
+    /* close device (this not explicitly needed in most implementations) */
+    printf("ready to close and terminate... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+	
+    Pm_Close(midi);
+    Pm_Terminate();
+    printf("done closing and terminating...\n");
+}
+
+
+void main_test_both()
+{
+    int i = 0;
+    int in, out;
+    PmStream * midi, * midiOut;
+    PmEvent buffer[1];
+    PmError status, length;
+    int num = 10;
+    
+    in = get_number("Type input number: ");
+    out = get_number("Type output number: ");
+
+    /* In is recommended to start timer before PortMidi */
+    TIME_START;
+
+    Pm_OpenOutput(&midiOut, 
+                  out, 
+                  DRIVER_INFO,
+                  OUTPUT_BUFFER_SIZE, 
+                  TIME_PROC,
+                  TIME_INFO, 
+                  latency);
+    printf("Midi Output opened with %ld ms latency.\n", latency);
+    /* open input device */
+    Pm_OpenInput(&midi, 
+                 in,
+                 DRIVER_INFO, 
+                 INPUT_BUFFER_SIZE, 
+                 TIME_PROC, 
+                 TIME_INFO);
+    printf("Midi Input opened. Reading %d Midi messages...\n",num);
+    Pm_SetFilter(midi, PM_FILT_ACTIVE | PM_FILT_CLOCK);
+    /* empty the buffer after setting filter, just in case anything
+       got through */
+    while (Pm_Poll(midi)) {
+        Pm_Read(midi, buffer, 1);
+    }
+    i = 0;
+    while (i < num) {
+        status = Pm_Poll(midi);
+        if (status == TRUE) {
+            length = Pm_Read(midi,buffer,1);
+            if (length > 0) {
+                Pm_Write(midiOut, buffer, 1);
+                printf("Got message %d: time %ld, %2lx %2lx %2lx\n",
+					   i,
+                       buffer[0].timestamp,
+                       Pm_MessageStatus(buffer[0].message),
+                       Pm_MessageData1(buffer[0].message),
+                       Pm_MessageData2(buffer[0].message));
+                i++;
+            } else {
+                assert(0);
+            }
+        }
+    }
+
+    /* close midi devices */
+    Pm_Close(midi);
+    Pm_Close(midiOut);
+    Pm_Terminate(); 
+}
+
+
+/* main_test_stream exercises windows winmm API's stream mode */
+/*    The winmm stream mode is used for latency>0, and sends
+   timestamped messages. The timestamps are relative (delta) 
+   times, whereas PortMidi times are absolute. Since peculiar
+   things happen when messages are not always sent in advance,
+   this function allows us to exercise the system and test it.
+ */
+void main_test_stream() {
+    PmStream * midi;
+	char line[80];
+    PmEvent buffer[16];
+
+	/* determine which output device to use */
+    int i = get_number("Type output number: ");
+
+	latency = 500; /* ignore LATENCY for this test and
+				      fix the latency at 500ms */
+
+    /* It is recommended to start timer before PortMidi */
+    TIME_START;
+
+	/* open output device */
+    Pm_OpenOutput(&midi, 
+                  i, 
+                  DRIVER_INFO,
+                  OUTPUT_BUFFER_SIZE, 
+                  TIME_PROC,
+                  TIME_INFO, 
+                  latency);
+    printf("Midi Output opened with %ld ms latency.\n", latency);
+
+    /* output note on/off w/latency offset; hold until user prompts */
+    printf("ready to send output... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+
+    /* if we were writing midi for immediate output, we could always use
+       timestamps of zero, but since we may be writing with latency, we
+       will explicitly set the timestamp to "now" by getting the time.
+       The source of timestamps should always correspond to the TIME_PROC
+       and TIME_INFO parameters used in Pm_OpenOutput(). */
+    buffer[0].timestamp = TIME_PROC(TIME_INFO);
+    buffer[0].message = Pm_Message(0xC0, 0, 0);
+	buffer[1].timestamp = buffer[0].timestamp;
+	buffer[1].message = Pm_Message(0x90, 60, 100);
+	buffer[2].timestamp = buffer[0].timestamp + 1000;
+	buffer[2].message = Pm_Message(0x90, 62, 100);
+	buffer[3].timestamp = buffer[0].timestamp + 2000;
+	buffer[3].message = Pm_Message(0x90, 64, 100);
+	buffer[4].timestamp = buffer[0].timestamp + 3000;
+	buffer[4].message = Pm_Message(0x90, 66, 100);
+	buffer[5].timestamp = buffer[0].timestamp + 4000;
+	buffer[5].message = Pm_Message(0x90, 60, 0);
+	buffer[6].timestamp = buffer[0].timestamp + 4000;
+	buffer[6].message = Pm_Message(0x90, 62, 0);
+	buffer[7].timestamp = buffer[0].timestamp + 4000;
+	buffer[7].message = Pm_Message(0x90, 64, 0);
+	buffer[8].timestamp = buffer[0].timestamp + 4000;
+	buffer[8].message = Pm_Message(0x90, 66, 0);
+
+    Pm_Write(midi, buffer, 9);
+#ifdef SEND8
+	/* Now, we're ready for the real test.
+	   Play 4 notes at now, now+500, now+1000, and now+1500
+	   Then wait until now+2000.
+	   Play 4 more notes as before.
+	   We should hear 8 evenly spaced notes. */
+	now = TIME_PROC(TIME_INFO);
+	for (i = 0; i < 4; i++) {
+		buffer[i * 2].timestamp = now + (i * 500);
+		buffer[i * 2].message = Pm_Message(0x90, 60, 100);
+		buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
+		buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
+	}
+    Pm_Write(midi, buffer, 8);
+
+    while (Pt_Time() < now + 2500) 
+		/* busy wait */;
+	/* now we are 500 ms behind schedule, but since the latency
+	   is 500, the delay should not be audible */
+	now += 2000;
+	for (i = 0; i < 4; i++) {
+		buffer[i * 2].timestamp = now + (i * 500);
+		buffer[i * 2].message = Pm_Message(0x90, 60, 100);
+		buffer[i * 2 + 1].timestamp = now + 250 + (i * 500);
+		buffer[i * 2 + 1].message = Pm_Message(0x90, 60, 0);
+	}
+    Pm_Write(midi, buffer, 8);
+#endif
+    /* close device (this not explicitly needed in most implementations) */
+    printf("ready to close and terminate... (type RETURN):");
+    fgets(line, STRING_MAX, stdin);
+	
+    Pm_Close(midi);
+    Pm_Terminate();
+    printf("done closing and terminating...\n");
+}
+
+
+void show_usage()
+{
+    printf("Usage: test [-h] [-l latency-in-ms]\n");
+    exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+    int default_in;
+    int default_out;
+    int i = 0, n = 0;
+    char line[STRING_MAX];
+    int test_input = 0, test_output = 0, test_both = 0, somethingStupid = 0;
+    int stream_test = 0;
+    int latency_valid = FALSE;
+    
+    for (i = 1; i < argc; i++) {
+        if (strcmp(argv[i], "-h") == 0) {
+            show_usage();
+        } else if (strcmp(argv[i], "-l") == 0 && (i + 1 < argc)) {
+            i = i + 1;
+            latency = atoi(argv[i]);
+            printf("Latency will be %ld\n", latency);
+			latency_valid = TRUE;
+        } else {
+            show_usage();
+        }
+    }
+
+	while (!latency_valid) {
+		printf("Latency in ms: ");
+		if (scanf("%ld", &latency) == 1) {
+			latency_valid = TRUE;
+		}
+	}
+
+    /* determine what type of test to run */
+    printf("begin portMidi test...\n");
+    printf("%s%s%s%s%s",
+           "enter your choice...\n    1: test input\n",
+           "    2: test input (fail w/assert)\n",
+           "    3: test input (fail w/NULL assign)\n",
+           "    4: test output\n    5: test both\n",
+	       "    6: stream test\n");
+    while (n != 1) {
+        n = scanf("%d", &i);
+        fgets(line, STRING_MAX, stdin);
+        switch(i) {
+        case 1: 
+            test_input = 1;
+            break;
+        case 2: 
+            test_input = 1;
+            somethingStupid = 1;
+            break;
+        case 3: 
+            test_input = 1;
+            somethingStupid = 2;
+            break;
+        case 4: 
+            test_output = 1;
+            break;
+        case 5:
+            test_both = 1;
+            break;
+		case 6:
+			stream_test = 1;
+			break;
+        default:
+            printf("got %d (invalid input)\n", n);
+            break;
+        }
+    }
+    
+    /* list device information */
+    default_in = Pm_GetDefaultInputDeviceID();
+    default_out = Pm_GetDefaultOutputDeviceID();
+    for (i = 0; i < Pm_CountDevices(); i++) {
+        char *deflt;
+        const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
+        if (((test_input  | test_both) & info->input) |
+            ((test_output | test_both | stream_test) & info->output)) {
+            printf("%d: %s, %s", i, info->interf, info->name);
+            if (info->input) {
+                deflt = (i == default_in ? "default " : "");
+                printf(" (%sinput)", deflt);
+            }
+            if (info->output) {
+                deflt = (i == default_out ? "default " : "");
+                printf(" (%soutput)", deflt);
+            }
+            printf("\n");
+        }
+    }
+    
+    /* run test */
+    if (stream_test) {
+        main_test_stream();
+    } else if (test_input) {
+        main_test_input(somethingStupid);
+    } else if (test_output) {
+        main_test_output();
+    } else if (test_both) {
+        main_test_both();
+    }
+    
+    printf("finished portMidi test...type ENTER to quit...");
+    fgets(line, STRING_MAX, stdin);
+    return 0;
+}
diff --git a/lib-src/portmidi/pm_test/test.vcproj b/lib-src/portmidi/pm_test/test.vcproj
new file mode 100644
index 0000000..791e2a7
--- /dev/null
+++ b/lib-src/portmidi/pm_test/test.vcproj
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="test"
+	ProjectGUID="{49FA3196-A8F8-4E22-98C3-F3A5197CD06D}"
+	RootNamespace="test"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\testRelease"
+			IntermediateDirectory=".\testRelease"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\testRelease/test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\testRelease/test.pch"
+				AssemblerListingLocation=".\testRelease/"
+				ObjectFile=".\testRelease/"
+				ProgramDataBaseFileName=".\testRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\testRelease/test.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\testRelease/test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\testRelease/test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\testDebug"
+			IntermediateDirectory=".\testDebug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\testDebug/test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\testDebug/test.pch"
+				AssemblerListingLocation=".\testDebug/"
+				ObjectFile=".\testDebug/"
+				ProgramDataBaseFileName=".\testDebug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="advapi32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib $(NOINHERIT)"
+				OutputFile=".\testDebug/test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\testDebug/test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\testDebug/test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\testDebug/test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\testDebug/test.pch"
+				AssemblerListingLocation=".\testDebug/"
+				ObjectFile=".\testDebug/"
+				ProgramDataBaseFileName=".\testDebug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/VERBOSE:LIB"
+				AdditionalDependencies="advapi32.lib winmm.lib ..\pm_win\Debug\portmidi.lib ..\porttime\Debug\porttime.lib $(NOINHERIT)"
+				OutputFile=".\testDebug/test.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\testDebug/test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\testDebug/test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\testRelease/test.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="../pm_common,../porttime"
+				PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\testRelease/test.pch"
+				AssemblerListingLocation=".\testRelease/"
+				ObjectFile=".\testRelease/"
+				ProgramDataBaseFileName=".\testRelease/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib ..\pm_win\Release\portmidi.lib ..\porttime\Release\porttime.lib"
+				OutputFile=".\testRelease/test.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\testRelease/test.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\testRelease/test.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="test.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/pm_test/txdata.syx b/lib-src/portmidi/pm_test/txdata.syx
new file mode 100644
index 0000000..a4848b6
--- /dev/null
+++ b/lib-src/portmidi/pm_test/txdata.syx
@@ -0,0 +1,257 @@
+20  0 1d  4  c  6  0 34  1 4d  4  d 1f  7  3  6 
+ c 5e  4 4d  d  b 18  5  3  6  0 3d  1 4a 16 18 
+1f  8  3  6  d  0  1 63  4 13 3a 23  0  0  0  2 
+ c  2  4  0 63 32  0  0  0 32  0 47 72 61 6e 64 
+50 69 61 6e 6f 63 63 63 32 32 32  0  0  0  0  0 
+10  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  9  9  f  c 27  2 35 37 10 1f  4  3  4 
+ d 19  4 56  5 16 1f  f  8  d  c  0 43 60  4  e 
+1f  c  3  7  e  0 43 63  5 10 3c 14  8  2 1b 56 
+ 5  2  4  0 63 32  0  0  0 32  0 4c 6f 54 69 6e 
+65 38 31 5a 20 63 63 63 32 32 32  0 7f  0  1  0 
+18  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  e  f  e  9  0  3 43 2d  e 1f  f  5  7 
+ f 16 43 5a  0  0 1f 12  6  8  d  0  3 63  4  0 
+1f 12  6  8  f  0  2 63  4  6 34 14  0  1  2 4e 
+18  2  4  0 63 32  0 32  0 32  0 44 79 6e 6f 6d 
+69 74 65 45 50 63 63 63 32 32 32  0 70  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  b  1  b  8 18 40 5f  a  e 1f 1f  0  a 
+ f  0 40 5f  4  0 1f 1f  0  a  f  0 40 63  5  6 
+1f 1f  0  a  f  0 40 5f  0  8 1f 20  0  3  0 5a 
+18  4  4  0 63 32 32  0  0 32  0 50 65 72 63 4f 
+72 67 61 6e 20 63 63 63 32 32 32  0  0  0  0  0 
+ 1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  b  7  f  9  0  4 49 13 13 1f  8  7  5 
+ e  0  2 58  0  c 1f  6  4  6  f 23  3 46 10  a 
+1f  7  8  c  d  0  2 63  8  b  2 1c  0  0  0 52 
+18  4  4  0 63 32  0 32  0 32  0 54 68 69 6e 20 
+43 6c 61 76 20 63 63 63 32 32 32  0 70  0 20  0 
+10  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  c  0  6  1  a  4 50 20  e 1f  c  0  6 
+ 1  a  4 50 1f  8 1f  b  9  5  e  0  2 63  5  e 
+1f  b  9  5  e  0  3 63  4  8  4 1a  0  0  0 52 
+1d  2  4  0 63 32  0 32  0 32  0 42 72 69 74 65 
+43 65 6c 73 74 63 63 63 32 32 32  0 20  0 26  0 
+ 1  0  8  4  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  f 1f  4  8  f  0 3a 51  4  b  e 1f  0  8 
+ f  0 22 4b  4  3  f 1a  b  8  d  0 3b 36  9  3 
+12 1f  0  8  f  0 22 5d  4  b 3a 1e 19  5  0 52 
+18  4  4  0 63 32  0  0  0 32  0 54 72 75 6d 70 
+65 74 38 31 5a 63 63 63 32 32 32  0  0  0 50  0 
+51  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  c  5  0  8  0  0  2 4a  4  b  f 1f  0  8 
+ f  0  2 3f  4  3 1f  f  0  8  0 23  3 44  b  3 
+10 1f  0  9  f  0  2 5e  4  c 3a 1f 19  7  0 52 
+18  4  4  0 63 32  0  0  0 32  0 46 6c 75 67 65 
+6c 68 6f 72 6e 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 10 1f  0  8  f  0 42 4a  0  3 11 1f  0  8 
+ f  a 43 51  0  3 11  9  0  8  d  0 42 2b 16  6 
+10 1f  0  9  f  0 42 63  4  b 3a 1e  9  9  0 5a 
+24  4  4  0 63 32 31  0  0 32  0 52 61 73 70 41 
+6c 74 6f 20 20 63 63 63 32 32 32  0 10  0 20  0 
+54  0 20  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 10  9  2  6  d  0 41 3e  4 15  c  b  2  3 
+ e  0 41 4f  4 12  c  e  2  8  d  0 42 4b  a 1c 
+ d  b  1  9  e  0  3 63  a 14  0 23  f  2 1b 5e 
+18  4  5  0 63 28 50 32  0 32  0 48 61 72 6d 6f 
+6e 69 63 61 20 63 63 63 32 32 32  0 50 10 50  0 
+50  0 10  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1c  2  0  4  e 63  0 4e  4  3  d  5  0  6 
+ e 63  1 56  a  8 12  7  0  6  9 63  2 47 1b  e 
+ a  a  0  5  f  0  1 63  4  b 32 1a  8  d  0 52 
+ c  4  4  0 63 32  0  0  0 32  0 44 6f 75 62 6c 
+65 42 61 73 73 63 63 63 32 32 32  0 10  0  0  0 
+ 3  0  0  5  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  b  4  0  4  f 14  2 49  9  6  a  7  0  4 
+ f 14  2 51  a  0  8 1f  0  5  f  0  1 63  9  6 
+ a 1f  0  5  f  0  1 63  a  0 3c 1f  6  9  0 52 
+ 5  4  4  0 63 32  0  0  0 32  0 48 69 53 74 72 
+69 6e 67 20 31 63 63 63 32 32 32  0  2  0 30  0 
+32  0 10  5  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 10 13  f  4  a  0  3 3b 14 14 1f  e  8  7 
+ 9  0  2 42  5  e 18 13  d  9  c  0  2 3c 13  8 
+1f 11  7  4  f  0 42 63  4 10 3a 1b  0  0  0 52 
+1d  4  4  0 63 32  0  0  0 32  0 48 61 72 70 20 
+20 20 20 20 20 63 63 63 32 32 32  8  0  0 21  0 
+ 0  0  8  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  6  6  4  f  0 40 48  5  0  c  8  7  5 
+ f  5  0 52  4  0  f  7  3  7  e  8  3 63  4  6 
+ f  8  4  5  f  0  3 63  4  6 7c 1f  0  6  0 4a 
+11  2  4  0 63 32  0  0  0 32  0 46 61 6e 66 61 
+72 54 70 74 73 63 63 63 32 32 32  6  1  0 38  0 
+ 8  0 48  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  d  b  0  1  c  0  2 2c 3d  3  d  7  0  1 
+ c  0  2 1f 3c  3  d 1f  0  5  f  0  2 63  5  6 
+ d 1f  0  5  f  0  2 63  4  0 3c 63  0 2f  0 53 
+11  4  4  0 63 32  0  0  0 32  0 42 72 65 61 74 
+68 4f 72 67 6e 63 63 63 32 32 32  4 30  5 50  0 
+11  0 18  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  9  0  6  0 27  2 51 19  b 1c  6  0  8 
+ 0 37  2 47  a  3 1f  a  0  9  0 3d  2 4d  a  e 
+1f 12  8  8  f  0  3 61  4  b 28 1f  0  3  0 52 
+ c  3  4  0 63 32  1 32  0 32  0 4e 79 6c 6f 6e 
+47 75 69 74 20 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  e  e  f  f  0  3 48 2d  6 1f  f  4  f 
+ f 25  3 5b  0  0 1f 12  6  c  e 1c  3 55  0 10 
+1f 13  7  8  e  6  4 62  4  e 3b 14  0  0  0 42 
+18  2  4  0 63 32  0 32  0 32  0 47 75 69 74 61 
+72 20 23 31 20 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f 19  8  a  3  0  3 63 10 18 1f  c  5  b 
+ 5  0  3 52  0  b 1f 19  6  b  5  0  3 63  a 16 
+1f  f 11  9  7  0  4 63  4  3 3a 14  0  0  0 42 
+18  2  4  0 63 32  0 32  0 32  0 46 75 6e 6b 79 
+20 50 69 63 6b 63 63 63 32 32 32  0 30  0  0  0 
+ 0  0  0  7  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  1  0  8  4  0  3 3d  a 1e 1f  1  0  8 
+ 0  0  0 43  0 10 1f  9  6  8  c 1b  7 46 1c 1e 
+1f  9  0  9  9  0  1 63  4  3 3a 1c  0  0  0 52 
+ c  4  5  0 63 4b  0  0  0 32  0 45 6c 65 63 42 
+61 73 73 20 31 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  f  f  e  9  0  3 46 1d 16 1f  f  5  e 
+ e  d  3 63  0  b 1f 13  6  5  d 1c  3 63  0  0 
+1f 13  6  8  f  0  4 63  4  6 3b 1f  0  0  0 42 
+ c  4  4  0 63 32  0 32  0 32  0 53 79 6e 46 75 
+6e 6b 42 61 73 63 63 63 32 32 32  d 6c  0  0  0 
+70  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f 10  7  8  3  0  3 4f  4  3 1f  9  0  8 
+ 0  0  1 4a  0  b 1f 11  0  8  0  0  1 47  4  8 
+1f  9  0  8  0  0  0 63  0  b 39 19  0  7  0 52 
+ c  2  4  0 63 32  0 32  0 32  0 4c 61 74 65 6c 
+79 42 61 73 73 63 63 63 32 32 32  2  0  0  0  0 
+40  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 13 12  0  9  d 22  0 51  0  b 1f 14  0  5 
+ 8 24 40 5c  0  3 1f 11  0  6  c 2c  0 53  9  0 
+10 1f  0  b  f  0  0 5c  a  e 3a 22 11  e 1e 5e 
+18  7  4  0 63 32  0 32  0 32  0 53 79 6e 63 20 
+4c 65 61 64 20 63 63 63 32 32 32  0 70  0 40  0 
+ 2  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 13 1e  0  9  e  0  0 63 3f  b 1f 14  0  5 
+ e 24  1 51  4  3 1f 14  0  f  1  0 41 4d  8  3 
+ f 1f  0  b  f  0  2 63  4  b 3b 20 11 12 33 56 
+18  4  4  0 63 37  e  0  0 32  0 4a 61 7a 7a 20 
+46 6c 75 74 65 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 15 13  d  3  d 1e  2 50 18  e 15 14  9  4 
+ c 1e  2 56 11  8 1b 1f  f  7  f  0  1 63  4  6 
+1a 1f  e  6  f  0  2 63  4  0 7c  b  0  8  0 62 
+18  4  4  0 63 32  0  0  0 32  0 4a 61 76 61 20 
+4a 69 76 65 20 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  0  0  4  f  0 40 63 3c  0  b  8  7  7 
+ f  5  0 63  4  6  f  5  3  7  f  8  0 3b  5  6 
+ e  8  4  5  f  0  3 63  3  0 7e 1d  6  f  0 4a 
+11  0  4  0 63 32  0  0  0 32  0 42 61 61 64 42 
+72 65 61 74 68 63 63 63 32 32 32  6 30  0 38  0 
+ 1  0 46  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f  0  0  4  f  0 40 47 2f  0  e  8  7  7 
+ f  5  0 4c  0  6 13 1c  d  c  6  8  0 63  5  6 
+14 11  d  b  0  0  3 63  4  0 7a 10  0 51  0 68 
+17  0  4  0 63 32  0  0  0 32  0 56 6f 63 61 6c 
+4e 75 74 73 20 63 63 63 32 32 32  6 30  0 30  0 
+ 1  0 10  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f 1f  0  5  f  0  0 41 32  3 1f 14 10  5 
+ 5  1  2 63  7  3 1f  b 12  8  f  0  1 63  c  3 
+1f 1f  f  8  f  0  1 63  4  3 39 23  0  0  0 62 
+18  7  4  0 63 32  0  0  0 32  0 57 61 74 65 72 
+47 6c 61 73 73 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  7  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 16  2  0  4  6  9  1 4f  8  0 19  e  1  4 
+ 0 20  1 43 19  0 1f 12 10  6  7  0  0 54 3d  3 
+16  d  6  6  2 1e  3 61  8  e 3a 20  1 14  0 42 
+ c  2  4  2 63 63 63  0  0 32  0 46 75 7a 7a 79 
+20 4b 6f 74 6f 63 63 63 32 32 32  0  0  0  0  b 
+50  0  0  5  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1c  8  0  3  e  0  1 55 12  3 1c  7  0  1 
+ e 2e  1 58 27  b  e  4  0  2  a  0  2 63  4  a 
+ d  9  0  2  c  1  2 63 10  b  4 54  0 47  0 53 
+18  7  4  0 63 32  0  0  0 32  0 42 72 74 68 62 
+65 6c 6c 73 20 63 63 63 32 32 32  0  4  0 40  0 
+40  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1a  4  1  1  b 16  0 47  5  3 15  e  0  1 
+ d  0  0 4c  5 16 1c  6  4  2  7  0  0 63  4 16 
+18 18  3  1  e  0  0 5e  4 10 24  7  0  4  0 62 
+24  4  4  0 63 32  0  0  0 32  0 54 75 62 65 20 
+42 65 6c 6c 73 63 63 63 32 32 32  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f 1f 13  3  0  0  0 5f 3d  6 1f 12 13  2 
+ 0  0  1 52  5  2 1f 14 13  3  0  0  1 56 28  5 
+1e  b 13  f  9  0  0 63  6  3 3b 63  0 63  0 73 
+23  7  4  0 63 32  0  0  0 32  0 4e 6f 69 73 65 
+20 53 68 6f 74 63 63 63 32 32 32  8  0  0  0  8 
+ 0  0  0  6  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 1f 16  0  3  7  0  1 50  0  3 1f 18  3  3 
+ 3 22  0 63  0 14 1d  7  6  3  6  0  1 3c  8  3 
+1f  5  7  3  0  0  1 63  4 1b 39 23  0  8  0 42 
+18  4  4  0 63 32  0  0  0 32  0 48 61 6e 64 20 
+44 72 75 6d 20 63 63 63 32 32 32  0  1  0  3  0 
+ 1  0  1  3  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
+ 0  0 7d f7 
\ No newline at end of file
diff --git a/lib-src/portmidi/pm_win/README_WIN.txt b/lib-src/portmidi/pm_win/README_WIN.txt
new file mode 100644
index 0000000..366dfee
--- /dev/null
+++ b/lib-src/portmidi/pm_win/README_WIN.txt
@@ -0,0 +1,285 @@
+File: PortMidi Win32 Readme
+Author: Belinda Thom, June 16 2002
+Revised by: Roger Dannenberg, June 2002, May 2004, June 2007, 
+            Umpei Kurokawa, June 2007
+
+=============================================================================
+USING PORTMIDI:
+=============================================================================
+
+Using Microsoft Visual C++ project files (provided with PortMidi), there
+are two configurations of the PortMidi library. The Debug version is 
+intended for debugging, especially in a console application. The Debug
+version enables some extra error checking and outputs some text as well
+as a prompt to type ENTER so that you don't lose any debugging text when
+the program exits. You can turn off this extra debugging info by taking
+out the compile-time definition for DEBUG. (But leave _DEBUG, which I
+think is important for compiling in Debug mode.) This debugging version also
+defines PM_CHECK_ERRORS, which forces a check for error return codes from
+every call to PortMidi. You can disable this checking (especially if you
+want to handle error codes in your own way) by removing PM_CHECK_ERRORS
+from the predefined symbols list in the Settings dialog box.
+
+PortMidi is designed to run without a console and should work perfectly 
+well within a graphical user interface application. The Release version
+is both optimized and lacking the debugging printout code of the Debug
+version.
+
+Read the portmidi.h file for PortMidi API details on using the PortMidi API.
+See <...>\pm_dll_test\test.c or <...>\multithread\test.c for usage examples.
+
+=============================================================================
+TO INSTALL PORTMIDI:
+=============================================================================
+1)  get current source from the portmedia project at SourceForge.net
+
+2)  copy source into directory: <...>\portmidi
+
+=============================================================================
+TO COMPILE PORTMIDI:
+=============================================================================
+
+3)  cd to or open the portmidi directory
+
+4)  start or click on the portmidi.sln workspace (note, there is also
+    portmidi-VC9.sln for Visual C++ version 9 users).
+	
+5)  the following projects exist within this workspace:
+    - portmidi (the PortMidi library)
+    - porttime (a small portable library implementing timer facilities)
+    - test (simple midi I/O testing)
+    - midithread (an example illustrating low-latency MIDI processing
+        using a dedicated low-latency thread)
+    - sysex (simple sysex message I/O testing)
+    - latency (uses porttime to measure system latency)
+    - midithru (an example illustrating software MIDI THRU)
+    - qtest (a test of the new multicore-safe queue implementation)
+    - mm  (allows monitoring of midi messages)
+    - pmjni (a dll to provide an interface to PortMidi for Java)
+
+6)  open the pmjni project properties
+    - visit Configuration Properties, C/C++, General
+    - find Additional Include Directories property and open the editor (...)
+    - at the end of the list, you will find two paths beginning with E:\
+    - these are absolute paths to the Java SDK; you'll need to install the
+      Java SDK (from Sun) and update these directories in order to build
+      this project.
+
+6)  verify that all project settings are for Win32 Debug release:
+    - type Alt-F7
+    - highlight all three projects in left part of Project Settings window; 
+    - "Settings For" should say "Win32 Debug"
+	
+    -In Visual C++ 2005 Express Edition, there is a drop down menu in 
+     the top toolbar to select the Win32 and Debug option.
+
+7)  use Build->Batch Build ... to build everything in the project
+	
+    -In Visual C++ 2005 Express Edition, use Build->Build Solution
+	
+8)  The settings for these projects were distributed in the zip file, so
+    compile should just work.
+
+9)  run test project; use the menu that shows up from the command prompt to
+    test that portMidi works on your system. tests include: 
+		- verify midi output works
+		- verify midi input works
+
+10) run other projects if you wish: sysex, latency, midithread, mm, 
+    qtest, midithru
+
+11) use pm_java/make.bat (run in a cmd window from pm_java) to compile
+    the java code.
+
+12) run pm_java/pmdefaults.bat (run in a cmd window from pm_java) to
+    run the PmDefaults program. This lets you select the default input
+    and output devices for PortMidi.
+
+============================================================================
+TO CREATE YOUR OWN PORTMIDI CLIENT APPLICATION:
+============================================================================
+
+NOTE: this section needs to be reviewed and tested. My suggestion would
+be to copy the test project file (test.dsp) and modify it. -RBD
+
+The easiest way is to start a new project w/in the portMidi workspace:
+
+1) To open new project: 
+	- File->New->Projects
+	- Location: <...>\portmidi\<yourProjectName>
+	- check Add to current workspace
+	- select Win32 Console Application (recommended for now)
+	- do *NOT* select the "make dependency" box (you will explicitly do this
+      in the next step)
+	- Click OK
+	- Select "An Empty Project" and click Finish
+	
+	In Visual C++ 2005 Express Edition, 
+	- File->New->Projects
+	- Location: <...>\portmidi\<yourProjectName>
+	- select Add to solution
+	- select CLR Empty project in CLR
+	- select Win32 Console Application in Win32
+	- select Empty project in General
+	
+2) Now this project will be the active project. Make it explicitly depend
+   on PortMidi dll:
+	- Project->Dependencies
+	- Click pm_dll
+
+3) add whatever files you wish to add to your new project, using portMidi
+   calls as desired (see USING PORTMIDI at top of this readme)
+
+4) when you include portMidi files, do so like this:
+	- #include "..\pm_common\portmidi.h"
+	- etc.
+
+5) build and run your project
+
+============================================================================
+DESIGN NOTES
+============================================================================
+
+PortMidi for Win32 exists as a simple static library,
+with Win32-specific code in pmwin.c and MM-specific code in pmwinmm.c.
+
+Orderly cleanup after errors are encountered is based on a fixed order of
+steps and state changes to reflect each step. Here's the order:
+
+To open input:
+    initialize return value to NULL
+    - allocate the PmInternal strucure (representation of PortMidiStream)
+    return value is (non-null) PmInternal structure
+    - allocate midi buffer
+    set buffer field of PmInternal structure
+    - call system-dependent open code
+        - allocate midiwinmm_type for winmm dependent data
+        set descriptor field of PmInternal structure
+        - open device
+        set handle field of midiwinmm_type structure
+        - allocate buffers
+        - start device
+        - return
+    - return
+
+SYSEX HANDLING -- the most complex, least exercised, and therefore most
+      buggy part of PortMidi (but maybe bugs are finally gone)
+
+There are three cases: simple output, stream output, input
+Each must deal with:
+ 1. Buffer Initialization (creating buffers)
+ 2. Buffer Allocation (finding a free buffer)
+ 3. Buffer Fill (putting bytes in the buffer)
+ 4. Buffer Preparation (midiOutPrepare, etc.)
+ 5. Buffer Send (to Midi device)
+ 6. Buffer Receive (in callback)
+ 7. Buffer Empty (removing bytes from buffer)
+ 8. Buffer Free (returning to the buffer pool)
+ 9. Buffer Finalization (returning to heap)
+
+Here's how simple output handles sysex:
+ 1. Buffer Initialization (creating buffers)
+  allocated when code tries to write first byte to a buffer
+  the test is "if (!m->sysex_buffers[0]) { ... }"
+  this field is initialized to NULL when device is opened
+  the size is SYSEX_BYTES_PER_BUFFER
+  allocate_sysex_buffers() does the initialization
+  note that the actual size of the allocation includes
+      additional space for a MIDIEVENT (3 longs) which are
+      not used in this case
+ 2. Buffer Allocation (finding a free buffer)
+  see get_free_sysex_buffer()
+  cycle through m->sysex_buffers[] using m->next_sysex_buffer
+      to determine where to look next
+  if nothing is found, wait by blocking on m->sysex_buffer_signal
+  this is signaled by the callback every time a message is
+      received
+ 3. Buffer Fill (putting bytes in the buffer)
+  essentially a state machine approach
+  hdr->dwBytesRecorded is a position in message pointed to by m->hdr
+  keep appending bytes until dwBytesRecorded >= SYSEX_BYTES_PER_BUFFER
+  then send the message, reseting the state to initial values
+ 4. Buffer Preparation (midiOutPrepare, etc.)
+  just before sending in winmm_end_sysex()
+ 5. Buffer Send (to Midi device)
+  message is padded with zero at end (since extra space was allocated
+      this is ok) -- the zero works around a bug in (an old version of)
+      MIDI YOKE drivers
+  dwBufferLength gets dwBytesRecorded, and dwBytesRecorded gets 0
+  uses midiOutLongMsg()
+ 6. Buffer Receive (in callback)
+ 7. Buffer Empty (removing bytes from buffer)
+  not applicable for output
+ 8. Buffer Free (returning to the buffer pool)
+  unprepare message to indicate that it is free
+  SetEvent on m->buffer_signal in case client is waiting
+ 9. Buffer Finalization (returning to heap)
+  when device is closed, winmm_out_delete frees all sysex buffers
+
+Here's how stream output handles sysex:
+ 1. Buffer Initialization (creating buffers)
+  same code as simple output (see above)
+ 2. Buffer Allocation (finding a free buffer)
+  same code as simple output (see above)
+ 3. Buffer Fill (putting bytes in the buffer)
+  essentially a state machine approach
+  m->dwBytesRecorded is a position in message
+  keep appending bytes until buffer is full (one byte to spare)
+ 4. Buffer Preparation (midiOutPrepare, etc.)
+  done before sending message
+  dwBytesRecorded and dwBufferLength are set in winmm_end_sysex
+ 5. Buffer Send (to Midi device)
+  uses midiStreamOutMsg()
+ 6. Buffer Receive (in callback)
+ 7. Buffer Empty (removing bytes from buffer)
+  not applicable for output
+ 8. Buffer Free (returning to the buffer pool)
+  unprepare message to indicate that it is free
+  SetEvent on m->buffer_signal in case client is waiting
+ 9. Buffer Finalization (returning to heap)
+  when device is closed, winmm_out_delete frees all sysex buffers
+
+
+Here's how input handles sysex:
+ 1. Buffer Initialization (creating buffers)
+  two buffers are allocated in winmm_in_open
+ 2. Buffer Allocation (finding a free buffer)
+  same code as simple output (see above)
+ 3. Buffer Fill (putting bytes in the buffer)
+  not applicable for input
+ 4. Buffer Preparation (midiOutPrepare, etc.)
+  done before sending message -- in winmm_in_open and in callback
+ 5. Buffer Send (to Midi device)
+  uses midiInAddbuffer in allocate_sysex_input_buffer (called from
+      winmm_in_open) and callback
+ 6. Buffer Receive (in callback)
+ 7. Buffer Empty (removing bytes from buffer)
+      done without pause in loop in callback
+ 8. Buffer Free (returning to the buffer pool)
+  done by midiInAddBuffer in callback, no pointer to buffers
+      is retained except by device
+ 9. Buffer Finalization (returning to heap)
+  when device is closed, empty buffers are delivered to callback,
+      which frees them
+
+IMPORTANT: In addition to the above, PortMidi now has
+"shortcuts" to optimize the transfer of sysex data. To enable
+the optimization for sysex output, the system-dependent code
+sets fields in the pmInternal structure: fill_base, fill_offset_ptr,
+and fill_length. When fill_base is non-null, the system-independent
+part of PortMidi is allowed to directly copy sysex bytes to
+"fill_base[*fill_offset_ptr++]" until *fill_offset_ptr reaches
+fill_length. See the code for details.
+
+-----------
+
+Additional notes on using VS 2005 (maybe this is obsolete now?):
+
+1) Make sure "Configuration: All Configurations" is selected in all of the following Properties modifications!
+
+2) In my case the project defaulted to compiling all .c files with the C++ compiler, which was disastrous. I had to go to set Properties for each file, to wit: Expand Configuration Properties, Expand C/C++, Select Advanced, set the Compile As popup to Compile as C Code (/TC). (For better or worse, the project I inherited has a bunch of .c files that rely on C++ features, so I couldn't reliably set this the project properties level.)
+
+3) While you're there, make sure that the C/C++ -> General -> "Compile with Common Language Runtime support" is set to "No Common Language Runtime support" (the C compiler *can't* support CLR, but VS won't do anything useful like automatically set the two options to match)-.
+
+4) I never got VS precompiled header thing to work sensibly, so I took the path of least resistance and turned PCH's off for all my files. Properties -> Configuration Properties -> C/C++ -> Precompiled Headers -> Create/Use Precompiled Header popup set to "Not Using Precompiled Headers". The compiler is reasonably fast even if it has to parse all the header files, so unless someone wants to explain VS's PCHs to me, the hell with it, I say.
+
diff --git a/lib-src/portmidi/pm_win/debugging_dlls.txt b/lib-src/portmidi/pm_win/debugging_dlls.txt
new file mode 100644
index 0000000..8032e93
--- /dev/null
+++ b/lib-src/portmidi/pm_win/debugging_dlls.txt
@@ -0,0 +1,145 @@
+========================================================================================================================
+Methods for Debugging DLLs
+========================================================================================================================
+If you have the source for both the DLL and the calling program, open the project for the calling executable file and 
+debug the DLL from there. If you load a DLL dynamically, you must specify it in the Additional DLLs category of the 
+Debug tab in the Project Settings dialog box. 
+
+If you have the source for the DLL only, open the project that builds the DLL. Use the Debug tab in the Project 
+Settings dialog box to specify the executable file that calls the DLL.
+
+You can also debug a DLL without a project. For example, maybe you just picked up a DLL and source code but you 
+don’t have an associated project or workspace. You can use the Open command on the File menu to select the .DLL 
+file you want to debug. The debug information should be in either the .DLL or the related .PDB file. After 
+Visual C++ opens the file, on the Build menu click Start Debug and Go to begin debugging.
+
+To debug a DLL using the project for the executable file 
+
+From the Project menu, click Settings. 
+The Project Settings dialog box appears.
+
+Choose the Debug tab.
+
+
+In the Category drop-down list box, select General. 
+
+
+In the Program Arguments text box, type any command-line arguments required by the executable file.
+
+
+In the Category drop-down list box, select Additional DLLs.
+
+
+In the Local Name column, type the names of DLLs to debug. 
+If you are debugging remotely, the Remote Name column appears. In this column, type the complete path for the 
+remote module to map to the local module name.
+
+In the Preload column, select the check box if you want to load the module before debugging begins.
+
+
+Click OK to store the information in your project.
+
+
+From the Build menu, click Start Debug and Go to start the debugger. 
+You can set breakpoints in the DLL or the calling program. You can open a source file for the DLL and set breakpoints 
+in that file, even though it is not a part of the executable file’s project.
+
+To debug a DLL using the project for the DLL 
+
+From the Project menu, click Settings. 
+The Project Settings dialog box appears.
+
+Choose the Debug tab.
+
+
+In the Category drop-down list box, select General. 
+
+
+In the Executable For Debug Session text box, type the name of the executable file that calls the DLL.
+
+
+In the Category list box, select Additional DLLs.
+
+
+In the Local Module Name column, type the name of the DLLs you want to debug.
+
+
+Click OK to store the information in your project.
+
+
+Set breakpoints as required in your DLL source files or on function symbols in the DLL.
+
+
+From the Build menu, click Start Debug and Go to start the debugger. 
+To debug a DLL created with an external project 
+
+From the Project menu, click Settings. 
+The Project Settings dialog box appears.
+
+Choose the Debug tab.
+
+
+In the Category drop-down list box, select General.
+
+
+In the Executable For Debug Session text box, type the name of the DLL that your external makefile builds. 
+
+
+Click OK to store the information in your project.
+
+
+Build a debug version of the DLL with symbolic debugging information, if you don’t already have one.
+
+
+Follow one of the two procedures immediately preceding this one to debug the DLL. 
+
+========================================================================================================================
+Why Don’t My DLL Breakpoints Work?
+========================================================================================================================
+Some reasons why your breakpoints don’t work as expected are listed here, along with solutions or work-arounds for each. 
+If you follow the instructions in one topic and are still having breakpoint problems, look at some of the other topics. 
+Often breakpoint problems result from a combination of conditions. 
+
+You can't set a breakpoint in a source file when the corresponding symbolic information isn't loaded into memory by 
+the debugger. 
+You cannot set a breakpoint in any source file when the corresponding symbolic information will not be loaded into memory 
+by the debugger. 
+Symptoms include messages such as "the breakpoint cannot be set" or a simple, noninformational beep.
+
+When setting breakpoints before the code to be debugged has been started, the debugger uses a breakpoint list to keep 
+track of how and where to set breakpoints. When you actually begin the debugging session, the debugger loads the symbolic 
+information for all the code to be debugged and then walks through its breakpoint list, attempting to set the 
+breakpoints. 
+
+However, if one or more of the code modules have not been designated to the debugger, there will be no symbolic 
+information for the debugger to use when walking through its breakpoint list. Situations where this is likely to 
+occur include: 
+
+Attempts to set breakpoints in a DLL before the call to LoadLibrary.
+
+Setting a breakpoint in an ActiveX server before the container has started the server.
+
+Other similar cases. 
+
+To prevent this behavior in Visual C++, specify all additional DLLs and COM servers in the Additional DLLs field 
+in the Debug/Options dialog box to notify the debugger that you want it to load symbolic debug information for 
+additional .DLL files. When this has been done, breakpoints set in code that has not yet been loaded into memory 
+will be "virtual" breakpoints. When the code is actually loaded into memory by the loader, these become physical 
+breakpoints. Make sure that these additional debugging processes are not already running when you start your 
+debugging session. The debugging process and these additional processes must be sychronized at the same beginning 
+point to work correctly, hitting all breakpoints. 
+
+Breakpoints are missed when more than one copy of a DLL is on your hard disk. 
+Having more than one copy of a DLL on your hard drive, especially if it is in your Windows directory, can cause 
+debugger confusion. The debugger will load the symbolic information for the DLL specified to it at run time (with the 
+Additional DLLs field in the Debug/Options dialog box), while Windows has actually loaded a different copy of the 
+DLL itself into memory. Because there is no way to force the debugger to load a specific DLL, it is a good idea to 
+keep only one version of a DLL at a time in your path, current directory, and Windows directory. 
+
+You can’t set "Break When Expression Has Changed" breakpoints on a variable local to a DLL. 
+Setting a "Break When Expression Has Changed" breakpoint on a variable local to a DLL function before the call 
+to LoadLibrary causes the breakpoint to be virtual (there are no physical addresses for the DLL in memory yet). 
+Virtual breakpoints involving expressions pose a special problem. The DLL must be specified to the debugger at 
+startup (causing its symbolic information to be loaded). In addition, the DLL's executable code must also be loaded 
+into memory before this kind of breakpoint can be set. This means that the calling application's code must be 
+executed to the point after its call to LoadLibrary before the debugger will allow this type of breakpoint to be set. 
diff --git a/lib-src/portmidi/pm_win/pmwin.c b/lib-src/portmidi/pm_win/pmwin.c
new file mode 100644
index 0000000..aeed485
--- /dev/null
+++ b/lib-src/portmidi/pm_win/pmwin.c
@@ -0,0 +1,143 @@
+/* pmwin.c -- PortMidi os-dependent code */
+
+/* This file only needs to implement:
+       pm_init(), which calls various routines to register the 
+           available midi devices,
+       Pm_GetDefaultInputDeviceID(), and
+       Pm_GetDefaultOutputDeviceID().
+   This file must
+   be separate from the main portmidi.c file because it is system
+   dependent, and it is separate from, say, pmwinmm.c, because it
+   might need to register devices for winmm, directx, and others.
+
+ */
+
+#include "stdlib.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include "pmwinmm.h"
+#ifdef DEBUG
+#include "stdio.h"
+#endif
+#include <windows.h>
+
+/* pm_exit is called when the program exits.
+   It calls pm_term to make sure PortMidi is properly closed.
+   If DEBUG is on, we prompt for input to avoid losing error messages.
+ */
+static void pm_exit(void) {
+    pm_term();
+#ifdef DEBUG
+#define STRING_MAX 80
+    {
+        char line[STRING_MAX];
+        printf("Type ENTER...\n");
+        /* note, w/o this prompting, client console application can not see one
+           of its errors before closing. */
+        fgets(line, STRING_MAX, stdin);
+    }
+#endif
+}
+
+
+/* pm_init is the windows-dependent initialization.*/
+void pm_init(void)
+{
+    atexit(pm_exit);
+#ifdef DEBUG
+    printf("registered pm_exit with atexit()\n");
+#endif
+    pm_winmm_init();
+    /* initialize other APIs (DirectX?) here */
+}
+
+
+void pm_term(void) {
+    pm_winmm_term();
+}
+
+
+static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
+    HKEY hkey;
+#define PATTERN_MAX 256
+    char pattern[PATTERN_MAX];
+    long pattern_max = PATTERN_MAX;
+    DWORD dwType;
+    /* Find first input or device -- this is the default. */
+    PmDeviceID id = pmNoDevice;
+    int i, j;
+    Pm_Initialize(); /* make sure descriptors exist! */
+    for (i = 0; i < pm_descriptor_index; i++) {
+        if (descriptors[i].pub.input == is_input) {
+            id = i;
+            break;
+        }
+    }
+    /* Look in registry for a default device name pattern. */
+    if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) != 
+        ERROR_SUCCESS) {
+        return id;
+    }
+    if (RegOpenKeyEx(hkey, "JavaSoft", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return id;
+    }
+    if (RegOpenKeyEx(hkey, "Prefs", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return id;
+    }
+    if (RegOpenKeyEx(hkey, "/Port/Midi", 0, KEY_READ, &hkey) !=
+        ERROR_SUCCESS) {
+        return id;
+    }
+    if (RegQueryValueEx(hkey, key, NULL, &dwType, pattern, &pattern_max) != 
+	ERROR_SUCCESS) {
+        return id;
+    }
+
+    /* decode pattern: upper case encoded with "/" prefix */
+    i = j = 0;
+    while (pattern[i]) {
+        if (pattern[i] == '/' && pattern[i + 1]) {
+            pattern[j++] = toupper(pattern[++i]);
+	} else {
+            pattern[j++] = tolower(pattern[i]);
+	}
+        i++;
+    }
+    pattern[j] = 0; /* end of string */
+
+    /* now pattern is the string from the registry; search for match */
+    i = pm_find_default_device(pattern, is_input);
+    if (i != pmNoDevice) {
+        id = i;
+    }
+    return id;
+}
+
+
+PmDeviceID Pm_GetDefaultInputDeviceID() {
+    return pm_get_default_device_id(TRUE, 
+           "/P/M_/R/E/C/O/M/M/E/N/D/E/D_/I/N/P/U/T_/D/E/V/I/C/E");
+}
+
+
+PmDeviceID Pm_GetDefaultOutputDeviceID() {
+  return pm_get_default_device_id(FALSE,
+          "/P/M_/R/E/C/O/M/M/E/N/D/E/D_/O/U/T/P/U/T_/D/E/V/I/C/E");
+}
+
+
+#include "stdio.h" 
+
+void *pm_alloc(size_t s) {
+    return malloc(s); 
+}
+
+
+void pm_free(void *ptr) { 
+    free(ptr); 
+}
+
+
diff --git a/lib-src/portmidi/pm_win/pmwinmm.c b/lib-src/portmidi/pm_win/pmwinmm.c
new file mode 100644
index 0000000..6e6354d
--- /dev/null
+++ b/lib-src/portmidi/pm_win/pmwinmm.c
@@ -0,0 +1,1459 @@
+/* pmwinmm.c -- system specific definitions */
+
+#ifdef _MSC_VER
+ #pragma warning(disable: 4133) // stop warnings about implicit typecasts
+#endif
+
+#ifndef _WIN32_WINNT
+    /* without this define, InitializeCriticalSectionAndSpinCount is 
+     * undefined. This version level means "Windows 2000 and higher" 
+     */
+    #define _WIN32_WINNT 0x0500
+#endif
+
+#include "windows.h"
+#include "mmsystem.h"
+#include "portmidi.h"
+#include "pmutil.h"
+#include "pminternal.h"
+#include "pmwinmm.h"
+#include <string.h>
+#include "porttime.h"
+
+/* asserts used to verify portMidi code logic is sound; later may want
+    something more graceful */
+#include <assert.h>
+#define DEBUG 1
+#ifdef DEBUG
+/* this printf stuff really important for debugging client app w/host errors.
+    probably want to do something else besides read/write from/to console
+    for portability, however */
+#define STRING_MAX 80
+#include "stdio.h"
+#endif
+
+#define streql(x, y) (strcmp(x, y) == 0)
+
+#define MIDI_SYSEX      0xf0
+#define MIDI_EOX        0xf7
+
+/* callback routines */
+static void CALLBACK winmm_in_callback(HMIDIIN hMidiIn,
+                                       WORD wMsg, DWORD dwInstance, 
+                                       DWORD dwParam1, DWORD dwParam2);
+static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
+                                              DWORD dwInstance, DWORD dwParam1, 
+                                              DWORD dwParam2);
+static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
+                                        DWORD dwInstance, DWORD dwParam1, 
+                                        DWORD dwParam2);
+
+extern pm_fns_node pm_winmm_in_dictionary;
+extern pm_fns_node pm_winmm_out_dictionary;
+
+static void winmm_out_delete(PmInternal *midi); /* forward reference */
+
+/*
+A note about buffers: WinMM seems to hold onto buffers longer than
+one would expect, e.g. when I tried using 2 small buffers to send
+long sysex messages, at some point WinMM held both buffers. This problem
+was fixed by making buffers bigger. Therefore, it seems that there should 
+be enough buffer space to hold a whole sysex message. 
+
+The bufferSize passed into Pm_OpenInput (passed into here as buffer_len)
+will be used to estimate the largest sysex message (= buffer_len * 4 bytes).
+Call that the max_sysex_len = buffer_len * 4.
+
+For simple midi output (latency == 0), allocate 3 buffers, each with half
+the size of max_sysex_len, but each at least 256 bytes.
+
+For stream output, there will already be enough space in very short
+buffers, so use them, but make sure there are at least 16.
+
+For input, use many small buffers rather than 2 large ones so that when 
+there are short sysex messages arriving frequently (as in control surfaces)
+there will be more free buffers to fill. Use max_sysex_len / 64 buffers,
+but at least 16, of size 64 bytes each.
+
+The following constants help to represent these design parameters:
+*/
+#define NUM_SIMPLE_SYSEX_BUFFERS 3
+#define MIN_SIMPLE_SYSEX_LEN 256
+
+#define MIN_STREAM_BUFFERS 16
+#define STREAM_BUFFER_LEN 24
+
+#define INPUT_SYSEX_LEN 64
+#define MIN_INPUT_BUFFERS 16
+
+/* if we run out of space for output (assume this is due to a sysex msg,
+   expand by up to NUM_EXPANSION_BUFFERS in increments of EXPANSION_BUFFER_LEN
+ */
+#define NUM_EXPANSION_BUFFERS 128
+#define EXPANSION_BUFFER_LEN 1024
+
+/* A sysex buffer has 3 DWORDS as a header plus the actual message size */
+#define MIDIHDR_SYSEX_BUFFER_LENGTH(x) ((x) + sizeof(long)*3)
+/* A MIDIHDR with a sysex message is the buffer length plus the header size */
+#define MIDIHDR_SYSEX_SIZE(x) (MIDIHDR_SYSEX_BUFFER_LENGTH(x) + sizeof(MIDIHDR))
+#ifdef USE_SYSEX_BUFFERS
+/* Size of a MIDIHDR with a buffer contaning multiple MIDIEVENT structures */
+#define MIDIHDR_SIZE(x) ((x) + sizeof(MIDIHDR))
+#endif
+
+/*
+==============================================================================
+win32 mmedia system specific structure passed to midi callbacks
+==============================================================================
+*/
+
+/* global winmm device info */
+MIDIINCAPS *midi_in_caps = NULL;
+MIDIINCAPS midi_in_mapper_caps;
+UINT midi_num_inputs = 0;
+MIDIOUTCAPS *midi_out_caps = NULL;
+MIDIOUTCAPS midi_out_mapper_caps;
+UINT midi_num_outputs = 0;
+
+/* per device info */
+typedef struct midiwinmm_struct {
+    union {
+        HMIDISTRM stream;   /* windows handle for stream */
+        HMIDIOUT out;       /* windows handle for out calls */
+        HMIDIIN in;         /* windows handle for in calls */
+    } handle;
+
+    /* midi output messages are sent in these buffers, which are allocated
+     * in a round-robin fashion, using next_buffer as an index
+     */
+    LPMIDIHDR *buffers;     /* pool of buffers for midi in or out data */
+    int max_buffers;        /* length of buffers array */
+    int buffers_expanded;   /* buffers array expanded for extra msgs? */
+    int num_buffers;        /* how many buffers allocated in buffers array */
+    int next_buffer;        /* index of next buffer to send */
+    HANDLE buffer_signal;   /* used to wait for buffer to become free */
+#ifdef USE_SYSEX_BUFFERS
+    /* sysex buffers will be allocated only when
+     * a sysex message is sent. The size of the buffer is fixed.
+     */
+    LPMIDIHDR sysex_buffers[NUM_SYSEX_BUFFERS]; /* pool of buffers for sysex data */
+    int next_sysex_buffer;      /* index of next sysexbuffer to send */
+#endif
+    unsigned long last_time;    /* last output time */
+    int first_message;          /* flag: treat first message differently */
+    int sysex_mode;             /* middle of sending sysex */
+    unsigned long sysex_word;   /* accumulate data when receiving sysex */
+    unsigned int sysex_byte_count; /* count how many received */
+    LPMIDIHDR hdr;              /* the message accumulating sysex to send */
+    unsigned long sync_time;    /* when did we last determine delta? */
+    long delta;                 /* difference between stream time and
+                                       real time */
+    int error;                  /* host error from doing port midi call */
+    CRITICAL_SECTION lock;      /* prevents reentrant callbacks (input only) */
+} midiwinmm_node, *midiwinmm_type;
+
+
+/*
+=============================================================================
+general MIDI device queries
+=============================================================================
+*/
+static void pm_winmm_general_inputs()
+{
+    UINT i;
+    WORD wRtn;
+    midi_num_inputs = midiInGetNumDevs();
+    midi_in_caps = (MIDIINCAPS *) pm_alloc(sizeof(MIDIINCAPS) * 
+                                           midi_num_inputs);
+    if (midi_in_caps == NULL) {
+        /* if you can't open a particular system-level midi interface
+         * (such as winmm), we just consider that system or API to be
+         * unavailable and move on without reporting an error.
+         */
+        return;
+    }
+
+    for (i = 0; i < midi_num_inputs; i++) {
+        wRtn = midiInGetDevCaps(i, (LPMIDIINCAPS) & midi_in_caps[i],
+                                sizeof(MIDIINCAPS));
+        if (wRtn == MMSYSERR_NOERROR) {
+            /* ignore errors here -- if pm_descriptor_max is exceeded, some
+               devices will not be accessible. */
+            pm_add_device("MMSystem", midi_in_caps[i].szPname, TRUE,
+                          (void *) i, &pm_winmm_in_dictionary);
+        }
+    }
+}
+
+
+static void pm_winmm_mapper_input()
+{
+    WORD wRtn;
+    /* Note: if MIDIMAPPER opened as input (documentation implies you
+        can, but current system fails to retrieve input mapper
+        capabilities) then you still should retrieve some formof
+        setup info. */
+    wRtn = midiInGetDevCaps((UINT) MIDIMAPPER,
+                            (LPMIDIINCAPS) & midi_in_mapper_caps, 
+                            sizeof(MIDIINCAPS));
+    if (wRtn == MMSYSERR_NOERROR) {
+        pm_add_device("MMSystem", midi_in_mapper_caps.szPname, TRUE,
+                      (void *) MIDIMAPPER, &pm_winmm_in_dictionary);
+    }
+}
+
+
+static void pm_winmm_general_outputs()
+{
+    UINT i;
+    DWORD wRtn;
+    midi_num_outputs = midiOutGetNumDevs();
+    midi_out_caps = pm_alloc( sizeof(MIDIOUTCAPS) * midi_num_outputs );
+
+    if (midi_out_caps == NULL) {
+        /* no error is reported -- see pm_winmm_general_inputs */
+        return ;
+    }
+
+    for (i = 0; i < midi_num_outputs; i++) {
+        wRtn = midiOutGetDevCaps(i, (LPMIDIOUTCAPS) & midi_out_caps[i],
+                                 sizeof(MIDIOUTCAPS));
+        if (wRtn == MMSYSERR_NOERROR) {
+            pm_add_device("MMSystem", midi_out_caps[i].szPname, FALSE,
+                          (void *) i, &pm_winmm_out_dictionary);
+        }
+    }
+}
+
+
+static void pm_winmm_mapper_output()
+{
+    WORD wRtn;
+    /* Note: if MIDIMAPPER opened as output (pseudo MIDI device
+        maps device independent messages into device dependant ones,
+        via NT midimapper program) you still should get some setup info */
+    wRtn = midiOutGetDevCaps((UINT) MIDIMAPPER, (LPMIDIOUTCAPS)
+                             & midi_out_mapper_caps, sizeof(MIDIOUTCAPS));
+    if (wRtn == MMSYSERR_NOERROR) {
+        pm_add_device("MMSystem", midi_out_mapper_caps.szPname, FALSE,
+                      (void *) MIDIMAPPER, &pm_winmm_out_dictionary);
+    }
+}
+
+
+/*
+=========================================================================================
+host error handling
+=========================================================================================
+*/
+static unsigned int winmm_has_host_error(PmInternal * midi)
+{
+    midiwinmm_type m = (midiwinmm_type)midi->descriptor;
+    return m->error;
+}
+
+
+/* str_copy_len -- like strcat, but won't overrun the destination string */
+/*
+ * returns length of resulting string
+ */
+static int str_copy_len(char *dst, char *src, int len)
+{
+    strncpy(dst, src, len);
+    /* just in case suffex is greater then len, terminate with zero */
+    dst[len - 1] = 0;
+    return strlen(dst);
+}
+
+
+static void winmm_get_host_error(PmInternal * midi, char * msg, UINT len)
+{
+    /* precondition: midi != NULL */
+    midiwinmm_node * m = (midiwinmm_node *) midi->descriptor;
+    char *hdr1 = "Host error: ";
+    char *hdr2 = "Host callback error: ";
+
+    msg[0] = 0; /* initialize result string to empty */
+
+    if (descriptors[midi->device_id].pub.input) {
+        /* input and output use different winmm API calls */
+        if (m) { /* make sure there is an open device to examine */
+            if (m->error != MMSYSERR_NOERROR) {
+                int n = str_copy_len(msg, hdr1, len);
+                /* read and record host error */
+                int err = midiInGetErrorText(m->error, msg + n, len - n);
+                assert(err == MMSYSERR_NOERROR);
+                m->error = MMSYSERR_NOERROR;
+            }
+        }
+    } else { /* output port */
+        if (m) {
+            if (m->error != MMSYSERR_NOERROR) {
+                int n = str_copy_len(msg, hdr1, len);
+                int err = midiOutGetErrorText(m->error, msg + n, len - n);
+                assert(err == MMSYSERR_NOERROR);
+                m->error = MMSYSERR_NOERROR;
+            }
+        }
+    }
+}
+
+
+/*
+=============================================================================
+buffer handling
+=============================================================================
+*/
+static MIDIHDR *allocate_buffer(long data_size)
+{
+    LPMIDIHDR hdr = (LPMIDIHDR) pm_alloc(MIDIHDR_SYSEX_SIZE(data_size));
+    MIDIEVENT *evt;
+    if (!hdr) return NULL;
+    evt = (MIDIEVENT *) (hdr + 1); /* place MIDIEVENT after header */
+    hdr->lpData = (LPSTR) evt;
+    hdr->dwBufferLength = MIDIHDR_SYSEX_BUFFER_LENGTH(data_size);
+    hdr->dwBytesRecorded = 0;
+    hdr->dwFlags = 0;
+    hdr->dwUser = hdr->dwBufferLength;
+    return hdr;
+}
+
+#ifdef USE_SYSEX_BUFFERS
+static MIDIHDR *allocate_sysex_buffer(long data_size)
+{
+    /* we're actually allocating more than data_size because the buffer 
+     * will include the MIDIEVENT header in addition to the data 
+     */
+    LPMIDIHDR hdr = (LPMIDIHDR) pm_alloc(MIDIHDR_SYSEX_SIZE(data_size));
+    MIDIEVENT *evt;
+    if (!hdr) return NULL;
+    evt = (MIDIEVENT *) (hdr + 1); /* place MIDIEVENT after header */
+    hdr->lpData = (LPSTR) evt;
+    hdr->dwFlags = 0;
+    hdr->dwUser = 0;
+    return hdr;
+}
+#endif
+
+static PmError allocate_buffers(midiwinmm_type m, long data_size, long count)
+{
+    int i;
+    /* buffers is an array of count pointers to MIDIHDR/MIDIEVENT struct */
+    m->num_buffers = 0; /* in case no memory can be allocated */
+    m->buffers = (LPMIDIHDR *) pm_alloc(sizeof(LPMIDIHDR) * count);
+    if (!m->buffers) return pmInsufficientMemory;
+    m->max_buffers = count;
+    for (i = 0; i < count; i++) {
+        LPMIDIHDR hdr = allocate_buffer(data_size);
+        if (!hdr) { /* free everything allocated so far and return */
+            for (i = i - 1; i >= 0; i--) pm_free(m->buffers[i]);
+            pm_free(m->buffers);
+            m->max_buffers = 0;
+            return pmInsufficientMemory;
+        }
+        m->buffers[i] = hdr; /* this may be NULL if allocation fails */
+    }
+    m->num_buffers = count;
+    return pmNoError;
+}
+
+#ifdef USE_SYSEX_BUFFERS
+static PmError allocate_sysex_buffers(midiwinmm_type m, long data_size)
+{
+    PmError rslt = pmNoError;
+    /* sysex_buffers is an array of count pointers to MIDIHDR/MIDIEVENT struct */
+    int i;
+    for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
+        LPMIDIHDR hdr = allocate_sysex_buffer(data_size);
+
+        if (!hdr) rslt = pmInsufficientMemory;
+        m->sysex_buffers[i] = hdr; /* this may be NULL if allocation fails */
+        hdr->dwFlags = 0; /* mark as free */
+    }
+    return rslt;
+}
+#endif
+
+#ifdef USE_SYSEX_BUFFERS
+static LPMIDIHDR get_free_sysex_buffer(PmInternal *midi)
+{
+    LPMIDIHDR r = NULL;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    if (!m->sysex_buffers[0]) {
+        if (allocate_sysex_buffers(m, SYSEX_BYTES_PER_BUFFER)) {
+            return NULL;
+        }
+    }
+    /* busy wait until we find a free buffer */
+    while (TRUE) {
+        int i;
+        for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
+            /* cycle through buffers, modulo NUM_SYSEX_BUFFERS */
+            m->next_sysex_buffer++;
+            if (m->next_sysex_buffer >= NUM_SYSEX_BUFFERS) m->next_sysex_buffer = 0;
+            r = m->sysex_buffers[m->next_sysex_buffer];
+            if ((r->dwFlags & MHDR_PREPARED) == 0) goto found_sysex_buffer;
+        }
+        /* after scanning every buffer and not finding anything, block */
+        if (WaitForSingleObject(m->buffer_signal, 1000) == WAIT_TIMEOUT) {
+#ifdef DEBUG
+            printf("PortMidi warning: get_free_sysex_buffer() wait timed out after 1000ms\n");
+#endif
+        }
+    }
+found_sysex_buffer:
+    r->dwBytesRecorded = 0;
+    r->dwBufferLength = 0; /* changed to correct value later */
+    return r;
+}
+#endif
+
+static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
+{
+    LPMIDIHDR r = NULL;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    while (TRUE) {
+        int i;
+        for (i = 0; i < m->num_buffers; i++) {
+            /* cycle through buffers, modulo m->num_buffers */
+            m->next_buffer++;
+            if (m->next_buffer >= m->num_buffers) m->next_buffer = 0;
+            r = m->buffers[m->next_buffer];
+            if ((r->dwFlags & MHDR_PREPARED) == 0) goto found_buffer;
+        }
+        /* after scanning every buffer and not finding anything, block */
+        if (WaitForSingleObject(m->buffer_signal, 1000) == WAIT_TIMEOUT) {
+#ifdef DEBUG
+            printf("PortMidi warning: get_free_output_buffer() wait timed out after 1000ms\n");
+#endif
+            /* if we're trying to send a sysex message, maybe the 
+             * message is too big and we need more message buffers.
+             * Expand the buffer pool by 128KB using 1024-byte buffers.
+             */
+            /* first, expand the buffers array if necessary */
+            if (!m->buffers_expanded) {
+                LPMIDIHDR *new_buffers = (LPMIDIHDR *) pm_alloc(
+                        (m->num_buffers + NUM_EXPANSION_BUFFERS) * 
+                        sizeof(LPMIDIHDR));
+                /* if no memory, we could return a no-memory error, but user
+                 * probably will be unprepared to deal with it. Maybe the
+                 * MIDI driver is temporarily hung so we should just wait.
+                 * I don't know the right answer, but waiting is easier.
+                 */
+                if (!new_buffers) continue;
+                /* copy buffers to new_buffers and replace buffers */
+                memcpy(new_buffers, m->buffers, 
+                       m->num_buffers * sizeof(LPMIDIHDR));
+                pm_free(m->buffers);
+                m->buffers = new_buffers;
+                m->max_buffers = m->num_buffers + NUM_EXPANSION_BUFFERS;
+                m->buffers_expanded = TRUE;
+            }
+            /* next, add one buffer and return it */
+            if (m->num_buffers < m->max_buffers) {
+                r = allocate_buffer(EXPANSION_BUFFER_LEN);
+                /* again, if there's no memory, we may not really be 
+                 * dead -- maybe the system is temporarily hung and
+                 * we can just wait longer for a message buffer */
+                if (!r) continue;
+                m->buffers[m->num_buffers++] = r;
+                goto found_buffer; /* break out of 2 loops */
+            }
+            /* else, we've allocated all NUM_EXPANSION_BUFFERS buffers,
+             * and we have no free buffers to send. We'll just keep
+             * polling to see if any buffers show up.
+             */
+        }
+    }
+found_buffer:
+    r->dwBytesRecorded = 0;
+    /* actual buffer length is saved in dwUser field */
+    r->dwBufferLength = (DWORD) r->dwUser;
+    return r;
+}
+
+#ifdef EXPANDING_SYSEX_BUFFERS
+note: this is not working code, but might be useful if you want
+      to grow sysex buffers.
+static PmError resize_sysex_buffer(PmInternal *midi, long old_size, long new_size)
+{
+    LPMIDIHDR big;
+    int i;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    /* buffer must be smaller than 64k, but be also a multiple of 4 */
+    if (new_size > 65520) {
+        if (old_size >= 65520)
+            return pmBufferMaxSize;
+        else
+            new_size = 65520;
+    }
+    /* allocate a bigger message  */
+    big = allocate_sysex_buffer(new_size);
+    /* printf("expand to %d bytes\n", new_size);*/
+    if (!big) return pmInsufficientMemory;
+    m->error = midiOutPrepareHeader(m->handle.out, big, sizeof(MIDIHDR));
+    if (m->error) {
+        pm_free(big);
+        return pmHostError;
+    }
+    /* make sure we're not going to overwrite any memory */
+    assert(old_size <= new_size);
+    memcpy(big->lpData, m->hdr->lpData, old_size);
+    /* keep track of how many sysex bytes are in message so far */
+    big->dwBytesRecorded = m->hdr->dwBytesRecorded;
+    big->dwBufferLength = new_size;
+    /* find which buffer this was, and replace it */
+    for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
+        if (m->sysex_buffers[i] == m->hdr) {
+            m->sysex_buffers[i] = big;
+            m->sysex_buffer_size[i] = new_size;
+            pm_free(m->hdr);
+            m->hdr = big;
+            break;
+        }
+    }
+    assert(i != NUM_SYSEX_BUFFERS);
+
+    return pmNoError;
+}
+#endif
+
+/*
+=========================================================================================
+begin midi input implementation
+=========================================================================================
+*/
+
+
+static PmError allocate_input_buffer(HMIDIIN h, long buffer_len)
+{
+    LPMIDIHDR hdr = allocate_buffer(buffer_len);
+    if (!hdr) return pmInsufficientMemory;
+    pm_hosterror = midiInPrepareHeader(h, hdr, sizeof(MIDIHDR));
+    if (pm_hosterror) {
+        pm_free(hdr);
+        return pm_hosterror;
+    }
+    pm_hosterror = midiInAddBuffer(h, hdr, sizeof(MIDIHDR));
+    return pm_hosterror;
+}
+
+
+static PmError winmm_in_open(PmInternal *midi, void *driverInfo)
+{
+    DWORD dwDevice;
+    int i = midi->device_id;
+    int max_sysex_len = midi->buffer_len * 4;
+    int num_input_buffers = max_sysex_len / INPUT_SYSEX_LEN;
+    midiwinmm_type m;
+
+    dwDevice = (DWORD) descriptors[i].descriptor;
+
+    /* create system dependent device data */
+    m = (midiwinmm_type) pm_alloc(sizeof(midiwinmm_node)); /* create */
+    midi->descriptor = m;
+    if (!m) goto no_memory;
+    m->handle.in = NULL;
+    m->buffers = NULL; /* not used for input */
+    m->num_buffers = 0; /* not used for input */
+    m->max_buffers = FALSE; /* not used for input */
+    m->buffers_expanded = 0; /* not used for input */
+    m->next_buffer = 0; /* not used for input */
+    m->buffer_signal = 0; /* not used for input */
+#ifdef USE_SYSEX_BUFFERS
+    for (i = 0; i < NUM_SYSEX_BUFFERS; i++) 
+        m->sysex_buffers[i] = NULL; /* not used for input */
+    m->next_sysex_buffer = 0; /* not used for input */
+#endif
+    m->last_time = 0;
+    m->first_message = TRUE; /* not used for input */
+    m->sysex_mode = FALSE;
+    m->sysex_word = 0;
+    m->sysex_byte_count = 0;
+    m->hdr = NULL; /* not used for input */
+    m->sync_time = 0;
+    m->delta = 0;
+    m->error = MMSYSERR_NOERROR;
+    /* 4000 is based on Windows documentation -- that's the value used in the
+       memory manager. It's small enough that it should not hurt performance even
+       if it's not optimal.
+     */
+    InitializeCriticalSectionAndSpinCount(&m->lock, 4000);
+    /* open device */
+    pm_hosterror = midiInOpen(
+	    &(m->handle.in),  /* input device handle */
+	    dwDevice,  /* device ID */
+	    (DWORD_PTR) winmm_in_callback,  /* callback address */
+	    (DWORD_PTR) midi,  /* callback instance data */
+	    CALLBACK_FUNCTION); /* callback is a procedure */
+    if (pm_hosterror) goto free_descriptor;
+
+    if (num_input_buffers < MIN_INPUT_BUFFERS)
+        num_input_buffers = MIN_INPUT_BUFFERS;
+    for (i = 0; i < num_input_buffers; i++) {
+        if (allocate_input_buffer(m->handle.in, INPUT_SYSEX_LEN)) {
+            /* either pm_hosterror was set, or the proper return code
+               is pmInsufficientMemory */
+            goto close_device;
+        }
+    }
+    /* start device */
+    pm_hosterror = midiInStart(m->handle.in);
+    if (pm_hosterror) goto reset_device;
+    return pmNoError;
+
+    /* undo steps leading up to the detected error */
+reset_device:
+    /* ignore return code (we already have an error to report) */
+    midiInReset(m->handle.in);
+close_device:
+    midiInClose(m->handle.in); /* ignore return code */
+free_descriptor:
+    midi->descriptor = NULL;
+    pm_free(m);
+no_memory:
+    if (pm_hosterror) {
+        int err = midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+                                     PM_HOST_ERROR_MSG_LEN);
+        assert(err == MMSYSERR_NOERROR);
+        return pmHostError;
+    }
+    /* if !pm_hosterror, then the error must be pmInsufficientMemory */
+    return pmInsufficientMemory;
+    /* note: if we return an error code, the device will be
+       closed and memory will be freed. It's up to the caller
+       to free the parameter midi */
+}
+
+static PmError winmm_in_poll(PmInternal *midi) {
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    return m->error;
+}
+
+
+
+/* winmm_in_close -- close an open midi input device */
+/*
+ * assume midi is non-null (checked by caller)
+ */
+static PmError winmm_in_close(PmInternal *midi)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    if (!m) return pmBadPtr;
+    /* device to close */
+    if (pm_hosterror = midiInStop(m->handle.in)) {
+        midiInReset(m->handle.in); /* try to reset and close port */
+        midiInClose(m->handle.in);
+    } else if (pm_hosterror = midiInReset(m->handle.in)) {
+        midiInClose(m->handle.in); /* best effort to close midi port */
+    } else {
+        pm_hosterror = midiInClose(m->handle.in);
+    }
+    midi->descriptor = NULL;
+    DeleteCriticalSection(&m->lock);
+    pm_free(m); /* delete */
+    if (pm_hosterror) {
+        int err = midiInGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+                                     PM_HOST_ERROR_MSG_LEN);
+        assert(err == MMSYSERR_NOERROR);
+        return pmHostError;
+    }
+    return pmNoError;
+}
+
+
+/* Callback function executed via midiInput SW interrupt (via midiInOpen). */
+static void FAR PASCAL winmm_in_callback(
+    HMIDIIN hMidiIn,    /* midiInput device Handle */
+    WORD wMsg,          /* midi msg */
+    DWORD dwInstance,   /* application data */
+    DWORD dwParam1,     /* MIDI data */
+    DWORD dwParam2)    /* device timestamp (wrt most recent midiInStart) */
+{
+    static int entry = 0;
+    PmInternal *midi = (PmInternal *) dwInstance;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+
+    /* NOTE: we do not just EnterCriticalSection() here because an
+     * MIM_CLOSE message arrives when the port is closed, but then
+     * the m->lock has been destroyed.
+     */
+
+    switch (wMsg) {
+    case MIM_DATA: {
+        /* if this callback is reentered with data, we're in trouble. 
+         * It's hard to imagine that Microsoft would allow callbacks 
+         * to be reentrant -- isn't the model that this is like a 
+         * hardware interrupt? -- but I've seen reentrant behavior 
+         * using a debugger, so it happens.
+         */
+        long new_driver_time;
+        EnterCriticalSection(&m->lock);
+
+        /* dwParam1 is MIDI data received, packed into DWORD w/ 1st byte of
+                message LOB;
+           dwParam2 is time message received by input device driver, specified
+            in [ms] from when midiInStart called.
+           each message is expanded to include the status byte */
+
+        new_driver_time = dwParam2;
+
+        if ((dwParam1 & 0x80) == 0) {
+            /* not a status byte -- ignore it. This happened running the
+               sysex.c test under Win2K with MidiMan USB 1x1 interface,
+               but I can't reproduce it. -RBD
+             */
+            /* printf("non-status byte found\n"); */
+        } else { /* data to process */
+            PmEvent event;
+            if (midi->time_proc)
+                dwParam2 = (*midi->time_proc)(midi->time_info);
+            event.timestamp = dwParam2;
+            event.message = dwParam1;
+            pm_read_short(midi, &event);
+        }
+        LeaveCriticalSection(&m->lock);
+        break;
+    }
+    case MIM_LONGDATA: {
+        MIDIHDR *lpMidiHdr = (MIDIHDR *) dwParam1;
+        unsigned char *data = (unsigned char *) lpMidiHdr->lpData;
+        unsigned int processed = 0;
+        int remaining = lpMidiHdr->dwBytesRecorded;
+
+        EnterCriticalSection(&m->lock);
+        /* printf("midi_in_callback -- lpMidiHdr %x, %d bytes, %2x...\n", 
+                lpMidiHdr, lpMidiHdr->dwBytesRecorded, *data); */
+        if (midi->time_proc)
+            dwParam2 = (*midi->time_proc)(midi->time_info);
+        /* can there be more than one message in one buffer? */
+        /* assume yes and iterate through them */
+        while (remaining > 0) {
+            unsigned int amt = pm_read_bytes(midi, data + processed, 
+                                             remaining, dwParam2);
+            remaining -= amt;
+            processed += amt;
+        }
+
+        /* when a device is closed, the pending MIM_LONGDATA buffers are
+           returned to this callback with dwBytesRecorded == 0. In this
+           case, we do not want to send them back to the interface (if
+           we do, the interface will not close, and Windows OS may hang). */
+        if (lpMidiHdr->dwBytesRecorded > 0) {
+            lpMidiHdr->dwBytesRecorded = 0;
+            lpMidiHdr->dwFlags = 0;
+			
+            /* note: no error checking -- can this actually fail? */
+            assert(midiInPrepareHeader(hMidiIn, lpMidiHdr, 
+                        sizeof(MIDIHDR)) == MMSYSERR_NOERROR);
+            /* note: I don't think this can fail except possibly for
+             * MMSYSERR_NOMEM, but the pain of reporting this
+             * unlikely but probably catastrophic error does not seem
+             * worth it.
+             */
+            assert(midiInAddBuffer(hMidiIn, lpMidiHdr, 
+                        sizeof(MIDIHDR)) == MMSYSERR_NOERROR);
+            LeaveCriticalSection(&m->lock);
+        } else {
+            midiInUnprepareHeader(hMidiIn,lpMidiHdr,sizeof(MIDIHDR));
+            LeaveCriticalSection(&m->lock);
+            pm_free(lpMidiHdr);
+        }
+        break;
+    }
+    case MIM_OPEN:
+        break;
+    case MIM_CLOSE:
+        break;
+    case MIM_ERROR:
+        /* printf("MIM_ERROR\n"); */
+        break;
+    case MIM_LONGERROR:
+        /* printf("MIM_LONGERROR\n"); */
+        break;
+    default:
+        break;
+    }
+}
+
+/*
+=========================================================================================
+begin midi output implementation
+=========================================================================================
+*/
+
+/* begin helper routines used by midiOutStream interface */
+
+/* add_to_buffer -- adds timestamped short msg to buffer, returns fullp */
+static int add_to_buffer(midiwinmm_type m, LPMIDIHDR hdr,
+                         unsigned long delta, unsigned long msg)
+{
+    unsigned long *ptr = (unsigned long *)
+                         (hdr->lpData + hdr->dwBytesRecorded);
+    *ptr++ = delta; /* dwDeltaTime */
+    *ptr++ = 0;     /* dwStream */
+    *ptr++ = msg;   /* dwEvent */
+    hdr->dwBytesRecorded += 3 * sizeof(long);
+    /* if the addition of three more words (a message) would extend beyond
+       the buffer length, then return TRUE (full)
+     */
+    return hdr->dwBytesRecorded + 3 * sizeof(long) > hdr->dwBufferLength;
+}
+
+
+static PmTimestamp pm_time_get(midiwinmm_type m)
+{
+    MMTIME mmtime;
+    MMRESULT wRtn;
+    mmtime.wType = TIME_TICKS;
+    mmtime.u.ticks = 0;
+    wRtn = midiStreamPosition(m->handle.stream, &mmtime, sizeof(mmtime));
+    assert(wRtn == MMSYSERR_NOERROR);
+    return mmtime.u.ticks;
+}
+
+
+/* end helper routines used by midiOutStream interface */
+
+
+static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
+{
+    DWORD dwDevice;
+    int i = midi->device_id;
+    midiwinmm_type m;
+    MIDIPROPTEMPO propdata;
+    MIDIPROPTIMEDIV divdata;
+    int max_sysex_len = midi->buffer_len * 4;
+    int output_buffer_len;
+    int num_buffers;
+    dwDevice = (DWORD) descriptors[i].descriptor;
+
+    /* create system dependent device data */
+    m = (midiwinmm_type) pm_alloc(sizeof(midiwinmm_node)); /* create */
+    midi->descriptor = m;
+    if (!m) goto no_memory;
+    m->handle.out = NULL;
+    m->buffers = NULL;
+    m->num_buffers = 0;
+    m->max_buffers = 0;
+    m->buffers_expanded = FALSE;
+    m->next_buffer = 0;
+#ifdef USE_SYSEX_BUFFERS
+    m->sysex_buffers[0] = NULL;
+    m->sysex_buffers[1] = NULL;
+    m->next_sysex_buffer = 0;
+#endif
+    m->last_time = 0;
+    m->first_message = TRUE; /* we treat first message as special case */
+    m->sysex_mode = FALSE;
+    m->sysex_word = 0;
+    m->sysex_byte_count = 0;
+    m->hdr = NULL;
+    m->sync_time = 0;
+    m->delta = 0;
+    m->error = MMSYSERR_NOERROR;
+
+    /* create a signal */
+    m->buffer_signal = CreateEvent(NULL, FALSE, FALSE, NULL);
+
+    /* this should only fail when there are very serious problems */
+    assert(m->buffer_signal);
+
+    /* open device */
+    if (midi->latency == 0) {
+        /* use simple midi out calls */
+        pm_hosterror = midiOutOpen(
+                (LPHMIDIOUT) & m->handle.out,  /* device Handle */
+		dwDevice,  /* device ID  */
+		/* note: same callback fn as for StreamOpen: */
+		(DWORD_PTR) winmm_streamout_callback, /* callback fn */
+		(DWORD_PTR) midi,  /* callback instance data */
+		CALLBACK_FUNCTION); /* callback type */
+    } else {
+        /* use stream-based midi output (schedulable in future) */
+        pm_hosterror = midiStreamOpen(
+	        &m->handle.stream,  /* device Handle */
+		(LPUINT) & dwDevice,  /* device ID pointer */
+		1,  /* reserved, must be 1 */
+		(DWORD_PTR) winmm_streamout_callback,
+		(DWORD_PTR) midi,  /* callback instance data */
+		CALLBACK_FUNCTION);
+    }
+    if (pm_hosterror != MMSYSERR_NOERROR) {
+        goto free_descriptor;
+    }
+
+    if (midi->latency == 0) {
+        num_buffers = NUM_SIMPLE_SYSEX_BUFFERS;
+        output_buffer_len = max_sysex_len / num_buffers;
+        if (output_buffer_len < MIN_SIMPLE_SYSEX_LEN)
+            output_buffer_len = MIN_SIMPLE_SYSEX_LEN;
+    } else {
+        long dur = 0;
+        num_buffers = max(midi->buffer_len, midi->latency / 2);
+        if (num_buffers < MIN_STREAM_BUFFERS)
+            num_buffers = MIN_STREAM_BUFFERS;
+        output_buffer_len = STREAM_BUFFER_LEN;
+
+        propdata.cbStruct = sizeof(MIDIPROPTEMPO);
+        propdata.dwTempo = 480000; /* microseconds per quarter */
+        pm_hosterror = midiStreamProperty(m->handle.stream,
+                                          (LPBYTE) & propdata,
+                                          MIDIPROP_SET | MIDIPROP_TEMPO);
+        if (pm_hosterror) goto close_device;
+
+        divdata.cbStruct = sizeof(MIDIPROPTEMPO);
+        divdata.dwTimeDiv = 480;   /* divisions per quarter */
+        pm_hosterror = midiStreamProperty(m->handle.stream,
+                                          (LPBYTE) & divdata,
+                                          MIDIPROP_SET | MIDIPROP_TIMEDIV);
+        if (pm_hosterror) goto close_device;
+    }
+    /* allocate buffers */
+    if (allocate_buffers(m, output_buffer_len, num_buffers)) 
+        goto free_buffers;
+    /* start device */
+    if (midi->latency != 0) {
+        pm_hosterror = midiStreamRestart(m->handle.stream);
+        if (pm_hosterror != MMSYSERR_NOERROR) goto free_buffers;
+    }
+    return pmNoError;
+
+free_buffers:
+    /* buffers are freed below by winmm_out_delete */
+close_device:
+    midiOutClose(m->handle.out);
+free_descriptor:
+    midi->descriptor = NULL;
+    winmm_out_delete(midi); /* frees buffers and m */
+no_memory:
+    if (pm_hosterror) {
+        int err = midiOutGetErrorText(pm_hosterror, (char *) pm_hosterror_text,
+                                      PM_HOST_ERROR_MSG_LEN);
+        assert(err == MMSYSERR_NOERROR);
+        return pmHostError;
+    }
+    return pmInsufficientMemory;
+}
+
+
+/* winmm_out_delete -- carefully free data associated with midi */
+/**/
+static void winmm_out_delete(PmInternal *midi)
+{
+    int i;
+    /* delete system dependent device data */
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    if (m) {
+        if (m->buffer_signal) {
+            /* don't report errors -- better not to stop cleanup */
+            CloseHandle(m->buffer_signal);
+        }
+        /* if using stream output, free buffers */
+        for (i = 0; i < m->num_buffers; i++) {
+            if (m->buffers[i]) pm_free(m->buffers[i]);
+        }
+        m->num_buffers = 0;
+        pm_free(m->buffers);
+        m->max_buffers = 0;
+#ifdef USE_SYSEX_BUFFERS
+        /* free sysex buffers */
+        for (i = 0; i < NUM_SYSEX_BUFFERS; i++) {
+            if (m->sysex_buffers[i]) pm_free(m->sysex_buffers[i]);
+        }
+#endif
+    }
+    midi->descriptor = NULL;
+    pm_free(m); /* delete */
+}
+
+
+/* see comments for winmm_in_close */
+static PmError winmm_out_close(PmInternal *midi)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    if (m->handle.out) {
+        /* device to close */
+        if (midi->latency == 0) {
+            pm_hosterror = midiOutClose(m->handle.out);
+        } else {
+            pm_hosterror = midiStreamClose(m->handle.stream);
+        }
+        /* regardless of outcome, free memory */
+        winmm_out_delete(midi);
+    }
+    if (pm_hosterror) {
+        int err = midiOutGetErrorText(pm_hosterror,
+                                      (char *) pm_hosterror_text,
+                                      PM_HOST_ERROR_MSG_LEN);
+        assert(err == MMSYSERR_NOERROR);
+        return pmHostError;
+    }
+    return pmNoError;
+}
+
+
+static PmError winmm_out_abort(PmInternal *midi)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    m->error = MMSYSERR_NOERROR;
+
+    /* only stop output streams */
+    if (midi->latency > 0) {
+        m->error = midiStreamStop(m->handle.stream);
+    }
+    return m->error ? pmHostError : pmNoError;
+}
+
+
+static PmError winmm_write_flush(PmInternal *midi, PmTimestamp timestamp)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    assert(m);
+    if (m->hdr) {
+        m->error = midiOutPrepareHeader(m->handle.out, m->hdr, 
+                                        sizeof(MIDIHDR));
+        if (m->error) {
+            /* do not send message */
+        } else if (midi->latency == 0) {
+            /* As pointed out by Nigel Brown, 20Sep06, dwBytesRecorded
+             * should be zero. This is set in get_free_sysex_buffer(). 
+             * The msg length goes in dwBufferLength in spite of what
+             * Microsoft documentation says (or doesn't say). */
+            m->hdr->dwBufferLength = m->hdr->dwBytesRecorded;
+            m->hdr->dwBytesRecorded = 0;
+            m->error = midiOutLongMsg(m->handle.out, m->hdr, sizeof(MIDIHDR));
+        } else {
+            m->error = midiStreamOut(m->handle.stream, m->hdr, 
+                                     sizeof(MIDIHDR));
+        }
+        midi->fill_base = NULL;
+        m->hdr = NULL;
+        if (m->error) {
+            m->hdr->dwFlags = 0; /* release the buffer */
+            return pmHostError;
+        }
+    }
+    return pmNoError;
+}
+
+
+
+#ifdef GARBAGE
+static PmError winmm_write_sysex_byte(PmInternal *midi, unsigned char byte)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    unsigned char *msg_buffer;
+
+    /* at the beginning of sysex, m->hdr is NULL */
+    if (!m->hdr) { /* allocate a buffer if none allocated yet */
+        m->hdr = get_free_output_buffer(midi);
+        if (!m->hdr) return pmInsufficientMemory;
+        m->sysex_byte_count = 0;
+    }
+    /* figure out where to write byte */
+    msg_buffer = (unsigned char *) (m->hdr->lpData);
+    assert(m->hdr->lpData == (char *) (m->hdr + 1));
+
+    /* check for overflow */
+    if (m->sysex_byte_count >= m->hdr->dwBufferLength) {
+        /* allocate a bigger message -- double it every time */
+        LPMIDIHDR big = allocate_buffer(m->sysex_byte_count * 2);
+        /* printf("expand to %d bytes\n", m->sysex_byte_count * 2); */
+        if (!big) return pmInsufficientMemory;
+        m->error = midiOutPrepareHeader(m->handle.out, big,
+                                        sizeof(MIDIHDR));
+        if (m->error) {
+            m->hdr = NULL;
+            return pmHostError;
+        }
+        memcpy(big->lpData, msg_buffer, m->sysex_byte_count);
+        msg_buffer = (unsigned char *) (big->lpData);
+        if (m->buffers[0] == m->hdr) {
+            m->buffers[0] = big;
+            pm_free(m->hdr);
+            /* printf("freed m->hdr\n"); */
+        } else if (m->buffers[1] == m->hdr) {
+            m->buffers[1] = big;
+            pm_free(m->hdr);
+            /* printf("freed m->hdr\n"); */
+        }
+        m->hdr = big;
+    }
+
+    /* append byte to message */
+    msg_buffer[m->sysex_byte_count++] = byte;
+
+    /* see if we have a complete message */
+    if (byte == MIDI_EOX) {
+        m->hdr->dwBytesRecorded = m->sysex_byte_count;
+        /*
+        { int i; int len = m->hdr->dwBytesRecorded;
+          printf("OutLongMsg %d ", len);
+          for (i = 0; i < len; i++) {
+              printf("%2x ", msg_buffer[i]);
+          }
+        }
+        */
+        m->error = midiOutLongMsg(m->handle.out, m->hdr, sizeof(MIDIHDR));
+        m->hdr = NULL; /* stop using this message buffer */
+        if (m->error) return pmHostError;
+    }
+    return pmNoError;
+}
+#endif
+
+
+static PmError winmm_write_short(PmInternal *midi, PmEvent *event)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    PmError rslt = pmNoError;
+    assert(m);
+
+    if (midi->latency == 0) { /* use midiOut interface, ignore timestamps */
+        m->error = midiOutShortMsg(m->handle.out, event->message);
+        if (m->error) rslt = pmHostError;
+    } else {  /* use midiStream interface -- pass data through buffers */
+        unsigned long when = event->timestamp;
+        unsigned long delta;
+        int full;
+        if (when == 0) when = midi->now;
+        /* when is in real_time; translate to intended stream time */
+        when = when + m->delta + midi->latency;
+        /* make sure we don't go backward in time */
+        if (when < m->last_time) when = m->last_time;
+        delta = when - m->last_time;
+        m->last_time = when;
+        /* before we insert any data, we must have a buffer */
+        if (m->hdr == NULL) {
+            /* stream interface: buffers allocated when stream is opened */
+            m->hdr = get_free_output_buffer(midi);
+        }
+        full = add_to_buffer(m, m->hdr, delta, event->message);
+        if (full) rslt = winmm_write_flush(midi, when);
+    }
+    return rslt;
+}
+
+#define winmm_begin_sysex winmm_write_flush
+#ifndef winmm_begin_sysex
+static PmError winmm_begin_sysex(PmInternal *midi, PmTimestamp timestamp)
+{
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    PmError rslt = pmNoError;
+
+    if (midi->latency == 0) {
+        /* do nothing -- it's handled in winmm_write_byte */
+    } else {
+        /* sysex expects an empty sysex buffer, so send whatever is here */
+        rslt = winmm_write_flush(midi);
+    }
+    return rslt;
+}
+#endif
+
+static PmError winmm_end_sysex(PmInternal *midi, PmTimestamp timestamp)
+{
+    /* could check for callback_error here, but I haven't checked
+     * what happens if we exit early and don't finish the sysex msg
+     * and clean up
+     */
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    PmError rslt = pmNoError;
+    LPMIDIHDR hdr = m->hdr;
+    if (!hdr) return rslt; /* something bad happened earlier,
+            do not report an error because it would have been 
+            reported (at least) once already */
+    /* a(n old) version of MIDI YOKE requires a zero byte after
+     * the sysex message, but do not increment dwBytesRecorded: */
+    hdr->lpData[hdr->dwBytesRecorded] = 0;
+    if (midi->latency == 0) {
+#ifdef DEBUG_PRINT_BEFORE_SENDING_SYSEX
+        /* DEBUG CODE: */
+        { int i; int len = m->hdr->dwBufferLength;
+          printf("OutLongMsg %d ", len);
+          for (i = 0; i < len; i++) {
+              printf("%2x ", (unsigned char) (m->hdr->lpData[i]));
+          }
+        }
+#endif
+    } else {
+        /* Using stream interface. There are accumulated bytes in m->hdr
+           to send using midiStreamOut
+         */
+        /* add bytes recorded to MIDIEVENT length, but don't
+           count the MIDIEVENT data (3 longs) */
+        MIDIEVENT *evt = (MIDIEVENT *) (hdr->lpData);
+        evt->dwEvent += hdr->dwBytesRecorded - 3 * sizeof(long);
+        /* round up BytesRecorded to multiple of 4 */
+        hdr->dwBytesRecorded = (hdr->dwBytesRecorded + 3) & ~3;
+    }
+    rslt = winmm_write_flush(midi, timestamp);
+    return rslt;
+}
+
+
+static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
+                                PmTimestamp timestamp)
+{
+    /* write a sysex byte */
+    PmError rslt = pmNoError;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    LPMIDIHDR hdr = m->hdr;
+    unsigned char *msg_buffer;
+    assert(m);
+    if (!hdr) {
+        m->hdr = hdr = get_free_output_buffer(midi);
+        assert(hdr);
+        midi->fill_base = (unsigned char *) m->hdr->lpData;
+        midi->fill_offset_ptr = &(hdr->dwBytesRecorded);
+        /* when buffer fills, Pm_WriteSysEx will revert to calling
+         * pmwin_write_byte, which expect to have space, so leave
+         * one byte free for pmwin_write_byte. Leave another byte
+         * of space for zero after message to make early version of 
+         * MIDI YOKE driver happy -- therefore dwBufferLength - 2 */
+        midi->fill_length = hdr->dwBufferLength - 2;
+        if (midi->latency != 0) {
+            unsigned long when = (unsigned long) timestamp;
+            unsigned long delta;
+            unsigned long *ptr;
+            if (when == 0) when = midi->now;
+            /* when is in real_time; translate to intended stream time */
+            when = when + m->delta + midi->latency;
+            /* make sure we don't go backward in time */
+            if (when < m->last_time) when = m->last_time;
+            delta = when - m->last_time;
+            m->last_time = when;
+
+            ptr = (unsigned long *) hdr->lpData;
+            *ptr++ = delta;
+            *ptr++ = 0;
+            *ptr = MEVT_F_LONG;
+            hdr->dwBytesRecorded = 3 * sizeof(long);
+            /* data will be added at an offset of dwBytesRecorded ... */
+        }
+    }
+    /* add the data byte */
+    msg_buffer = (unsigned char *) (hdr->lpData);
+    msg_buffer[hdr->dwBytesRecorded++] = byte;
+
+    /* see if buffer is full, leave one byte extra for pad */
+    if (hdr->dwBytesRecorded >= hdr->dwBufferLength - 1) {
+        /* write what we've got and continue */
+        rslt = winmm_end_sysex(midi, timestamp); 
+    }
+    return rslt;
+}
+
+#ifdef EXPANDING_SYSEX_BUFFERS
+note: this code is here as an aid in case you want sysex buffers
+      to expand to hold large messages completely. If so, you
+      will want to change SYSEX_BYTES_PER_BUFFER above to some
+      variable that remembers the buffer size. A good place to 
+      put this value would be in the hdr->dwUser field.
+
+            rslt = resize_sysex_buffer(midi, m->sysex_byte_count, 
+                                       m->sysex_byte_count * 2);
+
+            if (rslt == pmBufferMaxSize) /* if the buffer can't be resized */
+#endif
+#ifdef EXPANDING_SYSEX_BUFFERS
+            int bytesRecorded = hdr->dwBytesRecorded; /* this field gets wiped out, so we'll save it */
+            rslt = resize_sysex_buffer(midi, bytesRecorded, 2 * bytesRecorded);
+            hdr->dwBytesRecorded = bytesRecorded;
+
+            if (rslt == pmBufferMaxSize) /* if buffer can't be resized */
+#endif
+
+
+
+static PmTimestamp winmm_synchronize(PmInternal *midi)
+{
+    midiwinmm_type m;
+    unsigned long pm_stream_time_2;
+    unsigned long real_time;
+    unsigned long pm_stream_time;
+
+    /* only synchronize if we are using stream interface */
+    if (midi->latency == 0) return 0;
+
+    /* figure out the time */
+    m = (midiwinmm_type) midi->descriptor;
+    pm_stream_time_2 = pm_time_get(m);
+
+    do {
+        /* read real_time between two reads of stream time */
+        pm_stream_time = pm_stream_time_2;
+        real_time = (*midi->time_proc)(midi->time_info);
+        pm_stream_time_2 = pm_time_get(m);
+        /* repeat if more than 1ms elapsed */
+    } while (pm_stream_time_2 > pm_stream_time + 1);
+    m->delta = pm_stream_time - real_time;
+    m->sync_time = real_time;
+    return real_time;
+}
+
+#ifdef USE_SYSEX_BUFFERS
+/* winmm_out_callback -- recycle sysex buffers */
+static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
+                                        DWORD dwInstance, DWORD dwParam1, 
+                                        DWORD dwParam2)
+{
+    PmInternal *midi = (PmInternal *) dwInstance;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    LPMIDIHDR hdr = (LPMIDIHDR) dwParam1;
+    int err = 0;  /* set to 0 so that no buffer match will also be an error */
+
+    /* Future optimization: eliminate UnprepareHeader calls -- they aren't
+       necessary; however, this code uses the prepared-flag to indicate which
+       buffers are free, so we need to do something to flag empty buffers if
+       we leave them prepared
+     */
+    /*
+    printf("out_callback: hdr %x, wMsg %x, MOM_DONE %x\n", 
+           hdr, wMsg, MOM_DONE);
+    */
+    if (wMsg == MOM_DONE)
+        assert(midiOutUnprepareHeader(m->handle.out, hdr,
+                        sizeof(MIDIHDR)) == MMSYSERR_NOERROR);
+    /* notify waiting sender that a buffer is available */
+    err = SetEvent(m->buffer_signal);
+    assert(err); /* false -> error */
+}
+#endif
+
+/* winmm_streamout_callback -- unprepare (free) buffer header */
+static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
+        DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
+{
+    PmInternal *midi = (PmInternal *) dwInstance;
+    midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+    LPMIDIHDR hdr = (LPMIDIHDR) dwParam1;
+    int err;
+
+    /* Even if an error is pending, I think we should unprepare msgs and
+       signal their arrival
+     */
+    /* printf("streamout_callback: hdr %x, wMsg %x, MOM_DONE %x\n", 
+           hdr, wMsg, MOM_DONE); */
+    if (wMsg == MOM_DONE) {
+        assert(midiOutUnprepareHeader(m->handle.out, hdr, 
+                    sizeof(MIDIHDR)) == MMSYSERR_NOERROR);
+    }
+    /* signal client in case it is blocked waiting for buffer */
+    err = SetEvent(m->buffer_signal);
+    assert(err); /* false -> error */
+}
+
+
+/*
+=========================================================================================
+begin exported functions
+=========================================================================================
+*/
+
+#define winmm_in_abort pm_fail_fn
+pm_fns_node pm_winmm_in_dictionary = {
+                                         none_write_short,
+                                         none_sysex,
+                                         none_sysex,
+                                         none_write_byte,
+                                         none_write_short,
+                                         none_write_flush,
+                                         winmm_synchronize,
+                                         winmm_in_open,
+                                         winmm_in_abort,
+                                         winmm_in_close,
+                                         winmm_in_poll,
+                                         winmm_has_host_error,
+                                         winmm_get_host_error
+                                     };
+
+pm_fns_node pm_winmm_out_dictionary = {
+                                          winmm_write_short,
+                                          winmm_begin_sysex,
+                                          winmm_end_sysex,
+                                          winmm_write_byte,
+                                          winmm_write_short,  /* short realtime message */
+                                          winmm_write_flush,
+                                          winmm_synchronize,
+                                          winmm_out_open,
+                                          winmm_out_abort,
+                                          winmm_out_close,
+                                          none_poll,
+                                          winmm_has_host_error,
+                                          winmm_get_host_error
+                                      };
+
+
+/* initialize winmm interface. Note that if there is something wrong
+   with winmm (e.g. it is not supported or installed), it is not an
+   error. We should simply return without having added any devices to
+   the table. Hence, no error code is returned. Furthermore, this init
+   code is called along with every other supported interface, so the
+   user would have a very hard time figuring out what hardware and API
+   generated the error. Finally, it would add complexity to pmwin.c to
+   remember where the error code came from in order to convert to text.
+ */
+void pm_winmm_init( void )
+{
+    pm_winmm_mapper_input();
+    pm_winmm_mapper_output();
+    pm_winmm_general_inputs();
+    pm_winmm_general_outputs();
+}
+
+
+/* no error codes are returned, even if errors are encountered, because
+   there is probably nothing the user could do (e.g. it would be an error
+   to retry.
+ */
+void pm_winmm_term( void )
+{
+    int i;
+#ifdef DEBUG
+    char msg[PM_HOST_ERROR_MSG_LEN];
+#endif
+    int doneAny = 0;
+#ifdef DEBUG
+    printf("pm_winmm_term called\n");
+#endif
+    for (i = 0; i < pm_descriptor_index; i++) {
+        PmInternal * midi = descriptors[i].internalDescriptor;
+        if (midi) {
+            midiwinmm_type m = (midiwinmm_type) midi->descriptor;
+            if (m->handle.out) {
+                /* close next open device*/
+#ifdef DEBUG
+                if (doneAny == 0) {
+                    printf("begin closing open devices...\n");
+                    doneAny = 1;
+                }
+                /* report any host errors; this EXTEREMELY useful when
+                   trying to debug client app */
+                if (winmm_has_host_error(midi)) {
+                    winmm_get_host_error(midi, msg, PM_HOST_ERROR_MSG_LEN);
+                    printf("%s\n", msg);
+                }
+#endif
+                /* close all open ports */
+                (*midi->dictionary->close)(midi);
+            }
+        }
+    }
+    if (midi_in_caps) {
+        pm_free(midi_in_caps);
+        midi_in_caps = NULL;
+    }
+    if (midi_out_caps) {
+        pm_free(midi_out_caps);
+        midi_out_caps = NULL;
+    }
+#ifdef DEBUG
+    if (doneAny) {
+        printf("warning: devices were left open. They have been closed.\n");
+    }
+    printf("pm_winmm_term exiting\n");
+#endif
+    pm_descriptor_index = 0;
+}
diff --git a/lib-src/portmidi/pm_win/pmwinmm.h b/lib-src/portmidi/pm_win/pmwinmm.h
new file mode 100644
index 0000000..9474200
--- /dev/null
+++ b/lib-src/portmidi/pm_win/pmwinmm.h
@@ -0,0 +1,5 @@
+/* midiwin32.h -- system-specific definitions */
+
+void pm_winmm_init( void );
+void pm_winmm_term( void );
+
diff --git a/lib-src/portmidi/portmidi-VC9.vcproj b/lib-src/portmidi/portmidi-VC9.vcproj
new file mode 100644
index 0000000..5580eca
--- /dev/null
+++ b/lib-src/portmidi/portmidi-VC9.vcproj
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="PortMidi"
+	ProjectGUID="{33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug VC9|Win32"
+			OutputDirectory=".\pm_win\Debug VC9"
+			IntermediateDirectory=".\pm_win\Debug VC9"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="pm_common,porttime,pm_win"
+				PreprocessorDefinitions="_LIB;DEBUG;PM_CHECK_ERRORS;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\portmidi.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\$(OutDir)\portmidi.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\portmidi.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release VC9|Win32"
+			OutputDirectory=".\pm_win\Release VC9"
+			IntermediateDirectory=".\pm_win\Release VC9"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="pm_common,porttime,pm_win"
+				PreprocessorDefinitions="WIN32;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\portmidi.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\$(OutDir)\portmidi.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\portmidi.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\pm_common\pminternal.h"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_common\pmutil.c"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_common\pmutil.h"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_win\pmwin.c"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_win\pmwinmm.c"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_win\pmwinmm.h"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_common\portmidi.c"
+			>
+		</File>
+		<File
+			RelativePath=".\pm_common\portmidi.h"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/portmidi.vcproj b/lib-src/portmidi/portmidi.vcproj
new file mode 100644
index 0000000..83ddc92
--- /dev/null
+++ b/lib-src/portmidi/portmidi.vcproj
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="portmidi"
+	ProjectGUID="{33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="pm_common,porttime,pm_win"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;DEBUG;PM_CHECK_ERRORS"
+				StringPooling="true"
+				MinimalRebuild="false"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)\"
+				ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+				DisableSpecificWarnings="4996"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile="$(OutDir)/$(ProjectName).bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				AdditionalIncludeDirectories="pm_common,porttime,pm_win"
+				PreprocessorDefinitions="WIN32;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=""
+				AssemblerListingLocation=""
+				ObjectFile="$(IntDir)\"
+				ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile="$(OutDir)\$(ProjectName).lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\pm_win\Release/portmidi.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="pm_common\pmutil.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="pm_win\pmwin.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="pm_win\pmwinmm.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="pm_common\portmidi.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\porttime\porttime.c"
+				>
+			</File>
+			<File
+				RelativePath=".\porttime\ptwinmm.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="pm_common\pminternal.h"
+				>
+			</File>
+			<File
+				RelativePath="pm_common\pmutil.h"
+				>
+			</File>
+			<File
+				RelativePath="pm_win\pmwinmm.h"
+				>
+			</File>
+			<File
+				RelativePath="pm_common\portmidi.h"
+				>
+			</File>
+			<File
+				RelativePath=".\porttime\porttime.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/portmusic_logo.png b/lib-src/portmidi/portmusic_logo.png
new file mode 100644
index 0000000..17a063a
Binary files /dev/null and b/lib-src/portmidi/portmusic_logo.png differ
diff --git a/lib-src/portmidi/porttime/porttime-VC9.vcproj b/lib-src/portmidi/porttime/porttime-VC9.vcproj
new file mode 100644
index 0000000..929533a
--- /dev/null
+++ b/lib-src/portmidi/porttime/porttime-VC9.vcproj
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="PortTime"
+	ProjectGUID="{338224B8-D575-408D-BACF-95C557B429BE}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\$(OutDir)\porttime.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\$(OutDir)\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug VC9|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_LIB;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\$(OutDir)\porttime.pch"
+				AssemblerListingLocation=".\$(OutDir)\"
+				ObjectFile=".\$(OutDir)\"
+				ProgramDataBaseFileName=".\$(OutDir)\"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\$(OutDir)\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\$(OutDir)\porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\porttime.c"
+			>
+		</File>
+		<File
+			RelativePath=".\porttime.h"
+			>
+		</File>
+		<File
+			RelativePath=".\ptwinmm.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/porttime/porttime.c b/lib-src/portmidi/porttime/porttime.c
new file mode 100644
index 0000000..4a6be96
--- /dev/null
+++ b/lib-src/portmidi/porttime/porttime.c
@@ -0,0 +1,3 @@
+/* porttime.c -- portable API for millisecond timer */
+
+/* There is no machine-independent implementation code to put here */
diff --git a/lib-src/portmidi/porttime/porttime.dsp b/lib-src/portmidi/porttime/porttime.dsp
new file mode 100644
index 0000000..364373c
--- /dev/null
+++ b/lib-src/portmidi/porttime/porttime.dsp
@@ -0,0 +1,104 @@
+# Microsoft Developer Studio Project File - Name="porttime" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=porttime - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "porttime.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "porttime.mak" CFG="porttime - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "porttime - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "porttime - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "porttime - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "porttime - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_LIB" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "USE_DLL_FOR_CLEANUP" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "porttime - Win32 Release"
+# Name "porttime - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\porttime.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ptwinmm.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\porttime.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/lib-src/portmidi/porttime/porttime.h b/lib-src/portmidi/porttime/porttime.h
new file mode 100644
index 0000000..1ed12eb
--- /dev/null
+++ b/lib-src/portmidi/porttime/porttime.h
@@ -0,0 +1,72 @@
+/* porttime.h -- portable interface to millisecond timer */
+
+/* CHANGE LOG FOR PORTTIME
+  10-Jun-03 Mark Nelson & RBD
+    boost priority of timer thread in ptlinux.c implementation
+ */
+
+/* Should there be a way to choose the source of time here? */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+typedef enum {
+    ptNoError = 0,         /* success */
+    ptHostError = -10000,  /* a system-specific error occurred */
+    ptAlreadyStarted,      /* cannot start timer because it is already started */
+    ptAlreadyStopped,      /* cannot stop timer because it is already stopped */
+    ptInsufficientMemory   /* memory could not be allocated */
+} PtError;
+
+
+typedef long PtTimestamp;
+
+typedef void (PtCallback)( PtTimestamp timestamp, void *userData );
+
+/*
+    Pt_Start() starts a real-time service.
+
+    resolution is the timer resolution in ms. The time will advance every
+    resolution ms.
+
+    callback is a function pointer to be called every resolution ms.
+
+    userData is passed to callback as a parameter.
+
+    return value:
+    Upon success, returns ptNoError. See PtError for other values.
+*/
+PtError Pt_Start(int resolution, PtCallback *callback, void *userData);
+
+/*
+    Pt_Stop() stops the timer.
+
+    return value:
+    Upon success, returns ptNoError. See PtError for other values.
+*/
+PtError Pt_Stop();
+
+/*
+    Pt_Started() returns true iff the timer is running.
+*/
+int Pt_Started();
+
+/* 
+    Pt_Time() returns the current time in ms.
+*/
+PtTimestamp Pt_Time();
+
+/*
+    Pt_Sleep() pauses, allowing other threads to run.
+
+    duration is the length of the pause in ms. The true duration 
+    of the pause may be rounded to the nearest or next clock tick
+    as determined by resolution in Pt_Start().
+*/
+void Pt_Sleep(long duration);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/lib-src/portmidi/porttime/porttime.vcproj b/lib-src/portmidi/porttime/porttime.vcproj
new file mode 100644
index 0000000..c126a8b
--- /dev/null
+++ b/lib-src/portmidi/porttime/porttime.vcproj
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="porttime"
+	ProjectGUID="{338224B8-D575-408D-BACF-95C557B429BE}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/porttime.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_LIB;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\Debug/porttime.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_LIB;WIN32;_DEBUG"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\Debug/porttime.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/porttime.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\porttime.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/porttime.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="porttime.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ptwinmm.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Unicode Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="porttime.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/lib-src/portmidi/porttime/ptlinux.c b/lib-src/portmidi/porttime/ptlinux.c
new file mode 100644
index 0000000..e2aad0a
--- /dev/null
+++ b/lib-src/portmidi/porttime/ptlinux.c
@@ -0,0 +1,133 @@
+/* ptlinux.c -- portable timer implementation for linux */
+
+
+/* IMPLEMENTATION NOTES (by Mark Nelson): 
+
+Unlike Windows, Linux has no system call to request a periodic callback,
+so if Pt_Start() receives a callback parameter, it must create a thread
+that wakes up periodically and calls the provided callback function.
+If running as superuser, use setpriority() to renice thread to -20.  
+One could also set the timer thread to a real-time priority (SCHED_FIFO
+and SCHED_RR), but this is dangerous for This is necessary because  
+if the callback hangs it'll never return. A more serious reason
+is that the current scheduler implementation busy-waits instead 
+of sleeping when realtime threads request a sleep of <=2ms (as a way 
+to get around the 10ms granularity), which means the thread would never 
+let anyone else on the CPU.
+
+CHANGE LOG
+
+18-Jul-03 Roger Dannenberg -- Simplified code to set priority of timer
+            thread. Simplified implementation notes. 
+
+*/
+/* stdlib, stdio, unistd, and sys/types were added because they appeared
+ * in a Gentoo patch, but I'm not sure why they are needed. -RBD
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include "porttime.h"
+#include "sys/time.h"
+#include "sys/resource.h"
+#include "sys/timeb.h"
+#include "pthread.h"
+
+#define TRUE 1
+#define FALSE 0
+
+static int time_started_flag = FALSE;
+static struct timeb time_offset = {0, 0, 0, 0};
+static pthread_t pt_thread_pid;
+
+/* note that this is static data -- we only need one copy */
+typedef struct {
+    int id;
+    int resolution;
+    PtCallback *callback;
+    void *userData;
+} pt_callback_parameters;
+
+static int pt_callback_proc_id = 0;
+
+static void *Pt_CallbackProc(void *p)
+{
+    pt_callback_parameters *parameters = (pt_callback_parameters *) p;
+    int mytime = 1;
+    /* to kill a process, just increment the pt_callback_proc_id */
+    /* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id,
+           parameters->id); */
+    if (geteuid() == 0) setpriority(PRIO_PROCESS, 0, -20);
+    while (pt_callback_proc_id == parameters->id) {
+        /* wait for a multiple of resolution ms */
+        struct timeval timeout;
+        int delay = mytime++ * parameters->resolution - Pt_Time();
+        if (delay < 0) delay = 0;
+        timeout.tv_sec = 0;
+        timeout.tv_usec = delay * 1000;
+        select(0, NULL, NULL, NULL, &timeout);
+        (*(parameters->callback))(Pt_Time(), parameters->userData);
+    }
+    /* printf("Pt_CallbackProc exiting\n"); */
+    // free(parameters);
+    return NULL;
+}
+
+
+PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+{
+    if (time_started_flag) return ptNoError;
+    ftime(&time_offset); /* need this set before process runs */
+    if (callback) {
+        int res;
+        pt_callback_parameters *parms = (pt_callback_parameters *) 
+            malloc(sizeof(pt_callback_parameters));
+        if (!parms) return ptInsufficientMemory;
+        parms->id = pt_callback_proc_id;
+        parms->resolution = resolution;
+        parms->callback = callback;
+        parms->userData = userData;
+        res = pthread_create(&pt_thread_pid, NULL, 
+                             Pt_CallbackProc, parms);
+        if (res != 0) return ptHostError;
+    }
+    time_started_flag = TRUE;
+    return ptNoError;
+}
+
+
+PtError Pt_Stop()
+{
+    /* printf("Pt_Stop called\n"); */
+    pt_callback_proc_id++;
+    pthread_join(pt_thread_pid, NULL);
+    time_started_flag = FALSE;
+    return ptNoError;
+}
+
+
+int Pt_Started()
+{
+    return time_started_flag;
+}
+
+
+PtTimestamp Pt_Time()
+{
+    long seconds, milliseconds;
+    struct timeb now;
+    ftime(&now);
+    seconds = now.time - time_offset.time;
+    milliseconds = now.millitm - time_offset.millitm;
+    return seconds * 1000 + milliseconds;
+}
+
+
+void Pt_Sleep(long duration)
+{
+    usleep(duration * 1000);
+}
+
+
+
diff --git a/lib-src/portmidi/porttime/ptmacosx_cf.c b/lib-src/portmidi/porttime/ptmacosx_cf.c
new file mode 100644
index 0000000..71f1166
--- /dev/null
+++ b/lib-src/portmidi/porttime/ptmacosx_cf.c
@@ -0,0 +1,140 @@
+/* ptmacosx.c -- portable timer implementation for mac os x */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <pthread.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+#import <mach/mach.h>
+#import <mach/mach_error.h>
+#import <mach/mach_time.h>
+#import <mach/clock.h>
+
+#include "porttime.h"
+
+#define THREAD_IMPORTANCE 30
+#define LONG_TIME 1000000000.0
+
+static int time_started_flag = FALSE;
+static CFAbsoluteTime startTime = 0.0;
+static CFRunLoopRef timerRunLoop;
+
+typedef struct {
+    int resolution;
+    PtCallback *callback;
+    void *userData;
+} PtThreadParams;
+
+
+void Pt_CFTimerCallback(CFRunLoopTimerRef timer, void *info)
+{
+    PtThreadParams *params = (PtThreadParams*)info;
+    (*params->callback)(Pt_Time(), params->userData);
+}
+
+static void* Pt_Thread(void *p)
+{
+    CFTimeInterval timerInterval;
+    CFRunLoopTimerContext timerContext;
+    CFRunLoopTimerRef timer;
+    PtThreadParams *params = (PtThreadParams*)p;
+    //CFTimeInterval timeout;
+
+    /* raise the thread's priority */
+    kern_return_t error;
+    thread_extended_policy_data_t extendedPolicy;
+    thread_precedence_policy_data_t precedencePolicy;
+
+    extendedPolicy.timeshare = 0;
+    error = thread_policy_set(mach_thread_self(), THREAD_EXTENDED_POLICY,
+                              (thread_policy_t)&extendedPolicy,
+                              THREAD_EXTENDED_POLICY_COUNT);
+    if (error != KERN_SUCCESS) {
+        mach_error("Couldn't set thread timeshare policy", error);
+    }
+
+    precedencePolicy.importance = THREAD_IMPORTANCE;
+    error = thread_policy_set(mach_thread_self(), THREAD_PRECEDENCE_POLICY,
+                              (thread_policy_t)&precedencePolicy,
+                              THREAD_PRECEDENCE_POLICY_COUNT);
+    if (error != KERN_SUCCESS) {
+        mach_error("Couldn't set thread precedence policy", error);
+    }
+
+    /* set up the timer context */
+    timerContext.version = 0;
+    timerContext.info = params;
+    timerContext.retain = NULL;
+    timerContext.release = NULL;
+    timerContext.copyDescription = NULL;
+
+    /* create a new timer */
+    timerInterval = (double)params->resolution / 1000.0;
+    timer = CFRunLoopTimerCreate(NULL, startTime+timerInterval, timerInterval,
+                                 0, 0, Pt_CFTimerCallback, &timerContext);
+
+    timerRunLoop = CFRunLoopGetCurrent();
+    CFRunLoopAddTimer(timerRunLoop, timer, CFSTR("PtTimeMode"));
+
+    /* run until we're told to stop by Pt_Stop() */
+    CFRunLoopRunInMode(CFSTR("PtTimeMode"), LONG_TIME, false);
+    
+    CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), timer, CFSTR("PtTimeMode"));
+    CFRelease(timer);
+    free(params);
+
+    return NULL;
+}
+
+PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+{
+    PtThreadParams *params = (PtThreadParams*)malloc(sizeof(PtThreadParams));
+    pthread_t pthread_id;
+
+    printf("Pt_Start() called\n");
+
+    // /* make sure we're not already playing */
+    if (time_started_flag) return ptAlreadyStarted;
+    startTime = CFAbsoluteTimeGetCurrent();
+
+    if (callback) {
+    
+        params->resolution = resolution;
+        params->callback = callback;
+        params->userData = userData;
+    
+        pthread_create(&pthread_id, NULL, Pt_Thread, params);
+    }
+
+    time_started_flag = TRUE;
+    return ptNoError;
+}
+
+
+PtError Pt_Stop()
+{
+    printf("Pt_Stop called\n");
+
+    CFRunLoopStop(timerRunLoop);
+    time_started_flag = FALSE;
+    return ptNoError;
+}
+
+
+int Pt_Started()
+{
+    return time_started_flag;
+}
+
+
+PtTimestamp Pt_Time()
+{
+    CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
+    return (PtTimestamp) ((now - startTime) * 1000.0);
+}
+
+
+void Pt_Sleep(long duration)
+{
+    usleep(duration * 1000);
+}
diff --git a/lib-src/portmidi/porttime/ptmacosx_mach.c b/lib-src/portmidi/porttime/ptmacosx_mach.c
new file mode 100644
index 0000000..34f83a4
--- /dev/null
+++ b/lib-src/portmidi/porttime/ptmacosx_mach.c
@@ -0,0 +1,130 @@
+/* ptmacosx.c -- portable timer implementation for mac os x */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <CoreAudio/HostTime.h>
+
+#import <mach/mach.h>
+#import <mach/mach_error.h>
+#import <mach/mach_time.h>
+#import <mach/clock.h>
+#include <unistd.h>
+
+#include "porttime.h"
+#include "sys/time.h"
+#include "pthread.h"
+
+#define NSEC_PER_MSEC 1000000
+#define THREAD_IMPORTANCE 30
+
+static int time_started_flag = FALSE;
+static UInt64 start_time;
+static pthread_t pt_thread_pid;
+
+/* note that this is static data -- we only need one copy */
+typedef struct {
+    int id;
+    int resolution;
+    PtCallback *callback;
+    void *userData;
+} pt_callback_parameters;
+
+static int pt_callback_proc_id = 0;
+
+static void *Pt_CallbackProc(void *p)
+{
+    pt_callback_parameters *parameters = (pt_callback_parameters *) p;
+    int mytime = 1;
+
+    kern_return_t error;
+    thread_extended_policy_data_t extendedPolicy;
+    thread_precedence_policy_data_t precedencePolicy;
+
+    extendedPolicy.timeshare = 0;
+    error = thread_policy_set(mach_thread_self(), THREAD_EXTENDED_POLICY,
+                              (thread_policy_t)&extendedPolicy,
+                              THREAD_EXTENDED_POLICY_COUNT);
+    if (error != KERN_SUCCESS) {
+        mach_error("Couldn't set thread timeshare policy", error);
+    }
+
+    precedencePolicy.importance = THREAD_IMPORTANCE;
+    error = thread_policy_set(mach_thread_self(), THREAD_PRECEDENCE_POLICY,
+                              (thread_policy_t)&precedencePolicy,
+                              THREAD_PRECEDENCE_POLICY_COUNT);
+    if (error != KERN_SUCCESS) {
+        mach_error("Couldn't set thread precedence policy", error);
+    }
+    
+    
+    /* to kill a process, just increment the pt_callback_proc_id */
+    /* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id, parameters->id); */
+    while (pt_callback_proc_id == parameters->id) {
+        /* wait for a multiple of resolution ms */
+        UInt64 wait_time;
+        int delay = mytime++ * parameters->resolution - Pt_Time();
+	long timestamp;
+        if (delay < 0) delay = 0;
+        wait_time = AudioConvertNanosToHostTime((UInt64)delay * NSEC_PER_MSEC);
+        wait_time += AudioGetCurrentHostTime();
+        error = mach_wait_until(wait_time);
+	timestamp = Pt_Time();
+        (*(parameters->callback))(timestamp, parameters->userData);
+    }
+    free(parameters);
+    return NULL;
+}
+
+
+PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+{
+    if (time_started_flag) return ptAlreadyStarted;
+    start_time = AudioGetCurrentHostTime();
+    
+    if (callback) {
+        int res;
+        pt_callback_parameters *parms;
+
+        parms = (pt_callback_parameters *) malloc(sizeof(pt_callback_parameters));
+        if (!parms) return ptInsufficientMemory;
+        parms->id = pt_callback_proc_id;
+        parms->resolution = resolution;
+        parms->callback = callback;
+        parms->userData = userData;
+        res = pthread_create(&pt_thread_pid, NULL, Pt_CallbackProc, parms);
+        if (res != 0) return ptHostError;
+    }
+    
+    time_started_flag = TRUE;
+    return ptNoError;
+}
+
+
+PtError Pt_Stop()
+{
+    /* printf("Pt_Stop called\n"); */
+    pt_callback_proc_id++;
+    time_started_flag = FALSE;
+    return ptNoError;
+}
+
+
+int Pt_Started()
+{
+    return time_started_flag;
+}
+
+
+PtTimestamp Pt_Time()
+{
+    UInt64 clock_time, nsec_time;
+    clock_time = AudioGetCurrentHostTime() - start_time;
+    nsec_time = AudioConvertHostTimeToNanos(clock_time);
+    return (PtTimestamp)(nsec_time / NSEC_PER_MSEC);
+}
+
+
+void Pt_Sleep(long duration)
+{
+    usleep(duration * 1000);
+}
diff --git a/lib-src/portmidi/porttime/ptwinmm.c b/lib-src/portmidi/porttime/ptwinmm.c
new file mode 100644
index 0000000..ce19fa5
--- /dev/null
+++ b/lib-src/portmidi/porttime/ptwinmm.c
@@ -0,0 +1,70 @@
+/* ptwinmm.c -- portable timer implementation for win32 */
+
+
+#include "porttime.h"
+#include "windows.h"
+#include "time.h"
+
+
+TIMECAPS caps;
+
+static long time_offset = 0;
+static int time_started_flag = FALSE;
+static long time_resolution;
+static MMRESULT timer_id;
+static PtCallback *time_callback;
+
+void CALLBACK winmm_time_callback(UINT uID, UINT uMsg, DWORD_PTR dwUser, 
+                                  DWORD_PTR dw1, DWORD_PTR dw2)
+{
+    (*time_callback)(Pt_Time(), (void *) dwUser);
+}
+ 
+
+PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+{
+    if (time_started_flag) return ptAlreadyStarted;
+    timeBeginPeriod(resolution);
+    time_resolution = resolution;
+    time_offset = timeGetTime();
+    time_started_flag = TRUE;
+    time_callback = callback;
+    if (callback) {
+        timer_id = timeSetEvent(resolution, 1, winmm_time_callback, 
+            (DWORD_PTR) userData, TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
+        if (!timer_id) return ptHostError;
+    }
+    return ptNoError;
+}
+
+
+PtError Pt_Stop()
+{
+    if (!time_started_flag) return ptAlreadyStopped;
+    if (time_callback && timer_id) {
+        timeKillEvent(timer_id);
+        time_callback = NULL;
+        timer_id = 0;
+    }
+    time_started_flag = FALSE;
+    timeEndPeriod(time_resolution);
+    return ptNoError;
+}
+
+
+int Pt_Started()
+{
+    return time_started_flag;
+}
+
+
+PtTimestamp Pt_Time()
+{
+    return timeGetTime() - time_offset;
+}
+
+
+void Pt_Sleep(long duration)
+{
+    Sleep(duration);
+}
diff --git a/lib-src/portsmf/unsigned-const-casts.patch b/lib-src/portsmf/unsigned-const-casts.patch
new file mode 100644
index 0000000..b774926
--- /dev/null
+++ b/lib-src/portsmf/unsigned-const-casts.patch
@@ -0,0 +1,21 @@
+--- audacity-src-1.3.6/lib-src/portsmf/allegrord.cpp-orig	2009-01-07 12:52:34.939330000 -0600
++++ audacity-src-1.3.6/lib-src/portsmf/allegrord.cpp	2009-01-07 12:56:25.158766000 -0600
+@@ -262,7 +262,7 @@ bool Alg_reader::parse()
+                         parse_error(field, 0, "Dur specified twice");
+                     } else {
+                         // prepend 'U' to field, copy EOS too
+-                        field.insert(0, 1, 'U');
++                        field.insert((unsigned int)0, 1, 'U');
+                         dur = parse_dur(field, time);
+                         dur_flag = true;
+                     }
+@@ -271,7 +271,7 @@ bool Alg_reader::parse()
+                         parse_error(field, 0, "Pitch specified twice");
+                     } else {
+                         // prepend 'P' to field
+-                        field.insert(0, 1, 'P');
++                        field.insert((unsigned int)0, 1, 'P');
+                         new_pitch = parse_pitch(field);
+                         new_pitch_flag = true;
+                     }
+
diff --git a/lib-src/sbsms/dont-mangle-cflags.patch b/lib-src/sbsms/dont-mangle-cflags.patch
new file mode 100644
index 0000000..8b0d790
--- /dev/null
+++ b/lib-src/sbsms/dont-mangle-cflags.patch
@@ -0,0 +1,42 @@
+Index: configure.in
+===================================================================
+RCS file: /cvsroot/audacity/lib-src/sbsms/configure.in,v
+retrieving revision 1.5
+diff -u -r1.5 configure.in
+--- configure.in	17 Jan 2009 21:50:37 -0000	1.5
++++ configure.in	12 Jul 2009 16:32:54 -0000
+@@ -39,8 +39,18 @@
+ AC_PROG_LIBTOOL
+ AM_PROG_LIBTOOL
+ 
++# save $CXXFLAGS etc. since AC_PROG_CXX likes to insert "-g -O2"
++# if $CXXFLAGS is blank and it finds GCC
++cflags_save="$CFLAGS"
++cppflags_save="$CPPFLAGS"
++cxxflags_save="$CXXFLAGS"
+ AC_LANG([C++])
+ AC_PROG_CXX
++AC_PROG_CXXCPP
++# restore those variables back
++CFLAGS="$cflags_save"
++CPPFLAGS="$cppflags_save"
++CXXFLAGS="$cxxflags_save"
+ 
+ AC_CHECK_FUNCS(malloc calloc free memcpy)
+ 
+@@ -123,12 +133,10 @@
+ fi
+ AM_CONDITIONAL(ENABLE_PORTAUDIO, test x$enable_portaudio = xyes)
+ 
+-CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-g//" -e "s/-O2//"`
+-
++# legitimately we can add -g to flags for debug builds, because they won't
++# be much use otherwise
+ if test x$enable_debug = xyes; then
+-   CXXFLAGS="$CXXFLAGS -g -O0"
+-else
+-   CXXFLAGS="$CXXFLAGS -O3 -fomit-frame-pointer"
++   CXXFLAGS="$CXXFLAGS -g"
+ fi
+ 
+ if test x$enable_static = xyes; then
diff --git a/lib-src/taglib/AUTHORS b/lib-src/taglib/AUTHORS
new file mode 100644
index 0000000..8872bd8
--- /dev/null
+++ b/lib-src/taglib/AUTHORS
@@ -0,0 +1,11 @@
+Scott Wheeler <wheeler at kde.org>
+ Author, maintainer
+Ismael Orenstein <orenstein at kde.org>
+ Xing header implementation
+Allan Sandfeld Jensen <kde at carewolf.org>
+ FLAC metadata implementation
+Teemu Tervo <teemu.tervo at gmx.net>
+ Numerous bug reports and fixes
+
+Please send all patches and questions to taglib-devel at kde.org rather than to
+individual developers!
diff --git a/lib-src/taglib/CMakeLists.txt b/lib-src/taglib/CMakeLists.txt
new file mode 100644
index 0000000..c966747
--- /dev/null
+++ b/lib-src/taglib/CMakeLists.txt
@@ -0,0 +1,62 @@
+project(taglib)
+
+cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
+
+OPTION(BUILD_TESTS "Build the test suite"  OFF)
+OPTION(BUILD_EXAMPLES "Build the examples"  OFF)
+
+OPTION(NO_ITUNES_HACKS "Disable workarounds for iTunes bugs"  OFF)
+OPTION(WITH_ASF "Enable ASF tag reading/writing code"  OFF)
+OPTION(WITH_MP4 "Enable MP4 tag reading/writing code"  OFF)
+
+#add_definitions(-DHAVE_CONFIG_H)
+
+#add some KDE specific stuff
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
+set(EXEC_INSTALL_PREFIX  ${CMAKE_INSTALL_PREFIX}       CACHE PATH  "Base directory for executables and libraries" FORCE)
+#
+## the following are directories where stuff will be installed to
+set(BIN_INSTALL_DIR          "${EXEC_INSTALL_PREFIX}/bin"                  CACHE PATH "The kde info install dir (default prefix/info)" FORCE)
+set(LIB_INSTALL_DIR          "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"     CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
+set(INCLUDE_INSTALL_DIR      "${CMAKE_INSTALL_PREFIX}/include"             CACHE PATH "The subdirectory to the header prefix" FORCE)
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+   if (CMAKE_SYSTEM_NAME MATCHES Linux)
+     set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-check-new -fno-common")
+   endif (CMAKE_SYSTEM_NAME MATCHES Linux)
+endif (CMAKE_COMPILER_IS_GNUCXX)
+if(MSVC)
+  add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE )
+endif(MSVC)
+if (WIN32)
+  set(CMAKE_DEBUG_POSTFIX "d")
+endif (WIN32)
+
+SET(TAGLIB_LIB_MAJOR_VERSION "1")
+SET(TAGLIB_LIB_MINOR_VERSION "5")
+SET(TAGLIB_LIB_PATCH_VERSION "0")
+
+SET(TAGLIB_LIB_VERSION_STRING "${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}")
+
+
+include(ConfigureChecks.cmake)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config )
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc )
+
+configure_file(config-taglib.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
+
+ADD_SUBDIRECTORY( taglib ) 
+
+ADD_SUBDIRECTORY(tests)
+ADD_SUBDIRECTORY(examples)
+
+ADD_SUBDIRECTORY(bindings)
+if(NOT WIN32)
+  install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
+endif(NOT WIN32)
+
+INSTALL( PROGRAMS  ${CMAKE_CURRENT_BINARY_DIR}/taglib-config DESTINATION ${BIN_INSTALL_DIR})
+
+
diff --git a/lib-src/taglib/COPYING.LGPL b/lib-src/taglib/COPYING.LGPL
new file mode 100644
index 0000000..e38ffa8
--- /dev/null
+++ b/lib-src/taglib/COPYING.LGPL
@@ -0,0 +1,481 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+                    59 Temple Place - Suite 330
+                    Boston, MA 02111-1307, USA.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+          How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/lib-src/taglib/COPYING.MPL b/lib-src/taglib/COPYING.MPL
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/lib-src/taglib/COPYING.MPL
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/lib-src/taglib/ConfigureChecks.cmake b/lib-src/taglib/ConfigureChecks.cmake
new file mode 100644
index 0000000..3bbf248
--- /dev/null
+++ b/lib-src/taglib/ConfigureChecks.cmake
@@ -0,0 +1,28 @@
+# NOTE: only add something here if it is really needed by all of kdelibs.
+#     Otherwise please prefer adding to the relevant config-foo.h.cmake file,
+#     and the CMakeLists.txt that generates it (or a separate ConfigureChecks.make file if you prefer)
+#     to minimize recompilations and increase modularity.
+
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckSymbolExists)
+include(CheckFunctionExists)
+include(CheckLibraryExists)
+include(CheckTypeSize)
+include(CheckCXXSourceCompiles)
+
+#check for libz using the cmake supplied FindZLIB.cmake
+FIND_PACKAGE(ZLIB)
+
+IF(ZLIB_FOUND)
+	SET(HAVE_ZLIB 1)
+ELSE(ZLIB_FOUND)
+	SET(HAVE_ZLIB 0)
+ENDIF(ZLIB_FOUND)
+
+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+FIND_PACKAGE(CppUnit)
+IF (NOT CppUnit_FOUND AND BUILD_TESTS)
+	MESSAGE(STATUS "CppUnit not found, disabling tests.")
+	SET(BUILD_TESTS OFF)
+ENDIF(NOT CppUnit_FOUND AND BUILD_TESTS)
diff --git a/lib-src/sbsms/INSTALL b/lib-src/taglib/INSTALL
similarity index 100%
copy from lib-src/sbsms/INSTALL
copy to lib-src/taglib/INSTALL
diff --git a/lib-src/taglib/Makefile.am b/lib-src/taglib/Makefile.am
new file mode 100644
index 0000000..f454f7e
--- /dev/null
+++ b/lib-src/taglib/Makefile.am
@@ -0,0 +1,54 @@
+SUBDIRS = taglib bindings tests
+
+AUTOMAKE_OPTIONS = foreign
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
+
+bin_SCRIPTS = taglib-config
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = taglib.pc
+
+package-messages:
+	$(MAKE) -f admin/Makefile.common package-messages
+
+dist-hook:
+	cd $(top_distdir) && perl admin/am_edit -padmin
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+examples: examples-all
+
+examples-all:
+	cd examples ; \
+	$(MAKE) all
+
+apidox:
+	$(mkinstalldirs) doc/api; \
+	if test ! -x doc/common; then \
+		$(LN_S) $(kde_libs_htmldir)/en/common doc/common ; \
+	fi; \
+	cp $(top_srcdir)/admin/Doxyfile.global taglib.doxyfile; \
+	echo "PROJECT_NAME        = TagLib" >> taglib.doxyfile; \
+	echo "PROJECT_NUMBER      = \"Version 1.5\"" >> taglib.doxyfile; \
+	echo "INPUT               = $(srcdir)" >> taglib.doxyfile; \
+	echo "OUTPUT_DIRECTORY    = doc/api" >> taglib.doxyfile; \
+	echo "HTML_OUTPUT         = html" >> taglib.doxyfile; \
+	echo "GENERATE_HTML       = YES" >> taglib.doxyfile ; \
+	echo "GENERATE_MAN        = NO" >> taglib.doxyfile ; \
+	echo "GENERATE_LATEX      = NO" >> taglib.doxyfile ; \
+	echo "HTML_HEADER         = doc/common/header.html" >> taglib.doxyfile ; \
+	echo "HTML_FOOTER         = doc/common/footer.html" >> taglib.doxyfile ; \
+	echo "HTML_STYLESHEET     = doc/common/doxygen.css" >> taglib.doxyfile ; \
+	echo "FILE_PATTERNS       = *.h" >> taglib.doxyfile ; \
+	echo "PREDEFINED          = DO_NOT_DOCUMENT DOXYGEN" >> taglib.doxyfile ; \
+	echo "EXTRACT_ALL         = YES" >> taglib.doxyfile ; \
+	doxygen taglib.doxyfile
diff --git a/lib-src/taglib/Makefile.cvs b/lib-src/taglib/Makefile.cvs
new file mode 100644
index 0000000..ac8066e
--- /dev/null
+++ b/lib-src/taglib/Makefile.cvs
@@ -0,0 +1,14 @@
+all:
+	@echo "This Makefile is only for the CVS repository"
+	@echo "This will be deleted before making the distribution"
+	@echo ""
+	@if test ! -d admin; then \
+	   echo "Please recheckout this module!" ;\
+	   echo "for cvs: use checkout once and after that update again" ;\
+	   echo "for cvsup: checkout kde-common from cvsup and" ;\
+	   echo "   link kde-common/admin to ./admin" ;\
+	   exit 1 ;\
+	fi
+	$(MAKE) -f admin/Makefile.common cvs
+
+.SILENT:
diff --git a/lib-src/taglib/Makefile.in b/lib-src/taglib/Makefile.in
new file mode 100644
index 0000000..447ab3d
--- /dev/null
+++ b/lib-src/taglib/Makefile.in
@@ -0,0 +1,868 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(srcdir)/taglib-config.in $(srcdir)/taglib.pc.in \
+	$(top_srcdir)/configure AUTHORS INSTALL admin/compile \
+	admin/config.guess admin/config.sub admin/depcomp \
+	admin/install-sh admin/ltmain.sh admin/missing \
+	admin/mkinstalldirs admin/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = taglib-config taglib.pc
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = taglib bindings tests
+AUTOMAKE_OPTIONS = foreign
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
+bin_SCRIPTS = taglib-config
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = taglib.pc
+#>- all: config.h
+#>+ 1
+all: docs-am  config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+#>- 	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+#>- 		&& exit 0; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  Makefile
+#>+ 14
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ (  \
+	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	 ) || exit 1; echo ' cd $(top_srcdir) && perl admin/am_edit '; cd $(top_srcdir) && perl admin/am_edit && exit 0;  \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  Makefile
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+#>- 	cd $(srcdir) && $(AUTOCONF)
+#>+ 2
+	cd $(srcdir) && rm -f configure
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+taglib-config: $(top_builddir)/config.status $(srcdir)/taglib-config.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+taglib.pc: $(top_builddir)/config.status $(srcdir)/taglib.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	    $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d $(distdir) || mkdir $(distdir)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(SCRIPTS) $(DATA) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool mostlyclean-am
+#>+ 1
+clean-am: clean-bcheck  clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-dvi: install-dvi-recursive
+
+install-exec-am: install-binSCRIPTS
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
+	distcheck distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-binSCRIPTS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkgconfigDATA install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-binSCRIPTS uninstall-pkgconfigDATA
+
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+package-messages:
+	$(MAKE) -f admin/Makefile.common package-messages
+
+dist-hook:
+	cd $(top_distdir) && perl admin/am_edit -padmin
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+examples: examples-all
+
+examples-all:
+	cd examples ; \
+	$(MAKE) all
+
+apidox:
+	$(mkinstalldirs) doc/api; \
+	if test ! -x doc/common; then \
+		$(LN_S) $(kde_libs_htmldir)/en/common doc/common ; \
+	fi; \
+	cp $(top_srcdir)/admin/Doxyfile.global taglib.doxyfile; \
+	echo "PROJECT_NAME        = TagLib" >> taglib.doxyfile; \
+	echo "PROJECT_NUMBER      = \"Version 1.5\"" >> taglib.doxyfile; \
+	echo "INPUT               = $(srcdir)" >> taglib.doxyfile; \
+	echo "OUTPUT_DIRECTORY    = doc/api" >> taglib.doxyfile; \
+	echo "HTML_OUTPUT         = html" >> taglib.doxyfile; \
+	echo "GENERATE_HTML       = YES" >> taglib.doxyfile ; \
+	echo "GENERATE_MAN        = NO" >> taglib.doxyfile ; \
+	echo "GENERATE_LATEX      = NO" >> taglib.doxyfile ; \
+	echo "HTML_HEADER         = doc/common/header.html" >> taglib.doxyfile ; \
+	echo "HTML_FOOTER         = doc/common/footer.html" >> taglib.doxyfile ; \
+	echo "HTML_STYLESHEET     = doc/common/doxygen.css" >> taglib.doxyfile ; \
+	echo "FILE_PATTERNS       = *.h" >> taglib.doxyfile ; \
+	echo "PREDEFINED          = DO_NOT_DOCUMENT DOXYGEN" >> taglib.doxyfile ; \
+	echo "EXTRACT_ALL         = YES" >> taglib.doxyfile ; \
+	doxygen taglib.doxyfile
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=taglib-config.in subdirs COPYING.LGPL Makefile.in configure.in.bot config-taglib.h.cmake configure.files taglib-config.cmake config.h.in taglib.pc.in configure.in Makefile.cvs COPYING.MPL aclocal.m4 ConfigureChecks.cmake taglib.pc.cmake configure.in.in CMakeLists.txt acinclude.m4 Makefile.am 
+
+#>+ 2
+docs-am:
+
+#>+ 7
+force-reedit:
+	 \
+	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in ; do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/acinclude.m4 b/lib-src/taglib/acinclude.m4
new file mode 100644
index 0000000..39765d7
--- /dev/null
+++ b/lib-src/taglib/acinclude.m4
@@ -0,0 +1,11890 @@
+##   -*- autoconf -*-
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum at shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo at kde.org)
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl    Boston, MA 02110-1301, USA.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository. 
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+# KDE_PATH_X_DIRECT
+dnl Internal subroutine of AC_PATH_X.
+dnl Set ac_x_includes and/or ac_x_libraries.
+AC_DEFUN([KDE_PATH_X_DIRECT],
+[
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+AC_TRY_CPP([#include <$x_direct_test_include>],
+[# We can compile using X headers with no special include directory.
+ac_x_includes=],
+[# Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done])
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
+[LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=],
+[LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
+    /usr/X11/lib${kdelibsuff}           \
+    /usr/X11R6/lib${kdelibsuff}         \
+    /usr/X11R5/lib${kdelibsuff}         \
+    /usr/X11R4/lib${kdelibsuff}         \
+                                        \
+    /usr/lib${kdelibsuff}/X11           \
+    /usr/lib${kdelibsuff}/X11R6         \
+    /usr/lib${kdelibsuff}/X11R5         \
+    /usr/lib${kdelibsuff}/X11R4         \
+                                        \
+    /usr/local/X11/lib${kdelibsuff}     \
+    /usr/local/X11R6/lib${kdelibsuff}   \
+    /usr/local/X11R5/lib${kdelibsuff}   \
+    /usr/local/X11R4/lib${kdelibsuff}   \
+                                        \
+    /usr/local/lib${kdelibsuff}/X11     \
+    /usr/local/lib${kdelibsuff}/X11R6   \
+    /usr/local/lib${kdelibsuff}/X11R5   \
+    /usr/local/lib${kdelibsuff}/X11R4   \
+                                        \
+    /usr/X386/lib${kdelibsuff}          \
+    /usr/x386/lib${kdelibsuff}          \
+    /usr/XFree86/lib${kdelibsuff}/X11   \
+                                        \
+    /usr/lib${kdelibsuff}               \
+    /usr/local/lib${kdelibsuff}         \
+    /usr/unsupported/lib${kdelibsuff}   \
+    /usr/athena/lib${kdelibsuff}        \
+    /usr/local/x11r5/lib${kdelibsuff}   \
+    /usr/lpp/Xamples/lib${kdelibsuff}   \
+    /lib/usr/lib${kdelibsuff}/X11       \
+                                        \
+    /usr/openwin/lib${kdelibsuff}       \
+    /usr/openwin/share/lib${kdelibsuff} \
+    ; \
+do
+dnl Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done])
+fi # $ac_x_libraries = NO
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_FIND_FILE],
+[
+$3=NO
+for i in $2;
+do
+  for j in $1;
+  do
+    echo "configure: __oline__: $i/$j" >&AC_FD_CC
+    if test -r "$i/$j"; then
+      echo "taking that" >&AC_FD_CC
+      $3=$i
+      break 2
+    fi
+  done
+done
+])
+
+dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
+dnl	if-not-found, test-parameter, prepend-path)
+dnl
+dnl Look for program-name in list-of-dirs+$PATH.
+dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
+dnl If found, $variable-name is set. If not, if-not-found is evaluated.
+dnl test-parameter: if set, the program is executed with this arg,
+dnl                 and only a successful exit code is required.
+AC_DEFUN([KDE_FIND_PATH],
+[
+   AC_MSG_CHECKING([for $1])
+   if test -n "$$2"; then
+        kde_cv_path="$$2";
+   else
+        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+        AC_CACHE_VAL(kde_cv_path_$kde_cache,
+        [
+        kde_cv_path="NONE"
+	kde_save_IFS=$IFS
+	IFS=':'
+	dirs=""
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+	done
+	if test -z "$6"; then  dnl Append dirs in PATH (default)
+	  dirs="$3 $dirs"
+        else  dnl Prepend dirs in PATH (if 6th arg is set)
+	  dirs="$dirs $3"
+	fi
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/$1"; then
+	    if test -n "$5"
+	    then
+              evalstr="$dir/$1 $5 2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/$1"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/$1"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        ])
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      AC_MSG_RESULT(not found)
+      $4
+   else
+      AC_MSG_RESULT($kde_cv_path)
+      $2=$kde_cv_path
+
+   fi
+])
+
+AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
+[
+    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
+[
+    AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+
+AC_DEFUN([KDE_CHECK_UIC_FLAG],
+[
+    AC_MSG_CHECKING([whether uic supports -$1 ])
+    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
+    [
+        cat >conftest.ui <<EOT
+        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
+EOT
+        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
+        if AC_TRY_EVAL(ac_uic_testrun); then
+            eval "kde_cv_prog_uic_$kde_cache=yes"
+        else
+            eval "kde_cv_prog_uic_$kde_cache=no"
+        fi
+        rm -f conftest*
+    ])
+
+    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
+        AC_MSG_RESULT([yes])
+        :
+        $3
+    else
+        AC_MSG_RESULT([no])
+        :
+        $4
+    fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_MOC_UIC],
+[
+   AC_REQUIRE([KDE_CHECK_PERL])
+   qt_bindirs=""
+   for dir in $kde_qt_dirs; do
+      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir $qt_bindirs"
+   fi
+
+   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+   if test -z "$UIC_NOT_NEEDED"; then
+     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
+     if test -z "$UIC_PATH" ; then
+       KDE_UIC_ERROR_MESSAGE
+       exit 1
+     else
+       UIC=$UIC_PATH
+
+       if test $kde_qtver = 3; then
+         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
+         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
+
+         if test x$ac_uic_supports_libpath = xyes; then
+             UIC="$UIC -L \$(kde_widgetdir)"
+         fi
+         if test x$ac_uic_supports_nounload = xyes; then
+             UIC="$UIC -nounload"
+         fi
+       fi
+     fi
+   else
+     UIC="echo uic not available: "
+   fi
+
+   AC_SUBST(MOC)
+   AC_SUBST(UIC)
+
+   UIC_TR="i18n"
+   if test $kde_qtver = 3; then
+     UIC_TR="tr2i18n"
+   fi
+
+   AC_SUBST(UIC_TR)
+])
+
+AC_DEFUN([KDE_1_CHECK_PATHS],
+[
+  KDE_1_CHECK_PATH_HEADERS
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN([KDE_SET_PATHS],
+[
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_kcfgdir=\"$kde_kcfgdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_styledir=\"$kde_styledir\" \
+	kde_widgetdir=\"$kde_widgetdir\" \
+	xdg_appsdir=\"$xdg_appsdir\" \
+	xdg_menudir=\"$xdg_menudir\" \
+	xdg_directorydir=\"$xdg_directorydir\" \
+	kde_result=$1"
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_PATHS],
+[
+if test "$1" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${datadir}/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${datadir}/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${datadir}/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${datadir}/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${datadir}/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${datadir}/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${datadir}/config'
+  fi
+  if test -z "$kde_kcfgdir"; then
+    kde_kcfgdir='\${datadir}/config.kcfg'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${datadir}/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${datadir}/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${datadir}/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${datadir}/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${datadir}/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${datadir}/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    if test "$kde_qtver" = "2"; then
+      kde_moduledir='\${libdir}/kde2'
+    else
+      kde_moduledir='\${libdir}/kde3'
+    fi
+  fi
+  if test -z "$kde_styledir"; then
+    kde_styledir='\${libdir}/kde3/plugins/styles'
+  fi
+  if test -z "$kde_widgetdir"; then
+    kde_widgetdir='\${libdir}/kde3/plugins/designer'
+  fi
+  if test -z "$xdg_appsdir"; then
+    xdg_appsdir='\${datadir}/applications/kde'
+  fi
+  if test -z "$xdg_menudir"; then
+    xdg_menudir='\${sysconfdir}/xdg/menus'
+  fi
+  if test -z "$xdg_directorydir"; then
+    xdg_directorydir='\${datadir}/desktop-directories'
+  fi
+
+  KDE_SET_PATHS(defaults)
+
+else
+
+  if test $kde_qtver = 1; then
+     AC_MSG_RESULT([compiling])
+     KDE_1_CHECK_PATHS
+  else
+     AC_MSG_ERROR([path checking not yet supported for KDE 2])
+  fi
+
+fi
+])
+
+AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_kcfgdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
+   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
+   test "x$kde_have_all_paths" != "xyes"; then
+     kde_have_all_paths=no
+  fi
+])
+
+AC_DEFUN([KDE_MISSING_PROG_ERROR],
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN([KDE_MISSING_ARTS_ERROR],
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed aRts correctly or use
+--without-arts to compile without aRts support (this will remove functionality).
+])
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
+[
+    kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
+    test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
+    if test -n "$KDEDIRS"; then
+       kde_save_IFS=$IFS
+       IFS=:
+       for dir in $KDEDIRS; do
+            kde_default_bindirs="$dir/bin $kde_default_bindirs "
+       done
+       IFS=$kde_save_IFS
+    fi
+])
+
+AC_DEFUN([KDE_SUBST_PROGRAMS],
+[
+    AC_ARG_WITH(arts,
+        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
+        [build_arts=$withval],
+        [build_arts=yes]
+    )
+    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
+    if test "$build_arts" = "no"; then
+        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
+    fi
+
+        KDE_SET_DEFAULT_BINDIRS
+        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
+        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+        if test "$build_arts" '!=' "no"; then
+          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
+          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
+        fi
+        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
+
+        kde32ornewer=1
+        kde33ornewer=1
+        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
+            kde32ornewer=
+            kde33ornewer=
+        else
+            if test "$kde_qtver" = "3"; then
+              if test "$kde_qtsubver" -le 1; then
+                kde32ornewer=
+              fi
+              if test "$kde_qtsubver" -le 2; then
+                kde33ornewer=
+              fi
+              if test "$KDECONFIG" != "compiled"; then
+                if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
+                  kde33ornewer=
+                fi
+              fi
+            fi
+        fi
+
+        if test -n "$kde32ornewer"; then
+            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
+            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
+        fi
+        if test -n "$kde33ornewer"; then
+            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
+            AC_SUBST(MAKEKDEWIDGETS)
+        fi
+        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
+
+        if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
+ 	    kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
+            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
+            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
+	    if test "$KDE_XSL_STYLESHEET" = "NO"; then
+		KDE_XSL_STYLESHEET=""
+	    else
+                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
+	    fi
+        fi
+
+        DCOP_DEPENDENCIES='$(DCOPIDL)'
+        if test -n "$kde32ornewer"; then
+            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
+            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
+            AC_SUBST(KCONFIG_COMPILER)
+            AC_SUBST(KCFG_DEPENDENCIES)
+            AC_SUBST(DCOPIDLNG)
+        fi
+        AC_SUBST(DCOPIDL)
+        AC_SUBST(DCOPIDL2CPP)
+        AC_SUBST(DCOP_DEPENDENCIES)
+        AC_SUBST(MCOPIDL)
+        AC_SUBST(ARTSCCONFIG)
+	AC_SUBST(MEINPROC)
+ 	AC_SUBST(KDE_XSL_STYLESHEET)
+	AC_SUBST(XMLLINT)
+])dnl
+
+AC_DEFUN([AC_CREATE_KFSSTND],
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+  KDE_SET_DEFAULT_PATHS($1)
+  kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+  # wrong values were cached, may be, we can set better ones
+  kde_result=
+  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
+  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+  kde_have_all_paths=
+  kde_styledir=
+  kde_widgetdir=
+  xdg_appsdir = xdg_menudir= xdg_directorydir= 
+  KDE_SET_DEFAULT_PATHS($1)
+  eval "$kde_cv_all_paths"
+  KDE_CHECK_PATHS_FOR_COMPLETENESS
+  kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+  rm -f conftest*
+  AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN([AC_SUBST_KFSSTND],
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_kcfgdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl X Desktop Group standards
+AC_SUBST(xdg_appsdir)
+AC_SUBST(xdg_menudir)
+AC_SUBST(xdg_directorydir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+AC_SUBST(kdeinitdir, '$(kde_moduledir)')
+AC_SUBST(kde_styledir)
+AC_SUBST(kde_widgetdir)
+if test "$kde_qtver" = 1; then
+  kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+  kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN([KDE_MISC_TESTS],
+[
+   dnl Checks for libraries.
+   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
+   AC_SUBST(LIBUTIL)
+   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
+   AC_SUBST(LIBCOMPAT)
+   kde_have_crypt=
+   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+	kde_have_crypt=no
+      ]))
+   AC_SUBST(LIBCRYPT)
+   if test $kde_have_crypt = yes; then
+      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+   fi
+   AC_CHECK_SOCKLEN_T
+   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+   fi
+   AC_CHECK_FUNC(inet_ntoa)
+   if test $ac_cv_func_inet_ntoa = no; then
+     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+   fi
+   AC_CHECK_FUNC(connect)
+   if test $ac_cv_func_connect = no; then
+      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+        $X_EXTRA_LIBS)
+   fi
+
+   AC_CHECK_FUNC(remove)
+   if test $ac_cv_func_remove = no; then
+      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+   fi
+
+   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+   AC_CHECK_FUNC(shmat, ,
+     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+   
+   # more headers that need to be explicitly included on darwin
+   AC_CHECK_HEADERS(sys/types.h stdint.h)
+
+   # sys/bitypes.h is needed for uint32_t and friends on Tru64
+   AC_CHECK_HEADERS(sys/bitypes.h)
+
+   # darwin requires a poll emulation library
+   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
+
+   # for some image handling on Mac OS X
+   AC_CHECK_HEADERS(Carbon/Carbon.h)
+
+   # CoreAudio framework
+   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
+     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
+     FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
+   ])
+
+   AC_CHECK_RES_INIT
+   AC_SUBST(LIB_POLL)
+   AC_SUBST(FRAMEWORK_COREAUDIO)
+   LIBSOCKET="$X_EXTRA_LIBS"
+   AC_SUBST(LIBSOCKET)
+   AC_SUBST(X_EXTRA_LIBS)
+   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+   AC_SUBST(LIBUCB)
+
+   case $host in  dnl this *is* LynxOS specific
+   *-*-lynxos* )
+        AC_MSG_CHECKING([LynxOS header file wrappers])
+        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+        AC_MSG_RESULT(disabled)
+        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+         ;;
+    esac
+
+   KDE_CHECK_TYPES
+   KDE_CHECK_LIBDL
+   KDE_CHECK_STRLCPY
+   KDE_CHECK_PIE_SUPPORT
+
+# darwin needs this to initialize the environment
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
+ 
+AH_VERBATIM(_DARWIN_ENVIRON,
+[
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+])
+
+AH_VERBATIM(_AIX_STRINGS_H_BZERO,
+[
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+])
+
+AC_CHECK_FUNCS([vsnprintf snprintf])
+
+AH_VERBATIM(_TRU64,[
+/*
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
+ */
+
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
+#if __STDC__
+#include <stdarg.h>
+#include <stdlib.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
+#ifdef __cplusplus
+extern "C"
+#endif
+int snprintf(char *str, size_t n, char const *fmt, ...);
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([K_PATH_X],
+[
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_ARG_ENABLE(
+  embedded,
+  AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
+  kde_use_qt_emb=$enableval,
+  kde_use_qt_emb=no
+)
+
+AC_ARG_ENABLE(
+  qtopia,
+  AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
+  kde_use_qt_emb_palm=$enableval,
+  kde_use_qt_emb_palm=no
+)
+
+AC_ARG_ENABLE(
+  mac,
+  AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
+  kde_use_qt_mac=$enableval,
+  kde_use_qt_mac=no
+)
+
+# used to disable x11-specific stuff on special platforms
+AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
+
+if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
+
+AC_MSG_CHECKING(for X)
+
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+   kde_x_includes=NO
+else
+   kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+   kde_x_libraries=NO
+else
+   kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+KDE_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
+dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
+dnl x_includes should be left alone.
+case "$host" in
+mips-sgi-irix6*)
+  ;;
+*-*-solaris*)
+  ;;
+*)
+  _AC_PATH_X_XMKMF
+  if test -z "$ac_x_includes"; then
+    ac_x_includes="."
+  fi
+  if test -z "$ac_x_libraries"; then
+    ac_x_libraries="/usr/lib${kdelibsuff}"
+  fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+  kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+  kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+  AC_MSG_RESULT($have_x)
+  no_x=yes
+else
+  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+  X_INCLUDES=""
+  x_includes="."; dnl better than nothing :-
+ else
+  x_includes=$kde_x_includes
+  X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
+  X_LDFLAGS=""
+  x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+  x_libraries=$kde_x_libraries
+  X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols.  So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+#  --interran at uluru.Stanford.EDU, kb at cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+LDFLAGS="$ac_save_LDFLAGS"
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+)
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+LIB_XEXT="-lXext"
+QTE_NORTTI=""
+
+elif test "$kde_use_qt_emb" = "yes"; then
+  dnl We're using QT Embedded
+  CPPFLAGS=-DQWS
+  CXXFLAGS="$CXXFLAGS -fno-rtti"
+  QTE_NORTTI="-fno-rtti -DQWS"
+  X_PRE_LIBS=""
+  LIB_X11=""
+  LIB_XEXT=""
+  LIB_XRENDER=""
+  LIBSM=""
+  X_INCLUDES=""
+  X_LDFLAGS=""
+  x_includes=""
+  x_libraries=""
+elif test "$kde_use_qt_mac" = "yes"; then
+  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
+  dnl be included to get the information) --Sam
+  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
+  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
+  X_PRE_LIBS=""
+  LIB_X11=""
+  LIB_XEXT=""
+  LIB_XRENDER=""
+  LIBSM=""
+  X_INCLUDES=""
+  X_LDFLAGS=""
+  x_includes=""
+  x_libraries=""
+fi
+AC_SUBST(X_PRE_LIBS)
+AC_SUBST(LIB_X11)
+AC_SUBST(LIB_XRENDER)
+AC_SUBST(LIBSM)
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_includes)
+AC_SUBST(x_libraries)
+AC_SUBST(QTE_NORTTI)
+AC_SUBST(LIB_XEXT)
+
+])
+
+AC_DEFUN([KDE_PRINT_QT_PROGRAM],
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#if QT_VERSION < 210
+#error 1
+#endif
+EOF
+fi
+fi
+
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+    Q_UNUSED(t);
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+EOF
+fi
+fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+    (void)QStyleFactory::create(QString::null);
+    QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+])
+
+AC_DEFUN([KDE_USE_QT],
+[
+if test -z "$1"; then
+  # Current default Qt version: 3.3
+  kde_qtver=3
+  kde_qtsubver=3
+else
+  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
+  # following is the check if subversion isnt found in passed argument
+  if test "$kde_qtsubver" = "$1"; then
+    kde_qtsubver=1
+  fi
+  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
+  if test "$kde_qtver" = "1"; then
+    kde_qtsubver=42
+  fi
+fi
+
+if test -z "$2"; then
+  if test "$kde_qtver" = "2"; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_minversion=">= Qt 2.2.2"
+    else
+      kde_qt_minversion=">= Qt 2.0.2"
+    fi
+  fi
+  if test "$kde_qtver" = "3"; then
+    if test $kde_qtsubver -gt 0; then
+	 if test $kde_qtsubver -gt 1; then
+	    if test $kde_qtsubver -gt 2; then
+		kde_qt_minversion=">= Qt 3.3 and < 4.0"
+	    else
+	        kde_qt_minversion=">= Qt 3.2 and < 4.0"
+	    fi
+	 else
+            kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
+         fi
+    else
+      kde_qt_minversion=">= Qt 3.0 and < 4.0"
+    fi
+  fi
+  if test "$kde_qtver" = "1"; then
+    kde_qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   kde_qt_minversion="$2"
+fi
+
+if test -z "$3"; then
+   if test $kde_qtver = 3; then
+     if test $kde_qtsubver -gt 0; then
+       kde_qt_verstring="QT_VERSION >= 0x03 at VER@00 && QT_VERSION < 0x040000"
+       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
+       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s, at VER@,$qtsubver,"`
+     else
+       kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
+     fi
+   fi
+   if test $kde_qtver = 2; then
+     if test $kde_qtsubver -gt 0; then
+       kde_qt_verstring="QT_VERSION >= 222"
+     else
+       kde_qt_verstring="QT_VERSION >= 200"
+     fi
+   fi
+   if test $kde_qtver = 1; then
+    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+   fi
+else
+   kde_qt_verstring="$3"
+fi
+
+if test $kde_qtver = 4; then
+  kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
+fi
+if test $kde_qtver = 3; then
+  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3 /usr/lib${kdelibsuff}/qt-3.3"
+  if test -z "$PKG_CONFIG"; then
+      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+  if test "$PKG_CONFIG" != "no" ; then
+    if $PKG_CONFIG --exists qt-mt ; then
+       kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix qt-mt`"
+    fi
+  fi
+fi
+if test $kde_qtver = 2; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+fi
+if test $kde_qtver = 1; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN([KDE_CHECK_QT_DIRECT],
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+else
+LIBS="$LIBQT $LIBSOCKET"
+fi
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  kde_cv_qt_direct="yes"
+else
+  kde_cv_qt_direct="no"
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+  AC_MSG_RESULT(yes)
+  $1
+else
+  AC_MSG_RESULT(no)
+  $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_1_3],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  mt,
+  AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
+  kde_use_qt_mt=$enableval,
+  [
+    if test $kde_qtver = 3; then
+      kde_use_qt_mt=yes
+    else
+      kde_use_qt_mt=no
+    fi
+  ]
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
+if test "x$kde_use_qt_mt" = "xyes"; then
+  KDE_CHECK_THREADING
+  if test "x$kde_use_threading" = "xyes"; then
+    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
+    KDE_MT_LDFLAGS="$USE_THREADS"
+    KDE_MT_LIBS="$LIBPTHREAD"
+  else
+    kde_use_qt_mt=no
+  fi
+fi
+AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+if test -z "$LIBQT_GLOB"; then
+  if test "x$kde_use_qt_emb" = "xyes"; then
+    LIBQT_GLOB="libqte.*"
+  else
+    LIBQT_GLOB="libqt.*"
+  fi
+fi
+
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+if test "x$kde_use_qt_emb" = "xyes"; then
+  qtlib="qte"
+else
+  qtlib="qt"
+fi
+
+kde_int_qt="-l$qtlib"
+
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+  if test "x$kde_use_qt_emb" = "xyes"; then
+    if test "x$kde_use_qt_emb_palm" = "xyes"; then
+      LIB_QPE="-lqpe"
+    else
+      LIB_QPE=""
+    fi
+  else
+    LIB_QPE=""
+  fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+  LIBQT="-l$qtlib-mt"
+  kde_int_qt="-l$qtlib-mt"
+  LIBQT_GLOB="lib$qtlib-mt.*"
+  USING_QT_MT="using -mt"
+else
+  LIBQT="-l$qtlib"
+fi
+
+if test $kde_qtver != 1; then
+
+  AC_REQUIRE([AC_FIND_PNG])
+  AC_REQUIRE([AC_FIND_JPEG])
+  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+if test $kde_qtver = 3; then
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+  LIBQT="$LIBQT $LIBDL"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+fi
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+    AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
+    [  ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib${kdelibsuff}
+       ac_qt_bindir="$withval"/bin
+    ])
+
+AC_ARG_WITH(qt-includes,
+    AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
+    [
+       ac_qt_includes="$withval"
+    ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+    AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
+    [  ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+fi
+if test "$PKG_CONFIG" != "no" ; then
+  if $PKG_CONFIG --exists qt-mt ; then
+      qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir qt-mt`"
+  fi
+fi
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" != "1"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir/lib $dir"
+done
+if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+fi
+if test "$PKG_CONFIG" != "no" ; then
+  if $PKG_CONFIG --exists qt-mt ; then
+      qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir qt-mt`"
+  fi
+fi
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+fi
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+    LIBQT="$LIBQT ${kde_int_qt}_incremental"
+    break
+  fi
+done
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  missing_qt_mt=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    if test "x$kde_use_qt_mt" = "xyes"; then
+       missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+       ac_qt_notfound="(library $qtlib-mt)";
+    else
+       ac_qt_notfound="(library $qtlib)";
+    fi
+  fi
+
+  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.$missing_qt_mt])
+else
+  have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  AC_MSG_RESULT([$have_qt]);
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
+     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES=""
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$QT_LDFLAGS $all_libraries"
+fi
+test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+KDE_CHECK_QT_JPEG
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
+else
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
+fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
+     break
+  fi
+done
+
+AC_SUBST(LIB_QT)
+AC_SUBST(LIB_QPE)
+
+AC_SUBST(kde_qtver)
+])
+
+AC_DEFUN([AC_PATH_QT],
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
+[
+AC_REQUIRE([AC_PATH_QT_MOC_UIC])
+
+if test x$ac_uic_supports_libpath = xyes; then
+
+AC_MSG_CHECKING([if UIC has KDE plugins available])
+AC_CACHE_VAL(kde_cv_uic_plugins,
+[
+cat > actest.ui << EOF
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewConnectionDialog</class>
+<widget class="QDialog">
+   <widget class="KLineEdit">
+        <property name="name">
+           <cstring>testInput</cstring>
+        </property>
+   </widget>
+</widget>
+</UI>
+EOF
+       
+
+
+kde_cv_uic_plugins=no
+kde_line="$UIC_PATH -L $kde_widgetdir"
+if test x$ac_uic_supports_nounload = xyes; then
+   kde_line="$kde_line -nounload"
+fi
+kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
+if AC_TRY_EVAL(kde_line); then
+	# if you're trying to debug this check and think it's incorrect,
+	# better check your installation. The check _is_ correct - your
+	# installation is not.
+	if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
+		kde_cv_uic_plugins=yes
+	fi
+fi
+rm -f actest.ui actest.cpp
+])
+
+AC_MSG_RESULT([$kde_cv_uic_plugins])
+if test "$kde_cv_uic_plugins" != yes; then
+	AC_MSG_ERROR([
+you need to install kdelibs first.
+
+If you did install kdelibs, then the Qt version that is picked up by
+this configure is not the same version you used to compile kdelibs. 
+The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the 
+_same Qt version_, compiled with the _same compiler_ and the same Qt
+configuration settings.
+])
+fi
+fi
+])
+
+AC_DEFUN([KDE_CHECK_FINAL],
+[
+  AC_ARG_ENABLE(final,
+	AC_HELP_STRING([--enable-final],
+		       [build size optimized apps (experimental - needs lots of memory)]),
+	kde_use_final=$enableval, kde_use_final=no)
+
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_FINAL_TRUE)
+  AC_SUBST(KDE_USE_FINAL_FALSE)
+])
+
+AC_DEFUN([KDE_CHECK_CLOSURE],
+[
+  AC_ARG_ENABLE(closure,
+		AC_HELP_STRING([--enable-closure],[delay template instantiation]),
+  	kde_use_closure=$enableval, kde_use_closure=no)
+
+  KDE_NO_UNDEFINED=""
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+       KDE_NO_UNDEFINED=""
+       case $host in 
+         *-*-linux-gnu)
+           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
+                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
+		[KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
+		[KDE_NO_UNDEFINED=""])],
+	    [KDE_NO_UNDEFINED=""])
+           ;;
+       esac
+  fi
+  AC_SUBST(KDE_USE_CLOSURE_TRUE)
+  AC_SUBST(KDE_USE_CLOSURE_FALSE)
+  AC_SUBST(KDE_NO_UNDEFINED)
+])
+
+dnl Check if the linker supports --enable-new-dtags and --as-needed
+AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
+[
+  AC_ARG_ENABLE(new_ldflags,
+		AC_HELP_STRING([--enable-new-ldflags],
+		[enable the new linker flags]),
+	kde_use_new_ldflags=$enableval, 
+	kde_use_new_ldflags=no)
+
+  LDFLAGS_AS_NEEDED=""
+  LDFLAGS_NEW_DTAGS=""
+  if test "x$kde_use_new_ldflags" = "xyes"; then
+       LDFLAGS_NEW_DTAGS=""
+       KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
+		[LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
+
+       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
+		[LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
+  fi
+  AC_SUBST(LDFLAGS_AS_NEEDED)
+  AC_SUBST(LDFLAGS_NEW_DTAGS)
+])
+
+AC_DEFUN([KDE_CHECK_NMCHECK],
+[
+  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
+	kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
+
+  if test "$kde_use_nmcheck" = "yes"; then
+      KDE_USE_NMCHECK_TRUE=""
+      KDE_USE_NMCHECK_FALSE="#"
+   else
+      KDE_USE_NMCHECK_TRUE="#"
+      KDE_USE_NMCHECK_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_NMCHECK_TRUE)
+  AC_SUBST(KDE_USE_NMCHECK_FALSE)
+])
+
+AC_DEFUN([KDE_EXPAND_MAKEVAR], [
+savex=$exec_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+tmp=$$2
+while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
+exec_prefix=$savex
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_BASE_PATH_KDE],
+[
+AC_REQUIRE([KDE_CHECK_STL])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+  kde_includes=${includedir}
+  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
+
+  kde_libraries=${libdir}
+  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
+
+else
+  ac_kde_includes=
+  ac_kde_libraries=
+  kde_libraries=""
+  kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+  kde_check_header="ksock.h"
+  kde_check_lib="libkdecore.la"
+else
+  kde_check_header="ksharedptr.h"
+  kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+  AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+kde_widgetdir=NO
+dnl this might be somewhere else
+AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
+AC_MSG_ERROR([
+I can't find the designer plugins. These are required and should have been installed
+by kdelibs])
+fi
+
+if test -n "$kde_widgetdir"; then
+    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
+fi
+
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
+  ac_cv_have_kde="have_kde=no"
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1, e.g. from kdelibs
+
+  ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+  ac_kde_prefix="$ac_default_prefix"
+ else
+  ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+  ac_kde_exec_prefix="$ac_kde_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+  ac_kde_exec_prefix="$exec_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${libdir}"
+ kde_includes="${includedir}"
+
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+  kde_libraries="$ac_kde_libraries"
+  kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+
+KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
+ 
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
+ all_libraries="$KDE_LDFLAGS $all_libraries"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+if test -z "$1"; then
+KDE_CHECK_UIC_PLUGINS
+fi
+
+ac_kde_libraries="$kde_libdir"
+
+AC_SUBST(AUTODIRS)
+
+
+])
+
+AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
+  kde_use_extra_includes="$withval",
+  kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+   test "$kde_use_extra_includes" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_includes; do
+     kde_extra_includes="$kde_extra_includes $dir"
+     USER_INCLUDES="$USER_INCLUDES -I$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_includes="added"
+else
+   kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
+  kde_use_extra_libs=$withval,
+  kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+   test "$kde_use_extra_libs" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_libs; do
+     kde_extra_libs="$kde_extra_libs $dir"
+     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_libs="added"
+else
+   kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
+[
+    AC_MSG_CHECKING([for KDE headers installed])
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    printf("kde_styledir=\\"/tmp/dummy\\"\n");
+    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
+    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
+    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
+    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
+    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$all_includes $CPPFLAGS"
+ if AC_TRY_EVAL(ac_compile); then
+   AC_MSG_RESULT(yes)
+ else
+   AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+  fi
+  CPPFLAGS=$ac_save_CPPFLAGS
+
+  AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_CHECK_KDEQTADDON],
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+   #include <qdom.h>
+ ],
+ [
+   QDomDocument doc;
+ ],
+  kde_cv_have_kdeqtaddon=yes,
+  kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ CXXFLAGS=$kde_cxxflags_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
+[
+   AC_REQUIRE([KDE_MISC_TESTS])
+   AC_REQUIRE([KDE_CHECK_LIBDL])
+   AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 3; then
+   case $host in 
+               *cygwin*) lib_kded="-lkdeinit_kded" ;;
+               *) lib_kded="" ;;
+       esac
+   AC_SUBST(LIB_KDED, $lib_kded)
+   AC_SUBST(LIB_KDECORE, "-lkdecore")
+   AC_SUBST(LIB_KDEUI, "-lkdeui")
+   AC_SUBST(LIB_KIO, "-lkio")
+   AC_SUBST(LIB_KJS, "-lkjs")
+   AC_SUBST(LIB_SMB, "-lsmb")
+   AC_SUBST(LIB_KAB, "-lkab")
+   AC_SUBST(LIB_KABC, "-lkabc")
+   AC_SUBST(LIB_KHTML, "-lkhtml")
+   AC_SUBST(LIB_KSPELL, "-lkspell")
+   AC_SUBST(LIB_KPARTS, "-lkparts")
+   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+   AC_SUBST(LIB_KUTILS, "-lkutils")
+   AC_SUBST(LIB_KDEPIM, "-lkdepim")
+   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
+   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
+   AC_SUBST(LIB_KDNSSD, "-lkdnssd")
+   AC_SUBST(LIB_KUNITTEST, "-lkunittest")
+# these are for backward compatibility
+   AC_SUBST(LIB_KSYCOCA, "-lkio")
+   AC_SUBST(LIB_KFILE, "-lkio")
+elif test $kde_qtver = 2; then
+   AC_SUBST(LIB_KDECORE, "-lkdecore")
+   AC_SUBST(LIB_KDEUI, "-lkdeui")
+   AC_SUBST(LIB_KIO, "-lkio")
+   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
+   AC_SUBST(LIB_SMB, "-lsmb")
+   AC_SUBST(LIB_KFILE, "-lkfile")
+   AC_SUBST(LIB_KAB, "-lkab")
+   AC_SUBST(LIB_KHTML, "-lkhtml")
+   AC_SUBST(LIB_KSPELL, "-lkspell")
+   AC_SUBST(LIB_KPARTS, "-lkparts")
+   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+else
+   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
+   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
+   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
+   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
+   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
+fi
+])
+
+AC_DEFUN([AC_PATH_KDE],
+[
+  AC_BASE_PATH_KDE
+  AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
+  [
+  if test "$enableval" = "no";
+    then ac_use_path_checking="default"
+    else ac_use_path_checking=""
+  fi
+  ],
+  [
+  if test "$kde_qtver" = 1;
+    then ac_use_path_checking=""
+    else ac_use_path_checking="default"
+  fi
+  ]
+  )
+
+  AC_CREATE_KFSSTND($ac_use_path_checking)
+
+  AC_SUBST_KFSSTND
+  KDE_CREATE_LIBS_ALIASES
+])
+
+dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
+AC_DEFUN([KDE_CHECK_FUNC_EXT],
+[
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(kde_cv_func_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+$2
+],
+[
+$3
+],
+kde_cv_func_$1=yes,
+kde_cv_func_$1=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS="$kde_safe_LIBS"
+AC_LANG_RESTORE
+])
+
+AC_MSG_RESULT($kde_cv_func_$1)
+
+AC_MSG_CHECKING([if $1 needs custom prototype])
+AC_CACHE_VAL(kde_cv_proto_$1,
+[
+if test "x$kde_cv_func_$1" = xyes; then
+  kde_cv_proto_$1=no
+else
+  case "$1" in
+	setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
+		kde_cv_proto_$1="yes - in libkdefakes"
+		;;
+	*)
+		kde_cv_proto_$1=unknown
+		;;
+  esac
+fi
+
+if test "x$kde_cv_proto_$1" = xunknown; then
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+  kde_safe_libs=$LIBS
+  LIBS="$LIBS $X_EXTRA_LIBS"
+  AC_TRY_LINK([
+$2
+
+extern "C" $4;
+],
+[
+$3
+],
+[ kde_cv_func_$1=yes
+  kde_cv_proto_$1=yes ],
+  [kde_cv_proto_$1="$1 unavailable"]
+)
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+fi
+])
+AC_MSG_RESULT($kde_cv_proto_$1)
+
+if test "x$kde_cv_func_$1" = xyes; then
+  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
+  $6
+fi
+if test "x$kde_cv_proto_$1" = xno; then
+  AC_DEFINE(HAVE_$5_PROTO, 1,
+  [Define if you have the $1 prototype])
+fi
+
+AH_VERBATIM([_HAVE_$5_PROTO],
+[
+#if !defined(HAVE_$5_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+$4;
+#ifdef __cplusplus
+}
+#endif
+#endif
+])
+])
+
+AC_DEFUN([AC_CHECK_SETENV],
+[
+	KDE_CHECK_FUNC_EXT(setenv, [
+#include <stdlib.h>
+], 
+		[setenv("VAR", "VALUE", 1);],
+	        [int setenv (const char *, const char *, int)],
+		[SETENV])
+])
+
+AC_DEFUN([AC_CHECK_UNSETENV],
+[
+	KDE_CHECK_FUNC_EXT(unsetenv, [
+#include <stdlib.h>
+], 
+		[unsetenv("VAR");],
+	        [void unsetenv (const char *)],
+		[UNSETENV])
+])
+
+AC_DEFUN([AC_CHECK_GETDOMAINNAME],
+[
+	KDE_CHECK_FUNC_EXT(getdomainname, [
+#include <stdlib.h>
+#include <unistd.h>
+#include <netdb.h>
+], 
+		[
+char buffer[200];
+getdomainname(buffer, 200);
+], 	
+	        [#include <sys/types.h>
+		int getdomainname (char *, size_t)],
+		[GETDOMAINNAME])
+])
+
+AC_DEFUN([AC_CHECK_GETHOSTNAME],
+[
+	KDE_CHECK_FUNC_EXT(gethostname, [
+#include <stdlib.h>
+#include <unistd.h>
+], 
+		[
+char buffer[200];
+gethostname(buffer, 200);
+], 	
+	        [int gethostname (char *, unsigned int)],
+		[GETHOSTNAME])
+])
+
+AC_DEFUN([AC_CHECK_USLEEP],
+[
+	KDE_CHECK_FUNC_EXT(usleep, [
+#include <unistd.h>
+], 
+		[
+usleep(200);
+], 	
+	        [int usleep (unsigned int)],
+		[USLEEP])
+])
+
+
+AC_DEFUN([AC_CHECK_RANDOM],
+[
+	KDE_CHECK_FUNC_EXT(random, [
+#include <stdlib.h>
+], 
+		[
+random();
+], 	
+	        [long int random(void)],
+		[RANDOM])
+
+	KDE_CHECK_FUNC_EXT(srandom, [
+#include <stdlib.h>
+], 
+		[
+srandom(27);
+], 	
+	        [void srandom(unsigned int)],
+		[SRANDOM])
+
+])
+
+AC_DEFUN([AC_CHECK_INITGROUPS],
+[
+	KDE_CHECK_FUNC_EXT(initgroups, [
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
+],
+	[
+char buffer[200];
+initgroups(buffer, 27);
+],
+	[int initgroups(const char *, gid_t)],
+	[INITGROUPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMPS],
+[
+	KDE_CHECK_FUNC_EXT(mkstemps, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkstemps("/tmp/aaaXXXXXX", 6);
+],
+	[int mkstemps(char *, int)],
+	[MKSTEMPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMP],
+[
+	KDE_CHECK_FUNC_EXT(mkstemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkstemp("/tmp/aaaXXXXXX");
+],
+	[int mkstemp(char *)],
+	[MKSTEMP])
+])
+
+AC_DEFUN([AC_CHECK_MKDTEMP],
+[
+	KDE_CHECK_FUNC_EXT(mkdtemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkdtemp("/tmp/aaaXXXXXX");
+],
+	[char *mkdtemp(char *)],
+	[MKDTEMP])
+])
+
+
+AC_DEFUN([AC_CHECK_RES_INIT],
+[
+  AC_MSG_CHECKING([if res_init needs -lresolv])
+  kde_libs_safe="$LIBS"
+  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
+  AC_TRY_LINK(
+    [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+    ],
+    [
+      res_init(); 
+    ],
+    [
+      LIBRESOLV="-lresolv"
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
+    ],
+    [ AC_MSG_RESULT(no) ]
+  )
+  LIBS=$kde_libs_safe
+  AC_SUBST(LIBRESOLV)
+
+  KDE_CHECK_FUNC_EXT(res_init,
+    [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+    ],
+    [res_init()],
+    [int res_init(void)],
+    [RES_INIT])
+])
+
+AC_DEFUN([AC_CHECK_STRLCPY],
+[
+	KDE_CHECK_FUNC_EXT(strlcpy, [
+#include <string.h>
+],
+[ char buf[20];
+  strlcpy(buf, "KDE function test", sizeof(buf));
+],
+ 	[unsigned long strlcpy(char*, const char*, unsigned long)],
+	[STRLCPY])
+])
+
+AC_DEFUN([AC_CHECK_STRLCAT],
+[
+	KDE_CHECK_FUNC_EXT(strlcat, [
+#include <string.h>
+],
+[ char buf[20];
+  buf[0]='\0';
+  strlcat(buf, "KDE function test", sizeof(buf));
+],
+ 	[unsigned long strlcat(char*, const char*, unsigned long)],
+	[STRLCAT])
+])
+
+AC_DEFUN([AC_CHECK_RES_QUERY],
+[
+	KDE_CHECK_FUNC_EXT(res_query, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include <netdb.h>
+],
+[
+res_query(NULL, 0, 0, NULL, 0);
+],
+	[int res_query(const char *, int, int, unsigned char *, int)],
+	[RES_QUERY])
+])
+
+AC_DEFUN([AC_CHECK_DN_SKIPNAME],
+[
+	KDE_CHECK_FUNC_EXT(dn_skipname, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+],
+[
+dn_skipname (NULL, NULL);
+],
+	[int dn_skipname (unsigned char *, unsigned char *)],
+	[DN_SKIPNAME])
+])
+
+
+AC_DEFUN([AC_FIND_GIF],
+   [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+else
+LIBS="$all_libraries -lgif"
+fi
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [return GifLastError();],
+            eval "ac_cv_lib_gif=yes",
+            eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN([KDE_FIND_JPEG_HELPER],
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+void jpeg_CreateDecompress();
+#ifdef __cplusplus
+}
+#endif
+],
+[jpeg_CreateDecompress();],
+            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+            eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_$1"
+  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+  AC_MSG_RESULT(no)
+  $3
+fi
+
+])
+
+AC_DEFUN([AC_FIND_JPEG],
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+   KDE_FIND_JPEG_HELPER(normal, [],
+    [
+       LIBJPEG=
+    ]
+   )
+)
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+    AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+  else
+    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+  fi
+  jpeg_incdir=
+  LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+AH_VERBATIM(_AC_CHECK_JPEG,
+[/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+])
+])
+
+AC_DEFUN([KDE_CHECK_QT_JPEG],
+[
+if test -n "$LIBJPEG"; then
+AC_MSG_CHECKING([if Qt needs $LIBJPEG])
+AC_CACHE_VAL(kde_cv_qt_jpeg,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
+LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[#include <qapplication.h>],
+            [
+            int argc;
+            char** argv;
+            QApplication app(argc, argv);],
+            eval "kde_cv_qt_jpeg=no",
+            eval "kde_cv_qt_jpeg=yes")
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+fi
+])
+
+if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
+  AC_MSG_RESULT(yes)
+  LIBJPEG_QT='$(LIBJPEG)'
+else
+  AC_MSG_RESULT(no)
+  LIBJPEG_QT=
+fi
+
+])
+
+AC_DEFUN([AC_FIND_ZLIB],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+#include<string.h>
+],
+[
+  char buf[42];
+  gzFile f = (gzFile) 0;
+  /* this would segfault.. but we only link, don't run */
+  (void) gzgets(f, buf, sizeof(buf));
+
+  return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
+],
+            eval "ac_cv_lib_z='-lz'",
+            eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+  LIBZ="$ac_cv_lib_z"
+  AC_MSG_RESULT($ac_cv_lib_z)
+else
+  AC_MSG_ERROR(not found. 
+          Possibly configure picks up an outdated version
+          installed by XFree86. Remove it from your system.
+
+          Check your installation and look into config.log)
+  LIBZ=""
+fi
+AC_SUBST(LIBZ)
+])
+
+AC_DEFUN([KDE_TRY_TIFFLIB],
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+else
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
+fi
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+    [return (TIFFOpen( "", "r") == 0); ],
+[
+    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+    kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+    AC_MSG_RESULT(no)
+    LIBTIFF=""
+    $3
+else
+    LIBTIFF="$kde_cv_libtiff_$1"
+    AC_MSG_RESULT(yes)
+    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+    $2
+fi
+
+])
+
+AC_DEFUN([AC_FIND_TIFF],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+   KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+AC_DEFUN([KDE_FIND_LIBEXR],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_CACHE_VAL(ac_cv_libexr,
+[
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  AC_MSG_CHECKING([for OpenEXR libraries])
+
+  if test "$PKG_CONFIG" = "no" ; then
+     AC_MSG_RESULT(no)
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     if ! $PKG_CONFIG --exists OpenEXR ; then
+        AC_MSG_RESULT(no)
+        EXRSTATUS=no
+     else
+        if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
+           AC_MSG_RESULT(no)
+           EXRSTATUS=old
+        else
+           kde_save_LIBS="$LIBS"
+           LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
+           AC_LANG_SAVE
+           AC_LANG_CPLUSPLUS
+           kde_save_CXXFLAGS="$CXXFLAGS"
+           EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
+           CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
+
+           AC_TRY_LINK(dnl
+               [
+               #include <ImfRgbaFile.h>
+               ],
+               [
+               using namespace Imf;
+               RgbaInputFile file ("dummy");
+               return 0;
+               ],
+               eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
+               eval "ac_cv_libexr=no"
+           )
+           LIBS="$kde_save_LIBS"
+           CXXFLAGS="$kde_save_CXXFLAGS"
+           AC_LANG_RESTORE
+           ])dnl
+           if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
+               AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
+               LIB_EXR="$ac_cv_libexr"
+               AC_MSG_RESULT($ac_cv_libexr)
+           else
+               AC_MSG_RESULT(no)
+               LIB_EXR=""
+           fi
+        fi
+     fi
+  fi
+  AC_SUBST(LIB_EXR)
+  AC_SUBST(EXR_FLAGS)
+])
+
+
+
+AC_DEFUN([AC_FIND_PNG],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+else
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
+fi
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+    [
+    #include<png.h>
+    ],
+    [
+    png_structp png_ptr = png_create_read_struct(  /* image ptr */
+		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+    return( png_ptr != 0 );
+    ],
+    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+    eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+  LIBPNG="$ac_cv_lib_png"
+  AC_SUBST(LIBPNG)
+  AC_MSG_RESULT($ac_cv_lib_png)
+else
+  AC_MSG_RESULT(no)
+  LIBPNG=""
+  AC_SUBST(LIBPNG)
+fi
+])
+
+
+AC_DEFUN([AC_FIND_JASPER],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_MSG_CHECKING([for jasper])
+AC_CACHE_VAL(ac_cv_jasper,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+    [
+    #include<jasper/jasper.h>
+    ],
+    [
+    return( jas_init() );
+    ],
+    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
+    eval "ac_cv_jasper=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
+  LIB_JASPER="$ac_cv_jasper"
+  AC_MSG_RESULT($ac_cv_jasper)
+else
+  AC_MSG_RESULT(no)
+  LIB_JASPER=""
+fi
+AC_SUBST(LIB_JASPER)
+])
+
+AC_DEFUN([AC_CHECK_BOOL],
+[
+  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_gnu_extensions=yes
+else
+  ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CXX supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -$1"
+  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+  CXXFLAGS="$save_CXXFLAGS"
+  AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CC supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
+[
+  AC_LANG_SAVE
+  AC_LANG_C
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -$1"
+  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
+  CFLAGS="$save_CFLAGS"
+  AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN([AC_REMOVE_FORBIDDEN],
+[ __val=$$1
+  __forbid=" $2 "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    $1=$__new
+  fi
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
+[
+  AC_MSG_CHECKING([whether $CC is blacklisted])
+
+  dnl In theory we have tu run this test against $CC and $CXX
+  dnl in C and in C++ mode, because its perfectly legal for
+  dnl the user to mix compiler versions, since C has a defined
+  dnl ABI. 
+  dnl 
+  dnl For now, we assume the user is not on crack.
+
+  AC_TRY_COMPILE([
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
+choke me
+#endif
+#endif
+], ,
+  kde_bad_compiler=no, 
+  kde_bad_compiler=yes
+)
+
+  AC_MSG_RESULT($kde_bad_compiler)
+
+if test "$kde_bad_compiler" = "yes"; then
+  AC_MSG_ERROR([
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version. 
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
+[
+  AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
+    kde_cv_opt_noinline_match,
+  [
+  kde_cv_opt_noinline_match=irrelevant
+  dnl if we don't use both -O2 and -fno-inline, this check is moot
+  if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
+     && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
+
+    ac_cflags_save="$CFLAGS"
+    CFLAGS="$CFLAGS -D_USE_GNU"
+
+    AC_TRY_LINK([
+  #include <string.h>
+], [  const char *pt, *et;
+  et = __extension__      ({ char __a0, __a1, __a2;       (__builtin_constant_p (  ";,"  ) && ((size_t)(const void *)((   ";,"   )+ 1) - (size_t)(const void *)(   ";,"   ) == 1)        ? ((__a0 =((__const char  *) (  ";,"  ))[0], __a0 == '\0')     ? ((void) (  pt ),((void *)0) )        : ((__a1 = ((__const char *) (  ";,"  ))[1], __a1== '\0')      ? (__extension__ (__builtin_constant_p (  __a0 ) && ( __a0 ) == '\0'   ? (char *) __rawmemchr (   pt  ,   __a0)       : strchr(   pt  ,   __a0 )))   : ((__a2 = ((__const char *) (  ";,"  ))[2], __a2 == '\0')      ? __strpbrk_c2 (  pt , __a0, __a1)      :(((__const char *) (  ";,"  ))[3] == '\0'     ? __strpbrk_c3 (  pt ,__a0, __a1, __a2): strpbrk (  pt ,   ";,"  ))))) : strpbrk (  pt ,  ";,"  )); }) ;
+],
+    kde_cv_opt_noinline_match=yes,
+    kde_cv_opt_noinline_match=no
+    )
+
+    CFLAGS="$ac_cflags_save"
+  fi
+  ])
+])
+
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
+[dnl
+if test "x$kde_use_qt_emb" != "xyes"; then
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ AC_REMOVE_FORBIDDEN(CXX, [-rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
+])
+
+AC_DEFUN([AC_CHECK_COMPILERS],
+[
+  AC_ARG_ENABLE(debug,
+	        AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
+  [
+    case $enableval in
+      yes)
+        kde_use_debug_code="yes"
+        kde_use_debug_define=no
+        ;;
+      full)
+        kde_use_debug_code="full"
+        kde_use_debug_define=no
+        ;;
+      *)
+        kde_use_debug_code="no"
+        kde_use_debug_define=yes
+        ;;
+    esac
+  ], 
+    [kde_use_debug_code="no"
+      kde_use_debug_define=no
+  ])
+
+  dnl Just for configure --help
+  AC_ARG_ENABLE(dummyoption,
+	        AC_HELP_STRING([--disable-debug],
+	  		       [disables debug output and debug symbols [default=no]]),
+		[],[])
+
+  AC_ARG_ENABLE(strict,
+		AC_HELP_STRING([--enable-strict],
+			      [compiles with strict compiler options (may not work!)]),
+   [
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+   ], [kde_use_strict_options="no"])
+
+  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
+   [
+    if test $enableval = "no"; then
+         kde_use_warnings="no"
+       else
+         kde_use_warnings="yes"
+    fi
+   ], [kde_use_warnings="yes"])
+
+  dnl enable warnings for debug build
+  if test "$kde_use_debug_code" != "no"; then
+    kde_use_warnings=yes
+  fi
+
+  AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
+    [kde_use_profiling=$enableval],
+    [kde_use_profiling="no"]
+  )
+
+  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
+  CFLAGS=" $CFLAGS"
+
+  AC_PROG_CC 
+
+  AC_PROG_CPP
+
+  if test "$GCC" = "yes"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test $kde_use_debug_code = "full"; then
+        CFLAGS="-g3 -fno-inline $CFLAGS"
+      else
+        CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
+      fi
+    else
+      CFLAGS="-O2 $CFLAGS"
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CFLAGS="-DNDEBUG $CFLAGS"
+  fi
+
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
+  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
+  esac
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+  CXXFLAGS=" $CXXFLAGS"
+
+  AC_PROG_CXX
+
+  KDE_CHECK_FOR_BAD_COMPILER
+
+  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
+      else
+        if test "$kde_use_debug_code" = "full"; then
+          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
+        else
+          CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
+        fi
+      fi
+      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
+
+      dnl convenience compiler flags
+      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
+      AC_SUBST(WOVERLOADED_VIRTUAL)
+    else
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K3 $CXXFLAGS"
+      else
+        CXXFLAGS="-O2 $CXXFLAGS"
+      fi
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
+  fi  
+
+  if test "$kde_use_profiling" = "yes"; then
+    KDE_CHECK_COMPILER_FLAG(pg,
+    [
+      CFLAGS="-pg $CFLAGS"
+      CXXFLAGS="-pg $CXXFLAGS"
+    ])
+  fi
+
+  if test "$kde_use_warnings" = "yes"; then
+      if test "$GCC" = "yes"; then
+        CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
+        case $host in
+          *-*-linux-gnu)	
+            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
+            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
+            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
+          ;;
+        esac
+        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
+        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
+        dnl ### FIXME: revert for KDE 4
+        KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
+     fi
+  fi
+
+  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
+    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+  fi
+
+  AC_ARG_ENABLE(pch,
+     AC_HELP_STRING([--enable-pch],
+                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
+    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
+ 
+  HAVE_GCC_VISIBILITY=0
+  AC_SUBST([HAVE_GCC_VISIBILITY])
+
+  if test "$GXX" = "yes"; then
+    gcc_no_reorder_blocks=NO
+    KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
+    if test $kde_use_debug_code != "no" && \
+       test $kde_use_debug_code != "full" && \
+       test "YES" = "$gcc_no_reorder_blocks" ; then
+          CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+          CFLAGS="$CFLAGS -fno-reorder-blocks"
+    fi
+    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
+    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
+    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
+    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=	)
+    ENABLE_PERMISSIVE_FLAG="-fpermissive"
+
+    if test "$kde_use_pch" = "yes"; then
+        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
+        echo >conftest.h
+        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
+            kde_gcc_supports_pch=yes
+            AC_MSG_RESULT(yes)
+        else
+            kde_gcc_supports_pch=no
+            AC_MSG_RESULT(no)
+        fi
+        if test "$kde_gcc_supports_pch" = "yes"; then
+            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
+            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
+                kde_gcc_supports_pch=yes
+                AC_MSG_RESULT(yes)
+            else
+                kde_gcc_supports_pch=no
+                AC_MSG_RESULT(no)
+            fi
+        fi
+        rm -f conftest.h conftest.h.gch
+    fi
+
+    KDE_CHECK_FOR_OPT_NOINLINE_MATCH
+    if test "x$kde_cv_opt_noinline_match" = "xno" ; then
+       CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
+    fi
+  fi
+  AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
+  if test "$CXX" = "KCC"; then
+    dnl unfortunately we currently cannot disable exception support in KCC
+    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
+    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
+    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=	)
+
+    if test "$kde_use_pch" = "yes"; then
+      dnl TODO: support --pch-dir!
+      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
+      dnl the below works (but the dir must exist), but it's
+      dnl useless for a whole package.
+      dnl The are precompiled headers for each source file, so when compiling
+      dnl from scratch, it doesn't make a difference, and they take up
+      dnl around ~5Mb _per_ sourcefile.
+      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
+      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
+    fi
+    dnl this flag controls inlining. by default KCC inlines in optimisation mode
+    dnl all implementations that are defined inside the class {} declaration. 
+    dnl because of templates-compatibility with broken gcc compilers, this
+    dnl can cause excessive inlining. This flag limits it to a sane level
+    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
+    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
+    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
+    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
+    dnl Some source files are shared between multiple executables
+    dnl (or libraries) and some of those need template instantiations.
+    dnl In that case KCC needs to compile those sources with
+    dnl --one_instantiation_per_object.  To make it easy for us we compile
+    dnl _all_ objects with that flag (--one_per is a shorthand).
+    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
+  fi
+  AC_SUBST(USE_EXCEPTIONS)
+  dnl obsolete macro - provided to keep things going
+  USE_RTTI=
+  AC_SUBST(USE_RTTI)
+
+  case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
+      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`$CXX -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+          fi
+        fi
+        ;;
+  esac
+
+  AC_VALIDIFY_CXXFLAGS
+
+  AC_PROG_CXXCPP
+
+  if test "$GCC" = yes; then
+     NOOPT_CFLAGS=-O0
+  fi
+  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
+
+  AC_ARG_ENABLE(coverage,
+    AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
+      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker="-lgcc"
+      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker=""
+      else
+        AC_MSG_ERROR([coverage with your compiler is not supported])
+      fi
+      CFLAGS="$CFLAGS $ac_coverage_compiler"
+      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
+      LDFLAGS="$LDFLAGS $ac_coverage_linker"
+    ])
+
+  AC_SUBST(NOOPT_CXXFLAGS)
+  AC_SUBST(NOOPT_CFLAGS)
+  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
+
+  KDE_CHECK_NEW_LDFLAGS
+  KDE_CHECK_FINAL
+  KDE_CHECK_CLOSURE
+  KDE_CHECK_NMCHECK
+
+  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+])
+
+AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
+  [
+    AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
+      [
+        AC_LANG_SAVE
+        AC_LANG_CPLUSPLUS
+
+        safe_CXXFLAGS=$CXXFLAGS
+        safe_LDFLAGS=$LDFLAGS
+        CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
+        LDFLAGS="$LDFLAGS -shared -fPIC"
+
+        AC_TRY_LINK(
+        [
+          /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
+	  #include <string>
+          int some_function( void ) __attribute__ ((visibility("default")));
+          int some_function( void )
+          {
+	    std::string s("blafasel");
+            return 0;
+          }
+        ], [/* elvis is alive */],
+        kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
+
+        CXXFLAGS=$safe_CXXFLAGS
+        LDFLAGS=$safe_LDFLAGS
+        AC_LANG_RESTORE
+      ]
+    )
+
+    if test x$kde_cv_val_gcc_visibility_bug = xno; then
+      CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+    fi
+  ]
+)
+
+AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
+[
+  AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
+
+  AC_MSG_CHECKING([grepping for visibility push/pop in headers])
+
+  if test "x$GXX" = "xyes"; then
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    AC_EGREP_CPP(
+       [GCC visibility push],
+       [ #include <exception> 
+       ], 
+    [
+      AC_MSG_RESULT(yes)
+      kde_stdc_visibility_patched=yes ],
+    [ 
+      AC_MSG_RESULT(no)
+      AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for 
+                   visibility support. Disabling -fvisibility=hidden])
+
+      kde_stdc_visibility_patched=no ])
+
+    AC_LANG_RESTORE
+
+    kde_have_gcc_visibility=no
+    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
+    [
+      kde_have_gcc_visibility=yes
+      dnl the whole toolchain is just a mess, gcc is just too buggy
+      dnl to handle STL with visibility enabled. Lets reconsider 
+      dnl when gcc 4.2 is out or when things get fixed in the compiler.
+      dnl Contact mueller at kde.org for details.
+      AC_ARG_ENABLE(gcc-hidden-visibility,
+        AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
+          [kde_have_gcc_visibility=$enableval],
+          [kde_have_gcc_visibility=no])
+
+      AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
+        [
+          AC_LANG_SAVE
+          AC_LANG_CPLUSPLUS
+
+          safe_CXXFLAGS=$CXXFLAGS
+          CXXFLAGS="$CXXFLAGS $all_includes"
+
+          AC_TRY_COMPILE(
+          [
+#include <qglobal.h>
+#if Q_EXPORT - 0 != 0
+/* if this compiles, then Q_EXPORT is undefined */
+/* if Q_EXPORT is nonempty, this will break compilation */
+#endif
+          ], [/* elvis is alive */],
+          kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
+
+          CXXFLAGS=$safe_CXXFLAGS
+          AC_LANG_RESTORE
+        ]
+      )
+
+      if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
+        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+        KDE_CHECK_VISIBILITY_GCC_BUG
+        HAVE_GCC_VISIBILITY=1
+        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
+      fi
+    ])
+  fi
+])
+
+AC_DEFUN([KDE_ADD_DEPENDENCIES],
+[
+   [A]M_DEPENDENCIES(CC)
+   [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN([KDE_PROG_LIBTOOL],
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_OBJEXT
+AC_EXEEXT
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
+AC_SUBST(KDE_PLUGIN)
+
+# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
+KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
+AC_SUBST(KDE_CHECK_PLUGIN)
+
+# we patch configure quite some so we better keep that consistent for incremental runs 
+AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
+])
+
+AC_DEFUN([KDE_CHECK_LIB64],
+[
+    AC_ARG_ENABLE(libsuffix,
+        AC_HELP_STRING([--enable-libsuffix],
+            [/lib directory suffix (64,32,none,auto[=default])]),
+            kdelibsuff=$enableval, kdelibsuff="auto")
+    
+    if test "$kdelibsuff" = "auto"; then
+    
+cat > conftest.c << EOF
+#include <stdio.h>
+int main() {
+ return 0;
+}
+EOF
+        kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
+    s,.*/lib\([[^\/]]*\)/.*,\1, 
+    p 
+}'`
+	rm -rf conftest.*
+    fi	
+	
+    if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
+       kdelibsuff=
+    fi
+    if test -z "$kdelibsuff"; then
+        AC_MSG_RESULT([not using lib directory suffix])
+        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
+    else
+        if test "$libdir" = '${exec_prefix}/lib'; then
+            libdir="$libdir${kdelibsuff}"
+            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
+        fi
+        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
+        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
+    fi
+])
+
+AC_DEFUN([KDE_CHECK_TYPES],
+[  AC_CHECK_SIZEOF(int, 4)dnl
+   AC_CHECK_SIZEOF(short)dnl
+  AC_CHECK_SIZEOF(long, 4)dnl
+  AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+dnl Not used - kept for compat only?
+AC_DEFUN([KDE_DO_IT_ALL],
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN([AC_CHECK_RPATH],
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+      AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
+      USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  KDE_RPATH="-R \$(libdir)"
+
+  if test "$kde_libraries" != "$libdir"; then
+      KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
+  fi
+
+  if test -n "$qt_libraries"; then
+    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+  fi
+  dnl $x_libraries is set to /usr/lib in case
+  if test -n "$X_LDFLAGS"; then
+    X_RPATH="-R \$(x_libraries)"
+    KDE_RPATH="$KDE_RPATH $X_RPATH"
+  fi
+  if test -n "$KDE_EXTRA_RPATH"; then
+    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+  fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_SUBST(X_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN([AC_CHECK_SOCKLEN_T],
+[
+   AC_MSG_CHECKING(for socklen_t)
+   AC_CACHE_VAL(kde_cv_socklen_t,
+   [
+      AC_LANG_PUSH(C++)
+      kde_cv_socklen_t=no
+      AC_TRY_COMPILE([
+         #include <sys/types.h>
+         #include <sys/socket.h>
+      ],
+      [
+         socklen_t len;
+         getpeername(0,0,&len);
+      ],
+      [
+         kde_cv_socklen_t=yes
+         kde_cv_socklen_t_equiv=socklen_t
+      ])
+      AC_LANG_POP(C++)
+   ])
+   AC_MSG_RESULT($kde_cv_socklen_t)
+   if test $kde_cv_socklen_t = no; then
+      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
+      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
+      [
+         kde_cv_socklen_t_equiv=int
+         AC_LANG_PUSH(C++)
+         for t in int size_t unsigned long "unsigned long"; do
+            AC_TRY_COMPILE([
+               #include <sys/types.h>
+               #include <sys/socket.h>
+            ],
+            [
+               $t len;
+               getpeername(0,0,&len);
+            ],
+            [
+               kde_cv_socklen_t_equiv="$t"
+               break
+            ])
+         done
+         AC_LANG_POP(C++)
+      ])
+      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
+   fi
+   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
+                     [type to use in place of socklen_t if not defined])
+   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
+                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN([AM_KDE_WITH_NLS],
+  [
+    dnl If we use NLS figure out what method
+
+    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+        GMSGFMT=":"
+      fi
+      MSGFMT=$GMSGFMT
+      AC_SUBST(GMSGFMT)
+      AC_SUBST(MSGFMT)
+
+      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+	dnl If it is no GNU xgettext we define it as : so that the
+	dnl Makefiles still can work.
+	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+	  : ;
+	else
+	  AC_MSG_RESULT(
+	    [found xgettext programs is not GNU xgettext; ignore it])
+	  XGETTEXT=":"
+	fi
+      fi
+     AC_SUBST(XGETTEXT)
+
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper at cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+	ac_cv_path_$1="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper at cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN([AM_LC_MESSAGES],
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+    fi
+  fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN([AM_FUNC_OBSTACK],
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
+	      am_cv_func_obstack=yes,
+	      am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+   AC_DEFINE(HAVE_OBSTACK)
+ else
+   LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+              am_cv_lib_error_at_line=yes,
+	      am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+   LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper at cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN([AM_KDE_GNU_GETTEXT],
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   AC_MSG_CHECKING(for stpcpy)
+   AC_CACHE_VAL(kde_cv_func_stpcpy,
+   [
+   kde_safe_cxxflags=$CXXFLAGS
+   CXXFLAGS="-Werror"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_TRY_COMPILE([
+   #include <string.h>
+   ],
+   [
+   char buffer[200];
+   stpcpy(buffer, buffer);
+   ],
+   kde_cv_func_stpcpy=yes,
+   kde_cv_func_stpcpy=no)
+   AC_LANG_RESTORE
+   CXXFLAGS=$kde_safe_cxxflags
+   ])
+   AC_MSG_RESULT($kde_cv_func_stpcpy)
+   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+   fi
+
+   AM_LC_MESSAGES
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+  ])
+
+AC_DEFUN([AC_HAVE_XPM],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
+	xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+   ac_cv_have_xpm=no
+ else
+   AC_MSG_CHECKING(for XPM)
+   AC_CACHE_VAL(ac_cv_have_xpm,
+   [
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+    else
+      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
+    fi
+    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <X11/xpm.h>],[],
+	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_xpm" = no; then
+    AC_MSG_RESULT(no)
+    XPM_LDFLAGS=""
+    XPMINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+    if test "$XPM_LDFLAGS" = ""; then
+       XPMLIB='-lXpm $(LIB_X11)'
+    else
+       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+    fi
+    if test "$XPM_INCLUDE" = ""; then
+       XPMINC=""
+    else
+       XPMINC="-I$XPM_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN([AC_HAVE_DPMS],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
+	dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+   ac_cv_have_dpms=no
+ else
+   AC_MSG_CHECKING(for DPMS)
+   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+   AC_CACHE_VAL(ac_cv_have_dpms,
+   [
+    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
+      AC_MSG_RESULT(no)
+      ac_cv_have_dpms="no"
+    else
+      ac_save_ldflags="$LDFLAGS"
+      ac_save_cflags="$CFLAGS"
+      ac_save_libs="$LIBS"
+      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
+      LIBS="-lX11 -lXext $LIBSOCKET"
+      CFLAGS="$CFLAGS $X_INCLUDES"
+      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+      AC_TRY_LINK([
+	  #include <X11/Xproto.h>
+	  #include <X11/X.h>
+	  #include <X11/Xlib.h>
+	  #include <X11/extensions/dpms.h>
+	  int foo_test_dpms()
+	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+	  ac_cv_have_dpms="yes", [
+              LIBS="-lXdpms $LIBS"
+              AC_TRY_LINK([
+	          #include <X11/Xproto.h>
+        	  #include <X11/X.h>
+        	  #include <X11/Xlib.h>
+        	  #include <X11/extensions/dpms.h>
+        	  int foo_test_dpms()
+        	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+        	  [
+                  ac_cv_have_dpms="-lXdpms"
+                  ],ac_cv_have_dpms="no")
+              ])
+      LDFLAGS="$ac_save_ldflags"
+      CFLAGS="$ac_save_cflags"
+      LIBS="$ac_save_libs"
+    fi
+   ])dnl
+
+  if test "$ac_cv_have_dpms" = no; then
+    AC_MSG_RESULT(no)
+    DPMS_LDFLAGS=""
+    DPMSINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+    if test "$ac_cv_have_dpms" = "-lXdpms"; then
+       DPMS_LIB="-lXdpms"
+    fi
+    if test "$DPMS_LDFLAGS" = ""; then
+       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+    else
+       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+    fi
+    if test "$DPMS_INCLUDE" = ""; then
+       DPMSINC=""
+    else
+       DPMSINC="-I$DPMS_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ ac_save_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
+   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSCapable,
+   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
+   [#include <X11/Xlib.h>
+   #include <X11/extensions/dpms.h>])
+ AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
+   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSInfo,
+   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
+   [#include <X11/Xlib.h>
+   #include <X11/extensions/dpms.h>])
+ CFLAGS="$ac_save_cflags"
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN([AC_HAVE_GL],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
+	gl_test=$withval, gl_test="yes")
+ if test "x$kde_use_qt_emb" = "xyes"; then
+   # GL and Qt Embedded is a no-go for now.
+   ac_cv_have_gl=no
+ elif test "x$gl_test" = xno; then
+   ac_cv_have_gl=no
+ else
+   AC_MSG_CHECKING(for GL)
+   AC_CACHE_VAL(ac_cv_have_gl,
+   [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_ldflags=$LDFLAGS
+    ac_save_cxxflags=$CXXFLAGS
+    ac_save_libs=$LIBS
+    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
+    LIBS="$LIBS -lGL -lGLU"
+    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
+    LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
+    CXXFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+	ac_cv_have_gl="yes", ac_cv_have_gl="no")
+    AC_LANG_RESTORE
+    LDFLAGS=$ac_save_ldflags
+    CXXFLAGS=$ac_save_cxxflags
+    LIBS=$ac_save_libs
+   ])dnl
+
+  if test "$ac_cv_have_gl" = "no"; then
+    AC_MSG_RESULT(no)
+    GL_LDFLAGS=""
+    GLINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+    if test "$GL_LDFLAGS" = ""; then
+       GLLIB='-lGLU -lGL $(LIB_X11)'
+    else
+       GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
+    fi
+    if test "$GL_INCLUDE" = ""; then
+       GLINC=""
+    else
+       GLINC="-I$GL_INCLUDE"
+    fi
+    AC_MSG_RESULT($ac_cv_have_gl)
+    $1
+  fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+
+ dnl shadow password and PAM magic - maintained by ossi at kde.org
+
+AC_DEFUN([KDE_PAM], [
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+
+  want_pam=
+  AC_ARG_WITH(pam,
+    AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
+    [ if test "x$withval" = "xyes"; then
+        want_pam=yes
+        pam_service=kde
+      elif test "x$withval" = "xno"; then
+        want_pam=no
+      else
+        want_pam=yes
+        pam_service=$withval
+      fi
+    ], [ pam_service=kde ])
+
+  use_pam=
+  PAMLIBS=
+  if test "x$want_pam" != xno; then
+    AC_CHECK_LIB(pam, pam_start, [
+      AC_CHECK_HEADER(security/pam_appl.h,
+        [ pam_header=security/pam_appl.h ],
+        [ AC_CHECK_HEADER(pam/pam_appl.h,
+            [ pam_header=pam/pam_appl.h ],
+            [
+    AC_MSG_WARN([PAM detected, but no headers found!
+Make sure you have the necessary development packages installed.])
+            ]
+          )
+        ]
+      )
+    ], , $LIBDL)
+    if test -z "$pam_header"; then
+      if test "x$want_pam" = xyes; then
+        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
+      fi
+    else
+      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
+      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
+      use_pam=yes
+
+      dnl darwin claims to be something special
+      if test "$pam_header" = "pam/pam_appl.h"; then
+        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
+      fi
+
+      dnl test whether struct pam_message is const (Linux) or not (Sun)
+      AC_MSG_CHECKING(for const pam_message)
+      AC_EGREP_HEADER([struct pam_message], $pam_header,
+        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
+                          [AC_MSG_RESULT([const: Linux-type PAM])],
+                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
+                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+                          )],
+        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+    fi
+  fi
+
+  AC_SUBST(PAMLIBS)
+])
+
+dnl DEF_PAM_SERVICE(arg name, full name, define name)
+AC_DEFUN([DEF_PAM_SERVICE], [
+  AC_ARG_WITH($1-pam,
+    AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
+    [ if test "x$use_pam" = xyes; then
+        $3_PAM_SERVICE=$withval
+      else
+        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
+You may want to enforce it by using --with-pam.])
+      fi
+    ], 
+    [ if test "x$use_pam" = xyes; then
+        $3_PAM_SERVICE="$pam_service"
+      fi
+    ])
+    if test -n "$$3_PAM_SERVICE"; then
+      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
+      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
+    fi
+    AC_SUBST($3_PAM_SERVICE)
+])
+
+AC_DEFUN([KDE_SHADOWPASSWD], [
+  AC_REQUIRE([KDE_PAM])
+
+  AC_CHECK_LIB(shadow, getspent,
+    [ LIBSHADOW="-lshadow"
+      ac_use_shadow=yes
+    ],
+    [ dnl for UnixWare
+      AC_CHECK_LIB(gen, getspent, 
+        [ LIBGEN="-lgen"
+          ac_use_shadow=yes
+        ], 
+        [ AC_CHECK_FUNC(getspent, 
+            [ ac_use_shadow=yes ],
+            [ ac_use_shadow=no ])
+	])
+    ])
+  AC_SUBST(LIBSHADOW)
+  AC_SUBST(LIBGEN)
+  
+  AC_MSG_CHECKING([for shadow passwords])
+
+  AC_ARG_WITH(shadow,
+    AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
+    [ if test "x$withval" != "xno"; then
+        use_shadow=yes
+      else
+        use_shadow=no
+      fi
+    ], [
+      use_shadow="$ac_use_shadow"
+    ])
+
+  if test "x$use_shadow" = xyes; then
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
+  else
+    AC_MSG_RESULT(no)
+    LIBSHADOW=
+    LIBGEN=
+  fi
+
+  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
+  dnl this still applies, if we could use it indirectly through pam.
+  if test "x$use_shadow" = xyes || 
+     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
+      case $host in
+      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
+	SETUIDFLAGS="-m 4755 -o root";;
+      *)
+	SETUIDFLAGS="-m 4755";;
+      esac
+  fi
+  AC_SUBST(SETUIDFLAGS)
+
+])
+
+AC_DEFUN([KDE_PASSWDLIBS], [
+  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
+  AC_REQUIRE([KDE_PAM])
+  AC_REQUIRE([KDE_SHADOWPASSWD])
+
+  if test "x$use_pam" = "xyes"; then 
+    PASSWDLIBS="$PAMLIBS"
+  else
+    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
+  fi
+
+  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
+  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
+  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
+  dnl may need to read /etc/master.passwd).
+  case $host in
+  *-*-freebsd*)
+    SETUIDFLAGS="-m 4755 -o root"
+    ;;
+  *)
+    ;;
+  esac
+
+  AC_SUBST(PASSWDLIBS)
+])
+
+AC_DEFUN([KDE_CHECK_LIBDL],
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN([KDE_CHECK_DLOPEN],
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+  ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+  ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+  enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+  test -n "$1" && eval $1
+else
+  test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+  dynamic_loading=yes
+  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+  dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+  $1
+else
+  $2
+fi
+])
+
+AC_DEFUN([KDE_ADD_INCLUDES],
+[
+if test -z "$1"; then
+  test_include="Pix.h"
+else
+  test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+   for ac_dir in               \
+                               \
+     /usr/include/g++          \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$test_include"; then
+       kde_cv_libgpp_includes=$ac_dir
+       break
+     fi
+   done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+AC_DEFUN([KDE_CHECK_LIBPTHREAD],
+[
+  dnl This code is here specifically to handle the
+  dnl various flavors of threading library on FreeBSD
+  dnl 4-, 5-, and 6-, and the (weird) rules around it.
+  dnl There may be an environment PTHREAD_LIBS that 
+  dnl specifies what to use; otherwise, search for it.
+  dnl -pthread is special cased and unsets LIBPTHREAD
+  dnl below if found.
+  LIBPTHREAD=""
+
+  if test -n "$PTHREAD_LIBS"; then
+    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
+      LIBPTHREAD="PTHREAD"
+    else
+      PTHREAD_LIBS_save="$PTHREAD_LIBS"
+      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
+      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
+      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
+          LIBPTHREAD="$PTHREAD_LIBS_save"])
+      PTHREAD_LIBS="$PTHREAD_LIBS_save"
+    fi
+  fi
+
+  dnl Is this test really needed, in the face of the Tru64 test below?
+  if test -z "$LIBPTHREAD"; then
+    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
+  fi
+
+  dnl This is a special Tru64 check, see BR 76171 issue #18.
+  if test -z "$LIBPTHREAD" ; then
+    AC_MSG_CHECKING([for pthread_create in -lpthread])
+    kde_safe_libs=$LIBS
+    LIBS="$LIBS -lpthread"
+    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
+        AC_MSG_RESULT(yes)
+        LIBPTHREAD="-lpthread"],[
+	AC_MSG_RESULT(no)])
+    LIBS=$kde_safe_libs
+  fi
+
+  dnl Un-special-case for FreeBSD.
+  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
+    LIBPTHREAD=""
+  fi
+
+  AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
+[
+      USE_THREADS=""
+      if test -z "$LIBPTHREAD"; then
+        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
+      fi
+
+    AH_VERBATIM(__svr_define, [
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+])
+    case $host_os in
+ 	solaris*)
+		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
+    		;;
+        freebsd*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
+                ;;
+        aix*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                LIBPTHREAD="$LIBPTHREAD -lc_r"
+                ;;
+        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+                if test "$CXX" = "KCC"; then
+                  CXXFLAGS="$CXXFLAGS --thread_safe"
+		  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
+                fi
+                ;;
+	*)
+		;;
+    esac
+    AC_SUBST(USE_THREADS)
+    AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_THREADING],
+[
+  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+  dnl default is yes if libpthread is found and no if no libpthread is available
+  if test -z "$LIBPTHREAD"; then
+    if test -z "$USE_THREADS"; then
+      kde_check_threading_default=no
+    else
+      kde_check_threading_default=yes
+    fi
+  else
+    kde_check_threading_default=yes
+  fi
+  AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
+   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+  if test "x$kde_use_threading" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+  fi
+])
+
+AC_DEFUN([KDE_TRY_LINK_PYTHON],
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+  AC_MSG_CHECKING(if a Python application links)
+else
+  AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+	PySys_SetArgv(1, 0);
+],
+	[kde_cv_try_link_python_$1=yes],
+	[kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+  AC_MSG_RESULT(yes)
+  kde_python_link_found=yes
+  if test ! "$1" = normal; then
+    LIBPYTHON="$LIBPYTHON $2"
+  fi
+  $3
+else
+  AC_MSG_RESULT(no)
+  $4
+fi
+
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_DIR],
+[
+AC_MSG_CHECKING([for Python directory])
+ 
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+  if test -z "$PYTHONDIR"; then
+    kde_cv_pythondir=/usr/local
+  else
+    kde_cv_pythondir="$PYTHONDIR"
+  fi
+])
+ 
+AC_ARG_WITH(pythondir,
+AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
+[
+  ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+ 
+AC_MSG_RESULT($ac_python_dir)
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
+
+if test -z "$1"; then
+  version="1.5"
+else
+  version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+  python_incdir=$python_incdir/python$version
+  if test ! -r $python_incdir/Python.h; then
+    python_incdir=no
+  fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
+AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.so; then
+  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+  if test ! -r $python_libdir/libpython$version.a; then
+    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+    python_libdir=$python_libdir/python$version/config
+    if test ! -r $python_libdir/libpython$version.a; then
+      python_libdir=no
+    fi
+  fi
+fi
+
+PYTHONLIB=-L$python_libdir
+kde_orig_LIBPYTHON=$LIBPYTHON
+if test -z "$LIBPYTHON"; then
+  LIBPYTHON=-lpython$version
+fi
+
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+  python_moddir=no
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
+   LIBPYTHON=$kde_orig_LIBPYTHON
+   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
+   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
+   $2
+else 
+  dnl Note: this test is very weak
+  kde_python_link_found=no
+  KDE_TRY_LINK_PYTHON(normal)
+  KDE_TRY_LINK_PYTHON(m, -lm)
+  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+  KDE_TRY_LINK_PYTHON(db2, -ldb2)
+  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
+  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
+  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
+  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
+	[AC_MSG_WARN([it seems, Python depends on another library.
+    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
+    and contact the authors to let them know about this problem])
+	])
+
+  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+  AC_SUBST(PYTHONINC)
+  AC_SUBST(PYTHONLIB)
+  AC_SUBST(LIBPYTHON)
+  AC_SUBST(PYTHONMODDIR)
+  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_PYTHON],
+[
+  KDE_CHECK_PYTHON_INTERN("2.6",
+    [KDE_CHECK_PYTHON_INTERN("2.5",
+      [KDE_CHECK_PYTHON_INTERN("2.4",
+        [KDE_CHECK_PYTHON_INTERN("2.3", 
+          [KDE_CHECK_PYTHON_INTERN("2.2", 
+            [KDE_CHECK_PYTHON_INTERN("2.1", 
+              [KDE_CHECK_PYTHON_INTERN("2.0", 
+                [KDE_CHECK_PYTHON_INTERN($1, $2) ])
+              ])
+            ])
+          ])
+        ])
+      ])
+    ])
+])
+
+AC_DEFUN([KDE_CHECK_STL],
+[
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+
+    AC_MSG_CHECKING([if C++ programs can be compiled])
+    AC_CACHE_VAL(kde_cv_stl_works,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hallo Welt.";
+  astring.erase(0, 6); // now astring is "Welt"
+  return 0;
+], kde_cv_stl_works=yes,
+   kde_cv_stl_works=no)
+])
+
+   AC_MSG_RESULT($kde_cv_stl_works)
+
+   if test "$kde_cv_stl_works" = "yes"; then
+     # back compatible
+	 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+   else
+	 AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
+Check config.log for details - if you're using a Linux distribution you might miss
+a package named similar to libstdc++-dev.])
+   fi
+
+   CXXFLAGS="$ac_save_CXXFLAGS"
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN([AC_FIND_QIMGIO],
+   [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+		QString t = "hallo";
+		t.fill('t');
+		qInitImageIO();
+}
+],
+            ac_cv_lib_qimgio=yes,
+            ac_cv_lib_qimgio=no,
+	    ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+  AC_SUBST(LIBQIMGIO)
+else
+  AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN([AM_DISABLE_LIBRARIES],
+[
+    AC_PROVIDE([AM_ENABLE_STATIC])
+    AC_PROVIDE([AM_ENABLE_SHARED])
+    enable_static=no
+    enable_shared=yes
+])
+
+
+AC_DEFUN([AC_CHECK_UTMP_FILE],
+[
+    AC_MSG_CHECKING([for utmp file])
+
+    AC_CACHE_VAL(kde_cv_utmp_file,
+    [
+    kde_cv_utmp_file=no
+
+    for ac_file in    \
+                      \
+	/var/run/utmp \
+	/var/adm/utmp \
+	/etc/utmp     \
+     ; \
+    do
+     if test -r "$ac_file"; then
+       kde_cv_utmp_file=$ac_file
+       break
+     fi
+    done
+    ])
+
+    if test "$kde_cv_utmp_file" != "no"; then
+	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+	$1
+	AC_MSG_RESULT($kde_cv_utmp_file)
+    else
+    	$2
+	AC_MSG_RESULT([non found])
+    fi
+])
+
+
+AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+TOPSUBDIRS=""
+
+if test ! -s $srcdir/subdirs; then
+  dnl Note: Makefile.common creates subdirs, so this is just a fallback
+  files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+ac_topsubdirs=
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+elif test -s $srcdir/subdirs; then
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  AC_MSG_CHECKING([if $i should be compiled])
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  AC_MSG_RESULT($install_it)
+  vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+    eval "$vari""_SUBDIR_included=yes"
+  else
+    eval "$vari""_SUBDIR_included=no"
+  fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN([KDE_CHECK_NAMESPACES],
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+  extern int i;
+  namespace Bar {
+    extern int i;
+  }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure at kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_S_ISSOCK],
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+
+AH_VERBATIM(_ISSOCK,
+[
+#ifndef HAVE_S_ISSOCK
+#define HAVE_S_ISSOCK
+#define S_ISSOCK(mode) (1==0)
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure at kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+    ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+AC_DEFUN([KDE_CHECK_HEADER],
+[
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
+   AC_LANG_RESTORE
+   CPPFLAGS=$kde_safe_cppflags
+])
+
+AC_DEFUN([KDE_CHECK_HEADERS],
+[
+   AH_CHECK_HEADERS([$1])
+   AC_LANG_SAVE
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
+   CPPFLAGS=$kde_safe_cppflags
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_FAST_CONFIGURE],
+[
+  dnl makes configure fast (needs perl)
+  AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
+      with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN([KDE_CONF_FILES],
+[
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+  AC_SUBST(CONF_FILES)
+])dnl
+
+dnl This sets the prefix, for arts and kdelibs
+dnl Do NOT use in any other module.
+dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
+AC_DEFUN([KDE_SET_PREFIX_CORE],
+[
+  unset CDPATH
+  dnl make $KDEDIR the default for the installation
+  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+  if test "x$prefix" = "xNONE"; then
+    prefix=$ac_default_prefix
+    ac_configure_args="$ac_configure_args --prefix=$prefix"
+  fi
+  # And delete superfluous '/' to make compares easier
+  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+  kde_libs_prefix='$(prefix)'
+  kde_libs_htmldir='$(kde_htmldir)'
+  AC_SUBST(kde_libs_prefix)
+  AC_SUBST(kde_libs_htmldir)
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+
+AC_DEFUN([KDE_SET_PREFIX],
+[
+  unset CDPATH
+  dnl We can't give real code to that macro, only a value.
+  dnl It only matters for --help, since we set the prefix in this function anyway.
+  AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
+
+  KDE_SET_DEFAULT_BINDIRS
+  if test "x$prefix" = "xNONE"; then
+    dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
+    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+  else
+    dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
+    kde_save_PATH="$PATH"
+    PATH="$exec_prefix/bin:$prefix/bin:$PATH"
+    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+    PATH="$kde_save_PATH"
+  fi
+
+  kde_libs_prefix=`$KDECONFIG --prefix`
+  if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+       AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+                    This means it has been moved since you installed it.
+                    This won't work. Please recompile kdelibs for the new prefix.
+                    ])
+  fi
+  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+
+  AC_MSG_CHECKING([where to install])
+  if test "x$prefix" = "xNONE"; then
+    prefix=$kde_libs_prefix
+    AC_MSG_RESULT([$prefix (as returned by kde-config)])
+  else
+    dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
+    given_prefix=$prefix
+    AC_MSG_RESULT([$prefix (as requested)])
+  fi
+
+  # And delete superfluous '/' to make compares easier
+  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+  AC_SUBST(KDECONFIG)
+  AC_SUBST(kde_libs_prefix)
+  AC_SUBST(kde_libs_htmldir)
+
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+  dnl our own version, testing for a -p flag
+  popdef([AC_PROG_INSTALL])
+  dnl as AC_PROG_INSTALL works as it works we first have
+  dnl to save if the user didn't specify INSTALL, as the
+  dnl autoconf one overwrites INSTALL and we have no chance to find
+  dnl out afterwards
+  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  AC_PROG_INSTALL
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    AC_MSG_CHECKING(for -p flag to install)
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    AC_MSG_RESULT($ac_res)
+  fi
+  dnl the following tries to resolve some signs and wonders coming up
+  dnl with different autoconf/automake versions
+  dnl e.g.:
+  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+  dnl   install- at DIR@PROGRAMS targets to explicitly use that flag
+  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
+  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
+  dnl  *sometimes KDE does not use the install- at DIR@PROGRAM targets from
+  dnl   automake (due to broken Makefile.am or whatever) to install programs,
+  dnl   and so does not see the -s flag in automake > 1.4
+  dnl to clean up that mess we:
+  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+  dnl   which cleans KDE's program with automake > 1.4;
+  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+  dnl   with automake<=1.4
+  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
+  dnl   properly uses install- at DIR@PROGRAMS, but I don't care
+  dnl
+  dnl And to all this comes, that I even can't write in comments variable
+  dnl  names used by automake, because it is so stupid to think I wanted to
+  dnl  _use_ them, therefor I have written A_M_... instead of AM_
+  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+])dnl
+
+AC_DEFUN([KDE_LANG_CPLUSPLUS],
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN([KDE_CHECK_LONG_LONG],
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  AC_TRY_LINK([], [
+  long long foo = 0;
+  foo = foo+1;
+  ],
+  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+  AC_LANG_RESTORE
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_LIB],
+[
+     kde_save_LDFLAGS="$LDFLAGS"
+     dnl AC_CHECK_LIB modifies LIBS, so save it here
+     kde_save_LIBS="$LIBS"
+     LDFLAGS="$LDFLAGS $all_libraries"
+     case $host_os in
+      aix*) LDFLAGS="-brtl $LDFLAGS"
+	test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
+	;;
+     esac
+     AC_CHECK_LIB($1, $2, $3, $4, $5)
+     LDFLAGS="$kde_save_LDFLAGS"
+     LIBS="$kde_save_LIBS"
+])
+
+AC_DEFUN([KDE_JAVA_PREFIX],
+[
+	dir=`dirname "$1"`
+	base=`basename "$1"`
+	list=`ls -1 $dir 2> /dev/null`
+	for entry in $list; do 
+		if test -d $dir/$entry/bin; then
+			case $entry in
+			   $base)
+				javadirs="$javadirs $dir/$entry/bin"
+				;;
+			esac
+		elif test -d $dir/$entry/jre/bin; then
+			case $entry in
+			   $base)
+				javadirs="$javadirs $dir/$entry/jre/bin"
+				;;
+			esac
+		fi
+	done
+])
+
+dnl KDE_CHEC_JAVA_DIR(onlyjre)
+AC_DEFUN([KDE_CHECK_JAVA_DIR],
+[
+
+AC_ARG_WITH(java,
+AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
+[  ac_java_dir=$withval
+], ac_java_dir=""
+)
+
+AC_MSG_CHECKING([for Java])
+
+dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
+if test "x$ac_java_dir" = "xno"; then
+   kde_java_bindir=no
+   kde_java_includedir=no
+   kde_java_libjvmdir=no
+   kde_java_libgcjdir=no
+   kde_java_libhpidir=no
+else
+  if test "x$ac_java_dir" = "x"; then
+     
+     
+      dnl No option set -> collect list of candidate paths
+      if test -n "$JAVA_HOME"; then
+        KDE_JAVA_PREFIX($JAVA_HOME)
+      fi
+      KDE_JAVA_PREFIX(/usr/j2se)
+      KDE_JAVA_PREFIX(/usr/lib/j2se)
+      KDE_JAVA_PREFIX(/usr/j*dk*)
+      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
+      KDE_JAVA_PREFIX(/opt/j*sdk*)
+      KDE_JAVA_PREFIX(/usr/lib/java*)
+      KDE_JAVA_PREFIX(/usr/java*)
+      KDE_JAVA_PREFIX(/usr/java/j*dk*)
+      KDE_JAVA_PREFIX(/usr/java/j*re*)
+      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
+      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
+      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
+      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
+      KDE_JAVA_PREFIX(/opt/java*)
+
+      kde_cv_path="NONE"
+      kde_save_IFS=$IFS
+      IFS=':'
+      for dir in $PATH; do
+	  if test -d "$dir"; then
+	      javadirs="$javadirs $dir"
+	  fi
+      done
+      IFS=$kde_save_IFS
+      jredirs=
+
+      dnl Now javadirs contains a list of paths that exist, all ending with bin/
+      for dir in $javadirs; do
+          dnl Check for the java executable
+	  if test -x "$dir/java"; then
+	      sane_path=$(cd $dir; /bin/pwd)
+	      dnl And also check for a libjvm.so somewhere under there
+	      dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
+              if test "$sane_path" != "/usr/bin"; then
+                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+		  if test ! -f $libjvmdir/libjvm.so; then continue; fi
+		  jredirs="$jredirs $dir"
+	      fi
+	  fi
+      done
+
+      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
+      JAVAC=
+      JAVA=
+      kde_java_bindir=no
+      for dir in $jredirs; do
+	  JAVA="$dir/java"
+	  kde_java_bindir=$dir
+	  if test -x "$dir/javac"; then
+		JAVAC="$dir/javac"
+                break
+	  fi
+      done
+
+      if test -n "$JAVAC"; then
+          dnl this substitution might not work - well, we test for jni.h below
+          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
+      else
+          kde_java_includedir=no
+      fi
+  else
+    dnl config option set
+    kde_java_bindir=$ac_java_dir/bin
+    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
+	kde_java_includedir=no
+    else
+        kde_java_includedir=$ac_java_dir/include
+    fi
+  fi
+fi
+
+dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
+if test "x$kde_java_bindir" != "xno"; then
+
+  dnl Look for libjvm.so
+  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+  dnl Look for libgcj.so
+  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+  dnl Look for libhpi.so and avoid green threads
+  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
+
+  dnl Now check everything's fine under there
+  dnl the include dir is our flag for having the JDK
+  if test -d "$kde_java_includedir"; then
+    if test ! -x "$kde_java_bindir/javac"; then
+      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
+    fi
+    if test ! -x "$kde_java_bindir/javah"; then
+      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+    fi
+    if test ! -x "$kde_java_bindir/jar"; then
+      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+    fi
+    if test ! -r "$kde_java_includedir/jni.h"; then
+      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
+    fi
+
+    jni_includes="-I$kde_java_includedir"
+    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
+    dnl and under linux here.. 
+    
+    dnl not needed for gcj
+
+    if test "x$kde_java_libgcjdir" = "x"; then 
+      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
+      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
+      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
+    fi
+
+  else
+    JAVAC=
+    jni_includes=
+  fi
+
+  if test "x$kde_java_libgcjdir" = "x"; then 
+     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
+        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
+     fi 
+  else
+     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
+        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
+     fi 
+  fi
+
+  if test ! -x "$kde_java_bindir/java"; then
+      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+  fi
+
+  dnl not needed for gcj compile
+
+  if test "x$kde_java_libgcjdir" = "x"; then 
+      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
+        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
+      fi
+  fi
+
+  if test -n "$jni_includes"; then
+    dnl Check for JNI version
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_cxxflags_safe="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
+
+    AC_TRY_COMPILE([
+  #include <jni.h>
+	      ],
+	      [
+  #ifndef JNI_VERSION_1_2
+  Syntax Error
+  #endif
+	      ],[ kde_jni_works=yes ],
+	      [ kde_jni_works=no ])
+
+    if test $kde_jni_works = no; then
+      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
+		    You need to have Java Development Kit (JDK) version 1.2. 
+
+		    Use --with-java to specify another location.
+		    Use --without-java to configure without java support.
+		    Or download a newer JDK and try again. 
+		    See e.g. http://java.sun.com/products/jdk/1.2 ])
+    fi
+
+    CXXFLAGS="$ac_cxxflags_safe"    
+    AC_LANG_RESTORE
+
+    dnl All tests ok, inform and subst the variables
+
+    JAVAC=$kde_java_bindir/javac
+    JAVAH=$kde_java_bindir/javah
+    JAR=$kde_java_bindir/jar
+    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+    if test "x$kde_java_libgcjdir" = "x"; then 
+      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
+    else
+      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+    fi
+    AC_MSG_RESULT([java JDK in $kde_java_bindir])
+
+  else
+      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+      AC_MSG_RESULT([java JRE in $kde_java_bindir])
+  fi
+elif test -d "/Library/Java/Home"; then
+  kde_java_bindir="/Library/Java/Home/bin"
+  jni_includes="-I/Library/Java/Home/include"
+
+  JAVAC=$kde_java_bindir/javac
+  JAVAH=$kde_java_bindir/javah
+  JAR=$kde_java_bindir/jar
+  JVMLIBS="-Wl,-framework,JavaVM"
+
+  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+  AC_MSG_RESULT([Apple Java Framework])
+else
+  AC_MSG_RESULT([none found])
+fi
+
+AC_SUBST(JAVAC)
+AC_SUBST(JAVAH)
+AC_SUBST(JAR)
+AC_SUBST(JVMLIBS)
+AC_SUBST(jni_includes)
+
+# for backward compat
+kde_cv_java_includedir=$kde_java_includedir
+kde_cv_java_bindir=$kde_java_bindir
+])
+
+dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
+dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
+dnl big packages, m4_foreach is dog-slow.  So use our own version of
+dnl it.  (matz at kde.org)
+m4_define([mm_foreach],
+[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
+m4_define([mm_car], [[$1]])
+m4_define([mm_car2], [[$@]])
+m4_define([_mm_foreach],
+[m4_if(m4_quote($2), [], [],
+       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
+                                                   mm_car2(m4_shift($2)),
+                                                   [$3])])])
+m4_define([AC_FOREACH],
+[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
+
+AC_DEFUN([KDE_NEED_FLEX],
+[
+kde_libs_safe=$LIBS
+LIBS="$LIBS $USER_LDFLAGS"
+AM_PROG_LEX
+LIBS=$kde_libs_safe
+if test -z "$LEXLIB"; then
+    AC_MSG_ERROR([You need to have flex installed.])
+fi
+AC_SUBST(LEXLIB)
+])
+
+AC_DEFUN([AC_PATH_QTOPIA],
+[
+  dnl TODO: use AC_CACHE_VAL
+
+  if test -z "$1"; then
+    qtopia_minver_maj=1
+    qtopia_minver_min=5
+    qtopia_minver_pat=0
+  else
+    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
+    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
+    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
+  fi
+
+  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
+  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
+
+  AC_REQUIRE([AC_PATH_QT])
+
+  AC_MSG_CHECKING([for Qtopia])
+
+  LIB_QTOPIA="-lqpe"
+  AC_SUBST(LIB_QTOPIA)
+
+  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
+
+  ac_qtopia_incdir=NO
+
+  AC_ARG_WITH(qtopia-dir,
+              AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
+              [  ac_qtopia_incdir="$withval"/include] ) 
+  
+  qtopia_incdirs=""
+  for dir in $kde_qtopia_dirs; do
+    qtopia_incdirs="$qtopia_incdirs $dir/include"
+  done
+
+  if test ! "$ac_qtopia_incdir" = "NO"; then
+    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
+  fi
+
+  qtopia_incdir=""
+  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
+  ac_qtopia_incdir="$qtopia_incdir"
+
+  if test -z "$qtopia_incdir"; then
+    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
+  fi
+
+  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
+  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
+  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
+
+  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
+  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
+  if test "$qtopia_ver" -lt "$qtopia_minver"; then
+    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
+is required.])
+  fi
+
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+
+  ac_cxxflags_safe="$CXXFLAGS"
+  ac_ldflags_safe="$LDFLAGS"
+  ac_libs_safe="$LIBS"
+
+  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
+  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
+
+  cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qpe/qpeapplication.h>
+#include <qpe/version.h>
+
+int main( int argc, char **argv )
+{
+    QPEApplication app( argc, argv );
+    return 0;
+}
+EOF
+
+  if AC_TRY_EVAL(ac_link) && test -s conftest; then
+    rm -f conftest*
+  else
+    rm -f conftest*
+    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
+the end of config.log])
+  fi
+
+  CXXFLAGS="$ac_cxxflags_safe"
+  LDFLAGS="$ac_ldflags_safe"
+  LIBS="$ac_libs_safe"
+
+  AC_LANG_RESTORE
+
+  QTOPIA_INCLUDES="-I$qtopia_incdir"
+  AC_SUBST(QTOPIA_INCLUDES)
+
+  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
+])
+
+
+AC_DEFUN([KDE_INIT_DOXYGEN],
+[
+AC_MSG_CHECKING([for Qt docs])
+kde_qtdir=
+if test "${with_qt_dir+set}" = set; then
+  kde_qtdir="$with_qt_dir"
+fi
+
+AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
+AC_MSG_RESULT($QTDOCDIR)
+
+AC_SUBST(QTDOCDIR)
+
+KDE_FIND_PATH(dot, DOT, [], [])
+if test -n "$DOT"; then
+  KDE_HAVE_DOT="YES"
+else
+  KDE_HAVE_DOT="NO"
+fi
+AC_SUBST(KDE_HAVE_DOT)
+KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
+AC_SUBST(DOXYGEN)
+
+DOXYGEN_PROJECT_NAME="$1"
+DOXYGEN_PROJECT_NUMBER="$2"
+AC_SUBST(DOXYGEN_PROJECT_NAME)
+AC_SUBST(DOXYGEN_PROJECT_NUMBER)
+
+KDE_HAS_DOXYGEN=no
+if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
+  KDE_HAS_DOXYGEN=yes
+fi
+AC_SUBST(KDE_HAS_DOXYGEN)
+
+])
+
+
+AC_DEFUN([AC_FIND_BZIP2],
+[
+AC_MSG_CHECKING([for bzDecompress in libbz2])
+AC_CACHE_VAL(ac_cv_lib_bzip2,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#define BZ_NO_STDIO
+#include<bzlib.h>
+],
+            [ bz_stream s; (void) bzDecompress(&s); ],
+            eval "ac_cv_lib_bzip2='-lbz2'",
+            eval "ac_cv_lib_bzip2=no")
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+AC_MSG_RESULT($ac_cv_lib_bzip2)
+
+if test ! "$ac_cv_lib_bzip2" = no; then
+  BZIP2DIR=bzip2
+
+  LIBBZ2="$ac_cv_lib_bzip2"
+  AC_SUBST(LIBBZ2)
+
+else
+
+   cxx_shared_flag=
+   ld_shared_flag=
+   KDE_CHECK_COMPILER_FLAG(shared, [
+	ld_shared_flag="-shared"
+   ])
+   KDE_CHECK_COMPILER_FLAG(fPIC, [
+        cxx_shared_flag="-fPIC"
+   ])
+
+   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
+   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
+   [
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   kde_save_LIBS="$LIBS"
+   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
+   kde_save_CXXFLAGS="$CXXFLAGS"
+   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
+
+   AC_TRY_LINK(dnl
+   [
+   #define BZ_NO_STDIO
+   #include<bzlib.h>
+   ],
+               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
+               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
+               eval "ac_cv_lib_bzip2_prefix=no")
+   LIBS="$kde_save_LIBS"
+   CXXFLAGS="$kde_save_CXXFLAGS"
+   AC_LANG_RESTORE
+   ])dnl
+
+   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
+   
+   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
+     BZIP2DIR=bzip2
+    
+     LIBBZ2="$ac_cv_lib_bzip2_prefix"
+     AC_SUBST(LIBBZ2)
+
+     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
+   dnl else, we just ignore this
+   fi
+
+fi
+AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the SSL headers and libraries.
+dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
+dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([KDE_CHECK_SSL],
+[
+LIBSSL="-lssl -lcrypto"
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+ac_ssl_includes=NO ac_ssl_libraries=NO
+ssl_libraries=""
+ssl_includes=""
+AC_ARG_WITH(ssl-dir,
+    AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
+    [  ac_ssl_includes="$withval"/include
+       ac_ssl_libraries="$withval"/lib$kdelibsuff
+    ])
+
+want_ssl=yes
+AC_ARG_WITH(ssl,
+    AC_HELP_STRING([--without-ssl],[disable SSL checks]),
+    [want_ssl=$withval])
+
+if test $want_ssl = yes; then
+
+AC_MSG_CHECKING(for OpenSSL)
+
+AC_CACHE_VAL(ac_cv_have_ssl,
+[#try to guess OpenSSL locations
+  
+  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
+  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
+  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
+  ac_ssl_includes="$ssl_incdir"
+
+  ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
+  if test ! "$ac_ssl_libraries" = "NO"; then
+    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
+  fi
+
+  test=NONE
+  ssl_libdir=NONE
+  for dir in $ssl_libdirs; do
+    try="ls -1 $dir/libssl*"
+    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+
+  ac_ssl_libraries="$ssl_libdir"
+
+  ac_ldflags_safe="$LDFLAGS"
+  ac_libs_safe="$LIBS"
+
+  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
+  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
+
+  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
+  ac_ssl_rsaref="yes"
+  ,
+  ac_ssl_rsaref="no"
+  )
+
+  LDFLAGS="$ac_ldflags_safe"
+  LIBS="$ac_libs_safe"
+
+  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
+    have_ssl=no
+  else
+    have_ssl=yes;
+  fi
+
+  ])
+
+  eval "$ac_cv_have_ssl"
+
+  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
+
+  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
+  AC_MSG_RESULT($ac_ssl_rsaref)
+
+  AC_MSG_CHECKING([for easter eggs])
+  AC_MSG_RESULT([none found])
+
+else
+  have_ssl=no
+fi
+
+if test "$have_ssl" = yes; then
+  AC_MSG_CHECKING(for OpenSSL version)
+  dnl Check for SSL version
+  AC_CACHE_VAL(ac_cv_ssl_version,
+  [
+
+    cat >conftest.$ac_ext <<EOF
+#include <openssl/opensslv.h>
+#include <stdio.h>
+    int main() {
+ 
+#ifndef OPENSSL_VERSION_NUMBER
+      printf("ssl_version=\\"error\\"\n");
+#else
+      if (OPENSSL_VERSION_NUMBER < 0x00906000)
+        printf("ssl_version=\\"old\\"\n");
+      else
+        printf("ssl_version=\\"ok\\"\n");
+#endif
+     return (0);
+    }
+EOF
+
+    ac_save_CPPFLAGS=$CPPFLAGS
+    if test "$ac_ssl_includes" != "/usr/include"; then
+        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
+    fi
+
+    if AC_TRY_EVAL(ac_link); then 
+
+      if eval `./conftest 2>&5`; then
+        if test $ssl_version = error; then
+          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
+        else
+          if test $ssl_version = old; then
+            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
+            have_ssl=no
+          fi
+        fi
+        ac_cv_ssl_version="ssl_version=$ssl_version"
+      else
+        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
+        Check config.log, and if you can't figure it out, send a mail to 
+        David Faure <faure at kde.org>, attaching your config.log])
+      fi
+
+    else
+      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
+      Check config.log, and if you can't figure it out, send a mail to 
+      David Faure <faure at kde.org>, attaching your config.log])
+    fi 
+    CPPFLAGS=$ac_save_CPPFLAGS
+
+  ])
+
+  eval "$ac_cv_ssl_version"
+  AC_MSG_RESULT($ssl_version)
+fi
+
+if test "$have_ssl" != yes; then
+  LIBSSL="";
+else
+  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
+  ac_cv_have_ssl="have_ssl=yes \
+    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
+  
+  
+  ssl_libraries="$ac_ssl_libraries"
+  ssl_includes="$ac_ssl_includes"
+
+  if test "$ac_ssl_rsaref" = yes; then
+    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
+  fi
+
+  if test $ssl_version = "old"; then
+    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
+  fi
+fi
+
+SSL_INCLUDES=
+
+if test "$ssl_includes" = "/usr/include"; then
+  if test -f /usr/kerberos/include/krb5.h; then
+	SSL_INCLUDES="-I/usr/kerberos/include"
+  fi
+elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
+  SSL_INCLUDES="-I$ssl_includes"
+fi
+
+if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
+ SSL_LDFLAGS=""
+else
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
+fi
+
+AC_SUBST(SSL_INCLUDES)
+AC_SUBST(SSL_LDFLAGS)
+AC_SUBST(LIBSSL)
+])
+
+AC_DEFUN([KDE_CHECK_STRLCPY],
+[
+  AC_REQUIRE([AC_CHECK_STRLCAT])
+  AC_REQUIRE([AC_CHECK_STRLCPY])
+  AC_CHECK_SIZEOF(size_t)
+  AC_CHECK_SIZEOF(unsigned long)
+
+  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
+  AC_TRY_COMPILE(,[
+    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
+       choke me
+    #endif
+    ],AC_MSG_RESULT([yes]),[
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([
+       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
+       does not apply. Please mail kde-devel at kde.org with a description of your system!
+      ])
+  ])
+])
+
+AC_DEFUN([KDE_CHECK_BINUTILS],
+[
+  AC_MSG_CHECKING([if ld supports unversioned version maps])
+
+  kde_save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
+  AC_TRY_LINK([int foo;],
+[
+#ifdef __INTEL_COMPILER
+icc apparently does not support libtools version-info and version-script
+at the same time. Dunno where the bug is, but until somebody figured out,
+better disable the optional version scripts.
+#endif
+
+  foo = 42;
+], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
+  LDFLAGS="$kde_save_LDFLAGS"
+  rm -f conftest.map
+  AM_CONDITIONAL(include_VERSION_SCRIPT, 
+    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
+
+  AC_MSG_RESULT($kde_supports_versionmaps)
+])
+
+AC_DEFUN([AM_PROG_OBJC],[
+AC_CHECK_PROGS(OBJC, gcc, gcc)
+test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
+if test "x${OBJCFLAGS-unset}" = xunset; then
+   OBJCFLAGS="-g -O2"
+fi
+AC_SUBST(OBJCFLAGS)
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
+])
+
+AC_DEFUN([KDE_CHECK_PERL],
+[
+	KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
+		    AC_MSG_ERROR([No Perl found in your $PATH.
+We need perl to generate some code.])
+	])
+    AC_SUBST(PERL)
+])
+
+AC_DEFUN([KDE_CHECK_LARGEFILE],
+[
+AC_SYS_LARGEFILE
+if test "$ac_cv_sys_file_offset_bits" != no; then
+  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+fi
+
+if test "x$ac_cv_sys_large_files" != "xno"; then
+  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
+fi
+
+])
+
+dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
+dnl which allows to search for libs that get installed into the KDE prefix.
+dnl
+dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
+dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
+dnl also defines KSTUFF_PKG_ERRORS on error
+AC_DEFUN([KDE_PKG_CHECK_MODULES], [
+
+   PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+   if test "$prefix" != "$kde_libs_prefix"; then
+       PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+   fi
+   export PKG_CONFIG_PATH
+   PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
+])
+
+
+dnl Check for PIE support in the compiler and linker
+AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
+[
+  AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
+  [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    safe_CXXFLAGS=$CXXFLAGS
+    safe_LDFLAGS=$LDFLAGS
+    CXXFLAGS="$CXXFLAGS -fPIE"
+    LDFLAGS="$LDFLAGS -pie"
+
+    AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
+
+    CXXFLAGS=$safe_CXXFLAGS
+    LDFLAGS=$safe_LDFLAGS
+    AC_LANG_RESTORE
+  ])
+
+  AC_MSG_CHECKING(if enabling -pie/fPIE support)
+
+  AC_ARG_ENABLE(pie,
+    AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
+      [kde_has_pie_support=$enableval],
+      [kde_has_pie_support=detect])
+
+  if test "$kde_has_pie_support" = "detect"; then
+    kde_has_pie_support=$kde_cv_val_pie_support
+  fi
+
+  AC_MSG_RESULT([$kde_has_pie_support])
+
+  KDE_USE_FPIE=""
+  KDE_USE_PIE=""
+
+  AC_SUBST([KDE_USE_FPIE])
+  AC_SUBST([KDE_USE_PIE])
+
+  if test "$kde_has_pie_support" = "yes"; then
+    KDE_USE_FPIE="-fPIE"
+    KDE_USE_PIE="-pie"
+  fi
+])
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+	         [m4_ifdef([AC_PROVIDE_$1],
+		           [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "[$]0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      LINUX_64_MODE="32"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      LINUX_64_MODE="64"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  testring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+ *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
+	       = "XX$testring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      testring=$testring$testring
+    done
+    testring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
+    
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac  
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  AC_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+  
+mingw* | pw32*)
+  # win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='win32_libid'
+  ;;
+
+darwin* | rhapsody*)
+  # this will be overwritten by pass_all, but leave it in just in case
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.[[012]])
+    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case "$host_cpu" in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+  irix5* | nonstopux*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
+  arm* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+        ;;
+      *)
+	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	*/dev/null*)
+	  lt_cv_path_NM="$tmp_nm -p"
+	  break
+	  ;;
+	*)
+	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	  continue # so that we can try to find one that supports BSD flags
+	  ;;
+	esac
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!).  If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.[012])
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi  
+    ;;  
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_LD
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+	grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      # KDE requires run time linking.  Make it the default.
+      aix_use_runtimelinking=yes
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	fi
+      esac
+      shared_flag='-shared'
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	shared_flag='-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='-qmkshrobj ${wl}-G'
+	else
+	  shared_flag='-qmkshrobj'
+	fi
+      fi
+    fi
+
+    # Let the compiler handle the export list.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname.def;
+      else
+	echo EXPORTS > $output_objdir/$soname.def;
+	cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.[012])
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    else
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+    fi
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				# but as the default
+				# location of the library.
+
+    case $cc_basename in
+    CC)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	  ;;
+	esac
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	      ;;
+	    esac
+	  fi
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	# Archives containing C++ object files must be created using
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	runpath_var=LD_RUN_PATH
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	  echo "-hidden">> $lib.exp~
+	  $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# Archives containing C++ object files must be created using
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+
+	# The C++ compiler must be used to create the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  else
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	    # platform.
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  fi
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+	  || test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext|*.$libext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi  
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGISTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;; 
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+      runpath_var=LD_RUN_PATH
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	fi
+
+	# KDE requires run time linking.  Make it the default.
+	aix_use_runtimelinking=yes
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	esac
+	shared_flag='-shared'
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+  	if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='-qmkshrobj ${wl}-G'
+	  else
+	    shared_flag='-qmkshrobj'
+  	fi
+	fi
+      fi
+
+      # Let the compiler handle the export list.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi4*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      case "$host_os" in
+      rhapsody* | darwin1.[[012]])
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+	;;
+      *) # Darwin 1.3 on
+	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	else
+	  case ${MACOSX_DEPLOYMENT_TARGET} in
+	    10.[012])
+	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	      ;;
+	    10.*)
+	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	      ;;
+	  esac
+	fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    	else
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+      fi
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    else  
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi  
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	esac
+      else
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+  
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && break
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
diff --git a/lib-src/taglib/admin/Doxyfile.am b/lib-src/taglib/admin/Doxyfile.am
new file mode 100644
index 0000000..420b411
--- /dev/null
+++ b/lib-src/taglib/admin/Doxyfile.am
@@ -0,0 +1,102 @@
+## generate API documentation with doxygen
+apidox-am-yes:
+	@if test \! -d "$(top_srcdir)/doc/common/" && test -z "$$DOXDATA" ; then \
+		export DOXDATA=$(kde_libs_htmldir)/en/common ; \
+	fi ; \
+	abs_top_srcdir=`cd $(top_srcdir) && pwd` ;\
+	test -d $(top_builddir)/apidocs || \
+		( cd $(top_builddir) && sh $$abs_top_srcdir/admin/doxygen.sh \
+		--no-modulename --installdir=$(kde_libs_htmldir)/en \
+		--no-recurse $(abs_top_srcdir) . ) ; \
+	cd $(top_builddir) && sh $$abs_top_srcdir/admin/doxygen.sh \
+		--recurse --no-modulename --installdir=$(kde_libs_htmldir)/en \
+		$$abs_top_srcdir $(subdir)
+
+apidox-am-toplevel-yes:
+	@if test \! -d "$(top_srcdir)/doc/common/" && test -z "$$ADMIN" ; then \
+		export DOXDATA=$(kde_libs_htmldir)/en/common ; \
+	fi ; \
+	abs_top_srcdir=`cd $(top_srcdir) && pwd` ;\
+	cd $(top_builddir) && sh $$abs_top_srcdir/admin/doxygen.sh \
+		--no-modulename --installdir=$(kde_libs_htmldir)/en \
+		$$abs_top_srcdir
+
+## Don't generate API documentation without doxygen
+apidox-am-no:
+
+apidox-am-toplevel-no:
+
+
+apidox:
+	@if test "$(subdir)" != "."; then \
+		$(MAKE) apidox-am- at KDE_HAS_DOXYGEN@ ;\
+	else \
+		$(MAKE) apidox-am-toplevel- at KDE_HAS_DOXYGEN@ ;\
+	fi
+
+
+
+install-data-local: install-apidox
+
+## install API documentation
+install-apidox:
+	@if test "$(subdir)" != "."; then \
+		$(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html ; \
+		if test -f $(top_builddir)/apidocs/$(subdir)/$(subdir).tag; then \
+		echo $(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/$(subdir).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+		$(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/$(subdir).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+		fi; \
+		if test -d $(top_builddir)/apidocs/$(subdir)/html; then \
+			list=`ls $(top_builddir)/apidocs/$(subdir)/html`; \
+			echo "installing $(top_builddir)/apidocs/$(subdir)/html" ;\
+			for file in $$list; do \
+				$(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/html/$$file $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html; \
+		done; \
+		fi; \
+	else\
+		if test -d $(top_builddir)/apidocs; then \
+		$(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs ;\
+		list=`cd $(top_builddir)/apidocs && ls -1`; \
+		echo "installing $(top_builddir)/apidocs/$$file" ;\
+		echo "target directory $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs" ; \
+		for file in $$list; do \
+			if test -f $(top_builddir)/apidocs/$$file; then \
+				$(INSTALL_DATA) $(top_builddir)/apidocs/$$file $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
+			fi; \
+		done ; fi; \
+	fi
+
+uninstall-local: uninstall-apidox
+
+## uninstall API documentation
+uninstall-apidox:
+	@if test "$(subdir)" != "."; then \
+		if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); then \
+			rm -rf $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+		fi \
+	else \
+		if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; then \
+			rm -rf $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
+		fi \
+	fi
+
+install-apidox-recurse: install-apidox
+	@set fnord $(MAKEFLAGS); amf=$$2; if test -n '$(SUBDIRS)'; then \
+	    list='$(SUBDIRS)'; \
+	    for subdir in $$list; do \
+		if grep '^include .*Doxyfile.am' $(srcdir)/$$subdir/Makefile.am > /dev/null ; then \
+		echo "Installing apidox from $$subdir"; \
+		if test "$$subdir" != "."; then \
+			(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) GENERATE_FLAG=no install-apidox-recurse) || exit 1; \
+		fi ; fi ;\
+	    done; \
+	fi
+
+
+
+.PHONY: apidox-am-yes apidox-am-no install-data-local install-apidox install-apidox uninstall-local uninstall-apidox uninstall-apidox apidox apidox-am-toplevel-no apidox-am-toplevel-yes
+
+
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/lib-src/taglib/admin/Doxyfile.global b/lib-src/taglib/admin/Doxyfile.global
new file mode 100755
index 0000000..1b9f560
--- /dev/null
+++ b/lib-src/taglib/admin/Doxyfile.global
@@ -0,0 +1,192 @@
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = NO
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 4
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TESTLIST      = NO
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+QUIET                  = YES
+WARNINGS               = NO
+WARN_IF_UNDOCUMENTED   = NO
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = 
+WARN_LOGFILE           = 
+INPUT                  = 
+FILE_PATTERNS          = *.h \
+                         *.cpp \
+                         *.cc \
+                         *.hpp \
+                         *.dox \
+                         *.c++ \
+                         *.cxx \
+                         *.h++ \
+                         *.hh
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = *.moc.* \
+                         moc* \
+                         *.all_cpp.* \
+                         *unload.* \
+                         */test/* \
+                         */tests/* \
+                         *_p.h 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 3
+HTML_OUTPUT            = 
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = ../apidocs/common/header.html
+HTML_FOOTER            = ../apidocs/common/footer.html
+HTML_STYLESHEET        = ../apidocs/common/doxygen.css
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = YES
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = 
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+GENERATE_RTF           = NO
+RTF_OUTPUT             = 
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+GENERATE_MAN           = NO
+MAN_OUTPUT             = 
+MAN_EXTENSION          = .kde3
+MAN_LINKS              = YES
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = NO
+GENERATE_AUTOGEN_DEF   = NO
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+ENABLE_PREPROCESSING   = YES
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = QT_VERSION=320 \
+                         __cplusplus \
+                         Q_WS_X11
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = NO
+PERL_PATH              = 
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = NO
+HAVE_DOT               = NO
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 800
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+SEARCHENGINE           = NO
+
+### KDE Settings
+ALIASES = \
+	"intern=\par<b>Internal use only.</b>" \
+	"reimp=\par<b>Reimplemented from superclass.</b>" \
+	"obsolete=@deprecated" \
+	"feature=\xrefitem features \"Feature(s)\" \"Features\"" \
+	"maintainer=\xrefitem maintainers \"Maintainer(s)\" \"Maintainers\"" \
+	"unmaintained=\xrefitem unmaintained \"Unmaintained\" \"Unmaintained\"" \
+	"requirement=\xrefitem requirements \"Requirement(s)\" \"Requirements\"" \
+	"faq=\xrefitem FAQ \"F.A.Q.\" \"F.A.Q.\"" \
+	"authors=\xrefitem authors \"Author(s)\" \"Authors\"" \
+	"FIXME=\xrefitem fixme \"Fixme\" \"Fixme\""
+
+HTML_ALIGN_MEMBERS     = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+VERBATIM_HEADERS       = NO
+GENERATE_HTML          = YES
+SOURCE_BROWSER         = YES
+GENERATE_AUTOGEN_DEF   = NO
+DETAILS_AT_TOP         = YES
+SORT_MEMBER_DOCS       = YES
+GENERATE_TODOLIST      = YES
+IGNORE_PREFIX          = K
+GENERATE_HTML          = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = NO
+
+
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+
diff --git a/lib-src/taglib/admin/Makefile.common b/lib-src/taglib/admin/Makefile.common
new file mode 100644
index 0000000..d07b404
--- /dev/null
+++ b/lib-src/taglib/admin/Makefile.common
@@ -0,0 +1,37 @@
+### Makefile.common
+###
+### Copyright (C) 2002 by the KDE developers
+
+### All the real work is done by the shellscript cvs.sh
+
+SHELL=/bin/sh
+
+cvs dist configure configure.in configure.files subdirs package-messages package-merge Makefile.am acinclude.m4 extract-messages:
+	@admindir=$(admindir); \
+	if test "x$$admindir" = x; then \
+	  admindir=.; until test -f $$admindir/admin/cvs.sh; do \
+	    admindir=$$admindir/..; \
+	    if test `cd $$admindir && pwd` = / ; then break; fi; \
+	  done; \
+	  admindir=$$admindir/admin; \
+	  if test -f $$admindir/cvs.sh; then :; else \
+	    echo "Can't find the admin/ directory in any parent of the"; \
+	    echo "current directory.  Please set it with admindir=..."; \
+	    exit 1; \
+	  fi; \
+	fi; \
+	if test "$@" = "package-merge"; then \
+		MAKE="$(MAKE)" POFILES="$(POFILES)" PACKAGE="$(PACKAGE)" \
+	  	$(SHELL) $$admindir/cvs.sh package-merge ;\
+	else \
+		MAKE="$(MAKE)" $(SHELL) $$admindir/cvs.sh $@ ;\
+	fi
+
+configure.in: configure.files subdirs
+configure.files: subdirs
+
+svn: cvs
+
+.SILENT:
+
+.PHONY: svn cvs dist package-merge package-messages
diff --git a/lib-src/taglib/admin/acinclude.m4.in b/lib-src/taglib/admin/acinclude.m4.in
new file mode 100644
index 0000000..c37d92b
--- /dev/null
+++ b/lib-src/taglib/admin/acinclude.m4.in
@@ -0,0 +1,5999 @@
+##   -*- autoconf -*-
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum at shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo at kde.org)
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl    Boston, MA 02110-1301, USA.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository. 
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+# KDE_PATH_X_DIRECT
+dnl Internal subroutine of AC_PATH_X.
+dnl Set ac_x_includes and/or ac_x_libraries.
+AC_DEFUN([KDE_PATH_X_DIRECT],
+[
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+AC_TRY_CPP([#include <$x_direct_test_include>],
+[# We can compile using X headers with no special include directory.
+ac_x_includes=],
+[# Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done])
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
+[LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=],
+[LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
+    /usr/X11/lib${kdelibsuff}           \
+    /usr/X11R6/lib${kdelibsuff}         \
+    /usr/X11R5/lib${kdelibsuff}         \
+    /usr/X11R4/lib${kdelibsuff}         \
+                                        \
+    /usr/lib${kdelibsuff}/X11           \
+    /usr/lib${kdelibsuff}/X11R6         \
+    /usr/lib${kdelibsuff}/X11R5         \
+    /usr/lib${kdelibsuff}/X11R4         \
+                                        \
+    /usr/local/X11/lib${kdelibsuff}     \
+    /usr/local/X11R6/lib${kdelibsuff}   \
+    /usr/local/X11R5/lib${kdelibsuff}   \
+    /usr/local/X11R4/lib${kdelibsuff}   \
+                                        \
+    /usr/local/lib${kdelibsuff}/X11     \
+    /usr/local/lib${kdelibsuff}/X11R6   \
+    /usr/local/lib${kdelibsuff}/X11R5   \
+    /usr/local/lib${kdelibsuff}/X11R4   \
+                                        \
+    /usr/X386/lib${kdelibsuff}          \
+    /usr/x386/lib${kdelibsuff}          \
+    /usr/XFree86/lib${kdelibsuff}/X11   \
+                                        \
+    /usr/lib${kdelibsuff}               \
+    /usr/local/lib${kdelibsuff}         \
+    /usr/unsupported/lib${kdelibsuff}   \
+    /usr/athena/lib${kdelibsuff}        \
+    /usr/local/x11r5/lib${kdelibsuff}   \
+    /usr/lpp/Xamples/lib${kdelibsuff}   \
+    /lib/usr/lib${kdelibsuff}/X11       \
+                                        \
+    /usr/openwin/lib${kdelibsuff}       \
+    /usr/openwin/share/lib${kdelibsuff} \
+    ; \
+do
+dnl Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done])
+fi # $ac_x_libraries = NO
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_FIND_FILE],
+[
+$3=NO
+for i in $2;
+do
+  for j in $1;
+  do
+    echo "configure: __oline__: $i/$j" >&AC_FD_CC
+    if test -r "$i/$j"; then
+      echo "taking that" >&AC_FD_CC
+      $3=$i
+      break 2
+    fi
+  done
+done
+])
+
+dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
+dnl	if-not-found, test-parameter, prepend-path)
+dnl
+dnl Look for program-name in list-of-dirs+$PATH.
+dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
+dnl If found, $variable-name is set. If not, if-not-found is evaluated.
+dnl test-parameter: if set, the program is executed with this arg,
+dnl                 and only a successful exit code is required.
+AC_DEFUN([KDE_FIND_PATH],
+[
+   AC_MSG_CHECKING([for $1])
+   if test -n "$$2"; then
+        kde_cv_path="$$2";
+   else
+        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+        AC_CACHE_VAL(kde_cv_path_$kde_cache,
+        [
+        kde_cv_path="NONE"
+	kde_save_IFS=$IFS
+	IFS=':'
+	dirs=""
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+	done
+	if test -z "$6"; then  dnl Append dirs in PATH (default)
+	  dirs="$3 $dirs"
+        else  dnl Prepend dirs in PATH (if 6th arg is set)
+	  dirs="$dirs $3"
+	fi
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/$1"; then
+	    if test -n "$5"
+	    then
+              evalstr="$dir/$1 $5 2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/$1"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/$1"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        ])
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      AC_MSG_RESULT(not found)
+      $4
+   else
+      AC_MSG_RESULT($kde_cv_path)
+      $2=$kde_cv_path
+
+   fi
+])
+
+AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
+[
+    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
+[
+    AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+
+AC_DEFUN([KDE_CHECK_UIC_FLAG],
+[
+    AC_MSG_CHECKING([whether uic supports -$1 ])
+    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
+    [
+        cat >conftest.ui <<EOT
+        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
+EOT
+        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
+        if AC_TRY_EVAL(ac_uic_testrun); then
+            eval "kde_cv_prog_uic_$kde_cache=yes"
+        else
+            eval "kde_cv_prog_uic_$kde_cache=no"
+        fi
+        rm -f conftest*
+    ])
+
+    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
+        AC_MSG_RESULT([yes])
+        :
+        $3
+    else
+        AC_MSG_RESULT([no])
+        :
+        $4
+    fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_MOC_UIC],
+[
+   AC_REQUIRE([KDE_CHECK_PERL])
+   qt_bindirs=""
+   for dir in $kde_qt_dirs; do
+      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir $qt_bindirs"
+   fi
+
+   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+   if test -z "$UIC_NOT_NEEDED"; then
+     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
+     if test -z "$UIC_PATH" ; then
+       KDE_UIC_ERROR_MESSAGE
+       exit 1
+     else
+       UIC=$UIC_PATH
+
+       if test $kde_qtver = 3; then
+         KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
+         KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
+
+         if test x$ac_uic_supports_libpath = xyes; then
+             UIC="$UIC -L \$(kde_widgetdir)"
+         fi
+         if test x$ac_uic_supports_nounload = xyes; then
+             UIC="$UIC -nounload"
+         fi
+       fi
+     fi
+   else
+     UIC="echo uic not available: "
+   fi
+
+   AC_SUBST(MOC)
+   AC_SUBST(UIC)
+
+   UIC_TR="i18n"
+   if test $kde_qtver = 3; then
+     UIC_TR="tr2i18n"
+   fi
+
+   AC_SUBST(UIC_TR)
+])
+
+AC_DEFUN([KDE_1_CHECK_PATHS],
+[
+  KDE_1_CHECK_PATH_HEADERS
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN([KDE_SET_PATHS],
+[
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_kcfgdir=\"$kde_kcfgdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_styledir=\"$kde_styledir\" \
+	kde_widgetdir=\"$kde_widgetdir\" \
+	xdg_appsdir=\"$xdg_appsdir\" \
+	xdg_menudir=\"$xdg_menudir\" \
+	xdg_directorydir=\"$xdg_directorydir\" \
+	kde_result=$1"
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_PATHS],
+[
+if test "$1" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${datadir}/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${datadir}/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${datadir}/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${datadir}/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${datadir}/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${datadir}/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${datadir}/config'
+  fi
+  if test -z "$kde_kcfgdir"; then
+    kde_kcfgdir='\${datadir}/config.kcfg'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${datadir}/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${datadir}/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${datadir}/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${datadir}/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${datadir}/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${datadir}/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    if test "$kde_qtver" = "2"; then
+      kde_moduledir='\${libdir}/kde2'
+    else
+      kde_moduledir='\${libdir}/kde3'
+    fi
+  fi
+  if test -z "$kde_styledir"; then
+    kde_styledir='\${libdir}/kde3/plugins/styles'
+  fi
+  if test -z "$kde_widgetdir"; then
+    kde_widgetdir='\${libdir}/kde3/plugins/designer'
+  fi
+  if test -z "$xdg_appsdir"; then
+    xdg_appsdir='\${datadir}/applications/kde'
+  fi
+  if test -z "$xdg_menudir"; then
+    xdg_menudir='\${sysconfdir}/xdg/menus'
+  fi
+  if test -z "$xdg_directorydir"; then
+    xdg_directorydir='\${datadir}/desktop-directories'
+  fi
+
+  KDE_SET_PATHS(defaults)
+
+else
+
+  if test $kde_qtver = 1; then
+     AC_MSG_RESULT([compiling])
+     KDE_1_CHECK_PATHS
+  else
+     AC_MSG_ERROR([path checking not yet supported for KDE 2])
+  fi
+
+fi
+])
+
+AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_kcfgdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test -z "$kde_styledir" || test -z "kde_widgetdir" ||
+   test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
+   test "x$kde_have_all_paths" != "xyes"; then
+     kde_have_all_paths=no
+  fi
+])
+
+AC_DEFUN([KDE_MISSING_PROG_ERROR],
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN([KDE_MISSING_ARTS_ERROR],
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed aRts correctly or use
+--without-arts to compile without aRts support (this will remove functionality).
+])
+])
+
+AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
+[
+    kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
+    test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
+    if test -n "$KDEDIRS"; then
+       kde_save_IFS=$IFS
+       IFS=:
+       for dir in $KDEDIRS; do
+            kde_default_bindirs="$dir/bin $kde_default_bindirs "
+       done
+       IFS=$kde_save_IFS
+    fi
+])
+
+AC_DEFUN([KDE_SUBST_PROGRAMS],
+[
+    AC_ARG_WITH(arts,
+        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
+        [build_arts=$withval],
+        [build_arts=yes]
+    )
+    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
+    if test "$build_arts" = "no"; then
+        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
+    fi
+
+        KDE_SET_DEFAULT_BINDIRS
+        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
+        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+        if test "$build_arts" '!=' "no"; then
+          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
+          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
+        fi
+        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
+
+        kde32ornewer=1
+        kde33ornewer=1
+        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
+            kde32ornewer=
+            kde33ornewer=
+        else
+            if test "$kde_qtver" = "3"; then
+              if test "$kde_qtsubver" -le 1; then
+                kde32ornewer=
+              fi
+              if test "$kde_qtsubver" -le 2; then
+                kde33ornewer=
+              fi
+              if test "$KDECONFIG" != "compiled"; then
+                if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
+                  kde33ornewer=
+                fi
+              fi
+            fi
+        fi
+
+        if test -n "$kde32ornewer"; then
+            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
+            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
+        fi
+        if test -n "$kde33ornewer"; then
+            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
+            AC_SUBST(MAKEKDEWIDGETS)
+        fi
+        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
+
+        if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
+ 	    kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
+            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
+            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
+	    if test "$KDE_XSL_STYLESHEET" = "NO"; then
+		KDE_XSL_STYLESHEET=""
+	    else
+                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
+	    fi
+        fi
+
+        DCOP_DEPENDENCIES='$(DCOPIDL)'
+        if test -n "$kde32ornewer"; then
+            KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
+            DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
+            AC_SUBST(KCONFIG_COMPILER)
+            AC_SUBST(KCFG_DEPENDENCIES)
+            AC_SUBST(DCOPIDLNG)
+        fi
+        AC_SUBST(DCOPIDL)
+        AC_SUBST(DCOPIDL2CPP)
+        AC_SUBST(DCOP_DEPENDENCIES)
+        AC_SUBST(MCOPIDL)
+        AC_SUBST(ARTSCCONFIG)
+	AC_SUBST(MEINPROC)
+ 	AC_SUBST(KDE_XSL_STYLESHEET)
+	AC_SUBST(XMLLINT)
+])dnl
+
+AC_DEFUN([AC_CREATE_KFSSTND],
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+  KDE_SET_DEFAULT_PATHS($1)
+  kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+  # wrong values were cached, may be, we can set better ones
+  kde_result=
+  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
+  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+  kde_have_all_paths=
+  kde_styledir=
+  kde_widgetdir=
+  xdg_appsdir = xdg_menudir= xdg_directorydir= 
+  KDE_SET_DEFAULT_PATHS($1)
+  eval "$kde_cv_all_paths"
+  KDE_CHECK_PATHS_FOR_COMPLETENESS
+  kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+  rm -f conftest*
+  AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN([AC_SUBST_KFSSTND],
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_kcfgdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl X Desktop Group standards
+AC_SUBST(xdg_appsdir)
+AC_SUBST(xdg_menudir)
+AC_SUBST(xdg_directorydir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+AC_SUBST(kdeinitdir, '$(kde_moduledir)')
+AC_SUBST(kde_styledir)
+AC_SUBST(kde_widgetdir)
+if test "$kde_qtver" = 1; then
+  kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+  kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN([KDE_MISC_TESTS],
+[
+   dnl Checks for libraries.
+   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
+   AC_SUBST(LIBUTIL)
+   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
+   AC_SUBST(LIBCOMPAT)
+   kde_have_crypt=
+   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+	kde_have_crypt=no
+      ]))
+   AC_SUBST(LIBCRYPT)
+   if test $kde_have_crypt = yes; then
+      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+   fi
+   AC_CHECK_SOCKLEN_T
+   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+   fi
+   AC_CHECK_FUNC(inet_ntoa)
+   if test $ac_cv_func_inet_ntoa = no; then
+     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+   fi
+   AC_CHECK_FUNC(connect)
+   if test $ac_cv_func_connect = no; then
+      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+        $X_EXTRA_LIBS)
+   fi
+
+   AC_CHECK_FUNC(remove)
+   if test $ac_cv_func_remove = no; then
+      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+   fi
+
+   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+   AC_CHECK_FUNC(shmat, ,
+     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+   
+   # more headers that need to be explicitly included on darwin
+   AC_CHECK_HEADERS(sys/types.h stdint.h)
+
+   # sys/bitypes.h is needed for uint32_t and friends on Tru64
+   AC_CHECK_HEADERS(sys/bitypes.h)
+
+   # darwin requires a poll emulation library
+   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
+
+   # for some image handling on Mac OS X
+   AC_CHECK_HEADERS(Carbon/Carbon.h)
+
+   # CoreAudio framework
+   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
+     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
+     FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
+   ])
+
+   AC_CHECK_RES_INIT
+   AC_SUBST(LIB_POLL)
+   AC_SUBST(FRAMEWORK_COREAUDIO)
+   LIBSOCKET="$X_EXTRA_LIBS"
+   AC_SUBST(LIBSOCKET)
+   AC_SUBST(X_EXTRA_LIBS)
+   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+   AC_SUBST(LIBUCB)
+
+   case $host in  dnl this *is* LynxOS specific
+   *-*-lynxos* )
+        AC_MSG_CHECKING([LynxOS header file wrappers])
+        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+        AC_MSG_RESULT(disabled)
+        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+         ;;
+    esac
+
+   KDE_CHECK_TYPES
+   KDE_CHECK_LIBDL
+   KDE_CHECK_STRLCPY
+   KDE_CHECK_PIE_SUPPORT
+
+# darwin needs this to initialize the environment
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
+ 
+AH_VERBATIM(_DARWIN_ENVIRON,
+[
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+])
+
+AH_VERBATIM(_AIX_STRINGS_H_BZERO,
+[
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+])
+
+AC_CHECK_FUNCS([vsnprintf snprintf])
+
+AH_VERBATIM(_TRU64,[
+/*
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
+ */
+
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
+#if __STDC__
+#include <stdarg.h>
+#include <stdlib.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
+#ifdef __cplusplus
+extern "C"
+#endif
+int snprintf(char *str, size_t n, char const *fmt, ...);
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([K_PATH_X],
+[
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_ARG_ENABLE(
+  embedded,
+  AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
+  kde_use_qt_emb=$enableval,
+  kde_use_qt_emb=no
+)
+
+AC_ARG_ENABLE(
+  qtopia,
+  AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
+  kde_use_qt_emb_palm=$enableval,
+  kde_use_qt_emb_palm=no
+)
+
+AC_ARG_ENABLE(
+  mac,
+  AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
+  kde_use_qt_mac=$enableval,
+  kde_use_qt_mac=no
+)
+
+# used to disable x11-specific stuff on special platforms
+AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
+
+if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
+
+AC_MSG_CHECKING(for X)
+
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+   kde_x_includes=NO
+else
+   kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+   kde_x_libraries=NO
+else
+   kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+KDE_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
+dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
+dnl x_includes should be left alone.
+case "$host" in
+mips-sgi-irix6*)
+  ;;
+*-*-solaris*)
+  ;;
+*)
+  _AC_PATH_X_XMKMF
+  if test -z "$ac_x_includes"; then
+    ac_x_includes="."
+  fi
+  if test -z "$ac_x_libraries"; then
+    ac_x_libraries="/usr/lib${kdelibsuff}"
+  fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+  kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+  kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+  AC_MSG_RESULT($have_x)
+  no_x=yes
+else
+  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+  X_INCLUDES=""
+  x_includes="."; dnl better than nothing :-
+ else
+  x_includes=$kde_x_includes
+  X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
+  X_LDFLAGS=""
+  x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+  x_libraries=$kde_x_libraries
+  X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols.  So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+#  --interran at uluru.Stanford.EDU, kb at cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+LDFLAGS="$ac_save_LDFLAGS"
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+)
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+LIB_XEXT="-lXext"
+QTE_NORTTI=""
+
+elif test "$kde_use_qt_emb" = "yes"; then
+  dnl We're using QT Embedded
+  CPPFLAGS=-DQWS
+  CXXFLAGS="$CXXFLAGS -fno-rtti"
+  QTE_NORTTI="-fno-rtti -DQWS"
+  X_PRE_LIBS=""
+  LIB_X11=""
+  LIB_XEXT=""
+  LIB_XRENDER=""
+  LIBSM=""
+  X_INCLUDES=""
+  X_LDFLAGS=""
+  x_includes=""
+  x_libraries=""
+elif test "$kde_use_qt_mac" = "yes"; then
+  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
+  dnl be included to get the information) --Sam
+  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
+  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
+  X_PRE_LIBS=""
+  LIB_X11=""
+  LIB_XEXT=""
+  LIB_XRENDER=""
+  LIBSM=""
+  X_INCLUDES=""
+  X_LDFLAGS=""
+  x_includes=""
+  x_libraries=""
+fi
+AC_SUBST(X_PRE_LIBS)
+AC_SUBST(LIB_X11)
+AC_SUBST(LIB_XRENDER)
+AC_SUBST(LIBSM)
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_includes)
+AC_SUBST(x_libraries)
+AC_SUBST(QTE_NORTTI)
+AC_SUBST(LIB_XEXT)
+
+])
+
+AC_DEFUN([KDE_PRINT_QT_PROGRAM],
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#if QT_VERSION < 210
+#error 1
+#endif
+EOF
+fi
+fi
+
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+    Q_UNUSED(t);
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+EOF
+fi
+fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+    (void)QStyleFactory::create(QString::null);
+    QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+])
+
+AC_DEFUN([KDE_USE_QT],
+[
+if test -z "$1"; then
+  # Current default Qt version: 3.3
+  kde_qtver=3
+  kde_qtsubver=3
+else
+  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
+  # following is the check if subversion isnt found in passed argument
+  if test "$kde_qtsubver" = "$1"; then
+    kde_qtsubver=1
+  fi
+  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
+  if test "$kde_qtver" = "1"; then
+    kde_qtsubver=42
+  fi
+fi
+
+if test -z "$2"; then
+  if test "$kde_qtver" = "2"; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_minversion=">= Qt 2.2.2"
+    else
+      kde_qt_minversion=">= Qt 2.0.2"
+    fi
+  fi
+  if test "$kde_qtver" = "3"; then
+    if test $kde_qtsubver -gt 0; then
+	 if test $kde_qtsubver -gt 1; then
+	    if test $kde_qtsubver -gt 2; then
+		kde_qt_minversion=">= Qt 3.3 and < 4.0"
+	    else
+	        kde_qt_minversion=">= Qt 3.2 and < 4.0"
+	    fi
+	 else
+            kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
+         fi
+    else
+      kde_qt_minversion=">= Qt 3.0 and < 4.0"
+    fi
+  fi
+  if test "$kde_qtver" = "1"; then
+    kde_qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   kde_qt_minversion="$2"
+fi
+
+if test -z "$3"; then
+   if test $kde_qtver = 3; then
+     if test $kde_qtsubver -gt 0; then
+       kde_qt_verstring="QT_VERSION >= 0x03 at VER@00 && QT_VERSION < 0x040000"
+       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
+       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s, at VER@,$qtsubver,"`
+     else
+       kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
+     fi
+   fi
+   if test $kde_qtver = 2; then
+     if test $kde_qtsubver -gt 0; then
+       kde_qt_verstring="QT_VERSION >= 222"
+     else
+       kde_qt_verstring="QT_VERSION >= 200"
+     fi
+   fi
+   if test $kde_qtver = 1; then
+    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+   fi
+else
+   kde_qt_verstring="$3"
+fi
+
+if test $kde_qtver = 4; then
+  kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
+fi
+if test $kde_qtver = 3; then
+  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3 /usr/lib${kdelibsuff}/qt-3.3"
+  if test -z "$PKG_CONFIG"; then
+      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+  if test "$PKG_CONFIG" != "no" ; then
+    if $PKG_CONFIG --exists qt-mt ; then
+       kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix qt-mt`"
+    fi
+  fi
+fi
+if test $kde_qtver = 2; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+fi
+if test $kde_qtver = 1; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN([KDE_CHECK_QT_DIRECT],
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+else
+LIBS="$LIBQT $LIBSOCKET"
+fi
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  kde_cv_qt_direct="yes"
+else
+  kde_cv_qt_direct="no"
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+  AC_MSG_RESULT(yes)
+  $1
+else
+  AC_MSG_RESULT(no)
+  $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_PATH_QT_1_3],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  mt,
+  AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
+  kde_use_qt_mt=$enableval,
+  [
+    if test $kde_qtver = 3; then
+      kde_use_qt_mt=yes
+    else
+      kde_use_qt_mt=no
+    fi
+  ]
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
+if test "x$kde_use_qt_mt" = "xyes"; then
+  KDE_CHECK_THREADING
+  if test "x$kde_use_threading" = "xyes"; then
+    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
+    KDE_MT_LDFLAGS="$USE_THREADS"
+    KDE_MT_LIBS="$LIBPTHREAD"
+  else
+    kde_use_qt_mt=no
+  fi
+fi
+AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+if test -z "$LIBQT_GLOB"; then
+  if test "x$kde_use_qt_emb" = "xyes"; then
+    LIBQT_GLOB="libqte.*"
+  else
+    LIBQT_GLOB="libqt.*"
+  fi
+fi
+
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+if test "x$kde_use_qt_emb" = "xyes"; then
+  qtlib="qte"
+else
+  qtlib="qt"
+fi
+
+kde_int_qt="-l$qtlib"
+
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+  if test "x$kde_use_qt_emb" = "xyes"; then
+    if test "x$kde_use_qt_emb_palm" = "xyes"; then
+      LIB_QPE="-lqpe"
+    else
+      LIB_QPE=""
+    fi
+  else
+    LIB_QPE=""
+  fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+  LIBQT="-l$qtlib-mt"
+  kde_int_qt="-l$qtlib-mt"
+  LIBQT_GLOB="lib$qtlib-mt.*"
+  USING_QT_MT="using -mt"
+else
+  LIBQT="-l$qtlib"
+fi
+
+if test $kde_qtver != 1; then
+
+  AC_REQUIRE([AC_FIND_PNG])
+  AC_REQUIRE([AC_FIND_JPEG])
+  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+if test $kde_qtver = 3; then
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+  LIBQT="$LIBQT $LIBDL"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+fi
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+    AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
+    [  ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib${kdelibsuff}
+       ac_qt_bindir="$withval"/bin
+    ])
+
+AC_ARG_WITH(qt-includes,
+    AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
+    [
+       ac_qt_includes="$withval"
+    ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+    AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
+    [  ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+fi
+if test "$PKG_CONFIG" != "no" ; then
+  if $PKG_CONFIG --exists qt-mt ; then
+      qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir qt-mt`"
+  fi
+fi
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" != "1"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir/lib $dir"
+done
+if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+fi
+if test "$PKG_CONFIG" != "no" ; then
+  if $PKG_CONFIG --exists qt-mt ; then
+      qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir qt-mt`"
+  fi
+fi
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+fi
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+    LIBQT="$LIBQT ${kde_int_qt}_incremental"
+    break
+  fi
+done
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  missing_qt_mt=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    if test "x$kde_use_qt_mt" = "xyes"; then
+       missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+       ac_qt_notfound="(library $qtlib-mt)";
+    else
+       ac_qt_notfound="(library $qtlib)";
+    fi
+  fi
+
+  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.$missing_qt_mt])
+else
+  have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  AC_MSG_RESULT([$have_qt]);
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
+     KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES=""
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$QT_LDFLAGS $all_libraries"
+fi
+test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+KDE_CHECK_QT_JPEG
+
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
+else
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
+fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
+     break
+  fi
+done
+
+AC_SUBST(LIB_QT)
+AC_SUBST(LIB_QPE)
+
+AC_SUBST(kde_qtver)
+])
+
+AC_DEFUN([AC_PATH_QT],
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
+[
+AC_REQUIRE([AC_PATH_QT_MOC_UIC])
+
+if test x$ac_uic_supports_libpath = xyes; then
+
+AC_MSG_CHECKING([if UIC has KDE plugins available])
+AC_CACHE_VAL(kde_cv_uic_plugins,
+[
+cat > actest.ui << EOF
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewConnectionDialog</class>
+<widget class="QDialog">
+   <widget class="KLineEdit">
+        <property name="name">
+           <cstring>testInput</cstring>
+        </property>
+   </widget>
+</widget>
+</UI>
+EOF
+       
+
+
+kde_cv_uic_plugins=no
+kde_line="$UIC_PATH -L $kde_widgetdir"
+if test x$ac_uic_supports_nounload = xyes; then
+   kde_line="$kde_line -nounload"
+fi
+kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
+if AC_TRY_EVAL(kde_line); then
+	# if you're trying to debug this check and think it's incorrect,
+	# better check your installation. The check _is_ correct - your
+	# installation is not.
+	if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
+		kde_cv_uic_plugins=yes
+	fi
+fi
+rm -f actest.ui actest.cpp
+])
+
+AC_MSG_RESULT([$kde_cv_uic_plugins])
+if test "$kde_cv_uic_plugins" != yes; then
+	AC_MSG_ERROR([
+you need to install kdelibs first.
+
+If you did install kdelibs, then the Qt version that is picked up by
+this configure is not the same version you used to compile kdelibs. 
+The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the 
+_same Qt version_, compiled with the _same compiler_ and the same Qt
+configuration settings.
+])
+fi
+fi
+])
+
+AC_DEFUN([KDE_CHECK_FINAL],
+[
+  AC_ARG_ENABLE(final,
+	AC_HELP_STRING([--enable-final],
+		       [build size optimized apps (experimental - needs lots of memory)]),
+	kde_use_final=$enableval, kde_use_final=no)
+
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_FINAL_TRUE)
+  AC_SUBST(KDE_USE_FINAL_FALSE)
+])
+
+AC_DEFUN([KDE_CHECK_CLOSURE],
+[
+  AC_ARG_ENABLE(closure,
+		AC_HELP_STRING([--enable-closure],[delay template instantiation]),
+  	kde_use_closure=$enableval, kde_use_closure=no)
+
+  KDE_NO_UNDEFINED=""
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+       KDE_NO_UNDEFINED=""
+       case $host in 
+         *-*-linux-gnu)
+           KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
+                [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
+		[KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
+		[KDE_NO_UNDEFINED=""])],
+	    [KDE_NO_UNDEFINED=""])
+           ;;
+       esac
+  fi
+  AC_SUBST(KDE_USE_CLOSURE_TRUE)
+  AC_SUBST(KDE_USE_CLOSURE_FALSE)
+  AC_SUBST(KDE_NO_UNDEFINED)
+])
+
+dnl Check if the linker supports --enable-new-dtags and --as-needed
+AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
+[
+  AC_ARG_ENABLE(new_ldflags,
+		AC_HELP_STRING([--enable-new-ldflags],
+		[enable the new linker flags]),
+	kde_use_new_ldflags=$enableval, 
+	kde_use_new_ldflags=no)
+
+  LDFLAGS_AS_NEEDED=""
+  LDFLAGS_NEW_DTAGS=""
+  if test "x$kde_use_new_ldflags" = "xyes"; then
+       LDFLAGS_NEW_DTAGS=""
+       KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
+		[LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
+
+       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
+		[LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
+  fi
+  AC_SUBST(LDFLAGS_AS_NEEDED)
+  AC_SUBST(LDFLAGS_NEW_DTAGS)
+])
+
+AC_DEFUN([KDE_CHECK_NMCHECK],
+[
+  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
+	kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
+
+  if test "$kde_use_nmcheck" = "yes"; then
+      KDE_USE_NMCHECK_TRUE=""
+      KDE_USE_NMCHECK_FALSE="#"
+   else
+      KDE_USE_NMCHECK_TRUE="#"
+      KDE_USE_NMCHECK_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_NMCHECK_TRUE)
+  AC_SUBST(KDE_USE_NMCHECK_FALSE)
+])
+
+AC_DEFUN([KDE_EXPAND_MAKEVAR], [
+savex=$exec_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+tmp=$$2
+while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
+exec_prefix=$savex
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_BASE_PATH_KDE],
+[
+AC_REQUIRE([KDE_CHECK_STL])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+  kde_includes=${includedir}
+  KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
+
+  kde_libraries=${libdir}
+  KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
+
+else
+  ac_kde_includes=
+  ac_kde_libraries=
+  kde_libraries=""
+  kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+  kde_check_header="ksock.h"
+  kde_check_lib="libkdecore.la"
+else
+  kde_check_header="ksharedptr.h"
+  kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+  AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+kde_widgetdir=NO
+dnl this might be somewhere else
+AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
+AC_MSG_ERROR([
+I can't find the designer plugins. These are required and should have been installed
+by kdelibs])
+fi
+
+if test -n "$kde_widgetdir"; then
+    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
+fi
+
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
+  ac_cv_have_kde="have_kde=no"
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1, e.g. from kdelibs
+
+  ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+  ac_kde_prefix="$ac_default_prefix"
+ else
+  ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+  ac_kde_exec_prefix="$ac_kde_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+  ac_kde_exec_prefix="$exec_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${libdir}"
+ kde_includes="${includedir}"
+
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+  kde_libraries="$ac_kde_libraries"
+  kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+
+KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
+ 
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
+ all_libraries="$KDE_LDFLAGS $all_libraries"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+if test -z "$1"; then
+KDE_CHECK_UIC_PLUGINS
+fi
+
+ac_kde_libraries="$kde_libdir"
+
+AC_SUBST(AUTODIRS)
+
+
+])
+
+AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
+  kde_use_extra_includes="$withval",
+  kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+   test "$kde_use_extra_includes" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_includes; do
+     kde_extra_includes="$kde_extra_includes $dir"
+     USER_INCLUDES="$USER_INCLUDES -I$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_includes="added"
+else
+   kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
+  kde_use_extra_libs=$withval,
+  kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+   test "$kde_use_extra_libs" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_libs; do
+     kde_extra_libs="$kde_extra_libs $dir"
+     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_libs="added"
+else
+   kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
+[
+    AC_MSG_CHECKING([for KDE headers installed])
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    printf("kde_styledir=\\"/tmp/dummy\\"\n");
+    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
+    printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
+    printf("xdg_menudir=\\"/tmp/dummy\\"\n");
+    printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
+    printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$all_includes $CPPFLAGS"
+ if AC_TRY_EVAL(ac_compile); then
+   AC_MSG_RESULT(yes)
+ else
+   AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+  fi
+  CPPFLAGS=$ac_save_CPPFLAGS
+
+  AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_CHECK_KDEQTADDON],
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+   #include <qdom.h>
+ ],
+ [
+   QDomDocument doc;
+ ],
+  kde_cv_have_kdeqtaddon=yes,
+  kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ CXXFLAGS=$kde_cxxflags_safe
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
+[
+   AC_REQUIRE([KDE_MISC_TESTS])
+   AC_REQUIRE([KDE_CHECK_LIBDL])
+   AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 3; then
+   case $host in 
+               *cygwin*) lib_kded="-lkdeinit_kded" ;;
+               *) lib_kded="" ;;
+       esac
+   AC_SUBST(LIB_KDED, $lib_kded)
+   AC_SUBST(LIB_KDECORE, "-lkdecore")
+   AC_SUBST(LIB_KDEUI, "-lkdeui")
+   AC_SUBST(LIB_KIO, "-lkio")
+   AC_SUBST(LIB_KJS, "-lkjs")
+   AC_SUBST(LIB_SMB, "-lsmb")
+   AC_SUBST(LIB_KAB, "-lkab")
+   AC_SUBST(LIB_KABC, "-lkabc")
+   AC_SUBST(LIB_KHTML, "-lkhtml")
+   AC_SUBST(LIB_KSPELL, "-lkspell")
+   AC_SUBST(LIB_KPARTS, "-lkparts")
+   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+   AC_SUBST(LIB_KUTILS, "-lkutils")
+   AC_SUBST(LIB_KDEPIM, "-lkdepim")
+   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
+   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
+   AC_SUBST(LIB_KDNSSD, "-lkdnssd")
+   AC_SUBST(LIB_KUNITTEST, "-lkunittest")
+# these are for backward compatibility
+   AC_SUBST(LIB_KSYCOCA, "-lkio")
+   AC_SUBST(LIB_KFILE, "-lkio")
+elif test $kde_qtver = 2; then
+   AC_SUBST(LIB_KDECORE, "-lkdecore")
+   AC_SUBST(LIB_KDEUI, "-lkdeui")
+   AC_SUBST(LIB_KIO, "-lkio")
+   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
+   AC_SUBST(LIB_SMB, "-lsmb")
+   AC_SUBST(LIB_KFILE, "-lkfile")
+   AC_SUBST(LIB_KAB, "-lkab")
+   AC_SUBST(LIB_KHTML, "-lkhtml")
+   AC_SUBST(LIB_KSPELL, "-lkspell")
+   AC_SUBST(LIB_KPARTS, "-lkparts")
+   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
+else
+   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
+   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
+   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
+   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
+   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
+fi
+])
+
+AC_DEFUN([AC_PATH_KDE],
+[
+  AC_BASE_PATH_KDE
+  AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
+  [
+  if test "$enableval" = "no";
+    then ac_use_path_checking="default"
+    else ac_use_path_checking=""
+  fi
+  ],
+  [
+  if test "$kde_qtver" = 1;
+    then ac_use_path_checking=""
+    else ac_use_path_checking="default"
+  fi
+  ]
+  )
+
+  AC_CREATE_KFSSTND($ac_use_path_checking)
+
+  AC_SUBST_KFSSTND
+  KDE_CREATE_LIBS_ALIASES
+])
+
+dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
+AC_DEFUN([KDE_CHECK_FUNC_EXT],
+[
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(kde_cv_func_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+$2
+],
+[
+$3
+],
+kde_cv_func_$1=yes,
+kde_cv_func_$1=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS="$kde_safe_LIBS"
+AC_LANG_RESTORE
+])
+
+AC_MSG_RESULT($kde_cv_func_$1)
+
+AC_MSG_CHECKING([if $1 needs custom prototype])
+AC_CACHE_VAL(kde_cv_proto_$1,
+[
+if test "x$kde_cv_func_$1" = xyes; then
+  kde_cv_proto_$1=no
+else
+  case "$1" in
+	setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
+		kde_cv_proto_$1="yes - in libkdefakes"
+		;;
+	*)
+		kde_cv_proto_$1=unknown
+		;;
+  esac
+fi
+
+if test "x$kde_cv_proto_$1" = xunknown; then
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+  kde_safe_libs=$LIBS
+  LIBS="$LIBS $X_EXTRA_LIBS"
+  AC_TRY_LINK([
+$2
+
+extern "C" $4;
+],
+[
+$3
+],
+[ kde_cv_func_$1=yes
+  kde_cv_proto_$1=yes ],
+  [kde_cv_proto_$1="$1 unavailable"]
+)
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+fi
+])
+AC_MSG_RESULT($kde_cv_proto_$1)
+
+if test "x$kde_cv_func_$1" = xyes; then
+  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
+  $6
+fi
+if test "x$kde_cv_proto_$1" = xno; then
+  AC_DEFINE(HAVE_$5_PROTO, 1,
+  [Define if you have the $1 prototype])
+fi
+
+AH_VERBATIM([_HAVE_$5_PROTO],
+[
+#if !defined(HAVE_$5_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+$4;
+#ifdef __cplusplus
+}
+#endif
+#endif
+])
+])
+
+AC_DEFUN([AC_CHECK_SETENV],
+[
+	KDE_CHECK_FUNC_EXT(setenv, [
+#include <stdlib.h>
+], 
+		[setenv("VAR", "VALUE", 1);],
+	        [int setenv (const char *, const char *, int)],
+		[SETENV])
+])
+
+AC_DEFUN([AC_CHECK_UNSETENV],
+[
+	KDE_CHECK_FUNC_EXT(unsetenv, [
+#include <stdlib.h>
+], 
+		[unsetenv("VAR");],
+	        [void unsetenv (const char *)],
+		[UNSETENV])
+])
+
+AC_DEFUN([AC_CHECK_GETDOMAINNAME],
+[
+	KDE_CHECK_FUNC_EXT(getdomainname, [
+#include <stdlib.h>
+#include <unistd.h>
+#include <netdb.h>
+], 
+		[
+char buffer[200];
+getdomainname(buffer, 200);
+], 	
+	        [#include <sys/types.h>
+		int getdomainname (char *, size_t)],
+		[GETDOMAINNAME])
+])
+
+AC_DEFUN([AC_CHECK_GETHOSTNAME],
+[
+	KDE_CHECK_FUNC_EXT(gethostname, [
+#include <stdlib.h>
+#include <unistd.h>
+], 
+		[
+char buffer[200];
+gethostname(buffer, 200);
+], 	
+	        [int gethostname (char *, unsigned int)],
+		[GETHOSTNAME])
+])
+
+AC_DEFUN([AC_CHECK_USLEEP],
+[
+	KDE_CHECK_FUNC_EXT(usleep, [
+#include <unistd.h>
+], 
+		[
+usleep(200);
+], 	
+	        [int usleep (unsigned int)],
+		[USLEEP])
+])
+
+
+AC_DEFUN([AC_CHECK_RANDOM],
+[
+	KDE_CHECK_FUNC_EXT(random, [
+#include <stdlib.h>
+], 
+		[
+random();
+], 	
+	        [long int random(void)],
+		[RANDOM])
+
+	KDE_CHECK_FUNC_EXT(srandom, [
+#include <stdlib.h>
+], 
+		[
+srandom(27);
+], 	
+	        [void srandom(unsigned int)],
+		[SRANDOM])
+
+])
+
+AC_DEFUN([AC_CHECK_INITGROUPS],
+[
+	KDE_CHECK_FUNC_EXT(initgroups, [
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
+],
+	[
+char buffer[200];
+initgroups(buffer, 27);
+],
+	[int initgroups(const char *, gid_t)],
+	[INITGROUPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMPS],
+[
+	KDE_CHECK_FUNC_EXT(mkstemps, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkstemps("/tmp/aaaXXXXXX", 6);
+],
+	[int mkstemps(char *, int)],
+	[MKSTEMPS])
+])
+
+AC_DEFUN([AC_CHECK_MKSTEMP],
+[
+	KDE_CHECK_FUNC_EXT(mkstemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkstemp("/tmp/aaaXXXXXX");
+],
+	[int mkstemp(char *)],
+	[MKSTEMP])
+])
+
+AC_DEFUN([AC_CHECK_MKDTEMP],
+[
+	KDE_CHECK_FUNC_EXT(mkdtemp, [
+#include <stdlib.h>
+#include <unistd.h>
+],
+	[
+mkdtemp("/tmp/aaaXXXXXX");
+],
+	[char *mkdtemp(char *)],
+	[MKDTEMP])
+])
+
+
+AC_DEFUN([AC_CHECK_RES_INIT],
+[
+  AC_MSG_CHECKING([if res_init needs -lresolv])
+  kde_libs_safe="$LIBS"
+  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
+  AC_TRY_LINK(
+    [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+    ],
+    [
+      res_init(); 
+    ],
+    [
+      LIBRESOLV="-lresolv"
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
+    ],
+    [ AC_MSG_RESULT(no) ]
+  )
+  LIBS=$kde_libs_safe
+  AC_SUBST(LIBRESOLV)
+
+  KDE_CHECK_FUNC_EXT(res_init,
+    [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+    ],
+    [res_init()],
+    [int res_init(void)],
+    [RES_INIT])
+])
+
+AC_DEFUN([AC_CHECK_STRLCPY],
+[
+	KDE_CHECK_FUNC_EXT(strlcpy, [
+#include <string.h>
+],
+[ char buf[20];
+  strlcpy(buf, "KDE function test", sizeof(buf));
+],
+ 	[unsigned long strlcpy(char*, const char*, unsigned long)],
+	[STRLCPY])
+])
+
+AC_DEFUN([AC_CHECK_STRLCAT],
+[
+	KDE_CHECK_FUNC_EXT(strlcat, [
+#include <string.h>
+],
+[ char buf[20];
+  buf[0]='\0';
+  strlcat(buf, "KDE function test", sizeof(buf));
+],
+ 	[unsigned long strlcat(char*, const char*, unsigned long)],
+	[STRLCAT])
+])
+
+AC_DEFUN([AC_CHECK_RES_QUERY],
+[
+	KDE_CHECK_FUNC_EXT(res_query, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include <netdb.h>
+],
+[
+res_query(NULL, 0, 0, NULL, 0);
+],
+	[int res_query(const char *, int, int, unsigned char *, int)],
+	[RES_QUERY])
+])
+
+AC_DEFUN([AC_CHECK_DN_SKIPNAME],
+[
+	KDE_CHECK_FUNC_EXT(dn_skipname, [
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+],
+[
+dn_skipname (NULL, NULL);
+],
+	[int dn_skipname (unsigned char *, unsigned char *)],
+	[DN_SKIPNAME])
+])
+
+
+AC_DEFUN([AC_FIND_GIF],
+   [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+else
+LIBS="$all_libraries -lgif"
+fi
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [return GifLastError();],
+            eval "ac_cv_lib_gif=yes",
+            eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN([KDE_FIND_JPEG_HELPER],
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+void jpeg_CreateDecompress();
+#ifdef __cplusplus
+}
+#endif
+],
+[jpeg_CreateDecompress();],
+            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+            eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_$1"
+  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+  AC_MSG_RESULT(no)
+  $3
+fi
+
+])
+
+AC_DEFUN([AC_FIND_JPEG],
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+   KDE_FIND_JPEG_HELPER(normal, [],
+    [
+       LIBJPEG=
+    ]
+   )
+)
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+    AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+  else
+    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+  fi
+  jpeg_incdir=
+  LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+AH_VERBATIM(_AC_CHECK_JPEG,
+[/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+])
+])
+
+AC_DEFUN([KDE_CHECK_QT_JPEG],
+[
+if test -n "$LIBJPEG"; then
+AC_MSG_CHECKING([if Qt needs $LIBJPEG])
+AC_CACHE_VAL(kde_cv_qt_jpeg,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
+LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[#include <qapplication.h>],
+            [
+            int argc;
+            char** argv;
+            QApplication app(argc, argv);],
+            eval "kde_cv_qt_jpeg=no",
+            eval "kde_cv_qt_jpeg=yes")
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+fi
+])
+
+if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
+  AC_MSG_RESULT(yes)
+  LIBJPEG_QT='$(LIBJPEG)'
+else
+  AC_MSG_RESULT(no)
+  LIBJPEG_QT=
+fi
+
+])
+
+AC_DEFUN([AC_FIND_ZLIB],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+#include<string.h>
+],
+[
+  char buf[42];
+  gzFile f = (gzFile) 0;
+  /* this would segfault.. but we only link, don't run */
+  (void) gzgets(f, buf, sizeof(buf));
+
+  return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
+],
+            eval "ac_cv_lib_z='-lz'",
+            eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+  LIBZ="$ac_cv_lib_z"
+  AC_MSG_RESULT($ac_cv_lib_z)
+else
+  AC_MSG_ERROR(not found. 
+          Possibly configure picks up an outdated version
+          installed by XFree86. Remove it from your system.
+
+          Check your installation and look into config.log)
+  LIBZ=""
+fi
+AC_SUBST(LIBZ)
+])
+
+AC_DEFUN([KDE_TRY_TIFFLIB],
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+else
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
+fi
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+    [return (TIFFOpen( "", "r") == 0); ],
+[
+    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+    kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+    AC_MSG_RESULT(no)
+    LIBTIFF=""
+    $3
+else
+    LIBTIFF="$kde_cv_libtiff_$1"
+    AC_MSG_RESULT(yes)
+    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+    $2
+fi
+
+])
+
+AC_DEFUN([AC_FIND_TIFF],
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+   KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+AC_DEFUN([KDE_FIND_LIBEXR],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_CACHE_VAL(ac_cv_libexr,
+[
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  AC_MSG_CHECKING([for OpenEXR libraries])
+
+  if test "$PKG_CONFIG" = "no" ; then
+     AC_MSG_RESULT(no)
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     if ! $PKG_CONFIG --exists OpenEXR ; then
+        AC_MSG_RESULT(no)
+        EXRSTATUS=no
+     else
+        if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
+           AC_MSG_RESULT(no)
+           EXRSTATUS=old
+        else
+           kde_save_LIBS="$LIBS"
+           LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
+           AC_LANG_SAVE
+           AC_LANG_CPLUSPLUS
+           kde_save_CXXFLAGS="$CXXFLAGS"
+           EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
+           CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
+
+           AC_TRY_LINK(dnl
+               [
+               #include <ImfRgbaFile.h>
+               ],
+               [
+               using namespace Imf;
+               RgbaInputFile file ("dummy");
+               return 0;
+               ],
+               eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
+               eval "ac_cv_libexr=no"
+           )
+           LIBS="$kde_save_LIBS"
+           CXXFLAGS="$kde_save_CXXFLAGS"
+           AC_LANG_RESTORE
+           ])dnl
+           if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
+               AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
+               LIB_EXR="$ac_cv_libexr"
+               AC_MSG_RESULT($ac_cv_libexr)
+           else
+               AC_MSG_RESULT(no)
+               LIB_EXR=""
+           fi
+        fi
+     fi
+  fi
+  AC_SUBST(LIB_EXR)
+  AC_SUBST(EXR_FLAGS)
+])
+
+
+
+AC_DEFUN([AC_FIND_PNG],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+else
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
+fi
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+    [
+    #include<png.h>
+    ],
+    [
+    png_structp png_ptr = png_create_read_struct(  /* image ptr */
+		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+    return( png_ptr != 0 );
+    ],
+    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+    eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+  LIBPNG="$ac_cv_lib_png"
+  AC_SUBST(LIBPNG)
+  AC_MSG_RESULT($ac_cv_lib_png)
+else
+  AC_MSG_RESULT(no)
+  LIBPNG=""
+  AC_SUBST(LIBPNG)
+fi
+])
+
+
+AC_DEFUN([AC_FIND_JASPER],
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_MSG_CHECKING([for jasper])
+AC_CACHE_VAL(ac_cv_jasper,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+    [
+    #include<jasper/jasper.h>
+    ],
+    [
+    return( jas_init() );
+    ],
+    eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
+    eval "ac_cv_jasper=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
+  LIB_JASPER="$ac_cv_jasper"
+  AC_MSG_RESULT($ac_cv_jasper)
+else
+  AC_MSG_RESULT(no)
+  LIB_JASPER=""
+fi
+AC_SUBST(LIB_JASPER)
+])
+
+AC_DEFUN([AC_CHECK_BOOL],
+[
+  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_gnu_extensions=yes
+else
+  ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CXX supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -$1"
+  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+  CXXFLAGS="$save_CXXFLAGS"
+  AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
+[
+AC_MSG_CHECKING([whether $CC supports -$1])
+kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
+AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
+[
+  AC_LANG_SAVE
+  AC_LANG_C
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -$1"
+  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
+  CFLAGS="$save_CFLAGS"
+  AC_LANG_RESTORE
+])
+if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN([AC_REMOVE_FORBIDDEN],
+[ __val=$$1
+  __forbid=" $2 "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    $1=$__new
+  fi
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
+[
+  AC_MSG_CHECKING([whether $CC is blacklisted])
+
+  dnl In theory we have tu run this test against $CC and $CXX
+  dnl in C and in C++ mode, because its perfectly legal for
+  dnl the user to mix compiler versions, since C has a defined
+  dnl ABI. 
+  dnl 
+  dnl For now, we assume the user is not on crack.
+
+  AC_TRY_COMPILE([
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
+choke me
+#endif
+#endif
+], ,
+  kde_bad_compiler=no, 
+  kde_bad_compiler=yes
+)
+
+  AC_MSG_RESULT($kde_bad_compiler)
+
+if test "$kde_bad_compiler" = "yes"; then
+  AC_MSG_ERROR([
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version. 
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
+[
+  AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
+    kde_cv_opt_noinline_match,
+  [
+  kde_cv_opt_noinline_match=irrelevant
+  dnl if we don't use both -O2 and -fno-inline, this check is moot
+  if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
+     && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
+
+    ac_cflags_save="$CFLAGS"
+    CFLAGS="$CFLAGS -D_USE_GNU"
+
+    AC_TRY_LINK([
+  #include <string.h>
+], [  const char *pt, *et;
+  et = __extension__      ({ char __a0, __a1, __a2;       (__builtin_constant_p (  ";,"  ) && ((size_t)(const void *)((   ";,"   )+ 1) - (size_t)(const void *)(   ";,"   ) == 1)        ? ((__a0 =((__const char  *) (  ";,"  ))[0], __a0 == '\0')     ? ((void) (  pt ),((void *)0) )        : ((__a1 = ((__const char *) (  ";,"  ))[1], __a1== '\0')      ? (__extension__ (__builtin_constant_p (  __a0 ) && ( __a0 ) == '\0'   ? (char *) __rawmemchr (   pt  ,   __a0)       : strchr(   pt  ,   __a0 )))   : ((__a2 = ((__const char *) (  ";,"  ))[2], __a2 == '\0')      ? __strpbrk_c2 (  pt , __a0, __a1)      :(((__const char *) (  ";,"  ))[3] == '\0'     ? __strpbrk_c3 (  pt ,__a0, __a1, __a2): strpbrk (  pt ,   ";,"  ))))) : strpbrk (  pt ,  ";,"  )); }) ;
+],
+    kde_cv_opt_noinline_match=yes,
+    kde_cv_opt_noinline_match=no
+    )
+
+    CFLAGS="$ac_cflags_save"
+  fi
+  ])
+])
+
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
+[dnl
+if test "x$kde_use_qt_emb" != "xyes"; then
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ AC_REMOVE_FORBIDDEN(CXX, [-rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
+])
+
+AC_DEFUN([AC_CHECK_COMPILERS],
+[
+  AC_ARG_ENABLE(debug,
+	        AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
+  [
+    case $enableval in
+      yes)
+        kde_use_debug_code="yes"
+        kde_use_debug_define=no
+        ;;
+      full)
+        kde_use_debug_code="full"
+        kde_use_debug_define=no
+        ;;
+      *)
+        kde_use_debug_code="no"
+        kde_use_debug_define=yes
+        ;;
+    esac
+  ], 
+    [kde_use_debug_code="no"
+      kde_use_debug_define=no
+  ])
+
+  dnl Just for configure --help
+  AC_ARG_ENABLE(dummyoption,
+	        AC_HELP_STRING([--disable-debug],
+	  		       [disables debug output and debug symbols [default=no]]),
+		[],[])
+
+  AC_ARG_ENABLE(strict,
+		AC_HELP_STRING([--enable-strict],
+			      [compiles with strict compiler options (may not work!)]),
+   [
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+   ], [kde_use_strict_options="no"])
+
+  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
+   [
+    if test $enableval = "no"; then
+         kde_use_warnings="no"
+       else
+         kde_use_warnings="yes"
+    fi
+   ], [kde_use_warnings="yes"])
+
+  dnl enable warnings for debug build
+  if test "$kde_use_debug_code" != "no"; then
+    kde_use_warnings=yes
+  fi
+
+  AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
+    [kde_use_profiling=$enableval],
+    [kde_use_profiling="no"]
+  )
+
+  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
+  CFLAGS=" $CFLAGS"
+
+  AC_PROG_CC 
+
+  AC_PROG_CPP
+
+  if test "$GCC" = "yes"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test $kde_use_debug_code = "full"; then
+        CFLAGS="-g3 -fno-inline $CFLAGS"
+      else
+        CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
+      fi
+    else
+      CFLAGS="-O2 $CFLAGS"
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CFLAGS="-DNDEBUG $CFLAGS"
+  fi
+
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
+  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
+  esac
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+  CXXFLAGS=" $CXXFLAGS"
+
+  AC_PROG_CXX
+
+  KDE_CHECK_FOR_BAD_COMPILER
+
+  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
+      else
+        if test "$kde_use_debug_code" = "full"; then
+          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
+        else
+          CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
+        fi
+      fi
+      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
+
+      dnl convenience compiler flags
+      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
+      AC_SUBST(WOVERLOADED_VIRTUAL)
+    else
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K3 $CXXFLAGS"
+      else
+        CXXFLAGS="-O2 $CXXFLAGS"
+      fi
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
+  fi  
+
+  if test "$kde_use_profiling" = "yes"; then
+    KDE_CHECK_COMPILER_FLAG(pg,
+    [
+      CFLAGS="-pg $CFLAGS"
+      CXXFLAGS="-pg $CXXFLAGS"
+    ])
+  fi
+
+  if test "$kde_use_warnings" = "yes"; then
+      if test "$GCC" = "yes"; then
+        CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
+        case $host in
+          *-*-linux-gnu)	
+            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
+            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
+            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
+          ;;
+        esac
+        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
+        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
+        dnl ### FIXME: revert for KDE 4
+        KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
+     fi
+  fi
+
+  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
+    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+  fi
+
+  AC_ARG_ENABLE(pch,
+     AC_HELP_STRING([--enable-pch],
+                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
+    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
+ 
+  HAVE_GCC_VISIBILITY=0
+  AC_SUBST([HAVE_GCC_VISIBILITY])
+
+  if test "$GXX" = "yes"; then
+    gcc_no_reorder_blocks=NO
+    KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
+    if test $kde_use_debug_code != "no" && \
+       test $kde_use_debug_code != "full" && \
+       test "YES" = "$gcc_no_reorder_blocks" ; then
+          CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+          CFLAGS="$CFLAGS -fno-reorder-blocks"
+    fi
+    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
+    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
+    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
+    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=	)
+    ENABLE_PERMISSIVE_FLAG="-fpermissive"
+
+    if test "$kde_use_pch" = "yes"; then
+        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
+        echo >conftest.h
+        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
+            kde_gcc_supports_pch=yes
+            AC_MSG_RESULT(yes)
+        else
+            kde_gcc_supports_pch=no
+            AC_MSG_RESULT(no)
+        fi
+        if test "$kde_gcc_supports_pch" = "yes"; then
+            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
+            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
+                kde_gcc_supports_pch=yes
+                AC_MSG_RESULT(yes)
+            else
+                kde_gcc_supports_pch=no
+                AC_MSG_RESULT(no)
+            fi
+        fi
+        rm -f conftest.h conftest.h.gch
+    fi
+
+    KDE_CHECK_FOR_OPT_NOINLINE_MATCH
+    if test "x$kde_cv_opt_noinline_match" = "xno" ; then
+       CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
+    fi
+  fi
+  AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
+  if test "$CXX" = "KCC"; then
+    dnl unfortunately we currently cannot disable exception support in KCC
+    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
+    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
+    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=	)
+
+    if test "$kde_use_pch" = "yes"; then
+      dnl TODO: support --pch-dir!
+      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
+      dnl the below works (but the dir must exist), but it's
+      dnl useless for a whole package.
+      dnl The are precompiled headers for each source file, so when compiling
+      dnl from scratch, it doesn't make a difference, and they take up
+      dnl around ~5Mb _per_ sourcefile.
+      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
+      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
+    fi
+    dnl this flag controls inlining. by default KCC inlines in optimisation mode
+    dnl all implementations that are defined inside the class {} declaration. 
+    dnl because of templates-compatibility with broken gcc compilers, this
+    dnl can cause excessive inlining. This flag limits it to a sane level
+    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
+    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
+    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
+    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
+    dnl Some source files are shared between multiple executables
+    dnl (or libraries) and some of those need template instantiations.
+    dnl In that case KCC needs to compile those sources with
+    dnl --one_instantiation_per_object.  To make it easy for us we compile
+    dnl _all_ objects with that flag (--one_per is a shorthand).
+    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
+  fi
+  AC_SUBST(USE_EXCEPTIONS)
+  dnl obsolete macro - provided to keep things going
+  USE_RTTI=
+  AC_SUBST(USE_RTTI)
+
+  case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
+      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`$CXX -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+          fi
+        fi
+        ;;
+  esac
+
+  AC_VALIDIFY_CXXFLAGS
+
+  AC_PROG_CXXCPP
+
+  if test "$GCC" = yes; then
+     NOOPT_CFLAGS=-O0
+  fi
+  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
+
+  AC_ARG_ENABLE(coverage,
+    AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
+      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker="-lgcc"
+      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker=""
+      else
+        AC_MSG_ERROR([coverage with your compiler is not supported])
+      fi
+      CFLAGS="$CFLAGS $ac_coverage_compiler"
+      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
+      LDFLAGS="$LDFLAGS $ac_coverage_linker"
+    ])
+
+  AC_SUBST(NOOPT_CXXFLAGS)
+  AC_SUBST(NOOPT_CFLAGS)
+  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
+
+  KDE_CHECK_NEW_LDFLAGS
+  KDE_CHECK_FINAL
+  KDE_CHECK_CLOSURE
+  KDE_CHECK_NMCHECK
+
+  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+])
+
+AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
+  [
+    AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
+      [
+        AC_LANG_SAVE
+        AC_LANG_CPLUSPLUS
+
+        safe_CXXFLAGS=$CXXFLAGS
+        safe_LDFLAGS=$LDFLAGS
+        CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
+        LDFLAGS="$LDFLAGS -shared -fPIC"
+
+        AC_TRY_LINK(
+        [
+          /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
+	  #include <string>
+          int some_function( void ) __attribute__ ((visibility("default")));
+          int some_function( void )
+          {
+	    std::string s("blafasel");
+            return 0;
+          }
+        ], [/* elvis is alive */],
+        kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
+
+        CXXFLAGS=$safe_CXXFLAGS
+        LDFLAGS=$safe_LDFLAGS
+        AC_LANG_RESTORE
+      ]
+    )
+
+    if test x$kde_cv_val_gcc_visibility_bug = xno; then
+      CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+    fi
+  ]
+)
+
+AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
+[
+  AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
+
+  AC_MSG_CHECKING([grepping for visibility push/pop in headers])
+
+  if test "x$GXX" = "xyes"; then
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    AC_EGREP_CPP(
+       [GCC visibility push],
+       [ #include <exception> 
+       ], 
+    [
+      AC_MSG_RESULT(yes)
+      kde_stdc_visibility_patched=yes ],
+    [ 
+      AC_MSG_RESULT(no)
+      AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for 
+                   visibility support. Disabling -fvisibility=hidden])
+
+      kde_stdc_visibility_patched=no ])
+
+    AC_LANG_RESTORE
+
+    kde_have_gcc_visibility=no
+    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
+    [
+      kde_have_gcc_visibility=yes
+      dnl the whole toolchain is just a mess, gcc is just too buggy
+      dnl to handle STL with visibility enabled. Lets reconsider 
+      dnl when gcc 4.2 is out or when things get fixed in the compiler.
+      dnl Contact mueller at kde.org for details.
+      AC_ARG_ENABLE(gcc-hidden-visibility,
+        AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
+          [kde_have_gcc_visibility=$enableval],
+          [kde_have_gcc_visibility=no])
+
+      AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
+        [
+          AC_LANG_SAVE
+          AC_LANG_CPLUSPLUS
+
+          safe_CXXFLAGS=$CXXFLAGS
+          CXXFLAGS="$CXXFLAGS $all_includes"
+
+          AC_TRY_COMPILE(
+          [
+#include <qglobal.h>
+#if Q_EXPORT - 0 != 0
+/* if this compiles, then Q_EXPORT is undefined */
+/* if Q_EXPORT is nonempty, this will break compilation */
+#endif
+          ], [/* elvis is alive */],
+          kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
+
+          CXXFLAGS=$safe_CXXFLAGS
+          AC_LANG_RESTORE
+        ]
+      )
+
+      if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
+        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+        KDE_CHECK_VISIBILITY_GCC_BUG
+        HAVE_GCC_VISIBILITY=1
+        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
+      fi
+    ])
+  fi
+])
+
+AC_DEFUN([KDE_ADD_DEPENDENCIES],
+[
+   [A]M_DEPENDENCIES(CC)
+   [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN([KDE_PROG_LIBTOOL],
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+AC_OBJEXT
+AC_EXEEXT
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
+AC_SUBST(KDE_PLUGIN)
+
+# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
+KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
+AC_SUBST(KDE_CHECK_PLUGIN)
+
+# we patch configure quite some so we better keep that consistent for incremental runs 
+AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
+])
+
+AC_DEFUN([KDE_CHECK_LIB64],
+[
+    AC_ARG_ENABLE(libsuffix,
+        AC_HELP_STRING([--enable-libsuffix],
+            [/lib directory suffix (64,32,none,auto[=default])]),
+            kdelibsuff=$enableval, kdelibsuff="auto")
+    
+    if test "$kdelibsuff" = "auto"; then
+    
+cat > conftest.c << EOF
+#include <stdio.h>
+int main() {
+ return 0;
+}
+EOF
+        kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
+    s,.*/lib\([[^\/]]*\)/.*,\1, 
+    p 
+}'`
+	rm -rf conftest.*
+    fi	
+	
+    if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
+       kdelibsuff=
+    fi
+    if test -z "$kdelibsuff"; then
+        AC_MSG_RESULT([not using lib directory suffix])
+        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
+    else
+        if test "$libdir" = '${exec_prefix}/lib'; then
+            libdir="$libdir${kdelibsuff}"
+            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
+        fi
+        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
+        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
+    fi
+])
+
+AC_DEFUN([KDE_CHECK_TYPES],
+[  AC_CHECK_SIZEOF(int, 4)dnl
+   AC_CHECK_SIZEOF(short)dnl
+  AC_CHECK_SIZEOF(long, 4)dnl
+  AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+dnl Not used - kept for compat only?
+AC_DEFUN([KDE_DO_IT_ALL],
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN([AC_CHECK_RPATH],
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+      AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
+      USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  KDE_RPATH="-R \$(libdir)"
+
+  if test "$kde_libraries" != "$libdir"; then
+      KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
+  fi
+
+  if test -n "$qt_libraries"; then
+    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+  fi
+  dnl $x_libraries is set to /usr/lib in case
+  if test -n "$X_LDFLAGS"; then
+    X_RPATH="-R \$(x_libraries)"
+    KDE_RPATH="$KDE_RPATH $X_RPATH"
+  fi
+  if test -n "$KDE_EXTRA_RPATH"; then
+    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+  fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_SUBST(X_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN([AC_CHECK_SOCKLEN_T],
+[
+   AC_MSG_CHECKING(for socklen_t)
+   AC_CACHE_VAL(kde_cv_socklen_t,
+   [
+      AC_LANG_PUSH(C++)
+      kde_cv_socklen_t=no
+      AC_TRY_COMPILE([
+         #include <sys/types.h>
+         #include <sys/socket.h>
+      ],
+      [
+         socklen_t len;
+         getpeername(0,0,&len);
+      ],
+      [
+         kde_cv_socklen_t=yes
+         kde_cv_socklen_t_equiv=socklen_t
+      ])
+      AC_LANG_POP(C++)
+   ])
+   AC_MSG_RESULT($kde_cv_socklen_t)
+   if test $kde_cv_socklen_t = no; then
+      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
+      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
+      [
+         kde_cv_socklen_t_equiv=int
+         AC_LANG_PUSH(C++)
+         for t in int size_t unsigned long "unsigned long"; do
+            AC_TRY_COMPILE([
+               #include <sys/types.h>
+               #include <sys/socket.h>
+            ],
+            [
+               $t len;
+               getpeername(0,0,&len);
+            ],
+            [
+               kde_cv_socklen_t_equiv="$t"
+               break
+            ])
+         done
+         AC_LANG_POP(C++)
+      ])
+      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
+   fi
+   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
+                     [type to use in place of socklen_t if not defined])
+   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
+                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN([AM_KDE_WITH_NLS],
+  [
+    dnl If we use NLS figure out what method
+
+    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+        GMSGFMT=":"
+      fi
+      MSGFMT=$GMSGFMT
+      AC_SUBST(GMSGFMT)
+      AC_SUBST(MSGFMT)
+
+      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+	dnl If it is no GNU xgettext we define it as : so that the
+	dnl Makefiles still can work.
+	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+	  : ;
+	else
+	  AC_MSG_RESULT(
+	    [found xgettext programs is not GNU xgettext; ignore it])
+	  XGETTEXT=":"
+	fi
+      fi
+     AC_SUBST(XGETTEXT)
+
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper at cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+	ac_cv_path_$1="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper at cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN([AM_LC_MESSAGES],
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+    fi
+  fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN([AM_FUNC_OBSTACK],
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
+	      am_cv_func_obstack=yes,
+	      am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+   AC_DEFINE(HAVE_OBSTACK)
+ else
+   LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+              am_cv_lib_error_at_line=yes,
+	      am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+   LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper at cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN([AM_KDE_GNU_GETTEXT],
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   AC_MSG_CHECKING(for stpcpy)
+   AC_CACHE_VAL(kde_cv_func_stpcpy,
+   [
+   kde_safe_cxxflags=$CXXFLAGS
+   CXXFLAGS="-Werror"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_TRY_COMPILE([
+   #include <string.h>
+   ],
+   [
+   char buffer[200];
+   stpcpy(buffer, buffer);
+   ],
+   kde_cv_func_stpcpy=yes,
+   kde_cv_func_stpcpy=no)
+   AC_LANG_RESTORE
+   CXXFLAGS=$kde_safe_cxxflags
+   ])
+   AC_MSG_RESULT($kde_cv_func_stpcpy)
+   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+   fi
+
+   AM_LC_MESSAGES
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+  ])
+
+AC_DEFUN([AC_HAVE_XPM],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
+	xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+   ac_cv_have_xpm=no
+ else
+   AC_MSG_CHECKING(for XPM)
+   AC_CACHE_VAL(ac_cv_have_xpm,
+   [
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
+      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+    else
+      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
+    fi
+    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <X11/xpm.h>],[],
+	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_xpm" = no; then
+    AC_MSG_RESULT(no)
+    XPM_LDFLAGS=""
+    XPMINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+    if test "$XPM_LDFLAGS" = ""; then
+       XPMLIB='-lXpm $(LIB_X11)'
+    else
+       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+    fi
+    if test "$XPM_INCLUDE" = ""; then
+       XPMINC=""
+    else
+       XPMINC="-I$XPM_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN([AC_HAVE_DPMS],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
+	dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+   ac_cv_have_dpms=no
+ else
+   AC_MSG_CHECKING(for DPMS)
+   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+   AC_CACHE_VAL(ac_cv_have_dpms,
+   [
+    if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
+      AC_MSG_RESULT(no)
+      ac_cv_have_dpms="no"
+    else
+      ac_save_ldflags="$LDFLAGS"
+      ac_save_cflags="$CFLAGS"
+      ac_save_libs="$LIBS"
+      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
+      LIBS="-lX11 -lXext $LIBSOCKET"
+      CFLAGS="$CFLAGS $X_INCLUDES"
+      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+      AC_TRY_LINK([
+	  #include <X11/Xproto.h>
+	  #include <X11/X.h>
+	  #include <X11/Xlib.h>
+	  #include <X11/extensions/dpms.h>
+	  int foo_test_dpms()
+	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+	  ac_cv_have_dpms="yes", [
+              LIBS="-lXdpms $LIBS"
+              AC_TRY_LINK([
+	          #include <X11/Xproto.h>
+        	  #include <X11/X.h>
+        	  #include <X11/Xlib.h>
+        	  #include <X11/extensions/dpms.h>
+        	  int foo_test_dpms()
+        	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+        	  [
+                  ac_cv_have_dpms="-lXdpms"
+                  ],ac_cv_have_dpms="no")
+              ])
+      LDFLAGS="$ac_save_ldflags"
+      CFLAGS="$ac_save_cflags"
+      LIBS="$ac_save_libs"
+    fi
+   ])dnl
+
+  if test "$ac_cv_have_dpms" = no; then
+    AC_MSG_RESULT(no)
+    DPMS_LDFLAGS=""
+    DPMSINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+    if test "$ac_cv_have_dpms" = "-lXdpms"; then
+       DPMS_LIB="-lXdpms"
+    fi
+    if test "$DPMS_LDFLAGS" = ""; then
+       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+    else
+       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+    fi
+    if test "$DPMS_INCLUDE" = ""; then
+       DPMSINC=""
+    else
+       DPMSINC="-I$DPMS_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ ac_save_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
+   [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSCapable,
+   AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
+   [#include <X11/Xlib.h>
+   #include <X11/extensions/dpms.h>])
+ AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
+   [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
+ AC_CHECK_DECL(DPMSInfo,
+   AC_DEFINE(HAVE_DPMSINFO_PROTO),,
+   [#include <X11/Xlib.h>
+   #include <X11/extensions/dpms.h>])
+ CFLAGS="$ac_save_cflags"
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN([AC_HAVE_GL],
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
+	gl_test=$withval, gl_test="yes")
+ if test "x$kde_use_qt_emb" = "xyes"; then
+   # GL and Qt Embedded is a no-go for now.
+   ac_cv_have_gl=no
+ elif test "x$gl_test" = xno; then
+   ac_cv_have_gl=no
+ else
+   AC_MSG_CHECKING(for GL)
+   AC_CACHE_VAL(ac_cv_have_gl,
+   [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_ldflags=$LDFLAGS
+    ac_save_cxxflags=$CXXFLAGS
+    ac_save_libs=$LIBS
+    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
+    LIBS="$LIBS -lGL -lGLU"
+    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
+    LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
+    CXXFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+	ac_cv_have_gl="yes", ac_cv_have_gl="no")
+    AC_LANG_RESTORE
+    LDFLAGS=$ac_save_ldflags
+    CXXFLAGS=$ac_save_cxxflags
+    LIBS=$ac_save_libs
+   ])dnl
+
+  if test "$ac_cv_have_gl" = "no"; then
+    AC_MSG_RESULT(no)
+    GL_LDFLAGS=""
+    GLINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+    if test "$GL_LDFLAGS" = ""; then
+       GLLIB='-lGLU -lGL $(LIB_X11)'
+    else
+       GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
+    fi
+    if test "$GL_INCLUDE" = ""; then
+       GLINC=""
+    else
+       GLINC="-I$GL_INCLUDE"
+    fi
+    AC_MSG_RESULT($ac_cv_have_gl)
+    $1
+  fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+
+ dnl shadow password and PAM magic - maintained by ossi at kde.org
+
+AC_DEFUN([KDE_PAM], [
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+
+  want_pam=
+  AC_ARG_WITH(pam,
+    AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
+    [ if test "x$withval" = "xyes"; then
+        want_pam=yes
+        pam_service=kde
+      elif test "x$withval" = "xno"; then
+        want_pam=no
+      else
+        want_pam=yes
+        pam_service=$withval
+      fi
+    ], [ pam_service=kde ])
+
+  use_pam=
+  PAMLIBS=
+  if test "x$want_pam" != xno; then
+    AC_CHECK_LIB(pam, pam_start, [
+      AC_CHECK_HEADER(security/pam_appl.h,
+        [ pam_header=security/pam_appl.h ],
+        [ AC_CHECK_HEADER(pam/pam_appl.h,
+            [ pam_header=pam/pam_appl.h ],
+            [
+    AC_MSG_WARN([PAM detected, but no headers found!
+Make sure you have the necessary development packages installed.])
+            ]
+          )
+        ]
+      )
+    ], , $LIBDL)
+    if test -z "$pam_header"; then
+      if test "x$want_pam" = xyes; then
+        AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
+      fi
+    else
+      AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
+      PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
+      use_pam=yes
+
+      dnl darwin claims to be something special
+      if test "$pam_header" = "pam/pam_appl.h"; then
+        AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
+      fi
+
+      dnl test whether struct pam_message is const (Linux) or not (Sun)
+      AC_MSG_CHECKING(for const pam_message)
+      AC_EGREP_HEADER([struct pam_message], $pam_header,
+        [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
+                          [AC_MSG_RESULT([const: Linux-type PAM])],
+                          [AC_MSG_RESULT([nonconst: Sun-type PAM])
+                          AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+                          )],
+        [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
+    fi
+  fi
+
+  AC_SUBST(PAMLIBS)
+])
+
+dnl DEF_PAM_SERVICE(arg name, full name, define name)
+AC_DEFUN([DEF_PAM_SERVICE], [
+  AC_ARG_WITH($1-pam,
+    AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
+    [ if test "x$use_pam" = xyes; then
+        $3_PAM_SERVICE=$withval
+      else
+        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
+You may want to enforce it by using --with-pam.])
+      fi
+    ], 
+    [ if test "x$use_pam" = xyes; then
+        $3_PAM_SERVICE="$pam_service"
+      fi
+    ])
+    if test -n "$$3_PAM_SERVICE"; then
+      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
+      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
+    fi
+    AC_SUBST($3_PAM_SERVICE)
+])
+
+AC_DEFUN([KDE_SHADOWPASSWD], [
+  AC_REQUIRE([KDE_PAM])
+
+  AC_CHECK_LIB(shadow, getspent,
+    [ LIBSHADOW="-lshadow"
+      ac_use_shadow=yes
+    ],
+    [ dnl for UnixWare
+      AC_CHECK_LIB(gen, getspent, 
+        [ LIBGEN="-lgen"
+          ac_use_shadow=yes
+        ], 
+        [ AC_CHECK_FUNC(getspent, 
+            [ ac_use_shadow=yes ],
+            [ ac_use_shadow=no ])
+	])
+    ])
+  AC_SUBST(LIBSHADOW)
+  AC_SUBST(LIBGEN)
+  
+  AC_MSG_CHECKING([for shadow passwords])
+
+  AC_ARG_WITH(shadow,
+    AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
+    [ if test "x$withval" != "xno"; then
+        use_shadow=yes
+      else
+        use_shadow=no
+      fi
+    ], [
+      use_shadow="$ac_use_shadow"
+    ])
+
+  if test "x$use_shadow" = xyes; then
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
+  else
+    AC_MSG_RESULT(no)
+    LIBSHADOW=
+    LIBGEN=
+  fi
+
+  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
+  dnl this still applies, if we could use it indirectly through pam.
+  if test "x$use_shadow" = xyes || 
+     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
+      case $host in
+      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
+	SETUIDFLAGS="-m 4755 -o root";;
+      *)
+	SETUIDFLAGS="-m 4755";;
+      esac
+  fi
+  AC_SUBST(SETUIDFLAGS)
+
+])
+
+AC_DEFUN([KDE_PASSWDLIBS], [
+  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
+  AC_REQUIRE([KDE_PAM])
+  AC_REQUIRE([KDE_SHADOWPASSWD])
+
+  if test "x$use_pam" = "xyes"; then 
+    PASSWDLIBS="$PAMLIBS"
+  else
+    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
+  fi
+
+  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
+  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
+  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
+  dnl may need to read /etc/master.passwd).
+  case $host in
+  *-*-freebsd*)
+    SETUIDFLAGS="-m 4755 -o root"
+    ;;
+  *)
+    ;;
+  esac
+
+  AC_SUBST(PASSWDLIBS)
+])
+
+AC_DEFUN([KDE_CHECK_LIBDL],
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN([KDE_CHECK_DLOPEN],
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+  ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+  ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+  enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+  test -n "$1" && eval $1
+else
+  test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+  dynamic_loading=yes
+  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+  dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+  $1
+else
+  $2
+fi
+])
+
+AC_DEFUN([KDE_ADD_INCLUDES],
+[
+if test -z "$1"; then
+  test_include="Pix.h"
+else
+  test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+   for ac_dir in               \
+                               \
+     /usr/include/g++          \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$test_include"; then
+       kde_cv_libgpp_includes=$ac_dir
+       break
+     fi
+   done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+AC_DEFUN([KDE_CHECK_LIBPTHREAD],
+[
+  dnl This code is here specifically to handle the
+  dnl various flavors of threading library on FreeBSD
+  dnl 4-, 5-, and 6-, and the (weird) rules around it.
+  dnl There may be an environment PTHREAD_LIBS that 
+  dnl specifies what to use; otherwise, search for it.
+  dnl -pthread is special cased and unsets LIBPTHREAD
+  dnl below if found.
+  LIBPTHREAD=""
+
+  if test -n "$PTHREAD_LIBS"; then
+    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
+      LIBPTHREAD="PTHREAD"
+    else
+      PTHREAD_LIBS_save="$PTHREAD_LIBS"
+      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
+      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
+      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
+          LIBPTHREAD="$PTHREAD_LIBS_save"])
+      PTHREAD_LIBS="$PTHREAD_LIBS_save"
+    fi
+  fi
+
+  dnl Is this test really needed, in the face of the Tru64 test below?
+  if test -z "$LIBPTHREAD"; then
+    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
+  fi
+
+  dnl This is a special Tru64 check, see BR 76171 issue #18.
+  if test -z "$LIBPTHREAD" ; then
+    AC_MSG_CHECKING([for pthread_create in -lpthread])
+    kde_safe_libs=$LIBS
+    LIBS="$LIBS -lpthread"
+    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
+        AC_MSG_RESULT(yes)
+        LIBPTHREAD="-lpthread"],[
+	AC_MSG_RESULT(no)])
+    LIBS=$kde_safe_libs
+  fi
+
+  dnl Un-special-case for FreeBSD.
+  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
+    LIBPTHREAD=""
+  fi
+
+  AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
+[
+      USE_THREADS=""
+      if test -z "$LIBPTHREAD"; then
+        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
+      fi
+
+    AH_VERBATIM(__svr_define, [
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+])
+    case $host_os in
+ 	solaris*)
+		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
+    		;;
+        freebsd*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
+                ;;
+        aix*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                LIBPTHREAD="$LIBPTHREAD -lc_r"
+                ;;
+        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+                if test "$CXX" = "KCC"; then
+                  CXXFLAGS="$CXXFLAGS --thread_safe"
+		  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
+                fi
+                ;;
+	*)
+		;;
+    esac
+    AC_SUBST(USE_THREADS)
+    AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN([KDE_CHECK_THREADING],
+[
+  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+  dnl default is yes if libpthread is found and no if no libpthread is available
+  if test -z "$LIBPTHREAD"; then
+    if test -z "$USE_THREADS"; then
+      kde_check_threading_default=no
+    else
+      kde_check_threading_default=yes
+    fi
+  else
+    kde_check_threading_default=yes
+  fi
+  AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
+   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+  if test "x$kde_use_threading" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+  fi
+])
+
+AC_DEFUN([KDE_TRY_LINK_PYTHON],
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+  AC_MSG_CHECKING(if a Python application links)
+else
+  AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+	PySys_SetArgv(1, 0);
+],
+	[kde_cv_try_link_python_$1=yes],
+	[kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+  AC_MSG_RESULT(yes)
+  kde_python_link_found=yes
+  if test ! "$1" = normal; then
+    LIBPYTHON="$LIBPYTHON $2"
+  fi
+  $3
+else
+  AC_MSG_RESULT(no)
+  $4
+fi
+
+fi
+
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_DIR],
+[
+AC_MSG_CHECKING([for Python directory])
+ 
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+  if test -z "$PYTHONDIR"; then
+    kde_cv_pythondir=/usr/local
+  else
+    kde_cv_pythondir="$PYTHONDIR"
+  fi
+])
+ 
+AC_ARG_WITH(pythondir,
+AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
+[
+  ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+ 
+AC_MSG_RESULT($ac_python_dir)
+])
+
+AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
+
+if test -z "$1"; then
+  version="1.5"
+else
+  version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+  python_incdir=$python_incdir/python$version
+  if test ! -r $python_incdir/Python.h; then
+    python_incdir=no
+  fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
+AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.so; then
+  AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+  if test ! -r $python_libdir/libpython$version.a; then
+    AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+    python_libdir=$python_libdir/python$version/config
+    if test ! -r $python_libdir/libpython$version.a; then
+      python_libdir=no
+    fi
+  fi
+fi
+
+PYTHONLIB=-L$python_libdir
+kde_orig_LIBPYTHON=$LIBPYTHON
+if test -z "$LIBPYTHON"; then
+  LIBPYTHON=-lpython$version
+fi
+
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+  python_moddir=no
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
+   LIBPYTHON=$kde_orig_LIBPYTHON
+   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
+   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
+   $2
+else 
+  dnl Note: this test is very weak
+  kde_python_link_found=no
+  KDE_TRY_LINK_PYTHON(normal)
+  KDE_TRY_LINK_PYTHON(m, -lm)
+  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+  KDE_TRY_LINK_PYTHON(db2, -ldb2)
+  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
+  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
+  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
+  KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
+  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
+	[AC_MSG_WARN([it seems, Python depends on another library.
+    Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
+    and contact the authors to let them know about this problem])
+	])
+
+  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+  AC_SUBST(PYTHONINC)
+  AC_SUBST(PYTHONLIB)
+  AC_SUBST(LIBPYTHON)
+  AC_SUBST(PYTHONMODDIR)
+  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
+fi
+
+])
+
+
+AC_DEFUN([KDE_CHECK_PYTHON],
+[
+  KDE_CHECK_PYTHON_INTERN("2.6",
+    [KDE_CHECK_PYTHON_INTERN("2.5",
+      [KDE_CHECK_PYTHON_INTERN("2.4",
+        [KDE_CHECK_PYTHON_INTERN("2.3", 
+          [KDE_CHECK_PYTHON_INTERN("2.2", 
+            [KDE_CHECK_PYTHON_INTERN("2.1", 
+              [KDE_CHECK_PYTHON_INTERN("2.0", 
+                [KDE_CHECK_PYTHON_INTERN($1, $2) ])
+              ])
+            ])
+          ])
+        ])
+      ])
+    ])
+])
+
+AC_DEFUN([KDE_CHECK_STL],
+[
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+
+    AC_MSG_CHECKING([if C++ programs can be compiled])
+    AC_CACHE_VAL(kde_cv_stl_works,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hallo Welt.";
+  astring.erase(0, 6); // now astring is "Welt"
+  return 0;
+], kde_cv_stl_works=yes,
+   kde_cv_stl_works=no)
+])
+
+   AC_MSG_RESULT($kde_cv_stl_works)
+
+   if test "$kde_cv_stl_works" = "yes"; then
+     # back compatible
+	 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+   else
+	 AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
+Check config.log for details - if you're using a Linux distribution you might miss
+a package named similar to libstdc++-dev.])
+   fi
+
+   CXXFLAGS="$ac_save_CXXFLAGS"
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN([AC_FIND_QIMGIO],
+   [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+		QString t = "hallo";
+		t.fill('t');
+		qInitImageIO();
+}
+],
+            ac_cv_lib_qimgio=yes,
+            ac_cv_lib_qimgio=no,
+	    ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+  AC_SUBST(LIBQIMGIO)
+else
+  AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN([AM_DISABLE_LIBRARIES],
+[
+    AC_PROVIDE([AM_ENABLE_STATIC])
+    AC_PROVIDE([AM_ENABLE_SHARED])
+    enable_static=no
+    enable_shared=yes
+])
+
+
+AC_DEFUN([AC_CHECK_UTMP_FILE],
+[
+    AC_MSG_CHECKING([for utmp file])
+
+    AC_CACHE_VAL(kde_cv_utmp_file,
+    [
+    kde_cv_utmp_file=no
+
+    for ac_file in    \
+                      \
+	/var/run/utmp \
+	/var/adm/utmp \
+	/etc/utmp     \
+     ; \
+    do
+     if test -r "$ac_file"; then
+       kde_cv_utmp_file=$ac_file
+       break
+     fi
+    done
+    ])
+
+    if test "$kde_cv_utmp_file" != "no"; then
+	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+	$1
+	AC_MSG_RESULT($kde_cv_utmp_file)
+    else
+    	$2
+	AC_MSG_RESULT([non found])
+    fi
+])
+
+
+AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+TOPSUBDIRS=""
+
+if test ! -s $srcdir/subdirs; then
+  dnl Note: Makefile.common creates subdirs, so this is just a fallback
+  files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+ac_topsubdirs=
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+elif test -s $srcdir/subdirs; then
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  AC_MSG_CHECKING([if $i should be compiled])
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  AC_MSG_RESULT($install_it)
+  vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+    eval "$vari""_SUBDIR_included=yes"
+  else
+    eval "$vari""_SUBDIR_included=no"
+  fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN([KDE_CHECK_NAMESPACES],
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+  extern int i;
+  namespace Bar {
+    extern int i;
+  }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure at kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_S_ISSOCK],
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+
+AH_VERBATIM(_ISSOCK,
+[
+#ifndef HAVE_S_ISSOCK
+#define HAVE_S_ISSOCK
+#define S_ISSOCK(mode) (1==0)
+#endif
+])
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure at kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+cat > conftest.$ac_ext <<EOF
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+    ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+AC_DEFUN([KDE_CHECK_HEADER],
+[
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADER([$1], [$2], [$3], [$4])
+   AC_LANG_RESTORE
+   CPPFLAGS=$kde_safe_cppflags
+])
+
+AC_DEFUN([KDE_CHECK_HEADERS],
+[
+   AH_CHECK_HEADERS([$1])
+   AC_LANG_SAVE
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
+   CPPFLAGS=$kde_safe_cppflags
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN([KDE_FAST_CONFIGURE],
+[
+  dnl makes configure fast (needs perl)
+  AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
+      with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN([KDE_CONF_FILES],
+[
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+  AC_SUBST(CONF_FILES)
+])dnl
+
+dnl This sets the prefix, for arts and kdelibs
+dnl Do NOT use in any other module.
+dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
+AC_DEFUN([KDE_SET_PREFIX_CORE],
+[
+  unset CDPATH
+  dnl make $KDEDIR the default for the installation
+  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+  if test "x$prefix" = "xNONE"; then
+    prefix=$ac_default_prefix
+    ac_configure_args="$ac_configure_args --prefix=$prefix"
+  fi
+  # And delete superfluous '/' to make compares easier
+  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+  kde_libs_prefix='$(prefix)'
+  kde_libs_htmldir='$(kde_htmldir)'
+  AC_SUBST(kde_libs_prefix)
+  AC_SUBST(kde_libs_htmldir)
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+
+AC_DEFUN([KDE_SET_PREFIX],
+[
+  unset CDPATH
+  dnl We can't give real code to that macro, only a value.
+  dnl It only matters for --help, since we set the prefix in this function anyway.
+  AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
+
+  KDE_SET_DEFAULT_BINDIRS
+  if test "x$prefix" = "xNONE"; then
+    dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
+    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+  else
+    dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
+    kde_save_PATH="$PATH"
+    PATH="$exec_prefix/bin:$prefix/bin:$PATH"
+    KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
+    PATH="$kde_save_PATH"
+  fi
+
+  kde_libs_prefix=`$KDECONFIG --prefix`
+  if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+       AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+                    This means it has been moved since you installed it.
+                    This won't work. Please recompile kdelibs for the new prefix.
+                    ])
+  fi
+  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+
+  AC_MSG_CHECKING([where to install])
+  if test "x$prefix" = "xNONE"; then
+    prefix=$kde_libs_prefix
+    AC_MSG_RESULT([$prefix (as returned by kde-config)])
+  else
+    dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
+    given_prefix=$prefix
+    AC_MSG_RESULT([$prefix (as requested)])
+  fi
+
+  # And delete superfluous '/' to make compares easier
+  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+  given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
+
+  AC_SUBST(KDECONFIG)
+  AC_SUBST(kde_libs_prefix)
+  AC_SUBST(kde_libs_htmldir)
+
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+  dnl our own version, testing for a -p flag
+  popdef([AC_PROG_INSTALL])
+  dnl as AC_PROG_INSTALL works as it works we first have
+  dnl to save if the user didn't specify INSTALL, as the
+  dnl autoconf one overwrites INSTALL and we have no chance to find
+  dnl out afterwards
+  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  AC_PROG_INSTALL
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    AC_MSG_CHECKING(for -p flag to install)
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    AC_MSG_RESULT($ac_res)
+  fi
+  dnl the following tries to resolve some signs and wonders coming up
+  dnl with different autoconf/automake versions
+  dnl e.g.:
+  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+  dnl   install- at DIR@PROGRAMS targets to explicitly use that flag
+  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
+  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
+  dnl  *sometimes KDE does not use the install- at DIR@PROGRAM targets from
+  dnl   automake (due to broken Makefile.am or whatever) to install programs,
+  dnl   and so does not see the -s flag in automake > 1.4
+  dnl to clean up that mess we:
+  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+  dnl   which cleans KDE's program with automake > 1.4;
+  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+  dnl   with automake<=1.4
+  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
+  dnl   properly uses install- at DIR@PROGRAMS, but I don't care
+  dnl
+  dnl And to all this comes, that I even can't write in comments variable
+  dnl  names used by automake, because it is so stupid to think I wanted to
+  dnl  _use_ them, therefor I have written A_M_... instead of AM_
+  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+])dnl
+
+AC_DEFUN([KDE_LANG_CPLUSPLUS],
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN([KDE_CHECK_LONG_LONG],
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  AC_TRY_LINK([], [
+  long long foo = 0;
+  foo = foo+1;
+  ],
+  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+  AC_LANG_RESTORE
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+AC_DEFUN([KDE_CHECK_LIB],
+[
+     kde_save_LDFLAGS="$LDFLAGS"
+     dnl AC_CHECK_LIB modifies LIBS, so save it here
+     kde_save_LIBS="$LIBS"
+     LDFLAGS="$LDFLAGS $all_libraries"
+     case $host_os in
+      aix*) LDFLAGS="-brtl $LDFLAGS"
+	test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
+	;;
+     esac
+     AC_CHECK_LIB($1, $2, $3, $4, $5)
+     LDFLAGS="$kde_save_LDFLAGS"
+     LIBS="$kde_save_LIBS"
+])
+
+AC_DEFUN([KDE_JAVA_PREFIX],
+[
+	dir=`dirname "$1"`
+	base=`basename "$1"`
+	list=`ls -1 $dir 2> /dev/null`
+	for entry in $list; do 
+		if test -d $dir/$entry/bin; then
+			case $entry in
+			   $base)
+				javadirs="$javadirs $dir/$entry/bin"
+				;;
+			esac
+		elif test -d $dir/$entry/jre/bin; then
+			case $entry in
+			   $base)
+				javadirs="$javadirs $dir/$entry/jre/bin"
+				;;
+			esac
+		fi
+	done
+])
+
+dnl KDE_CHEC_JAVA_DIR(onlyjre)
+AC_DEFUN([KDE_CHECK_JAVA_DIR],
+[
+
+AC_ARG_WITH(java,
+AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
+[  ac_java_dir=$withval
+], ac_java_dir=""
+)
+
+AC_MSG_CHECKING([for Java])
+
+dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
+if test "x$ac_java_dir" = "xno"; then
+   kde_java_bindir=no
+   kde_java_includedir=no
+   kde_java_libjvmdir=no
+   kde_java_libgcjdir=no
+   kde_java_libhpidir=no
+else
+  if test "x$ac_java_dir" = "x"; then
+     
+     
+      dnl No option set -> collect list of candidate paths
+      if test -n "$JAVA_HOME"; then
+        KDE_JAVA_PREFIX($JAVA_HOME)
+      fi
+      KDE_JAVA_PREFIX(/usr/j2se)
+      KDE_JAVA_PREFIX(/usr/lib/j2se)
+      KDE_JAVA_PREFIX(/usr/j*dk*)
+      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
+      KDE_JAVA_PREFIX(/opt/j*sdk*)
+      KDE_JAVA_PREFIX(/usr/lib/java*)
+      KDE_JAVA_PREFIX(/usr/java*)
+      KDE_JAVA_PREFIX(/usr/java/j*dk*)
+      KDE_JAVA_PREFIX(/usr/java/j*re*)
+      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
+      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
+      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
+      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
+      KDE_JAVA_PREFIX(/opt/java*)
+
+      kde_cv_path="NONE"
+      kde_save_IFS=$IFS
+      IFS=':'
+      for dir in $PATH; do
+	  if test -d "$dir"; then
+	      javadirs="$javadirs $dir"
+	  fi
+      done
+      IFS=$kde_save_IFS
+      jredirs=
+
+      dnl Now javadirs contains a list of paths that exist, all ending with bin/
+      for dir in $javadirs; do
+          dnl Check for the java executable
+	  if test -x "$dir/java"; then
+	      sane_path=$(cd $dir; /bin/pwd)
+	      dnl And also check for a libjvm.so somewhere under there
+	      dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
+              if test "$sane_path" != "/usr/bin"; then
+                  libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+		  if test ! -f $libjvmdir/libjvm.so; then continue; fi
+		  jredirs="$jredirs $dir"
+	      fi
+	  fi
+      done
+
+      dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
+      JAVAC=
+      JAVA=
+      kde_java_bindir=no
+      for dir in $jredirs; do
+	  JAVA="$dir/java"
+	  kde_java_bindir=$dir
+	  if test -x "$dir/javac"; then
+		JAVAC="$dir/javac"
+                break
+	  fi
+      done
+
+      if test -n "$JAVAC"; then
+          dnl this substitution might not work - well, we test for jni.h below
+          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
+      else
+          kde_java_includedir=no
+      fi
+  else
+    dnl config option set
+    kde_java_bindir=$ac_java_dir/bin
+    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
+	kde_java_includedir=no
+    else
+        kde_java_includedir=$ac_java_dir/include
+    fi
+  fi
+fi
+
+dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
+if test "x$kde_java_bindir" != "xno"; then
+
+  dnl Look for libjvm.so
+  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+  dnl Look for libgcj.so
+  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+  dnl Look for libhpi.so and avoid green threads
+  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
+
+  dnl Now check everything's fine under there
+  dnl the include dir is our flag for having the JDK
+  if test -d "$kde_java_includedir"; then
+    if test ! -x "$kde_java_bindir/javac"; then
+      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
+    fi
+    if test ! -x "$kde_java_bindir/javah"; then
+      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+    fi
+    if test ! -x "$kde_java_bindir/jar"; then
+      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+    fi
+    if test ! -r "$kde_java_includedir/jni.h"; then
+      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
+    fi
+
+    jni_includes="-I$kde_java_includedir"
+    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
+    dnl and under linux here.. 
+    
+    dnl not needed for gcj
+
+    if test "x$kde_java_libgcjdir" = "x"; then 
+      test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
+      test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
+      test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
+    fi
+
+  else
+    JAVAC=
+    jni_includes=
+  fi
+
+  if test "x$kde_java_libgcjdir" = "x"; then 
+     if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
+        AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
+     fi 
+  else
+     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
+        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
+     fi 
+  fi
+
+  if test ! -x "$kde_java_bindir/java"; then
+      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+  fi
+
+  dnl not needed for gcj compile
+
+  if test "x$kde_java_libgcjdir" = "x"; then 
+      if test ! -r "$kde_java_libhpidir/libhpi.so"; then
+        AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
+      fi
+  fi
+
+  if test -n "$jni_includes"; then
+    dnl Check for JNI version
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_cxxflags_safe="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
+
+    AC_TRY_COMPILE([
+  #include <jni.h>
+	      ],
+	      [
+  #ifndef JNI_VERSION_1_2
+  Syntax Error
+  #endif
+	      ],[ kde_jni_works=yes ],
+	      [ kde_jni_works=no ])
+
+    if test $kde_jni_works = no; then
+      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
+		    You need to have Java Development Kit (JDK) version 1.2. 
+
+		    Use --with-java to specify another location.
+		    Use --without-java to configure without java support.
+		    Or download a newer JDK and try again. 
+		    See e.g. http://java.sun.com/products/jdk/1.2 ])
+    fi
+
+    CXXFLAGS="$ac_cxxflags_safe"    
+    AC_LANG_RESTORE
+
+    dnl All tests ok, inform and subst the variables
+
+    JAVAC=$kde_java_bindir/javac
+    JAVAH=$kde_java_bindir/javah
+    JAR=$kde_java_bindir/jar
+    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+    if test "x$kde_java_libgcjdir" = "x"; then 
+      JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
+    else
+      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+    fi
+    AC_MSG_RESULT([java JDK in $kde_java_bindir])
+
+  else
+      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+      AC_MSG_RESULT([java JRE in $kde_java_bindir])
+  fi
+elif test -d "/Library/Java/Home"; then
+  kde_java_bindir="/Library/Java/Home/bin"
+  jni_includes="-I/Library/Java/Home/include"
+
+  JAVAC=$kde_java_bindir/javac
+  JAVAH=$kde_java_bindir/javah
+  JAR=$kde_java_bindir/jar
+  JVMLIBS="-Wl,-framework,JavaVM"
+
+  AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
+  AC_MSG_RESULT([Apple Java Framework])
+else
+  AC_MSG_RESULT([none found])
+fi
+
+AC_SUBST(JAVAC)
+AC_SUBST(JAVAH)
+AC_SUBST(JAR)
+AC_SUBST(JVMLIBS)
+AC_SUBST(jni_includes)
+
+# for backward compat
+kde_cv_java_includedir=$kde_java_includedir
+kde_cv_java_bindir=$kde_java_bindir
+])
+
+dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
+dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
+dnl big packages, m4_foreach is dog-slow.  So use our own version of
+dnl it.  (matz at kde.org)
+m4_define([mm_foreach],
+[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
+m4_define([mm_car], [[$1]])
+m4_define([mm_car2], [[$@]])
+m4_define([_mm_foreach],
+[m4_if(m4_quote($2), [], [],
+       [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
+                                                   mm_car2(m4_shift($2)),
+                                                   [$3])])])
+m4_define([AC_FOREACH],
+[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
+
+AC_DEFUN([KDE_NEED_FLEX],
+[
+kde_libs_safe=$LIBS
+LIBS="$LIBS $USER_LDFLAGS"
+AM_PROG_LEX
+LIBS=$kde_libs_safe
+if test -z "$LEXLIB"; then
+    AC_MSG_ERROR([You need to have flex installed.])
+fi
+AC_SUBST(LEXLIB)
+])
+
+AC_DEFUN([AC_PATH_QTOPIA],
+[
+  dnl TODO: use AC_CACHE_VAL
+
+  if test -z "$1"; then
+    qtopia_minver_maj=1
+    qtopia_minver_min=5
+    qtopia_minver_pat=0
+  else
+    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
+    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
+    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
+  fi
+
+  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
+  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
+
+  AC_REQUIRE([AC_PATH_QT])
+
+  AC_MSG_CHECKING([for Qtopia])
+
+  LIB_QTOPIA="-lqpe"
+  AC_SUBST(LIB_QTOPIA)
+
+  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
+
+  ac_qtopia_incdir=NO
+
+  AC_ARG_WITH(qtopia-dir,
+              AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
+              [  ac_qtopia_incdir="$withval"/include] ) 
+  
+  qtopia_incdirs=""
+  for dir in $kde_qtopia_dirs; do
+    qtopia_incdirs="$qtopia_incdirs $dir/include"
+  done
+
+  if test ! "$ac_qtopia_incdir" = "NO"; then
+    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
+  fi
+
+  qtopia_incdir=""
+  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
+  ac_qtopia_incdir="$qtopia_incdir"
+
+  if test -z "$qtopia_incdir"; then
+    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
+  fi
+
+  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
+  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
+  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
+
+  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
+  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
+  if test "$qtopia_ver" -lt "$qtopia_minver"; then
+    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
+is required.])
+  fi
+
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+
+  ac_cxxflags_safe="$CXXFLAGS"
+  ac_ldflags_safe="$LDFLAGS"
+  ac_libs_safe="$LIBS"
+
+  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
+  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
+
+  cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qpe/qpeapplication.h>
+#include <qpe/version.h>
+
+int main( int argc, char **argv )
+{
+    QPEApplication app( argc, argv );
+    return 0;
+}
+EOF
+
+  if AC_TRY_EVAL(ac_link) && test -s conftest; then
+    rm -f conftest*
+  else
+    rm -f conftest*
+    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
+the end of config.log])
+  fi
+
+  CXXFLAGS="$ac_cxxflags_safe"
+  LDFLAGS="$ac_ldflags_safe"
+  LIBS="$ac_libs_safe"
+
+  AC_LANG_RESTORE
+
+  QTOPIA_INCLUDES="-I$qtopia_incdir"
+  AC_SUBST(QTOPIA_INCLUDES)
+
+  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
+])
+
+
+AC_DEFUN([KDE_INIT_DOXYGEN],
+[
+AC_MSG_CHECKING([for Qt docs])
+kde_qtdir=
+if test "${with_qt_dir+set}" = set; then
+  kde_qtdir="$with_qt_dir"
+fi
+
+AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
+AC_MSG_RESULT($QTDOCDIR)
+
+AC_SUBST(QTDOCDIR)
+
+KDE_FIND_PATH(dot, DOT, [], [])
+if test -n "$DOT"; then
+  KDE_HAVE_DOT="YES"
+else
+  KDE_HAVE_DOT="NO"
+fi
+AC_SUBST(KDE_HAVE_DOT)
+KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
+AC_SUBST(DOXYGEN)
+
+DOXYGEN_PROJECT_NAME="$1"
+DOXYGEN_PROJECT_NUMBER="$2"
+AC_SUBST(DOXYGEN_PROJECT_NAME)
+AC_SUBST(DOXYGEN_PROJECT_NUMBER)
+
+KDE_HAS_DOXYGEN=no
+if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
+  KDE_HAS_DOXYGEN=yes
+fi
+AC_SUBST(KDE_HAS_DOXYGEN)
+
+])
+
+
+AC_DEFUN([AC_FIND_BZIP2],
+[
+AC_MSG_CHECKING([for bzDecompress in libbz2])
+AC_CACHE_VAL(ac_cv_lib_bzip2,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#define BZ_NO_STDIO
+#include<bzlib.h>
+],
+            [ bz_stream s; (void) bzDecompress(&s); ],
+            eval "ac_cv_lib_bzip2='-lbz2'",
+            eval "ac_cv_lib_bzip2=no")
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+AC_MSG_RESULT($ac_cv_lib_bzip2)
+
+if test ! "$ac_cv_lib_bzip2" = no; then
+  BZIP2DIR=bzip2
+
+  LIBBZ2="$ac_cv_lib_bzip2"
+  AC_SUBST(LIBBZ2)
+
+else
+
+   cxx_shared_flag=
+   ld_shared_flag=
+   KDE_CHECK_COMPILER_FLAG(shared, [
+	ld_shared_flag="-shared"
+   ])
+   KDE_CHECK_COMPILER_FLAG(fPIC, [
+        cxx_shared_flag="-fPIC"
+   ])
+
+   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
+   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
+   [
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   kde_save_LIBS="$LIBS"
+   LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
+   kde_save_CXXFLAGS="$CXXFLAGS"
+   CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
+
+   AC_TRY_LINK(dnl
+   [
+   #define BZ_NO_STDIO
+   #include<bzlib.h>
+   ],
+               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
+               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
+               eval "ac_cv_lib_bzip2_prefix=no")
+   LIBS="$kde_save_LIBS"
+   CXXFLAGS="$kde_save_CXXFLAGS"
+   AC_LANG_RESTORE
+   ])dnl
+
+   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
+   
+   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
+     BZIP2DIR=bzip2
+    
+     LIBBZ2="$ac_cv_lib_bzip2_prefix"
+     AC_SUBST(LIBBZ2)
+
+     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
+   dnl else, we just ignore this
+   fi
+
+fi
+AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the SSL headers and libraries.
+dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
+dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN([KDE_CHECK_SSL],
+[
+LIBSSL="-lssl -lcrypto"
+AC_REQUIRE([KDE_CHECK_LIB64])
+
+ac_ssl_includes=NO ac_ssl_libraries=NO
+ssl_libraries=""
+ssl_includes=""
+AC_ARG_WITH(ssl-dir,
+    AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
+    [  ac_ssl_includes="$withval"/include
+       ac_ssl_libraries="$withval"/lib$kdelibsuff
+    ])
+
+want_ssl=yes
+AC_ARG_WITH(ssl,
+    AC_HELP_STRING([--without-ssl],[disable SSL checks]),
+    [want_ssl=$withval])
+
+if test $want_ssl = yes; then
+
+AC_MSG_CHECKING(for OpenSSL)
+
+AC_CACHE_VAL(ac_cv_have_ssl,
+[#try to guess OpenSSL locations
+  
+  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
+  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
+  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
+  ac_ssl_includes="$ssl_incdir"
+
+  ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
+  if test ! "$ac_ssl_libraries" = "NO"; then
+    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
+  fi
+
+  test=NONE
+  ssl_libdir=NONE
+  for dir in $ssl_libdirs; do
+    try="ls -1 $dir/libssl*"
+    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+
+  ac_ssl_libraries="$ssl_libdir"
+
+  ac_ldflags_safe="$LDFLAGS"
+  ac_libs_safe="$LIBS"
+
+  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
+  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
+
+  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
+  ac_ssl_rsaref="yes"
+  ,
+  ac_ssl_rsaref="no"
+  )
+
+  LDFLAGS="$ac_ldflags_safe"
+  LIBS="$ac_libs_safe"
+
+  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
+    have_ssl=no
+  else
+    have_ssl=yes;
+  fi
+
+  ])
+
+  eval "$ac_cv_have_ssl"
+
+  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
+
+  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
+  AC_MSG_RESULT($ac_ssl_rsaref)
+
+  AC_MSG_CHECKING([for easter eggs])
+  AC_MSG_RESULT([none found])
+
+else
+  have_ssl=no
+fi
+
+if test "$have_ssl" = yes; then
+  AC_MSG_CHECKING(for OpenSSL version)
+  dnl Check for SSL version
+  AC_CACHE_VAL(ac_cv_ssl_version,
+  [
+
+    cat >conftest.$ac_ext <<EOF
+#include <openssl/opensslv.h>
+#include <stdio.h>
+    int main() {
+ 
+#ifndef OPENSSL_VERSION_NUMBER
+      printf("ssl_version=\\"error\\"\n");
+#else
+      if (OPENSSL_VERSION_NUMBER < 0x00906000)
+        printf("ssl_version=\\"old\\"\n");
+      else
+        printf("ssl_version=\\"ok\\"\n");
+#endif
+     return (0);
+    }
+EOF
+
+    ac_save_CPPFLAGS=$CPPFLAGS
+    if test "$ac_ssl_includes" != "/usr/include"; then
+        CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
+    fi
+
+    if AC_TRY_EVAL(ac_link); then 
+
+      if eval `./conftest 2>&5`; then
+        if test $ssl_version = error; then
+          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
+        else
+          if test $ssl_version = old; then
+            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
+            have_ssl=no
+          fi
+        fi
+        ac_cv_ssl_version="ssl_version=$ssl_version"
+      else
+        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
+        Check config.log, and if you can't figure it out, send a mail to 
+        David Faure <faure at kde.org>, attaching your config.log])
+      fi
+
+    else
+      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
+      Check config.log, and if you can't figure it out, send a mail to 
+      David Faure <faure at kde.org>, attaching your config.log])
+    fi 
+    CPPFLAGS=$ac_save_CPPFLAGS
+
+  ])
+
+  eval "$ac_cv_ssl_version"
+  AC_MSG_RESULT($ssl_version)
+fi
+
+if test "$have_ssl" != yes; then
+  LIBSSL="";
+else
+  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
+  ac_cv_have_ssl="have_ssl=yes \
+    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
+  
+  
+  ssl_libraries="$ac_ssl_libraries"
+  ssl_includes="$ac_ssl_includes"
+
+  if test "$ac_ssl_rsaref" = yes; then
+    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
+  fi
+
+  if test $ssl_version = "old"; then
+    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
+  fi
+fi
+
+SSL_INCLUDES=
+
+if test "$ssl_includes" = "/usr/include"; then
+  if test -f /usr/kerberos/include/krb5.h; then
+	SSL_INCLUDES="-I/usr/kerberos/include"
+  fi
+elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
+  SSL_INCLUDES="-I$ssl_includes"
+fi
+
+if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
+ SSL_LDFLAGS=""
+else
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
+fi
+
+AC_SUBST(SSL_INCLUDES)
+AC_SUBST(SSL_LDFLAGS)
+AC_SUBST(LIBSSL)
+])
+
+AC_DEFUN([KDE_CHECK_STRLCPY],
+[
+  AC_REQUIRE([AC_CHECK_STRLCAT])
+  AC_REQUIRE([AC_CHECK_STRLCPY])
+  AC_CHECK_SIZEOF(size_t)
+  AC_CHECK_SIZEOF(unsigned long)
+
+  AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
+  AC_TRY_COMPILE(,[
+    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
+       choke me
+    #endif
+    ],AC_MSG_RESULT([yes]),[
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([
+       Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
+       does not apply. Please mail kde-devel at kde.org with a description of your system!
+      ])
+  ])
+])
+
+AC_DEFUN([KDE_CHECK_BINUTILS],
+[
+  AC_MSG_CHECKING([if ld supports unversioned version maps])
+
+  kde_save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+  echo "{ local: extern \"C++\" { foo }; };" > conftest.map
+  AC_TRY_LINK([int foo;],
+[
+#ifdef __INTEL_COMPILER
+icc apparently does not support libtools version-info and version-script
+at the same time. Dunno where the bug is, but until somebody figured out,
+better disable the optional version scripts.
+#endif
+
+  foo = 42;
+], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
+  LDFLAGS="$kde_save_LDFLAGS"
+  rm -f conftest.map
+  AM_CONDITIONAL(include_VERSION_SCRIPT, 
+    [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
+
+  AC_MSG_RESULT($kde_supports_versionmaps)
+])
+
+AC_DEFUN([AM_PROG_OBJC],[
+AC_CHECK_PROGS(OBJC, gcc, gcc)
+test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
+if test "x${OBJCFLAGS-unset}" = xunset; then
+   OBJCFLAGS="-g -O2"
+fi
+AC_SUBST(OBJCFLAGS)
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
+])
+
+AC_DEFUN([KDE_CHECK_PERL],
+[
+	KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
+		    AC_MSG_ERROR([No Perl found in your $PATH.
+We need perl to generate some code.])
+	])
+    AC_SUBST(PERL)
+])
+
+AC_DEFUN([KDE_CHECK_LARGEFILE],
+[
+AC_SYS_LARGEFILE
+if test "$ac_cv_sys_file_offset_bits" != no; then
+  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+fi
+
+if test "x$ac_cv_sys_large_files" != "xno"; then
+  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
+fi
+
+])
+
+dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
+dnl which allows to search for libs that get installed into the KDE prefix.
+dnl
+dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
+dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
+dnl also defines KSTUFF_PKG_ERRORS on error
+AC_DEFUN([KDE_PKG_CHECK_MODULES], [
+
+   PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+   if test "$prefix" != "$kde_libs_prefix"; then
+       PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
+   fi
+   export PKG_CONFIG_PATH
+   PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
+])
+
+
+dnl Check for PIE support in the compiler and linker
+AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
+[
+  AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
+  [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    safe_CXXFLAGS=$CXXFLAGS
+    safe_LDFLAGS=$LDFLAGS
+    CXXFLAGS="$CXXFLAGS -fPIE"
+    LDFLAGS="$LDFLAGS -pie"
+
+    AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
+
+    CXXFLAGS=$safe_CXXFLAGS
+    LDFLAGS=$safe_LDFLAGS
+    AC_LANG_RESTORE
+  ])
+
+  AC_MSG_CHECKING(if enabling -pie/fPIE support)
+
+  AC_ARG_ENABLE(pie,
+    AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
+      [kde_has_pie_support=$enableval],
+      [kde_has_pie_support=detect])
+
+  if test "$kde_has_pie_support" = "detect"; then
+    kde_has_pie_support=$kde_cv_val_pie_support
+  fi
+
+  AC_MSG_RESULT([$kde_has_pie_support])
+
+  KDE_USE_FPIE=""
+  KDE_USE_PIE=""
+
+  AC_SUBST([KDE_USE_FPIE])
+  AC_SUBST([KDE_USE_PIE])
+
+  if test "$kde_has_pie_support" = "yes"; then
+    KDE_USE_FPIE="-fPIE"
+    KDE_USE_PIE="-pie"
+  fi
+])
diff --git a/lib-src/taglib/admin/am_edit b/lib-src/taglib/admin/am_edit
new file mode 100644
index 0000000..c293132
--- /dev/null
+++ b/lib-src/taglib/admin/am_edit
@@ -0,0 +1,2445 @@
+#!/usr/bin/perl -w
+
+# Expands the specialised KDE tags in Makefile.in to (hopefully) valid
+# make syntax.
+# When called without file parameters, we work recursively on all Makefile.in
+# in and below the current subdirectory. When called with file parameters,
+# only those Makefile.in are changed.
+# The currently supported tags are
+#
+# {program}_METASOURCES
+# where you have a choice of two styles
+#   {program}_METASOURCES = name1.moc name2.moc ... [\]
+#   {program}_METASOURCES = AUTO
+#       The second style requires other tags as well.
+#
+# To install icons :
+#    KDE_ICON = iconname iconname2 ...
+#    KDE_ICON = AUTO
+#
+# For documentation :
+#    http://developer.kde.org/documentation/other/developer-faq.html
+#
+# and more new tags TBD!
+#
+# The concept (and base code) for this program came from automoc,
+# supplied by the following
+#
+# Matthias Ettrich <ettrich at kde.org>      (The originator)
+# Kalle Dalheimer <kalle at kde.org>      (The original implementator)
+# Harri Porten  <porten at tu-harburg.de>
+# Alex Zepeda  <jazepeda at pacbell.net>
+# David Faure <faure at kde.org>
+# Stephan Kulow <coolo at kde.org>
+# Dirk Mueller <mueller at kde.org>
+
+use Cwd;
+use File::Find;
+use File::Basename;
+
+# Prototype the functions
+sub initialise ();
+sub processMakefile ($);
+sub updateMakefile ();
+sub restoreMakefile ();
+
+sub removeLine ($$);
+sub appendLines ($);
+sub substituteLine ($$);
+
+sub findMocCandidates ();
+sub pruneMocCandidates ($);
+sub checkMocCandidates ();
+sub addMocRules ();
+sub findKcfgFile($);
+
+sub tag_AUTOMAKE ();
+sub tag_META_INCLUDES ();
+sub tag_METASOURCES ();
+sub tag_POFILES ();
+sub tag_DOCFILES ();
+sub tag_LOCALINSTALL();
+sub tag_IDLFILES();
+sub tag_UIFILES();
+sub tag_KCFGFILES();
+sub tag_SUBDIRS();
+sub tag_ICON();
+sub tag_CLOSURE();
+sub tag_NO_UNDEFINED();
+sub tag_NMCHECK();
+sub tag_DIST();
+sub tag_KDEINIT();
+
+# Some global globals...
+$verbose    = 0;        # a debug flag
+$thisProg   = "$0";     # This programs name
+$topdir     = cwd();    # The current directory
+ at makefiles  = ();       # Contains all the files we'll process
+ at foreignfiles = ();
+$start      = (times)[0]; # some stats for testing - comment out for release
+$version    = "v0.2";
+$errorflag  = 0;
+$cppExt     = "(cpp|cc|cxx|C|c\\+\\+)";
+$hExt       = "(h|H|hh|hxx|hpp|h\\+\\+)";
+$progId     = "KDE tags expanded automatically by " . basename($thisProg);
+$automkCall = "\n";
+$printname  = "";  # used to display the directory the Makefile is in
+$use_final  = 1;        # create code for --enable-final
+$cleantarget = "clean";
+$dryrun     = 0;
+$pathoption = 0;
+$foreign_libtool = 0;
+
+while (defined ($ARGV[0]))
+{
+    $_ = shift;
+    if (/^--version$/)
+    {
+        print STDOUT "\n";
+        print STDOUT basename($thisProg), " $version\n",
+                "This is really free software, unencumbered by the GPL.\n",
+                "You can do anything you like with it except sueing me.\n",
+                "Copyright 1998 Kalle Dalheimer <kalle\@kde.org>\n",
+                "Concept, design and unnecessary questions about perl\n",
+                "       by Matthias Ettrich <ettrich\@kde.org>\n\n",
+                "Making it useful by Stephan Kulow <coolo\@kde.org> and\n",
+                "Harri Porten <porten\@kde.org>\n",
+                "Updated (Feb-1999), John Birch <jb.nz\@writeme.com>\n",
+                "Fixes and Improvements by Dirk Mueller <mueller\@kde.org>\n",
+	        "Current Maintainer Stephan Kulow\n\n";
+        exit 0;
+    }
+    elsif (/^--verbose$|^-v$/)
+    {
+        $verbose = 1;       # Oh is there a problem...?
+    }
+    elsif (/^(?:-p|--path=)(.+)$/)
+    {
+        my $p = $1;
+        $thisProg = $p . "/". basename($thisProg);
+        warn ("$thisProg doesn't exist\n")      if (!(-f $thisProg));
+        $thisProg .= " -p".$p;
+        $pathoption=1;
+    }
+    elsif (/^--help$|^-h$/)
+    {
+        print STDOUT "Usage $thisProg [OPTION] ... [dir/Makefile.in]...\n",
+                "\n",
+                "Patches dir/Makefile.in generated by automake\n",
+                "(where dir can be an absolute or relative directory name)\n",
+                "\n",
+                "  -v, --verbose      verbosely list files processed\n",
+                "  -h, --help         print this help, then exit\n",
+                "  --version          print version number, then exit\n",
+                "  -p, --path=        use the path to am_edit if the path\n",
+                "                     called from is not the one to be used\n",
+	        "  --no-final         don't patch for --enable-final\n";
+	
+        exit 0;
+    }
+    elsif (/^--no-final$/)
+    {
+	$use_final = 0;
+        $thisProg .= " --no-final";
+    }
+    elsif (/^--foreign-libtool$/)
+    {
+        $foreign_libtool = 1;
+        $thisProg .= " --foreign-libtool";
+    }
+    elsif (/^-n$/)
+    {
+    	$dryrun = 1;
+    }
+    else
+    {
+        # user selects what input files to check
+        # add full path if relative path is given
+        $_ = cwd()."/".$_   if (! /^\//);
+        print "User wants $_\n" if ($verbose);
+        push (@makefiles, $_);
+    }
+}
+
+if ($thisProg =~ /^\// && !$pathoption )
+{
+  print STDERR "Illegal full pathname call performed...\n",
+      "The call to \"$thisProg\"\nwould be inserted in some Makefile.in.\n",
+      "Please use option --path.\n";
+  exit 1;
+}
+
+# Only scan for files when the user hasn't entered data
+if (!@makefiles)
+{
+    print STDOUT "Scanning for Makefile.in\n"       if ($verbose);
+    find (\&add_makefile, cwd());
+    #chdir('$topdir');
+} else {
+    print STDOUT "Using input files specified by user\n"   if ($verbose);
+}
+
+foreach $makefile (sort(@makefiles))
+{
+    processMakefile ($makefile);
+    last            if ($errorflag);
+}
+
+# Just some debug statistics - comment out for release as it uses printf.
+printf STDOUT "Time %.2f CPU sec\n", (times)[0] - $start     if ($verbose);
+
+exit $errorflag;        # causes make to fail if erroflag is set
+
+#-----------------------------------------------------------------------------
+
+# In conjunction with the "find" call, this builds the list of input files
+sub add_makefile ()
+{
+  push (@makefiles, $File::Find::name) if (/Makefile.in$/);
+}
+
+#-----------------------------------------------------------------------------
+
+# Processes a single make file
+# The parameter contains the full path name of the Makefile.in to use
+sub processMakefile ($)
+{
+    # some useful globals for the subroutines called here
+    local ($makefile)       = @_;
+    local @headerdirs       = ('.');
+    local $haveAutomocTag   = 0;
+    local $MakefileData     = "";
+
+    local $cxxsuffix  = "KKK";
+
+    local @programs = ();  # lists the names of programs and libraries
+    local $program = "";
+
+    local @kdeinits = (); # lists the kdeinit targets
+
+    local %realObjs = ();  # lists the objects compiled into $program
+    local %sources = ();   # lists the sources used for $program
+    local %finalObjs = (); # lists the objects compiled when final
+    local %realname = ();  # the binary name of program variable
+    local %idlfiles = ();  # lists the idl files used for $program
+    local %globalmocs = ();# list of all mocfiles (in %mocFiles format)
+    local %important = (); # list of files to be generated asap
+    local %uiFiles = ();
+    local %kcfgFiles = ();
+
+    local $allidls = "";
+    local $idl_output = "";# lists all idl generated files for cleantarget
+    local $ui_output = "";# lists all uic generated files for cleantarget
+    local $kcfg_output = "";# lists all kcfg generated files for cleantarget
+
+    local %dependmocs = ();
+    
+    local $metasourceTags = 0;
+    local $dep_files      = "";
+    local $dep_finals     = "";
+    local %target_adds    = (); # the targets to add
+    local %rule_adds      = ();
+    local $kdelang        = "";
+    local @cleanfiles     = ();
+    local $cleanMoc       = "";
+    local $closure_output = "";
+
+    local %varcontent     = ();
+
+    $makefileDir = dirname($makefile);
+    chdir ($makefileDir);
+    $printname = $makefile;
+    $printname =~ s/^\Q$topdir\E\///;
+    $makefile = basename($makefile);
+
+    print STDOUT "Processing makefile $printname\n"   if ($verbose);
+
+    # Setup and see if we need to do this.
+    return      if (!initialise());
+
+    tag_AUTOMAKE ();            # Allows a "make" to redo the Makefile.in
+    tag_META_INCLUDES ();       # Supplies directories for src locations
+
+    foreach $program (@programs) {
+        $sources_changed{$program} = 0;
+        $dependmocs{$program} = "";
+        $important{$program} = "";
+	tag_IDLFILES();             # Sorts out idl rules
+	tag_NO_UNDEFINED();
+	tag_CLOSURE();
+	tag_NMCHECK();
+	tag_UIFILES();              # Sorts out ui rules
+	tag_KCFGFILES();            # Sorts out kcfg rules
+        tag_METASOURCES ();         # Sorts out the moc rules
+        if ($sources_changed{$program}) {
+            my $lookup = $program . '_SOURCES\s*=[ \t]*(.*)';
+
+            if($program =~ /libkdeinit_(.*)/) {
+                my $prog = $1;
+                substituteLine($prog . '_SOURCES\s*=[ \t]*(.*)', 
+                    "${prog}_SOURCES = ${prog}_dummy.$cxxsuffix\n" .
+                    "libkdeinit_${prog}_SOURCES = " . $sources{$program});
+                $sources{$prog} = "${prog}_dummy.$cxxsuffix";
+            }
+            else {
+                substituteLine($lookup, "$program\_SOURCES=" . $sources{$program});
+            }
+        }
+        if ($important{$program}) {
+            local %source_dict = ();
+            for $source (split(/[\034\s]+/, $sources{$program})) {
+                $source_dict{$source} = 1;
+            }
+            for $source (@cleanfiles) {
+                $source_dict{$source} = 0;
+            }
+            for $source (keys %source_dict) {
+                next if (!$source);
+                if ($source_dict{$source}) {
+                    # sanity check
+                    if (! -f $source) {
+                        print STDERR "Error: $source is listed in a _SOURCE line in $printname, but doesn't exist yet. Put it in DISTCLEANFILES!\n";
+                    } else {
+                        $target_adds{"\$(srcdir)/$source"} .= $important{$program};
+                    }
+                }
+            }
+        }
+    }
+    if ($cleanMoc) {
+        # Always add dist clean tag
+        # Add extra *.moc.cpp files created for USE_AUTOMOC because they
+        # aren't included in the normal *.moc clean rules.
+        appendLines ("$cleantarget-metasources:\n\t-rm -f $cleanMoc\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-metasources ";
+    }
+    
+    tag_DIST() unless ($kdeopts{"noautodist"});
+
+    if ($idl_output) {
+        appendLines ("$cleantarget-idl:\n\t-rm -f $idl_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-idl ";
+    }
+
+    if ($ui_output) {
+        appendLines ("$cleantarget-ui:\n\t-rm -f $ui_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-ui ";
+    }
+
+    if ($kcfg_output) {
+        appendLines ("$cleantarget-kcfg:\n\t-rm -f $kcfg_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-kcfg ";
+    }
+
+    if ($closure_output) {
+        appendLines ("$cleantarget-closures:\n\t-rm -f $closure_output\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-closures ";
+    }
+
+    if ($MakefileData =~ /\nKDE_LANG\s*=\s*(\S*)\s*\n/) {
+        $kdelang = '$(KDE_LANG)'
+    } else {
+        $kdelang = '';
+    }
+
+    tag_POFILES ();             # language rules for po directory
+    tag_DOCFILES ();            # language rules for doc directories
+    tag_LOCALINSTALL();         # add $(DESTDIR) before all kde_ dirs
+    tag_ICON();
+    tag_SUBDIRS();
+
+    my $tmp = "force-reedit:\n";
+    $tmp   .= "\t$automkCall\n\tcd \$(top_srcdir) && perl $thisProg $printname\n\n";
+    appendLines($tmp);
+
+    make_bcheck_target();
+    make_meta_classes();
+    tag_COMPILE_FIRST();
+    tag_FINAL() if (!$kdeopts{"nofinal"});
+
+    my $final_lines = "final:\n\t\$(MAKE) ";
+    my $final_install_lines = "final-install:\n\t\$(MAKE) ";
+    my $nofinal_lines = "no-final:\n\t\$(MAKE) ";
+    my $nofinal_install_lines = "no-final-install:\n\t\$(MAKE) ";
+
+    foreach $program (@programs) {
+        my $lookup = $program . '_OBJECTS\s*=[ \t]*.*';
+        my $new = "";
+        my @list = split(/[\034\s]+/, $realObjs{$program});
+        if (!$kdeopts{"nofinal"} && @list > 1 && $finalObjs{$program}) {
+            $new .= "$program\_final\_OBJECTS = " . $finalObjs{$program};
+            $new .= "\n$program\_nofinal\_OBJECTS = " . $realObjs{$program};
+            $new .= "\n\@KDE_USE_FINAL_FALSE\@$program\_OBJECTS = \$($program\_nofinal\_OBJECTS)";
+            $new .= "\n\@KDE_USE_FINAL_TRUE\@$program\_OBJECTS = \$($program\_final\_OBJECTS)";
+
+            $final_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" ";
+            $final_install_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" ";
+            $nofinal_lines .= "$program\_OBJECTS=\"\$($program\_nofinal\_OBJECTS)\" ";
+            $nofinal_install_lines .= "$program\_OBJECTS=\"\$($program\_nofinal_OBJECTS)\" ";
+        } else {
+            $new = "$program\_OBJECTS = " . $realObjs{$program};
+        }
+        if($MakefileData =~ m/\n$lookup/) {
+            substituteLine ($lookup, $new);
+        }
+        else {
+            appendLines("$new\n");
+        }
+    }
+    appendLines($final_lines . "all-am\n");
+    appendLines($final_install_lines . "install-am\n");
+    appendLines($nofinal_lines . "all-am\n");
+    appendLines($nofinal_install_lines . "install-am\n");
+
+    my $lookup = '(\@\S+\@)?DEP_FILES\s*=[ \t]*(.*)';
+    if ($MakefileData =~ /\n$lookup/) {
+        my $condition = $1;
+        my $depfiles = $2;
+        my $workfiles;
+
+        if ($dep_finals) {
+            # Add the conditions on every line, since
+            # there may be line continuations in the list.
+            $workfiles = "$dep_files $dep_finals $depfiles";
+            $workfiles =~ s/\034/\034$condition\@KDE_USE_FINAL_TRUE\@\t/g;
+            $lines  = "$condition\@KDE_USE_FINAL_TRUE\@DEP_FILES = $workfiles\n";
+            $workfiles = "$dep_files $depfiles";
+            $workfiles =~ s/\034/\034$condition\@KDE_USE_FINAL_FALSE\@\t/g;
+            $lines .= "$condition\@KDE_USE_FINAL_FALSE\@DEP_FILES = $workfiles";
+        } else {
+            $workfiles = "$dep_files $depfiles";
+            $workfiles =~ s/\034/\034$condition\t/g;
+            $lines = $condition . "DEP_FILES = $workfiles";
+        }
+        substituteLine($lookup, $lines);
+    }
+
+    # new recursive targets
+    $target_adds{ "nmcheck" } .= ""; # always create nmcheck target
+    $target_adds{ "nmcheck-am" } .= "nmcheck";
+    $lookup = 'RECURSIVE_TARGETS\s*=[ \t]*(.*)';
+    if ($MakefileData =~ /\n$lookup/) {
+      substituteLine($lookup, "RECURSIVE_TARGETS = $1 nmcheck-recursive bcheck-recursive");
+    }
+
+    $cvs_lines  = "kde-rpo-clean:\n";
+    $cvs_lines .= "\t-rm -f *.rpo\n";
+    appendLines($cvs_lines);
+    $target_adds{"clean"} .= "kde-rpo-clean ";
+
+    my %target_dels = ("install-data-am" => "");
+
+    # some strange people like to do a install-exec, and expect that also
+    # all modules are installed.  automake doesn't know this, so we need to move
+    # this here from install-data to install-exec.
+    if ($MakefileData =~ m/\nkde_module_LTLIBRARIES\s*=/) {
+#      $target_adds{"install-exec-am"} .= "install-kde_moduleLTLIBRARIES ";
+#      don't use $target_adds here because we need to append the dependency, not
+#      prepend it. Fixes #44342 , when a module depends on a lib in the same dir
+#      and libtool needs it during relinking upon install (Simon)
+      my $lookup = "install-exec-am:([^\n]*)";
+      if($MakefileData =~ /\n$lookup\n/) {
+        substituteLine("$lookup", "install-exec-am: $1 install-kde_moduleLTLIBRARIES");
+      }
+      $target_dels{"install-data-am"} .= "install-kde_moduleLTLIBRARIES ";
+      $target_adds{"install-data-am"} .= " ";
+    }
+
+    my $lines = "";
+
+    foreach $add (keys %target_adds) {
+	my $lookup = quotemeta($add) . ':([^\n]*)';
+        if ($MakefileData =~ /\n$lookup\n/) {
+	  my $newlines = $1;
+	  my $oldlines = $lookup;
+	  if (defined $target_dels{$add}) {
+	    foreach $del (split(' ', $target_dels{$add})) {
+	      $newlines =~ s/\s*$del\s*/ /g;
+	    }
+	  }
+	  substituteLine($oldlines, "$add: " . $target_adds{$add} . $newlines);
+        } else {
+	  $lines .= "$add: " . $target_adds{$add} . "\n";
+        }
+    }
+
+    appendLines($lines) if ($lines);
+
+    $lines = join("\n", values %rule_adds);
+    appendLines($lines) if ($lines);
+
+    my $found = 1;
+
+    while ($found) {
+        if ($MakefileData =~ m/\n(.*)\$\(CXXFLAGS\)(.*)\n/) {
+            my $stuff_before = $1;
+            my $stuff_after = $2;
+            my $lookup = quotemeta("$1\$(CXXFLAGS)$2");
+            my $replacement = "$1\$(KCXXFLAGS)$2";
+            $MakefileData =~ s/$lookup/$replacement/;
+            $lookup =~ s/\\\$\\\(CXXFLAGS\\\)/\\\$\\\(KCXXFLAGS\\\)/;
+            $replacement = "$stuff_before\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$stuff_after";
+            next if ($stuff_before =~ /\$\(KDE_CXXFLAGS\)/ or $stuff_after =~ /\$\(KDE_CXXFLAGS\)/);
+            substituteLine($lookup, $replacement);
+        } else {
+            $found = 0;
+        }
+    }
+
+    if($foreign_libtool == 0) {
+        $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=link) (\$\(CXXLD\).*\$\(KCXXFLAGS\))';
+
+        if ($MakefileData =~ m/$lookup/ ) {
+            $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+        }
+
+        $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=compile)\s+(\$\(CXX\)\s+)';
+        if ($MakefileData =~ m/$lookup/ ) {
+            $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+        }
+    }
+
+    $MakefileData =~ s/\$\(KCXXFLAGS\)/\$\(CXXFLAGS\)/g;
+
+    $lookup = '(.*)cp -pr \$\$/\$\$file \$\(distdir\)/\$\$file(.*)';
+    if ($MakefileData =~ m/\n$lookup\n/) {
+        substituteLine($lookup, "$1cp -pr \$\$d/\$\$file \$(distdir)/\$\$file$2");
+    }
+
+    # Always update the Makefile.in
+    updateMakefile ();
+    return;
+}
+
+#-----------------------------------------------------------------------------
+
+# Beware: This procedure is not complete.  E.g. it also parses lines
+# containing a '=' in rules (for instance setting shell vars).  For our
+# usage this us enough, though.
+sub read_variables ()
+{
+    while ($MakefileData =~ /\n\s*(\S+)\s*=([^\n]*)/g) {
+        $varcontent{$1} = $2;
+    }
+}
+
+# Check to see whether we should process this make file.
+# This is where we look for tags that we need to process.
+# A small amount of initialising on the tags is also done here.
+# And of course we open and/or create the needed make files.
+sub initialise ()
+{
+    if (! -r "Makefile.am") {
+	print STDOUT "found Makefile.in without Makefile.am\n" if ($verbose);
+	return 0;
+    }
+
+    # Checking for files to process...
+
+    open (FILEIN, $makefile) || die "Can't open $makefileDir/$makefile: $!\n";
+    # perl bug in 5.8.0: in utf8 mode it badly screws up
+    binmode(FILEIN, ":bytes") if ($] >= 5.008);
+    # Read the file
+    # stat(FILEIN)[7] might look more elegant, but is slower as it 
+    # requires stat'ing the file
+    seek(FILEIN, 0, 2);
+    my $fsize = tell(FILEIN);
+    seek(FILEIN, 0, 0);
+    read FILEIN, $MakefileData, $fsize;
+    close FILEIN;
+    print "DOS CRLF within $makefileDir/$makefile!\n" if($MakefileData =~ y/\r//d);
+
+    # Remove the line continuations, but keep them marked
+    # Note: we lose the trailing spaces but that's ok.
+    # Don't mangle line-leading spaces (usually tabs)
+    # since they're important.
+    $MakefileData =~ s/\\\s*\n/\034/g;
+
+    # If we've processed the file before...
+    restoreMakefile ()      if ($MakefileData =~ /$progId/);
+
+    foreach $dir (@foreignfiles) {
+      if (substr($makefileDir,0,length($dir)) eq $dir) {
+	return 0;
+      }
+    }
+
+    %kdeopts = ();
+    $kdeopts{"foreign"} = 0;
+    $kdeopts{"qtonly"} = 0;
+    $kdeopts{"noautodist"} = 0;
+    $kdeopts{"foreign-libtool"} = $foreign_libtool;
+    $kdeopts{"nofinal"} = !$use_final; # default
+
+    read_variables();
+
+    if ($MakefileData =~ /\nKDE_OPTIONS\s*=[ \t]*([^\n]*)\n/) {
+	my $kde_options_str = $1;
+        local @kde_options = split(/[\034\s]+/, $kde_options_str);
+        if (grep(/^foreign$/, @kde_options)) {
+            push(@foreignfiles, $makefileDir . "/");
+            return 0; # don't touch me
+        }
+        for $opt (@kde_options) {
+            if (!defined $kdeopts{$opt}) {
+                print STDERR "Warning: unknown option $opt in $printname\n";
+            } else {
+                $kdeopts{$opt} = 1;
+            }
+        }
+    }
+
+    # Look for the tags that mean we should process this file.
+    $metasourceTags = 0;
+    $metasourceTags++    while ($MakefileData =~ /\n[^=\#]*METASOURCES\s*=/g);
+
+    my $pofileTag = 0;
+    $pofileTag++    while ($MakefileData =~ /\nPOFILES\s*=/g);
+    if ($pofileTag > 1)
+      {
+          print STDERR "Error: Only one POFILES tag allowed\n";
+          $errorflag = 1;
+      }
+
+    while ($MakefileData =~ /\n\.SUFFIXES:([^\n]+)\n/g) {
+	my $suffixes_str = $1;
+	my @list=split(' ', $suffixes_str);
+	foreach $ext (@list) {
+	    if ($ext =~ /^\.$cppExt$/) {
+		$cxxsuffix = $ext;
+		$cxxsuffix =~ s/\.//g;
+		print STDOUT "will use suffix $cxxsuffix\n" if ($verbose);
+		last;
+	    }
+	}
+    }
+
+    tag_KDEINIT();
+
+    while ($MakefileData =~ /\n(\S*)_OBJECTS\s*=[\034 \t]*([^\n]*)\n/g) {
+
+        my $program = $1;
+        my $objs = $2; # safe them
+
+        my $ocv = 0;
+
+        my @objlist = split(/[\034\s]+/, $objs);
+        foreach $obj (@objlist) {
+            if ($obj =~ /(\S*)\$\((\S+)\)/ ) {
+		my $pre = $1;
+                my $variable = $2;
+		if ($pre eq '' && exists($varcontent{$variable})) {
+		    my @addlist = split(/[\034\s]+/, $varcontent{$variable});
+		    push(@objlist, @addlist);
+                } elsif ($variable !~ 'OBJEXT' && $variable !~ /am__objects_\d+/ ) {
+                    $ocv = 1;
+		}
+            }
+        }
+
+        next if ($ocv);
+        next if ($program =~ /^am_libkdeinit_/);
+
+        $program =~ s/^am_// if ($program =~ /^am_/);
+
+        my $sourceprogram = $program;
+        $sourceprogram =~ s/\@am_/\@/ if($sourceprogram =~ /^.*\@am_.+/);
+
+        print STDOUT "found program $program\n" if ($verbose);
+        push(@programs, $program);
+
+        $realObjs{$program} = $objs;
+
+        if ($MakefileData =~ /\n$sourceprogram\_SOURCES\s*=[ \t]*(.*)\n/) {
+            $sources{$program} = $1;
+        } 
+        else {
+            $sources{$program} = "";
+            print STDERR "found program with no _SOURCES: $program\n";
+        }
+        
+        my $realprogram = $program;
+        $realprogram =~ s/_/./g; # unmask to regexp
+        if ($MakefileData =~ /\n($realprogram)(\$\(EXEEXT\)?)?:.*\$\($program\_OBJECTS\)/) {
+            $realname{$program} = $1;
+        } else {
+            # not standard Makefile - nothing to worry about
+            $realname{$program} = "";
+        }
+    }
+
+    my $lookup = 'DEPDIR\s*=.*';
+    if ($MakefileData !~ /\n$lookup/) {
+        $lookup = 'bindir\s*=[ \t]*.*';
+        substituteLine($lookup, "DEPDIR = .deps\n$1") if ($MakefileData =~ /\n($lookup)/);
+    }
+
+    my @marks = ('MAINTAINERCLEANFILES', 'CLEANFILES', 'DISTCLEANFILES');
+    foreach $mark (@marks) {
+        while ($MakefileData =~ /\n($mark)\s*=[ \t]*([^\n]*)/g) {
+	    my $clean_str = $2; 
+            foreach $file (split('[\034\s]+', $clean_str)) {
+                $file =~ s/\.\///;
+                push(@cleanfiles, $file);
+            }
+        }
+    }
+
+    my $localTag = 0;
+    $localTag++ if ($MakefileData =~ /\ninstall-\S+-local:/);
+    
+    return (!$errorflag);
+}
+
+#-----------------------------------------------------------------------------
+
+# Gets the list of user defined directories - relative to $srcdir - where
+# header files could be located.
+sub tag_META_INCLUDES ()
+{
+    my $lookup = '[^=\n]*META_INCLUDES\s*=[ \t]*(.*)';
+    return 1    if ($MakefileData !~ /($lookup)\n/);
+    print STDOUT "META_INCLUDE processing <$1>\n"       if ($verbose);
+
+    my $headerStr = $2;
+    removeLine ($lookup, $1);
+
+    my @headerlist = split(/[\034\s]+/, $headerStr);
+
+    foreach $dir (@headerlist)
+    {
+        $dir =~ s#\$\(srcdir\)#.#;
+        if (! -d $dir)
+        {
+            print STDERR "Warning: $dir can't be found. ",
+                            "Must be a relative path to \$(srcdir)\n";
+        }
+        else
+        {
+            push (@headerdirs, $dir);
+        }
+    }
+
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_FINAL()
+{
+    my @final_names = ();
+    
+    foreach $program (@programs) {
+        
+        if ($sources{$program} =~ /\(/) {
+            print STDOUT "found ( in $program\_SOURCES. skipping\n" if ($verbose);
+            next;
+        }
+
+        my $mocs = "";       # Moc files (in this program)
+	my $moc_cpp_added = 0;  # If we added some .moc.cpp files, due to
+				# no other .cpp file including the .moc one.
+        
+        my @progsources = split(/[\034\s]+/, $sources{$program});
+        my %shash = ();
+        @shash{@progsources} = 1;  # we are only interested in the existence
+        my %sourcelist = ();
+        my %extradeps = ();
+        
+        foreach $source (@progsources) {
+            my $suffix = $source;
+            $suffix =~ s/^.*\.([^\.]+)$/$1/;
+            
+            $sourcelist{$suffix} .= "$source ";
+        }
+        foreach my $mocFile (keys (%globalmocs))
+        {
+            my ($dir, $hFile, $cppFile) = split ("\035", $globalmocs{$mocFile}, 3);
+            if (defined ($cppFile)) {
+                $mocs .= " $mocFile.moc" if exists $shash{$cppFile};
+            } else {
+		$sourcelist{$cxxsuffix} .= "$mocFile.moc.$cxxsuffix ";
+		$moc_cpp_added = 1;
+	    }
+        }
+
+        # scan for extra given dependencies and add them to our target
+        while ($MakefileData =~ /\n\s*(\S+)\.(?:lo|o)\s*:([^\n]*)/g) {
+            $extradeps{$1} = $2;
+        }
+
+        foreach $suffix (keys %sourcelist) {
+            # See if this file contains c++ code. (i.e., just check the file's suffix against c++ extensions)
+            my $suffix_is_cxx = 0;
+            if($suffix =~ /($cppExt)$/) {
+              $cxxsuffix = $1;
+              $suffix_is_cxx = 1;
+            }
+            
+            my $mocfiles_in = ($suffix eq $cxxsuffix) && $moc_cpp_added;
+            
+            my @sourcelist = split(/[\034\s]+/, $sourcelist{$suffix});
+            
+            if ((@sourcelist == 1 && !$mocfiles_in) || $suffix_is_cxx != 1 ) {
+                
+                # we support IDL on our own
+                if ($suffix eq "skel" || $suffix =~ /^stub/
+		    || $suffix =~ /^signals/ # obsolete, remove in KDE-4
+                    || $suffix eq "h" || $suffix eq "ui" 
+                    || $suffix eq "kcfgc" ) {
+                    next;
+                }
+                
+                foreach $file (@sourcelist) {
+                    $file =~ s/\Q$suffix\E$//;
+                    
+                    $finalObjs{$program} .= $file;
+                    if ($program =~ /_la$/) {
+                        $finalObjs{$program} .= "lo ";
+                    } else {
+                        $finalObjs{$program} .= "o ";
+                    }
+                }
+                next; # suffix
+            }
+            
+            my $source_deps = "";
+            foreach $source (@sourcelist) {
+                if (-f $source) {
+                    $source_deps .= " \$(srcdir)/$source";
+                } else {
+                    $source_deps .= " $source";
+                }
+                my $plainsource = $source;
+                $plainsource =~ s/\.$cppExt$//;
+                $source_deps .= " " . $extradeps{$plainsource} if (exists($extradeps{$plainsource}));
+            }
+
+            $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in" . $source_deps . " " . join(' ', $mocs)  . "\n";
+            $handling .= "\t\@echo 'creating $program.all_$suffix.$suffix ...'; \\\n";
+            $handling .= "\trm -f $program.all_$suffix.files $program.all_$suffix.final; \\\n";
+            $handling .= "\techo \"#define KDE_USE_FINAL 1\" >> $program.all_$suffix.final; \\\n";
+            $handling .= "\tfor file in " . $sourcelist{$suffix} . "; do \\\n";
+            $handling .= "\t  echo \"#include \\\"\$\$file\\\"\" >> $program.all_$suffix.files; \\\n";
+            $handling .= "\t  test ! -f \$\(srcdir\)/\$\$file || egrep '^#pragma +implementation' \$\(srcdir\)/\$\$file >> $program.all_$suffix.final; \\\n";
+            $handling .= "\tdone; \\\n";
+            $handling .= "\tcat $program.all_$suffix.final $program.all_$suffix.files > $program.all_$suffix.$suffix; \\\n";
+            $handling .= "\trm -f $program.all_$suffix.final $program.all_$suffix.files\n";
+
+            appendLines($handling);
+
+            push(@final_names, "$program.all_$suffix.$suffix");
+            my $finalObj = "$program.all_$suffix.";
+            if ($program =~ /_la$/) {
+                $finalObj .= "lo";
+            } else {
+                $finalObj .= "o";
+            }
+	    $finalObjs{$program} .= $finalObj . " ";
+        }
+    }
+    
+    if (!$kdeopts{"nofinal"} && @final_names >= 1) {
+        # add clean-final target
+        my $lines = "$cleantarget-final:\n";
+        $lines .= "\t-rm -f " . join(' ', @final_names) . "\n" if (@final_names);
+        appendLines($lines);
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-final ";
+        
+        foreach $finalfile (@final_names) {
+            $finalfile =~ s/\.[^.]*$/.P/;
+            $dep_finals .= " \$(DEPDIR)/$finalfile";
+        }
+    }
+}
+
+sub tag_KDEINIT()
+{
+    my @progs = ();
+    my $ltlibs = "";
+    my $lookup = 'kdeinit_LTLIBRARIES\s*=[ \t]*(.*)';
+
+    if ($MakefileData =~ m/\n$lookup/) {
+	@kdeinits = split(/[\034\s]+/, $1);
+	my $lines = "";
+	foreach my $kdeinit (@kdeinits) {
+	    if ($kdeinit =~ m/\.la$/) {
+		$kdeinit =~ s/\.la$//;
+                push(@progs, $kdeinit);
+
+                $lines .= "\n${kdeinit}.la.$cxxsuffix:\n";
+                $lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' > ${kdeinit}.la.$cxxsuffix; \\\n";
+                $lines .= "\techo 'int main(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}.la.$cxxsuffix\n";
+
+                $lines .= "\n${kdeinit}_dummy.$cxxsuffix:\n";
+                $lines .= "\techo '#include <kdemacros.h>' > ${kdeinit}_dummy.$cxxsuffix; \\\n";
+                $lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' >> ${kdeinit}_dummy.$cxxsuffix; \\\n";
+                $lines .= "\techo 'extern \"C\" KDE_EXPORT int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}_dummy.$cxxsuffix\n";
+
+                push(@cleanfiles, "${kdeinit}.la.$cxxsuffix");
+                push(@cleanfiles, "${kdeinit}_dummy.$cxxsuffix");
+
+                # add dependency
+                $dep_files .= " \$(DEPDIR)/${kdeinit}.la.Po" if($dep_files !~/${kdeinit}.la.Po/ );
+                $dep_files .= " \$(DEPDIR)/${kdeinit}_dummy.Plo" if($dep_files !~/${kdeinit}_dummy.Plo/ );
+
+                # make library
+                $lookup = $kdeinit . '_la_LIBADD\s*=[ \t]*(.*)';
+                if($MakefileData =~ m/\n$lookup/) {
+                    my $libadd = $1;
+                    substituteLine($lookup, "${kdeinit}_la_LIBADD = libkdeinit_${kdeinit}.la");
+                    appendLines("libkdeinit_${kdeinit}_la_LIBADD = $libadd\n");
+                }
+                appendLines("libkdeinit_${kdeinit}_la_LDFLAGS = -no-undefined -avoid-version \$(all_libraries)\n");
+
+                # add library dependencies
+                $lookup = $kdeinit . '_la_DEPENDENCIES\s*=[ \t]*(.*)';
+                if($MakefileData =~ m/\n$lookup/) {
+                    my $libdeps = $1;
+                    substituteLine($lookup, "${kdeinit}_la_DEPENDENCIES = libkdeinit_${kdeinit}.la");
+                    appendLines("libkdeinit_${kdeinit}_la_DEPENDENCIES = $libdeps\n");
+                }
+
+                # make library objects
+                $lookup = "am_${kdeinit}_la_OBJECTS" . '\s*=[ \t]*(.*)';
+                if($MakefileData =~ m/\n$lookup/) {
+                    my $libobjects = $1;
+                    substituteLine($lookup, "am_${kdeinit}_la_OBJECTS = ${kdeinit}_dummy.lo");
+                    appendLines("am_libkdeinit_${kdeinit}_la_OBJECTS = $libobjects\n");
+                    my $prog = "libkdeinit_${kdeinit}_la";
+                    push(@programs, $prog);
+                    $realObjs{$prog} = $libobjects;
+                    $realname{$prog} = "libkdeinit_${kdeinit}.la";
+                }
+                $target_adds{"libkdeinit_${kdeinit}.la"} = "\$(libkdeinit_${kdeinit}_la_OBJECTS) \$(libkdeinit_${kdeinit}_la_DEPENDENCIES)\n" .
+                        "\t\$(CXXLINK) -rpath \$(libdir) \$(libkdeinit_${kdeinit}_la_LDFLAGS) ".
+                           "\$(libkdeinit_${kdeinit}_la_OBJECTS) " .
+                           "\$(libkdeinit_${kdeinit}_la_LIBADD) " .
+                           "\$(LIBS)\n";
+
+                # make libkdeinit sources
+                $lookup = $kdeinit . '_la_SOURCES\s*=[ \t]*(.*)';
+                if($MakefileData =~ m/\n$lookup/) {
+                    my $srces = $1;
+                    $sources_changed{"libkdeinit_${kdeinit}_la"} = 1;
+                    $sources{"libkdeinit_${kdeinit}_la"} = $srces;
+                }
+
+                # make libkdeinit metasources
+                $lookup = $kdeinit . '_la_METASOURCES\s*=[ \t]*(.*)';
+                substituteLine($lookup, "libkdeinit_${kdeinit}_la_METASOURCES = $1")
+                    if($MakefileData =~ m/\n$lookup/);
+
+=cut
+                # make binary sources
+                $lookup = $kdeinit. '_SOURCES\s*=[ \t]*(.*)';
+                if($MakefileData =~ m/\n$lookup/) {
+                    substituteLine($lookup, "${kdeinit}_SOURCES = ${kdeinit}.la.$cxxsuffix");
+                    $lookup = 'SOURCES\s*=[ \t]*(.*)';
+                    if($MakefileData =~ m/\n$lookup/) {
+                        my $srces = $1;
+                        $srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/;
+                        $srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libkdeinit_${kdeinit}_la_SOURCES)/;
+                        substituteLine($lookup, "SOURCES = $srces");
+                    }
+                    $lookup = 'DIST_SOURCES\s*=[ \t](.*)';
+                    if($MakefileData =~ m/\n$lookup/) {
+                        my $srces = $1;
+                        $srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/;
+                        $srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libkdeinit_${kdeinit}_la_SOURCES)/;
+                        substituteLine($lookup, "DIST_SOURCES = $srces");
+                    }
+                }
+
+                # make binary objects / libs
+                $lookup = $kdeinit . '_OBJECTS\s*=[ \t]*.*';
+                if($MakefileData =~ m/\n$lookup/) {
+                    $realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)";
+                    substituteLine("${kdeinit}_LDFLAGS\\s*=.*", "${kdeinit}_LDFLAGS = \$(all_libraries)");
+                    substituteLine("${kdeinit}_LDADD\\s*=.*", "${kdeinit}_LDADD = libkdeinit_${kdeinit}.la");
+                    substituteLine("${kdeinit}_DEPENDENCIES\\s*=.*", "${kdeinit}_DEPENDENCIES = libkdeinit_${kdeinit}.la");
+                }
+=cut
+                # add binary
+                push(@programs, $kdeinit);
+                $realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)";
+                $realname{$kdeinit} = $kdeinit;
+                $sources{$kdeinit} = "${kdeinit}.la.$cxxsuffix";
+
+                $lines .= "${kdeinit}_LDFLAGS = \$(KDE_RPATH) -no-undefined \$(all_libraries)\n";
+                $lines .= "${kdeinit}_LDADD = libkdeinit_${kdeinit}.la\n";
+                $lines .= "${kdeinit}_DEPENDENCIES = libkdeinit_${kdeinit}.la\n";
+
+                $target_adds{"${kdeinit}\$(EXEEXT)"} =
+                          "\$(${kdeinit}_OBJECTS) \$(${kdeinit}_DEPENDENCIES)\n" .
+                          "\t\@rm -f ${kdeinit}\$(EXEEXT)\n" .
+                          "\t\$(CXXLINK) \$(${kdeinit}_LDFLAGS) \$(${kdeinit}_OBJECTS) \$(${kdeinit}_LDADD) \$(LIBS)\n";
+
+                $ltlibs .= " libkdeinit_${kdeinit}.la";
+	    }
+        }
+        appendLines($lines);
+
+        # add libkdeinit target
+        $lookup = 'lib_LTLIBRARIES\s*=[ \t]*(.*)';
+        if($MakefileData =~ m/\n$lookup/) {
+            substituteLine($lookup, "lib_LTLIBRARIES = $1 $ltlibs");
+        }
+        else {
+            print STDERR
+                "Error: lib_LTLIBRARIES missing in $printname (required for kdeinit_LTLIBRARIES).\n";
+            $errorflag = 1;
+        }
+    }
+
+    if($#progs >= 0) {
+        if($MakefileData !~ m/\nbin_PROGRAMS\s*=/) {
+            print STDERR "Error: bin_PROGRAMS missing in $printname (required for kdeinit_LTLIBRARIES).\n";
+            $errorflag = 1;
+        }
+        else {
+            # add our new progs to SOURCES, DIST_SOURCES and bin_PROGRAMS
+            my $progsources = "";
+            my $progexes = "";
+            foreach my $p (@progs) {
+                $progsources .= "\$(${p}_SOURCES) ";
+                $progexes .= "${p}\$(EXEEXT) ";
+            }
+            $lookup = 'SOURCES\s*=[ \t]*(.*)';
+            if($MakefileData =~ /\n$lookup/) {
+                substituteLine($lookup, "SOURCES = $1 $progsources");
+            }
+            $lookup = 'DIST_SOURCES\s*=[ \t]*(.*)';
+            if($MakefileData =~ /\n$lookup/) {
+                substituteLine($lookup, "DIST_SOURCES = $1 $progsources");
+            }
+            # bin_PROGRAMS is complicated, as it exists twice, so we do a little
+            # magic trick here
+            $lookup = 'PROGRAMS\s*=[ \t]*(.*)';
+            if ($MakefileData =~ /\n$lookup/) {
+                substituteLine($lookup, "bin_PROGRAMS += $progexes\nPROGRAMS = $1");
+            }
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_COMPILE_FIRST()
+{
+  foreach $program (@programs) {
+    my $lookup = "$program" . '_COMPILE_FIRST\s*=[ \t]*(.*)';
+    if ($MakefileData =~ m/\n$lookup\n/) {
+      my $compilefirst_str = $1;
+      my @compilefirst = split(/[\034\s]+/, $compilefirst_str);
+      my @progsources = split(/[\034\s]+/, $sources{$program});
+      my %donesources = ();
+      foreach $source (@progsources) {
+        my @deps  = ();
+        my $sdeps = "";
+        if (-f $source) {
+          $sdeps = "\$(srcdir)/$source";
+        } else {
+          $sdeps = "$source";
+        }
+        foreach $depend (@compilefirst) {
+          next if ($source eq $depend);
+          # avoid cyclic dependencies
+          next if defined($donesources{$depend});
+          push @deps, $depend;
+        }
+        $target_adds{$sdeps} .= join(' ', @deps) . ' ' if (@deps);
+        $donesources{$source} = 1;
+      }
+    }
+  }
+}
+
+#-----------------------------------------------------------------------------
+
+
+# Organises the list of headers that we'll use to produce moc files
+# from.
+sub tag_METASOURCES ()
+{
+    local @newObs           = ();  # here we add to create object files
+    local @depend           = ();  # here we add to create moc files
+    local $mocExt           = ".moc";
+    local %mocFiles         = ();
+
+    my $line = "";
+    my $postEqual = "";
+
+    my $lookup;
+    my $found = "";
+    if ($metasourceTags > 1) {
+	$lookup = $program . '_METASOURCES\s*=\s*(.*)';
+	return 1    if ($MakefileData !~ /\n($lookup)\n/);
+	$found = $1;
+    } else {
+	$lookup = $program . '_METASOURCES\s*=\s*(.*)';
+	if ($MakefileData !~ /\n($lookup)\n/) {
+	    $lookup = 'METASOURCES\s*=\s*(.*)';
+	    return 1    if ($MakefileData !~ /\n($lookup)\n/);
+	    $found = $1;
+	    $metasourceTags = 0; # we can use the general target only once
+	} else {
+            $found = $1;
+        }
+    }
+    print STDOUT "METASOURCE processing <$found>)\n"      if ($verbose);
+    
+    $postEqual = $found;
+    $postEqual =~ s/[^=]*=//;
+    
+    removeLine ($lookup, $found);
+    
+    # Always find the header files that could be used to "moc"
+    return 1    if (findMocCandidates ());
+    
+    if ($postEqual =~ /AUTO\s*(\S*)|USE_AUTOMOC\s*(\S*)/)
+    {
+	print STDERR "$printname: the argument for AUTO|USE_AUTOMOC is obsolete" if ($+);
+	$mocExt = ".moc.$cxxsuffix";
+	$haveAutomocTag = 1;
+    }
+    else
+    {
+        # Not automoc so read the list of files supplied which
+        # should be .moc files.
+
+        $postEqual =~ tr/\034/ /;
+
+        # prune out extra headers - This also checks to make sure that
+        # the list is valid.
+        pruneMocCandidates ($postEqual);
+    }
+
+    checkMocCandidates ();
+    
+    if (@newObs) {
+        my $ext =  ($program =~ /_la$/) ? ".moc.lo " : ".moc.o ";
+        $realObjs{$program} .= "\034" . join ($ext, @newObs) . $ext;
+        $dependmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix";
+        foreach $file (@newObs) {
+            $dep_files .= " \$(DEPDIR)/$file.moc.P" if($dep_files !~/$file.moc.P/);
+        }
+    }
+    if (@depend) {
+        $dependmocs{$program} .= " ";
+        $dependmocs{$program} .= join('.moc ', @depend) . ".moc";
+        $dependmocs{$program} .= " ";
+    }
+    addMocRules ();
+    @globalmocs{keys %mocFiles}=values %mocFiles;
+}
+
+#-----------------------------------------------------------------------------
+
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_AUTOMAKE ()
+{
+    my $lookup = '.*cd \$\(top_srcdir\)\s+&&[\034\s]+\$\(AUTOMAKE\)(.*)';
+    return 1    if ($MakefileData !~ /\n($lookup)\n/);
+    print STDOUT "AUTOMAKE processing <$1>\n"        if ($verbose);
+
+    my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname";
+
+    # automake 1.8.x adds another automake call. *sigh*
+    $newLine =~ s/;([\034\s]+cd\s+\$\(srcdir\)\s+&&[\034\s]+\$\(AUTOMAKE\).*)[\034\s]+\&\&[\034\s]+exit[\034\s]+0;([\034\s]+exit\s+1)/; \034 ( $1 ) || exit 1; echo \' cd \$(top_srcdir) && perl $thisProg \'; cd \$(top_srcdir) && perl $thisProg && exit 0; $2/;
+    substituteLine ($lookup, $newLine);
+    $automkCall = $1;
+
+    $lookup = '.*cd \$\(srcdir\)\s+&&[\034\s]+\$\(AUTOCONF\)(.*)';
+    if ($MakefileData =~ /\n($lookup)\n/) {
+      $newLine  = "\tcd \$(srcdir) && rm -f configure\n";
+      $newLine .= "\tcd \$(top_srcdir) && \$(MAKE) -f admin/Makefile.common configure";
+      substituteLine ($lookup, $newLine);
+    }
+
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub handle_TOPLEVEL()
+{
+    my $pofiles = "";
+    my @restfiles = ();
+    opendir (THISDIR, ".");
+    foreach $entry (readdir(THISDIR)) {
+        next if (-d $entry);
+        
+        next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/ || $entry =~ /.gmo$/);
+                 
+        if ($entry =~ /\.po$/) {
+             next;
+        }
+        push(@restfiles, $entry);
+    }
+    closedir (THISDIR);
+            
+    if (@restfiles) {
+        $target_adds{"install-data-am"} .= "install-nls-files ";
+        $lines = "install-nls-files:\n";
+        $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$kdelang\n";
+        for $file (@restfiles) {
+            $lines .= "\t\$(INSTALL_DATA) \$\(srcdir\)/$file \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";
+        }
+	$target_adds{"uninstall"} .= "uninstall-nls-files ";
+        $lines .= "uninstall-nls-files:\n";
+        for $file (@restfiles) {
+            $lines .= "\t-rm -f \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";
+        }
+        appendLines($lines);
+    }
+    
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+sub tag_SUBDIRS ()
+{
+  if ($MakefileData !~ /\nSUBDIRS\s*=\s*\$\(AUTODIRS\)\s*\n/) {
+    return 1;
+  }
+
+  my $subdirs = ".";
+
+  opendir (THISDIR, ".");
+  foreach $entry (readdir(THISDIR)) {
+    next if ($entry eq "CVS" || $entry =~ /^\./);
+    if (-d $entry && -f $entry . "/Makefile.am") {
+      $subdirs .= " $entry";
+      next;
+    }
+  }
+  closedir (THISDIR);
+
+  substituteLine('SUBDIRS\s*=.*', "SUBDIRS =$subdirs");
+  return 0;
+}
+
+sub tag_IDLFILES ()
+{
+    my @psources = split(/[\034\s]+/, $sources{$program});
+    my $dep_lines = "";
+    my @cppFiles = ();
+    
+    foreach $source (@psources) {
+        my $skel = ($source =~ m/\.skel$/);
+        my $stub = ($source =~ m/\.stub$/);
+        my $signals = ($source =~ m/\.signals$/); # obsolete, remove in KDE-4
+        
+        if ($stub || $skel || $signals) {
+
+            my $qs = quotemeta($source);
+            $sources{$program} =~ s/$qs//;
+            $sources_changed{$program} = 1;
+
+            $source =~ s/\.(stub|skel|signals)$//;
+            my $sourcename;
+
+            if ($skel) {
+                $sourcename = "$source\_skel";
+            } elsif ($stub) {
+                $sourcename = "$source\_stub";
+            } else {
+                $sourcename = "$source\_signals";
+            }
+            
+            my $sourcedir = '';
+            if (-f "$makefileDir/$source.h") {
+                $sourcedir = '$(srcdir)/';
+            } else {
+                if ($MakefileData =~ /\n$source\_DIR\s*=\s*(\S+)\n/) {
+                    $sourcedir = $1;
+                    $sourcedir .= "/" if ($sourcedir !~ /\/$/);
+                }
+            }
+            
+            if ($allidls !~ /$source\_kidl/) {
+                
+                $use_ng = ($MakefileData =~ /\n$source\_DCOPIDLNG\s*=\s*(\S+)\n/);
+                $dcopidl =  $use_ng ? "KDECONFIG=\"\$(KDECONFIG)\" \$(DCOPIDLNG)" : "\$(DCOPIDL)";
+
+                $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOP_DEPENDENCIES)\n";
+                $dep_lines .= "\t$dcopidl $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; false )\n";
+                
+                $allidls .= $source . "_kidl ";
+            }
+            
+            if ($allidls !~ /$sourcename/) {
+                
+                $dep_lines_tmp = "";
+
+                if ($skel) {
+                    $dep_lines .= "$sourcename.$cxxsuffix: $source.kidl\n";
+                    $dep_lines .= "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-stub $source.kidl\n";
+                } elsif ($stub) {
+                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-skel $source.kidl\n";
+                } else { # signals - obsolete, remove in KDE 4
+                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-stub --no-skel $source.kidl\n";
+                }
+
+                if ($stub || $signals) {
+                    $target_adds{"$sourcename.$cxxsuffix"} .= "$sourcename.h ";
+                    $dep_lines .= "$sourcename.h: $source.kidl\n";
+                    $dep_lines .= $dep_lines_tmp;
+                }
+                
+                $allidls .= $sourcename . " ";
+            }
+            
+            $idlfiles{$program} .= $sourcename . " ";
+            
+            if ($program =~ /_la$/) {
+                $realObjs{$program} .= " $sourcename.lo";
+            } else {
+                $realObjs{$program} .= " $sourcename.\$(OBJEXT)";
+            }
+            $sources{$program} .= " $sourcename.$cxxsuffix";
+            $sources_changed{$program} = 1;
+            $important{$program} .= "$sourcename.h " if (!$skel);
+            $idl_output .= "\\\n\t$sourcename.$cxxsuffix $sourcename.h $source.kidl ";
+            push(@cleanfiles, "$sourcename.$cxxsuffix");
+            push(@cleanfiles, "$sourcename.h");
+            push(@cleanfiles, "$sourcename.kidl");
+            $dep_files .= " \$(DEPDIR)/$sourcename.P" if ($dep_files !~/$sourcename.P/);
+        }
+    }
+    if ($dep_lines) {
+        appendLines($dep_lines);
+    }
+    
+    if (0) {
+        my $lookup = "($program)";
+        $lookup .= '(|\$\(EXEEXT\))';
+        $lookup =~ s/\_/./g;
+        $lookup .= ":(.*..$program\_OBJECTS..*)";
+        #    $lookup = quotemeta($lookup);
+        if ($MakefileData =~ /\n$lookup\n/) {
+            
+            my $line = "$1$2: ";
+            foreach $file (split(' ', $idlfiles{$program})) {
+                $line .= "$file.$cxxsuffix ";
+            }
+            $line .= $3;
+            substituteLine($lookup, $line);
+        } else {
+            print STDERR "no built dependency found $lookup\n";
+        }
+    }
+}
+
+sub tag_UIFILES ()
+{
+    my @psources = split(/[\034\s]+/, $sources{$program});
+    my @depFiles = ();
+    
+    foreach $source (@psources) {
+
+        if ($source =~ m/\.ui$/) {
+
+            print STDERR "adding UI file $source\n" if ($verbose);
+
+            my $qs = quotemeta($source);
+            $sources{$program} =~ s/$qs//;
+            $sources_changed{$program} = 1;
+      
+            $source =~ s/\.ui$//;
+
+            my $sourcedir = '';
+            if (-f "$makefileDir/$source.ui") {
+                $sourcedir = '$(srcdir)/';
+            }
+
+            if (!$uiFiles{$source}) {
+
+                my $dep_lines = "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n";
+                $dep_lines .= "\trm -f $source.$cxxsuffix\n";
+                if (!$kdeopts{"qtonly"}) {
+                    $dep_lines .= "\techo '#include <kdialog.h>' > $source.$cxxsuffix\n";
+                    $dep_lines .= "\techo '#include <klocale.h>' >> $source.$cxxsuffix\n";
+                    my ($mangled_source) = $source;
+                    $mangled_source =~ s/[^A-Za-z0-9]/_/g;  # get rid of garbage
+                    $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui > $source.$cxxsuffix.temp ; ret=\$\$?; \\\n";
+                    $dep_lines .= "\t\$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" $source.$cxxsuffix.temp | \$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | \$(PERL) -pe \"s,image([0-9][0-9]*)_data,img\\\$\$1_" . $mangled_source . ",g\" | \$(PERL) -pe \"s,: QWizard\\(,: KWizard(,g\" >> $source.$cxxsuffix ;\\\n";
+		    $dep_lines .= "\trm -f $source.$cxxsuffix.temp ;\\\n";
+                } else {
+                    $dep_lines .= "\t\$(UIC) -i $source.h $sourcedir$source.ui > $source.$cxxsuffix; ret=\$\$?; \\\n";
+                }
+		$dep_lines .= "\tif test \"\$\$ret\" = 0; then echo '#include \"$source.moc\"' >> $source.$cxxsuffix; else rm -f $source.$cxxsuffix ; exit \$\$ret ; fi\n\n";
+                $dep_lines .= "$source.h: $sourcedir$source.ui\n";
+                $dep_lines .= "\trm -rf $source.h;\n";
+                if (!$kdeopts{"qtonly"}) {
+                    $dep_lines .= "\t\$(UIC) $sourcedir$source.ui | \$(PERL) -pi -e \"s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g\" >> $source.h ;\n";
+                } else {
+                    $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n";
+                }
+                $dep_lines .= "$source.moc: $source.h\n";
+                $dep_lines .= "\t\$(MOC) $source.h -o $source.moc\n";
+
+                $rule_adds{"$source.$cxxsuffix"} = $dep_lines;
+
+		$uiFiles{$source} = 1;
+                $dependmocs{$program} .= " $source.moc";
+                $globalmocs{$source} = "\035$source.h\035$source.cpp";
+            }
+            
+            if ($program =~ /_la$/) {
+                $realObjs{$program} .= " $source.lo";
+            } else {
+                $realObjs{$program} .= " $source.\$(OBJEXT)";
+            }
+            $sources{$program} .= " $source.$cxxsuffix";
+            $sources_changed{$program} = 1;
+            $important{$program} .= "$source.h ";
+            $ui_output .= "\\\n\t$source.$cxxsuffix $source.h $source.moc ";
+            push(@cleanfiles, "$source.$cxxsuffix");
+            push(@cleanfiles, "$source.h");
+            push(@cleanfiles, "$source.moc");
+            $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ );
+        }
+    }
+}
+
+sub tag_KCFGFILES ()
+{
+    my @psources = split(/[\034\s]+/, $sources{$program});
+    my @depFiles = ();
+    
+    foreach $source (@psources) {
+
+        if ($source =~ m/\.kcfgc$/) {
+
+            print STDERR "adding KCFG file $source\n" if ($verbose);
+
+            my $qs = quotemeta($source);
+            $sources{$program} =~ s/$qs//;
+            $sources_changed{$program} = 1;
+      
+            $source =~ s/\.kcfgc$//;
+
+            my $sourcedir = '';
+            if (-f "$makefileDir/$source.kcfgc") {
+                $sourcedir = '$(srcdir)/';
+            }
+
+            if (!$kcfgFiles{$source}) {
+                $kcfg = "$program.kcfg";
+                findKcfgFile("$source.kcfgc");
+
+                my $fixsuffix = "";
+                $fixsuffix = "else mv $source.cpp $source.$cxxsuffix ; " 
+                    unless "cpp" eq $cxxsuffix;
+
+                my $dep_lines = "$source.$cxxsuffix: $source.h\n";
+                $dep_lines .= "$source.h: $sourcedir$kcfg $sourcedir$source.kcfgc \$(KCFG_DEPENDENCIES)\n";
+                $dep_lines .= "\t\$(KCONFIG_COMPILER) $sourcedir$kcfg $sourcedir$source.kcfgc; ret=\$\$?; \\\n";
+		$dep_lines .= "\tif test \"\$\$ret\" != 0; then rm -f $source.h ; exit \$\$ret ; $fixsuffix fi\n\n";
+
+                $rule_adds{"$source.$cxxsuffix"} = $dep_lines;
+
+		$kcfgFiles{$source} = 1;
+            }
+            
+            if ($program =~ /_la$/) {
+                $realObjs{$program} .= " $source.lo";
+            } else {
+                $realObjs{$program} .= " $source.\$(OBJEXT)";
+            }
+            $sources{$program} .= " $source.$cxxsuffix";
+            $sources_changed{$program} = 1;
+            $important{$program} .= "$source.h ";
+            $kcfg_output .= "\\\n\t$source.$cxxsuffix $source.h ";
+            push(@cleanfiles, "$source.$cxxsuffix");
+            push(@cleanfiles, "$source.h");
+            $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ );
+        }
+    }
+}
+
+sub tag_ICON()
+{
+    my $lookup = '([^\s]*)_ICON\s*=[ \t]*(.*)';
+    my $install = "";
+    my $uninstall = "";
+
+    while ($MakefileData =~ /\n$lookup/g) {
+        my $destdir;
+        if ($1 eq "KDE") {
+            $destdir = "kde_icondir";
+        } else {
+            $destdir = $1 . "dir";
+        }
+        my $iconauto = ($2 =~ /AUTO\s*$/);
+        my @appnames = ();
+        if ( ! $iconauto ) {
+	    my $appicon_str = $2;
+            my @_appnames = split(" ", $appicon_str);
+            print STDOUT "KDE_ICON processing <@_appnames>\n"   if ($verbose);
+            foreach $appname (@_appnames) {
+                push(@appnames, quotemeta($appname));
+            }
+        } else {
+            print STDOUT "KDE_ICON processing <AUTO>\n"   if ($verbose);
+        }
+
+        my @files = ();
+        opendir (THISDIR, ".");
+        foreach $entry (readdir(THISDIR)) {
+            next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/);
+            next if (! -f $entry);
+            if ( $iconauto )
+              {
+                  push(@files, $entry)
+                    if ($entry =~ /\.xpm/ || $entry =~ /\.png/ || $entry =~ /\.mng/ || $entry =~ /\.svg/);
+              } else {
+                  foreach $appname (@appnames) {
+                      push(@files, $entry)
+                        if ($entry =~ /-$appname\.xpm/ || $entry =~ /-$appname\.png/ || $entry =~ /-$appname\.mng/ || $entry =~ /-$appname\.svg/);
+                  }
+              }
+        }
+        closedir (THISDIR);
+        
+        my %directories = ();
+        
+        foreach $file (@files) {
+            my $newfile = $file;
+            my $prefix = $file;
+            $prefix =~ s/\.(png|xpm|mng|svg|svgz)$//;
+            my $appname = $prefix;
+            $appname =~ s/^[^-]+-// if ($appname =~ /-/) ;
+            $appname =~ s/^[^-]+-// if ($appname =~ /-/) ;
+            $appname = quotemeta($appname);
+            $prefix =~ s/$appname$//;
+            $prefix =~ s/-$//;
+            
+            $prefix = 'lo16-app' if ($prefix eq 'mini');
+            $prefix = 'lo32-app' if ($prefix eq 'lo');
+            $prefix = 'hi48-app' if ($prefix eq 'large');
+            $prefix .= '-app' if ($prefix =~ m/^...$/);
+            
+            my $type = $prefix;
+            $type =~ s/^.*-([^-]+)$/$1/;
+            $prefix =~ s/^(.*)-[^-]+$/$1/;
+            
+            my %type_hash =
+              (
+               'action' => 'actions',
+               'app' => 'apps',
+               'device' => 'devices',
+               'filesys' => 'filesystems',
+               'mime' => 'mimetypes'
+              );
+
+            if (! defined $type_hash{$type} ) {
+                print STDERR "unknown icon type $type in $printname ($file)\n";
+                next;
+            }
+
+            my %dir_hash =
+              (
+               'los' => 'locolor/16x16',
+               'lom' => 'locolor/32x32',
+               'him' => 'hicolor/32x32',
+               'hil' => 'hicolor/48x48',
+               'lo16' => 'locolor/16x16',
+               'lo22' => 'locolor/22x22',
+               'lo32' => 'locolor/32x32',
+               'hi16' => 'hicolor/16x16',
+               'hi22' => 'hicolor/22x22',
+               'hi32' => 'hicolor/32x32',
+               'hi48' => 'hicolor/48x48',
+               'hi64' => 'hicolor/64x64',
+               'hi128' => 'hicolor/128x128',
+               'hisc' => 'hicolor/scalable',
+ 	       'cr16' => 'crystalsvg/16x16',
+               'cr22' => 'crystalsvg/22x22',
+               'cr32' => 'crystalsvg/32x32',
+               'cr48' => 'crystalsvg/48x48',
+               'cr64' => 'crystalsvg/64x64',
+               'cr128' => 'crystalsvg/128x128',
+               'crsc' => 'crystalsvg/scalable'
+              );
+            
+            $newfile =~ s at .*-($appname\.(png|xpm|mng|svgz|svg?))@$1@;
+            
+            if (! defined $dir_hash{$prefix}) {
+                print STDERR "unknown icon prefix $prefix in $printname\n";
+                next;
+            }
+            
+            my $dir = $dir_hash{$prefix} . "/" . $type_hash{$type};
+            if ($newfile =~ /-[^\.]/) {
+                my $tmp = $newfile;
+                $tmp =~ s/^([^-]+)-.*$/$1/;
+                $dir = $dir . "/" . $tmp;
+                $newfile =~ s/^[^-]+-//;
+            }
+            
+            if (!defined $directories{$dir}) {
+                $install .= "\t\$(mkinstalldirs) \$(DESTDIR)\$($destdir)/$dir\n";
+                $directories{$dir} = 1;
+            }
+            
+            $install .= "\t\$(INSTALL_DATA) \$(srcdir)/$file \$(DESTDIR)\$($destdir)/$dir/$newfile\n";
+            $uninstall .= "\t-rm -f \$(DESTDIR)\$($destdir)/$dir/$newfile\n";
+            
+        }
+    }
+
+    if (length($install)) {
+        $target_adds{"install-data-am"} .= "install-kde-icons ";
+        $target_adds{"uninstall-am"} .= "uninstall-kde-icons ";
+        appendLines("install-kde-icons:\n" . $install . "\nuninstall-kde-icons:\n" . $uninstall);
+    }
+}
+
+sub handle_POFILES($$)
+{
+  my @pofiles = split(" ", $_[0]);
+  my $lang = $_[1];
+
+  # Build rules for creating the gmo files
+  my $tmp = "";
+  my $allgmofiles     = "";
+  my $pofileLine   = "POFILES =";
+  foreach $pofile (@pofiles)
+    {
+        $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+        $tmp .= "$1.gmo: $pofile\n";
+        $tmp .= "\trm -f $1.gmo; \$(GMSGFMT) -o $1.gmo \$(srcdir)/$pofile\n";
+        $tmp .= "\ttest ! -f $1.gmo || touch $1.gmo\n";
+        $allgmofiles .= " $1.gmo";
+        $pofileLine  .= " $1.po";
+    }
+  appendLines ($tmp);
+  my $lookup = 'POFILES\s*=([^\n]*)';
+  if ($MakefileData !~ /\n$lookup/) {
+    appendLines("$pofileLine\nGMOFILES =$allgmofiles");
+  } else {
+    substituteLine ($lookup, "$pofileLine\nGMOFILES =$allgmofiles");
+  }
+
+    if ($allgmofiles) {
+
+        # Add the "clean" rule so that the maintainer-clean does something
+        appendLines ("clean-nls:\n\t-rm -f $allgmofiles\n");
+
+	$target_adds{"maintainer-clean"} .= "clean-nls ";
+
+	$lookup = 'DISTFILES\s*=[ \t]*(.*)';
+	if ($MakefileData =~ /\n$lookup/) {
+	  $tmp = "DISTFILES = \$(GMOFILES) \$(POFILES) $1";
+	  substituteLine ($lookup, $tmp);
+	}
+    }
+
+  $target_adds{"install-data-am"} .= "install-nls ";
+
+  $tmp = "install-nls:\n";
+  if ($lang) {
+    $tmp  .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES\n";
+  }
+  $tmp .= "\t\@for base in ";
+  foreach $pofile (@pofiles)
+    {
+      $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+      $tmp .= "$1 ";
+    }
+
+  $tmp .= "; do \\\n";
+  if ($lang) {
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n";
+    $tmp .= "\t  if test -f \$\$base.gmo; then \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n";
+    $tmp .= "\t  elif test -f \$(srcdir)/\$\$base.gmo; then \$(INSTALL_DATA) \$(srcdir)/\$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n";
+    $tmp .= "\t  fi ;\\\n";
+  } else {
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n";
+    $tmp .= "\t  \$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES ; \\\n";
+    $tmp .= "\t  if test -f \$\$base.gmo; then \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n";
+    $tmp .= "\t  elif test -f \$(srcdir)/\$\$base.gmo; then \$(INSTALL_DATA) \$(srcdir)/\$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n";
+    $tmp .= "\t  fi ;\\\n";
+  }
+  $tmp .= "\tdone\n\n";
+  appendLines ($tmp);
+
+  $target_adds{"uninstall"} .= "uninstall-nls ";
+
+  $tmp = "uninstall-nls:\n";
+  foreach $pofile (@pofiles)
+    {
+      $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+      if ($lang) {
+	$tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/$1.mo\n";
+      } else {
+	$tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$1/LC_MESSAGES/\$(PACKAGE).mo\n";
+      }
+    }
+  appendLines($tmp);
+
+  $target_adds{"all"} .= "all-nls ";
+
+  $tmp = "all-nls: \$(GMOFILES)\n";
+
+  appendLines($tmp);
+
+  $target_adds{"distdir"} .= "distdir-nls ";
+
+  $tmp = "distdir-nls:\$(GMOFILES)\n";
+  $tmp .= "\tfor file in \$(POFILES); do \\\n";
+  $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+  $tmp .= "\tdone\n";
+  $tmp .= "\tfor file in \$(GMOFILES); do \\\n";
+  $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+  $tmp .= "\tdone\n";
+
+  appendLines ($tmp);
+
+  if (!$lang) {
+    appendLines("merge:\n\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n");
+  }
+ 
+}
+
+#-----------------------------------------------------------------------------
+
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_POFILES ()
+{
+    my $lookup = 'POFILES\s*=([^\n]*)';
+    return 1    if ($MakefileData !~ /\n$lookup/);
+    print STDOUT "POFILES processing <$1>\n"   if ($verbose);
+
+    my $tmp = $1;
+
+    # make sure these are all gone.
+    if ($MakefileData =~ /\n\.po\.gmo:\n/)
+    {
+        print STDERR "Warning: Found old .po.gmo rules in $printname. New po rules not added\n";
+        return 1;
+    }
+
+    # Either find the pofiles in the directory (AUTO) or use
+    # only the specified po files.
+    my $pofiles = "";
+    if ($tmp =~ /^\s*AUTO\s*$/)
+    {
+        opendir (THISDIR, ".");
+	$pofiles =  join(" ", grep(/\.po$/, readdir(THISDIR)));
+        closedir (THISDIR);
+        print STDOUT "pofiles found = $pofiles\n"   if ($verbose);
+	if (-f "charset" && -f "kdelibs/kdelibs.po") {
+	    handle_TOPLEVEL();
+	}
+    }
+    else
+    {
+        $tmp =~ s/\034/ /g;
+        $pofiles = $tmp;
+    }
+    return 1    if (!$pofiles);        # Nothing to do
+
+    handle_POFILES($pofiles, $kdelang);
+
+    return 0;
+}
+
+sub helper_LOCALINSTALL($)
+{
+  my $lookup = "\035" . $_[0] . " *:[^\035]*\035\t";
+  my $copy = $MakefileData;
+  $copy =~ s/\n/\035/g;
+  if ($copy =~ /($lookup.*)$/) {
+
+    $install = $1;
+    $install =~ s/\035$_[0] *:[^\035]*\035//;
+    my $emptyline = 0;
+    while (! $emptyline ) {
+      if ($install =~ /([^\035]*)\035(.*)/) {
+	local $line = $1;
+	$install = $2;
+	if ($line !~ /^\s*$/ && $line !~ /^(\@.*\@)*\t/) {
+	  $emptyline = 1;
+	} else {
+	  replaceDestDir($line);
+	}
+      } else {
+	$emptyline = 1;
+      }
+    }
+  }
+
+}
+
+sub tag_LOCALINSTALL ()
+{
+  helper_LOCALINSTALL('install-exec-local');
+  helper_LOCALINSTALL('install-data-local');
+  helper_LOCALINSTALL('uninstall-local');
+
+  return 0;
+}
+
+sub replaceDestDir($) {
+  local $line = $_[0];
+
+  if (   $line =~ /^\s*(\@.*\@)*\s*\$\(mkinstalldirs\)/
+      || $line =~ /^\s*(\@.*\@)*\s*\$\(INSTALL\S*\)/
+      || $line =~ /^\s*(\@.*\@)*\s*(-?rm.*) \S*$/)
+  {
+    $line =~ s/^(.*) ([^\s]+)\s*$/$1 \$(DESTDIR)$2/ if ($line !~ /\$\(DESTDIR\)/);
+  }
+
+  if ($line ne $_[0]) {
+    $_[0] = quotemeta $_[0];
+    substituteLine($_[0], $line);
+  }
+}
+
+#---------------------------------------------------------------------------
+# libtool is very hard to persuade it could use -Wl,--no-undefined for making
+# -no-undefined actually work
+# append $(KDE_NO_UNFINED) after every -no-undefined in LDFLAGS
+# this may go away if libtool ever does this on its own
+sub tag_NO_UNDEFINED () {
+    return if ($program !~ /_la$/);
+
+    my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n";
+    $MakefileData =~ m/$lookup/;
+    return if (!defined($1));
+    return if ($1 !~ /CXXLINK/);
+
+    if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ ) {
+        return;
+    }
+
+    $lookup = $program . '\_LDFLAGS(\s*)=(.*)-no-undefined(.*)';
+    if ($MakefileData =~ /\n$lookup\n/) {
+	my $replace = $program . "\_LDFLAGS$1=$2-no-undefined \$(KDE_NO_UNDEFINED)$3";
+        substituteLine($lookup, $replace);
+    }
+}
+
+sub tag_CLOSURE () {
+    return if ($program !~ /_la$/);
+
+    my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n";
+    $MakefileData =~ m/$lookup/;
+    return if (!defined($1));
+    return if ($1 !~ /CXXLINK/);
+
+    if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ &&
+        $MakefileData !~ /\n$program\_LDFLAGS\s*=.*KDE_PLUGIN/ ) {
+        print STDERR "Report: $program contains undefined in $printname\n" if ($program =~ /^lib/ && $dryrun);
+        return;
+    }
+
+    my $closure = $realname{$program} . ".closure";
+    my $lines = "$closure: \$($program\_OBJECTS) \$($program\_DEPENDENCIES)\n";
+    $lines .= "\t\@echo \"int main() {return 0;}\" > $program\_closure.$cxxsuffix\n";
+    $lines .= "\t\@\$\(LTCXXCOMPILE\) -c $program\_closure.$cxxsuffix\n";
+    $lines .= "\t\$\(CXXLINK\) $program\_closure.lo \$($program\_LDFLAGS) \$($program\_OBJECTS) \$($program\_LIBADD) \$(LIBS)\n";
+    $lines .= "\t\@rm -f $program\_closure.* $closure\n";
+    $lines .= "\t\@echo \"timestamp\" > $closure\n";
+    $lines .= "\n";
+    appendLines($lines);
+    $lookup = $realname{$program} . ": (.*)";
+    if ($MakefileData =~ /\n$lookup\n/) {
+        $lines  = "\@KDE_USE_CLOSURE_TRUE@". $realname{$program} . ": $closure $1";
+        $lines .= "\n\@KDE_USE_CLOSURE_FALSE@" . $realname{$program} . ": $1";
+        substituteLine($lookup, $lines);
+    }
+    $closure_output .= " $closure";
+}
+
+sub tag_NMCHECK () {
+    return if ($program !~ /_la$/);
+    my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n";
+    $MakefileData =~ m/$lookup/;
+    my $linkcmd = $1;
+    return if (!defined($1));
+    return if ($linkcmd !~ /CXXLINK/ && $linkcmd !~ /LINK/);
+
+    $lookup = $program . '_NMCHECK\s*=([^\n]*)';
+    if( $MakefileData !~ m/\n$lookup\n/ ) {
+	return;
+    }
+    my $allowed = $1;
+    $allowed =~ s/^ *//;
+    $lookup = $program . '_NMCHECKWEAK\s*=([^\n]*)';
+    my $weak = "";
+    my $is_weak = 0;
+    if( $MakefileData =~ m/\n$lookup\n/ ) {
+	$weak = $1;
+	$is_weak = 1;
+    }
+    $weak =~ s/^ *//;
+
+    if( $is_weak )
+    {
+	$weak = '--allowweak=\'' . $weak . '\' ';
+    }
+    my $nmline = "\@KDE_USE_NMCHECK_TRUE@\t\@\$(MAKE) \$(AM_MAKEFLAGS) nmcheck_$realname{$program} || ( rm -f $realname{$program}; exit 1 )";
+    $lookup = '(\t\$\(CXXLINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)';
+    if( $MakefileData =~ /\n$lookup\n/ ) {
+	my $oldstuff = $1;
+	substituteLine( $lookup, $oldstuff . "\n" . $nmline );
+    }
+    $lookup = '(\t\$\(LINK\)[^\n]*' . $program . '_OBJECTS[^\n]*)';
+    if( $MakefileData =~ /\n$lookup\n/ ) {
+	my $oldstuff = $1;
+	substituteLine( $lookup, $oldstuff . "\n" . $nmline );
+    }
+    $nmline = "\@\$(top_srcdir)/admin/nmcheck $realname{$program} \'$allowed\' $weak";
+    appendLines( "\nnmcheck_$realname{$program}: $realname{$program} \n\t$nmline\n" );
+    $target_adds{ "nmcheck" } .= "nmcheck_$realname{$program} ";
+}
+
+sub tag_DIST () {
+    my %foundfiles = ();
+    opendir (THISDIR, ".");
+    foreach $entry (readdir(THISDIR)) {
+        next if ($entry eq "CVS" || $entry =~ /^\./  || $entry eq "Makefile" || $entry =~ /~$/ || $entry =~ /^\#.*\#$/);
+        next if (! -f $entry);
+        next if ($entry =~ /\.moc/ || $entry =~ /\.moc.$cppExt$/ || $entry =~ /\.lo$/ || $entry =~ /\.la$/ || $entry =~ /\.o/);
+        next if ($entry =~ /\.all_$cppExt\.$cppExt$/);
+        $foundfiles{$entry} = 1;
+    }
+    closedir (THISDIR);
+
+    # doing this for MAINTAINERCLEANFILES would be wrong
+    my @marks = ("EXTRA_DIST", "DIST_COMMON", '\S*_SOURCES', '\S*_HEADERS', 'CLEANFILES', 'DISTCLEANFILES', '\S*_OBJECTS');
+    foreach $mark (@marks) {
+        while ($MakefileData =~ /\n($mark)\s*=[ \t]*([^\n]*)/g) {
+	    my $cleanfiles_str = $2;
+            foreach $file (split('[\034\s]+', $cleanfiles_str)) {
+                $file =~ s/\.\///;
+                $foundfiles{$file} = 0 if (defined $foundfiles{$file});
+            }
+        }
+    }
+    my @files = ("Makefile", "config.cache", "config.log", "stamp-h",
+                 "stamp-h1", "stamp-h1", "config.h", "Makefile", 
+                 "config.status", "config.h", "libtool", "core" );
+    foreach $file (@files) {
+        $foundfiles{$file} = 0 if (defined $foundfiles{$file});
+    }
+
+    my $KDE_DIST = "";
+    foreach $file (keys %foundfiles) {
+        if ($foundfiles{$file} == 1) {
+            $KDE_DIST .= "$file ";
+        }
+    }
+    if ($KDE_DIST) {
+        print "KDE_DIST $printname $KDE_DIST\n" if ($verbose);
+
+        my $lookup = 'DISTFILES\s*=[ \t]*(.*)';
+        if ($MakefileData =~ /\n$lookup/) {
+            substituteLine($lookup, "DISTFILES = $1 \$(KDE_DIST)");
+            appendLines("KDE_DIST=$KDE_DIST\n");
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+# Returns 0 if the line was processed - 1 otherwise.
+# Errors are logged in the global $errorflags
+sub tag_DOCFILES ()
+{
+    $target_adds{"all"} .= "docs-am ";
+
+    my $lookup = 'KDE_DOCS\s*=[ \t]*([^\n]*)';
+    goto nodocs    if ($MakefileData !~ /\n$lookup/);
+    print STDOUT "KDE_DOCS processing <$1>\n"   if ($verbose);
+
+    my $tmp = $1;
+
+    # Either find the files in the directory (AUTO) or use
+    # only the specified po files.
+    my $files = "";
+    my $appname = $tmp;
+    $appname =~ s/^(\S*)\s*.*$/$1/;
+    if ($appname =~ /AUTO/) {
+      $appname = basename($makefileDir);
+      if ("$appname" eq "en") {
+      	  print STDERR "Error: KDE_DOCS = AUTO relies on the directory name. Yours is 'en' - you most likely want something else, e.g. KDE_DOCS = myapp\n";
+          exit(1);
+      }
+    }
+
+    if ($tmp !~ / - /)
+    {
+        opendir (THISDIR, ".");
+	foreach $entry (readdir(THISDIR)) {
+	  next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/ || $entry eq "core" || $entry eq "index.cache.bz2");
+	  next if (! -f $entry);
+	  $files .= "$entry ";
+	}
+        closedir (THISDIR);
+        print STDOUT "docfiles found = $files\n"   if ($verbose);
+    }
+    else
+    {
+        $tmp =~ s/\034/ /g;
+	$tmp =~ s/^\S*\s*-\s*//;
+        $files = $tmp;
+    }
+    goto nodocs if (!$files);        # Nothing to do
+
+    if ($files =~ /(^| )index\.docbook($| )/) {
+
+      my $lines = "";
+      my $lookup = 'MEINPROC\s*=';
+      if ($MakefileData !~ /\n($lookup)/) {
+	$lines = "MEINPROC=/\$(kde_bindir)/meinproc\n";
+      }
+      $lookup = 'KDE_XSL_STYLESHEET\s*=';
+      if ($MakefileData !~ /\n($lookup)/) {
+        $lines .= "KDE_XSL_STYLESHEET=/\$(kde_datadir)/ksgmltools2/customization/kde-chunk.xsl\n";
+      }
+      $lookup = '\nindex.cache.bz2:';
+      if ($MakefileData !~ /\n($lookup)/) {
+         $lines .= "index.cache.bz2: \$(srcdir)/index.docbook \$(KDE_XSL_STYLESHEET) $files\n";
+         $lines .= "\t\@if test -n \"\$(MEINPROC)\"; then echo \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; fi\n";
+         $lines .= "\n";
+      }
+
+      $lines .= "docs-am: index.cache.bz2\n";
+      $lines .= "\n";
+      $lines .= "install-docs: docs-am install-nls\n";
+      $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
+      $lines .= "\t\@if test -f index.cache.bz2; then \\\n";
+      $lines .= "\techo \$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\t\$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\telif test -f  \$(srcdir)/index.cache.bz2; then \\\n";
+      $lines .= "\techo \$(INSTALL_DATA) \$(srcdir)/index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\t\$(INSTALL_DATA) \$(srcdir)/index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n";
+      $lines .= "\tfi\n";
+      $lines .= "\t-rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n";
+      $lines .= "\t\$(LN_S) \$(kde_libs_htmldir)/$kdelang/common \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n";
+
+      $lines .= "\n";
+      $lines .= "uninstall-docs:\n";
+      $lines .= "\t-rm -rf \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
+      $lines .= "\n";
+      $lines .= "clean-docs:\n";
+      $lines .= "\t-rm -f index.cache.bz2\n";
+      $lines .= "\n";
+      $target_adds{"install-data-am"} .= "install-docs ";
+      $target_adds{"uninstall"} .= "uninstall-docs ";
+      $target_adds{"clean-am"} .= "clean-docs ";
+      appendLines ($lines);
+    } else {
+      appendLines("docs-am: $files\n");
+    }
+
+    $target_adds{"install-data-am"} .= "install-nls ";
+    $target_adds{"uninstall"} .= "uninstall-nls ";
+
+    $tmp = "install-nls:\n";
+    $tmp .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
+    $tmp .= "\t\@for base in $files; do \\\n";
+    $tmp .= "\t  echo \$(INSTALL_DATA) \$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\t  \$(INSTALL_DATA) \$(srcdir)/\$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\tdone\n";
+    if ($appname eq 'common') {
+      $tmp .= "\t\@echo \"merging common and language specific dir\" ;\\\n";
+      $tmp .= "\tif test ! -f \$(kde_htmldir)/en/common/kde-common.css; then echo 'no english docs found in \$(kde_htmldir)/en/common/'; exit 1; fi \n";
+      $tmp .= "\t\@com_files=`cd \$(kde_htmldir)/en/common && echo *` ;\\\n";
+      $tmp .= "\tcd \$(DESTDIR)\$(kde_htmldir)/$kdelang/common ;\\\n";
+      $tmp .= "\tif test -n \"\$\$com_files\"; then for p in \$\$com_files ; do \\\n";
+      $tmp .= "\t  case \" $files \" in \\\n";
+      $tmp .= "\t    *\" \$\$p \"*) ;; \\\n";
+      $tmp .= "\t    *) test ! -f \$\$p && echo \$(LN_S) ../../en/common/\$\$p \$(DESTDIR)\$(kde_htmldir)/$kdelang/common/\$\$p && \$(LN_S) ../../en/common/\$\$p \$\$p ;; \\\n";
+      $tmp .= "\t  esac ; \\\n";
+      $tmp .= "\tdone ; fi ; true\n";
+    }
+    $tmp .= "\n";
+    $tmp .= "uninstall-nls:\n";
+    $tmp .= "\tfor base in $files; do \\\n";
+    $tmp .= "\t  rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n";
+    $tmp .= "\tdone\n\n";
+    appendLines ($tmp);
+
+    $target_adds{"distdir"} .= "distdir-nls ";
+
+    $tmp = "distdir-nls:\n";
+    $tmp .= "\tfor file in $files; do \\\n";
+    $tmp .= "\t  cp \$(srcdir)/\$\$file \$(distdir); \\\n";
+    $tmp .= "\tdone\n";
+
+    appendLines ($tmp);
+
+    return 0;
+
+  nodocs:
+    appendLines("docs-am:\n");
+    return 1;
+}
+
+#-----------------------------------------------------------------------------
+# Find headers in any of the source directories specified previously, that
+# are candidates for "moc-ing".
+sub findMocCandidates ()
+{
+    foreach $dir (@headerdirs)
+    {
+        my @list = ();
+        opendir (SRCDIR, "$dir");
+        @hFiles = grep { /.+\.$hExt$/o && !/^\./ } readdir(SRCDIR);
+        closedir SRCDIR;
+        foreach $hf (@hFiles)
+        {
+            next if ($hf =~ /^\.\#/);
+	    $hf =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+	    next if ($uiFiles{$1});
+            open (HFIN, "$dir/$hf") || die "Could not open $dir/$hf: $!\n";
+            my $hfsize = 0;
+            seek(HFIN, 0, 2);
+            $hfsize = tell(HFIN);
+            seek(HFIN, 0, 0);
+            read HFIN, $hfData, $hfsize;
+            close HFIN;
+            # push (@list, $hf) if(index($hfData, "Q_OBJECT") >= 0); ### fast but doesn't handle //Q_OBJECT
+	    # handle " { friend class blah; Q_OBJECT ", but don't match antlarr_Q_OBJECT (\b).
+            if ( $hfData =~ /{([^}]*)\bQ_OBJECT/s ) {
+                push (@list, $hf) unless $1 =~ m://[^\n]*Q_OBJECT[^\n]*$:s;  ## reject "// Q_OBJECT"
+            }
+        }
+        # The assoc array of root of headerfile and header filename
+        foreach $hFile (@list)
+        {
+            $hFile =~ /(.*)\.[^\.]*$/;          # Find name minus extension
+            if ($mocFiles{$1})
+            {
+              print STDERR "Warning: Multiple header files found for $1\n";
+              next;                           # Use the first one
+            }
+            $mocFiles{$1} = "$dir\035$hFile";   # Add relative dir
+        }
+    }
+
+    return 0;
+}
+
+#-----------------------------------------------------------------------------
+
+# The programmer has specified a moc list. Prune out the moc candidates
+# list that we found based on looking at the header files. This generates
+# a warning if the programmer gets the list wrong, but this doesn't have
+# to be fatal here.
+sub pruneMocCandidates ($)
+{
+    my %prunedMoc = ();
+    local @mocList = split(' ', $_[0]);
+
+    foreach $mocname (@mocList)
+    {
+        $mocname =~ s/\.moc$//;
+        if ($mocFiles{$mocname})
+        {
+            $prunedMoc{$mocname} = $mocFiles{$mocname};
+        }
+        else
+        {
+            my $print = $makefileDir;
+            $print =~ s/^\Q$topdir\E\\//;
+            # They specified a moc file but we can't find a header that
+            # will generate this moc file. That's possible fatal!
+            print STDERR "Warning: No moc-able header file for $print/$mocname\n";
+        }
+    }
+
+    undef %mocFiles;
+    %mocFiles = %prunedMoc;
+}
+
+#-----------------------------------------------------------------------------
+
+# Finds the cpp files (If they exist).
+# The cpp files get appended to the header file separated by \035
+sub checkMocCandidates ()
+{
+    my @cppFiles;
+    my $cpp2moc;  # which c++ file includes which .moc files
+    my $moc2cpp;  # which moc file is included by which c++ files
+
+    return unless (keys %mocFiles);
+    opendir(THISDIR, ".") || return;
+    @cppFiles = grep { /.+\.$cppExt$/o  && !/.+\.moc\.$cppExt$/o
+                         && !/.+\.all_$cppExt\.$cppExt$/o
+			 && !/^\./  } readdir(THISDIR);
+    closedir THISDIR;
+    return unless (@cppFiles);
+    my $files = join (" ", @cppFiles);
+    $cpp2moc = {};
+    $moc2cpp = {};
+    foreach $cxxf (@cppFiles)
+    {
+      open (CXXFIN, $cxxf) || die "Could not open $cxxf: $!\n";
+      seek(CXXFIN, 0, 2);
+      my $cxxfsize = tell(CXXFIN);
+      seek(CXXFIN, 0, 0);
+      read CXXFIN, $cxxfData, $cxxfsize;
+      close CXXFIN;
+      while(($cxxfData =~ m/^[ \t]*\#include\s*[<\"](.*\.moc)[>\"]/gm)) {
+	$cpp2moc->{$cxxf}->{$1} = 1;
+	$moc2cpp->{$1}->{$cxxf} = 1;
+      }
+    }
+    foreach my $mocFile (keys (%mocFiles))
+    {
+	@cppFiles = keys %{$moc2cpp->{"$mocFile.moc"}};
+        if (@cppFiles == 1) {
+            $mocFiles{$mocFile} .= "\035" . $cppFiles[0];
+	    push(@depend, $mocFile);
+        } elsif (@cppFiles == 0) {
+            push (@newObs, $mocFile);           # Produce new object file
+            next    if ($haveAutomocTag);       # This is expected...
+            # But this is an error we can deal with - let them know
+            print STDERR
+                "Warning: No c++ file that includes $mocFile.moc\n";
+        } else {
+            # We can't decide which file to use, so it's fatal. Although as a
+            # guess we could use the mocFile.cpp file if it's in the list???
+            print STDERR
+                "Error: Multiple c++ files that include $mocFile.moc\n";
+            print STDERR "\t",join ("\t", @cppFiles),"\n";
+            $errorflag = 1;
+            delete $mocFiles{$mocFile};
+            # Let's continue and see what happens - They have been told!
+        }
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# Add the rules for generating moc source from header files
+# For Automoc output *.moc.cpp but normally we'll output *.moc
+# (We must compile *.moc.cpp separately. *.moc files are included
+# in the appropriate *.cpp file by the programmer)
+sub addMocRules ()
+{
+    my $cppFile;
+    my $hFile;
+
+    foreach $mocFile (keys (%mocFiles))
+    {
+        undef $cppFile;
+        ($dir, $hFile, $cppFile) =  split ("\035", $mocFiles{$mocFile}, 3);
+        $dir =~ s#^\.#\$(srcdir)#;
+        if (defined ($cppFile))
+        {
+	  $cppFile =~ s,\.[^.]*$,,;
+	  $target_adds{"$cppFile.o"} .= "$mocFile.moc ";
+	  $target_adds{"$cppFile.lo"} .= "$mocFile.moc ";
+	  appendLines ("$mocFile.moc: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile.moc\n");
+	  $cleanMoc .= " $mocFile.moc";
+	  appendLines ("mocs: $mocFile.moc\n");
+        }
+        else
+        {
+            appendLines ("$mocFile$mocExt: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile$mocExt\n");
+            $cleanMoc .= " $mocFile$mocExt";
+	    appendLines ("mocs: $mocFile$mocExt\n");
+        }
+    }
+}
+
+sub make_bcheck_target()
+{
+    my $lookup = 'RECURSIVE_TARGETS\s*=[ \t]*(.*)';
+    my $bcheckdep = "bcheck-am";
+    $bcheckdep = "bcheck-recursive" if ($MakefileData =~ /\n$lookup/);
+
+    my $headers= "";
+    $headers = $1 if($MakefileData =~ /\nHEADERS\s*=[ \t]*(.+)/);
+    $headers =~ s/\$\((?:noinst|EXTRA)_HEADERS\)//g;
+
+    $target_adds{"clean-am"} .= "clean-bcheck ";
+
+    my $t = "clean-bcheck: \n" .
+            "\trm -f *.bchecktest.cc *.bchecktest.cc.class a.out\n\n" .
+            "bcheck: $bcheckdep\n\n" .
+            "bcheck-am:\n" .
+           "\t\@for i in $headers; do \\\n" .
+           "\t    if test \$(srcdir)/\$\$i -nt \$\$i.bchecktest.cc; then \\\n" . 
+           "\t        echo \"int main() {return 0;}\" > \$\$i.bchecktest.cc ; \\\n" .
+           "\t        echo \"#include \\\"\$\$i\\\"\" >> \$\$i.bchecktest.cc ; \\\n" .
+           "\t        echo \"\$\$i\"; \\\n" . 
+           "\t        if ! ";
+    $t .=  $cxxsuffix eq "KKK" ?
+           "\$(CXX) \$(DEFS) -I. -I\$(srcdir) -I\$(top_builddir) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(CXXFLAGS) \$(KDE_CXXFLAGS) " :
+           "\$(CXXCOMPILE) ";
+    $t .=  " --dump-class-hierarchy -c \$\$i.bchecktest.cc; then \\\n" .
+           "\t            rm -f \$\$i.bchecktest.cc; exit 1; \\\n" .
+           "\t        fi ; \\\n" .
+           "\t        echo \"\" >> \$\$i.bchecktest.cc.class; \\\n" .
+           "\t        perl \$(top_srcdir)/admin/bcheck.pl \$\$i.bchecktest.cc.class || { rm -f \$\$i.bchecktest.cc; exit 1; }; \\\n" .
+           "\t        rm -f a.out; \\\n" .
+           "\t    fi ; \\\n" .
+           "\tdone\n";
+    appendLines("$t\n");
+}
+
+sub make_meta_classes ()
+{
+    return if ($kdeopts{"qtonly"});
+
+    my $cppFile;
+    my $hFile;
+    my $moc_class_headers = "";
+    foreach $program (@programs) {
+	my $mocs = "";
+	my @progsources = split(/[\034\s]+/, $sources{$program});
+	my @depmocs = split(' ', $dependmocs{$program});
+	my %shash = (), %mhash = ();
+	@shash{@progsources} = 1;  # we are only interested in the existence
+	@mhash{@depmocs} = 1;
+
+	print STDOUT "program=$program\n" if ($verbose);
+	print STDOUT "psources=[".join(' ', keys %shash)."]\n" if ($verbose);
+	print STDOUT "depmocs=[".join(' ', keys %mhash)."]\n" if ($verbose);
+	print STDOUT "globalmocs=[".join(' ', keys(%globalmocs))."]\n" if ($verbose);
+	foreach my $mocFile (keys (%globalmocs))
+	{
+	    my ($dir, $hFile, $cppFile) = split ("\035", $globalmocs{$mocFile}, 3);
+	    if (defined ($cppFile))
+	    {
+		$mocs .= " $mocFile.moc" if exists $shash{$cppFile};
+	    }
+	    else
+	    {
+		# Bah. This is the case, if no C++ file includes the .moc
+		# file. We make a .moc.cpp file for that. Unfortunately this
+		# is not included in the %sources hash, but rather is mentioned
+		# in %dependmocs. If the user wants to use AUTO he can't just
+		# use an unspecific METAINCLUDES. Instead he must use
+		# program_METAINCLUDES. Anyway, it's not working real nicely.
+		# E.g. Its not clear what happens if user specifies two
+		# METAINCLUDES=AUTO in the same Makefile.am.
+		$mocs .= " $mocFile.moc.$cxxsuffix"
+		    if exists $mhash{$mocFile.".moc.$cxxsuffix"};
+	    }
+	}
+	if ($mocs) {
+	    print STDOUT "==> mocs=[".$mocs."]\n" if ($verbose);
+	}
+	print STDOUT "\n" if $verbose;
+    }
+    if ($moc_class_headers) {
+        appendLines ("$cleantarget-moc-classes:\n\t-rm -f $moc_class_headers\n");
+        $target_adds{"$cleantarget-am"} .= "$cleantarget-moc-classes ";
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+sub updateMakefile ()
+{
+    return if ($dryrun);
+
+    open (FILEOUT, "> $makefile")
+                        || die "Could not create $makefile: $!\n";
+
+    $MakefileData =~ s/\034/\\\n/g;    # Restore continuation lines
+    # Append our $progId line, _below_ the "generated by automake" line
+    # because automake-1.6 relies on the first line to be his own.
+    my $progIdLine = "\# $progId - " . '$Revision: 1.1 $ '."\n";
+    if ( !( $MakefileData =~ s/^(.*generated .*by automake.*\n)/$1$progIdLine/ ) ) {
+        warn "automake line not found in $makefile\n";
+	# Fallback: first line
+        print FILEOUT $progIdLine;
+    };
+    print FILEOUT $MakefileData;
+    close FILEOUT;
+}
+
+#-----------------------------------------------------------------------------
+
+# The given line needs to be removed from the makefile
+# Do this by adding the special "removed line" comment at the line start.
+sub removeLine ($$)
+{
+    my ($lookup, $old) = @_;
+
+    $old =~ s/\034/\\\n#>- /g;          # Fix continuation lines
+    $MakefileData =~ s/\n$lookup/\n#>\- $old/;
+}
+
+#-----------------------------------------------------------------------------
+
+# Replaces the old line with the new line
+# old line(s) are retained but tagged as removed. The new line(s) have the
+# "added" tag placed before it.
+sub substituteLine ($$)
+{
+    my ($lookup, $new) = @_;
+
+    if ($MakefileData =~ /\n($lookup)/) {
+      $old = $1;
+      $old =~ s/\034/\\\n#>\- /g;         # Fix continuation lines
+      my $newCount = ($new =~ tr/\034//) + ($new =~ tr/\n//) + 1;
+      $new =~ s/\\\n/\034/g;
+      $MakefileData =~ s/\n$lookup/\n#>- $old\n#>\+ $newCount\n$new/;
+    } else {
+        warn "Warning: substitution of \"$lookup\" in $printname failed\n";
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# Slap new lines on the back of the file.
+sub appendLines ($)
+{
+  my ($new) = @_;
+  my $copynew = $new;
+  my $newCount = ($new =~ tr/\034//) + ($new =~ tr/\n//) + 1;
+  $new =~ s/\\\n/\034/g;        # Fix continuation lines
+  $MakefileData .= "\n#>\+ $newCount\n$new";
+}
+
+#-----------------------------------------------------------------------------
+
+# Restore the Makefile.in to the state it was before we fiddled with it
+sub restoreMakefile ()
+{
+    $MakefileData =~ s/# $progId[^\n\034]*[\n\034]*//g;
+    # Restore removed lines
+    $MakefileData =~ s/([\n\034])#>\- /$1/g;
+    # Remove added lines
+    while ($MakefileData =~ /[\n\034]#>\+ ([^\n\034]*)/)
+    {
+        my $newCount = $1;
+        my $removeLines = "";
+        while ($newCount--) {
+            $removeLines .= "[^\n\034]*([\n\034]|)";
+        }
+        $MakefileData =~ s/[\n\034]#>\+.*[\n\034]$removeLines/\n/;
+    }
+}
+
+#-----------------------------------------------------------------------------
+
+# find the .kcfg file listed in the .kcfgc file
+sub findKcfgFile($)
+{
+  my ($kcfgf) = @_;
+  open (KCFGFIN, $kcfgf) || die "Could not open $kcfgf: $!\n";
+  seek(KCFGFIN, 0, 2);
+  my $kcfgfsize = tell(KCFGFIN);
+  seek(KCFGFIN, 0, 0);
+  read KCFGFIN, $kcfgfData, $kcfgfsize;
+  close KCFGFIN;
+  if(($kcfgfData =~ m/^File=(.*\.kcfg)/gm)) {
+    $kcfg = $1;
+  }
+}
diff --git a/lib-src/taglib/admin/bcheck.pl b/lib-src/taglib/admin/bcheck.pl
new file mode 100644
index 0000000..cca973e
--- /dev/null
+++ b/lib-src/taglib/admin/bcheck.pl
@@ -0,0 +1,157 @@
+#!/usr/bin/perl -w
+
+use DB_File;
+use Fcntl ':flock';
+
+if (!defined($ARGV[0])) {
+    print "usage: requires .class dump as parameter!\n";
+    exit;
+}
+
+sub bailout
+{
+    untie %bcheckdb if(defined(%bcheckdb));
+
+    if(defined(MYLOCK)) {
+        flock MYLOCK, LOCK_UN;
+        close(MYLOCK);
+    }
+
+    print @_;
+    exit 5;
+}
+
+sub ask_user
+{
+    my ($dbkey, $dbchunk) = @_;
+
+    if (defined($ENV{"BCHECK_UPDATE"})) {
+        $bcheckdb{$dbkey} = $dbchunk;
+        return;
+    }
+
+    &bailout("BC problem detected") if (! -t STDIN);
+
+    print "(I)gnore / (Q)uit / (U)pdate: ";
+
+    my $key;
+    while(defined(read STDIN, $key, 1)) {
+        $key = lc($key);
+
+        print "got: >$key<\n";
+
+        return if ($key eq 'i');
+
+        &bailout("BC problem. aborted") if ($key eq 'q');
+
+        if ($key eq 'u') {
+            $bcheckdb{$dbkey} = $dbchunk;
+            return;
+        }
+        print "\n(I)gnore / (Q)uit / (U)pdate: ";
+    }
+}
+
+sub diff_chunk($$)
+{
+    my ($oldl, $newl) = @_;
+    my @old = split /^/m, $oldl;
+    my @new = split /^/m, $newl;
+    my $haschanges = 0;
+    my $max = $#old > $#new ? $#old : $#new;
+
+    die "whoops. key different" if ($old[0] ne $new[0]);
+
+    if ($#old != $#new) {
+        warn ("Structural difference.\n");
+        print @old;
+        print "-----------------------------------------------\n";
+        print @new;
+        $haschanges = 1;
+        return $haschanges;
+    }
+
+    print $old[0];
+
+    my ($class) = ($old[0] =~ /^(?:Class |Vtable for )(\S+)/);
+
+    my $c = 1;
+    while ($c < $max) {
+        my ($o, $n) = ($old[$c], $new[$c]);
+        chomp $o;
+        chomp $n;
+        $c++;
+        next if ($o eq $n);
+
+        if(defined($class) and $n =~ /^(\d+\s+)\w+(::\S+\s*.*)$/) {
+            next if ($n eq "$1$class$2");
+        }
+
+        $haschanges = 1;
+
+        print "-$o\n+$n\n\n";
+    }
+
+    return $haschanges;
+}
+
+local $dblock = $ENV{"HOME"} . "/bcheck.lock";
+my $dbfile = $ENV{"HOME"} . "/bcheck.db";
+my $cdump  = $ARGV[0];
+
+die "file $cdump is not readable: $!" if (! -f $cdump);
+
+# make sure the advisory lock exists
+open(MYLOCK, ">$dblock");
+print MYLOCK "";
+
+flock MYLOCK, LOCK_EX;
+
+tie %bcheckdb, 'DB_File', $dbfile;
+
+my $chunk = "";
+
+open (IN, "<$cdump") or die "cannot open $cdump: $!";
+while (<IN>) {
+
+    chop;
+
+    s/0x[0-9a-fA-F]+/0x......../g;
+    s/base size=/size=/g;
+    s/\(\)\s*$//g;
+    s/base align=/align=/g;
+
+    $chunk .= $_ . "\n";
+
+    if(/^\s*$/) {
+        my @lines = split /^/m, $chunk;
+        my $key = $lines[0];
+        chomp $key;
+
+        if($key !~ /<anonymous struct>/ &&
+           $key !~ /<anonymous union>/) {
+            if(defined($bcheckdb{$key})) {
+                my $dbversion = $bcheckdb{$key};
+
+                if($dbversion ne $chunk) {
+                     &ask_user($key, $chunk) if(&diff_chunk($dbversion, $chunk));
+                }
+            }
+            else {
+                $bcheckdb{$key} = $chunk;
+                print "NEW: $key\n";
+            }
+        }
+
+        $chunk = "";
+        next;
+    }
+
+}
+close(IN);
+
+untie %bcheckdb;
+flock MYLOCK, LOCK_UN;
+close(MYLOCK);
+
+exit 0;
diff --git a/lib-src/taglib/admin/compile b/lib-src/taglib/admin/compile
new file mode 100755
index 0000000..1b1d232
--- /dev/null
+++ b/lib-src/taglib/admin/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/lib-src/taglib/admin/conf.change.pl b/lib-src/taglib/admin/conf.change.pl
new file mode 100644
index 0000000..129d759
--- /dev/null
+++ b/lib-src/taglib/admin/conf.change.pl
@@ -0,0 +1,191 @@
+#!/usr/bin/env perl
+
+# this script patches a config.status file, to use our own perl script
+# in the main loop
+# we do it this way to circumvent hacking (and thereby including)
+# autoconf function (which are GPL) into our LGPL acinclude.m4.in
+# written by Michael Matz <matz at kde.org>
+# adapted by Dirk Mueller <mueller at kde.org>
+#
+#   This file is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU Library General Public
+#   License as published by the Free Software Foundation; either
+#   version 2 of the License, or (at your option) any later version.
+
+#   This library is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#   Library General Public License for more details.
+
+#   You should have received a copy of the GNU Library General Public License
+#   along with this library; see the file COPYING.LIB.  If not, write to
+#   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#   Boston, MA 02110-1301, USA.
+
+# we have to change two places
+# 1. the splitting of the substitutions into chunks of 90 (or even 48 in
+#    later autoconf's
+# 2. the big main loop which patches all Makefile.in's
+
+use strict;
+use File::Basename;
+
+my $ac_aux_dir = dirname($0);
+my ($flag);
+my $ac_version = 0;
+my $vpath_seen = 0;
+$flag = 0;
+
+while (<>) {
+# usage of $flag: 0 -- we have seen nothing yet
+#   1 -- we are in (1)
+#   2 -- we have ended (1)
+#   3 -- we are in (2)
+#   4 -- we ended (2)
+
+    if ($flag == 4) {
+        print;
+    } elsif ($flag == 0) {
+# 1. begins with (including): "ac_max_sed_\S+\s*=\s*[0-9]+..."
+#    ends with (excluding) "CONFIG_FILE=..."
+#    in later autoconf (2.14.1) there is no CONFIG_FILES= line,
+#    but instead the (2) directly follow (1)
+        if (/^\s*ac_max_sed_([a-z]+).*=\s*([0-9]+)/ ) {
+	    $flag = 1;
+	    if ($1 eq 'lines') {
+                # lets hope its different with 2141, 
+                # wasn't able to verify that
+              if ($2 eq '48') {
+                $ac_version = 250;
+              }
+              else {
+	        $ac_version = 2141;
+              }
+	    } elsif ($1 eq 'cmds') {
+	        $ac_version = 213;
+	    }
+	    # hmm, we don't know the autoconf version, but we try anyway
+	} else {
+	    print;
+	}
+    } elsif ($flag == 1) {
+        if (/^\s*CONFIG_FILES=/ && ($ac_version != 250)) {
+	     print;
+	     $flag = 2;
+	} elsif (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
+	     $flag = 3;
+	}
+    } elsif ($flag == 2) {
+# 2. begins with: "for ac_file in.*CONFIG_FILES"  (the next 'for' after (1))
+#    end with: "rm -f conftest.s\*"
+# on autoconf 250, it ends with '# CONFIG_HEADER section'
+#
+# gg: if a post-processing commands section is found first, 
+#    stop there and insert a new loop to honor the case/esac.
+# (pattern: /^\s+#\sRun the commands associated with the file./)
+
+	if (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
+	    $flag = 3;
+	} else {
+	    print;
+	}
+    } elsif ($flag == 3) {
+        if (/^\s*rm\s+-f\s+conftest/ ) {
+	    $flag = 4;
+	    &insert_main_loop();
+	} elsif (/^\s*rm\s+-f\s+.*ac_cs_root/ ) {
+	    $flag = 4;
+	    &insert_main_loop();
+	    #die "hhhhhhh";
+	    if ($ac_version != 2141) {
+	        print STDERR "hmm, don't know autoconf version\n";
+	    }
+        } elsif (/^\#\s*CONFIG_(HEADER|COMMANDS) section.*|^\s+#\s(Run) the commands associated/) {
+          $flag = 4;
+          my $commands = defined $2;
+          &insert_main_loop();
+          $commands && insert_command_loop();
+          if($ac_version != 250) {
+            print STDERR "hmm, something went wrong :-(\n";
+          }
+	} elsif (/VPATH/ ) {
+	    $vpath_seen = 1;
+	}
+    }
+}
+
+die "wrong input (flag != 4)" unless $flag == 4;
+print STDERR "hmm, don't know autoconf version\n" unless $ac_version;
+
+sub insert_main_loop {
+
+  if ($ac_version == 250) {
+    &insert_main_loop_250();
+  }
+  else {
+    &insert_main_loop_213();
+  }
+}
+
+sub insert_main_loop_250 {
+
+  print <<EOF;
+  #echo Doing the fast build of Makefiles -- autoconf $ac_version
+EOF
+    if ($vpath_seen) {
+        print <<EOF;
+        # VPATH subst was seen in original config.status main loop
+  echo '/^[ 	]*VPATH[ 	]*=[^:]*\$/d' >>\$tmp/subs.sed
+EOF
+      }
+  print <<EOF;
+  rm -f \$tmp/subs.files
+  for ac_file in .. \$CONFIG_FILES ; do
+      if test "x\$ac_file" != x..; then
+          echo \$ac_file >> \$tmp/subs.files
+      fi
+  done
+  if test -f \$tmp/subs.files ; then
+      perl $ac_aux_dir/config.pl "\$tmp/subs.sed" "\$tmp/subs.files" "\$srcdir" "\$INSTALL"
+  fi
+  rm -f \$tmp/subs.files
+
+fi
+EOF
+  return;
+}
+
+sub insert_main_loop_213 {
+    print <<EOF;
+#echo Doing the fast build of Makefiles -- autoconf $ac_version
+if test "x\$ac_cs_root" = "x" ; then
+    ac_cs_root=conftest
+fi
+EOF
+    if ($vpath_seen) {
+      print <<EOF;
+# VPATH subst was seen in original config.status main loop
+echo '/^[ 	]*VPATH[ 	]*=[^:]*\$/d' >> \$ac_cs_root.subs
+EOF
+    }
+    print <<EOF;
+rm -f \$ac_cs_root.sacfiles
+for ac_file in .. \$CONFIG_FILES ; do
+    if test "x\$ac_file" != x..; then
+        echo \$ac_file >> \$ac_cs_root.sacfiles
+    fi
+done
+if test -f \$ac_cs_root.sacfiles ; then
+    perl $ac_aux_dir/config.pl "\$ac_cs_root.subs" "\$ac_cs_root.sacfiles" "\$ac_given_srcdir" "\$ac_given_INSTALL"
+fi
+rm -f \$ac_cs_root.s*
+
+EOF
+    return;
+}
+
+sub insert_command_loop {
+    print <<EOF;
+  for ac_file in .. \$CONFIG_FILES ; do
+EOF
+}
diff --git a/lib-src/taglib/admin/config.guess b/lib-src/taglib/admin/config.guess
new file mode 100755
index 0000000..4f0f63f
--- /dev/null
+++ b/lib-src/taglib/admin/config.guess
@@ -0,0 +1,1464 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-06-30'
+
+# 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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 <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>.  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 <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+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 ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # 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 at 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 ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# 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 Pn.n version is a patched version.
+	# 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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    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 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at 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 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    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 ;;
+    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 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    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 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # 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 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* 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 &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    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 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????: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 ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    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 ;;
+    *: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 <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	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 ;;
+    *: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 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    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 <stdlib.h>
+              #include <unistd.h>
+
+              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
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	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 && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    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 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    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 ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    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 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    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; }
+	;;
+    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; }
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    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 ;;
+    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 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    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 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit ;;
+	  "")
+		# 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 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#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
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#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
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    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 ;;
+    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 ;;
+    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 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    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 ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	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 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/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 ;;
+    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 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    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 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*: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 | S7501*:*: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; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *: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 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    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 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *: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 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *: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 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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\n"); 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 <sys/param.h>
+#  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 && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# 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 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> 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:
diff --git a/lib-src/taglib/admin/config.pl b/lib-src/taglib/admin/config.pl
new file mode 100644
index 0000000..c2b0517
--- /dev/null
+++ b/lib-src/taglib/admin/config.pl
@@ -0,0 +1,238 @@
+#!/usr/bin/env perl
+# a script for use by autoconf to make the Makefiles
+# from the Makefile.in's
+#
+# the original autoconf mechanism first splits all substitutions into groups
+# of ca. 90, and than invokes sed for _every_ Makefile.in and every group
+# (so around 2-3 times per Makefile.in). So this takes forever, as sed
+# has to recompile the regexps every time.
+#
+# this script does better. It changes all Makefile.ins in one process.
+# in kdelibs the time for building Makefile went down from 2:59 min to 13 sec!
+#
+# written by Michael Matz <matz at kde.org>
+# adapted by Dirk Mueller <mueller at kde.org>
+
+#   This file is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU Library General Public
+#   License as published by the Free Software Foundation; either
+#   version 2 of the License, or (at your option) any later version.
+
+#   This library is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#   Library General Public License for more details.
+
+#   You should have received a copy of the GNU Library General Public License
+#   along with this library; see the file COPYING.LIB.  If not, write to
+#   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#   Boston, MA 02110-1301, USA.
+
+use strict;
+
+use File::Path;
+
+my $ac_subs=$ARGV[0];
+my $ac_sacfiles = $ARGV[1];
+my $ac_given_srcdir=$ARGV[2];
+my $ac_given_INSTALL=$ARGV[3];
+
+my @comp_match;
+my @comp_subs;
+
+#print "ac_subs=$ac_subs\n";
+#print "ac_sacfiles=$ac_sacfiles\n";
+#print "ac_given_srcdir=$ac_given_srcdir\n";
+#print "ac_given_INSTALL=$ac_given_INSTALL\n";
+
+my $configure_input;
+my ($srcdir, $top_srcdir);
+my $INSTALL;
+my $bad_perl = ($] < 5.005);
+my $created_file_count = 0;
+
+open(CF, "< $ac_subs") || die "can't open $ac_subs: $!";
+my @subs = <CF>;
+my $pat;
+close(CF);
+chomp @subs;
+ at comp_match=();
+ at comp_subs=();
+
+if ($bad_perl) {
+    print "Using perl older than version 5.005\n";
+    foreach $pat (@subs) {
+	if (  ($pat =~ m/s%([^%]*)%([^%]*)%g/ )
+	   || ($pat =~ m/s%([^%]*)%([^%]*)%;t/ )
+           || ($pat =~ m/s,([^,]*),(.*),;t/)
+	   || ($pat =~ m%s/([^/]*)/([^/]*)/g% )
+	   || ($pat =~ m%s/([^/]*)/([^/]*)/;t% )
+	   ) {
+            # form : s%bla%blubb%g
+            # or     s%bla%blubb%;t t   (autoconf > 2.13 and < 2.52 ?)
+            # or     s,bla,blubb,;t t   (autoconf 2.52)
+            my $srch = $1;
+            my $repl = $2;
+            $repl =~ s/\\(.)/$1/g;
+	    push @comp_subs, make_closure($srch, $repl);
+
+	} elsif ( ($pat =~ /%([^%]*)%d/ )
+	   || ($pat =~ m%/([^/]*)/d% )
+	   ) {
+	    push @comp_subs, make_closure($1, "");
+	} else {
+	    die "Uhh. Malformed pattern in $ac_subs ($pat)"
+		unless ( $pat =~ /^\s*$/ );   # ignore white lines
+	}
+    }
+} else {
+    foreach $pat (@subs) {
+       if ( ($pat =~ /s%([^%]*)%([^%]*)%g/ ) ||
+            ($pat =~ /s%([^%]*)%([^%]*)%;t/ ) ||
+            ($pat =~ /s,([^,]*),(.*),;t/) ) {
+         # form : s%bla%blubb%g
+         # or     s%bla%blubb%;t t   (autoconf > 2.13 and < 2.52 ?)
+         # or     s,bla,blubb,;t t   (autoconf 2.52)
+         my $srch = $1;
+         my $repl = $2;
+         push @comp_match, eval "qr/\Q$srch\E/";  # compile match pattern
+         $repl =~ s/\\(.)/$1/g;
+         push @comp_subs, $repl;
+      } elsif ( ($pat =~ /%([^%]*)%d/ )
+                || ($pat =~ m%/([^/]*)/d% )
+              ) {
+        push @comp_match, eval "qr/\Q$1\E/";
+        push @comp_subs, "";
+      } else {
+          die "Uhh. Malformed pattern in $ac_subs ($pat)"
+          unless ( $pat =~ /^\s*$/ );   # ignore white lines
+      }
+    }
+}
+undef @subs;
+
+# read the list of files to be patched, form:
+# ./Makefile arts/Makefile arts/examples/Makefile arts/flow/Makefile
+
+open(CF, "< $ac_sacfiles") || die "can't open $ac_sacfiles: $!";
+my @ac_files = <CF>;
+close(CF);
+chomp @ac_files;
+
+
+my $ac_file;
+foreach $ac_file (@ac_files) {
+    next if $ac_file =~ /\.\./;
+    next if $ac_file =~ /^\s*$/;
+    my $ac_file_in;
+    my ($ac_dir, $ac_dots, $ac_dir_suffix);
+
+    if ($ac_file =~ /.*:.*/ ) {
+	($ac_file_in = $ac_file) =~ s%[^:]*:%%;
+	$ac_file =~ s%:.*%%;
+    } else {
+	$ac_file_in = $ac_file.".in";
+    }
+
+# 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 = $ac_file) =~ s%/[^/][^/]*$%%;
+    if ( ($ac_dir ne $ac_file) && ($ac_dir ne ".")) {
+# The file is in a subdirectory.
+	if (! -d "$ac_dir") { mkpath "$ac_dir", 0, 0777; }
+	($ac_dir_suffix = $ac_dir) =~ s%^./%%;
+	$ac_dir_suffix="/".$ac_dir_suffix;
+# A "../" for each directory in $ac_dir_suffix.
+	($ac_dots = $ac_dir_suffix) =~ s%/[^/]*%../%g;
+    } else {
+	$ac_dir_suffix="";
+	$ac_dots="";
+    }
+
+    if ($ac_given_srcdir eq ".") {
+	$srcdir=".";
+	if ($ac_dots) {
+	    ( $top_srcdir = $ac_dots) =~ s%/$%%;
+	} else { $top_srcdir="."; }
+    } elsif ($ac_given_srcdir =~ m%^/%) {
+	$srcdir=$ac_given_srcdir.$ac_dir_suffix;
+	$top_srcdir = $ac_given_srcdir;
+    } else {
+	$srcdir = $ac_dots.$ac_given_srcdir.$ac_dir_suffix;
+	$top_srcdir = $ac_dots.$ac_given_srcdir;
+    }
+
+    if ($ac_given_INSTALL) {
+	if ($ac_given_INSTALL =~ m%^/% ) {
+	    $INSTALL = $ac_given_INSTALL;
+	} else {
+	    $INSTALL = $ac_dots.$ac_given_INSTALL;
+	}
+    }
+
+    print "fast creating $ac_file\n";
+    unlink $ac_file;
+    my $ac_comsub="";
+    my $fname=$ac_file_in;
+    $fname =~ s%.*/%%;
+    $configure_input="$ac_file.  Generated from $fname by config.pl.";
+
+    my $ac_file_inputs;
+    ($ac_file_inputs = $ac_file_in) =~ s%^%$ac_given_srcdir/%;
+    $ac_file_inputs =~ s%:% $ac_given_srcdir/%g;
+
+    patch_file($ac_file, $ac_file_inputs);
+    ++$created_file_count;
+}
+
+print "config.pl: fast created $created_file_count file(s).\n";
+
+sub patch_file {
+    my ($outf, $infiles) = @_;
+    my $filedata;
+    my @infiles=split(' ', $infiles);
+    my $i=0;
+    my $name;
+
+    foreach $name (@infiles) {
+	if (open(CF, "< $name")) {
+	    while (<CF>) {
+		$filedata .= $_;
+	    }
+	    close(CF);
+	} else {
+	    print STDERR "can't open $name: $!"."\n";
+	}
+    }
+
+    $filedata =~ s%\@configure_input\@%$configure_input%g;
+    $filedata =~ s%\@srcdir\@%$srcdir%g;
+    $filedata =~ s%\@top_srcdir\@%$top_srcdir%g;
+    $filedata =~ s%\@INSTALL\@%$INSTALL%g;
+
+    if ($bad_perl) {
+	while ($i <= $#comp_subs) {
+	    my $ref = $comp_subs[$i];
+	    &$ref(\$filedata);
+	    $i++;
+	}
+    } else {
+	while ($i <= $#comp_match) {
+	    $filedata =~ s/$comp_match[$i]/$comp_subs[$i]/g;
+	    $i++;
+	}
+    }
+    open(CF, "> $outf") || die "can't create $outf: $!";
+    print CF $filedata;
+    close(CF);
+}
+
+sub make_closure {
+    my ($pat, $sub) = @_;
+    my $ret = eval "return sub { my \$ref=shift; \$\$ref =~ s%\Q$pat\E%\Q$sub\E%g; }";
+    if ($@) {
+        print "can't create CODE: $@\n";
+    }
+    return $ret;
+}
diff --git a/lib-src/taglib/admin/config.sub b/lib-src/taglib/admin/config.sub
new file mode 100755
index 0000000..2ef2842
--- /dev/null
+++ b/lib-src/taglib/admin/config.sub
@@ -0,0 +1,1575 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-07-01'
+
+# 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., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, 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 <config-patches at gnu.org>.  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 <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+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 ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # 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 ;;
+
+    * )
+       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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-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 | -knuth | -cray)
+		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] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| ms1 \
+	| msp430 \
+	| ns16k | ns32k \
+	| 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 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m32c)
+		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-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | 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-* | iq2000-* \
+	| m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| ms1-* \
+	| msp430-* \
+	| none-* | np1-* | 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-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	m32c-*)
+		;;
+	# 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
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	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
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	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
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	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
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	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
+		;;
+	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
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	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
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	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
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	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
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	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
+		;;
+	sparc | sparcv8 | 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* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -ekkobsd* | -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* | -linux-uclibc* | -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* | -dragonfly* | -skyos*)
+	# 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-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-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
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-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
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-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
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-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
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-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
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-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
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/lib-src/taglib/admin/configure.in.bot.end b/lib-src/taglib/admin/configure.in.bot.end
new file mode 100644
index 0000000..1bc030b
--- /dev/null
+++ b/lib-src/taglib/admin/configure.in.bot.end
@@ -0,0 +1,45 @@
+# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
+if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
+  # And if so, warn when they don't match
+  if test "$kde_libs_prefix" != "$given_prefix"; then
+    # And if kde doesn't know about the prefix yet
+    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
+    if test $? -ne 0; then
+      echo ""
+      echo "Warning: you chose to install this package in $given_prefix,"
+      echo "but KDE was found in $kde_libs_prefix."
+      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
+      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
+      echo "Then restart KDE."
+      echo ""
+    fi
+  fi
+fi
+
+if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
+  echo ""
+  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
+  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
+  echo ""
+  echo "For better performance, consider including the Qt visibility supporting patch"
+  echo "located at:"
+  echo ""
+  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
+  echo ""
+  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
+  echo "everything will continue to work just fine without it."
+  echo ""
+fi
+
+if test "$all_tests" = "bad"; then
+  if test ! "$cache_file" = "/dev/null"; then
+    echo ""
+    echo "Please remove the file $cache_file after changing your setup"
+    echo "so that configure will find the changes next time."
+    echo ""
+  fi
+else
+  echo ""
+  echo "Good - your configure finished. Start make now"
+  echo ""
+fi
diff --git a/lib-src/taglib/admin/configure.in.min b/lib-src/taglib/admin/configure.in.min
new file mode 100644
index 0000000..0dfe378
--- /dev/null
+++ b/lib-src/taglib/admin/configure.in.min
@@ -0,0 +1,57 @@
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 2001 Stephan Kulow (coolo at kde.org)
+ 
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+ 
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+ 
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl    Boston, MA 02110-1301, USA.
+
+# Original Author was Kalle at kde.org
+# I lifted it in some mater. (Stephan Kulow)
+# I used much code from Janos Farkas
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
+
+dnl This is so we can use kde-common
+AC_CONFIG_AUX_DIR(admin)
+
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
+unset CDPATH
+
+dnl Checking host/target/build systems, for make, install etc.
+AC_CANONICAL_SYSTEM 
+dnl Perform program name transformation
+AC_ARG_PROGRAM
+
+dnl Automake doc recommends to do this only here. (Janos)
+AM_INIT_AUTOMAKE(@MODULENAME@, @VERSION@) dnl searches for some needed programs
+
+KDE_SET_PREFIX
+
+dnl generate the config header
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
+
+dnl Checks for programs.
+AC_CHECK_COMPILERS
+AC_ENABLE_SHARED(yes)
+AC_ENABLE_STATIC(no)
+KDE_PROG_LIBTOOL
+
+dnl for NLS support. Call them in this order!
+dnl WITH_NLS is for the po files
+AM_KDE_WITH_NLS
+
+dnl KDE_USE_QT
+AC_PATH_KDE
diff --git a/lib-src/taglib/admin/cvs.sh b/lib-src/taglib/admin/cvs.sh
new file mode 100644
index 0000000..1732e98
--- /dev/null
+++ b/lib-src/taglib/admin/cvs.sh
@@ -0,0 +1,661 @@
+#! /bin/sh
+#
+# cvs.sh
+#
+# This file contains support code from Makefile.common
+# It defines a shell function for each known target
+# and then does a case to call the correct function.
+
+unset MAKEFLAGS
+
+call_and_fix_autoconf()
+{
+  $AUTOCONF || exit 1
+  if test -r configure.in.in ; then
+    perl -pi -e "print \"if test \\\"x\\\$with_fast_perl\\\" = \\\"xyes\\\"; then\
+    \\n  perl -i.bak \\\$ac_aux_dir/conf.change.pl \\\$CONFIG_STATUS\
+    \\\\\\n    || mv \\\$CONFIG_STATUS.bak \\\$CONFIG_STATUS\
+    \\n  rm -f \\\$CONFIG_STATUS.bak\\nfi\
+    \\n\" if /^\\s*chmod\\s+.*\\+x\\s+.*CONFIG_STATUS/; s,^#line.*LINENO.*\$,/* \$& */, ;" configure
+  fi
+}
+
+strip_makefile()
+{
+  if test ! -f $makefile_wo; then
+    perl -e '$in=0; while ( <> ) { $in = 1 if ($_ =~ m/^if / ); print $_ unless ($in || $_ =~ m/^include /); $in = 0 if ($_ =~ m/^endif/); }' < $makefile_am > $makefile_wo
+  fi
+}
+
+check_autotool_versions()
+{
+required_autoconf_version="2.53 or newer"
+AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1`
+case $AUTOCONF_VERSION in
+  Autoconf*2.5* | autoconf*2.5* | autoconf*2.6* ) : ;;
+  "" )
+    echo "*** AUTOCONF NOT FOUND!."
+    echo "*** KDE requires autoconf $required_autoconf_version"
+    exit 1
+    ;;
+  * )
+    echo "*** YOU'RE USING $AUTOCONF_VERSION."
+    echo "*** KDE requires autoconf $required_autoconf_version"
+    exit 1
+    ;;
+esac
+
+AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1`
+case $AUTOHEADER_VERSION in
+  Autoconf*2.5* | autoheader*2.5* | autoheader*2.6* ) : ;;
+  "" )
+    echo "*** AUTOHEADER NOT FOUND!."
+    echo "*** KDE requires autoheader $required_autoconf_version"
+    exit 1
+    ;;
+  * )
+    echo "*** YOU'RE USING $AUTOHEADER_VERSION."
+    echo "*** KDE requires autoheader $required_autoconf_version"
+    exit 1
+    ;;
+esac
+
+AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
+required_automake_version="1.6.1 or newer"
+case $AUTOMAKE_STRING in
+  automake*1.5d* | automake*1.5* | automake*1.5-* )
+    echo "*** YOU'RE USING $AUTOMAKE_STRING."
+    echo "*** KDE requires automake $required_automake_version"
+    exit 1
+    ;;
+  automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9* | automake*1.10*)
+    echo "*** $AUTOMAKE_STRING found."
+    UNSERMAKE=no
+    ;;
+  "" )
+    echo "*** AUTOMAKE NOT FOUND!."
+    echo "*** KDE requires automake $required_automake_version"
+    exit 1
+    ;;
+  *unsermake* ) :
+    echo "*** YOU'RE USING UNSERMAKE."
+    echo "*** GOOD LUCK!! :)"
+    UNSERMAKE=unsermake
+    ;;
+  * )
+    echo "*** YOU'RE USING $AUTOMAKE_STRING."
+    echo "*** KDE requires automake $required_automake_version"
+    exit 1
+    ;;
+esac
+unset required_automake_version
+}
+
+cvs()
+{
+check_autotool_versions
+acinclude_m4 
+
+### Make new subdirs and configure.in.
+### The make calls could be optimized away here,
+### with a little thought.
+if test -r configure.in.in; then
+    rm -f configure.in
+    echo "*** Creating list of subdirectories"
+    create_subdirs
+
+    if test -r Makefile.am.in; then
+        echo "*** Creating Makefile.am"
+        if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then 
+            strip_makefile
+            $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1
+        else
+            Makefile_am
+        fi
+     fi
+     configure_files
+     echo "*** Creating configure.in"
+     if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then 
+       strip_makefile
+       $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1
+     else
+       configure_in
+     fi
+fi
+
+echo "*** Creating aclocal.m4"
+$ACLOCAL $ACLOCALFLAGS || exit 1
+echo "*** Creating configure"
+call_and_fix_autoconf
+
+if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
+  echo "*** Creating config.h template"
+  $AUTOHEADER || exit 1
+  touch config.h.in
+fi
+
+echo "*** Creating Makefile templates"
+$AUTOMAKE || exit 1
+
+if test "$UNSERMAKE" = no; then
+  echo "*** Postprocessing Makefile templates"
+  perl -w admin/am_edit || exit 1
+fi
+
+if egrep "^cvs-local:" $makefile_am >/dev/null; then \
+  strip_makefile
+  $MAKE -f $makefile_wo cvs-local top_srcdir=. || exit 1
+fi
+
+echo "*** Creating date/time stamp"
+touch stamp-h.in
+
+echo "*** Finished"
+echo "    Don't forget to run ./configure"
+echo "    If you haven't done so in a while, run ./configure --help"
+}
+
+dist()
+{
+check_autotool_versions
+
+###
+### First build all of the files necessary to do just "make"
+###
+acinclude_m4
+if test -r configure.in.in; then
+  rm -f configure.in
+  create_subdirs
+
+  if test -r Makefile.am.in; then
+    if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then 
+      strip_makefile
+      $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1
+    else
+      Makefile_am
+    fi
+  fi
+  configure_files
+  if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then 
+    strip_makefile
+    $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1
+  else
+    configure_in
+  fi
+fi
+$ACLOCAL $ACLOCALFLAGS
+if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
+  echo "*** Creating config.h template"
+  $AUTOHEADER || exit 1
+  touch config.h.in
+fi
+$AUTOMAKE --foreign || exit 1
+if test "$UNSERMAKE" = no; then
+  echo "*** Postprocessing Makefile templates"
+  perl -w admin/am_edit || exit 1
+fi
+call_and_fix_autoconf
+touch stamp-h.in
+if grep "^cvs-local:" $makefile_am >/dev/null; then
+  strip_makefile
+  $MAKE -f $makefile_wo cvs-local top_srcdir=.
+fi
+
+###
+### Then make messages
+###
+if test -d po; then
+ LIST=`find ./po -name "*.po"`
+ for i in $LIST; do
+  file2=`echo $i | sed -e "s#\.po#\.gmo#"`
+  msgfmt -o $file2 $i || touch $file2
+ done
+fi
+if grep "^cvs-dist-local:" $makefile_am >/dev/null; then
+  strip_makefile
+  $MAKE -f $makefile_wo cvs-dist-local top_srcdir=.
+fi
+}
+
+subdir_dist()
+{
+$ACLOCAL $ACLOCALFLAGS
+$AUTOHEADER
+touch config.h.in
+$AUTOMAKE
+AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
+case $AUTOMAKE_STRING in
+  *unsermake* ) :
+    ;;
+  *)
+     perl -w ../admin/am_edit --path=../admin
+esac
+call_and_fix_autoconf
+touch stamp-h.in
+}
+
+configure_in()
+{
+rm -f configure.in configure.in.new
+kde_use_qt_param=
+test -f configure.files || { echo "need configure.files for configure.in"; exit 1; }
+list=`fgrep -v "configure.in.bot" < configure.files | fgrep -v "configure.in.mid"`
+: > configure.in.new
+for file in $list; do 
+  echo "dnl =======================================================" >> configure.in.new
+  echo "dnl FILE: $file" >> configure.in.new
+  echo "dnl =======================================================" >> configure.in.new
+  echo "" >> configure.in.new
+  cat $file >> configure.in.new
+done
+echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new
+if test -f Makefile.am.in; then
+  subdirs=`cat subdirs`
+  for dir in $subdirs; do
+    vdir=`echo $dir | sed -e 's,[-+.@],_,g'`
+    echo "AM_CONDITIONAL($vdir""_SUBDIR_included, test \"x\$$vdir""_SUBDIR_included\" = xyes)" >> configure.in.new
+    if test -f "$dir/configure.in"; then
+        echo "if test \"x\$$vdir""_SUBDIR_included\" = xyes; then " >> configure.in.new
+        echo "  AC_CONFIG_SUBDIRS($dir)" >> configure.in.new
+        echo "fi" >> configure.in.new
+    fi
+  done
+fi
+
+echo "AC_CONFIG_FILES([ Makefile ])" >> configure.in.new
+
+if test -f inst-apps; then
+    topleveldirs=`cat inst-apps`
+else
+    topleveldirs=
+    for dir in `ls -1d * | sort`; do
+	if test "$dir" != "debian" && test -d $dir; then
+	    topleveldirs="$topleveldirs $dir"
+	fi
+    done
+fi
+
+for topleveldir in $topleveldirs; do 
+  if test -f $topleveldir/configure.in; then
+	continue
+  fi
+  if test -f $topleveldir/Makefile.am; then :; else
+	continue
+  fi
+
+  mfs=`find $topleveldir -follow -name Makefile.am -print | fgrep -v "/." | \
+       sed -e 's#\./##; s#/Makefile.am$##' | sort | sed -e 's#$#/Makefile#'`
+  for i in $mfs; do
+     echo "AC_CONFIG_FILES([ $i ])" >> configure.in.new
+  done
+done
+
+files=`cat configure.files`
+list=`egrep '^dnl AC_OUTPUT\(.*\)' $files | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1#"`
+for file in $list; do 
+    echo "AC_CONFIG_FILES([ $file ])" >>  configure.in.new
+done
+
+midfiles=`cat configure.files | fgrep "configure.in.mid"`
+test -n "$midfiles" && cat $midfiles >> configure.in.new
+
+echo "AC_OUTPUT" >> configure.in.new
+modulename=
+if test -f configure.in.in; then
+   if head -n 2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$" > /dev/null; then
+      kde_use_qt_param=`cat configure.in.in | sed -n -e "s/#MIN_CONFIG(\(.*\))/\1/p"`
+   fi
+   if head -n 2 configure.in.in | egrep "^#MIN_CONFIG" > /dev/null; then
+      line=`grep "^AM_INIT_AUTOMAKE(" configure.in.in`
+      if test -n "$line"; then
+	  modulename=`echo $line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"`
+	  VERSION=`echo $line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"`
+      fi
+      sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" \
+          configure.in.new > configure.in && mv configure.in configure.in.new
+   fi
+fi
+if test -z "$VERSION" || test "$VERSION" = "@VERSION@"; then
+     VERSION="\"3.5.10\""
+fi
+if test -z "$modulename" || test "$modulename" = "@MODULENAME@"; then
+   modulename=`pwd`; 
+   modulename=`basename $modulename`
+   esc_VERSION=`echo $VERSION | sed -e "s#[^.0-9a-zA-Z]##g"`
+   modulename=`echo $modulename | sed -e "s#-$esc_VERSION##"`   
+
+fi
+if test -n "$kde_use_qt_param"; then
+      sed -e "s#^dnl KDE_USE_QT#KDE_USE_QT($kde_use_qt_param)#" \
+      	configure.in.new > configure.in && mv configure.in configure.in.new
+fi
+sed -e "s#@MODULENAME@#$modulename#" configure.in.new |
+	sed -e "s#@VERSION@#$VERSION#" > configure.in
+botfiles=`cat configure.files | egrep "configure.in.bot"`
+test -n "$botfiles" && cat $botfiles >> configure.in
+cat $admindir/configure.in.bot.end >> configure.in
+rm -f configure.in.new
+}
+
+configure_files()
+{
+echo "*** Creating configure.files"
+admindir=NO
+for i in . .. ../.. ../../..; do
+  if test -x $i/admin; then admindir=$i/admin; break; fi
+done
+rm -f configure.files
+touch configure.files
+if test -f configure.in.in && head -n 2 configure.in.in | grep "^#MIN_CONFIG" > /dev/null; then
+	echo $admindir/configure.in.min >> configure.files
+fi
+test -f configure.in.in && echo configure.in.in >> configure.files
+# we collect files in the subdirs and do some sorting tricks, so subsubdirs come after subdirs
+if test -f inst-apps; then
+   inst=`cat inst-apps`
+   list=""
+   for i in $inst; do
+      list="$list `find $i/ -follow -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \
+		sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"`"
+   done
+else
+   list=`find . -follow -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \
+		sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"`
+fi
+for i in $list; do if test -f $i && test `dirname $i` != "." ; then
+  echo $i >> configure.files
+fi; done
+test -f configure.in.mid && echo configure.in.mid >> configure.files
+test -f configure.in.bot && echo configure.in.bot >> configure.files
+if test ! -s configure.files; then
+   echo "There are no files to build a configure. Please check your checkout."
+   exit 1
+fi
+}
+
+create_subdirs()
+{
+if grep '\$(top_srcdir)/subdirs:' $makefile_am >/dev/null; then 
+    # as many modules contain rules to create subdirs without any
+    # dependencies make won't create it unless there is no file.
+    # so we check if that's a dummy rule or one that works
+    rm -f subdirs.cvs.sh.$$
+    if test -f subdirs; then
+	mv subdirs subdirs.cvs.sh.$$
+    fi
+    strip_makefile
+    $MAKE -f $makefile_wo top_srcdir=. ./subdirs || exit 1
+    if test -f subdirs.cvs.sh.$$; then
+	if test -s subdirs; then
+	    rm subdirs.cvs.sh.$$ 
+	else
+	    mv subdirs.cvs.sh.$$ subdirs
+	fi
+    fi
+else
+    subdirs
+fi
+}
+
+subdirs()
+{
+dirs=
+idirs=
+if test -f inst-apps; then
+   idirs=`cat inst-apps`
+else
+   idirs=`ls -1 | sort`
+fi
+
+compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1`
+compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1`
+for i in $idirs; do
+    if test -f $i/Makefile.am; then
+       case " $compilefirst $compilelast " in
+         *" $i "*) ;;
+         *) dirs="$dirs $i"
+       esac
+    fi
+done
+
+: > ./_SUBDIRS
+
+for d in $compilefirst; do
+   echo $d >> ./_SUBDIRS
+done
+
+(for d in $dirs; do 
+   list=`sed -ne "s#^COMPILE_BEFORE_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
+   for s in $list; do
+      echo $s $d
+   done
+   list=`sed -ne "s#^COMPILE_AFTER_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
+   for s in $list; do
+      echo $d $s
+   done
+   echo $d $d
+done ) | tsort >> ./_SUBDIRS
+
+for d in $compilelast; do
+   echo $d >> ./_SUBDIRS
+done
+
+if test -r subdirs && cmp -s subdirs _SUBDIRS; then
+    rm -f _SUBDIRS
+fi
+test -r _SUBDIRS && mv _SUBDIRS subdirs || true
+}
+
+Makefile_am()
+{
+if test -f Makefile.am.in; then
+  compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1`
+  compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1`
+
+  idirs=
+  dirs=
+  if test -f inst-apps; then
+     idirs=`cat inst-apps`
+  else
+     idirs=`cat subdirs`
+  fi
+  for i in $idirs; do
+    case " $compilefirst $compilelast " in
+      *" $i "*) ;;
+      *) dirs="$dirs $i"
+    esac
+  done
+
+  adds=`fgrep '$(top_srcdir)/acinclude.m4:' Makefile.am.in | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir)/,,g'`
+  if echo "$adds" | fgrep "*" >/dev/null ; then
+    adds=`ls -d -1 $adds 2>/dev/null`
+    fgrep -v  '$(top_srcdir)/acinclude.m4:' Makefile.am.in > Makefile.am.in.adds
+    str='$(top_srcdir)/acinclude.m4:'
+    for add in $adds; do 
+	str="$str \$(top_srcdir)/$add"
+    done
+    echo $str >> Makefile.am.in.adds
+  else
+    cat Makefile.am.in > Makefile.am.in.adds
+  fi
+
+  cat Makefile.am.in.adds | \
+      sed -e 's,^\s*\(COMPILE_BEFORE.*\),# \1,' | \
+      sed -e 's,^\s*\(COMPILE_AFTER.*\),# \1,' > Makefile.am
+    echo "SUBDIRS="'$(TOPSUBDIRS)' >> Makefile.am
+  rm Makefile.am.in.adds
+fi
+}
+
+acinclude_m4()
+{
+  echo "*** Creating acinclude.m4"
+  adds=
+  if grep '\$(top_srcdir)/acinclude.m4:' $makefile_am >/dev/null; then 
+    strip_makefile
+    rm -f acinclude.m4
+    adds=`grep '\$(top_srcdir)/acinclude.m4:' $makefile_wo | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir),.,g'`
+    if echo $adds | fgrep "*" >/dev/null ; then
+      adds=`ls -d -1 $adds 2>/dev/null`
+    else
+      $MAKE -f $makefile_wo top_srcdir=. ./acinclude.m4 || exit 1
+    fi
+  else
+    rm -f acinclude.m4
+  fi
+  # if it wasn't created up to now, then we do it better
+  if test ! -f acinclude.m4; then
+     cat admin/acinclude.m4.in admin/libtool.m4.in admin/pkg.m4.in $adds > acinclude.m4
+  fi
+}
+
+package_merge()
+{
+catalogs=$POFILES
+for cat in $catalogs; do
+  msgmerge -o $cat.new $cat $PACKAGE.pot
+  if test -s $cat.new; then
+    grep -v "\"POT-Creation" $cat.new > $cat.new.2
+    grep -v "\"POT-Creation" $cat >> $cat.new.1
+    if diff $cat.new.1 $cat.new.2; then
+	rm $cat.new
+    else
+	mv $cat.new $cat
+    fi
+    rm -f $cat.new.1 $cat.new.2
+  fi
+done
+}
+
+extract_messages()
+{
+podir=${podir:-$PWD/po}
+files=`find . -name Makefile.am | xargs egrep -l '^messages:' `
+dirs=`for i in $files; do echo \`dirname $i\`; done`
+tmpname="$PWD/messages.log"
+if test -z "$EXTRACTRC"; then EXTRACTRC=extractrc ; fi
+if test -z "$PREPARETIPS"; then PREPARETIPS=preparetips ; fi
+export EXTRACTRC PREPARETIPS
+
+for subdir in $dirs; do
+  test -z "$VERBOSE" || echo "Making messages in $subdir"
+  (cd $subdir
+   if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then
+	$EXTRACTRC *.rc *.ui *.kcfg > rc.cpp
+   else
+	candidates=`ls -1 *.rc *.ui *.kcfg 2>/dev/null`
+	if test -n "$candidates"; then
+	    echo "$subdir has *.rc, *.ui or *.kcfg files, but not correct messages line"
+	fi
+   fi
+   if find . -name \*.c\* -o -name \*.h\* | fgrep -v ".svn" | xargs fgrep -s -q KAboutData ; then
+	echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp
+   else echo " " > _translatorinfo.cpp
+   fi
+   perl -e '$mes=0; while (<STDIN>) { next if (/^(if\s|else\s|endif)/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile
+
+   kdepotpath=${includedir:-`kde-config --expandvars --install include`}/kde.pot
+   if ! test -f $kdepotpath; then
+	kdepotpath=`kde-config --expandvars --prefix`/include/kde.pot
+   fi
+
+   $MAKE -s -f _transMakefile podir=$podir EXTRACTRC="$EXTRACTRC" PREPARETIPS="$PREPARETIPS" srcdir=. \
+	XGETTEXT="${XGETTEXT:-xgettext} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x $kdepotpath" messages
+   exit_code=$?
+   if test "$exit_code" != 0; then
+       echo "make exit code: $exit_code"
+   fi
+   ) 2>&1 | grep -v '^make\[1\]' > $tmpname
+   test -s $tmpname && { echo $subdir ; cat "$tmpname"; }
+   test -f $subdir/rc.cpp && rm -f $subdir/rc.cpp
+   rm -f $subdir/_translatorinfo.cpp
+   rm -f $subdir/_transMakefile
+done
+rm -f $tmpname
+}
+
+package_messages()
+{
+rm -rf po.backup
+mkdir po.backup
+
+for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
+  egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > po.backup/$i
+  cat po/$i > po.backup/backup_$i
+  touch -r po/$i po.backup/backup_$i
+  rm po/$i
+done
+
+extract_messages
+
+for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do
+  test -f po/$i || echo "disappeared: $i"
+done
+for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
+  sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po/$i > po/$i.new && mv po/$i.new po/$i
+  #msgmerge -q -o po/$i po/$i po/$i
+  egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > temp.pot
+  if test -f po.backup/$i && ! cmp -s temp.pot po.backup/$i; then
+    echo "will update $i"
+  else
+    if test -f po.backup/backup_$i; then
+      test -z "$VERBOSE" || echo "I'm restoring $i"
+      mv po.backup/backup_$i po/$i
+      rm po.backup/$i
+    else
+      echo "will add $i"
+    fi
+  fi
+done
+rm -f temp.pot
+rm -rf po.backup
+}
+
+# Make sure that sorting is always done the same way
+LC_ALL=C
+export LC_ALL
+unset LANG || :
+unset LC_CTYPE || :
+unset LANGUAGE || :
+
+unset CDPATH || :
+admindir=`echo "$0" | sed 's%[\\/][^\\/][^\\/]*$%%'`
+test "x$admindir" = "x$0" && admindir=.
+
+test "x$MAKE" = x && MAKE=make
+makefile_am=Makefile.am
+makefile_wo=Makefile.am.wo
+if test -f Makefile.am.in; then
+  makefile_am=Makefile.am.in
+  makefile_wo=Makefile.am.in.wo
+  rm -f $makefile_wo
+fi
+
+# Call script to find autoconf and friends.  Uses eval since the script outputs
+# sh-compatible code.
+eval `$admindir/detect-autoconf.pl`
+
+###
+### Main
+###
+
+arg=`echo $1 | tr .- __`
+case $arg in
+  cvs | dist | subdir_dist | configure_in | configure_files | subdirs | \
+  cvs_clean | package_merge | package_messages | Makefile_am | acinclude_m4 | extract_messages ) $arg ;;
+  configure ) call_and_fix_autoconf ;;
+  * ) echo "Usage: cvs.sh <target>"
+      echo "Target can be one of:"
+      echo "    cvs svn dist"
+      echo "    configure.in configure.files"
+      echo "    package-merge package-messages"
+      echo ""
+      echo "Usage: anything but $1"
+      exit 1 ;;
+esac
+
+if test -f $makefile_wo; then
+  rm $makefile_wo
+fi
+
+exit 0
diff --git a/lib-src/taglib/admin/debianrules b/lib-src/taglib/admin/debianrules
new file mode 100755
index 0000000..25897f2
--- /dev/null
+++ b/lib-src/taglib/admin/debianrules
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+
+use Shell qw(mv cp mkdir rm) ;
+use File::Find;
+use Cwd;
+
+$origPwd = `pwd`;
+chomp $origPwd;
+
+$kde_prefix	=	"/usr";
+$sysconfdir	=	"/etc";
+$kde_includedir	=	"$kde_prefix/include/kde";
+$infodir	=	"$kde_prefix/share/info";
+$mandir		=	"$kde_prefix/share/man";
+$qtdir		=	"/usr/share/qt3";
+
+$kde_cgidir	=	"$kde_prefix/lib/cgi-bin";
+$kde_confdir	=	"$sysconfdir/kde3";
+$kde_htmldir	=	"$kde_prefix/share/doc/kde/HTML";
+
+if (defined $ENV{DEB_BUILD_OPTIONS} &&
+    $ENV{DEB_BUILD_OPTIONS} =~ /\bnostrip\b/) {
+	$enable_debug="--enable-debug=full";
+} else {
+	$enable_debug="--disable-debug";
+}
+
+if (@ARGV && $ARGV[0] eq 'echodirs') {
+  print STDOUT "export kde_prefix=$kde_prefix\n";
+  print STDOUT "export sysconfdir=$sysconfdir\n";
+  print STDOUT "export kde_includedir=$kde_includedir\n";
+  print STDOUT "export infodir=$infodir\n";
+  print STDOUT "export mandir=$mandir\n";
+  print STDOUT "export qtdir=$qtdir\n";
+
+  print STDOUT "export kde_cgidir=$kde_cgidir\n";
+  print STDOUT "export kde_confdir=$kde_confdir\n";
+  print STDOUT "export kde_htmldir=$kde_htmldir\n";
+
+  print STDOUT "configkde=$enable_debug --disable-rpath --prefix=\$(kde_prefix) --sysconfdir=\$(sysconfdir) --includedir=\$(kde_includedir) --infodir=\$(infodir) --mandir=\$(mandir) --with-qt-dir=\$(qtdir)\n";
+
+  exit
+}
diff --git a/lib-src/portaudio-v19/depcomp b/lib-src/taglib/admin/depcomp
similarity index 100%
copy from lib-src/portaudio-v19/depcomp
copy to lib-src/taglib/admin/depcomp
diff --git a/lib-src/taglib/admin/deps.am b/lib-src/taglib/admin/deps.am
new file mode 100644
index 0000000..e8f5015
--- /dev/null
+++ b/lib-src/taglib/admin/deps.am
@@ -0,0 +1,19 @@
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in $(top_srcdir)/admin/cvs.sh $(top_srcdir)/admin/pkg.m4.in
+	@cd $(top_srcdir) && $(SHELL) admin/cvs.sh acinclude_m4
+
+$(top_srcdir)/configure.in: $(top_srcdir)/subdirs $(top_srcdir)/configure.files $(top_srcdir)/admin/cvs.sh
+	@cd $(top_srcdir) && $(SHELL) admin/cvs.sh configure_in
+
+$(top_srcdir)/configure.files: $(top_srcdir)/subdirs $(CONF_FILES)
+	@cd $(top_srcdir) && $(SHELL) admin/cvs.sh configure.files $(top_srcdir)/admin/cvs.sh
+
+$(top_srcdir)/Makefile.am: $(top_srcdir)/Makefile.am.in $(top_srcdir)/subdirs $(top_srcdir)/admin/cvs.sh
+	@cd $(top_srcdir) && $(SHELL) admin/cvs.sh Makefile_am
+
+$(top_srcdir)/subdirs: $(top_srcdir)/Makefile.am.in $(top_srcdir)/admin/cvs.sh
+	@cd $(top_srcdir) && $(SHELL) admin/cvs.sh subdirs
+
+# defining default rules for files that may not be present
+$(top_srcdir)/Makefile.am.in:
+$(CONF_FILES):
+
diff --git a/lib-src/taglib/admin/detect-autoconf.pl b/lib-src/taglib/admin/detect-autoconf.pl
new file mode 100755
index 0000000..5ce1a08
--- /dev/null
+++ b/lib-src/taglib/admin/detect-autoconf.pl
@@ -0,0 +1,256 @@
+#!/usr/bin/env perl
+
+# Try to locate best version of auto*
+# By Michael Pyne <michael.pyne at kdemail.net>
+#
+# Copyright (c) 2005.
+# This code is public domain.  You may use it however you like (including
+# relicensing).
+
+# Emulate the 'which' program.
+sub which
+{
+    my $prog = shift;
+    my @paths = split(/:/, $ENV{'PATH'});
+
+    for $path (@paths)
+    {
+	return "$path/$prog" if -x "$path/$prog";
+    }
+
+    return "";
+}
+
+# Subroutine to lexicographically compare two version strings, a and b.
+# If a > b, 1 is returned.
+# If a == b, 0 is returned.
+# If a < b, -1 is returned.
+#
+# If the strings are of uneven number length then the shorter string is
+# prepended by enough zeroes to make the two string lengths equal in order to
+# allow an accurate comparison.  Note that the zero-padding only occurs in
+# between version separators (i.e. 1.6 and 1.10, results in 1.06 vs. 1.10).
+# Parts of the version ending in -foo (or any other text) are not considered
+# when doing the compare. (i.e. 2.53a vs 2.53 doesn't end up in 2.53a vs.
+# 2.053)
+sub compareVersions
+{
+    my ($a, $b) = @_;
+
+    # Split the strings up by '.' (version separator) and start comparing digit
+    # length.
+
+    my @aParts = split(/\./, $a);
+    my @bParts = split(/\./, $b);
+
+    # Make the arrays equal in length by adding missing zeroes to the end of the
+    # version.
+    push @aParts, '0' while scalar @aParts < scalar @bParts;
+    push @bParts, '0' while scalar @bParts < scalar @aParts;
+
+    # Now compare each individual portion.
+    for (my $i = 0; $i < scalar @aParts; ++$i)
+    {
+	# Make sure that any portion that has numbers is contiguous.  I'm sure
+	# there's a technique for saving stuff like 2.52a2 but I don't feel
+	# like implementing it.
+	if ($aParts[$i] !~ /^[^\d]*\d+[^\d]*$/ or
+	    $bParts[$i] !~ /^[^\d]*\d+[^\d]*$/)
+	{
+	    die "Not able to compare $a to $b!\n";
+	}
+
+	my ($aDigits) = ($aParts[$i] =~ /(\d+)/);
+	my ($bDigits) = ($bParts[$i] =~ /(\d+)/);
+
+	# Perl is $MODERATELY_INSULTING_TERM, don't remove the parentheses in
+	# the delta calculation below.
+	my $delta = (length $aDigits) - (length $bDigits);
+	if ($delta < 0) # b is longer
+	{
+	    my $replacement = ('0' x (-$delta)) . $aDigits;
+	    $aParts[$i] =~ s/$aDigits/$replacement/;
+	}
+	elsif ($delta > 0) # a is longer
+	{
+	    my $replacement = ('0' x $delta) . $bDigits;
+	    $bParts[$i] =~ s/$bDigits/$replacement/;
+	}
+    }
+
+    # Arrays now have standardized version components, let's re-merge them
+    # to strings to do the compare.
+    my $newA = join('.', @aParts);
+    my $newB = join('.', @bParts);
+
+    return 1 if ($newA gt $newB);
+    return -1 if ($newA lt $newB);
+    return 0;
+}
+
+# Subroutine to determine the highest installed version of the given program,
+# searching from the given paths.
+sub findBest
+{
+    my ($program, @paths) = @_;
+    my $best_version_found = '0'; # Deliberately a string.
+    my %versions;
+    my %minimumVersions = (
+	'autoconf' => '2.5',
+	'automake' => '1.6',
+    );
+    my $sgn; # Used for compareVersions results.
+
+    # Allow user to use environment variable to override search.
+    return $ENV{uc $program} if $ENV{uc $program};
+
+    for $prefix (@paths)
+    {
+	@files = glob "$prefix/$program*";
+	for $file (@files)
+	{
+	    # Don't check non-executable scripts.
+	    next unless -x $file;
+
+	    ($version) = $file =~ /$prefix\/$program-?(.*)$/;
+
+	    # Don't check the -wrapper ones (or any other non program one).
+	    # The real deal should start with a version number, or have no
+	    # suffix at all.
+	    next if $version =~ /^[^\d]/;
+
+	    # Special case some programs to make sure it has a minimum version.
+	    if (not $version and exists $minimumVersions{$program})
+	    {
+		my $min_version = $minimumVersions{$program};
+		my $versionOutput = `$program --version 2>/dev/null | head -n 1`;
+
+		# If we can't run the script to get the version it likely won't work later.
+		next unless $versionOutput;
+
+		# Use number.number for version (we don't need the excess in general).
+		($versionOutput) = ($versionOutput =~ /(\d+\.\d+)/);
+
+		# compareVersions returns -1 if the left argument is less than
+		# the right argument.  It can also die for invalid input so
+		# wrap with eval.
+		eval {
+		    $sgn = compareVersions($versionOutput, $min_version);
+		};
+
+		# $@ would be set if an error was encountered.
+		if ($@ or not $versionOutput or $sgn == -1) {
+		    next;
+		}
+	    }
+
+	    # If no version suffix then use it in favor of a versioned autotool
+	    # since the ever-popular WANT_AUTOFOO should then work (in theory).
+	    return $file unless $version;
+
+	    # Emulate 'which', and abort if we've already seen this version.
+	    next if exists $versions{$version};
+
+	    # Save filename of program.
+	    $versions{$version} = $file;
+
+	    # Use string comparison so that e.g. 253a will be > 253 but < 254.
+	    # See above about the need for eval.
+	    eval {
+		$sgn = compareVersions($version, $best_version_found);
+	    };
+
+	    if (not $@ and $sgn == 1)
+	    {
+		$best_version_found = $version;
+	    }
+	}
+    }
+
+    return $versions{$best_version_found};
+}
+
+# Find an appropriate "which" program for later use by the shell script calling
+# us.
+sub findWhich
+{
+    for $candidate ('type -p', 'which', 'type')
+    {
+	$test = `$candidate sh 2>/dev/null`;
+	chomp $test;
+
+	return $candidate if -x $test;
+    }
+}
+
+# Uses which() to find a program unless the user provided its path in the
+# environment (the upper case program name is searched).
+sub findProgram
+{
+    $suffix = ""; # For use if @_ has only one param.
+    my ($program, $suffix) = @_;
+
+    return $ENV{uc $program} if $ENV{uc $program};
+    return which("$program$suffix");
+}
+
+# SCRIPT STARTS.
+
+# Search in path.
+ at paths = split(/:/, $ENV{'PATH'});
+
+# Make sure at least /usr/bin and /usr/local/bin are in this search.
+unshift @paths, '/usr/local/bin' unless grep $_ eq '/usr/local/bin', @paths;
+unshift @paths, '/usr/bin' unless grep $_ eq '/usr/bin', @paths;
+
+$autoconf = findBest('autoconf', @paths);
+($autoconf_suffix) = $autoconf =~ /.*autoconf(.*)$/;
+
+# Find matching autoconf companions.
+$autoheader = findProgram('autoheader', $autoconf_suffix);
+$autom4te = findProgram('autom4te', $autoconf_suffix);
+
+# Get best automake, and look for unsermake to possibly override it.
+$automake = findBest('automake', @paths);
+$unsermake = "";
+# backward compatible: if $UNSERMAKE points to a path, use it
+$unsermake = findProgram('unsermake') if (defined($ENV{'UNSERMAKE'}) and $ENV{'UNSERMAKE'} =~ /\//);
+# new compatible: if it says 'yes', use the one from path
+$unsermake = which('unsermake') if ($ENV{'UNSERMAKE'} ne 'no');
+
+($automake_suffix) = $automake =~ /.*automake(.*)$/;
+
+# Find matching automake companions.
+$aclocal = findProgram('aclocal', $automake_suffix);
+
+# Use unsermake if we found it.
+$automake = "$unsermake -c" if ($unsermake and $aclocal);
+
+$which = findWhich();
+
+# Make sure we have all of the needed programs.
+for $i (qw'autoconf autoheader autom4te automake aclocal')
+{
+    unless(${$i})
+    {
+	print STDERR "# Unable to find $i!!\n";
+    }
+}
+
+# Print results in eval-able form.
+print <<EOF;
+AUTOCONF="$autoconf"
+AUTOHEADER="$autoheader"
+AUTOM4TE="$autom4te"
+
+AUTOMAKE="$automake"
+ACLOCAL="$aclocal"
+
+WHICH="$which"
+
+export AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE ACLOCAL WHICH
+EOF
+
+exit 0;
+
+# vim: set noet ts=8 sw=4:
diff --git a/lib-src/taglib/admin/doxygen.sh b/lib-src/taglib/admin/doxygen.sh
new file mode 100644
index 0000000..3e233d7
--- /dev/null
+++ b/lib-src/taglib/admin/doxygen.sh
@@ -0,0 +1,883 @@
+#! /bin/sh
+#
+# doxygen.sh Copyright (C) 2005 by Adriaan de Groot
+#            Based on some code from Doxyfile.am, among other things.
+# License:   GPL version 2.
+#            See file COPYING in kdelibs for details.
+
+echo "*** doxygen.sh"
+
+# Recurse handling is a little complicated, since normally
+# subdir (given on the command-line) processing doesn't recurse
+# but you can force it to do so.
+recurse=1
+recurse_given=NO
+use_modulename=1
+cleanup=YES
+
+while test -n "$1" ; do
+case "x$1" in
+"x--no-cleanup" )
+	cleanup=NO
+	;;
+"x--no-recurse" )
+	recurse=0
+	recurse_given=YES
+	;;
+"x--recurse" )
+	recurse=1
+	recurse_given=YES
+	;;
+"x--no-modulename" )
+	use_modulename=0
+	;;
+"x--modulename" )
+	use_modulename=1
+	;;
+"x--help" )
+	echo "doxygen.sh usage:"
+	echo "doxygen.sh [--no-recurse] [--no-modulename] <srcdir> [<subdir>]"
+	exit 2
+	;;
+x--doxdatadir=* )
+	DOXDATA=`echo $1 | sed -e 's+--doxdatadir=++'`
+	;;
+x--installdir=*)
+	PREFIX=`echo $1 | sed -e 's+--installdir=++'`
+	;;
+x--* )
+	echo "Unknown option: $1"
+	exit 1
+	;;
+* )
+	top_srcdir="$1"
+	break
+	;;
+esac
+shift
+done
+
+
+### Sanity check the mandatory "top srcdir" argument.
+if test -z "$top_srcdir" ; then
+	echo "Usage: doxygen.sh <top_srcdir>"
+	exit 1
+fi
+if test ! -d "$top_srcdir" ; then
+	echo "top_srcdir ($top_srcdir) is not a directory."
+	exit 1
+fi
+
+### Normalize top_srcdir so it is an absolute path.
+if expr "x$top_srcdir" : "x/" > /dev/null ; then
+	# top_srcdir is absolute already
+	:
+else
+	top_srcdir=`cd "$top_srcdir" 2> /dev/null && pwd`
+	if test ! -d "$top_srcdir" ; then
+		echo "top_srcdir ($top_srcdir) is not a directory."
+		exit 1
+	fi
+fi
+
+
+
+### Sanity check and guess QTDOCDIR.
+if test -z "$QTDOCDIR" ; then
+	if test -z "$QTDIR" ; then
+		for i in /usr/X11R6/share/doc/qt/html
+		do
+			QTDOCDIR="$i"
+			test -d "$QTDOCDIR" && break
+		done
+	else
+		for i in share/doc/qt/html doc/html
+		do
+			QTDOCDIR="$QTDIR/$i"
+			test -d "$QTDOCDIR" && break
+		done
+	fi
+fi
+if test -z "$QTDOCDIR"  || test ! -d "$QTDOCDIR" ; then
+	if test -z "$QTDOCDIR" ; then
+		echo "* QTDOCDIR could not be guessed."
+	else
+		echo "* QTDOCDIR does not name a directory."
+	fi
+	if test -z "$QTDOCTAG" ; then
+		echo "* QTDOCDIR set to \"\""
+		QTDOCDIR=""
+	else
+		echo "* But I'll use $QTDOCDIR anyway because of QTDOCTAG."
+	fi
+fi
+
+### Get the "top srcdir", also its name, and handle the case that subdir "."
+### is given (which would be top_srcdir then, so it's equal to none-given
+### but no recursion either).
+###
+# top_srcdir="$1" # Already set by options processing
+module_name=`basename "$top_srcdir"`
+subdir="$2"
+if test "x." = "x$subdir" ; then
+	subdir=""
+	if test "x$recurse_given" = "xNO" ; then
+		recurse=0
+	fi
+fi
+if test "x" != "x$subdir" ; then
+	# If no recurse option given explicitly, default to
+	# no recurse when processing subdirs given on the command-line.
+	if test "x$recurse_given" = "xNO" ; then
+		recurse=0
+	fi
+fi
+
+if test -z "$DOXDATA" || test ! -d "$DOXDATA" ; then
+	if test -n "$DOXDATA" ; then
+		echo "* \$DOXDATA is '$DOXDATA' which does not name a directory"
+	fi
+	DOXDATA="$top_srcdir/doc/common"
+fi
+
+if test ! -d "$DOXDATA" ; then
+	echo "* \$DOXDATA does not name a directory ( or is unset ), tried \"$DOXDATA\""
+	exit 1
+fi
+
+if test -n "$PREFIX" && test ! -d "$PREFIX" ; then
+	echo "* \$PREFIX does not name a directory, tried \"$PREFIX\""
+	echo "* \$PREFIX is disabled."
+	PREFIX=""
+fi
+
+### We need some values from top-level files, which
+### are not preserved between invocations of this
+### script, so factor it out for easy use.
+create_doxyfile_in() 
+{
+	eval `grep 'VERSION="' "$top_srcdir/admin/cvs.sh"`
+	echo "PROJECT_NUMBER = $VERSION" > Doxyfile.in
+	grep '^KDE_INIT_DOXYGEN' "$top_srcdir/configure.in.in" | \
+		sed -e 's+[^[]*\[\([^]]*\)+PROJECT_NAME = "\1"+' \
+			-e 's+].*++' >> Doxyfile.in
+}
+
+apidoxdir="$module_name"-apidocs
+test "x$use_modulename" = "x0" && apidoxdir="apidocs"
+
+### If we're making the top subdir, create the structure
+### for the apidox and initialize it. Otherwise, just use the
+### structure assumed to be there.
+if test -z "$subdir" ; then
+	if test ! -d "$apidoxdir" ; then
+		mkdir "$apidoxdir" > /dev/null 2>&1
+	fi
+	cd "$apidoxdir" > /dev/null 2>&1 || { 
+		echo "Cannot create and cd into $apidoxdir"
+		exit 1
+	}
+
+	test -f "Doxyfile.in" || create_doxyfile_in
+
+	# Copy in logos and the like
+	for i in "favicon.ico" "kde_gear_64.png"
+	do
+		cp "$DOXDATA/$i" . > /dev/null 2> /dev/null
+	done
+	for i in "$top_srcdir/doc/api/Dox-"*.png
+	do
+		T=`basename "$i" | sed -e 's+Dox-++'`
+		test -f "$i" && cp "$i" "./$T" > /dev/null 2> /dev/null
+	done
+
+	top_builddir="."
+	srcdir="$1"
+	subdir="."
+else
+	cd "$apidoxdir" > /dev/null 2>&1 || {
+		echo "Cannot cd into $apidoxdir -- maybe you need to"
+		echo "build the top-level dox first."
+		exit 1
+	}
+
+	if test "x1" = "x$recurse" ; then
+		# OK, so --recurse was requested
+		if test ! -f "subdirs.top" ; then
+			echo "* No subdirs.top available in the $apidoxdir."
+			echo "* The --recurse option will be ignored."
+			recurse=0
+		fi
+	fi
+fi
+
+### Read a single line (TODO: support \ continuations) from the Makefile.am.
+### Used to extract variable assignments from it.
+extract_line()
+{
+	file="$2" ; test -z "$file" && file="$srcdir/Makefile.am"
+	pattern=`echo "$1" | tr + .`
+	grep "^$1" "$file" | \
+		sed -e "s+$pattern.*=\s*++"
+}
+
+### Handle the COMPILE_{FIRST,LAST,BEFORE,AFTER} part of Makefile.am
+### in the toplevel. Copied from admin/cvs.sh. Licence presumed LGPL).
+create_subdirs()
+{
+echo "* Sorting top-level subdirs"
+dirs=
+idirs=
+if test -f "$top_srcdir/inst-apps"; then
+   idirs=`cat "$top_srcdir/"inst-apps`
+else
+   idirs=`cd "$top_srcdir" && ls -1 | sort`
+fi
+
+compilefirst=""
+compilelast=""
+if test -f "$top_srcdir/"Makefile.am.in ; then
+	compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' "$top_srcdir/"Makefile.am.in | head -n 1`
+	compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' "$top_srcdir/"Makefile.am.in | head -n 1`
+fi
+for i in $idirs; do
+    if test -f "$top_srcdir/$i"/Makefile.am; then
+       case " $compilefirst $compilelast " in
+         *" $i "*) ;;
+         *) dirs="$dirs $i"
+       esac
+    fi
+done
+
+: > ./_SUBDIRS
+
+for d in $compilefirst; do
+   echo $d >> ./_SUBDIRS
+done
+
+(for d in $dirs; do
+   list=""
+   if test -f "$top_srcdir/"Makefile.am.in ; then
+	   list=`sed -ne "s#^COMPILE_BEFORE_$d""[ ]*=[ ]*##p" "$top_srcdir/"Makefile.am.in | head -n 1`
+   fi
+   for s in $list; do
+      echo $s $d
+   done
+   list=""
+   if test -f "$top_srcdir/"Makefile.am.in ; then
+	   list=`sed -ne "s#^COMPILE_AFTER_$d""[ ]*=[ ]*##p" "$top_srcdir/"Makefile.am.in | head -n 1`
+   fi
+   for s in $list; do
+      echo $d $s
+   done
+   echo $d $d
+done ) | tsort >> ./_SUBDIRS
+
+for d in $compilelast; do
+   echo $d >> ./_SUBDIRS
+done
+
+test -r _SUBDIRS && mv _SUBDIRS subdirs.top || true
+}
+
+
+### Add HTML header, footer, CSS tags to Doxyfile.
+### Assumes $subdir is set. Argument is a string
+### to stick in front of the file if needed.
+apidox_htmlfiles()
+{
+	dox_header="$top_srcdir/doc/api/$1header.html"
+	dox_footer="$top_srcdir/doc/api/$1footer.html"
+	dox_css="$top_srcdir/doc/api/doxygen.css"
+	test -f "$dox_header" || dox_header="$DOXDATA/$1header.html"
+	test -f "$dox_footer" || dox_footer="$DOXDATA/$1footer.html"
+	test -f "$dox_css" || dox_css="$DOXDATA/doxygen.css"
+
+	echo "HTML_HEADER            = $dox_header" >> "$subdir/Doxyfile" ; \
+	echo "HTML_FOOTER            = $dox_footer" >> "$subdir/Doxyfile" ; \
+	echo "HTML_STYLESHEET        = $dox_css" >> "$subdir/Doxyfile"
+}
+
+apidox_specials()
+{
+	line=`extract_line DOXYGEN_PROJECTNAME "$1"`
+	test -n "$line" && echo "PROJECT_NAME = \"$line\"" >> "$2"
+}
+
+apidox_local()
+{
+	for i in "$top_srcdir/doc/api/Doxyfile.local"
+	do
+		if test -f "$i" ; then
+			cat "$i" >> "$subdir/Doxyfile"
+			break
+		fi
+	done
+}
+
+### Post-process HTML files by substituting in the menu files
+#
+# In non-top directories, both <!-- menu --> and <!-- gmenu -->
+# are calculated and replaced. Top directories get an empty <!-- menu -->
+# if any.
+doxyndex()
+{
+	# Special case top-level to have an empty MENU.
+	if test "x$subdir" = "x." ; then
+		MENU=""
+		htmldir="."
+		htmltop="$top_builddir" # Just ., presumably
+		echo "* Post-processing top-level files"
+	else
+		MENU="<ul>"
+		htmldir="$subdir/html"
+		htmltop="$top_builddir.." # top_builddir ends with /
+		echo "* Post-processing files in $htmldir"
+
+		# Build a little PHP file that maps class names to file
+		# names, for the quick-class-picker functionality.
+		# (The quick-class-picker is disabled due to styling
+		# problems in IE & FF).
+		(
+		echo "<?php \$map = array(";  \
+		for htmlfile in `find $htmldir/ -type f -name "class[A-Z]*.html" | grep -v "\-members.html$"`; do
+			classname=`echo $htmlfile | sed -e "s,.*/class\\(.*\\).html,\1," -e "s,_1_1,::,g" -e "s,_01, ,g" -e "s,_4,>,g" -e "s+_00+,+g" -e "s+_3+<+g" | tr "[A-Z]" "[a-z]"`
+			echo "  \"$classname\" => \"$htmlfile\","
+		done | sort ; \
+		echo ") ?>"
+		) > "$subdir/classmap.inc"
+
+		# This is a list of pairs, with / separators so we can use
+		# basename and dirname (a crude shell hack) to split them
+		# into parts. For each, if the file part exists (as a html
+		# file) tack it onto the MENU variable as a <li> with link.
+		for i in "Main Page/index" \
+			"Modules/modules" \
+			"Namespace List/namespaces" \
+			"Class Hierarchy/hierarchy" \
+			"Alphabetical List/classes" \
+			"Class List/annotated" \
+			"File List/files" \
+			"Directories/dirs" \
+			"Namespace Members/namespacemembers" \
+			"Class Members/functions" \
+			"Related Pages/pages"
+		do
+			NAME=`dirname "$i"`
+			FILE=`basename "$i"`
+			test -f "$htmldir/$FILE.html" && MENU="$MENU<li><a href=\"$FILE.html\">$NAME</a></li>"
+		done
+
+		MENU="$MENU</ul>"
+	fi
+
+
+	# Get the list of global Menu entries.
+	GMENU=`cat subdirs | tr -d '\n'`
+
+	PMENU=`grep '<!-- pmenu' "$htmldir/index.html" | sed -e 's+.*pmenu *++' -e 's+ *-->++' | awk '{ c=split($0,a,"/"); for (j=1; j<=c; j++) { printf " / <a href=\""; if (j==c) { printf("."); } for (k=j; k<c; k++) { printf "../"; } if (j<c) { printf("../html/index.html"); } printf "\">%s</a>\n" , a[j]; } }' | tr -d '\n'`
+
+	# Map the PHP file into HTML options so that
+	# it can be substituted in for the quick-class-picker.
+	CMENU=""
+	# For now, leave the CMENU disabled
+	CMENUBEGIN="<!--"
+	CMENUEND="-->"
+
+	if test "x$subdir" = "x." ; then
+		# Disable CMENU on toplevel anyway
+		CMENUBEGIN="<!--"
+		CMENUEND="-->"
+	else
+		test -f "$subdir/classmap.inc" && \
+		CMENU=`grep '=>' "$subdir/classmap.inc" | sed -e 's+"\([^"]*\)" => "'"$subdir/html/"'\([^"]*\)"+<option value="\2">\1<\/option>+' | tr -d '\n'`
+
+		if test -f "$subdir/classmap.inc" && grep "=>" "$subdir/classmap.inc" > /dev/null 2>&1 ; then
+			# Keep the menu, it's useful
+			:
+		else
+			CMENUBEGIN="<!--"
+			CMENUEND="-->"
+		fi
+	fi
+
+	# Now substitute in the MENU in every file. This depends
+	# on HTML_HEADER (ie. header.html) containing the
+	# <!-- menu --> comment.
+	for i in "$htmldir"/*.html
+	do
+		if test -f "$i" ; then
+			sed -e "s+<!-- menu -->+$MENU+" \
+				-e "s+<!-- gmenu -->+$GMENU+" \
+				-e "s+<!-- pmenu.*-->+$PMENU+" \
+				-e "s+<!-- cmenu.begin -->+$CMENUBEGIN+" \
+				-e "s+<!-- cmenu.end -->+$CMENUEND+" \
+				< "$i"  | sed -e "s+ at topdir@+$htmltop+g" > "$i.new" && mv "$i.new" "$i"
+			sed -e "s+<!-- cmenu -->+$CMENU+" < "$i" > "$i.new"
+			test -s "$i.new" && mv "$i.new" "$i"
+		fi
+	done
+}
+
+
+
+
+
+
+### Handle the Doxygen processing of a toplevel directory.
+apidox_toplevel()
+{
+	echo ""
+	echo "*** Creating API documentation main page for $module_name"
+	echo "*"
+	rm -f "Doxyfile"
+	for i in "$top_srcdir/doc/api/Doxyfile.global" \
+		"$top_srcdir/admin/Doxyfile.global" \
+		"$DOXDATA/Doxyfile.global"
+	do
+		if test -f "$i" ; then
+			cp "$i" Doxyfile
+			break
+		fi
+	done
+
+	if test ! -f "Doxyfile" ; then
+		echo "* Cannot create Doxyfile."
+		exit 1
+	fi
+
+	cat "$top_builddir/Doxyfile.in" >> Doxyfile
+
+
+	echo "INPUT                  = $top_srcdir" >> Doxyfile
+	echo "OUTPUT_DIRECTORY       = $top_builddir" >> Doxyfile ; \
+	echo "FILE_PATTERNS          = *.dox" >> Doxyfile ; \
+	echo "RECURSIVE              = NO" >> Doxyfile ; \
+	echo "ALPHABETICAL_INDEX     = NO" >> Doxyfile ; \
+	echo "HTML_OUTPUT            = ." >> Doxyfile ; \
+	apidox_htmlfiles "main"
+
+	# KDevelop has a top-level Makefile.am with settings.
+	for i in "$top_srcdir/Makefile.am.in" "$top_srcdir/Makefile.am"
+	do
+		if test -f "$i" ; then
+			grep '^DOXYGEN_SET_' "$i" | \
+				sed -e 's+DOXYGEN_SET_++' -e "s+ at topdir@+$top_srcdir+" >> Doxyfile
+			apidox_specials "$srcdir/Makefile.am" "$subdir/Doxyfile"
+
+			break
+		fi
+	done
+
+	apidox_local
+
+	doxygen Doxyfile
+
+	( cd "$top_srcdir" && grep -l '^include.*Doxyfile.am' `find . -name Makefile.am` ) | sed -e 's+/Makefile.am$++' -e 's+^\./++' | sort > subdirs.in
+	for i in `cat subdirs.in`
+	do
+		test "x." = "x$i" && continue;
+
+		dir=`dirname "$i"`
+		file=`basename "$i"`
+		if test "x." = "x$dir" ; then
+			dir=""
+		else
+			dir="$dir/"
+		fi
+		indent=`echo "$dir" | sed -e 's+[^/]*/+\&nbsp;\&nbsp;+g' | sed -e 's+&+\\\&+g'`
+		entryname=`extract_line DOXYGEN_SET_PROJECT_NAME "$top_srcdir/$dir/$file/Makefile.am"`
+		test -z "$entryname" && entryname="$file"
+
+		if grep DOXYGEN_EMPTY "$top_srcdir/$dir/$file/Makefile.am" > /dev/null 2>&1 ; then
+			echo "<li>$indent$file</li>"
+		else
+			echo "<li>$indent<a href=\"@topdir@/$dir$file/html/index.html\">$entryname</a></li>"
+		fi
+	done > subdirs
+
+	doxyndex
+}
+
+### Handle the Doxygen processing of a non-toplevel directory.
+apidox_subdir()
+{
+	echo ""
+	echo "*** Creating apidox in $subdir"
+	echo "*"
+	rm -f "$subdir/Doxyfile"
+	if test ! -d "$top_srcdir/$subdir" ; then
+		echo "* No source (sub)directory $subdir"
+		return
+	fi
+	for i in "$top_srcdir/doc/api/Doxyfile.global" \
+		"$top_srcdir/admin/Doxyfile.global" \
+		"$DOXDATA/Doxyfile.global"
+	do
+		if test -f "$i" ; then
+			cp "$i" "$subdir/Doxyfile"
+			break
+		fi
+	done
+
+
+	test -f "Doxyfile.in" || create_doxyfile_in
+	cat "Doxyfile.in" >> "$subdir/Doxyfile"
+
+	echo "PROJECT_NAME           = \"$subdir\"" >> "$subdir/Doxyfile"
+	echo "INPUT                  = $srcdir" >> "$subdir/Doxyfile"
+	echo "OUTPUT_DIRECTORY       = ." >> "$subdir/Doxyfile"
+	if grep -l "$subdir/" subdirs.in > /dev/null 2>&1 ; then
+		echo "RECURSIVE              = NO" >> "$subdir/Doxyfile"
+	fi
+	echo "HTML_OUTPUT            = $subdir/html" >> "$subdir/Doxyfile"
+	echo "GENERATE_TAGFILE       = $subdir/$subdirname.tag" >> "$subdir/Doxyfile"
+	test -d "$top_srcdir/doc/api" && \
+		echo "IMAGE_PATH             = $top_srcdir/doc/api" >> "$subdir/Doxyfile"
+
+	apidox_htmlfiles ""
+
+	# Makefile.ams may contain overrides to our settings,
+	# so copy them in.
+	grep '^DOXYGEN_SET_' "$srcdir/Makefile.am" | \
+		sed -e 's+DOXYGEN_SET_++' >> "$subdir/Doxyfile"
+	apidox_specials "$srcdir/Makefile.am" "$subdir/Doxyfile"
+
+	excludes=`extract_line DOXYGEN_EXCLUDE`
+	if test -n "$excludes"; then
+		patterns=""
+		dirs=""
+		for item in `echo "$excludes"`; do
+			if test -d "$top_srcdir/$subdir/$item"; then
+				dirs="$dirs $top_srcdir/$subdir/$item/"
+			else
+				patterns="$patterns $item"
+			fi
+		done
+		echo "EXCLUDE_PATTERNS      += $patterns" >> "$subdir/Doxyfile"
+		echo "EXCLUDE               += $dirs" >> "$subdir/Doxyfile"
+	fi
+
+	echo "TAGFILES = \\" >> "$subdir/Doxyfile"
+	## For now, don't support \ continued references lines
+	tags=`extract_line DOXYGEN_REFERENCES`
+	for i in $tags qt ; do
+		tagsubdir=`dirname $i` ; tag=`basename $i`
+		tagpath=""
+		not_found=""
+
+		if test "x$tagsubdir" = "x." ; then
+			tagsubdir=""
+		else
+			tagsubdir="$tagsubdir/"
+		fi
+
+		# Find location of tag file
+		if test -f "$tagsubdir$tag/$tag.tag" ; then
+			file="$tagsubdir$tag/$tag.tag"
+			loc="$tagsubdir$tag/html"
+		else
+			# This checks for dox built with_out_ --no-modulename
+			# in the same build dir as this dox run was started in.
+			file=`ls -1 ../*-apidocs/"$tagsubdir$tag/$tag.tag" 2> /dev/null`
+
+			if test -n "$file" ; then
+				loc=`echo "$file" | sed -e "s/$tag.tag\$/html/"`
+			else
+				# If the tag file doesn't exist yet, but should
+				# because we have the right dirs here, queue
+				# this directory for re-processing later.
+				if test -d "$top_srcdir/$tagsubdir$tag" ; then
+					echo "* Need to re-process $subdir for tag $i"
+					echo "$subdir" >> "subdirs.later"
+				else
+					# Re-check in $PREFIX if needed.
+					test -n "$PREFIX" && \
+					file=`cd "$PREFIX" && \
+					ls -1 *-apidocs/"$tagsubdir$tag/$tag.tag" 2> /dev/null`
+
+					# If something is found, patch it up. The location must be
+					# relative to the installed location of the dox and the
+					# file must be absolute.
+					if test -n "$file" ; then
+						loc=`echo "../$file" | sed -e "s/$tag.tag\$/html/"`
+						file="$PREFIX/$file"
+						echo "* Tags for $tagsubdir$tag will only work when installed."
+						not_found="YES"
+					fi
+				fi
+			fi
+		fi
+		if test "$tag" = "qt" ; then
+			if test -z "$QTDOCDIR" ; then
+				echo "  $file" >> "$subdir/Doxyfile"
+			else
+				if test -z "$file" ; then
+					# Really no Qt tags
+					echo "" >> "$subdir/Doxyfile"
+				else
+					echo "  $file=$QTDOCDIR" >> "$subdir/Doxyfile"
+				fi
+			fi
+		else
+			if test -n "$file"  ; then
+				test -z "$not_found" && echo "* Found tag $file"
+				echo "  $file=../$top_builddir$loc \\" >> "$subdir/Doxyfile"
+			fi
+		fi
+	done
+
+	apidox_local
+
+	if grep '^DOXYGEN_EMPTY' "$srcdir/Makefile.am" > /dev/null 2>&1 ; then
+		# This directory is empty, so don't process it, but
+		# *do* handle subdirs that might have dox.
+		:
+	else
+		# Regular processing
+		doxygen "$subdir/Doxyfile"
+		doxyndex
+	fi
+}
+
+### Run a given subdir by setting up global variables first.
+do_subdir()
+{
+	subdir=`echo "$1" | sed -e 's+/$++'`
+	srcdir="$top_srcdir/$subdir"
+	subdirname=`basename "$subdir"`
+	mkdir -p "$subdir" 2> /dev/null
+	if test ! -d "$subdir" ; then
+		echo "Can't create dox subdirectory $subdir"
+		return
+	fi
+	top_builddir=`echo "/$subdir" | sed -e 's+/[^/]*+../+g'`
+	apidox_subdir
+}
+
+
+### Create installdox-slow in the toplevel
+create_installdox()
+{
+# Fix up the installdox script so it accepts empty args
+#
+# This code is copied from the installdox generated by Doxygen,
+# copyright by Dimitri van Heesch and released under the GPL.
+# This does a _slow_ update of the dox, because it loops
+# over the given substitutions instead of assuming all the
+# needed ones are given.
+#
+cat <<\EOF
+#! /usr/bin/env perl
+
+%subst = () ;
+$quiet   = 0;
+
+if (open(F,"search.cfg"))
+{
+  $_=<F> ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_;
+  $_=<F> ; s/[ \t\n]*$//g ; $subst{"_cgi"} = $_;
+}
+
+while ( @ARGV ) {
+  $_ = shift @ARGV;
+  if ( s/^-// ) {
+    if ( /^l(.*)/ ) {
+      $v = ($1 eq "") ? shift @ARGV : $1;
+      ($v =~ /\/$/) || ($v .= "/");
+      $_ = $v;
+      if ( /(.+)\@(.+)/ ) {
+          $subst{$1} = $2;
+      } else {
+        print STDERR "Argument $_ is invalid for option -l\n";
+        &usage();
+      }
+    }
+    elsif ( /^q/ ) {
+      $quiet = 1;
+    }
+    elsif ( /^\?|^h/ ) {
+      &usage();
+    }
+    else {
+      print STDERR "Illegal option -$_\n";
+      &usage();
+    }
+  }
+  else {
+    push (@files, $_ );
+  }
+}
+
+
+if ( ! @files ) {
+  if (opendir(D,".")) {
+    foreach $file ( readdir(D) ) {
+      $match = ".html";
+      next if ( $file =~ /^\.\.?$/ );
+      ($file =~ /$match/) && (push @files, $file);
+      ($file =~ "tree.js") && (push @files, $file);
+    }
+    closedir(D);
+  }
+}
+
+if ( ! @files ) {
+  print STDERR "Warning: No input files given and none found!\n";
+}
+
+foreach $f (@files)
+{
+  if ( ! $quiet ) {
+    print "Editing: $f...\n";
+  }
+  $oldf = $f;
+  $f   .= ".bak";
+  unless (rename $oldf,$f) {
+    print STDERR "Error: cannot rename file $oldf\n";
+    exit 1;
+  }
+  if (open(F,"<$f")) {
+    unless (open(G,">$oldf")) {
+      print STDERR "Error: opening file $oldf for writing\n";
+      exit 1;
+    }
+    if ($oldf ne "tree.js") {
+      while (<F>) {
+	foreach $sub (keys %subst) {
+          s/doxygen\=\"$sub\:([^ \"\t\>\<]*)\" (href|src)=\"\1/doxygen\=\"$sub:$subst{$sub}\" \2=\"$subst{$sub}/g;
+          print G "$_";
+	}
+      }
+    }
+    else {
+      while (<F>) {
+	foreach $sub (keys %subst) {
+          s/\"$sub\:([^ \"\t\>\<]*)\", \"\1/\"$sub:$subst{$sub}\" ,\"$subst{$sub}/g;
+          print G "$_";
+	}
+      }
+    }
+  }
+  else {
+    print STDERR "Warning file $f does not exist\n";
+  }
+  unlink $f;
+}
+
+sub usage {
+  print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n";
+  print STDERR "Options:\n";
+  print STDERR "     -l tagfile\@linkName   tag file + URL or directory \n";
+  print STDERR "     -q                    Quiet mode\n\n";
+  exit 1;
+}
+EOF
+}
+
+# Do only the subdirs that match the RE passed in as $1
+do_subdirs_re()
+{
+	RE=`echo "$1" | sed -e 's+/$++'`
+
+	# Here's a queue of dirs to re-process later when
+	# all the rest have been done already.
+	> subdirs.later
+
+	# subdirs.top lists _all_ subdirs of top in the order they
+	# should be handled; subdirs.in lists those dirs that contain
+	# dox. So the intersection of the two is the ordered list
+	# of top-level subdirs that contain dox.
+	#
+	# subdirs.top also doesn't contain ".", so that special
+	# case can be ignored in the loop.
+
+
+	(
+	for i in `grep "^$RE" subdirs.top`
+	do
+		if test "x$i" = "x." ; then
+			continue
+		fi
+		# Calculate intersection of this element and the
+		# set of dox dirs.
+		if grep "^$i\$" subdirs.in > /dev/null 2>&1 ; then
+			echo "$i"
+			mkdir -p "$i" 2> /dev/null
+
+			# Handle the subdirs of this one
+			for j in `grep "$i/" subdirs.in`
+			do
+				echo "$j"
+				mkdir -p "$j" 2> /dev/null
+			done
+		fi
+	done
+
+	# Now we still need to handle whatever is left
+	for i in `cat subdirs.in`
+	do
+		test -d "$i" || echo "$i"
+		mkdir -p "$i" 2> /dev/null
+	done
+	) > subdirs.sort
+	for i in `cat subdirs.sort`
+	do
+		do_subdir "$i"
+	done
+
+	if test -s "subdirs.later" ; then
+		sort subdirs.later | uniq > subdirs.sort
+		for i in `cat subdirs.sort`
+		do
+			: > subdirs.later
+			echo "*** Reprocessing $i"
+			do_subdir "$i"
+			test -s "subdirs.later" && echo "* Some tag files were still not found."
+		done
+	fi
+}
+
+if test "x." = "x$top_builddir" ; then
+	apidox_toplevel
+	create_subdirs
+	create_installdox > installdox-slow
+	if test "x$recurse" = "x1" ; then
+		if test "x$module_name" = "xkdelibs" ; then
+			if test -z "$QTDOCTAG" && test -d "$QTDOCDIR" && \
+				test ! -f "qt/qt.tag" ; then
+				# Special case: create a qt tag file.
+				echo "*** Creating a tag file for the Qt library:"
+				mkdir qt
+				doxytag -t qt/qt.tag "$QTDOCDIR" > /dev/null 2>&1
+			fi
+		fi
+		if test -n "$QTDOCTAG" && test -r "$QTDOCTAG" ; then
+			echo "*** Copying tag file for the Qt library:"
+			mkdir qt
+			cp "$QTDOCTAG" qt/qt.tag
+		fi
+
+		do_subdirs_re "."
+
+	fi
+else
+	if test "x$recurse" = "x1" ; then
+		do_subdirs_re "$subdir"
+	else
+		do_subdir "$subdir"
+	fi
+fi
+
+
+# At the end of a run, clean up stuff.
+if test "YES" = "$cleanup" ; then
+	rm -f subdirs.in  subdirs.later subdirs.sort subdirs.top Doxyfile.in
+	rm -f `find . -name Doxyfile`
+	rm -f qt/qt.tag
+	rmdir qt > /dev/null 2>&1
+fi
+
+
+exit 0
+
diff --git a/lib-src/taglib/admin/install-sh b/lib-src/taglib/admin/install-sh
new file mode 100755
index 0000000..0ae12c0
--- /dev/null
+++ b/lib-src/taglib/admin/install-sh
@@ -0,0 +1,401 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-11-07.23
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Symbolic mode for testing mkdir with directories.
+# It is the same as 755, but also tests that "u+" works.
+test_mode=u=rwx,g=rx,o=rx,u+wx
+
+# Desired mode of installed file.
+mode=0755
+
+# Desired mode of newly created intermediate directories.
+# It is empty if not known yet.
+intermediate_mode=
+
+chmodcmd=$chmodprog
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
+	break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| \
+	     .       : '\(.\)' 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+		  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+		  /^X\(\/\/\)$/{ s//\1/; q; }
+		  /^X\(\/\).*/{ s//\1/; q; }
+		  s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	posix_mkdir=false
+	if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
+	  posix_mkdir=true
+	else
+	  # Remove any dirs left behind by ancient mkdir implementations.
+	  rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
+	fi ;;
+    esac
+
+    if
+      $posix_mkdir && {
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, create it using the same intermediate mode that
+	# mkdir -p would use when creating intermediate directories.
+	# POSIX says that this mode is "$(umask -S),u+wx", so use that
+	# if umask -S works.
+
+	if test -n "$dir_arg"; then
+	  mkdir_mode=$mode
+	else
+	  case $intermediate_mode in
+	    '')
+	      if umask_S=`(umask -S) 2>/dev/null`; then
+		intermediate_mode=$umask_S,u+wx
+	      else
+		intermediate_mode=$test_mode
+	      fi ;;
+	  esac
+	  mkdir_mode=$intermediate_mode
+	fi
+
+	$mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
+      }
+    then :
+    else
+
+      # mkdir does not conform to POSIX, or it failed possibly due to
+      # a race condition.  Create the directory the slow way, step by
+      # step, checking for races as we go.
+
+      case $dstdir in
+	/*) pathcomp=/ ;;
+	-*) pathcomp=./ ;;
+	*)  pathcomp= ;;
+      esac
+
+      case $posix_glob in
+        '')
+	  if (set -f) 2>/dev/null; then
+	    posix_glob=true
+	  else
+	    posix_glob=false
+	  fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
+      shift
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      for d
+      do
+	test "x$d" = x && continue
+
+	pathcomp=$pathcomp$d
+	if test ! -d "$pathcomp"; then
+	  $mkdirprog "$pathcomp"
+	  # Don't fail if two instances are running concurrently.
+	  test -d "$pathcomp" || exit 1
+	fi
+	pathcomp=$pathcomp/
+      done
+      obsolete_mkdir_used=true
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dst"; then
+	       $doit $rmcmd -f "$dst" 2>/dev/null \
+	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+	       || {
+		 echo "$0: cannot unlink or rename $dst" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dst"
+	 }
+    } || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/lib-src/taglib/admin/libtool.m4.in b/lib-src/taglib/admin/libtool.m4.in
new file mode 100644
index 0000000..7f5eed6
--- /dev/null
+++ b/lib-src/taglib/admin/libtool.m4.in
@@ -0,0 +1,5891 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+	         [m4_ifdef([AC_PROVIDE_$1],
+		           [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "[$]0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      LINUX_64_MODE="32"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      LINUX_64_MODE="64"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  testring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+ *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
+	       = "XX$testring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      testring=$testring$testring
+    done
+    testring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
+    
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac  
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  AC_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+  
+mingw* | pw32*)
+  # win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='win32_libid'
+  ;;
+
+darwin* | rhapsody*)
+  # this will be overwritten by pass_all, but leave it in just in case
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.[[012]])
+    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case "$host_cpu" in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+  irix5* | nonstopux*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
+  arm* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+        ;;
+      *)
+	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	*/dev/null*)
+	  lt_cv_path_NM="$tmp_nm -p"
+	  break
+	  ;;
+	*)
+	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	  continue # so that we can try to find one that supports BSD flags
+	  ;;
+	esac
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!).  If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.[012])
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi  
+    ;;  
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_LD
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+	grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      # KDE requires run time linking.  Make it the default.
+      aix_use_runtimelinking=yes
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	fi
+      esac
+      shared_flag='-shared'
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	shared_flag='-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='-qmkshrobj ${wl}-G'
+	else
+	  shared_flag='-qmkshrobj'
+	fi
+      fi
+    fi
+
+    # Let the compiler handle the export list.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname.def;
+      else
+	echo EXPORTS > $output_objdir/$soname.def;
+	cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.[012])
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    else
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+    fi
+    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+  else
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				# but as the default
+				# location of the library.
+
+    case $cc_basename in
+    CC)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	  ;;
+	esac
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	      ;;
+	    esac
+	  fi
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	# Archives containing C++ object files must be created using
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	runpath_var=LD_RUN_PATH
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	  echo "-hidden">> $lib.exp~
+	  $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# Archives containing C++ object files must be created using
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+
+	# The C++ compiler must be used to create the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  else
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	    # platform.
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  fi
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+	  || test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext|*.$libext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi  
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGISTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;; 
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+      runpath_var=LD_RUN_PATH
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	fi
+
+	# KDE requires run time linking.  Make it the default.
+	aix_use_runtimelinking=yes
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	esac
+	shared_flag='-shared'
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+  	if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='-qmkshrobj ${wl}-G'
+	  else
+	    shared_flag='-qmkshrobj'
+  	fi
+	fi
+      fi
+
+      # Let the compiler handle the export list.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi4*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      case "$host_os" in
+      rhapsody* | darwin1.[[012]])
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
+	;;
+      *) # Darwin 1.3 on
+	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	else
+	  case ${MACOSX_DEPLOYMENT_TARGET} in
+	    10.[012])
+	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	      ;;
+	    10.*)
+	      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
+	      ;;
+	  esac
+	fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    	else
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+      fi
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    else  
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi  
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	esac
+      else
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+  
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && break
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
diff --git a/lib-src/taglib/admin/ltmain.sh b/lib-src/taglib/admin/ltmain.sh
new file mode 100644
index 0000000..27ee8c4
--- /dev/null
+++ b/lib-src/taglib/admin/ltmain.sh
@@ -0,0 +1,6389 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5a
+TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+  SP2NL="tr '\100' '\n'"
+  NL2SP="tr '\r\n' '\100\100'"
+  ;;
+ *) # Assume ASCII based system
+  SP2NL="tr '\040' '\012'"
+  NL2SP="tr '\015\012' '\040\040'"
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS=" 	"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*) 
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit 1
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit 0
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+    done
+    exit 0
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit 0
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_output=
+    arg_mode=normal
+    libobj=
+
+    for arg
+    do
+      case "$arg_mode" in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit 1
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static)
+	  build_old_libs=yes
+	  continue
+	  ;;
+
+	-prefer-pic)
+	  pic_mode=yes
+	  continue
+	  ;;
+
+	-prefer-non-pic)
+	  pic_mode=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit 1
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit 1
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base compile
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+	    case "$base_compile " in
+	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit 1" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit 1" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$0" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+      $echo $srcfile > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $srcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      suppress_output=' >/dev/null 2>&1'
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      else
+	command="$base_compile $srcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit 0
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    add_flags=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      base_compile="$base_compile $arg"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit 1
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit 1
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit 1
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit 1
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+	        *" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+              esac
+              ;;
+   	  esac
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit 1
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit 1
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    continue
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # gcc -m* arguments should be passed to the linker via $compiler_flags
+      # in order to pass architecture information to the linker
+      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
+      # but this is not reliable with gcc because gcc may use -mfoo to
+      # select a different linker, different libraries, etc, while
+      # -Wl,-mfoo simply passes -mfoo to the linker.
+      -m*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit 1
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      -framework)
+        prev=framework
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	add_flags="$add_flags $arg"
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit 1
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit 1
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	add_flags="$add_flags $arg"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base link
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+	    case $base_compile in
+	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+	      # The compiler in $compile_command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#       else
+#         $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplcations in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  if test "$pass" = conv && test "$allow_undefined" = yes; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    if test "$deplibs_check_method" != pass_all; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit 1
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	case $host in
+	*-*-darwin*)
+	  # Convert "-framework foo" to "foo.ltframework" in dependency_libs
+	  test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    #echo "Adding $deplib to \$deplibs"
+	    deplibs="$deplib $deplibs"
+            if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+            fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit 1
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit 1
+	  fi
+	  continue
+	fi # $pass = conv
+
+    
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	else
+	  dir="$ladir/$objdir"
+	  absdir="$abs_ladir/$objdir"
+	  # Remove this search path later
+	  notinst_path="$notinst_path $abs_ladir"
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+    
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var"; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $dir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+	
+      # Warn about portability, can't link against -module's on some systems (darwin)
+      if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"    
+      fi	  
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$extract_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$old_archive_from_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against it, someone
+		    # is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi 
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case "$libdir" in
+		    [\\/]*)
+		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit 1
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case "$libdir" in
+		  [\\/]*)
+		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    convenience="$convenience $dir/$old_library"
+	    old_convenience="$old_convenience $dir/$old_library"
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  #if test -n "$dependency_libs" &&
+	  #   { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+	  #     test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  #fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit 1
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    # Sure, some shells/systems don't implement the -ef.
+		    # Those will have to live with the warning.
+		    test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
+		      $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs, but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		   fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		    path=""
+		  fi
+		  ;;
+		*)
+		path="-L$path"
+		;;
+		esac 
+		
+		;;
+		  -l*)
+		case $host in
+		*-*-darwin*)
+		 # Again, we only want to link against shared libraries
+		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		 for tmp in $newlib_search_path ; do
+		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		       eval depdepl="$tmp/lib$tmp_libs.dylib"
+		       break
+		     fi  
+         done
+         path=""
+		  ;;
+		*) continue ;;
+		esac  		  
+		;;
+
+	      *.ltframework)
+		case $host in
+		  *-*-darwin*)
+		    depdepl="$deplib"
+		    ;;
+		esac
+		;;
+
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$deplibs $depdepl" ;;
+	      esac	      
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$deplibs $path" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit 1
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+	
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $revision in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $age in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *$exeext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" -ne "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	case $host in
+	  *-*-darwin*)
+	    newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    ;;
+	esac
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    eval cmds=\"$export_symbols_cmds\"
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*) 
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs" 
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+
+	    for xlib in $convenience; do
+	      # Extract the objects.
+	      case $xlib in
+	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	      *) xabs=`pwd`"/$xlib" ;;
+	      esac
+	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	      xdir="$gentop/$xlib"
+
+	      $show "${rm}r $xdir"
+	      $run ${rm}r "$xdir"
+	      $show "$mkdir $xdir"
+	      $run $mkdir "$xdir"
+	      status=$?
+	      if test "$status" -ne 0 && test ! -d "$xdir"; then
+		exit $status
+	      fi
+	      # We will extract separately just the conflicting names and we will no
+	      # longer touch any unique names. It is faster to leave these extract
+	      # automatically by $AR in one run.
+	      $show "(cd $xdir && $AR x $xabs)"
+	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+		:
+	      else
+		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+		$AR t "$xabs" | sort | uniq -cd | while read -r count name
+		do
+		  i=1
+		  while test "$i" -le "$count"
+		  do
+		   # Put our $i before any first dot (extension)
+		   # Never overwrite any file
+		   name_to="$name"
+		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		   do
+		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		   done
+		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		   i=`expr $i + 1`
+		  done
+		done
+	      fi
+
+	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	    done
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Add all flags from the command line.  We here create a library,
+	# but those flags were only added to compile_command and
+	# finalize_command, which are only used when creating executables.
+	# So do it by hand here.
+	compiler_flags="$compiler_flags $add_flags"
+	# Only add it to commands which use CC, instead of LD, i.e.
+	# only to $compiler_flags
+	#linker_flags="$linker_flags $add_flags"
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval cmds=\"$module_expsym_cmds\"
+	  else
+	    eval cmds=\"$module_cmds\"
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval cmds=\"$archive_expsym_cmds\"
+	else
+	  eval cmds=\"$archive_cmds\"
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$save_output-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*"` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$save_output-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$save_output-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadale object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval cmds=\"$archive_expsym_cmds\"
+	  else
+	    eval cmds=\"$archive_cmds\"
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  exit 0
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit 1
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  $show "${rm}r $gentop"
+	  $run ${rm}r "$gentop"
+	  $show "$mkdir $gentop"
+	  $run $mkdir "$gentop"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$gentop"; then
+	    exit $status
+	  fi
+	  generated="$generated $gentop"
+
+	  for xlib in $convenience; do
+	    # Extract the objects.
+	    case $xlib in
+	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	    *) xabs=`pwd`"/$xlib" ;;
+	    esac
+	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	    xdir="$gentop/$xlib"
+
+	    $show "${rm}r $xdir"
+	    $run ${rm}r "$xdir"
+	    $show "$mkdir $xdir"
+	    $run $mkdir "$xdir"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$xdir"; then
+	      exit $status
+	    fi
+	    # We will extract separately just the conflicting names and we will no
+	    # longer touch any unique names. It is faster to leave these extract
+	    # automatically by $AR in one run.
+	    $show "(cd $xdir && $AR x $xabs)"
+	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	      :
+	    else
+	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	      do
+		i=1
+		while test "$i" -le "$count"
+		do
+		 # Put our $i before any first dot (extension)
+		 # Never overwrite any file
+		 name_to="$name"
+		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		 do
+		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		 done
+		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		 i=`expr $i + 1`
+		done
+	      done
+	    fi
+
+	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	  done
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      eval cmds=\"$reload_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit 0
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit 0
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	eval cmds=\"$reload_cmds\"
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit 0
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+        ;;
+      esac
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$output.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit 1
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
+      # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
+      # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
+      # This does not apply on AIX for ia64, which uses a SysV linker.
+      case "$host" in
+        ia64-*-aix5*) ;;
+        *-*-aix4* | *-*-aix5*)
+                   compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
+                   finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
+      esac
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit 0
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+	case $0 in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+	esac
+	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *mingw* )
+	    cwrappersource=`$echo ${output_objdir}/lt-${outputname}.c`
+	    cwrapper=`$echo ${output}.exe`
+	    $rm $cwrappersource $cwrapper
+	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+   
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2 
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+  
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe"); 
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char * 
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':') 
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char * 
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat) 
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode, 
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+	  # we should really use a build-platform specific compiler
+	  # here, but OTOH, the wrappers (shell script and this C one)
+	  # are only useful if you want to execute the "real" binary.
+	  # Since the "real" binary is built for $host, then this
+	  # wrapper might as well be built for $host, too.
+	  $run $LTCC -s -o $cwrapper $cwrappersource
+	  ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit 1" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  # Need to set LD_LIBRARY_PATH, to the value already
+	  # computed within libtool.
+	  $echo >> $output "\
+      LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit 0
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	$show "${rm}r $gentop"
+	$run ${rm}r "$gentop"
+	$show "$mkdir $gentop"
+	$run $mkdir "$gentop"
+	status=$?
+	if test "$status" -ne 0 && test ! -d "$gentop"; then
+	  exit $status
+	fi
+	generated="$generated $gentop"
+
+	# Add in members from convenience archives.
+	for xlib in $addlibs; do
+	  # Extract the objects.
+	  case $xlib in
+	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	  *) xabs=`pwd`"/$xlib" ;;
+	  esac
+	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	  xdir="$gentop/$xlib"
+
+	  $show "${rm}r $xdir"
+	  $run ${rm}r "$xdir"
+	  $show "$mkdir $xdir"
+	  $run $mkdir "$xdir"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$xdir"; then
+	    exit $status
+	  fi
+	  # We will extract separately just the conflicting names and we will no
+	  # longer touch any unique names. It is faster to leave these extract
+	  # automatically by $AR in one run.
+	  $show "(cd $xdir && $AR x $xabs)"
+	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	    do
+	      i=1
+	      while test "$i" -le "$count"
+	      do
+	       # Put our $i before any first dot (extension)
+	       # Never overwrite any file
+	       name_to="$name"
+	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+	       do
+		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+	       done
+	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+	       i=`expr $i + 1`
+	      done
+	    done
+	  fi
+
+	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+	done
+      fi
+
+      compiler_flags="$compiler_flags $add_flags"
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	eval cmds=\"$old_archive_from_new_cmds\"
+      else
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+	  # encoded into archives.  This makes 'ar r' malfunction in
+	  # this piecewise linking case whenever conflicting object
+	  # names appear in distinct ar calls; check, warn and compensate.
+	    if (for obj in $save_oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+	    AR_FLAGS=cq
+	  fi
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done  
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*"` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi  
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+        relink_command=
+      fi  
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit 1
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit 0
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest="$arg"
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*) ;;
+
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest="$arg"
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit 1
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit 1
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  eval cmds=\"$postinstall_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit 0
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit 1
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
+	      else
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyways
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      eval cmds=\"$old_postinstall_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $0 --finish$current_libdirs'
+    else
+      exit 0
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  eval cmds=\"$finish_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    exit 0
+
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit 0
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit 1
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit 1
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit 0
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test "$mode" = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      eval cmds=\"$postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      eval cmds=\"$old_postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe) 
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit 1
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool at gnu.org>."
+  exit 0
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/lib-src/taglib/admin/missing b/lib-src/taglib/admin/missing
new file mode 100755
index 0000000..64b5f90
--- /dev/null
+++ b/lib-src/taglib/admin/missing
@@ -0,0 +1,353 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2004-09-07.08
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, 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.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit 0
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit 0
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case "$firstarg" in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case "$firstarg" in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/lib-src/taglib/admin/mkinstalldirs b/lib-src/taglib/admin/mkinstalldirs
new file mode 100755
index 0000000..259dbfc
--- /dev/null
+++ b/lib-src/taglib/admin/mkinstalldirs
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake at gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+      else
+	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+	  lasterr=
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
+	  fi
+	fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/lib-src/taglib/admin/nmcheck b/lib-src/taglib/admin/nmcheck
new file mode 100755
index 0000000..1544713
--- /dev/null
+++ b/lib-src/taglib/admin/nmcheck
@@ -0,0 +1,371 @@
+#!/usr/bin/perl -w
+
+# Check namespace cleanness of a library.
+# Allowed symbols are passed as arguments.
+# They may have trailing * = wildcard.
+# Wildcards may be also specified as *::* (e.g. K*::* for all KDE classes)
+# Symbols are listed as full function unmangled names without arguments,
+# e.g. 'foo bar* nspace::*' allows foo(), foo(int), bar(), barbar()
+# and all symbols in namespace/class nspace.
+# If an argument has comma in it, it's a filename of a file containing
+# allowed symbols, one per line.
+
+
+$thisProg   = "$0";     # This programs name
+
+$library = "";
+$allowed_symbols = "";
+$debug = 0;
+$allowed_weak = "";
+$weak_specified = 0;
+
+while( defined( $ARGV[ 0 ] ))
+{
+    $_ = shift;
+    if( /^--verbose$|^-v$/ )
+    {
+	$debug = 1;
+    }
+    elsif( /^--help$|^-h$/ )
+    {
+        print STDOUT "Usage $thisProg [OPTION] ... library [allowed symbols] ...\n",
+                "\n",
+		"Check if the given library has only allowed public symbols.\n",
+                "\n",
+		"  --allowweak=[symbol] allow only these weak symbols\n",
+                "  -v, --verbose        verbosely list files processed\n",
+                "  -h, --help           print this help, then exit\n";
+        exit 0;
+    }
+    elsif( /^--allowweak=(.*)$/ )
+    {
+	$allowed_weak .= " " . $1;
+	$weak_specified = 1;
+    }
+    elsif( /^--allowweak$/ ) # simply list all weak
+    {
+	$allowed_weak .= " ";
+	$weak_specified = 1;
+    }
+    elsif( /^--*/ )
+    {
+	die "Invalid argument!\n";
+    }
+    else
+    {
+	if( ! $library )
+	{
+	    $library = $_;
+	}
+	else
+	{
+	    $allowed_symbols .= " " . $_;
+	}
+    }
+}
+
+if( ! $weak_specified )
+{
+    $allowed_weak = "*"; 
+    # allow all weak symbols by default
+    # instances of templates and similar stuff - unfortunately includes also things from other libraries,
+    # so it cannot be on by default
+}
+
+print STDERR "library:" . $library . "\n" if $debug;
+print STDERR "allowed_symbols:" . $allowed_symbols . "\n" if $debug;
+print STDERR "allowed_weak:" . $allowed_weak . "\n" if $debug;
+
+$default_symbols = "_fini _init";  # system symbols
+# on my system, every .so has :
+# A _DYNAMIC
+# A _GLOBAL_OFFSET_TABLE_
+# A __bss_start
+# A _edata
+# A _end
+# T _fini
+# T _init
+# no need to list A symbols in $default_symbols
+
+print STDERR "default_symbols: " . $default_symbols . "\n" if $debug;
+
+print STDOUT "Namespace cleanness check for " . $library . " :\n";
+
+$lib_file = "";
+if( $library =~ /\.la$/ )
+{
+    # get the real library file from .la
+    open( FILEIN, $library ) || die "Couldn't open $! !\n";
+    while( $line = <FILEIN> )
+    {
+	if( $line =~ /library_names=\'([^ ]*).*/o )
+	{
+	    $lib_file = $1;
+	}
+    }
+    close( FILEIN );
+    if( ! $lib_file )
+    {
+	print STDERR "Library file not found in .la file!\n";
+	exit 1;
+    }
+    my $libpath = $library;
+    $libpath =~ s%[^/]*$%%;
+    if(  -e $libpath . ".libs/" . $lib_file )
+    {
+	$lib_file = $libpath . ".libs/" . $lib_file;
+    }
+    else
+    {
+	$lib_file = $libpath . $lib_file;
+    }
+}
+else
+{
+    $lib_file = $library;
+}
+
+print STDERR "libfile: ". $lib_file . "\n" if $debug;
+
+$allowed_symbols .= " " . $default_symbols;
+
+sub process_symbols($\@\%\@);
+
+ at wildcards = ();
+%exacts = ();
+ at regwildcards = ();
+process_symbols( $allowed_symbols, @wildcards, %exacts, @regwildcards );
+ at weak_wildcards = ();
+%weak_exacts = ();
+ at weak_regwildcards = ();
+process_symbols( $allowed_weak, @weak_wildcards, %weak_exacts, @weak_regwildcards );
+
+# grep is for stripping not exported symbols, which don't have address (=first column)
+$nm_command = "nm -BDCg " . $lib_file . " | grep -v '^ ' |";
+
+# TODO how portable is this nmcheck stuff?
+
+print STDERR "nm command:" . $nm_command . "\n" if $debug;
+
+open( FILEIN, $nm_command ) || die "nm command failed\n";
+
+my $exit_code = 0;
+
+while( $line = <FILEIN> )
+{
+    my $type;
+    my $symbol;
+    if( $line =~ /^[^ ]* (.) (.*)$/o )
+    {
+	$type = $1;
+	$symbol = $2;
+    }
+    else
+    {
+	die "Invalid line: " . $line . "\n";
+    }
+    
+    print STDERR "Type: " . $type . " , symbol: " . $symbol . "\n" if $debug;
+    if( $type eq "A" )
+    { # these should be system symbols, so ignore them
+	next;
+    }
+
+    my $orig_symbol = $symbol;
+
+    if( $symbol =~ /\(anonymous namespace\)/o )
+    { # TODO tell to prefer named namespaces? (shorter symbols)
+	next;
+    }
+
+    # strip prefixes
+    # the :: appending is to make "CLASS::*" work also for "vtable for CLASS"
+    $symbol =~ s/^typeinfo for (.*)$/$1::/o;
+    $symbol =~ s/^typeinfo fn for (.*)$/$1::/o;
+    $symbol =~ s/^typeinfo name for (.*)$/$1::/o;
+    $symbol =~ s/^vtable for (.*)$/$1::/o;
+    $symbol =~ s/^guard variable for (.*)$/$1::/o;
+    $symbol =~ s/^reference temporary for (.*)$/$1::/o;
+    $symbol =~ s/^VTT for (.*)$/$1::/o;
+    $symbol =~ s/^virtual thunk \[[^\]]*\] to (.*)$/$1::/o;
+    $symbol =~ s/^non-virtual thunk \[[^\]]*\] to (.*)$/$1::/o;
+    $symbol =~ s/^covariant return thunk \[[^\]]*\] to (.*)$/$1::/o;
+    $symbol =~ s/^construction vtable thunk for (.*)$/$1::/o;
+    $symbol =~ s/^construction vtable for .*-in-(.*) [0-9]*$/$1::/o;
+
+    # templates seem to have also return types mangled in their name, and nm prints it too
+    # they have also template arguments in the symbol
+    # get rid of both of those
+    while( $symbol =~ /<.*>/o )
+    {
+        $symbol =~ s/<[^<>]*>//o; # strip innermost <>
+    }
+    if( $symbol !~ /operator\(\)/o )
+    {
+	$symbol =~ s/ ?\(.*\).*$//o;  # strip () and all after it
+    }
+    else
+    {
+	$symbol =~ s/(^|:| )operator\(\) ?\(.*\).*$//o;  # strip () and all after it
+    }
+    $symbol =~ s/\[.*\] *$//o;   # strip [in-charge] etc.
+    if( $symbol =~ /(^|:| )operator /o )
+    {
+	$symbol =~ s/.* ([^\s]*)operator /$1/o; # strip everything before 'X::operator blah'
+    }
+    else
+    {
+	$symbol =~ s/.* ([^\s]+) *$/$1/o;  # get last word (strip return type)
+    }
+
+    # print STDERR "Processed symbol: " . $symbol . "\n" if $debug;
+    
+    my $found = 0;
+    if( $exacts{ $symbol } )
+    {
+	$found = 1;
+    }
+    if( ! $found )
+    {
+	for my $wild ( @wildcards )
+	{
+	    if( index( $symbol, $wild ) == 0 )
+	    {
+		$found = 1;
+		last;
+	    }
+	}
+    }
+    if( ! $found )
+    {
+	for my $wild ( @regwildcards )
+	{
+	    if( $symbol =~ /^$wild$/ )
+	    {
+		$found = 1;
+		last;
+	    }
+	}
+    }
+    if( ( ! $found ) && ( $type eq "W" || $type eq "V" ))
+    {
+	if( $weak_exacts{ $symbol } )
+	{
+	    $found = 1;
+	}
+	if( ! $found )
+	{
+	    for my $wild ( @weak_wildcards )
+	    {
+	        if( index( $symbol, $wild ) == 0 )
+	        {
+	    	    $found = 1;
+		    last;
+		}
+	    }
+	}
+	if( ! $found )
+	{
+	    for my $wild ( @weak_regwildcards )
+	    {
+	        if( $symbol =~ /^$wild$/ )
+	        {
+		    $found = 1;
+		    last;
+	        }
+	    }
+	}
+    }
+
+    if( ! $found )
+    {
+	print STDERR "Public symbol " . $orig_symbol . " is not allowed!\n";
+	$exit_code = 1;
+    }
+}
+
+close( FILEIN );
+
+print STDOUT $exit_code == 0 ? "OK\n" : "FAILED\n";
+
+exit $exit_code;
+
+sub process_symbols($\@\%\@)
+{
+    my $allowed_symbols = $_[ 0 ];
+    my $wildcards_ref = $_[ 1 ];
+    my $exacts_ref = $_[ 2 ];
+    my $regwildcards_ref = $_[ 3 ];
+    
+    $allowed_symbols =~ s/^ *//o;  # strip whitespace
+    $allowed_symbols =~ s/ *$//o;
+
+    if( $allowed_symbols eq "NONE" )
+    {
+	$allowed_symbols = "";
+    }
+
+    my @symbols1 = split( ' ', $allowed_symbols );
+    my $i = 0;
+    my @symbols2 = ();
+    while( defined( $symbols1[ $i ] ))
+    {
+	my $symbol = $symbols1[ $i ];
+	if( $symbol =~ /\./ )  # dot in name -> file
+	{
+	    open( SYMIN, $symbol ) || die ( "Cannot open file " . $symbol . "!" );
+	    while( $line = <SYMIN> )
+	    {
+		$line =~ s/^\s*//o;  # strip whitespace
+		$line =~ s/\s*$//o;
+		if( $line !~ /^$/o  # empty line
+		    &&  $line !~ /^\s*#/ ) # comment line starting with #
+		{
+		    $symbols2[ $#symbols2 + 1 ] = $line;
+		}
+	    }
+	    close( SYMIN );
+	}
+	else
+	{
+	    $symbols2[ $#symbols2 + 1 ] = $symbol;
+	}
+	$i++;
+    }
+    $i = 0;
+    while( defined( $symbols2[ $i ] ))
+    {
+	my $symbol = $symbols2[ $i ];
+	if( $symbol =~ /__/
+	    || $symbol =~ /^_[A-Z]/ )
+	{ # ISO C++ 2.10.2
+	    die "Symbols containing a double underscore or beginning with an underscore and an upper-case letter are reserved!\n";
+	}
+	elsif( $symbol eq "main"
+	    || $symbol eq "main*" )
+	{
+	    die "Symbol main is not allowed!\n";
+	}
+	if( $symbol =~ /^([^\*]*)\*$/o   # trailing * without any * before it
+	    && $symbol !~ /operator\*$/o )
+        {
+	    print STDERR "wildcard:" . $symbol . "\n" if $debug;
+    	    $wildcards_ref->[ $#{$wildcards_ref} + 1 ] = $1;
+	}
+	elsif( $symbol =~ /\*$/o
+	    && ( $symbol =~ /\*::/o || $symbol =~ /::\*/o )
+	    && $symbol !~ /^\*/o
+	    && $symbol !~ /operator\*$/o )
+	{
+	    print STDERR "regwildcard:" . $symbol . "\n" if $debug;
+	    $symbol =~ s/\*/\.\*/go;  # change * to .* (regexp)
+	    $regwildcards_ref->[ $#{$regwildcards_ref} + 1 ] = $symbol;
+	}
+	else
+	{
+	    print STDERR "exact:" . $symbol . "\n" if $debug;
+	    $exacts_ref->{ $symbol } = 1;
+	}
+	$i++;
+    }
+}
diff --git a/lib-src/taglib/admin/oldinclude.m4.in b/lib-src/taglib/admin/oldinclude.m4.in
new file mode 100644
index 0000000..0ed7bcf
--- /dev/null
+++ b/lib-src/taglib/admin/oldinclude.m4.in
@@ -0,0 +1,192 @@
+###   -*- autoconf -*-
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum at shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo at kde.org)
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+dnl    Boston, MA 02110-1301, USA.
+
+AC_DEFUN([KDE_CHECK_MICO],
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_MISC_TESTS])
+AC_MSG_CHECKING(for MICO)
+
+if test -z "$MICODIR"; then
+    kde_micodir=/usr/local
+ else
+    kde_micodir="$MICODIR"
+fi
+
+AC_ARG_WITH(micodir,
+  [  --with-micodir=micodir  where mico is installed ],
+  kde_micodir=$withval,
+  kde_micodir=$kde_micodir
+)
+
+AC_CACHE_VAL(kde_cv_mico_incdir,
+[
+  mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
+AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
+
+])
+kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
+
+if test ! -r  $kde_micodir/include/CORBA.h; then
+  AC_MSG_ERROR([No CORBA.h found, specify another micodir])
+fi
+
+AC_MSG_RESULT($kde_micodir)
+
+MICO_INCLUDES=-I$kde_micodir/include
+AC_SUBST(MICO_INCLUDES)
+MICO_LDFLAGS=-L$kde_micodir/lib
+AC_SUBST(MICO_LDFLAGS)
+micodir=$kde_micodir
+AC_SUBST(micodir)
+
+AC_MSG_CHECKING([for MICO version])
+AC_CACHE_VAL(kde_cv_mico_version,
+[
+AC_LANG_C
+cat >conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include <mico/version.h>
+int main() {
+
+   printf("MICO_VERSION=%s\n",MICO_VERSION);
+   return (0);
+}
+EOF
+ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
+if AC_TRY_EVAL(ac_compile); then
+  if eval `./conftest 2>&5`; then
+    kde_cv_mico_version=$MICO_VERSION
+  else
+    AC_MSG_ERROR([your system is not able to execute a small application to
+    find MICO version! Check $kde_micodir/include/mico/version.h])
+  fi
+else
+  AC_MSG_ERROR([your system is not able to compile a small application to
+  find MICO version! Check $kde_micodir/include/mico/version.h])
+fi
+])
+
+dnl installed MICO version
+mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "x$1" = "x"; then
+ req_version="2.3.0"
+else
+ req_version=$1
+fi
+
+dnl required MICO version
+req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "$mico_v_maj" -lt "$req_v_maj" || \
+   ( test "$mico_v_maj" -eq "$req_v_maj" && \
+        test "$mico_v_mid" -lt "$req_v_mid" ) || \
+   ( test "$mico_v_mid" -eq "$req_v_mid" && \
+        test "$mico_v_min" -lt "$req_v_min" )
+
+then
+  AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
+at least is required. You should upgrade MICO.])
+else
+  AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
+fi
+
+LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
+AC_SUBST(LIBMICO)
+if test -z "$IDL"; then
+  IDL='$(kde_bindir)/cuteidl'
+fi
+AC_SUBST(IDL)
+IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
+AC_SUBST(IDL_DEPENDENCIES)
+
+idldir="\$(includedir)/idl"
+AC_SUBST(idldir)
+
+])
+
+AC_DEFUN([KDE_CHECK_MINI_STL],
+[
+AC_REQUIRE([KDE_CHECK_MICO])
+
+AC_MSG_CHECKING(if we use mico's mini-STL)
+AC_CACHE_VAL(kde_cv_have_mini_stl,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_cxxflags="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
+AC_TRY_COMPILE(
+[
+#include <mico/config.h>
+],
+[
+#ifdef HAVE_MINI_STL
+#error "nothing"
+#endif
+],
+kde_cv_have_mini_stl=no,
+kde_cv_have_mini_stl=yes)
+CXXFLAGS="$kde_save_cxxflags"
+AC_LANG_RESTORE
+])
+
+if test "x$kde_cv_have_mini_stl" = "xyes"; then
+   AC_MSG_RESULT(yes)
+   $1
+else
+   AC_MSG_RESULT(no)
+   $2
+fi
+])
+
+])
+
+AC_DEFUN([KDE_CHECK_ANSI],
+[
+])
+
+AC_DEFUN([KDE_CHECK_INSURE],
+[
+  AC_ARG_ENABLE(insure, [  --enable-insure             use insure++ for debugging [default=no]],
+  [
+  if test $enableval = "no"; dnl
+	then ac_use_insure="no"
+	else ac_use_insure="yes"
+   fi
+  ], [ac_use_insure="no"])
+
+  AC_MSG_CHECKING(if we will use Insure++ to debug)
+  AC_MSG_RESULT($ac_use_insure)
+  if test "$ac_use_insure" = "yes"; dnl
+       then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
+   fi
+])
+
+AC_DEFUN([KDE_CHECK_NEWLIBS],
+[
+
+])
diff --git a/lib-src/taglib/admin/pkg.m4.in b/lib-src/taglib/admin/pkg.m4.in
new file mode 100644
index 0000000..f2bfc2d
--- /dev/null
+++ b/lib-src/taglib/admin/pkg.m4.in
@@ -0,0 +1,57 @@
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN([PKG_CHECK_MODULES], [
+  succeeded=no
+
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+
+  if test "$PKG_CONFIG" = "no" ; then
+     echo "*** The pkg-config script could not be found. Make sure it is"
+     echo "*** in your path, or set the PKG_CONFIG environment variable"
+     echo "*** to the full path to pkg-config."
+     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+  else
+     PKG_CONFIG_MIN_VERSION=0.9.0
+     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+        AC_MSG_CHECKING(for $2)
+
+        if $PKG_CONFIG --exists "$2" ; then
+            AC_MSG_RESULT(yes)
+            succeeded=yes
+
+            AC_MSG_CHECKING($1_CFLAGS)
+            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+            AC_MSG_RESULT($$1_CFLAGS)
+
+            AC_MSG_CHECKING($1_LIBS)
+            $1_LIBS=`$PKG_CONFIG --libs "$2"`
+            AC_MSG_RESULT($$1_LIBS)
+        else
+            $1_CFLAGS=""
+            $1_LIBS=""
+            ## If we have a custom action on failure, don't print errors, but 
+            ## do set a variable so people can do so.
+            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+            ifelse([$4], ,echo $$1_PKG_ERRORS,)
+        fi
+
+        AC_SUBST($1_CFLAGS)
+        AC_SUBST($1_LIBS)
+     else
+        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+        echo "*** See http://www.freedesktop.org/software/pkgconfig"
+     fi
+  fi
+
+  if test $succeeded = yes; then
+     ifelse([$3], , :, [$3])
+  else
+     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+  fi
+])
+
+
diff --git a/lib-src/taglib/admin/ylwrap b/lib-src/taglib/admin/ylwrap
new file mode 100755
index 0000000..102bd89
--- /dev/null
+++ b/lib-src/taglib/admin/ylwrap
@@ -0,0 +1,223 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case "$1" in
+  '')
+    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
+    exit 1
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+  INPUT is the input file
+  OUTPUT is one file PROG generates
+  DESIRED is the file we actually want instead of OUTPUT
+  PROGRAM is program to run
+  ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit $?
+    ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+  [\\/]* | ?:[\\/]*)
+    # Absolute path; do nothing.
+    ;;
+  *)
+    # Relative path.  Make it absolute.
+    input="`pwd`/$input"
+    ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  pairlist="$pairlist $1"
+  shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+  [\\/]* | ?:[\\/]*) ;;
+  *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines.  But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+  0) $prog "$input" ;;
+  *) $prog "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+  set X $pairlist
+  shift
+  first=yes
+  # Since DOS filename conventions don't allow two dots,
+  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+  y_tab_nodot="no"
+  if test -f y_tab.c || test -f y_tab.h; then
+    y_tab_nodot="yes"
+  fi
+
+  # The directory holding the input.
+  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+  # Quote $INPUT_DIR so we can use it in a regexp.
+  # FIXME: really we should care about more than `.' and `\'.
+  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+  while test "$#" -ne 0; do
+    from="$1"
+    # Handle y_tab.c and y_tab.h output by DOS
+    if test $y_tab_nodot = "yes"; then
+      if test $from = "y.tab.c"; then
+    	from="y_tab.c"
+      else
+    	if test $from = "y.tab.h"; then
+    	  from="y_tab.h"
+    	fi
+      fi
+    fi
+    if test -f "$from"; then
+      # If $2 is an absolute path name, then just use that,
+      # otherwise prepend `../'.
+      case "$2" in
+    	[\\/]* | ?:[\\/]*) target="$2";;
+    	*) target="../$2";;
+      esac
+
+      # We do not want to overwrite a header file if it hasn't
+      # changed.  This avoid useless recompilations.  However the
+      # parser itself (the first file) should always be updated,
+      # because it is the destination of the .y.c rule in the
+      # Makefile.  Divert the output of all other files to a temporary
+      # file so we can compare them to existing versions.
+      if test $first = no; then
+	realtarget="$target"
+	target="tmp-`echo $target | sed s/.*[\\/]//g`"
+      fi
+      # Edit out `#line' or `#' directives.
+      #
+      # We don't want the resulting debug information to point at
+      # an absolute srcdir; it is better for it to just mention the
+      # .y file with no path.
+      #
+      # We want to use the real output file name, not yy.lex.c for
+      # instance.
+      #
+      # We want the include guards to be adjusted too.
+      FROM=`echo "$from" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+      TARGET=`echo "$2" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+      # Check whether header files must be updated.
+      if test $first = no; then
+	if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+	  echo "$2" is unchanged
+	  rm -f "$target"
+	else
+          echo updating "$2"
+          mv -f "$target" "$realtarget"
+        fi
+      fi
+    else
+      # A missing file is only an error for the first file.  This
+      # is a blatant hack to let us support using "yacc -d".  If -d
+      # is not specified, we don't want an error when the header
+      # file is "missing".
+      if test $first = yes; then
+        ret=1
+      fi
+    fi
+    shift
+    shift
+    first=no
+  done
+else
+  ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/lib-src/taglib/bindings/CMakeLists.txt b/lib-src/taglib/bindings/CMakeLists.txt
new file mode 100644
index 0000000..0afe119
--- /dev/null
+++ b/lib-src/taglib/bindings/CMakeLists.txt
@@ -0,0 +1 @@
+ADD_SUBDIRECTORY( c ) 
diff --git a/lib-src/taglib/bindings/Makefile.am b/lib-src/taglib/bindings/Makefile.am
new file mode 100644
index 0000000..6f20b92
--- /dev/null
+++ b/lib-src/taglib/bindings/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = c
diff --git a/lib-src/taglib/bindings/Makefile.in b/lib-src/taglib/bindings/Makefile.in
new file mode 100644
index 0000000..eb9dc9b
--- /dev/null
+++ b/lib-src/taglib/bindings/Makefile.in
@@ -0,0 +1,606 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = bindings
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = c
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  bindings/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  bindings/Makefile
+	cd $(top_srcdir) && perl admin/am_edit bindings/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool mostlyclean-am
+#>+ 1
+clean-am: clean-bcheck  clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	ctags ctags-recursive distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  bindings/Makefile
+	cd $(top_srcdir) && perl admin/am_edit bindings/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in ; do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/bindings/README b/lib-src/taglib/bindings/README
new file mode 100644
index 0000000..f9e9124
--- /dev/null
+++ b/lib-src/taglib/bindings/README
@@ -0,0 +1,6 @@
+There are a few other people that have done bindings externally that I have
+been made aware of.  I have not personally reviewed these bindings, but I'm
+listing them here so that those who find them useful are able to find them:
+
+- Ruby - http://www.hakubi.us/ruby-taglib/
+- Python - http://namingmuse.berlios.de/
diff --git a/lib-src/taglib/bindings/c/.deps/tag_c.Plo b/lib-src/taglib/bindings/c/.deps/tag_c.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/bindings/c/.deps/tag_c.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/bindings/c/CMakeLists.txt b/lib-src/taglib/bindings/c/CMakeLists.txt
new file mode 100644
index 0000000..d8dc190
--- /dev/null
+++ b/lib-src/taglib/bindings/c/CMakeLists.txt
@@ -0,0 +1,58 @@
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/toolkit
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/asf
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/mpeg
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/ogg
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/ogg/vorbis
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/ogg/flac
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/flac
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/mpc
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/mp4
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/mpeg/id3v2
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/wavpack
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/ogg/speex
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../../taglib/trueaudio
+)
+
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc )
+########### next target ###############
+
+ADD_LIBRARY(tag_c SHARED tag_c.cpp)
+
+TARGET_LINK_LIBRARIES(tag_c  tag )
+
+# On Solaris we need to explicitly add the C++ standard and runtime
+# libraries to the libs used by the C bindings, because those C bindings
+# themselves won't pull in the C++ libs -- and if a C application is
+# using the C bindings then we get link errors.
+CHECK_LIBRARY_EXISTS(Crun __RTTI___ "" HAVE_CRUN_LIB)
+IF(HAVE_CRUN_LIB)
+  # Which libraries to link depends critically on which
+  # STL version is going to be used by your application
+  # and which runtime is in use. While Crun is pretty much
+  # the only game in town, the three available STLs -- Cstd,
+  # stlport4 and stdcxx -- make this a mess. The KDE-Solaris
+  # team supports stdcxx (Apache RogueWave stdcxx 4.1.3).
+  #
+  TARGET_LINK_LIBRARIES(tag_c stdcxx Crun)
+ENDIF(HAVE_CRUN_LIB)
+
+SET_TARGET_PROPERTIES(tag_c PROPERTIES
+  VERSION 0.0.0
+  SOVERSION 0
+  DEFINE_SYMBOL MAKE_TAGLIB_C_LIB
+  INSTALL_NAME_DIR ${LIB_INSTALL_DIR}
+  )
+INSTALL(TARGETS tag_c
+	LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+	RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+	ARCHIVE DESTINATION  ${LIB_INSTALL_DIR}
+)
+
+
+########### install files ###############
+
+INSTALL( FILES  ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL( FILES  tag_c.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
+
diff --git a/lib-src/taglib/bindings/c/Makefile.am b/lib-src/taglib/bindings/c/Makefile.am
new file mode 100644
index 0000000..8bb0110
--- /dev/null
+++ b/lib-src/taglib/bindings/c/Makefile.am
@@ -0,0 +1,28 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/asf \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/ogg/vorbis \
+	-I$(top_srcdir)/taglib/ogg/speex \
+	-I$(top_srcdir)/taglib/ogg/flac \
+	-I$(top_srcdir)/taglib/flac \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mp4 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/taglib/wavpack \
+	-I$(top_srcdir)/taglib/trueaudio \
+	$(all_includes)
+
+lib_LTLIBRARIES = libtag_c.la
+
+libtag_c_la_SOURCES = tag_c.cpp
+taglib_include_HEADERS = tag_c.h
+taglib_includedir = $(includedir)/taglib
+
+libtag_c_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 0:0
+libtag_c_la_LIBADD = ../../taglib/libtag.la
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = taglib_c.pc
diff --git a/lib-src/taglib/bindings/c/Makefile.in b/lib-src/taglib/bindings/c/Makefile.in
new file mode 100644
index 0000000..41eb6a5
--- /dev/null
+++ b/lib-src/taglib/bindings/c/Makefile.in
@@ -0,0 +1,670 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = bindings/c
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/taglib_c.pc.in $(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = taglib_c.pc
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
+	"$(DESTDIR)$(taglib_includedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libtag_c_la_DEPENDENCIES = ../../taglib/libtag.la
+am_libtag_c_la_OBJECTS = tag_c.lo
+#>- libtag_c_la_OBJECTS = $(am_libtag_c_la_OBJECTS)
+#>+ 1
+libtag_c_la_OBJECTS = tag_c.lo
+#>- libtag_c_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+#>- 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+#>- 	$(CXXFLAGS) $(libtag_c_la_LDFLAGS) $(LDFLAGS) -o $@
+#>+ 3
+libtag_c_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(KDE_CXXFLAGS) $(libtag_c_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libtag_c_la_SOURCES)
+DIST_SOURCES = $(libtag_c_la_SOURCES)
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/asf \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/ogg/vorbis \
+	-I$(top_srcdir)/taglib/ogg/speex \
+	-I$(top_srcdir)/taglib/ogg/flac \
+	-I$(top_srcdir)/taglib/flac \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mp4 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/taglib/wavpack \
+	-I$(top_srcdir)/taglib/trueaudio \
+	$(all_includes)
+
+lib_LTLIBRARIES = libtag_c.la
+libtag_c_la_SOURCES = tag_c.cpp
+taglib_include_HEADERS = tag_c.h
+taglib_includedir = $(includedir)/taglib
+libtag_c_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 0:0
+libtag_c_la_LIBADD = ../../taglib/libtag.la
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = taglib_c.pc
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/c/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  bindings/c/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/c/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  bindings/c/Makefile
+	cd $(top_srcdir) && perl admin/am_edit bindings/c/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+taglib_c.pc: $(top_builddir)/config.status $(srcdir)/taglib_c.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libtag_c.la: $(libtag_c_la_OBJECTS) $(libtag_c_la_DEPENDENCIES) 
+	$(libtag_c_la_LINK) -rpath $(libdir) $(libtag_c_la_OBJECTS) $(libtag_c_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tag_c.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	done
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck  clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgconfigDATA install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \
+	uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-pkgconfigDATA install-ps install-ps-am install-strip \
+	install-taglib_includeHEADERS installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \
+	uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in taglib_c.pc.cmake taglib_c.pc.in configure.in.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  bindings/c/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  bindings/c/Makefile
+	cd $(top_srcdir) && perl admin/am_edit bindings/c/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/bindings/c/configure.in.in b/lib-src/taglib/bindings/c/configure.in.in
new file mode 100644
index 0000000..3e84740
--- /dev/null
+++ b/lib-src/taglib/bindings/c/configure.in.in
@@ -0,0 +1 @@
+dnl AC_OUTPUT(bindings/c/taglib_c.pc)
diff --git a/lib-src/taglib/bindings/c/tag_c.cpp b/lib-src/taglib/bindings/c/tag_c.cpp
new file mode 100644
index 0000000..a3ea853
--- /dev/null
+++ b/lib-src/taglib/bindings/c/tag_c.cpp
@@ -0,0 +1,293 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it  under the terms of the GNU Lesser General Public License version  *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "../../config.h"
+#endif
+
+#include "tag_c.h"
+
+#include <stdlib.h>
+#include <fileref.h>
+#include <tfile.h>
+#include <asffile.h>
+#include <vorbisfile.h>
+#include <mpegfile.h>
+#include <flacfile.h>
+#include <oggflacfile.h>
+#include <mpcfile.h>
+#include <wavpackfile.h>
+#include <speexfile.h>
+#include <trueaudiofile.h>
+#include <mp4file.h>
+#include <tag.h>
+#include <string.h>
+#include <id3v2framefactory.h>
+
+using namespace TagLib;
+
+static List<char *> strings;
+static bool unicodeStrings = true;
+static bool stringManagementEnabled = true;
+
+void taglib_set_strings_unicode(BOOL unicode)
+{
+  unicodeStrings = bool(unicode);
+}
+
+void taglib_set_string_management_enabled(BOOL management)
+{
+  stringManagementEnabled = bool(management);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TagLib::File wrapper
+////////////////////////////////////////////////////////////////////////////////
+
+TagLib_File *taglib_file_new(const char *filename)
+{
+  return reinterpret_cast<TagLib_File *>(FileRef::create(filename));
+}
+
+TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type)
+{
+  switch(type) {
+  case TagLib_File_MPEG:
+    return reinterpret_cast<TagLib_File *>(new MPEG::File(filename));
+  case TagLib_File_OggVorbis:
+    return reinterpret_cast<TagLib_File *>(new Ogg::Vorbis::File(filename));
+  case TagLib_File_FLAC:
+    return reinterpret_cast<TagLib_File *>(new FLAC::File(filename));
+  case TagLib_File_MPC:
+    return reinterpret_cast<TagLib_File *>(new MPC::File(filename));
+  case TagLib_File_OggFlac:
+    return reinterpret_cast<TagLib_File *>(new Ogg::FLAC::File(filename));
+  case TagLib_File_WavPack:
+    return reinterpret_cast<TagLib_File *>(new WavPack::File(filename));
+  case TagLib_File_Speex:
+    return reinterpret_cast<TagLib_File *>(new Ogg::Speex::File(filename));
+  case TagLib_File_TrueAudio:
+    return reinterpret_cast<TagLib_File *>(new TrueAudio::File(filename));
+#ifdef WITH_MP4
+  case TagLib_File_MP4:
+    return reinterpret_cast<TagLib_File *>(new MP4::File(filename));
+#endif
+#ifdef WITH_ASF
+  case TagLib_File_ASF:
+    return reinterpret_cast<TagLib_File *>(new ASF::File(filename));
+#endif
+  default:
+    return 0;
+  }
+
+  return 0;
+}
+
+void taglib_file_free(TagLib_File *file)
+{
+  delete reinterpret_cast<File *>(file);
+}
+
+BOOL taglib_file_is_valid(const TagLib_File *file)
+{
+	return reinterpret_cast<const File *>(file)->isValid();
+}
+
+TagLib_Tag *taglib_file_tag(const TagLib_File *file)
+{
+  const File *f = reinterpret_cast<const File *>(file);
+  return reinterpret_cast<TagLib_Tag *>(f->tag());
+}
+
+const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file)
+{
+  const File *f = reinterpret_cast<const File *>(file);
+  return reinterpret_cast<const TagLib_AudioProperties *>(f->audioProperties());
+}
+
+BOOL taglib_file_save(TagLib_File *file)
+{
+  return reinterpret_cast<File *>(file)->save();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TagLib::Tag wrapper
+////////////////////////////////////////////////////////////////////////////////
+
+char *taglib_tag_title(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  char *s = ::strdup(t->title().toCString(unicodeStrings));
+  if(stringManagementEnabled)
+    strings.append(s);
+  return s;
+}
+
+char *taglib_tag_artist(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  char *s = ::strdup(t->artist().toCString(unicodeStrings));
+  if(stringManagementEnabled)
+    strings.append(s);
+  return s;
+}
+
+char *taglib_tag_album(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  char *s = ::strdup(t->album().toCString(unicodeStrings));
+  if(stringManagementEnabled)
+    strings.append(s);
+  return s;
+}
+
+char *taglib_tag_comment(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  char *s = ::strdup(t->comment().toCString(unicodeStrings));
+  if(stringManagementEnabled)
+    strings.append(s);
+  return s;
+}
+
+char *taglib_tag_genre(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  char *s = ::strdup(t->genre().toCString(unicodeStrings));
+  if(stringManagementEnabled)
+    strings.append(s);
+  return s;
+}
+
+unsigned int taglib_tag_year(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  return t->year();
+}
+
+unsigned int taglib_tag_track(const TagLib_Tag *tag)
+{
+  const Tag *t = reinterpret_cast<const Tag *>(tag);
+  return t->track();
+}
+
+void taglib_tag_set_title(TagLib_Tag *tag, const char *title)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setTitle(String(title, unicodeStrings ? String::UTF8 : String::Latin1));
+}
+
+void taglib_tag_set_artist(TagLib_Tag *tag, const char *artist)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setArtist(String(artist, unicodeStrings ? String::UTF8 : String::Latin1));
+}
+
+void taglib_tag_set_album(TagLib_Tag *tag, const char *album)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setAlbum(String(album, unicodeStrings ? String::UTF8 : String::Latin1));
+}
+
+void taglib_tag_set_comment(TagLib_Tag *tag, const char *comment)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setComment(String(comment, unicodeStrings ? String::UTF8 : String::Latin1));
+}
+
+void taglib_tag_set_genre(TagLib_Tag *tag, const char *genre)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setGenre(String(genre, unicodeStrings ? String::UTF8 : String::Latin1));
+}
+
+void taglib_tag_set_year(TagLib_Tag *tag, unsigned int year)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setYear(year);
+}
+
+void taglib_tag_set_track(TagLib_Tag *tag, unsigned int track)
+{
+  Tag *t = reinterpret_cast<Tag *>(tag);
+  t->setTrack(track);
+}
+
+void taglib_tag_free_strings()
+{
+  if(!stringManagementEnabled)
+    return;
+
+  for(List<char *>::Iterator it = strings.begin(); it != strings.end(); ++it)
+    free(*it);
+  strings.clear();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TagLib::AudioProperties wrapper
+////////////////////////////////////////////////////////////////////////////////
+
+int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties)
+{
+  const AudioProperties *p = reinterpret_cast<const AudioProperties *>(audioProperties);
+  return p->length();
+}
+
+int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties)
+{
+  const AudioProperties *p = reinterpret_cast<const AudioProperties *>(audioProperties);
+  return p->bitrate();
+}
+
+int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties)
+{
+  const AudioProperties *p = reinterpret_cast<const AudioProperties *>(audioProperties);
+  return p->sampleRate();
+}
+
+int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties)
+{
+  const AudioProperties *p = reinterpret_cast<const AudioProperties *>(audioProperties);
+  return p->channels();
+}
+
+void taglib_id3v2_set_default_text_encoding(TagLib_ID3v2_Encoding encoding)
+{
+  String::Type type = String::Latin1;
+
+  switch(encoding)
+  {
+  case TagLib_ID3v2_Latin1:
+    type = String::Latin1;
+    break;
+  case TagLib_ID3v2_UTF16:
+    type = String::UTF16;
+    break;
+  case TagLib_ID3v2_UTF16BE:
+    type = String::UTF16BE;
+    break;
+  case TagLib_ID3v2_UTF8:
+    type = String::UTF8;
+    break;
+  }
+
+  ID3v2::FrameFactory::instance()->setDefaultTextEncoding(type);
+}
diff --git a/lib-src/taglib/bindings/c/tag_c.h b/lib-src/taglib/bindings/c/tag_c.h
new file mode 100644
index 0000000..055da4e
--- /dev/null
+++ b/lib-src/taglib/bindings/c/tag_c.h
@@ -0,0 +1,290 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it  under the terms of the GNU Lesser General Public License version  *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TAG_C
+#define TAGLIB_TAG_C
+
+/* Do not include this in the main TagLib documentation. */
+#ifndef DO_NOT_DOCUMENT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32) || defined(_WIN64)
+#ifdef MAKE_TAGLIB_C_LIB
+#define TAGLIB_C_EXPORT __declspec(dllexport)
+#else
+#define TAGLIB_C_EXPORT __declspec(dllimport)
+#endif
+#else
+#define TAGLIB_C_EXPORT
+#endif
+
+#ifndef BOOL
+#define BOOL int
+#endif
+
+/*******************************************************************************
+ * [ TagLib C Binding ]
+ *
+ * This is an interface to TagLib's "simple" API, meaning that you can read and
+ * modify media files in a generic, but not specialized way.  This is a rough
+ * representation of TagLib::File and TagLib::Tag, for which the documentation
+ * is somewhat more complete and worth consulting.
+ *******************************************************************************/
+
+/*
+ * These are used for type provide some type safety to the C API (as opposed to
+ * using void *, but pointers to them are simply cast to the corresponding C++
+ * types in the implementation.
+ */
+
+typedef struct { int dummy; } TagLib_File;
+typedef struct { int dummy; } TagLib_Tag;
+typedef struct { int dummy; } TagLib_AudioProperties;
+
+/*!
+ * By default all strings coming into or out of TagLib's C API are in UTF8.
+ * However, it may be desirable for TagLib to operate on Latin1 (ISO-8859-1)
+ * strings in which case this should be set to FALSE.
+ */
+TAGLIB_C_EXPORT void taglib_set_strings_unicode(BOOL unicode);
+
+/*!
+ * TagLib can keep track of strings that are created when outputting tag values
+ * and clear them using taglib_tag_clear_strings().  This is enabled by default.
+ * However if you wish to do more fine grained management of strings, you can do
+ * so by setting \a management to FALSE.
+ */
+TAGLIB_C_EXPORT void taglib_set_string_management_enabled(BOOL management);
+
+/*******************************************************************************
+ * File API
+ ******************************************************************************/
+
+typedef enum {
+  TagLib_File_MPEG,
+  TagLib_File_OggVorbis,
+  TagLib_File_FLAC,
+  TagLib_File_MPC,
+  TagLib_File_OggFlac,
+  TagLib_File_WavPack,
+  TagLib_File_Speex,
+  TagLib_File_TrueAudio,
+  TagLib_File_MP4,
+  TagLib_File_ASF
+} TagLib_File_Type;
+
+/*!
+ * Creates a TagLib file based on \a filename.  TagLib will try to guess the file
+ * type.
+ * 
+ * \returns NULL if the file type cannot be determined or the file cannot
+ * be opened.
+ */
+TAGLIB_C_EXPORT TagLib_File *taglib_file_new(const char *filename);
+
+/*!
+ * Creates a TagLib file based on \a filename.  Rather than attempting to guess
+ * the type, it will use the one specified by \a type.
+ */
+TAGLIB_C_EXPORT TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type);
+
+/*!
+ * Frees and closes the file.
+ */
+TAGLIB_C_EXPORT void taglib_file_free(TagLib_File *file);
+
+/*!
+ * Returns true if the file is open and readble and valid information for
+ * the Tag and / or AudioProperties was found.
+ */
+
+TAGLIB_C_EXPORT BOOL taglib_file_is_valid(const TagLib_File *file);
+
+/*!
+ * Returns a pointer to the tag associated with this file.  This will be freed
+ * automatically when the file is freed.
+ */
+TAGLIB_C_EXPORT TagLib_Tag *taglib_file_tag(const TagLib_File *file);
+
+/*!
+ * Returns a pointer to the the audio properties associated with this file.  This
+ * will be freed automatically when the file is freed.
+ */
+TAGLIB_C_EXPORT const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file);
+
+/*!
+ * Saves the \a file to disk.
+ */
+TAGLIB_C_EXPORT BOOL taglib_file_save(TagLib_File *file);
+
+/******************************************************************************
+ * Tag API
+ ******************************************************************************/
+
+/*!
+ * Returns a string with this tag's title.
+ *
+ * \note By default this string should be UTF8 encoded and its memory should be
+ * freed using taglib_tag_free_strings().
+ */
+TAGLIB_C_EXPORT char *taglib_tag_title(const TagLib_Tag *tag);
+
+/*!
+ * Returns a string with this tag's artist.
+ *
+ * \note By default this string should be UTF8 encoded and its memory should be
+ * freed using taglib_tag_free_strings().
+ */
+TAGLIB_C_EXPORT char *taglib_tag_artist(const TagLib_Tag *tag);
+
+/*!
+ * Returns a string with this tag's album name.
+ *
+ * \note By default this string should be UTF8 encoded and its memory should be
+ * freed using taglib_tag_free_strings().
+ */
+TAGLIB_C_EXPORT char *taglib_tag_album(const TagLib_Tag *tag);
+
+/*!
+ * Returns a string with this tag's comment.
+ *
+ * \note By default this string should be UTF8 encoded and its memory should be
+ * freed using taglib_tag_free_strings().
+ */
+TAGLIB_C_EXPORT char *taglib_tag_comment(const TagLib_Tag *tag);
+
+/*!
+ * Returns a string with this tag's genre.
+ *
+ * \note By default this string should be UTF8 encoded and its memory should be
+ * freed using taglib_tag_free_strings().
+ */
+TAGLIB_C_EXPORT char *taglib_tag_genre(const TagLib_Tag *tag);
+
+/*!
+ * Returns the tag's year or 0 if year is not set.
+ */
+TAGLIB_C_EXPORT unsigned int taglib_tag_year(const TagLib_Tag *tag);
+
+/*!
+ * Returns the tag's track number or 0 if track number is not set.
+ */
+TAGLIB_C_EXPORT unsigned int taglib_tag_track(const TagLib_Tag *tag);
+
+/*!
+ * Sets the tag's title.
+ *
+ * \note By default this string should be UTF8 encoded.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_title(TagLib_Tag *tag, const char *title);
+
+/*!
+ * Sets the tag's artist.
+ *
+ * \note By default this string should be UTF8 encoded.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_artist(TagLib_Tag *tag, const char *artist);
+
+/*!
+ * Sets the tag's album.
+ *
+ * \note By default this string should be UTF8 encoded.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_album(TagLib_Tag *tag, const char *album);
+
+/*!
+ * Sets the tag's comment.
+ *
+ * \note By default this string should be UTF8 encoded.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_comment(TagLib_Tag *tag, const char *comment);
+
+/*!
+ * Sets the tag's genre.
+ *
+ * \note By default this string should be UTF8 encoded.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_genre(TagLib_Tag *tag, const char *genre);
+
+/*!
+ * Sets the tag's year.  0 indicates that this field should be cleared.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_year(TagLib_Tag *tag, unsigned int year);
+
+/*!
+ * Sets the tag's track number.  0 indicates that this field should be cleared.
+ */
+TAGLIB_C_EXPORT void taglib_tag_set_track(TagLib_Tag *tag, unsigned int track);
+
+/*!
+ * Frees all of the strings that have been created by the tag.
+ */
+TAGLIB_C_EXPORT void taglib_tag_free_strings(void);
+
+/******************************************************************************
+ * Audio Properties API
+ ******************************************************************************/
+
+/*!
+ * Returns the length of the file in seconds.
+ */
+TAGLIB_C_EXPORT int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties);
+
+/*!
+ * Returns the bitrate of the file in kb/s.
+ */
+TAGLIB_C_EXPORT int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties);
+
+/*!
+ * Returns the sample rate of the file in Hz.
+ */
+TAGLIB_C_EXPORT int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties);
+
+/*!
+ * Returns the number of channels in the audio stream.
+ */
+TAGLIB_C_EXPORT int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties);
+
+/*******************************************************************************
+ * Special convenience ID3v2 functions
+ *******************************************************************************/
+
+typedef enum {
+  TagLib_ID3v2_Latin1,
+  TagLib_ID3v2_UTF16,
+  TagLib_ID3v2_UTF16BE,
+  TagLib_ID3v2_UTF8
+} TagLib_ID3v2_Encoding;
+
+/*!
+ * This sets the default encoding for ID3v2 frames that are written to tags.
+ */
+
+TAGLIB_C_EXPORT void taglib_id3v2_set_default_text_encoding(TagLib_ID3v2_Encoding encoding);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DO_NOT_DOCUMENT */
+#endif
diff --git a/lib-src/taglib/bindings/c/taglib_c.pc b/lib-src/taglib/bindings/c/taglib_c.pc
new file mode 100644
index 0000000..586bb39
--- /dev/null
+++ b/lib-src/taglib/bindings/c/taglib_c.pc
@@ -0,0 +1,11 @@
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: TagLib C Bindings
+Description: Audio meta-data library (C bindings)
+Requires: taglib
+Version: 1.5
+Libs: -L${libdir} -ltag_c
+Cflags: -I${includedir}/taglib 
diff --git a/lib-src/taglib/bindings/c/taglib_c.pc.cmake b/lib-src/taglib/bindings/c/taglib_c.pc.cmake
new file mode 100644
index 0000000..a48ae0a
--- /dev/null
+++ b/lib-src/taglib/bindings/c/taglib_c.pc.cmake
@@ -0,0 +1,12 @@
+prefix=${CMAKE_INSTALL_PREFIX}
+exec_prefix=${CMAKE_INSTALL_PREFIX}
+libdir=${LIB_INSTALL_DIR}
+includedir=${INCLUDE_INSTALL_DIR}
+
+
+Name: TagLib C Bindings
+Description: Audio meta-data library (C bindings)
+Requires: taglib
+Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
+Libs: -L${LIB_INSTALL_DIR} -ltag_c
+Cflags: -I=${INCLUDE_INSTALL_DIR}/taglib 
diff --git a/lib-src/taglib/bindings/c/taglib_c.pc.in b/lib-src/taglib/bindings/c/taglib_c.pc.in
new file mode 100644
index 0000000..01c63a6
--- /dev/null
+++ b/lib-src/taglib/bindings/c/taglib_c.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TagLib C Bindings
+Description: Audio meta-data library (C bindings)
+Requires: taglib
+Version: 1.5
+Libs: -L${libdir} -ltag_c
+Cflags: -I${includedir}/taglib 
diff --git a/lib-src/taglib/cmake/modules/FindCppUnit.cmake b/lib-src/taglib/cmake/modules/FindCppUnit.cmake
new file mode 100644
index 0000000..adaaeb6
--- /dev/null
+++ b/lib-src/taglib/cmake/modules/FindCppUnit.cmake
@@ -0,0 +1,69 @@
+# - Try to find the libcppunit libraries
+# Once done this will define
+#
+# CppUnit_FOUND - system has libcppunit
+# CPPUNIT_INCLUDE_DIR - the libcppunit include directory
+# CPPUNIT_LIBRARIES - libcppunit library
+
+include (MacroEnsureVersion)
+
+if(NOT CPPUNIT_MIN_VERSION)
+  SET(CPPUNIT_MIN_VERSION 1.12.0)
+endif(NOT CPPUNIT_MIN_VERSION)
+
+FIND_PROGRAM(CPPUNIT_CONFIG_EXECUTABLE cppunit-config )
+
+IF(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+    # in cache already
+    SET(CppUnit_FOUND TRUE)
+
+ELSE(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+    SET(CPPUNIT_INCLUDE_DIR)
+    SET(CPPUNIT_LIBRARIES)
+
+    IF(CPPUNIT_CONFIG_EXECUTABLE)
+        EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_CFLAGS)
+        EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_LIBRARIES)
+        EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION)
+        STRING(REGEX REPLACE "-I(.+)" "\\1" CPPUNIT_CFLAGS "${CPPUNIT_CFLAGS}")
+    ELSE(CPPUNIT_CONFIG_EXECUTABLE)
+        # in case win32 needs to find it the old way?
+        FIND_PATH(CPPUNIT_CFLAGS cppunit/TestRunner.h PATHS /usr/include /usr/local/include )
+        FIND_LIBRARY(CPPUNIT_LIBRARIES NAMES cppunit PATHS /usr/lib /usr/local/lib )
+        # how can we find cppunit version?
+        MESSAGE (STATUS "Ensure you cppunit installed version is at least ${CPPUNIT_MIN_VERSION}")
+        SET (CPPUNIT_INSTALLED_VERSION ${CPPUNIT_MIN_VERSION})
+    ENDIF(CPPUNIT_CONFIG_EXECUTABLE)
+
+    SET(CPPUNIT_INCLUDE_DIR ${CPPUNIT_CFLAGS} "${CPPUNIT_CFLAGS}/cppunit")
+
+ENDIF(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+IF(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+  SET(CppUnit_FOUND TRUE)
+
+  if(NOT CppUnit_FIND_QUIETLY)
+    MESSAGE (STATUS "Found cppunit: ${CPPUNIT_LIBRARIES}")
+  endif(NOT CppUnit_FIND_QUIETLY)
+
+  IF(CPPUNIT_CONFIG_EXECUTABLE)
+    EXEC_PROGRAM(${CPPUNIT_CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE CPPUNIT_INSTALLED_VERSION)
+  ENDIF(CPPUNIT_CONFIG_EXECUTABLE)
+
+  macro_ensure_version( ${CPPUNIT_MIN_VERSION} ${CPPUNIT_INSTALLED_VERSION} CPPUNIT_INSTALLED_VERSION_OK )
+
+  IF(NOT CPPUNIT_INSTALLED_VERSION_OK)
+    MESSAGE ("** CppUnit version is too old: found ${CPPUNIT_INSTALLED_VERSION} installed, ${CPPUNIT_MIN_VERSION} or major is required")
+    SET(CppUnit_FOUND FALSE)
+  ENDIF(NOT CPPUNIT_INSTALLED_VERSION_OK)
+
+ELSE(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+  SET(CppUnit_FOUND FALSE CACHE BOOL "Not found cppunit library")
+
+ENDIF(CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARIES)
+
+MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIR CPPUNIT_LIBRARIES)
diff --git a/lib-src/taglib/cmake/modules/MacroEnsureVersion.cmake b/lib-src/taglib/cmake/modules/MacroEnsureVersion.cmake
new file mode 100644
index 0000000..c6df537
--- /dev/null
+++ b/lib-src/taglib/cmake/modules/MacroEnsureVersion.cmake
@@ -0,0 +1,71 @@
+# This macro compares version numbers of the form "x.y.z"
+# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
+# will set FOO_VERSIN_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
+# where both have to be in a 3-part-version format, leading and trailing
+# text is ok, e.g.
+# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK)
+# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system
+
+# Copyright (c) 2006, David Faure, <faure at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
+
+    # parse the parts of the version string
+    STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_major_vers "${requested_version}")
+    STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" req_minor_vers "${requested_version}")
+    STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_patch_vers "${requested_version}")
+
+    STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
+    STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" found_minor_vers "${found_version}")
+    STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_patch_vers "${found_version}")
+
+    # compute an overall version number which can be compared at once
+    MATH(EXPR req_vers_num "${req_major_vers}*10000 + ${req_minor_vers}*100 + ${req_patch_vers}")
+    MATH(EXPR found_vers_num "${found_major_vers}*10000 + ${found_minor_vers}*100 + ${found_patch_vers}")
+
+    if (found_vers_num LESS req_vers_num)
+        set( ${var_too_old} FALSE )
+    else (found_vers_num LESS req_vers_num)
+        set( ${var_too_old} TRUE )
+    endif (found_vers_num LESS req_vers_num)
+
+ENDMACRO(MACRO_ENSURE_VERSION)
+
+
+# This macro compares version numbers of the form "x.y"
+# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
+# will set FOO_VERSIN_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
+# where both have to be in a 2-part-version format, leading and trailing
+# text is ok, e.g.
+# MACRO_ENSURE_VERSION( "0.5" "foo 0.6" VERSION_OK)
+# which means 0.5 is required and "foo 0.6" is what was found on the system
+
+# Copyright (c) 2006, David Faure, <faure at kde.org>
+# Copyright (c) 2007, Pino Toscano, <pino at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO(MACRO_ENSURE_VERSION2 requested_version found_version var_too_old)
+
+    # parse the parts of the version string
+    STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" req_major_vers "${requested_version}")
+    STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" req_minor_vers "${requested_version}")
+
+    STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
+    STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1" found_minor_vers "${found_version}")
+
+    # compute an overall version number which can be compared at once
+    MATH(EXPR req_vers_num "${req_major_vers}*100 + ${req_minor_vers}")
+    MATH(EXPR found_vers_num "${found_major_vers}*100 + ${found_minor_vers}")
+
+    if (found_vers_num LESS req_vers_num)
+        set( ${var_too_old} FALSE )
+    else (found_vers_num LESS req_vers_num)
+        set( ${var_too_old} TRUE )
+    endif (found_vers_num LESS req_vers_num)
+
+ENDMACRO(MACRO_ENSURE_VERSION2)
diff --git a/lib-src/taglib/config-taglib.h.cmake b/lib-src/taglib/config-taglib.h.cmake
new file mode 100644
index 0000000..69c1adb
--- /dev/null
+++ b/lib-src/taglib/config-taglib.h.cmake
@@ -0,0 +1,11 @@
+/* config-taglib.h. Generated by cmake from config-taglib.h.cmake */
+
+/* NOTE: only add something here if it is really needed by all of kdelibs.
+   Otherwise please prefer adding to the relevant config-foo.h.cmake file,
+   to minimize recompilations and increase modularity. */
+/* Define if you have libz */
+#cmakedefine   HAVE_ZLIB 1
+
+#cmakedefine   NO_ITUNES_HACKS 1
+#cmakedefine   WITH_ASF 1
+#cmakedefine   WITH_MP4 1
diff --git a/lib-src/taglib/config.h b/lib-src/taglib/config.h
new file mode 100644
index 0000000..5877a8f
--- /dev/null
+++ b/lib-src/taglib/config.h
@@ -0,0 +1,65 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* have cppunit */
+#define HAVE_CPPUNIT 0
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* have zlib */
+#define HAVE_ZLIB 1
+
+/* Suffix for lib directories */
+#define KDELIBSUFF ""
+
+/* Name of package */
+#define PACKAGE "taglib"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.4"
diff --git a/lib-src/taglib/config.h.in b/lib-src/taglib/config.h.in
new file mode 100644
index 0000000..a3c25d0
--- /dev/null
+++ b/lib-src/taglib/config.h.in
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* have cppunit */
+#undef HAVE_CPPUNIT
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* have zlib */
+#undef HAVE_ZLIB
+
+/* Suffix for lib directories */
+#undef KDELIBSUFF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/lib-src/taglib/configure b/lib-src/taglib/configure
new file mode 100755
index 0000000..a742507
--- /dev/null
+++ b/lib-src/taglib/configure
@@ -0,0 +1,24673 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "$0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="acinclude.m4"
+ac_default_prefix=/usr/local
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+TOPSUBDIRS
+build_tests_FALSE
+build_tests_TRUE
+link_zlib_FALSE
+link_zlib_TRUE
+AUTODIRS
+all_libraries
+all_includes
+KDE_CHECK_PLUGIN
+KDE_PLUGIN
+LIBTOOL
+ac_ct_F77
+FFLAGS
+F77
+RANLIB
+AR
+ECHO
+LN_S
+EGREP
+GREP
+KDE_USE_NMCHECK_FALSE
+KDE_USE_NMCHECK_TRUE
+KDE_NO_UNDEFINED
+KDE_USE_CLOSURE_FALSE
+KDE_USE_CLOSURE_TRUE
+KDE_USE_FINAL_FALSE
+KDE_USE_FINAL_TRUE
+LDFLAGS_NEW_DTAGS
+LDFLAGS_AS_NEEDED
+ENABLE_PERMISSIVE_FLAG
+NOOPT_CFLAGS
+NOOPT_CXXFLAGS
+CXXCPP
+USE_RTTI
+USE_EXCEPTIONS
+unsermake_enable_pch_FALSE
+unsermake_enable_pch_TRUE
+HAVE_GCC_VISIBILITY
+WOVERLOADED_VIRTUAL
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+CONF_FILES
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_fast_perl
+enable_debug
+enable_dummyoption
+enable_strict
+enable_warnings
+enable_profile
+enable_dependency_tracking
+enable_pch
+enable_coverage
+enable_new_ldflags
+enable_final
+enable_closure
+enable_nmcheck
+enable_shared
+enable_static
+enable_libsuffix
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+with_pic
+with_tags
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+F77
+FFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 | -n)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --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
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-fast-perl     disable fast Makefile generation (needs perl)
+  --enable-debug=ARG      enables debug symbols (yes|no|full) default=no
+  --disable-debug         disables debug output and debug symbols default=no
+  --enable-strict         compiles with strict compiler options (may not
+                          work!)
+  --disable-warnings      disables compilation with -Wall and similar
+  --enable-profile        creates profiling infos default=no
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-pch            enables precompiled header support (currently only
+                          KCC or gcc >=3.4+unsermake) default=no
+  --enable-coverage       use gcc coverage testing
+  --enable-new-ldflags    enable the new linker flags
+  --enable-final          build size optimized apps (experimental - needs lots
+                          of memory)
+  --enable-closure        delay template instantiation
+  --enable-nmcheck        enable automatic namespace cleanness check
+  --enable-shared[=PKGS]  build shared libraries [default=no]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-libsuffix      /lib directory suffix (64,32,none,auto=default)
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]      include additional configurations [automatic]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/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`
+/usr/bin/hostinfo      = `(/usr/bin/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`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# 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.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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_cache_corrupted=false
+for ac_var in $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_aux_dir=
+for ac_dir in admin "$srcdir"/admin; 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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in admin \"$srcdir\"/admin" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in admin \"$srcdir\"/admin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+unset CDPATH
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+
+am__api_version='1.10'
+
+
+
+          test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  # 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
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# 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"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /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
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&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}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    { $as_echo "$as_me:$LINENO: checking for -p flag to install" >&5
+$as_echo_n "checking for -p flag to install... " >&6; }
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  fi
+
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=taglib
+ VERSION=1.4
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+unset CDPATH
+
+
+if test "x$prefix" = "xNONE"; then
+  prefix=$ac_default_prefix
+  ac_configure_args="$ac_configure_args --prefix $prefix"
+fi
+
+    # Check whether --enable-fast-perl was given.
+if test "${enable_fast_perl+set}" = set; then
+  enableval=$enable_fast_perl; with_fast_perl=$enableval
+else
+  with_fast_perl=yes
+fi
+
+
+
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+
+  # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug;
+    case $enableval in
+      yes)
+        kde_use_debug_code="yes"
+        kde_use_debug_define=no
+        ;;
+      full)
+        kde_use_debug_code="full"
+        kde_use_debug_define=no
+        ;;
+      *)
+        kde_use_debug_code="no"
+        kde_use_debug_define=yes
+        ;;
+    esac
+
+else
+  kde_use_debug_code="no"
+      kde_use_debug_define=no
+
+fi
+
+
+    # Check whether --enable-dummyoption was given.
+if test "${enable_dummyoption+set}" = set; then
+  enableval=$enable_dummyoption;
+fi
+
+
+  # Check whether --enable-strict was given.
+if test "${enable_strict+set}" = set; then
+  enableval=$enable_strict;
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+
+else
+  kde_use_strict_options="no"
+fi
+
+
+  # Check whether --enable-warnings was given.
+if test "${enable_warnings+set}" = set; then
+  enableval=$enable_warnings;
+    if test $enableval = "no"; then
+         kde_use_warnings="no"
+       else
+         kde_use_warnings="yes"
+    fi
+
+else
+  kde_use_warnings="yes"
+fi
+
+
+    if test "$kde_use_debug_code" != "no"; then
+    kde_use_warnings=yes
+  fi
+
+  # Check whether --enable-profile was given.
+if test "${enable_profile+set}" = set; then
+  enableval=$enable_profile; kde_use_profiling=$enableval
+else
+  kde_use_profiling="no"
+
+fi
+
+
+    CFLAGS=" $CFLAGS"
+
+  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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+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
+
+
+  if test "$GCC" = "yes"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test $kde_use_debug_code = "full"; then
+        CFLAGS="-g3 -fno-inline $CFLAGS"
+      else
+        CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
+      fi
+    else
+      CFLAGS="-O2 $CFLAGS"
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CFLAGS="-DNDEBUG $CFLAGS"
+  fi
+
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
+  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
+  esac
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+  CXXFLAGS=" $CXXFLAGS"
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+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
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether $CC is blacklisted" >&5
+$as_echo_n "checking whether $CC is blacklisted... " >&6; }
+
+
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
+choke me
+#endif
+#endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  kde_bad_compiler=no
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	kde_bad_compiler=yes
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  { $as_echo "$as_me:$LINENO: result: $kde_bad_compiler" >&5
+$as_echo "$kde_bad_compiler" >&6; }
+
+if test "$kde_bad_compiler" = "yes"; then
+  { { $as_echo "$as_me:$LINENO: error:
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version.
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+" >&5
+$as_echo "$as_me: error:
+
+This particular compiler version is blacklisted because it
+is known to miscompile KDE. Please use a newer version, or
+if that is not yet available, choose an older version.
+
+Please do not report a bug or bother us reporting this
+configure error. We know about it, and we introduced
+it by intention to avoid untraceable bugs or crashes in KDE.
+
+" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+    if test "$kde_use_debug_code" != "no"; then
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
+      else
+        if test "$kde_use_debug_code" = "full"; then
+          CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
+        else
+          CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
+        fi
+      fi
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fno-builtin" >&5
+$as_echo_n "checking whether $CXX supports -fno-builtin... " >&6; }
+kde_cache=`echo fno-builtin | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-builtin"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="-fno-builtin $CXXFLAGS"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Woverloaded-virtual" >&5
+$as_echo_n "checking whether $CXX supports -Woverloaded-virtual... " >&6; }
+kde_cache=`echo Woverloaded-virtual | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Woverloaded-virtual"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ WOVERLOADED_VIRTUAL="-Woverloaded-virtual"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+ WOVERLOADED_VRITUAL=""
+fi
+
+
+    else
+      if test "$CXX" = "KCC"; then
+        CXXFLAGS="+K3 $CXXFLAGS"
+      else
+        CXXFLAGS="-O2 $CXXFLAGS"
+      fi
+    fi
+  fi
+
+  if test "$kde_use_debug_define" = "yes"; then
+    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
+  fi
+
+  if test "$kde_use_profiling" = "yes"; then
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -pg" >&5
+$as_echo_n "checking whether $CXX supports -pg... " >&6; }
+kde_cache=`echo pg | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -pg"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+
+      CFLAGS="-pg $CFLAGS"
+      CXXFLAGS="-pg $CXXFLAGS"
+
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+  fi
+
+  if test "$kde_use_warnings" = "yes"; then
+      if test "$GCC" = "yes"; then
+        CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
+        case $host in
+          *-*-linux-gnu)
+            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wmissing-format-attribute" >&5
+$as_echo_n "checking whether $CXX supports -Wmissing-format-attribute... " >&6; }
+kde_cache=`echo Wmissing-format-attribute | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wmissing-format-attribute"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CC supports -Wmissing-format-attribute" >&5
+$as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
+kde_cache=`echo Wmissing-format-attribute | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cc_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+  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
+
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Wmissing-format-attribute"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cc_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+          ;;
+        esac
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wundef" >&5
+$as_echo_n "checking whether $CXX supports -Wundef... " >&6; }
+kde_cache=`echo Wundef | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wundef"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="-Wundef $CXXFLAGS"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wno-long-long" >&5
+$as_echo_n "checking whether $CXX supports -Wno-long-long... " >&6; }
+kde_cache=`echo Wno-long-long | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wno-long-long"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="-Wno-long-long $CXXFLAGS"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wno-non-virtual-dtor" >&5
+$as_echo_n "checking whether $CXX supports -Wno-non-virtual-dtor... " >&6; }
+kde_cache=`echo Wno-non-virtual-dtor | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+     fi
+  fi
+
+  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
+    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+  fi
+
+  # Check whether --enable-pch was given.
+if test "${enable_pch+set}" = set; then
+  enableval=$enable_pch;  kde_use_pch=$enableval
+else
+   kde_use_pch=no
+fi
+
+
+  HAVE_GCC_VISIBILITY=0
+
+
+  if test "$GXX" = "yes"; then
+    gcc_no_reorder_blocks=NO
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fno-reorder-blocks" >&5
+$as_echo_n "checking whether $CXX supports -fno-reorder-blocks... " >&6; }
+kde_cache=`echo fno-reorder-blocks | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ gcc_no_reorder_blocks=YES
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+    if test $kde_use_debug_code != "no" && \
+       test $kde_use_debug_code != "full" && \
+       test "YES" = "$gcc_no_reorder_blocks" ; then
+          CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
+          CFLAGS="$CFLAGS -fno-reorder-blocks"
+    fi
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fno-exceptions" >&5
+$as_echo_n "checking whether $CXX supports -fno-exceptions... " >&6; }
+kde_cache=`echo fno-exceptions | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fno-check-new" >&5
+$as_echo_n "checking whether $CXX supports -fno-check-new... " >&6; }
+kde_cache=`echo fno-check-new | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-check-new"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS -fno-check-new"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fno-common" >&5
+$as_echo_n "checking whether $CXX supports -fno-common... " >&6; }
+kde_cache=`echo fno-common | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-common"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS -fno-common"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -fexceptions" >&5
+$as_echo_n "checking whether $CXX supports -fexceptions... " >&6; }
+kde_cache=`echo fexceptions | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fexceptions"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ USE_EXCEPTIONS="-fexceptions"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+ USE_EXCEPTIONS=
+fi
+
+    ENABLE_PERMISSIVE_FLAG="-fpermissive"
+
+    if test "$kde_use_pch" = "yes"; then
+        { $as_echo "$as_me:$LINENO: checking whether gcc supports precompiling c header files" >&5
+$as_echo_n "checking whether gcc supports precompiling c header files... " >&6; }
+        echo >conftest.h
+        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
+            kde_gcc_supports_pch=yes
+            { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+        else
+            kde_gcc_supports_pch=no
+            { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+        fi
+        if test "$kde_gcc_supports_pch" = "yes"; then
+            { $as_echo "$as_me:$LINENO: checking whether gcc supports precompiling c++ header files" >&5
+$as_echo_n "checking whether gcc supports precompiling c++ header files... " >&6; }
+            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
+                kde_gcc_supports_pch=yes
+                { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+            else
+                kde_gcc_supports_pch=no
+                { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+            fi
+        fi
+        rm -f conftest.h conftest.h.gch
+    fi
+
+
+  { $as_echo "$as_me:$LINENO: checking whether system headers can cope with -O2 -fno-inline" >&5
+$as_echo_n "checking whether system headers can cope with -O2 -fno-inline... " >&6; }
+if test "${kde_cv_opt_noinline_match+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+  kde_cv_opt_noinline_match=irrelevant
+    if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
+     && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
+
+    ac_cflags_save="$CFLAGS"
+    CFLAGS="$CFLAGS -D_USE_GNU"
+
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  #include <string.h>
+
+int
+main ()
+{
+  const char *pt, *et;
+  et = __extension__      ({ char __a0, __a1, __a2;       (__builtin_constant_p (  ";,"  ) && ((size_t)(const void *)((   ";,"   )+ 1) - (size_t)(const void *)(   ";,"   ) == 1)        ? ((__a0 =((__const char  *) (  ";,"  ))[0], __a0 == '\0')     ? ((void) (  pt ),((void *)0) )        : ((__a1 = ((__const char *) (  ";,"  ))[1], __a1== '\0')      ? (__extension__ (__builtin_constant_p (  __a0 ) && ( __a0 ) == '\0'   ? (char *) __rawmemchr (   pt  ,   __a0)       : strchr(   pt  ,   __a0 )))   : ((__a2 = ((__const char *) (  ";,"  ))[2], __a2 == '\0')      ? __strpbrk_c2 (  pt , __a0, __a1)      :(((__const char *) (  ";,"  ))[3] == '\0'     ? __strpbrk_c3 (  pt ,__a0, __a1, __a2): strpbrk (  pt ,   ";,"  ))))) : strpbrk (  pt ,  ";,"  )); }) ;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  kde_cv_opt_noinline_match=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	kde_cv_opt_noinline_match=no
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+    CFLAGS="$ac_cflags_save"
+  fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $kde_cv_opt_noinline_match" >&5
+$as_echo "$kde_cv_opt_noinline_match" >&6; }
+
+    if test "x$kde_cv_opt_noinline_match" = "xno" ; then
+       CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
+    fi
+  fi
+   if test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes"; then
+  unsermake_enable_pch_TRUE=
+  unsermake_enable_pch_FALSE='#'
+else
+  unsermake_enable_pch_TRUE='#'
+  unsermake_enable_pch_FALSE=
+fi
+
+  if test "$CXX" = "KCC"; then
+
+    if test "$kde_use_pch" = "yes"; then
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --pch" >&5
+$as_echo_n "checking whether $CXX supports --pch... " >&6; }
+kde_cache=`echo -pch | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --pch"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --pch"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+                                              fi
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --inline_keyword_space_time=6" >&5
+$as_echo_n "checking whether $CXX supports --inline_keyword_space_time=6... " >&6; }
+kde_cache=`echo -inline_keyword_space_time=6 | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --inline_auto_space_time=2" >&5
+$as_echo_n "checking whether $CXX supports --inline_auto_space_time=2... " >&6; }
+kde_cache=`echo -inline_auto_space_time=2 | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --inline_implicit_space_time=2.0" >&5
+$as_echo_n "checking whether $CXX supports --inline_implicit_space_time=2.0... " >&6; }
+kde_cache=`echo -inline_implicit_space_time=2.0 | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --inline_generated_space_time=2.0" >&5
+$as_echo_n "checking whether $CXX supports --inline_generated_space_time=2.0... " >&6; }
+kde_cache=`echo -inline_generated_space_time=2.0 | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports --one_per" >&5
+$as_echo_n "checking whether $CXX supports --one_per... " >&6; }
+kde_cache=`echo -one_per | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS --one_per"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ CXXFLAGS="$CXXFLAGS --one_per"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+  fi
+
+    USE_RTTI=
+
+
+  case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
+      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
+      *-*-solaris*)
+        if test "$GXX" = yes; then
+          libstdcpp=`$CXX -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             { { $as_echo "$as_me:$LINENO: error: You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so" >&5
+$as_echo "$as_me: error: You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so" >&2;}
+   { (exit 1); exit 1; }; }
+          fi
+        fi
+        ;;
+  esac
+
+  if test "x$kde_use_qt_emb" != "xyes"; then
+  __val=$CXX
+  __forbid=" -fno-rtti -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) { $as_echo "$as_me:$LINENO: WARNING: found forbidden $i in CXX, removing it" >&5
+$as_echo "$as_me: WARNING: found forbidden $i in CXX, removing it" >&2;} ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXX=$__new
+  fi
+
+  __val=$CXXFLAGS
+  __forbid=" -fno-rtti -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) { $as_echo "$as_me:$LINENO: WARNING: found forbidden $i in CXXFLAGS, removing it" >&5
+$as_echo "$as_me: WARNING: found forbidden $i in CXXFLAGS, removing it" >&2;} ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXXFLAGS=$__new
+  fi
+
+else
+  __val=$CXX
+  __forbid=" -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) { $as_echo "$as_me:$LINENO: WARNING: found forbidden $i in CXX, removing it" >&5
+$as_echo "$as_me: WARNING: found forbidden $i in CXX, removing it" >&2;} ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXX=$__new
+  fi
+
+  __val=$CXXFLAGS
+  __forbid=" -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) { $as_echo "$as_me:$LINENO: WARNING: found forbidden $i in CXXFLAGS, removing it" >&5
+$as_echo "$as_me: WARNING: found forbidden $i in CXXFLAGS, removing it" >&2;} ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXXFLAGS=$__new
+  fi
+
+fi
+
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+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
+
+
+  if test "$GCC" = yes; then
+     NOOPT_CFLAGS=-O0
+  fi
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -O0" >&5
+$as_echo_n "checking whether $CXX supports -O0... " >&6; }
+kde_cache=`echo O0 | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -O0"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ NOOPT_CXXFLAGS=-O0
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+  # Check whether --enable-coverage was given.
+if test "${enable_coverage+set}" = set; then
+  enableval=$enable_coverage;
+      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker="-lgcc"
+      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
+        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
+        ac_coverage_linker=""
+      else
+        { { $as_echo "$as_me:$LINENO: error: coverage with your compiler is not supported" >&5
+$as_echo "$as_me: error: coverage with your compiler is not supported" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      CFLAGS="$CFLAGS $ac_coverage_compiler"
+      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
+      LDFLAGS="$LDFLAGS $ac_coverage_linker"
+
+fi
+
+
+
+
+
+
+
+  # Check whether --enable-new_ldflags was given.
+if test "${enable_new_ldflags+set}" = set; then
+  enableval=$enable_new_ldflags; kde_use_new_ldflags=$enableval
+else
+  kde_use_new_ldflags=no
+fi
+
+
+  LDFLAGS_AS_NEEDED=""
+  LDFLAGS_NEW_DTAGS=""
+  if test "x$kde_use_new_ldflags" = "xyes"; then
+       LDFLAGS_NEW_DTAGS=""
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wl,--enable-new-dtags" >&5
+$as_echo_n "checking whether $CXX supports -Wl,--enable-new-dtags... " >&6; }
+kde_cache=`echo Wl,--enable-new-dtags | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wl,--enable-new-dtags"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wl,--as-needed" >&5
+$as_echo_n "checking whether $CXX supports -Wl,--as-needed... " >&6; }
+kde_cache=`echo Wl,--as-needed | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wl,--as-needed"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ LDFLAGS_AS_NEEDED="-Wl,--as-needed"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+fi
+
+  fi
+
+
+
+
+  # Check whether --enable-final was given.
+if test "${enable_final+set}" = set; then
+  enableval=$enable_final; kde_use_final=$enableval
+else
+  kde_use_final=no
+fi
+
+
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+
+
+
+
+  # Check whether --enable-closure was given.
+if test "${enable_closure+set}" = set; then
+  enableval=$enable_closure; kde_use_closure=$enableval
+else
+  kde_use_closure=no
+fi
+
+
+  KDE_NO_UNDEFINED=""
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+       KDE_NO_UNDEFINED=""
+       case $host in
+         *-*-linux-gnu)
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wl,--no-undefined" >&5
+$as_echo_n "checking whether $CXX supports -Wl,--no-undefined... " >&6; }
+kde_cache=`echo Wl,--no-undefined | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wl,--no-undefined"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+
+{ $as_echo "$as_me:$LINENO: checking whether $CXX supports -Wl,--allow-shlib-undefined" >&5
+$as_echo_n "checking whether $CXX supports -Wl,--allow-shlib-undefined... " >&6; }
+kde_cache=`echo Wl,--allow-shlib-undefined | sed 'y% .=/+-,%____p__%'`
+if { as_var=kde_cv_prog_cxx_$kde_cache; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+
+
+   ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -Wl,--allow-shlib-undefined"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "kde_cv_prog_cxx_$kde_cache=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$save_CXXFLAGS"
+  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
+
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+ KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+ KDE_NO_UNDEFINED=""
+fi
+
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ :
+ KDE_NO_UNDEFINED=""
+fi
+
+           ;;
+       esac
+  fi
+
+
+
+
+
+  # Check whether --enable-nmcheck was given.
+if test "${enable_nmcheck+set}" = set; then
+  enableval=$enable_nmcheck; kde_use_nmcheck=$enableval
+else
+  kde_use_nmcheck=no
+fi
+
+
+  if test "$kde_use_nmcheck" = "yes"; then
+      KDE_USE_NMCHECK_TRUE=""
+      KDE_USE_NMCHECK_FALSE="#"
+   else
+      KDE_USE_NMCHECK_TRUE="#"
+      KDE_USE_NMCHECK_FALSE=""
+  fi
+
+
+
+
+
+
+
+CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=no
+fi
+
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+    # Check whether --enable-libsuffix was given.
+if test "${enable_libsuffix+set}" = set; then
+  enableval=$enable_libsuffix; kdelibsuff=$enableval
+else
+  kdelibsuff="auto"
+fi
+
+
+    if test "$kdelibsuff" = "auto"; then
+
+cat > conftest.c << EOF
+#include <stdio.h>
+int main() {
+ return 0;
+}
+EOF
+        kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
+    s,.*/lib\([^\/]*\)/.*,\1,
+    p
+}'`
+	rm -rf conftest.*
+    fi
+
+    if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
+       kdelibsuff=
+    fi
+    if test -z "$kdelibsuff"; then
+        { $as_echo "$as_me:$LINENO: result: not using lib directory suffix" >&5
+$as_echo "not using lib directory suffix" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define KDELIBSUFF ""
+_ACEOF
+
+    else
+        if test "$libdir" = '${exec_prefix}/lib'; then
+            libdir="$libdir${kdelibsuff}"
+            libdir="$libdir"
+          fi
+
+cat >>confdefs.h <<_ACEOF
+#define KDELIBSUFF "${kdelibsuff}"
+_ACEOF
+
+        { $as_echo "$as_me:$LINENO: result: using lib directory suffix $kdelibsuff" >&5
+$as_echo "using lib directory suffix $kdelibsuff" >&6; }
+    fi
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && break
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+{ $as_echo "$as_me:$LINENO: result: $SED" >&5
+$as_echo "$SED" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+
+{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+$as_echo_n "checking for BSD-compatible nm... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+        ;;
+      *)
+	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	*/dev/null*)
+	  lt_cv_path_NM="$tmp_nm -p"
+	  break
+	  ;;
+	*)
+	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	  continue # so that we can try to find one that supports BSD flags
+	  ;;
+	esac
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+$as_echo_n "checking how to recognise dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+mingw* | pw32*)
+  # win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='win32_libid'
+  ;;
+
+darwin* | rhapsody*)
+  # this will be overwritten by pass_all, but leave it in just in case
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.[012])
+    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case "$host_cpu" in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+  irix5* | nonstopux*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  # the debian people say, arm and glibc 2.3.1 works for them with pass_all
+  arm* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 8306 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      LINUX_64_MODE="32"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      LINUX_64_MODE="64"
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  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
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  lt_cv_cc_needs_belf=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	lt_cv_cc_needs_belf=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     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
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+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
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  testring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+ *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
+	       = "XX$testring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$testring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      testring=$testring$testring
+    done
+    testring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGISTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=yes
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+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
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { $as_echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+$as_echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+    { $as_echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+$as_echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+$as_echo_n "checking if $compiler static flag $lt_prog_compiler_static works... " >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+$as_echo "$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:10059: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:10063: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:10292: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:10296: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+$as_echo "$lt_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:10359: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:10363: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=no
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+
+	# KDE requires run time linking.  Make it the default.
+	aix_use_runtimelinking=yes
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.012|aix4.012.*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  fi
+	esac
+	shared_flag='-shared'
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+  	if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='-qmkshrobj ${wl}-G'
+	  else
+	    shared_flag='-qmkshrobj'
+  	fi
+	fi
+      fi
+
+      # Let the compiler handle the export list.
+      always_export_symbols=no
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_cmds="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec=' '
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag='-Wl,-undefined -Wl,suppress'
+	;;
+      *) # Darwin 1.3 on
+	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	  allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	else
+	  case ${MACOSX_DEPLOYMENT_TARGET} in
+	    10.012)
+	      allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	      ;;
+	    10.*)
+	      allow_undefined_flag='-Wl,-undefined -Wl,dynamic_lookup'
+	      ;;
+	  esac
+	fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+      fi
+      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec='-all_load $convenience'
+      link_all_deplibs=yes
+    else
+      ld_shlibs=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	esac
+      else
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+      else
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.01* | freebsdelf3.01*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var " || \
+   test "X$hardcode_automatic"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+       ;;
+   *)
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12481 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12579 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# Report which librarie types wil actually be built
+{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+  darwin* | rhapsody*)
+  if test "$GCC" = yes; then
+    archive_cmds_need_lc=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.012)
+	    allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    allow_undefined_flag='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    output_verbose_link_cmd='echo'
+    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct=no
+    hardcode_automatic=yes
+    hardcode_shlibpath_var=unsupported
+    whole_archive_flag_spec='-all_load $convenience'
+    link_all_deplibs=yes
+  else
+    ld_shlibs=no
+  fi
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { $as_echo "$as_me:$LINENO: creating $ofile" >&5
+$as_echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+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
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+  withval=$with_tags; tagnames="$withval"
+fi
+
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+$as_echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+$as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    archive_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+	grep 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    archive_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      # KDE requires run time linking.  Make it the default.
+      aix_use_runtimelinking=yes
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.012|aix4.012.*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	fi
+      esac
+      shared_flag='-shared'
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	shared_flag='-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='-qmkshrobj ${wl}-G'
+	else
+	  shared_flag='-qmkshrobj'
+	fi
+      fi
+    fi
+
+    # Let the compiler handle the export list.
+    always_export_symbols_CXX=no
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_cmds_CXX="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# -bexpall does not export symbols beginning with underscore (_)
+	always_export_symbols_CXX=yes
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX=' '
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds it's shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=no
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname.def;
+      else
+	echo EXPORTS > $output_objdir/$soname.def;
+	cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+
+  darwin* | rhapsody*)
+  if test "$GXX" = yes; then
+    archive_cmds_need_lc_CXX=no
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag_CXX='-Wl,-undefined -Wl,suppress'
+      ;;
+    *) # Darwin 1.3 on
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	allow_undefined_flag_CXX='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+      else
+	case ${MACOSX_DEPLOYMENT_TARGET} in
+	  10.012)
+	    allow_undefined_flag_CXX='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	    ;;
+	  10.*)
+	    allow_undefined_flag_CXX='-Wl,-undefined -Wl,dynamic_lookup'
+	    ;;
+	esac
+      fi
+      ;;
+    esac
+    lt_int_apple_cc_single_mod=no
+    output_verbose_link_cmd='echo'
+    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+      lt_int_apple_cc_single_mod=yes
+    fi
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    else
+      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+    fi
+    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+
+    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    hardcode_direct_CXX=no
+    hardcode_automatic_CXX=yes
+    hardcode_shlibpath_var_CXX=unsupported
+    whole_archive_flag_spec_CXX='-all_load $convenience'
+    link_all_deplibs_CXX=yes
+  else
+    ld_shlibs_CXX=no
+  fi
+    ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd12*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=yes # Not in the search PATH,
+				# but as the default
+				# location of the library.
+
+    case $cc_basename in
+    CC)
+      # FIXME: insert proper C++ library support
+      ld_shlibs_CXX=no
+      ;;
+    aCC)
+      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+	hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      aCC)
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	  ;;
+	esac
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case "$host_cpu" in
+	    ia64*|hppa*64*)
+	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	      ;;
+	    esac
+	  fi
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	# Archives containing C++ object files must be created using
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc)
+	# Intel C++
+	with_gnu_ld=yes
+	archive_cmds_need_lc_CXX=no
+	archive_cmds_CXX='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      cxx)
+	# Compaq C++
+	archive_cmds_CXX='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	runpath_var=LD_RUN_PATH
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	  echo "-hidden">> $lib.exp~
+	  $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+	# Sun C++ 4.2, 5.x and Centerline C++
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
+	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=yes
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	# Archives containing C++ object files must be created using
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+
+	# The C++ compiler must be used to create the archive.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  else
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	    # platform.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  fi
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+	  || test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext|*.$libext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    case "$host_cpu" in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  cxx)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      sco*)
+	case $cc_basename in
+	  CC)
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      unixware*)
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:14748: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:14752: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:14815: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:14819: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+$as_echo "$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.01* | freebsdelf3.01*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var CXX" || \
+   test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+       ;;
+   *)
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 16146 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 16244 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+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
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+$as_echo "$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:17067: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:17071: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+$as_echo "$lt_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:17134: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:17138: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=no
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+
+	# KDE requires run time linking.  Make it the default.
+	aix_use_runtimelinking=yes
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.012|aix4.012.*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	esac
+	shared_flag='-shared'
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+  	if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='-qmkshrobj ${wl}-G'
+	  else
+	    shared_flag='-qmkshrobj'
+  	fi
+	fi
+      fi
+
+      # Let the compiler handle the export list.
+      always_export_symbols_F77=no
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_cmds_F77="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_F77=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77=' '
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_F77='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_F77=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_F77='-Wl,-undefined -Wl,suppress'
+	;;
+      *) # Darwin 1.3 on
+	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	  allow_undefined_flag_F77='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	else
+	  case ${MACOSX_DEPLOYMENT_TARGET} in
+	    10.012)
+	      allow_undefined_flag_F77='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	      ;;
+	    10.*)
+	      allow_undefined_flag_F77='-Wl,-undefined -Wl,dynamic_lookup'
+	      ;;
+	  esac
+	fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+      fi
+      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77='-all_load $convenience'
+      link_all_deplibs_F77=yes
+    else
+      ld_shlibs_F77=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_F77='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	esac
+      else
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_F77=:
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+      else
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+$as_echo "$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+$as_echo "$archive_cmds_need_lc_F77" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.01* | freebsdelf3.01*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var F77" || \
+   test "X$hardcode_automatic_F77"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+       ;;
+   *)
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+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
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:19110: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:19114: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $CC in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+$as_echo "$lt_prog_compiler_pic_GCJ" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; }
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:19343: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:19347: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+$as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+   # that will create temporary files in the current directory regardless of
+   # the output directory.  Thus, making CWD read-only will cause this test
+   # to fail, enabling locking or at least warning the user not to do parallel
+   # builds.
+   chmod -w .
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:19410: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:19414: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest* out/*
+   rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=no
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+
+	# KDE requires run time linking.  Make it the default.
+	aix_use_runtimelinking=yes
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.012|aix4.012.*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  fi
+	esac
+	shared_flag='-shared'
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+  	if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='-qmkshrobj ${wl}-G'
+	  else
+	    shared_flag='-qmkshrobj'
+  	fi
+	fi
+      fi
+
+      # Let the compiler handle the export list.
+      always_export_symbols_GCJ=no
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_cmds_GCJ="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # -bexpall does not export symbols beginning with underscore (_)
+	  always_export_symbols_GCJ=yes
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ=' '
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds it's shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi4*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=no
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_GCJ='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+    if test "$GXX" = yes ; then
+      archive_cmds_need_lc_GCJ=no
+      case "$host_os" in
+      rhapsody* | darwin1.[012])
+	allow_undefined_flag_GCJ='-Wl,-undefined -Wl,suppress'
+	;;
+      *) # Darwin 1.3 on
+	if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+	  allow_undefined_flag_GCJ='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	else
+	  case ${MACOSX_DEPLOYMENT_TARGET} in
+	    10.012)
+	      allow_undefined_flag_GCJ='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
+	      ;;
+	    10.*)
+	      allow_undefined_flag_GCJ='-Wl,-undefined -Wl,dynamic_lookup'
+	      ;;
+	  esac
+	fi
+	;;
+      esac
+    	lt_int_apple_cc_single_mod=no
+    	output_verbose_link_cmd='echo'
+    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+    	  lt_int_apple_cc_single_mod=yes
+    	fi
+    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
+    	else
+        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
+      fi
+      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        else
+          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+        fi
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      link_all_deplibs_GCJ=yes
+    else
+      ld_shlibs_GCJ=no
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu)
+      archive_cmds_GCJ='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
+	  ;;
+	esac
+      else
+	case "$host_cpu" in
+	hppa*64*|ia64*)
+	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	case "$host_cpu" in
+	hppa*64*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	ia64*)
+	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	*)
+	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_GCJ=:
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
+      else
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      esac
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+$as_echo "$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+$as_echo "$archive_cmds_need_lc_GCJ" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.01* | freebsdelf3.01*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  libsuff=
+  if test "x$LINUX_64_MODE" = x64; then
+    # Some platforms are per default 64-bit, so there's no /lib64
+    if test -d /lib64 -a ! -h /lib64; then
+      libsuff=64
+    fi
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
+  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var GCJ" || \
+   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+$as_echo "$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+       ;;
+   *)
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 21532 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 21630 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+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
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+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
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+$as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+$as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
+
+
+# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
+KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
+
+
+# we patch configure quite some so we better keep that consistent for incremental runs
+AUTOCONF='$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure'
+
+
+
+
+
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+
+
+
+
+
+#AM_INIT_AUTOMAKE(taglib,1.0)
+
+
+
+
+
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5
+$as_echo_n "checking zlib.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <zlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5
+$as_echo_n "checking zlib.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <zlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_zlib_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
+
+fi
+if test "x$ac_cv_header_zlib_h" = x""yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZLIB 1
+_ACEOF
+
+        have_zlib=true
+
+else
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZLIB 0
+_ACEOF
+
+        have_zlib=false
+
+fi
+
+
+ if test x$have_zlib = xtrue; then
+  link_zlib_TRUE=
+  link_zlib_FALSE='#'
+else
+  link_zlib_TRUE='#'
+  link_zlib_FALSE=
+fi
+
+
+
+
+
+
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+
+if test "${ac_cv_header_cppunit_extensions_HelperMacros_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for cppunit/extensions/HelperMacros.h" >&5
+$as_echo_n "checking for cppunit/extensions/HelperMacros.h... " >&6; }
+if test "${ac_cv_header_cppunit_extensions_HelperMacros_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cppunit_extensions_HelperMacros_h" >&5
+$as_echo "$ac_cv_header_cppunit_extensions_HelperMacros_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking cppunit/extensions/HelperMacros.h usability" >&5
+$as_echo_n "checking cppunit/extensions/HelperMacros.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <cppunit/extensions/HelperMacros.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking cppunit/extensions/HelperMacros.h presence" >&5
+$as_echo_n "checking cppunit/extensions/HelperMacros.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <cppunit/extensions/HelperMacros.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cppunit/extensions/HelperMacros.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: cppunit/extensions/HelperMacros.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for cppunit/extensions/HelperMacros.h" >&5
+$as_echo_n "checking for cppunit/extensions/HelperMacros.h... " >&6; }
+if test "${ac_cv_header_cppunit_extensions_HelperMacros_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_cppunit_extensions_HelperMacros_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cppunit_extensions_HelperMacros_h" >&5
+$as_echo "$ac_cv_header_cppunit_extensions_HelperMacros_h" >&6; }
+
+fi
+if test "x$ac_cv_header_cppunit_extensions_HelperMacros_h" = x""yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CPPUNIT 1
+_ACEOF
+
+        have_cppunit=true
+
+else
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CPPUNIT 0
+_ACEOF
+
+        have_cppunit=false
+
+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
+
+ if test x$have_cppunit = xtrue; then
+  build_tests_TRUE=
+  build_tests_FALSE='#'
+else
+  build_tests_TRUE='#'
+  build_tests_FALSE=
+fi
+
+
+
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+TOPSUBDIRS=""
+
+if test ! -s $srcdir/subdirs; then
+    files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+ac_topsubdirs=
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+elif test -s $srcdir/subdirs; then
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  { $as_echo "$as_me:$LINENO: checking if $i should be compiled" >&5
+$as_echo_n "checking if $i should be compiled... " >&6; }
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  { $as_echo "$as_me:$LINENO: result: $install_it" >&5
+$as_echo "$install_it" >&6; }
+  vari=`echo $i | sed -e 's,[-+.@],_,g'`
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+    eval "$vari""_SUBDIR_included=yes"
+  else
+    eval "$vari""_SUBDIR_included=no"
+  fi
+done
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+ac_config_files="$ac_config_files bindings/Makefile"
+
+ac_config_files="$ac_config_files bindings/c/Makefile"
+
+ac_config_files="$ac_config_files examples/Makefile"
+
+ac_config_files="$ac_config_files taglib/Makefile"
+
+ac_config_files="$ac_config_files taglib/ape/Makefile"
+
+ac_config_files="$ac_config_files taglib/asf/Makefile"
+
+ac_config_files="$ac_config_files taglib/flac/Makefile"
+
+ac_config_files="$ac_config_files taglib/mp4/Makefile"
+
+ac_config_files="$ac_config_files taglib/mpc/Makefile"
+
+ac_config_files="$ac_config_files taglib/mpeg/Makefile"
+
+ac_config_files="$ac_config_files taglib/mpeg/id3v1/Makefile"
+
+ac_config_files="$ac_config_files taglib/mpeg/id3v2/Makefile"
+
+ac_config_files="$ac_config_files taglib/mpeg/id3v2/frames/Makefile"
+
+ac_config_files="$ac_config_files taglib/ogg/Makefile"
+
+ac_config_files="$ac_config_files taglib/ogg/flac/Makefile"
+
+ac_config_files="$ac_config_files taglib/ogg/speex/Makefile"
+
+ac_config_files="$ac_config_files taglib/ogg/vorbis/Makefile"
+
+ac_config_files="$ac_config_files taglib/riff/Makefile"
+
+ac_config_files="$ac_config_files taglib/riff/aiff/Makefile"
+
+ac_config_files="$ac_config_files taglib/riff/wav/Makefile"
+
+ac_config_files="$ac_config_files taglib/toolkit/Makefile"
+
+ac_config_files="$ac_config_files taglib/trueaudio/Makefile"
+
+ac_config_files="$ac_config_files taglib/wavpack/Makefile"
+
+ac_config_files="$ac_config_files tests/Makefile"
+
+ac_config_files="$ac_config_files taglib-config"
+
+ac_config_files="$ac_config_files taglib.pc"
+
+ac_config_files="$ac_config_files bindings/c/taglib_c.pc"
+
+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 overridden 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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${unsermake_enable_pch_TRUE}" && test -z "${unsermake_enable_pch_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"unsermake_enable_pch\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"unsermake_enable_pch\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${link_zlib_TRUE}" && test -z "${link_zlib_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"link_zlib\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"link_zlib\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${build_tests_TRUE}" && test -z "${build_tests_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"build_tests\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"build_tests\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# 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
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -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
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;;
+    "bindings/c/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/c/Makefile" ;;
+    "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+    "taglib/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/Makefile" ;;
+    "taglib/ape/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/ape/Makefile" ;;
+    "taglib/asf/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/asf/Makefile" ;;
+    "taglib/flac/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/flac/Makefile" ;;
+    "taglib/mp4/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mp4/Makefile" ;;
+    "taglib/mpc/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mpc/Makefile" ;;
+    "taglib/mpeg/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mpeg/Makefile" ;;
+    "taglib/mpeg/id3v1/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mpeg/id3v1/Makefile" ;;
+    "taglib/mpeg/id3v2/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mpeg/id3v2/Makefile" ;;
+    "taglib/mpeg/id3v2/frames/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/mpeg/id3v2/frames/Makefile" ;;
+    "taglib/ogg/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/ogg/Makefile" ;;
+    "taglib/ogg/flac/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/ogg/flac/Makefile" ;;
+    "taglib/ogg/speex/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/ogg/speex/Makefile" ;;
+    "taglib/ogg/vorbis/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/ogg/vorbis/Makefile" ;;
+    "taglib/riff/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/riff/Makefile" ;;
+    "taglib/riff/aiff/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/riff/aiff/Makefile" ;;
+    "taglib/riff/wav/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/riff/wav/Makefile" ;;
+    "taglib/toolkit/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/toolkit/Makefile" ;;
+    "taglib/trueaudio/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/trueaudio/Makefile" ;;
+    "taglib/wavpack/Makefile") CONFIG_FILES="$CONFIG_FILES taglib/wavpack/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "taglib-config") CONFIG_FILES="$CONFIG_FILES taglib-config" ;;
+    "taglib.pc") CONFIG_FILES="$CONFIG_FILES taglib.pc" ;;
+    "bindings/c/taglib_c.pc") CONFIG_FILES="$CONFIG_FILES bindings/c/taglib_c.pc" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# 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
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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 by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+if test "x$have_zlib" = "xfalse"; then
+	echo "**************************************************"
+	echo "*"
+	echo "* You don't seem to have libz / zlib.h installed."
+	echo "* Compressed frames have been disabled."
+	echo "*"
+	echo "**************************************************"
+fi
+# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
+if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
+  # And if so, warn when they don't match
+  if test "$kde_libs_prefix" != "$given_prefix"; then
+    # And if kde doesn't know about the prefix yet
+    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
+    if test $? -ne 0; then
+      echo ""
+      echo "Warning: you chose to install this package in $given_prefix,"
+      echo "but KDE was found in $kde_libs_prefix."
+      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
+      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
+      echo "Then restart KDE."
+      echo ""
+    fi
+  fi
+fi
+
+if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
+  echo ""
+  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
+  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
+  echo ""
+  echo "For better performance, consider including the Qt visibility supporting patch"
+  echo "located at:"
+  echo ""
+  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
+  echo ""
+  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
+  echo "everything will continue to work just fine without it."
+  echo ""
+fi
+
+if test "$all_tests" = "bad"; then
+  if test ! "$cache_file" = "/dev/null"; then
+    echo ""
+    echo "Please remove the file $cache_file after changing your setup"
+    echo "so that configure will find the changes next time."
+    echo ""
+  fi
+else
+  echo ""
+  echo "Good - your configure finished. Start make now"
+  echo ""
+fi
diff --git a/lib-src/taglib/configure.files b/lib-src/taglib/configure.files
new file mode 100644
index 0000000..ad8f660
--- /dev/null
+++ b/lib-src/taglib/configure.files
@@ -0,0 +1,3 @@
+configure.in.in
+./bindings/c/configure.in.in
+configure.in.bot
diff --git a/lib-src/taglib/configure.in b/lib-src/taglib/configure.in
new file mode 100644
index 0000000..6bd9b09
--- /dev/null
+++ b/lib-src/taglib/configure.in
@@ -0,0 +1,225 @@
+dnl =======================================================
+dnl FILE: configure.in.in
+dnl =======================================================
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 2001 Stephan Kulow (coolo at kde.org)
+dnl                       modified by Walter Tasin (tasin at kdevelop.org)
+dnl                       for c++ console applications
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl    Boston, MA 02111-1307, USA.
+
+# Original Author was Kalle at kde.org
+# I lifted it in some mater. (Stephan Kulow)
+# I used much code from Janos Farkas
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
+
+dnl This is so we can use kde-common
+AC_CONFIG_AUX_DIR(admin)
+
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
+unset CDPATH
+
+dnl Checking host/target/build systems, for make, install etc.
+AC_CANONICAL_SYSTEM
+dnl Perform program name transformation
+AC_ARG_PROGRAM
+
+dnl Automake doc recommends to do this only here. (Janos)
+AM_INIT_AUTOMAKE(taglib,1.4)
+
+dnl almost the same like KDE_SET_PEFIX but the path is /usr/local
+dnl
+unset CDPATH
+dnl make /usr/local the default for the installation
+AC_PREFIX_DEFAULT(/usr/local)
+
+if test "x$prefix" = "xNONE"; then
+  prefix=$ac_default_prefix
+  ac_configure_args="$ac_configure_args --prefix $prefix"
+fi
+KDE_FAST_CONFIGURE
+KDE_CONF_FILES
+
+dnl without this order in this file, automake will be confused!
+dnl
+AM_CONFIG_HEADER(config.h)
+
+dnl checks for programs.
+dnl first check for c/c++ compilers
+AC_CHECK_COMPILERS
+
+dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
+dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
+CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
+
+dnl create only shared libtool-libraries
+AC_ENABLE_SHARED(no)
+
+dnl set the following to yes, if you want to create static
+dnl libtool-libraries, too.
+AC_ENABLE_STATIC(yes)
+
+dnl create a working libtool-script
+KDE_PROG_LIBTOOL
+
+dnl activate the next macro call for DLOPEN tests and setting LIBDL
+dnl   (n.b. KDE_MISC_TESTS does the same to you, so use either this or the next one)
+dnl KDE_CHECK_DLOPEN
+
+dnl activate the next macro call for some additional tests
+dnl   (compat, crypt, socket, nsl, dlopen, ...)
+dnl KDE_MISC_TESTS dnl __kdevelop__
+
+dnl KDE_NEED_FLEX dnl __kdevelop__
+dnl AC_PROG_YACC dnl __kdevelop__
+
+dnl KDE_CHECK_EXTRA_LIBS
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+AC_SUBST(AUTODIRS)
+
+#AM_INIT_AUTOMAKE(taglib,1.0)
+dnl don't remove the below
+dnl AC_OUTPUT(taglib-config)
+dnl AC_OUTPUT(taglib.pc)
+
+AC_DEFUN([AC_HAVE_ZLIB],
+[
+        AC_DEFINE(HAVE_ZLIB, 1, [have zlib])
+        have_zlib=true
+])
+
+AC_DEFUN([AC_NO_ZLIB],
+[
+        AC_DEFINE(HAVE_ZLIB, 0, [have zlib])
+        have_zlib=false
+])
+
+AC_CHECK_HEADER(zlib.h, AC_HAVE_ZLIB, AC_NO_ZLIB)
+AM_CONDITIONAL(link_zlib, test x$have_zlib = xtrue)
+
+AC_DEFUN([AC_HAVE_CPPUNIT],
+[
+        AC_DEFINE(HAVE_CPPUNIT, 1, [have cppunit])
+        have_cppunit=true
+])
+
+AC_DEFUN([AC_NO_CPPUNIT],
+[
+        AC_DEFINE(HAVE_CPPUNIT, 0, [have cppunit])
+        have_cppunit=false
+])
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADER(cppunit/extensions/HelperMacros.h, AC_HAVE_CPPUNIT, AC_NO_CPPUNIT)
+AC_LANG_RESTORE
+AM_CONDITIONAL(build_tests, test x$have_cppunit = xtrue)
+dnl =======================================================
+dnl FILE: ./bindings/c/configure.in.in
+dnl =======================================================
+
+dnl AC_OUTPUT(bindings/c/taglib_c.pc)
+KDE_CREATE_SUBDIRSLIST
+AC_CONFIG_FILES([ Makefile ])
+AC_CONFIG_FILES([ bindings/Makefile ])
+AC_CONFIG_FILES([ bindings/c/Makefile ])
+AC_CONFIG_FILES([ examples/Makefile ])
+AC_CONFIG_FILES([ taglib/Makefile ])
+AC_CONFIG_FILES([ taglib/ape/Makefile ])
+AC_CONFIG_FILES([ taglib/asf/Makefile ])
+AC_CONFIG_FILES([ taglib/flac/Makefile ])
+AC_CONFIG_FILES([ taglib/mp4/Makefile ])
+AC_CONFIG_FILES([ taglib/mpc/Makefile ])
+AC_CONFIG_FILES([ taglib/mpeg/Makefile ])
+AC_CONFIG_FILES([ taglib/mpeg/id3v1/Makefile ])
+AC_CONFIG_FILES([ taglib/mpeg/id3v2/Makefile ])
+AC_CONFIG_FILES([ taglib/mpeg/id3v2/frames/Makefile ])
+AC_CONFIG_FILES([ taglib/ogg/Makefile ])
+AC_CONFIG_FILES([ taglib/ogg/flac/Makefile ])
+AC_CONFIG_FILES([ taglib/ogg/speex/Makefile ])
+AC_CONFIG_FILES([ taglib/ogg/vorbis/Makefile ])
+AC_CONFIG_FILES([ taglib/riff/Makefile ])
+AC_CONFIG_FILES([ taglib/riff/aiff/Makefile ])
+AC_CONFIG_FILES([ taglib/riff/wav/Makefile ])
+AC_CONFIG_FILES([ taglib/toolkit/Makefile ])
+AC_CONFIG_FILES([ taglib/trueaudio/Makefile ])
+AC_CONFIG_FILES([ taglib/wavpack/Makefile ])
+AC_CONFIG_FILES([ tests/Makefile ])
+AC_CONFIG_FILES([ taglib-config ])
+AC_CONFIG_FILES([ taglib.pc ])
+AC_CONFIG_FILES([ bindings/c/taglib_c.pc ])
+AC_OUTPUT
+if test "x$have_zlib" = "xfalse"; then
+	echo "**************************************************"
+	echo "*"
+	echo "* You don't seem to have libz / zlib.h installed."
+	echo "* Compressed frames have been disabled."
+	echo "*"
+	echo "**************************************************"
+fi
+# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
+if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
+  # And if so, warn when they don't match
+  if test "$kde_libs_prefix" != "$given_prefix"; then
+    # And if kde doesn't know about the prefix yet
+    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
+    if test $? -ne 0; then
+      echo ""
+      echo "Warning: you chose to install this package in $given_prefix,"
+      echo "but KDE was found in $kde_libs_prefix."
+      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
+      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
+      echo "Then restart KDE."
+      echo ""
+    fi
+  fi
+fi
+
+if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
+  echo ""
+  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
+  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
+  echo ""
+  echo "For better performance, consider including the Qt visibility supporting patch"
+  echo "located at:"
+  echo ""
+  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
+  echo ""
+  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
+  echo "everything will continue to work just fine without it."
+  echo ""
+fi
+
+if test "$all_tests" = "bad"; then
+  if test ! "$cache_file" = "/dev/null"; then
+    echo ""
+    echo "Please remove the file $cache_file after changing your setup"
+    echo "so that configure will find the changes next time."
+    echo ""
+  fi
+else
+  echo ""
+  echo "Good - your configure finished. Start make now"
+  echo ""
+fi
diff --git a/lib-src/taglib/configure.in.bot b/lib-src/taglib/configure.in.bot
new file mode 100644
index 0000000..b3e513c
--- /dev/null
+++ b/lib-src/taglib/configure.in.bot
@@ -0,0 +1,8 @@
+if test "x$have_zlib" = "xfalse"; then
+	echo "**************************************************"
+	echo "*"
+	echo "* You don't seem to have libz / zlib.h installed."
+	echo "* Compressed frames have been disabled."
+	echo "*"
+	echo "**************************************************"
+fi
diff --git a/lib-src/taglib/configure.in.in b/lib-src/taglib/configure.in.in
new file mode 100644
index 0000000..0a3414b
--- /dev/null
+++ b/lib-src/taglib/configure.in.in
@@ -0,0 +1,133 @@
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 2001 Stephan Kulow (coolo at kde.org)
+dnl                       modified by Walter Tasin (tasin at kdevelop.org)
+dnl                       for c++ console applications
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl    Boston, MA 02111-1307, USA.
+
+# Original Author was Kalle at kde.org
+# I lifted it in some mater. (Stephan Kulow)
+# I used much code from Janos Farkas
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
+
+dnl This is so we can use kde-common
+AC_CONFIG_AUX_DIR(admin)
+
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
+unset CDPATH
+
+dnl Checking host/target/build systems, for make, install etc.
+AC_CANONICAL_SYSTEM
+dnl Perform program name transformation
+AC_ARG_PROGRAM
+
+dnl Automake doc recommends to do this only here. (Janos)
+AM_INIT_AUTOMAKE(taglib,1.4)
+
+dnl almost the same like KDE_SET_PEFIX but the path is /usr/local
+dnl
+unset CDPATH
+dnl make /usr/local the default for the installation
+AC_PREFIX_DEFAULT(/usr/local)
+
+if test "x$prefix" = "xNONE"; then
+  prefix=$ac_default_prefix
+  ac_configure_args="$ac_configure_args --prefix $prefix"
+fi
+KDE_FAST_CONFIGURE
+KDE_CONF_FILES
+
+dnl without this order in this file, automake will be confused!
+dnl
+AM_CONFIG_HEADER(config.h)
+
+dnl checks for programs.
+dnl first check for c/c++ compilers
+AC_CHECK_COMPILERS
+
+dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
+dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
+CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
+
+dnl create only shared libtool-libraries
+AC_ENABLE_SHARED(yes)
+
+dnl set the following to yes, if you want to create static
+dnl libtool-libraries, too.
+AC_ENABLE_STATIC(no)
+
+dnl create a working libtool-script
+KDE_PROG_LIBTOOL
+
+dnl activate the next macro call for DLOPEN tests and setting LIBDL
+dnl   (n.b. KDE_MISC_TESTS does the same to you, so use either this or the next one)
+dnl KDE_CHECK_DLOPEN
+
+dnl activate the next macro call for some additional tests
+dnl   (compat, crypt, socket, nsl, dlopen, ...)
+dnl KDE_MISC_TESTS dnl __kdevelop__
+
+dnl KDE_NEED_FLEX dnl __kdevelop__
+dnl AC_PROG_YACC dnl __kdevelop__
+
+dnl KDE_CHECK_EXTRA_LIBS
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+AC_SUBST(AUTODIRS)
+
+#AM_INIT_AUTOMAKE(taglib,1.0)
+dnl don't remove the below
+dnl AC_OUTPUT(taglib-config)
+dnl AC_OUTPUT(taglib.pc)
+
+AC_DEFUN([AC_HAVE_ZLIB],
+[
+        AC_DEFINE(HAVE_ZLIB, 1, [have zlib])
+        have_zlib=true
+])
+
+AC_DEFUN([AC_NO_ZLIB],
+[
+        AC_DEFINE(HAVE_ZLIB, 0, [have zlib])
+        have_zlib=false
+])
+
+AC_CHECK_HEADER(zlib.h, AC_HAVE_ZLIB, AC_NO_ZLIB)
+AM_CONDITIONAL(link_zlib, test x$have_zlib = xtrue)
+
+AC_DEFUN([AC_HAVE_CPPUNIT],
+[
+        AC_DEFINE(HAVE_CPPUNIT, 1, [have cppunit])
+        have_cppunit=true
+])
+
+AC_DEFUN([AC_NO_CPPUNIT],
+[
+        AC_DEFINE(HAVE_CPPUNIT, 0, [have cppunit])
+        have_cppunit=false
+])
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADER(cppunit/extensions/HelperMacros.h, AC_HAVE_CPPUNIT, AC_NO_CPPUNIT)
+AC_LANG_RESTORE
+AM_CONDITIONAL(build_tests, test x$have_cppunit = xtrue)
diff --git a/lib-src/taglib/doc/README b/lib-src/taglib/doc/README
new file mode 100644
index 0000000..ad634e1
--- /dev/null
+++ b/lib-src/taglib/doc/README
@@ -0,0 +1 @@
+Run "doxygen taglib.doxgen" to generate the TagLib API documentation.
diff --git a/lib-src/taglib/doc/api-footer.html b/lib-src/taglib/doc/api-footer.html
new file mode 100644
index 0000000..9b151ee
--- /dev/null
+++ b/lib-src/taglib/doc/api-footer.html
@@ -0,0 +1,4 @@
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/lib-src/taglib/doc/api-header.html b/lib-src/taglib/doc/api-header.html
new file mode 100644
index 0000000..91e7dc5
--- /dev/null
+++ b/lib-src/taglib/doc/api-header.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <title>$title ($projectname)</title>
+    <link href="taglib-api.css" rel="stylesheet" type="text/css">
+  </head>
+  <body>
+
+    
+    <div id="container">
+
+      <table border="0" width="100%">
+          <tr>
+            <td width="1">
+              <img src="../taglib.png">
+            </td>
+            <td>
+              <div id="intro">
+                <table border="0" height="119" cellpadding="0" cellspacing="0" width="100%">
+                    <tr><td valign="top"><h1>TagLib 1.5 ($title)</h1></td></tr>
+                    <tr>
+                      <td valign="bottom">
+                        <div id="links">
+                          <a href="index.html">Home</a>
+                          <a href="inherits.html">Class&nbsp;Hierarchy</a>
+                          <a href="namespaces.html">Namespaces</a>
+                          <a href="annotated.html">Classes</a>
+                          <a href="files.html">Headers</a>
+                          <a href="namespacemembers.html">Namespace&nbsp;Members</a>
+                          <a href="functions.html">Class&nbsp;Members</a>
+                          <a href="globals.html">File&nbsp;Members</a>
+                        </div>
+                      </td>
+                    </tr>
+                </table>
+              </div>
+            </td>
+          </tr>
+      </table>
+
+      <div id="text">
diff --git a/lib-src/taglib/doc/taglib-api.css b/lib-src/taglib/doc/taglib-api.css
new file mode 100644
index 0000000..3fa820e
--- /dev/null
+++ b/lib-src/taglib/doc/taglib-api.css
@@ -0,0 +1,395 @@
+body {
+  font-family: sans-serif;
+  background: white;
+  color: black;
+  margin: 0px;
+  padding: 15px;
+}
+
+a:link {
+  font-weight: bold;
+  text-decoration: none;
+  color: gray;
+}
+
+a:visited {
+  font-weight: bold;
+  text-decoration: none;
+  color: gray;
+}
+
+a:hover {
+  color: #cccccc;
+  text-decoration: underline;
+}
+
+a:active {
+  color: #cccccc;
+  text-decoration: underline;
+}
+
+img { 
+  border-style: none;
+}
+
+h1 {
+  font-family: sans-serif;
+}
+
+h2 {
+  font-family: sans-serif;
+}
+
+h3 {
+  font-family: sans-serif;
+}
+
+/* container */
+
+#container {
+  position: absolute;
+  border-width: thin;
+  border-style: solid;
+  width: 95%;
+}
+
+/* intro */
+
+#intro {
+  padding: 5px;
+  margin: 0px;
+  background: #cccccc;
+  border-width: medium;
+  border-style: solid;
+}
+
+#intro h1 {
+  margin: 5px;
+  padding: 5px;
+}
+
+/* links */
+
+#links { 
+  font-size: x-small;
+  vertical-align: bottom;
+}
+
+#links a {
+  border-width: thin;
+  border-style: dotted;
+  border-color: white;
+  /* margin: 0px 10px 0px 0px; */
+  margin: 1px;
+  padding: 3px;
+  line-height: 230%
+}
+
+#links a:hover {
+  color: black;
+  text-decoration: underline;
+}
+
+#links h3 {
+  outline-width: thin;
+  border-style: solid;
+  padding: 2px;
+  margin: 3px 0px 3px 0px;
+}
+
+/* menu */
+
+#menu h3 {
+  text-align: center;
+}
+
+/* text */
+
+#text {
+  margin: 0px;
+  padding: 5px 5px 0px 5px;
+  float: left;
+}
+
+#text h3 {
+  border-width: thin;
+  border-style: solid;
+  padding: 2px;
+  margin: 3px 0px 3px 0px;
+}
+
+#text li {
+  margin: 0px 0px 10px 0px;
+}
+
+#text ul {
+  margin: 5px;
+  padding: 0px 0px 0px 20px;
+}
+
+#leftcolumn {
+  float: left;
+  width: 300px;
+  margin: 0px 10px 0px 0px;
+  padding: 0px;
+}
+
+#rightcolumn {
+  float: right;
+  width: 210px;
+  margin: 0px;
+  padding: 0px;
+}
+
+/* vspacer */
+
+.vspacer {
+  height: 10px;
+}
+
+.silver {
+  border-width: thin;
+  border-color: black;
+  border-style: solid;
+  background: #cccccc;
+}
+
+a.code {
+  text-decoration: none;
+  font-weight: normal;
+  color: #4444ee
+}
+
+a.codeRef {
+  font-weight: normal;
+  color: #4444ee
+}
+
+div.fragment {
+  width: 98%;
+  border: 1px solid #CCCCCC;
+  background-color: #f5f5f5;
+  padding-left: 4px;
+  margin: 4px;
+}
+
+div.ah {
+  background-color: black;
+  font-weight: bold; color: #ffffff;
+  margin-bottom: 3px;
+  margin-top: 3px
+}
+
+#text td {
+  width: auto;
+}
+
+div.memdoc {
+  margin-top: 0px;
+  margin-bottom: 20px;
+  padding: 10px 10px 10px 40px;
+}
+
+div.memproto {
+  border: thin solid black;
+  background-color: #f2f2ff;
+  width: 100%;
+  margin-top: 20px;
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+td.paramtype {
+  color: #602020;
+}
+
+table.memname {
+  font-weight: bold;
+}
+
+div.groupHeader {
+  margin-left: 16px;
+  margin-top: 12px;
+  margin-bottom: 6px;
+  font-weight: bold
+}
+
+div.groupText {
+  margin-left: 16px;
+  font-style: italic;
+  font-size: smaller
+}
+
+body {
+  background: white;
+  color: black;
+  margin-right: 20px;
+  margin-left: 20px;
+}
+
+td.indexkey { 
+  background-color: #eeeeff; 
+  font-weight: bold; 
+  padding-right  : 10px; 
+  padding-top    : 2px; 
+  padding-left   : 10px; 
+  padding-bottom : 2px; 
+  margin-left    : 0px; 
+  margin-right   : 0px; 
+  margin-top     : 2px; 
+  margin-bottom  : 2px  
+}
+
+td.indexvalue { 
+  background-color: #eeeeff; 
+  font-style: italic; 
+  padding-right  : 10px; 
+  padding-top    : 2px; 
+  padding-left   : 10px; 
+  padding-bottom : 2px; 
+  margin-left    : 0px; 
+  margin-right   : 0px; 
+  margin-top     : 2px; 
+  margin-bottom  : 2px  
+}
+
+tr.memlist {
+  background-color: #f0f0f0; 
+}
+
+p.formulaDsp {
+  text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+  vertical-align: middle;
+}
+
+span.keyword {
+  color: #008000
+}
+
+span.keywordtype {
+  color: #604020
+}
+
+span.keywordflow {
+  color: #e08000
+}
+
+span.comment {
+  color: #800000
+}
+
+span.preprocessor {
+  color: #806020
+}
+
+span.stringliteral {
+  color: #002080
+}
+
+span.charliteral {
+  color: #008080
+}
+
+.mdTable {
+  border: 1px solid #868686;
+  background-color: #f2f2ff;
+}
+
+.mdRow {
+  padding: 8px 20px;
+}
+
+.mdescLeft {
+  font-size: smaller;
+  font-family: Arial, Helvetica, sans-serif;
+  background-color: #FAFAFA;
+  padding-left: 8px;
+  border-top: 1px none #E0E0E0;
+  border-right: 1px none #E0E0E0;
+  border-bottom: 1px none #E0E0E0;
+  border-left: 1px none #E0E0E0;
+  margin: 0px;
+}
+
+.mdescRight {
+  font-size: smaller;
+  font-family: Arial, Helvetica, sans-serif;
+  font-style: italic;
+  background-color: #FAFAFA;
+  padding-left: 4px;
+  border-top: 1px none #E0E0E0;
+  border-right: 1px none #E0E0E0;
+  border-bottom: 1px none #E0E0E0;
+  border-left: 1px none #E0E0E0;
+  margin: 0px;
+  padding-bottom: 0px;
+  padding-right: 8px;
+}
+
+.memItemLeft {
+  padding: 1px 0px 0px 8px;
+  margin: 4px;
+  border-top-width: 1px;
+  border-right-width: 1px;
+  border-bottom-width: 1px;
+  border-left-width: 1px;
+  border-top-style: solid;
+  border-top-color: #E0E0E0;
+  border-right-color: #E0E0E0;
+  border-bottom-color: #E0E0E0;
+  border-left-color: #E0E0E0;
+  border-right-style: none;
+  border-bottom-style: none;
+  border-left-style: none;
+  background-color: #FAFAFA;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 12px;
+}
+
+.memItemRight {
+  padding: 1px 0px 0px 8px;
+  margin: 4px;
+  border-top-width: 1px;
+  border-right-width: 1px;
+  border-bottom-width: 1px;
+  border-left-width: 1px;
+  border-top-style: solid;
+  border-top-color: #E0E0E0;
+  border-right-color: #E0E0E0;
+  border-bottom-color: #E0E0E0;
+  border-left-color: #E0E0E0;
+  border-right-style: none;
+  border-bottom-style: none;
+  border-left-style: none;
+  background-color: #FAFAFA;
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 13px;
+}
+
+.search {
+  color: #0000ee;
+  font-weight: bold;
+}
+
+form.search {
+  margin-bottom: 0px;
+  margin-top: 0px;
+}
+
+input.search {
+  font-size: 75%;
+  color: #000080;
+  font-weight: normal;
+  background-color: #eeeeff;
+}
+
+td.tiny {
+  font-size: 75%;
+}
diff --git a/lib-src/taglib/doc/taglib.doxygen b/lib-src/taglib/doc/taglib.doxygen
new file mode 100644
index 0000000..f31c0f1
--- /dev/null
+++ b/lib-src/taglib/doc/taglib.doxygen
@@ -0,0 +1,208 @@
+# Doxyfile 1.3.4
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = TagLib
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = .
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 4
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+GENERATE_TODOLIST      = NO
+GENERATE_TESTLIST      = NO
+GENERATE_BUGLIST       = NO
+GENERATE_DEPRECATEDLIST= NO
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = NO
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = ../taglib/
+FILE_PATTERNS          = *.h \
+                         *.hh \
+                         *.H
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = api-header.html
+HTML_FOOTER            = api-footer.html
+HTML_STYLESHEET        = taglib-api.css
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = YES
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = letter
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = DO_NOT_DOCUMENT \
+                         DOXYGEN
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
diff --git a/lib-src/taglib/doc/taglib.png b/lib-src/taglib/doc/taglib.png
new file mode 100644
index 0000000..7174ee9
Binary files /dev/null and b/lib-src/taglib/doc/taglib.png differ
diff --git a/lib-src/taglib/examples/.deps/framelist.Po b/lib-src/taglib/examples/.deps/framelist.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/examples/.deps/framelist.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/examples/.deps/strip-id3v1.Po b/lib-src/taglib/examples/.deps/strip-id3v1.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/examples/.deps/strip-id3v1.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/examples/.deps/tagreader.Po b/lib-src/taglib/examples/.deps/tagreader.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/examples/.deps/tagreader.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/examples/.deps/tagreader_c.Po b/lib-src/taglib/examples/.deps/tagreader_c.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/examples/.deps/tagreader_c.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/examples/.deps/tagwriter.Po b/lib-src/taglib/examples/.deps/tagwriter.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/examples/.deps/tagwriter.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/examples/CMakeLists.txt b/lib-src/taglib/examples/CMakeLists.txt
new file mode 100644
index 0000000..fd10229
--- /dev/null
+++ b/lib-src/taglib/examples/CMakeLists.txt
@@ -0,0 +1,46 @@
+if(BUILD_EXAMPLES)
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
+		     ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/c/  )
+
+########### next target ###############
+
+ADD_EXECUTABLE(tagreader tagreader.cpp)
+
+TARGET_LINK_LIBRARIES(tagreader  tag )
+
+
+########### next target ###############
+
+ADD_EXECUTABLE(tagreader_c tagreader_c.c)
+
+TARGET_LINK_LIBRARIES(tagreader_c  tag_c )
+
+
+########### next target ###############
+
+ADD_EXECUTABLE(tagwriter tagwriter.cpp)
+
+TARGET_LINK_LIBRARIES(tagwriter  tag )
+
+
+########### next target ###############
+
+ADD_EXECUTABLE(framelist framelist.cpp)
+
+TARGET_LINK_LIBRARIES(framelist  tag )
+
+
+########### next target ###############
+
+ADD_EXECUTABLE(strip-id3v1 strip-id3v1.cpp)
+
+TARGET_LINK_LIBRARIES(strip-id3v1  tag )
+
+
+endif(BUILD_EXAMPLES)
+
diff --git a/lib-src/taglib/examples/Makefile.am b/lib-src/taglib/examples/Makefile.am
new file mode 100644
index 0000000..bfb0f77
--- /dev/null
+++ b/lib-src/taglib/examples/Makefile.am
@@ -0,0 +1,18 @@
+bin_PROGRAMS = tagreader tagreader_c tagwriter framelist strip-id3v1
+tagreader_SOURCES = tagreader.cpp
+tagreader_c_SOURCES = tagreader_c.c
+tagwriter_SOURCES = tagwriter.cpp
+framelist_SOURCES = framelist.cpp
+strip_id3v1_SOURCES = strip-id3v1.cpp
+
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/bindings/c
+
+LDADD = ../taglib/libtag.la
+tagreader_c_LDADD = ../bindings/c/libtag_c.la
diff --git a/lib-src/taglib/examples/Makefile.in b/lib-src/taglib/examples/Makefile.in
new file mode 100644
index 0000000..b758c74
--- /dev/null
+++ b/lib-src/taglib/examples/Makefile.in
@@ -0,0 +1,677 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS = tagreader$(EXEEXT) tagreader_c$(EXEEXT) \
+	tagwriter$(EXEEXT) framelist$(EXEEXT) strip-id3v1$(EXEEXT)
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_framelist_OBJECTS = framelist.$(OBJEXT)
+#>- framelist_OBJECTS = $(am_framelist_OBJECTS)
+#>+ 1
+framelist_OBJECTS = framelist.$(OBJEXT)
+framelist_LDADD = $(LDADD)
+framelist_DEPENDENCIES = ../taglib/libtag.la
+am_strip_id3v1_OBJECTS = strip-id3v1.$(OBJEXT)
+#>- strip_id3v1_OBJECTS = $(am_strip_id3v1_OBJECTS)
+#>+ 1
+strip_id3v1_OBJECTS = strip-id3v1.$(OBJEXT)
+strip_id3v1_LDADD = $(LDADD)
+strip_id3v1_DEPENDENCIES = ../taglib/libtag.la
+am_tagreader_OBJECTS = tagreader.$(OBJEXT)
+#>- tagreader_OBJECTS = $(am_tagreader_OBJECTS)
+#>+ 1
+tagreader_OBJECTS = tagreader.$(OBJEXT)
+tagreader_LDADD = $(LDADD)
+tagreader_DEPENDENCIES = ../taglib/libtag.la
+am_tagreader_c_OBJECTS = tagreader_c.$(OBJEXT)
+#>- tagreader_c_OBJECTS = $(am_tagreader_c_OBJECTS)
+#>+ 1
+tagreader_c_OBJECTS = tagreader_c.$(OBJEXT)
+tagreader_c_DEPENDENCIES = ../bindings/c/libtag_c.la
+am_tagwriter_OBJECTS = tagwriter.$(OBJEXT)
+#>- tagwriter_OBJECTS = $(am_tagwriter_OBJECTS)
+#>+ 1
+tagwriter_OBJECTS = tagwriter.$(OBJEXT)
+tagwriter_LDADD = $(LDADD)
+tagwriter_DEPENDENCIES = ../taglib/libtag.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(framelist_SOURCES) $(strip_id3v1_SOURCES) \
+	$(tagreader_SOURCES) $(tagreader_c_SOURCES) \
+	$(tagwriter_SOURCES)
+DIST_SOURCES = $(framelist_SOURCES) $(strip_id3v1_SOURCES) \
+	$(tagreader_SOURCES) $(tagreader_c_SOURCES) \
+	$(tagwriter_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+tagreader_SOURCES = tagreader.cpp
+tagreader_c_SOURCES = tagreader_c.c
+tagwriter_SOURCES = tagwriter.cpp
+framelist_SOURCES = framelist.cpp
+strip_id3v1_SOURCES = strip-id3v1.cpp
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/bindings/c
+
+LDADD = ../taglib/libtag.la
+tagreader_c_LDADD = ../bindings/c/libtag_c.la
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  examples/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  examples/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  examples/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  examples/Makefile
+	cd $(top_srcdir) && perl admin/am_edit examples/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+framelist$(EXEEXT): $(framelist_OBJECTS) $(framelist_DEPENDENCIES) 
+	@rm -f framelist$(EXEEXT)
+	$(CXXLINK) $(framelist_OBJECTS) $(framelist_LDADD) $(LIBS)
+strip-id3v1$(EXEEXT): $(strip_id3v1_OBJECTS) $(strip_id3v1_DEPENDENCIES) 
+	@rm -f strip-id3v1$(EXEEXT)
+	$(CXXLINK) $(strip_id3v1_OBJECTS) $(strip_id3v1_LDADD) $(LIBS)
+tagreader$(EXEEXT): $(tagreader_OBJECTS) $(tagreader_DEPENDENCIES) 
+	@rm -f tagreader$(EXEEXT)
+	$(CXXLINK) $(tagreader_OBJECTS) $(tagreader_LDADD) $(LIBS)
+tagreader_c$(EXEEXT): $(tagreader_c_OBJECTS) $(tagreader_c_DEPENDENCIES) 
+	@rm -f tagreader_c$(EXEEXT)
+	$(LINK) $(tagreader_c_OBJECTS) $(tagreader_c_LDADD) $(LIBS)
+tagwriter$(EXEEXT): $(tagwriter_OBJECTS) $(tagwriter_DEPENDENCIES) 
+	@rm -f tagwriter$(EXEEXT)
+	$(CXXLINK) $(tagwriter_OBJECTS) $(tagwriter_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/framelist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strip-id3v1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tagreader.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tagreader_c.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tagwriter.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+#>+ 1
+clean-am: clean-bcheck  clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  examples/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  examples/Makefile
+	cd $(top_srcdir) && perl admin/am_edit examples/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in ; do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/examples/framelist.cpp b/lib-src/taglib/examples/framelist.cpp
new file mode 100644
index 0000000..dbe80fe
--- /dev/null
+++ b/lib-src/taglib/examples/framelist.cpp
@@ -0,0 +1,106 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <stdlib.h>
+
+#include <tbytevector.h>
+
+#include <mpegfile.h>
+
+#include <id3v2tag.h>
+#include <id3v2frame.h>
+#include <id3v2header.h>
+
+#include <id3v1tag.h>
+
+#include <apetag.h>
+
+using namespace std;
+using namespace TagLib;
+
+int main(int argc, char *argv[])
+{
+  // process the command line args
+
+
+  for(int i = 1; i < argc; i++) {
+
+    cout << "******************** \"" << argv[i] << "\"********************" << endl;
+
+    MPEG::File f(argv[i]);
+
+    ID3v2::Tag *id3v2tag = f.ID3v2Tag();
+
+    if(id3v2tag) {
+
+      cout << "ID3v2."
+           << id3v2tag->header()->majorVersion()
+           << "."
+           << id3v2tag->header()->revisionNumber()
+           << ", "
+           << id3v2tag->header()->tagSize()
+           << " bytes in tag"
+           << endl;
+
+      ID3v2::FrameList::ConstIterator it = id3v2tag->frameList().begin();
+      for(; it != id3v2tag->frameList().end(); it++)
+        cout << (*it)->frameID() << " - \"" << (*it)->toString() << "\"" << endl;
+    }
+    else
+      cout << "file does not have a valid id3v2 tag" << endl;
+
+    cout << endl << "ID3v1" << endl;
+
+    ID3v1::Tag *id3v1tag = f.ID3v1Tag();
+
+    if(id3v1tag) {
+      cout << "title   - \"" << id3v1tag->title()   << "\"" << endl;
+      cout << "artist  - \"" << id3v1tag->artist()  << "\"" << endl;
+      cout << "album   - \"" << id3v1tag->album()   << "\"" << endl;
+      cout << "year    - \"" << id3v1tag->year()    << "\"" << endl;
+      cout << "comment - \"" << id3v1tag->comment() << "\"" << endl;
+      cout << "track   - \"" << id3v1tag->track()   << "\"" << endl;
+      cout << "genre   - \"" << id3v1tag->genre()   << "\"" << endl;
+    }
+    else
+      cout << "file does not have a valid id3v1 tag" << endl;
+
+    APE::Tag *ape = f.APETag();
+
+    cout << endl << "APE" << endl;
+
+    if(ape) {
+      for(APE::ItemListMap::ConstIterator it = ape->itemListMap().begin();
+          it != ape->itemListMap().end(); ++it)
+      {
+        cout << (*it).first << " - \"" << (*it).second.toString() << "\"" << endl;
+      }
+    }
+    else
+      cout << "file does not have a valid APE tag" << endl;
+
+    cout << endl;
+  }
+}
diff --git a/lib-src/taglib/examples/strip-id3v1.cpp b/lib-src/taglib/examples/strip-id3v1.cpp
new file mode 100644
index 0000000..ab36d71
--- /dev/null
+++ b/lib-src/taglib/examples/strip-id3v1.cpp
@@ -0,0 +1,40 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <mpegfile.h>
+#include <tstring.h>
+
+using namespace TagLib;
+
+int main(int argc, char *argv[])
+{
+  for(int i = 1; i < argc; i++) {
+
+    std::cout << "******************** Stripping ID3v1 Tag From: \"" << argv[i] << "\"********************" << std::endl;
+
+    MPEG::File f(argv[i]);
+    f.strip(MPEG::File::ID3v1);
+  }
+}
diff --git a/lib-src/taglib/examples/tagreader.cpp b/lib-src/taglib/examples/tagreader.cpp
new file mode 100644
index 0000000..76fe0d1
--- /dev/null
+++ b/lib-src/taglib/examples/tagreader.cpp
@@ -0,0 +1,77 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <stdio.h>
+
+#include <fileref.h>
+#include <tag.h>
+
+using namespace std;
+
+TagLib::String formatSeconds(int seconds)
+{
+  char secondsString[3];
+  sprintf(secondsString, "%02i", seconds);
+  return secondsString;
+}
+
+int main(int argc, char *argv[])
+{
+  for(int i = 1; i < argc; i++) {
+
+    cout << "******************** \"" << argv[i] << "\" ********************" << endl;
+
+    TagLib::FileRef f(argv[i]);
+
+    if(!f.isNull() && f.tag()) {
+
+      TagLib::Tag *tag = f.tag();
+
+      cout << "-- TAG --" << endl;
+      cout << "title   - \"" << tag->title()   << "\"" << endl;
+      cout << "artist  - \"" << tag->artist()  << "\"" << endl;
+      cout << "album   - \"" << tag->album()   << "\"" << endl;
+      cout << "year    - \"" << tag->year()    << "\"" << endl;
+      cout << "comment - \"" << tag->comment() << "\"" << endl;
+      cout << "track   - \"" << tag->track()   << "\"" << endl;
+      cout << "genre   - \"" << tag->genre()   << "\"" << endl;
+    }
+
+    if(!f.isNull() && f.audioProperties()) {
+
+      TagLib::AudioProperties *properties = f.audioProperties();
+
+      int seconds = properties->length() % 60;
+      int minutes = (properties->length() - seconds) / 60;
+
+      cout << "-- AUDIO --" << endl;
+      cout << "bitrate     - " << properties->bitrate() << endl;
+      cout << "sample rate - " << properties->sampleRate() << endl;
+      cout << "channels    - " << properties->channels() << endl;
+      cout << "length      - " << minutes << ":" << formatSeconds(seconds) << endl;
+    }
+  }
+  return 0;
+}
diff --git a/lib-src/taglib/examples/tagreader_c.c b/lib-src/taglib/examples/tagreader_c.c
new file mode 100644
index 0000000..0220e19
--- /dev/null
+++ b/lib-src/taglib/examples/tagreader_c.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <tag_c.h>
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+int main(int argc, char *argv[])
+{
+  int i;
+  int seconds;
+  int minutes;
+  TagLib_File *file;
+  TagLib_Tag *tag;
+  const TagLib_AudioProperties *properties;
+
+  taglib_set_strings_unicode(FALSE);
+
+  for(i = 1; i < argc; i++) {
+    printf("******************** \"%s\" ********************\n", argv[i]);
+
+    file = taglib_file_new(argv[i]);
+
+    if(file == NULL)
+      break;
+
+    tag = taglib_file_tag(file);
+    properties = taglib_file_audioproperties(file);
+
+    printf("-- TAG --\n");
+    printf("title   - \"%s\"\n", taglib_tag_title(tag));
+    printf("artist  - \"%s\"\n", taglib_tag_artist(tag));
+    printf("album   - \"%s\"\n", taglib_tag_album(tag));
+    printf("year    - \"%i\"\n", taglib_tag_year(tag));
+    printf("comment - \"%s\"\n", taglib_tag_comment(tag));
+    printf("track   - \"%i\"\n", taglib_tag_track(tag));
+    printf("genre   - \"%s\"\n", taglib_tag_genre(tag));
+
+    seconds = taglib_audioproperties_length(properties) % 60;
+    minutes = (taglib_audioproperties_length(properties) - seconds) / 60;
+
+    printf("-- AUDIO --\n");
+    printf("bitrate     - %i\n", taglib_audioproperties_bitrate(properties));
+    printf("sample rate - %i\n", taglib_audioproperties_samplerate(properties));
+    printf("channels    - %i\n", taglib_audioproperties_channels(properties));
+    printf("length      - %i:%02i\n", minutes, seconds);
+
+    taglib_tag_free_strings();
+    taglib_file_free(file);
+  }
+
+  return 0;
+}
diff --git a/lib-src/taglib/examples/tagwriter.cpp b/lib-src/taglib/examples/tagwriter.cpp
new file mode 100644
index 0000000..63163fb
--- /dev/null
+++ b/lib-src/taglib/examples/tagwriter.cpp
@@ -0,0 +1,139 @@
+/* Copyright (C) 2004 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <iostream>
+#include <string.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+
+#include <tlist.h>
+#include <fileref.h>
+#include <tfile.h>
+#include <tag.h>
+
+using namespace std;
+
+bool isArgument(const char *s)
+{
+  return strlen(s) == 2 && s[0] == '-';
+}
+
+bool isFile(const char *s)
+{
+  struct stat st;
+#ifdef _WIN32
+  return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG));
+#else
+  return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG | S_IFLNK));
+#endif
+}
+
+void usage()
+{
+  cout << endl;
+  cout << "Usage: tagwriter <fields> <files>" << endl;
+  cout << endl;
+  cout << "Where the valid fields are:" << endl;
+  cout << "  -t <title>"   << endl;
+  cout << "  -a <artist>"  << endl;
+  cout << "  -A <album>"   << endl;
+  cout << "  -c <comment>" << endl;
+  cout << "  -g <genre>"   << endl;
+  cout << "  -y <year>"    << endl;
+  cout << "  -T <track>"   << endl;
+  cout << endl;
+
+  exit(1);
+}
+
+int main(int argc, char *argv[])
+{
+  TagLib::List<TagLib::FileRef> fileList;
+
+  while(argc > 0 && isFile(argv[argc - 1])) {
+
+    TagLib::FileRef f(argv[argc - 1]);
+
+    if(!f.isNull() && f.tag())
+      fileList.append(f);
+
+    argc--;
+  }
+
+  if(fileList.isEmpty())
+    usage();
+
+  for(int i = 1; i < argc - 1; i += 2) {
+
+    if(isArgument(argv[i]) && i + 1 < argc && !isArgument(argv[i + 1])) {
+
+      char field = argv[i][1];
+      TagLib::String value = argv[i + 1];
+
+      TagLib::List<TagLib::FileRef>::Iterator it;
+      for(it = fileList.begin(); it != fileList.end(); ++it) {
+
+        TagLib::Tag *t = (*it).tag();
+
+        switch (field) {
+        case 't':
+          t->setTitle(value);
+          break;
+        case 'a':
+          t->setArtist(value);
+          break;
+        case 'A':
+          t->setAlbum(value);
+          break;
+        case 'c':
+          t->setComment(value);
+          break;
+        case 'g':
+          t->setGenre(value);
+          break;
+        case 'y':
+          t->setYear(value.toInt());
+          break;
+        case 'T':
+          t->setTrack(value.toInt());
+          break;
+        default:
+          usage();
+          break;
+        }
+      }
+    }
+    else
+      usage();
+  }
+
+  TagLib::List<TagLib::FileRef>::Iterator it;
+  for(it = fileList.begin(); it != fileList.end(); ++it)
+    (*it).file()->save();
+
+  return 0;
+}
diff --git a/lib-src/taglib/libtool b/lib-src/taglib/libtool
new file mode 100755
index 0000000..e2c9361
--- /dev/null
+++ b/lib-src/taglib/libtool
@@ -0,0 +1,7025 @@
+#! /bin/bash
+
+# libtoolT - Provide generalized library-building support services.
+# Generated automatically by  (GNU taglib 1.4)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# A sed program that does not truncate output.
+SED="/bin/sed"
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="/bin/sed -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=" CXX"
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host Ubuntu904:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/bash"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=no
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=yes
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=needless
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="gcc"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP=strip
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation ?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=yes
+
+# Whether dlopen of programs is supported.
+dlopen_self=no
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$compiler_flags \$libobjs \$deplibs \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared \$compiler_flags \$libobjs \$deplibs \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=""
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=""
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGISTW][ABCDGISTW]*\\)[ 	][ 	]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH  LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL CONFIG
+
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5a
+TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+  SP2NL="tr '\100' '\n'"
+  NL2SP="tr '\r\n' '\100\100'"
+  ;;
+ *) # Assume ASCII based system
+  SP2NL="tr '\040' '\012'"
+  NL2SP="tr '\015\012' '\040\040'"
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS=" 	"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*) 
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit 1
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit 0
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+    done
+    exit 0
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit 0
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_output=
+    arg_mode=normal
+    libobj=
+
+    for arg
+    do
+      case "$arg_mode" in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit 1
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static)
+	  build_old_libs=yes
+	  continue
+	  ;;
+
+	-prefer-pic)
+	  pic_mode=yes
+	  continue
+	  ;;
+
+	-prefer-non-pic)
+	  pic_mode=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit 1
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit 1
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base compile
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+	    case "$base_compile " in
+	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit 1" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit 1" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$0" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+      $echo $srcfile > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $srcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      suppress_output=' >/dev/null 2>&1'
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      else
+	command="$base_compile $srcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit 0
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    add_flags=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      base_compile="$base_compile $arg"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit 1
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit 1
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit 1
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit 1
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+	        *" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+              esac
+              ;;
+   	  esac
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit 1
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit 1
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    continue
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # gcc -m* arguments should be passed to the linker via $compiler_flags
+      # in order to pass architecture information to the linker
+      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
+      # but this is not reliable with gcc because gcc may use -mfoo to
+      # select a different linker, different libraries, etc, while
+      # -Wl,-mfoo simply passes -mfoo to the linker.
+      -m*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit 1
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      -framework)
+        prev=framework
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	add_flags="$add_flags $arg"
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit 1
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit 1
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	add_flags="$add_flags $arg"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base link
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+	    case $base_compile in
+	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+	      # The compiler in $compile_command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#       else
+#         $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplcations in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  if test "$pass" = conv && test "$allow_undefined" = yes; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    if test "$deplibs_check_method" != pass_all; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit 1
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	case $host in
+	*-*-darwin*)
+	  # Convert "-framework foo" to "foo.ltframework" in dependency_libs
+	  test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    #echo "Adding $deplib to \$deplibs"
+	    deplibs="$deplib $deplibs"
+            if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+            fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit 1
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit 1
+	  fi
+	  continue
+	fi # $pass = conv
+
+    
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	else
+	  dir="$ladir/$objdir"
+	  absdir="$abs_ladir/$objdir"
+	  # Remove this search path later
+	  notinst_path="$notinst_path $abs_ladir"
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+    
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var"; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $dir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+	
+      # Warn about portability, can't link against -module's on some systems (darwin)
+      if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"    
+      fi	  
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$extract_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$old_archive_from_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against it, someone
+		    # is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi 
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case "$libdir" in
+		    [\\/]*)
+		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit 1
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case "$libdir" in
+		  [\\/]*)
+		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    convenience="$convenience $dir/$old_library"
+	    old_convenience="$old_convenience $dir/$old_library"
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  #if test -n "$dependency_libs" &&
+	  #   { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+	  #     test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  #fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit 1
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    # Sure, some shells/systems don't implement the -ef.
+		    # Those will have to live with the warning.
+		    test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
+		      $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs, but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		   fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		    path=""
+		  fi
+		  ;;
+		*)
+		path="-L$path"
+		;;
+		esac 
+		
+		;;
+		  -l*)
+		case $host in
+		*-*-darwin*)
+		 # Again, we only want to link against shared libraries
+		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		 for tmp in $newlib_search_path ; do
+		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		       eval depdepl="$tmp/lib$tmp_libs.dylib"
+		       break
+		     fi  
+         done
+         path=""
+		  ;;
+		*) continue ;;
+		esac  		  
+		;;
+
+	      *.ltframework)
+		case $host in
+		  *-*-darwin*)
+		    depdepl="$deplib"
+		    ;;
+		esac
+		;;
+
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$deplibs $depdepl" ;;
+	      esac	      
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$deplibs $path" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit 1
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+	
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $revision in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $age in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *$exeext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" -ne "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	case $host in
+	  *-*-darwin*)
+	    newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	    ;;
+	esac
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    eval cmds=\"$export_symbols_cmds\"
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*) 
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs" 
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+
+	    for xlib in $convenience; do
+	      # Extract the objects.
+	      case $xlib in
+	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	      *) xabs=`pwd`"/$xlib" ;;
+	      esac
+	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	      xdir="$gentop/$xlib"
+
+	      $show "${rm}r $xdir"
+	      $run ${rm}r "$xdir"
+	      $show "$mkdir $xdir"
+	      $run $mkdir "$xdir"
+	      status=$?
+	      if test "$status" -ne 0 && test ! -d "$xdir"; then
+		exit $status
+	      fi
+	      # We will extract separately just the conflicting names and we will no
+	      # longer touch any unique names. It is faster to leave these extract
+	      # automatically by $AR in one run.
+	      $show "(cd $xdir && $AR x $xabs)"
+	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+		:
+	      else
+		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+		$AR t "$xabs" | sort | uniq -cd | while read -r count name
+		do
+		  i=1
+		  while test "$i" -le "$count"
+		  do
+		   # Put our $i before any first dot (extension)
+		   # Never overwrite any file
+		   name_to="$name"
+		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		   do
+		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		   done
+		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		   i=`expr $i + 1`
+		  done
+		done
+	      fi
+
+	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	    done
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Add all flags from the command line.  We here create a library,
+	# but those flags were only added to compile_command and
+	# finalize_command, which are only used when creating executables.
+	# So do it by hand here.
+	compiler_flags="$compiler_flags $add_flags"
+	# Only add it to commands which use CC, instead of LD, i.e.
+	# only to $compiler_flags
+	#linker_flags="$linker_flags $add_flags"
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval cmds=\"$module_expsym_cmds\"
+	  else
+	    eval cmds=\"$module_cmds\"
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval cmds=\"$archive_expsym_cmds\"
+	else
+	  eval cmds=\"$archive_cmds\"
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$save_output-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*"` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$save_output-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$save_output-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadale object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval cmds=\"$archive_expsym_cmds\"
+	  else
+	    eval cmds=\"$archive_cmds\"
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  exit 0
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit 1
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  $show "${rm}r $gentop"
+	  $run ${rm}r "$gentop"
+	  $show "$mkdir $gentop"
+	  $run $mkdir "$gentop"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$gentop"; then
+	    exit $status
+	  fi
+	  generated="$generated $gentop"
+
+	  for xlib in $convenience; do
+	    # Extract the objects.
+	    case $xlib in
+	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	    *) xabs=`pwd`"/$xlib" ;;
+	    esac
+	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	    xdir="$gentop/$xlib"
+
+	    $show "${rm}r $xdir"
+	    $run ${rm}r "$xdir"
+	    $show "$mkdir $xdir"
+	    $run $mkdir "$xdir"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$xdir"; then
+	      exit $status
+	    fi
+	    # We will extract separately just the conflicting names and we will no
+	    # longer touch any unique names. It is faster to leave these extract
+	    # automatically by $AR in one run.
+	    $show "(cd $xdir && $AR x $xabs)"
+	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	      :
+	    else
+	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	      do
+		i=1
+		while test "$i" -le "$count"
+		do
+		 # Put our $i before any first dot (extension)
+		 # Never overwrite any file
+		 name_to="$name"
+		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		 do
+		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		 done
+		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		 i=`expr $i + 1`
+		done
+	      done
+	    fi
+
+	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	  done
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      eval cmds=\"$reload_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit 0
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit 0
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	eval cmds=\"$reload_cmds\"
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit 0
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+        ;;
+      esac
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$output.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit 1
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
+      # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
+      # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
+      # This does not apply on AIX for ia64, which uses a SysV linker.
+      case "$host" in
+        ia64-*-aix5*) ;;
+        *-*-aix4* | *-*-aix5*)
+                   compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
+                   finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
+      esac
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit 0
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+	case $0 in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+	esac
+	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *mingw* )
+	    cwrappersource=`$echo ${output_objdir}/lt-${outputname}.c`
+	    cwrapper=`$echo ${output}.exe`
+	    $rm $cwrappersource $cwrapper
+	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+   
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2 
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+  
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe"); 
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char * 
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':') 
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char * 
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat) 
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode, 
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+	  # we should really use a build-platform specific compiler
+	  # here, but OTOH, the wrappers (shell script and this C one)
+	  # are only useful if you want to execute the "real" binary.
+	  # Since the "real" binary is built for $host, then this
+	  # wrapper might as well be built for $host, too.
+	  $run $LTCC -s -o $cwrapper $cwrappersource
+	  ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit 1" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  # Need to set LD_LIBRARY_PATH, to the value already
+	  # computed within libtool.
+	  $echo >> $output "\
+      LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit 0
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	$show "${rm}r $gentop"
+	$run ${rm}r "$gentop"
+	$show "$mkdir $gentop"
+	$run $mkdir "$gentop"
+	status=$?
+	if test "$status" -ne 0 && test ! -d "$gentop"; then
+	  exit $status
+	fi
+	generated="$generated $gentop"
+
+	# Add in members from convenience archives.
+	for xlib in $addlibs; do
+	  # Extract the objects.
+	  case $xlib in
+	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	  *) xabs=`pwd`"/$xlib" ;;
+	  esac
+	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	  xdir="$gentop/$xlib"
+
+	  $show "${rm}r $xdir"
+	  $run ${rm}r "$xdir"
+	  $show "$mkdir $xdir"
+	  $run $mkdir "$xdir"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$xdir"; then
+	    exit $status
+	  fi
+	  # We will extract separately just the conflicting names and we will no
+	  # longer touch any unique names. It is faster to leave these extract
+	  # automatically by $AR in one run.
+	  $show "(cd $xdir && $AR x $xabs)"
+	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	    do
+	      i=1
+	      while test "$i" -le "$count"
+	      do
+	       # Put our $i before any first dot (extension)
+	       # Never overwrite any file
+	       name_to="$name"
+	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+	       do
+		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+	       done
+	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+	       i=`expr $i + 1`
+	      done
+	    done
+	  fi
+
+	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+	done
+      fi
+
+      compiler_flags="$compiler_flags $add_flags"
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	eval cmds=\"$old_archive_from_new_cmds\"
+      else
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+	  # encoded into archives.  This makes 'ar r' malfunction in
+	  # this piecewise linking case whenever conflicting object
+	  # names appear in distinct ar calls; check, warn and compensate.
+	    if (for obj in $save_oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+	    AR_FLAGS=cq
+	  fi
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done  
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*"` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi  
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+        relink_command=
+      fi  
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit 1
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit 0
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest="$arg"
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*) ;;
+
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest="$arg"
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit 1
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit 1
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  eval cmds=\"$postinstall_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit 0
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit 1
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
+	      else
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyways
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      eval cmds=\"$old_postinstall_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $0 --finish$current_libdirs'
+    else
+      exit 0
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  eval cmds=\"$finish_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    exit 0
+
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit 0
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit 1
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit 1
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit 0
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test "$mode" = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      eval cmds=\"$postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      eval cmds=\"$old_postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe) 
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit 1
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool at gnu.org>."
+  exit 0
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# Libtool was configured on host Ubuntu904:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/bash"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=no
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=needless
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="g++"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP=strip
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation ?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=yes
+
+# Whether dlopen of programs is supported.
+dlopen_self=no
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared -nostdlib \$compiler_flags \$predep_objects \$libobjs \$deplibs \$postdep_objects \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared -nostdlib \$compiler_flags \$predep_objects \$libobjs \$deplibs \$postdep_objects \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.3/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../.."
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGISTW][ABCDGISTW]*\\)[ 	][ 	]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=""
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: CXX
+
diff --git a/lib-src/portaudio-v19/bindings/cpp/AUTHORS b/lib-src/taglib/stamp-h.in
similarity index 100%
copy from lib-src/portaudio-v19/bindings/cpp/AUTHORS
copy to lib-src/taglib/stamp-h.in
diff --git a/lib-src/sbsms/stamp-h1 b/lib-src/taglib/stamp-h1
similarity index 100%
copy from lib-src/sbsms/stamp-h1
copy to lib-src/taglib/stamp-h1
diff --git a/lib-src/taglib/subdirs b/lib-src/taglib/subdirs
new file mode 100644
index 0000000..7cf3db2
--- /dev/null
+++ b/lib-src/taglib/subdirs
@@ -0,0 +1,4 @@
+tests
+taglib
+examples
+bindings
diff --git a/lib-src/taglib/taglib-config b/lib-src/taglib/taglib-config
new file mode 100644
index 0000000..9af7c4e
--- /dev/null
+++ b/lib-src/taglib/taglib-config
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+usage()
+{
+	echo "usage: $0 [OPTIONS]"
+cat << EOH
+
+options:
+	[--libs]
+	[--cflags]
+	[--version]
+	[--prefix]
+EOH
+	exit 1;
+}
+
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+flags=""
+
+if test $# -eq 0 ; then
+  usage
+fi
+
+while test $# -gt 0
+do
+  case $1 in
+    --libs)
+	  flags="$flags -L$libdir -ltag"
+	  ;;
+    --cflags)
+	  flags="$flags -I$includedir/taglib"
+	  ;;
+    --version)
+	  echo 1.5
+	  ;;
+    --prefix)
+	  echo $prefix
+	  ;;
+	*)
+	  echo "$0: unknown option $1"
+	  echo
+	  usage
+	  ;;
+  esac
+  shift
+done
+
+if test -n "$flags"
+then
+  echo $flags
+fi
diff --git a/lib-src/taglib/taglib-config.cmake b/lib-src/taglib/taglib-config.cmake
new file mode 100644
index 0000000..9dc5ed1
--- /dev/null
+++ b/lib-src/taglib/taglib-config.cmake
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+usage()
+{
+	echo "usage: $0 [OPTIONS]"
+cat << EOH
+
+options:
+	[--libs]
+	[--cflags]
+	[--version]
+	[--prefix]
+EOH
+	exit 1;
+}
+
+prefix=${CMAKE_INSTALL_PREFIX}
+exec_prefix=${CMAKE_INSTALL_PREFIX}
+libdir=${LIB_INSTALL_DIR}
+includedir=${INCLUDE_INSTALL_DIR}
+
+flags=""
+
+if test $# -eq 0 ; then
+  usage
+fi
+
+while test $# -gt 0
+do
+  case $1 in
+    --libs)
+	  flags="$flags -L$libdir -ltag"
+	  ;;
+    --cflags)
+	  flags="$flags -I$includedir/taglib"
+	  ;;
+    --version)
+	  echo 1.5
+	  ;;
+    --prefix)
+	  echo $prefix
+	  ;;
+	*)
+	  echo "$0: unknown option $1"
+	  echo
+	  usage
+	  ;;
+  esac
+  shift
+done
+
+if test -n "$flags"
+then
+  echo $flags
+fi
diff --git a/lib-src/taglib/taglib-config.in b/lib-src/taglib/taglib-config.in
new file mode 100644
index 0000000..10b9779
--- /dev/null
+++ b/lib-src/taglib/taglib-config.in
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+usage()
+{
+	echo "usage: $0 [OPTIONS]"
+cat << EOH
+
+options:
+	[--libs]
+	[--cflags]
+	[--version]
+	[--prefix]
+EOH
+	exit 1;
+}
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+flags=""
+
+if test $# -eq 0 ; then
+  usage
+fi
+
+while test $# -gt 0
+do
+  case $1 in
+    --libs)
+	  flags="$flags -L$libdir -ltag"
+	  ;;
+    --cflags)
+	  flags="$flags -I$includedir/taglib"
+	  ;;
+    --version)
+	  echo 1.5
+	  ;;
+    --prefix)
+	  echo $prefix
+	  ;;
+	*)
+	  echo "$0: unknown option $1"
+	  echo
+	  usage
+	  ;;
+  esac
+  shift
+done
+
+if test -n "$flags"
+then
+  echo $flags
+fi
diff --git a/lib-src/taglib/taglib.pc b/lib-src/taglib/taglib.pc
new file mode 100644
index 0000000..1b302cd
--- /dev/null
+++ b/lib-src/taglib/taglib.pc
@@ -0,0 +1,11 @@
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: TagLib
+Description: Audio meta-data library
+Requires: 
+Version: 1.5
+Libs: -L${libdir} -ltag
+Cflags: -I${includedir}/taglib 
diff --git a/lib-src/taglib/taglib.pc.cmake b/lib-src/taglib/taglib.pc.cmake
new file mode 100644
index 0000000..909b8fc
--- /dev/null
+++ b/lib-src/taglib/taglib.pc.cmake
@@ -0,0 +1,11 @@
+prefix=${CMAKE_INSTALL_PREFIX}
+exec_prefix=${CMAKE_INSTALL_PREFIX}
+libdir=${LIB_INSTALL_DIR}
+includedir=${INCLUDE_INSTALL_DIR}
+
+Name: TagLib
+Description: Audio meta-data library
+Requires: 
+Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
+Libs: -L${LIB_INSTALL_DIR} -ltag
+Cflags: -I${INCLUDE_INSTALL_DIR}/taglib 
diff --git a/lib-src/taglib/taglib.pc.in b/lib-src/taglib/taglib.pc.in
new file mode 100644
index 0000000..93d0a41
--- /dev/null
+++ b/lib-src/taglib/taglib.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TagLib
+Description: Audio meta-data library
+Requires: 
+Version: 1.5
+Libs: -L${libdir} -ltag
+Cflags: -I${includedir}/taglib 
diff --git a/lib-src/taglib/taglib/.deps/audioproperties.Plo b/lib-src/taglib/taglib/.deps/audioproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/.deps/audioproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/.deps/fileref.Plo b/lib-src/taglib/taglib/.deps/fileref.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/.deps/fileref.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/.deps/tag.Plo b/lib-src/taglib/taglib/.deps/tag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/.deps/tag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/.deps/tagunion.Plo b/lib-src/taglib/taglib/.deps/tagunion.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/.deps/tagunion.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/CMakeLists.txt b/lib-src/taglib/taglib/CMakeLists.txt
new file mode 100644
index 0000000..2483270
--- /dev/null
+++ b/lib-src/taglib/taglib/CMakeLists.txt
@@ -0,0 +1,206 @@
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+INCLUDE_DIRECTORIES(
+    ${CMAKE_CURRENT_SOURCE_DIR}/toolkit
+    ${CMAKE_CURRENT_SOURCE_DIR}/asf
+    ${CMAKE_CURRENT_SOURCE_DIR}/mpeg
+    ${CMAKE_CURRENT_SOURCE_DIR}/ogg
+    ${CMAKE_CURRENT_SOURCE_DIR}/ogg/flac
+    ${CMAKE_CURRENT_SOURCE_DIR}/flac
+    ${CMAKE_CURRENT_SOURCE_DIR}/mpc
+    ${CMAKE_CURRENT_SOURCE_DIR}/mp4
+    ${CMAKE_CURRENT_SOURCE_DIR}/ogg/vorbis
+    ${CMAKE_CURRENT_SOURCE_DIR}/ogg/speex
+    ${CMAKE_CURRENT_SOURCE_DIR}/mpeg/id3v2
+    ${CMAKE_CURRENT_SOURCE_DIR}/mpeg/id3v1
+    ${CMAKE_CURRENT_SOURCE_DIR}/ape
+    ${CMAKE_CURRENT_SOURCE_DIR}/wavpack
+    ${CMAKE_CURRENT_SOURCE_DIR}/trueaudio
+    ${CMAKE_CURRENT_SOURCE_DIR}/riff
+    ${CMAKE_CURRENT_SOURCE_DIR}/riff/aiff
+    ${CMAKE_CURRENT_SOURCE_DIR}/riff/wav
+    ${CMAKE_CURRENT_BINARY_DIR}/taglib
+    ${CMAKE_CURRENT_BINARY_DIR}/..
+)
+if(ZLIB_FOUND)
+    INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+endif(ZLIB_FOUND)
+
+ADD_SUBDIRECTORY( toolkit )
+ADD_SUBDIRECTORY( asf )
+ADD_SUBDIRECTORY( mpeg )
+ADD_SUBDIRECTORY( ogg )
+ADD_SUBDIRECTORY( flac )
+ADD_SUBDIRECTORY( ape )
+ADD_SUBDIRECTORY( mpc )
+ADD_SUBDIRECTORY( mp4 )
+ADD_SUBDIRECTORY( wavpack )
+ADD_SUBDIRECTORY( trueaudio )
+ADD_SUBDIRECTORY( riff )
+
+########### next target ###############
+
+SET(mpeg_SRCS
+mpeg/mpegfile.cpp
+mpeg/mpegproperties.cpp
+mpeg/mpegheader.cpp
+mpeg/xingheader.cpp
+)
+
+SET(id3v1_SRCS
+mpeg/id3v1/id3v1tag.cpp
+mpeg/id3v1/id3v1genres.cpp
+)
+
+
+SET(id3v2_SRCS
+mpeg/id3v2/id3v2framefactory.cpp
+mpeg/id3v2/id3v2synchdata.cpp
+mpeg/id3v2/id3v2tag.cpp
+mpeg/id3v2/id3v2header.cpp
+mpeg/id3v2/id3v2frame.cpp
+mpeg/id3v2/id3v2footer.cpp
+mpeg/id3v2/id3v2extendedheader.cpp
+)
+
+
+SET(frames_SRCS
+mpeg/id3v2/frames/attachedpictureframe.cpp
+mpeg/id3v2/frames/commentsframe.cpp
+mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp
+mpeg/id3v2/frames/popularimeterframe.cpp
+mpeg/id3v2/frames/privateframe.cpp
+mpeg/id3v2/frames/relativevolumeframe.cpp
+mpeg/id3v2/frames/textidentificationframe.cpp
+mpeg/id3v2/frames/uniquefileidentifierframe.cpp
+mpeg/id3v2/frames/unknownframe.cpp
+mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp
+mpeg/id3v2/frames/urllinkframe.cpp
+)
+
+SET(ogg_SRCS
+ogg/oggfile.cpp
+ogg/oggpage.cpp
+ogg/oggpageheader.cpp
+ogg/xiphcomment.cpp
+)
+
+SET(vorbis_SRCS
+ogg/vorbis/vorbisfile.cpp
+ogg/vorbis/vorbisproperties.cpp
+)
+
+
+SET(flacs_SRCS
+flac/flacfile.cpp
+flac/flacproperties.cpp
+)
+
+SET(oggflacs_SRCS
+ogg/flac/oggflacfile.cpp
+)
+
+SET(mpc_SRCS
+mpc/mpcfile.cpp
+mpc/mpcproperties.cpp
+)
+
+IF(WITH_MP4)
+SET(mp4_SRCS
+mp4/mp4file.cpp
+mp4/mp4atom.cpp
+mp4/mp4tag.cpp
+mp4/mp4item.cpp
+mp4/mp4properties.cpp
+)
+ELSE(WITH_MP4)
+SET(mp4_SRCS)
+ENDIF(WITH_MP4)
+
+SET(ape_SRCS
+ape/apetag.cpp
+ape/apefooter.cpp
+ape/apeitem.cpp
+)
+
+SET(wavpack_SRCS
+wavpack/wavpackfile.cpp
+wavpack/wavpackproperties.cpp
+)
+
+SET(speex_SRCS
+ogg/speex/speexfile.cpp
+ogg/speex/speexproperties.cpp
+)
+
+SET(trueaudio_SRCS
+trueaudio/trueaudiofile.cpp
+trueaudio/trueaudioproperties.cpp
+)
+
+IF(WITH_ASF)
+SET(asf_SRCS
+asf/asftag.cpp
+asf/asffile.cpp
+asf/asfproperties.cpp
+asf/asfattribute.cpp
+)
+ELSE(WITH_ASF)
+SET(asf_SRCS)
+ENDIF(WITH_ASF)
+
+SET(riff_SRCS
+riff/rifffile.cpp
+)
+
+SET(aiff_SRCS
+riff/aiff/aifffile.cpp
+riff/aiff/aiffproperties.cpp
+)
+
+SET(wav_SRCS
+riff/wav/wavfile.cpp
+riff/wav/wavproperties.cpp
+)
+
+SET(toolkit_SRCS
+toolkit/tstring.cpp
+toolkit/tstringlist.cpp
+toolkit/tbytevector.cpp
+toolkit/tbytevectorlist.cpp
+toolkit/tfile.cpp
+toolkit/tdebug.cpp
+toolkit/unicode.cpp
+)
+
+SET(tag_LIB_SRCS ${mpeg_SRCS} ${id3v1_SRCS} ${id3v2_SRCS} ${frames_SRCS} ${ogg_SRCS}
+		 ${vorbis_SRCS} ${oggflacs_SRCS} ${mpc_SRCS} ${ape_SRCS} ${toolkit_SRCS} ${flacs_SRCS}
+		 ${wavpack_SRCS} ${speex_SRCS} ${trueaudio_SRCS} ${riff_SRCS} ${aiff_SRCS} ${wav_SRCS}
+		 ${mp4_SRCS} ${asf_SRCS}
+		 tag.cpp
+		 tagunion.cpp
+		 fileref.cpp
+		 audioproperties.cpp
+)
+
+
+ADD_LIBRARY(tag SHARED ${tag_LIB_SRCS})
+
+TARGET_LINK_LIBRARIES(tag )
+if(ZLIB_FOUND)
+	TARGET_LINK_LIBRARIES(tag ${ZLIB_LIBRARIES})
+endif(ZLIB_FOUND)
+
+SET_TARGET_PROPERTIES(tag PROPERTIES
+        VERSION ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
+        SOVERSION ${TAGLIB_LIB_MAJOR_VERSION}
+        INSTALL_NAME_DIR ${LIB_INSTALL_DIR}
+        DEFINE_SYMBOL MAKE_TAGLIB_LIB
+)
+INSTALL(TARGETS tag
+	LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+	RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+	ARCHIVE DESTINATION  ${LIB_INSTALL_DIR}
+)
+
+INSTALL( FILES  tag.h fileref.h audioproperties.h taglib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/Makefile.am b/lib-src/taglib/taglib/Makefile.am
new file mode 100644
index 0000000..38f9d70
--- /dev/null
+++ b/lib-src/taglib/taglib/Makefile.am
@@ -0,0 +1,33 @@
+SUBDIRS = toolkit mpeg ogg flac ape mpc wavpack trueaudio riff asf mp4
+
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/ogg/flac \
+	-I$(top_srcdir)/taglib/flac \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/asf \
+	-I$(top_srcdir)/taglib/mp4 \
+	-I$(top_srcdir)/taglib/ogg/vorbis \
+	-I$(top_srcdir)/taglib/ogg/speex \
+	-I$(top_srcdir)/taglib/wavpack \
+	-I$(top_srcdir)/taglib/trueaudio \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/riff/aiff \
+	-I$(top_srcdir)/taglib/riff/wav \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+lib_LTLIBRARIES = libtag.la
+
+libtag_la_SOURCES = tag.cpp tagunion.cpp fileref.cpp audioproperties.cpp
+taglib_include_HEADERS = tag.h fileref.h audioproperties.h taglib_export.h
+taglib_includedir = $(includedir)/taglib
+
+libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 6:0:5
+libtag_la_LIBADD = ./mpeg/libmpeg.la ./ogg/libogg.la ./flac/libflac.la ./mpc/libmpc.la \
+	./ape/libape.la ./toolkit/libtoolkit.la ./wavpack/libwavpack.la \
+	./trueaudio/libtrueaudio.la ./riff/libriff.la \
+	./mp4/libmp4.la ./asf/libasf.la
diff --git a/lib-src/taglib/taglib/Makefile.in b/lib-src/taglib/taglib/Makefile.in
new file mode 100644
index 0000000..5a20cbc
--- /dev/null
+++ b/lib-src/taglib/taglib/Makefile.in
@@ -0,0 +1,802 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" \
+	"$(DESTDIR)$(taglib_includedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libtag_la_DEPENDENCIES = ./mpeg/libmpeg.la ./ogg/libogg.la \
+	./flac/libflac.la ./mpc/libmpc.la ./ape/libape.la \
+	./toolkit/libtoolkit.la ./wavpack/libwavpack.la \
+	./trueaudio/libtrueaudio.la ./riff/libriff.la ./mp4/libmp4.la \
+	./asf/libasf.la
+am_libtag_la_OBJECTS = tag.lo tagunion.lo fileref.lo \
+	audioproperties.lo
+#>- libtag_la_OBJECTS = $(am_libtag_la_OBJECTS)
+#>+ 5
+libtag_la_final_OBJECTS = libtag_la.all_cpp.lo 
+libtag_la_nofinal_OBJECTS = tag.lo tagunion.lo fileref.lo \
+	audioproperties.lo
+ at KDE_USE_FINAL_FALSE@libtag_la_OBJECTS = $(libtag_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libtag_la_OBJECTS = $(libtag_la_final_OBJECTS)
+#>- libtag_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+#>- 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+#>- 	$(CXXFLAGS) $(libtag_la_LDFLAGS) $(LDFLAGS) -o $@
+#>+ 3
+libtag_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(KDE_CXXFLAGS) $(libtag_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libtag_la_SOURCES)
+DIST_SOURCES = $(libtag_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = toolkit mpeg ogg flac ape mpc wavpack trueaudio riff asf mp4
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/ogg/flac \
+	-I$(top_srcdir)/taglib/flac \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/asf \
+	-I$(top_srcdir)/taglib/mp4 \
+	-I$(top_srcdir)/taglib/ogg/vorbis \
+	-I$(top_srcdir)/taglib/ogg/speex \
+	-I$(top_srcdir)/taglib/wavpack \
+	-I$(top_srcdir)/taglib/trueaudio \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/riff/aiff \
+	-I$(top_srcdir)/taglib/riff/wav \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+lib_LTLIBRARIES = libtag.la
+libtag_la_SOURCES = tag.cpp tagunion.cpp fileref.cpp audioproperties.cpp
+taglib_include_HEADERS = tag.h fileref.h audioproperties.h taglib_export.h
+taglib_includedir = $(includedir)/taglib
+libtag_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 6:0:5
+libtag_la_LIBADD = ./mpeg/libmpeg.la ./ogg/libogg.la ./flac/libflac.la ./mpc/libmpc.la \
+	./ape/libape.la ./toolkit/libtoolkit.la ./wavpack/libwavpack.la \
+	./trueaudio/libtrueaudio.la ./riff/libriff.la \
+	./mp4/libmp4.la ./asf/libasf.la
+
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libtag.la: $(libtag_la_OBJECTS) $(libtag_la_DEPENDENCIES) 
+	$(libtag_la_LINK) -rpath $(libdir) $(libtag_la_OBJECTS) $(libtag_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/audioproperties.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fileref.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tag.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tagunion.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES uninstall-taglib_includeHEADERS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	install-taglib_includeHEADERS installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-libLTLIBRARIES uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in tagunion.h taglib.pro Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libtag_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/tag.cpp $(srcdir)/tagunion.cpp $(srcdir)/fileref.cpp $(srcdir)/audioproperties.cpp 
+	@echo 'creating libtag_la.all_cpp.cpp ...'; \
+	rm -f libtag_la.all_cpp.files libtag_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libtag_la.all_cpp.final; \
+	for file in tag.cpp tagunion.cpp fileref.cpp audioproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libtag_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libtag_la.all_cpp.final; \
+	done; \
+	cat libtag_la.all_cpp.final libtag_la.all_cpp.files > libtag_la.all_cpp.cpp; \
+	rm -f libtag_la.all_cpp.final libtag_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libtag_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libtag_la_OBJECTS="$(libtag_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libtag_la_OBJECTS="$(libtag_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libtag_la_OBJECTS="$(libtag_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libtag_la_OBJECTS="$(libtag_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ape/.deps/apefooter.Plo b/lib-src/taglib/taglib/ape/.deps/apefooter.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/.deps/apefooter.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ape/.deps/apeitem.Plo b/lib-src/taglib/taglib/ape/.deps/apeitem.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/.deps/apeitem.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ape/.deps/apetag.Plo b/lib-src/taglib/taglib/ape/.deps/apetag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/.deps/apetag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ape/CMakeLists.txt b/lib-src/taglib/taglib/ape/CMakeLists.txt
new file mode 100644
index 0000000..ce7d1c3
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  apetag.h apefooter.h apeitem.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/ape/Makefile.am b/lib-src/taglib/taglib/ape/Makefile.am
new file mode 100644
index 0000000..1499938
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libape.la
+
+libape_la_SOURCES = apetag.cpp apefooter.cpp apeitem.cpp
+
+taglib_include_HEADERS = apetag.h apefooter.h apeitem.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/ape/Makefile.in b/lib-src/taglib/taglib/ape/Makefile.in
new file mode 100644
index 0000000..85bd74b
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/Makefile.in
@@ -0,0 +1,623 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/ape
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libape_la_LIBADD =
+am_libape_la_OBJECTS = apetag.lo apefooter.lo apeitem.lo
+#>- libape_la_OBJECTS = $(am_libape_la_OBJECTS)
+#>+ 4
+libape_la_final_OBJECTS = libape_la.all_cpp.lo 
+libape_la_nofinal_OBJECTS = apetag.lo apefooter.lo apeitem.lo
+ at KDE_USE_FINAL_FALSE@libape_la_OBJECTS = $(libape_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libape_la_OBJECTS = $(libape_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libape_la_SOURCES)
+DIST_SOURCES = $(libape_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libape.la
+libape_la_SOURCES = apetag.cpp apefooter.cpp apeitem.cpp
+taglib_include_HEADERS = apetag.h apefooter.h apeitem.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ape/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/ape/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ape/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ape/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ape/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libape.la: $(libape_la_OBJECTS) $(libape_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libape_la_OBJECTS) $(libape_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/apefooter.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/apeitem.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/apetag.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in ape-tag-format.txt Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ape/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ape/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ape/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libape_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/apetag.cpp $(srcdir)/apefooter.cpp $(srcdir)/apeitem.cpp 
+	@echo 'creating libape_la.all_cpp.cpp ...'; \
+	rm -f libape_la.all_cpp.files libape_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libape_la.all_cpp.final; \
+	for file in apetag.cpp apefooter.cpp apeitem.cpp ; do \
+	  echo "#include \"$$file\"" >> libape_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libape_la.all_cpp.final; \
+	done; \
+	cat libape_la.all_cpp.final libape_la.all_cpp.files > libape_la.all_cpp.cpp; \
+	rm -f libape_la.all_cpp.final libape_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libape_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libape_la_OBJECTS="$(libape_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libape_la_OBJECTS="$(libape_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libape_la_OBJECTS="$(libape_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libape_la_OBJECTS="$(libape_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ape/ape-tag-format.txt b/lib-src/taglib/taglib/ape/ape-tag-format.txt
new file mode 100644
index 0000000..21ff1c8
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/ape-tag-format.txt
@@ -0,0 +1,170 @@
+================================================================================
+= APE Tag Specification, Version 2.000
+================================================================================
+
+Original Content     (C) 2004, Frank Klemm <frank.klemm at elster.offl.uni-jena.de>
+Formatting / Editing (C) 2004, Scott Wheeler <wheeler at kde.org>
+
+================================================================================
+= Contents
+================================================================================
+
+1   - APE Tag General Structure
+2   - APE Tag Header / Footer Format
+3   - APE Tag Flags
+4   - APE Tag Item Format
+5   - APE Tag Item Supported Keys
+6   - APE Tag Item Content
+7   - Data Types
+7.1 - Data Types / UTF-8
+7.2 - Data Types / Dates
+7.3 - Data Types / Timestamps
+
+================================================================================
+= 1 - APE Tag General Structure
+================================================================================
+
+Member of Basic Components of SV8 Stream Note:
+
+It is strongly recommended that the data size be stored in the tags.  The size
+should normally be in the roughly one kilobyte, never more than 8 kilobytes.
+
+Larger data should be stored externally using link entries.  Linked data is much
+easier to process by normal programs, so for instance JPEG data should not be
+included inside the audio file.
+
+APE Tag Version 2.000 (with header, recommended):
+
+/================================\
+| APE Tag Header    | 32 bytes   |
+|-------------------|------------|
+| APE Tag Item 1    | > 10 bytes |
+| APE Tag Item 2    | > 10 bytes |
+| APE Tag Item n-1  | > 10 bytes |
+| APE Tag Item n    | > 10 bytes |
+|-------------------|------------|
+| APE Tag Footer    | 32 bytes   |
+\================================/
+
+
+APE tag items should be sorted ascending by size.  When streaming, parts of the
+APE tag may be dropped to reduce the danger of drop outs between tracks.  This
+is not required, but is strongly recommended.  It would be desirable for the i
+tems to be sorted by importance / size, but this is not feasible.  This
+convention should only be broken when adding less important small items and it
+is not desirable to rewrite the entire tag.  An APE tag at the end of a file
+(the recommended location) must have at least a footer; an APE tag at the
+beginning of a file (strongly discouraged) must have at least a header.
+
+APE Tag Version 1.000 (without header, deprecated)
+
+/================================\
+| APE Tag Item 1    | > 10 bytes |
+| APE Tag Item 2    | > 10 bytes |
+| APE Tag Item n-1  | > 10 bytes |
+| APE Tag Item n    | > 10 bytes |
+|-------------------|------------|
+| APE Tag Footer    | 32 bytes   |
+\================================/
+
+================================================================================
+= 2 - APE Tag Header / Footer Format
+================================================================================
+
+Contains number, length and attributes of all tag items
+
+Header and Footer are different in 1 bit in the Tags Flags to distinguish
+between them.
+
+Member of APE Tag 2.0
+
+/===========================================================================\
+| Preamble       | 8 bytes | { 'A', 'P', 'E', 'T', 'A', 'G', 'E', 'X' }     |
+|----------------|---------|------------------------------------------------|
+| Version Number | 4 bytes | 1000 = Version 1.000, 2000 = Version 2.000     |
+|----------------|---------|------------------------------------------------|
+| Tag Size       | 4 bytes | Tag size in bytes including footer and all tag |
+|                |         | items excluding the header (for 1.000          |
+|                |         | compatibility)                                 |
+|----------------|---------|------------------------------------------------|
+| Item Count     | 4 bytes | Number of items in the tag                     |
+|----------------|---------|------------------------------------------------|
+| Tag Flags      | 4 bytes | Global flags                                   |
+|----------------|---------|------------------------------------------------|
+| Reserved       | 8 bytes | Must be zeroed                                 |
+\===========================================================================/
+
+================================================================================
+= 3 - APE Tag Flags
+================================================================================
+
+The general flag structure for either items or headers / footers is the same.
+Bits 31, 30 and 29 are specific to headers / footers, whereas 2 through 0 are
+item specific.
+
+Note: APE Tags from Version 1.0 do not use any of the following.  All flags in
+that version are zeroed and ignored when reading.
+
+/=================================================================\
+| Contains Header | Bit 31      | 1 - has header | 0 - no header  |
+|-----------------|-------------|---------------------------------|
+| Contains Footer | Bit 30      | 1 - has footer | 0 - no footer  |
+|-----------------|-------------|---------------------------------|
+| Is Header       | Bit 29      | 1 - is header  | 0 - is footer  |
+|-----------------|-------------|---------------------------------|
+| Undefined       | Bits 28 - 3 | Undefined, must be zeroed       |
+|-----------------|-------------|---------------------------------|
+| Encoding        | Bits 2 - 1  | 00 - UTF-8                      |
+|                 |             | 01 - Binary Data *              |
+|                 |             | 10 - External Reference **      |
+|                 |             | 11 - Reserved                   |
+|-----------------|-------------|---------------------------------|
+| Read Only       | Bit 0       | 1 - read only  | 0 - read/write |
+\=================================================================/
+
+ (*) Should be ignored by tools for editing text values
+(**) Allowed external reference formats:
+     - http://host/directory/filename.ext
+     - ftp://host/directory/filename.ext
+     - filename.ext
+     - /directory/filename.ext
+     - DRIVE:/directory/filename.ext
+
+     Note: External references are also UTF-8 encoded.
+
+================================================================================
+= 4 - APE Tag Item Format
+================================================================================
+
+APE Tag Items are stored as key-value pairs.  APE Tags Item Key are case
+sensitive, however it is illegal to use keys which only differ in case and
+it is recommended that tag reading not be case sensitive.
+
+Every key can only occur (at most) once. It is not possible to repeat a key
+to signify updated contents.
+
+Tags can be partially or completely repeated in the streaming format.  This
+makes it possible to display an artist and / or title if it was missed at the
+beginning of the stream.  It is recommended that the important information like
+artist, album and title should occur approximately every 2 minutes in the
+stream and again 5 to 10 seconds before the end.  However, care should be tak
+en not to replicate this information too often or during passages with high
+bitrate demands to avoid unnecessary drop-outs.
+
+/==============================================================================\
+| Content Size   | 4 bytes       | Length of the value in bytes                |
+|----------------|---------------|---------------------------------------------|
+| Flags          | 4 bytes       | Item flags                                  |
+|----------------|---------------|---------------------------------------------|
+| Key            | 2 - 255 bytes | Item key                                    |
+|----------------|---------------|---------------------------------------------|
+| Key Terminator | 1 byte        | Null byte that indicates the end of the key |
+|----------------|---------------|---------------------------------------------|
+| Value          | variable      | Content (formatted according to the flags)  |
+\==============================================================================/
+
+================================================================================
+
+Sections 5 - 7 haven't yet been converted from:
+
+http://www.personal.uni-jena.de/~pfk/mpp/sv8/apetag.html
diff --git a/lib-src/taglib/taglib/ape/apefooter.cpp b/lib-src/taglib/taglib/ape/apefooter.cpp
new file mode 100644
index 0000000..da6494b
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apefooter.cpp
@@ -0,0 +1,236 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+                           (C) 2002 - 2008 by Scott Wheeler (id3v2header.cpp)
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <iostream>
+#include <bitset>
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "apefooter.h"
+
+using namespace TagLib;
+using namespace APE;
+
+class Footer::FooterPrivate
+{
+public:
+  FooterPrivate() : version(0),
+                    footerPresent(true),
+                    headerPresent(false),
+                    isHeader(false),
+                    itemCount(0),
+                    tagSize(0) {}
+
+  ~FooterPrivate() {}
+
+  uint version;
+
+  bool footerPresent;
+  bool headerPresent;
+
+  bool isHeader;
+
+  uint itemCount;
+  uint tagSize;
+
+  static const uint size = 32;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members
+////////////////////////////////////////////////////////////////////////////////
+
+TagLib::uint Footer::size()
+{
+  return FooterPrivate::size;
+}
+
+ByteVector Footer::fileIdentifier()
+{
+  return ByteVector::fromCString("APETAGEX");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Footer::Footer()
+{
+  d = new FooterPrivate;
+}
+
+Footer::Footer(const ByteVector &data)
+{
+  d = new FooterPrivate;
+  parse(data);
+}
+
+Footer::~Footer()
+{
+  delete d;
+}
+
+TagLib::uint Footer::version() const
+{
+  return d->version;
+}
+
+bool Footer::headerPresent() const
+{
+  return d->headerPresent;
+}
+
+bool Footer::footerPresent() const
+{
+  return d->footerPresent;
+}
+
+bool Footer::isHeader() const
+{
+  return d->isHeader;
+}
+
+void Footer::setHeaderPresent(bool b) const
+{
+  d->headerPresent = b;
+}
+
+TagLib::uint Footer::itemCount() const
+{
+  return d->itemCount;
+}
+
+void Footer::setItemCount(uint s)
+{
+  d->itemCount = s;
+}
+
+TagLib::uint Footer::tagSize() const
+{
+  return d->tagSize;
+}
+
+TagLib::uint Footer::completeTagSize() const
+{
+  if(d->headerPresent)
+    return d->tagSize + d->size;
+  else
+    return d->tagSize;
+}
+
+void Footer::setTagSize(uint s)
+{
+  d->tagSize = s;
+}
+
+void Footer::setData(const ByteVector &data)
+{
+  parse(data);
+}
+
+ByteVector Footer::renderFooter() const
+{
+    return render(false);
+}
+
+ByteVector Footer::renderHeader() const
+{
+    if (!d->headerPresent) return ByteVector();
+
+    return render(true);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void Footer::parse(const ByteVector &data)
+{
+  if(data.size() < size())
+    return;
+
+  // The first eight bytes, data[0..7], are the File Identifier, "APETAGEX".
+
+  // Read the version number
+
+  d->version = data.mid(8, 4).toUInt(false);
+
+  // Read the tag size
+
+  d->tagSize = data.mid(12, 4).toUInt(false);
+
+  // Read the item count
+
+  d->itemCount = data.mid(16, 4).toUInt(false);
+
+  // Read the flags
+
+  std::bitset<32> flags(data.mid(20, 4).toUInt(false));
+
+  d->headerPresent = flags[31];
+  d->footerPresent = !flags[30];
+  d->isHeader = flags[29];
+
+}
+
+ByteVector Footer::render(bool isHeader) const
+{
+  ByteVector v;
+
+  // add the file identifier -- "APETAGEX"
+
+  v.append(fileIdentifier());
+
+  // add the version number -- we always render a 2.000 tag regardless of what
+  // the tag originally was.
+
+  v.append(ByteVector::fromUInt(2000, false));
+
+  // add the tag size
+
+  v.append(ByteVector::fromUInt(d->tagSize, false));
+
+  // add the item count
+
+  v.append(ByteVector::fromUInt(d->itemCount, false));
+
+  // render and add the flags
+
+  std::bitset<32> flags;
+
+  flags[31] = d->headerPresent;
+  flags[30] = false; // footer is always present
+  flags[29] = isHeader;
+
+  v.append(ByteVector::fromUInt(flags.to_ulong(), false));
+
+  // add the reserved 64bit
+
+  v.append(ByteVector::fromLongLong(0));
+
+  return v;
+}
diff --git a/lib-src/taglib/taglib/ape/apefooter.h b/lib-src/taglib/taglib/ape/apefooter.h
new file mode 100644
index 0000000..f0d921f
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apefooter.h
@@ -0,0 +1,173 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_APEFOOTER_H
+#define TAGLIB_APEFOOTER_H
+
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace APE {
+
+    //! An implementation of APE footers
+
+    /*!
+     * This class implements APE footers (and headers). It attempts to follow, both
+     * semantically and programatically, the structure specified in
+     * the APE v2.0 standard.  The API is based on the properties of APE footer and
+     * headers specified there.
+     */
+
+    class TAGLIB_EXPORT Footer
+    {
+    public:
+      /*!
+       * Constructs an empty APE footer.
+       */
+      Footer();
+
+      /*!
+       * Constructs an APE footer based on \a data.  parse() is called
+       * immediately.
+       */
+      Footer(const ByteVector &data);
+
+      /*!
+       * Destroys the footer.
+       */
+      virtual ~Footer();
+
+      /*!
+       * Returns the version number.  (Note: This is the 1000 or 2000.)
+       */
+      uint version() const;
+
+      /*!
+       * Returns true if a header is present in the tag.
+       */
+      bool headerPresent() const;
+
+      /*!
+       * Returns true if a footer is present in the tag.
+       */
+      bool footerPresent() const;
+
+      /*!
+       * Returns true this is actually the header.
+       */
+      bool isHeader() const;
+
+      /*!
+       * Sets whether the header should be rendered or not
+       */
+      void setHeaderPresent(bool b) const;
+
+      /*!
+       * Returns the number of items in the tag.
+       */
+      uint itemCount() const;
+
+      /*!
+       * Set the item count to \a s.
+       * \see itemCount()
+       */
+      void setItemCount(uint s);
+
+      /*!
+       * Returns the tag size in bytes.  This is the size of the frame content and footer.
+       * The size of the \e entire tag will be this plus the header size, if present.
+       *
+       * \see completeTagSize()
+       */
+      uint tagSize() const;
+
+      /*!
+       * Returns the tag size, including if present, the header
+       * size.
+       *
+       * \see tagSize()
+       */
+      uint completeTagSize() const;
+
+      /*!
+       * Set the tag size to \a s.
+       * \see tagSize()
+       */
+      void setTagSize(uint s);
+
+      /*!
+       * Returns the size of the footer.  Presently this is always 32 bytes.
+       */
+      static uint size();
+
+      /*!
+       * Returns the string used to identify an APE tag inside of a file.
+       * Presently this is always "APETAGEX".
+       */
+      static ByteVector fileIdentifier();
+
+      /*!
+       * Sets the data that will be used as the footer.  32 bytes,
+       * starting from \a data will be used.
+       */
+      void setData(const ByteVector &data);
+
+      /*!
+       * Renders the footer back to binary format.
+       */
+      ByteVector renderFooter() const;
+
+      /*!
+       * Renders the header corresponding to the footer. If headerPresent is
+       * set to false, it returns an empty ByteVector.
+       */
+      ByteVector renderHeader() const;
+
+    protected:
+      /*!
+       * Called by setData() to parse the footer data.  It makes this information
+       * available through the public API.
+       */
+      void parse(const ByteVector &data);
+
+      /*!
+       * Called by renderFooter and renderHeader
+       */
+      ByteVector render(bool isHeader) const;
+
+    private:
+      Footer(const Footer &);
+      Footer &operator=(const Footer &);
+
+      class FooterPrivate;
+      FooterPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ape/apeitem.cpp b/lib-src/taglib/taglib/ape/apeitem.cpp
new file mode 100644
index 0000000..77a9ca0
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apeitem.cpp
@@ -0,0 +1,230 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <tdebug.h>
+
+#include "apeitem.h"
+
+using namespace TagLib;
+using namespace APE;
+
+class APE::Item::ItemPrivate
+{
+public:
+  ItemPrivate() : type(Text), readOnly(false) {}
+
+  Item::ItemTypes type;
+  String key;
+  ByteVector value;
+  StringList text;
+  bool readOnly;
+};
+
+APE::Item::Item()
+{
+  d = new ItemPrivate;
+}
+
+APE::Item::Item(const String &key, const String &value)
+{
+  d = new ItemPrivate;
+  d->key = key;
+  d->text.append(value);
+}
+
+APE::Item::Item(const String &key, const StringList &values)
+{
+  d = new ItemPrivate;
+  d->key = key;
+  d->text = values;
+}
+
+APE::Item::Item(const Item &item)
+{
+  d = new ItemPrivate(*item.d);
+}
+
+APE::Item::~Item()
+{
+  delete d;
+}
+
+Item &APE::Item::operator=(const Item &item)
+{
+  delete d;
+  d = new ItemPrivate(*item.d);
+  return *this;
+}
+
+void APE::Item::setReadOnly(bool readOnly)
+{
+  d->readOnly = readOnly;
+}
+
+bool APE::Item::isReadOnly() const
+{
+  return d->readOnly;
+}
+
+void APE::Item::setType(APE::Item::ItemTypes val)
+{
+  d->type = val;
+}
+
+APE::Item::ItemTypes APE::Item::type() const
+{
+  return d->type;
+}
+
+String APE::Item::key() const
+{
+  return d->key;
+}
+
+ByteVector APE::Item::value() const
+{
+  // This seems incorrect as it won't be actually rendering the value to keep it
+  // up to date.
+
+  return d->value;
+}
+
+void APE::Item::setKey(const String &key)
+{
+    d->key = key;
+}
+
+void APE::Item::setValue(const String &value)
+{
+    d->text = value;
+}
+
+void APE::Item::setValues(const StringList &value)
+{
+    d->text = value;
+}
+
+void APE::Item::appendValue(const String &value)
+{
+    d->text.append(value);
+}
+
+void APE::Item::appendValues(const StringList &values)
+{
+    d->text.append(values);
+}
+
+int APE::Item::size() const
+{
+  return 8 + d->key.size() + 1 + d->value.size();
+}
+
+StringList APE::Item::toStringList() const
+{
+  return d->text;
+}
+
+StringList APE::Item::values() const
+{
+  return d->text;
+}
+
+String APE::Item::toString() const
+{
+  return isEmpty() ? String::null : d->text.front();
+}
+
+bool APE::Item::isEmpty() const
+{
+  switch(d->type) {
+    case Text:
+    case Binary:
+      if(d->text.isEmpty())
+        return true;
+      if(d->text.size() == 1 && d->text.front().isEmpty())
+        return true;
+      return false;
+    case Locator:
+      return d->value.isEmpty();
+    default:
+      return false;
+  }
+}
+
+void APE::Item::parse(const ByteVector &data)
+{
+  // 11 bytes is the minimum size for an APE item
+
+  if(data.size() < 11) {
+    debug("APE::Item::parse() -- no data in item");
+    return;
+  }
+
+  uint valueLength  = data.mid(0, 4).toUInt(false);
+  uint flags        = data.mid(4, 4).toUInt(false);
+
+  d->key = String(data.mid(8), String::UTF8);
+
+  d->value = data.mid(8 + d->key.size() + 1, valueLength);
+
+  setReadOnly(flags & 1);
+  setType(ItemTypes((flags >> 1) & 3));
+
+  if(int(d->type) < 2)
+    d->text = StringList(ByteVectorList::split(d->value, '\0'), String::UTF8);
+}
+
+ByteVector APE::Item::render() const
+{
+  ByteVector data;
+  TagLib::uint flags = ((d->readOnly) ? 1 : 0) | (d->type << 1);
+  ByteVector value;
+
+  if(isEmpty())
+    return data;
+
+  if(d->type == Text) {
+    StringList::ConstIterator it = d->text.begin();
+
+    value.append(it->data(String::UTF8));
+    it++;
+    for(; it != d->text.end(); ++it) {
+      value.append('\0');
+      value.append(it->data(String::UTF8));
+    }
+    d->value = value;
+  }
+  else
+    value.append(d->value);
+
+  data.append(ByteVector::fromUInt(value.size(), false));
+  data.append(ByteVector::fromUInt(flags, false));
+  data.append(d->key.data(String::UTF8));
+  data.append(ByteVector('\0'));
+  data.append(value);
+
+  return data;
+}
diff --git a/lib-src/taglib/taglib/ape/apeitem.h b/lib-src/taglib/taglib/ape/apeitem.h
new file mode 100644
index 0000000..8558bb3
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apeitem.h
@@ -0,0 +1,204 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_APEITEM_H
+#define TAGLIB_APEITEM_H
+
+#include "tbytevector.h"
+#include "tstring.h"
+#include "tstringlist.h"
+
+namespace TagLib {
+
+  namespace APE {
+
+    //! An implementation of APE-items
+
+    /*!
+     * This class provides the features of items in the APEv2 standard.
+     */
+    class TAGLIB_EXPORT Item
+    {
+    public:
+      /*!
+       * Enum of types an Item can have. The value of 3 is reserved.
+       */
+      enum ItemTypes {
+        //! Item contains text information coded in UTF-8
+        Text = 0,
+        //! Item contains binary information
+        Binary = 1,
+        //! Item is a locator of external stored information
+        Locator = 2
+      };
+      /*!
+       * Constructs an empty item.
+       */
+      Item();
+
+      /*!
+       * Constructs an item with \a key and \a value.
+       */
+      // BIC: Remove this, StringList has a constructor from a single string
+      Item(const String &key, const String &value);
+
+      /*!
+       * Constructs an item with \a key and \a values.
+       */
+      Item(const String &key, const StringList &values);
+
+      /*!
+       * Construct an item as a copy of \a item.
+       */
+      Item(const Item &item);
+
+      /*!
+       * Destroys the item.
+       */
+      virtual ~Item();
+
+      /*!
+       * Copies the contents of \a item into this item.
+       */
+      Item &operator=(const Item &item);
+
+      /*!
+       * Returns the key.
+       */
+      String key() const;
+
+      /*!
+       * Returns the binary value.
+       *
+       * \deprecated This will be removed in the next binary incompatible version
+       * as it is not kept in sync with the things that are set using setValue()
+       * and friends.
+       */
+      ByteVector value() const;
+
+      /*!
+       * Sets the key for the item to \a key.
+       */
+      void setKey(const String &key);
+
+      /*!
+       * Sets the value of the item to \a value and clears any previous contents.
+       *
+       * \see toString()
+       */
+      void setValue(const String &value);
+
+      /*!
+       * Sets the value of the item to the list of values in \a value and clears
+       * any previous contents.
+       *
+       * \see toStringList()
+       */
+      void setValues(const StringList &values);
+
+      /*!
+       * Appends \a value to create (or extend) the current list of values.
+       *
+       * \see toString()
+       */
+      void appendValue(const String &value);
+
+      /*!
+       * Appends \a values to extend the current list of values.
+       *
+       * \see toStringList()
+       */
+      void appendValues(const StringList &values);
+
+      /*!
+       * Returns the size of the full item.
+       */
+      int size() const;
+
+      /*!
+       * Returns the value as a single string. In case of multiple strings,
+       * the first is returned.
+       */
+      String toString() const;
+
+      /*!
+       * \deprecated
+       * \see values
+       */
+      StringList toStringList() const;
+
+      /*!
+       * Returns the list of values.
+       */
+      StringList values() const;
+
+      /*!
+       * Render the item to a ByteVector.
+       */
+      ByteVector render() const;
+
+      /*!
+       * Parse the item from the ByteVector \a data.
+       */
+      void parse(const ByteVector& data);
+
+      /*!
+       * Set the item to read-only.
+       */
+      void setReadOnly(bool readOnly);
+
+      /*!
+       * Return true if the item is read-only.
+       */
+      bool isReadOnly() const;
+
+      /*!
+       * Sets the type of the item to \a type.
+       *
+       * \see ItemTypes
+       */
+      void setType(ItemTypes type);
+
+      /*!
+       * Returns the type of the item.
+       */
+      ItemTypes type() const;
+
+      /*!
+       * Returns if the item has any real content.
+       */
+      bool isEmpty() const;
+
+    private:
+      class ItemPrivate;
+      ItemPrivate *d;
+    };
+  }
+
+}
+
+#endif
+
+
diff --git a/lib-src/taglib/taglib/ape/apetag.cpp b/lib-src/taglib/taglib/ape/apetag.cpp
new file mode 100644
index 0000000..1c38d2b
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apetag.cpp
@@ -0,0 +1,266 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef __SUNPRO_CC
+// Sun Studio finds multiple specializations of Map because
+// it considers specializations with and without class types
+// to be different; this define forces Map to use only the
+// specialization with the class keyword.
+#define WANT_CLASS_INSTANTIATION_OF_MAP (1)
+#endif
+
+#include <tfile.h>
+#include <tstring.h>
+#include <tmap.h>
+
+#include "apetag.h"
+#include "apefooter.h"
+#include "apeitem.h"
+
+using namespace TagLib;
+using namespace APE;
+
+class APE::Tag::TagPrivate
+{
+public:
+  TagPrivate() : file(0), footerLocation(-1), tagLength(0) {}
+
+  File *file;
+  long footerLocation;
+  long tagLength;
+
+  Footer footer;
+
+  ItemListMap itemListMap;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
+APE::Tag::Tag() : TagLib::Tag()
+{
+  d = new TagPrivate;
+}
+
+APE::Tag::Tag(File *file, long footerLocation) : TagLib::Tag()
+{
+  d = new TagPrivate;
+  d->file = file;
+  d->footerLocation = footerLocation;
+
+  read();
+}
+
+APE::Tag::~Tag()
+{
+  delete d;
+}
+
+ByteVector APE::Tag::fileIdentifier()
+{
+  return ByteVector::fromCString("APETAGEX");
+}
+
+String APE::Tag::title() const
+{
+  if(d->itemListMap["TITLE"].isEmpty())
+    return String::null;
+  return d->itemListMap["TITLE"].toString();
+}
+
+String APE::Tag::artist() const
+{
+  if(d->itemListMap["ARTIST"].isEmpty())
+    return String::null;
+  return d->itemListMap["ARTIST"].toString();
+}
+
+String APE::Tag::album() const
+{
+  if(d->itemListMap["ALBUM"].isEmpty())
+    return String::null;
+  return d->itemListMap["ALBUM"].toString();
+}
+
+String APE::Tag::comment() const
+{
+  if(d->itemListMap["COMMENT"].isEmpty())
+    return String::null;
+  return d->itemListMap["COMMENT"].toString();
+}
+
+String APE::Tag::genre() const
+{
+  if(d->itemListMap["GENRE"].isEmpty())
+    return String::null;
+  return d->itemListMap["GENRE"].toString();
+}
+
+TagLib::uint APE::Tag::year() const
+{
+  if(d->itemListMap["YEAR"].isEmpty())
+    return 0;
+  return d->itemListMap["YEAR"].toString().toInt();
+}
+
+TagLib::uint APE::Tag::track() const
+{
+  if(d->itemListMap["TRACK"].isEmpty())
+    return 0;
+  return d->itemListMap["TRACK"].toString().toInt();
+}
+
+void APE::Tag::setTitle(const String &s)
+{
+  addValue("TITLE", s, true);
+}
+
+void APE::Tag::setArtist(const String &s)
+{
+  addValue("ARTIST", s, true);
+}
+
+void APE::Tag::setAlbum(const String &s)
+{
+  addValue("ALBUM", s, true);
+}
+
+void APE::Tag::setComment(const String &s)
+{
+  addValue("COMMENT", s, true);
+}
+
+void APE::Tag::setGenre(const String &s)
+{
+  addValue("GENRE", s, true);
+}
+
+void APE::Tag::setYear(uint i)
+{
+  if(i <= 0)
+    removeItem("YEAR");
+  else
+    addValue("YEAR", String::number(i), true);
+}
+
+void APE::Tag::setTrack(uint i)
+{
+  if(i <= 0)
+    removeItem("TRACK");
+  else
+    addValue("TRACK", String::number(i), true);
+}
+
+APE::Footer *APE::Tag::footer() const
+{
+  return &d->footer;
+}
+
+const APE::ItemListMap& APE::Tag::itemListMap() const
+{
+  return d->itemListMap;
+}
+
+void APE::Tag::removeItem(const String &key)
+{
+  Map<const String, Item>::Iterator it = d->itemListMap.find(key.upper());
+  if(it != d->itemListMap.end())
+    d->itemListMap.erase(it);
+}
+
+void APE::Tag::addValue(const String &key, const String &value, bool replace)
+{
+  if(replace)
+    removeItem(key);
+  if(!value.isEmpty()) {
+    if(d->itemListMap.contains(key) || !replace)
+      d->itemListMap[key.upper()].appendValue(value);
+    else
+      setItem(key, Item(key, value));
+  }
+}
+
+void APE::Tag::setItem(const String &key, const Item &item)
+{
+  d->itemListMap.insert(key.upper(), item);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected methods
+////////////////////////////////////////////////////////////////////////////////
+
+void APE::Tag::read()
+{
+  if(d->file && d->file->isValid()) {
+
+    d->file->seek(d->footerLocation);
+    d->footer.setData(d->file->readBlock(Footer::size()));
+
+    if(d->footer.tagSize() <= Footer::size() ||
+       d->footer.tagSize() > uint(d->file->length()))
+      return;
+
+    d->file->seek(d->footerLocation + Footer::size() - d->footer.tagSize());
+    parse(d->file->readBlock(d->footer.tagSize() - Footer::size()));
+  }
+}
+
+ByteVector APE::Tag::render() const
+{
+  ByteVector data;
+  uint itemCount = 0;
+
+  {
+    for(Map<const String, Item>::ConstIterator it = d->itemListMap.begin();
+        it != d->itemListMap.end(); ++it)
+    {
+      data.append(it->second.render());
+      itemCount++;
+    }
+  }
+
+  d->footer.setItemCount(itemCount);
+  d->footer.setTagSize(data.size() + Footer::size());
+  d->footer.setHeaderPresent(true);
+
+  return d->footer.renderHeader() + data + d->footer.renderFooter();
+}
+
+void APE::Tag::parse(const ByteVector &data)
+{
+  uint pos = 0;
+
+  // 11 bytes is the minimum size for an APE item
+
+  for(uint i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) {
+    APE::Item item;
+    item.parse(data.mid(pos));
+
+    d->itemListMap.insert(item.key().upper(), item);
+
+    pos += item.size();
+  }
+}
diff --git a/lib-src/taglib/taglib/ape/apetag.h b/lib-src/taglib/taglib/ape/apetag.h
new file mode 100644
index 0000000..03a3c91
--- /dev/null
+++ b/lib-src/taglib/taglib/ape/apetag.h
@@ -0,0 +1,162 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_APETAG_H
+#define TAGLIB_APETAG_H
+
+#include "tag.h"
+#include "tbytevector.h"
+#include "tmap.h"
+#include "tstring.h"
+#include "taglib_export.h"
+
+#include "apeitem.h"
+
+namespace TagLib {
+
+  class File;
+
+  //! An implementation of the APE tagging format
+
+  namespace APE {
+
+    class Footer;
+
+    /*!
+     * A mapping between a list of item names, or keys, and the associated item.
+     *
+     * \see APE::Tag::itemListMap()
+     */
+    typedef Map<const String, Item> ItemListMap;
+
+
+    //! An APE tag implementation
+
+    class TAGLIB_EXPORT Tag : public TagLib::Tag
+    {
+    public:
+      /*!
+       * Create an APE tag with default values.
+       */
+      Tag();
+
+      /*!
+       * Create an APE tag and parse the data in \a file with APE footer at
+       * \a tagOffset.
+       */
+      Tag(File *file, long footerLocation);
+
+      /*!
+       * Destroys this Tag instance.
+       */
+      virtual ~Tag();
+
+      /*!
+       * Renders the in memory values to a ByteVector suitable for writing to
+       * the file.
+       */
+      ByteVector render() const;
+
+      /*!
+       * Returns the string "APETAGEX" suitable for usage in locating the tag in a
+       * file.
+       */
+      static ByteVector fileIdentifier();
+
+      // Reimplementations.
+
+      virtual String title() const;
+      virtual String artist() const;
+      virtual String album() const;
+      virtual String comment() const;
+      virtual String genre() const;
+      virtual uint year() const;
+      virtual uint track() const;
+
+      virtual void setTitle(const String &s);
+      virtual void setArtist(const String &s);
+      virtual void setAlbum(const String &s);
+      virtual void setComment(const String &s);
+      virtual void setGenre(const String &s);
+      virtual void setYear(uint i);
+      virtual void setTrack(uint i);
+
+      /*!
+       * Returns a pointer to the tag's footer.
+       */
+      Footer *footer() const;
+
+      /*!
+       * Returns a reference to the item list map.  This is an ItemListMap of
+       * all of the items in the tag.
+       *
+       * This is the most powerfull structure for accessing the items of the tag.
+       *
+       * \warning You should not modify this data structure directly, instead
+       * use setItem() and removeItem().
+       */
+      const ItemListMap &itemListMap() const;
+
+      /*!
+       * Removes the \a key item from the tag
+       */
+      void removeItem(const String &key);
+
+      /*!
+       * Adds to the item specified by \a key the data \a value.  If \a replace
+       * is true, then all of the other values on the same key will be removed
+       * first.
+       */
+      void addValue(const String &key, const String &value, bool replace = true);
+
+      /*!
+       * Sets the \a key item to the value of \a item. If an item with the \a key is already
+       * present, it will be replaced.
+       */
+      void setItem(const String &key, const Item &item);
+
+    protected:
+
+      /*!
+       * Reads from the file specified in the constructor.
+       */
+      void read();
+
+      /*!
+       * Parses the body of the tag in \a data.
+       */
+      void parse(const ByteVector &data);
+
+    private:
+      Tag(const Tag &);
+      Tag &operator=(const Tag &);
+
+      class TagPrivate;
+      TagPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/.deps/asfattribute.Plo b/lib-src/taglib/taglib/asf/.deps/asfattribute.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/.deps/asfattribute.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/asf/.deps/asffile.Plo b/lib-src/taglib/taglib/asf/.deps/asffile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/.deps/asffile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/asf/.deps/asfproperties.Plo b/lib-src/taglib/taglib/asf/.deps/asfproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/.deps/asfproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/asf/.deps/asftag.Plo b/lib-src/taglib/taglib/asf/.deps/asftag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/.deps/asftag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/asf/CMakeLists.txt b/lib-src/taglib/taglib/asf/CMakeLists.txt
new file mode 100644
index 0000000..1cf3569
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  asffile.h asfproperties.h asftag.h asfattribute.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/asf/Makefile.am b/lib-src/taglib/taglib/asf/Makefile.am
new file mode 100644
index 0000000..0147dca
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libasf.la
+
+libasf_la_SOURCES = asfattribute.cpp asffile.cpp asfproperties.cpp asftag.cpp
+
+taglib_include_HEADERS = asfattribute.h asffile.h asfproperties.h asftag.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/asf/Makefile.in b/lib-src/taglib/taglib/asf/Makefile.in
new file mode 100644
index 0000000..ad37ce2
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/Makefile.in
@@ -0,0 +1,626 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/asf
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libasf_la_LIBADD =
+am_libasf_la_OBJECTS = asfattribute.lo asffile.lo asfproperties.lo \
+	asftag.lo
+#>- libasf_la_OBJECTS = $(am_libasf_la_OBJECTS)
+#>+ 5
+libasf_la_final_OBJECTS = libasf_la.all_cpp.lo 
+libasf_la_nofinal_OBJECTS = asfattribute.lo asffile.lo asfproperties.lo \
+	asftag.lo
+ at KDE_USE_FINAL_FALSE@libasf_la_OBJECTS = $(libasf_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libasf_la_OBJECTS = $(libasf_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libasf_la_SOURCES)
+DIST_SOURCES = $(libasf_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libasf.la
+libasf_la_SOURCES = asfattribute.cpp asffile.cpp asfproperties.cpp asftag.cpp
+taglib_include_HEADERS = asfattribute.h asffile.h asfproperties.h asftag.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/asf/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/asf/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/asf/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/asf/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/asf/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libasf.la: $(libasf_la_OBJECTS) $(libasf_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libasf_la_OBJECTS) $(libasf_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/asfattribute.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/asffile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/asfproperties.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/asftag.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/asf/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/asf/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/asf/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libasf_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/asfattribute.cpp $(srcdir)/asffile.cpp $(srcdir)/asfproperties.cpp $(srcdir)/asftag.cpp 
+	@echo 'creating libasf_la.all_cpp.cpp ...'; \
+	rm -f libasf_la.all_cpp.files libasf_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libasf_la.all_cpp.final; \
+	for file in asfattribute.cpp asffile.cpp asfproperties.cpp asftag.cpp ; do \
+	  echo "#include \"$$file\"" >> libasf_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libasf_la.all_cpp.final; \
+	done; \
+	cat libasf_la.all_cpp.final libasf_la.all_cpp.files > libasf_la.all_cpp.cpp; \
+	rm -f libasf_la.all_cpp.final libasf_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libasf_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libasf_la_OBJECTS="$(libasf_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libasf_la_OBJECTS="$(libasf_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libasf_la_OBJECTS="$(libasf_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libasf_la_OBJECTS="$(libasf_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/asf/asfattribute.cpp b/lib-src/taglib/taglib/asf/asfattribute.cpp
new file mode 100644
index 0000000..a4a4c17
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asfattribute.cpp
@@ -0,0 +1,316 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_ASF
+
+#include <taglib.h>
+#include "asfattribute.h"
+#include "asffile.h"
+
+using namespace TagLib;
+
+class ASF::Attribute::AttributePrivate : public RefCounter
+{
+public:
+  AttributePrivate()
+    : stream(0),
+      language(0) {}
+  AttributeTypes type;
+  String stringValue;
+  ByteVector byteVectorValue;
+  union {
+    unsigned int intValue;
+    unsigned short shortValue;
+    unsigned long long longLongValue;
+    bool boolValue;
+  };
+  int stream;
+  int language;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ASF::Attribute::Attribute()
+{
+  d = new AttributePrivate;
+  d->type = UnicodeType;
+}
+
+ASF::Attribute::Attribute(const ASF::Attribute &other)
+  : d(other.d)
+{
+  d->ref();
+}
+
+ASF::Attribute &
+ASF::Attribute::operator=(const ASF::Attribute &other)
+{
+  if(d->deref())
+    delete d;
+  d = other.d;
+  d->ref();
+  return *this;
+}
+
+ASF::Attribute::~Attribute()
+{
+  if(d->deref())
+    delete d;
+}
+
+ASF::Attribute::Attribute(const String &value)
+{
+  d = new AttributePrivate;
+  d->type = UnicodeType;
+  d->stringValue = value;
+}
+
+ASF::Attribute::Attribute(const ByteVector &value)
+{
+  d = new AttributePrivate;
+  d->type = BytesType;
+  d->byteVectorValue = value;
+}
+
+ASF::Attribute::Attribute(unsigned int value)
+{
+  d = new AttributePrivate;
+  d->type = DWordType;
+  d->intValue = value;
+}
+
+ASF::Attribute::Attribute(unsigned long long value)
+{
+  d = new AttributePrivate;
+  d->type = QWordType;
+  d->longLongValue = value;
+}
+
+ASF::Attribute::Attribute(unsigned short value)
+{
+  d = new AttributePrivate;
+  d->type = WordType;
+  d->shortValue = value;
+}
+
+ASF::Attribute::Attribute(bool value)
+{
+  d = new AttributePrivate;
+  d->type = BoolType;
+  d->boolValue = value;
+}
+
+ASF::Attribute::AttributeTypes
+ASF::Attribute::type() const
+{
+  return d->type;
+}
+
+String
+ASF::Attribute::toString() const
+{
+  return d->stringValue;
+}
+
+ByteVector
+ASF::Attribute::toByteVector() const
+{
+  return d->byteVectorValue;
+}
+
+unsigned short
+ASF::Attribute::toBool() const
+{
+  return d->shortValue;
+}
+
+unsigned short
+ASF::Attribute::toUShort() const
+{
+  return d->shortValue;
+}
+
+unsigned int
+ASF::Attribute::toUInt() const
+{
+  return d->intValue;
+}
+
+unsigned long long
+ASF::Attribute::toULongLong() const
+{
+  return d->longLongValue;
+}
+
+String
+ASF::Attribute::parse(ASF::File &f, int kind)
+{
+  int size, nameLength;
+  String name;
+
+  // extended content descriptor
+  if(kind == 0) {
+    nameLength = f.readWORD();
+    name = f.readString(nameLength);
+    d->type = ASF::Attribute::AttributeTypes(f.readWORD());
+    size = f.readWORD();
+  }
+  // metadata & metadata library
+  else {
+    int temp = f.readWORD();
+    // metadata library
+    if(kind == 2) {
+      d->language = temp;
+    }
+    d->stream = f.readWORD();
+    nameLength = f.readWORD();
+    d->type = ASF::Attribute::AttributeTypes(f.readWORD());
+    size = f.readDWORD();
+    name = f.readString(nameLength);
+  }
+
+  switch(d->type) {
+  case WordType:
+    d->shortValue = f.readWORD();
+    break;
+
+  case BoolType:
+    if(kind == 0) {
+      d->boolValue = f.readDWORD() == 1;
+    }
+    else {
+      d->boolValue = f.readWORD() == 1;
+    }
+    break;
+
+  case DWordType:
+    d->intValue = f.readDWORD();
+    break;
+
+  case QWordType:
+    d->longLongValue = f.readQWORD();
+    break;
+
+  case UnicodeType:
+    d->stringValue = f.readString(size);
+    break;
+
+  case BytesType:
+  case GuidType:
+    d->byteVectorValue = f.readBlock(size);
+    break;
+  }
+
+  return name;
+}
+
+ByteVector
+ASF::Attribute::render(const String &name, int kind) const
+{
+  ByteVector data;
+
+  switch (d->type) {
+  case WordType:
+    data.append(ByteVector::fromShort(d->shortValue, false));
+    break;
+
+  case BoolType:
+    if(kind == 0) {
+      data.append(ByteVector::fromUInt(d->boolValue ? 1 : 0, false));
+    }
+    else {
+      data.append(ByteVector::fromShort(d->boolValue ? 1 : 0, false));
+    }
+    break;
+
+  case DWordType:
+    data.append(ByteVector::fromUInt(d->intValue, false));
+    break;
+
+  case QWordType:
+    data.append(ByteVector::fromLongLong(d->longLongValue, false));
+    break;
+
+  case UnicodeType:
+    data.append(File::renderString(d->stringValue));
+    break;
+
+  case BytesType:
+  case GuidType:
+    data.append(d->byteVectorValue);
+    break;
+  }
+
+  if(kind == 0) {
+    data = File::renderString(name, true) +
+           ByteVector::fromShort((int)d->type, false) +
+           ByteVector::fromShort(data.size(), false) +
+           data;
+  }
+  else {
+    ByteVector nameData = File::renderString(name);
+    data = ByteVector::fromShort(kind == 2 ? d->language : 0, false) +
+           ByteVector::fromShort(d->stream, false) +
+           ByteVector::fromShort(nameData.size(), false) +
+           ByteVector::fromShort((int)d->type, false) +
+           ByteVector::fromUInt(data.size(), false) +
+           nameData +
+           data;
+  }
+
+  return data;
+}
+
+int
+ASF::Attribute::language() const
+{
+  return d->language;
+}
+
+void
+ASF::Attribute::setLanguage(int value)
+{
+  d->language = value;
+}
+
+int
+ASF::Attribute::stream() const
+{
+  return d->stream;
+}
+
+void
+ASF::Attribute::setStream(int value)
+{
+  d->stream = value;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asfattribute.h b/lib-src/taglib/taglib/asf/asfattribute.h
new file mode 100644
index 0000000..7278e90
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asfattribute.h
@@ -0,0 +1,181 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ASFATTRIBUTE_H
+#define TAGLIB_ASFATTRIBUTE_H
+
+#include <tstring.h>
+#include <tbytevector.h>
+#include "taglib_export.h"
+
+namespace TagLib
+{
+
+  namespace ASF
+  {
+
+    class File;
+
+    class TAGLIB_EXPORT Attribute
+    {
+    public:
+
+      /*!
+       * Enum of types an Attribute can have.
+       */
+      enum AttributeTypes {
+        UnicodeType = 0,
+        BytesType   = 1,
+        BoolType    = 2,
+        DWordType   = 3,
+        QWordType   = 4,
+        WordType    = 5,
+        GuidType    = 6
+      };
+
+      /*!
+       * Constructs an empty attribute.
+       */
+      Attribute();
+
+      /*!
+       * Constructs an attribute with \a key and a UnicodeType \a value.
+       */
+      Attribute(const String &value);
+
+      /*!
+       * Constructs an attribute with \a key and a BytesType \a value.
+       */
+      Attribute(const ByteVector &value);
+
+      /*!
+       * Constructs an attribute with \a key and a DWordType \a value.
+       */
+      Attribute(unsigned int value);
+
+      /*!
+       * Constructs an attribute with \a key and a QWordType \a value.
+       */
+      Attribute(unsigned long long value);
+
+      /*!
+       * Constructs an attribute with \a key and a WordType \a value.
+       */
+      Attribute(unsigned short value);
+
+      /*!
+       * Constructs an attribute with \a key and a BoolType \a value.
+       */
+      Attribute(bool value);
+
+      /*!
+       * Construct an attribute as a copy of \a other.
+       */
+      Attribute(const Attribute &item);
+
+      /*!
+       * Copies the contents of \a other into this item.
+       */
+      ASF::Attribute &operator=(const Attribute &other);
+
+      /*!
+       * Destroys the attribute.
+       */
+      virtual ~Attribute();
+
+      /*!
+       * Returns type of the value.
+       */
+      AttributeTypes type() const;
+
+      /*!
+       * Returns the BoolType \a value.
+       */
+      unsigned short toBool() const;
+
+      /*!
+       * Returns the WordType \a value.
+       */
+      unsigned short toUShort() const;
+
+      /*!
+       * Returns the DWordType \a value.
+       */
+      unsigned int toUInt() const;
+
+      /*!
+       * Returns the QWordType \a value.
+       */
+      unsigned long long toULongLong() const;
+
+      /*!
+       * Returns the UnicodeType \a value.
+       */
+      String toString() const;
+
+      /*!
+       * Returns the BytesType \a value.
+       */
+      ByteVector toByteVector() const;
+
+      /*!
+       * Returns the language number, or 0 is no stream number was set.
+       */
+      int language() const;
+
+      /*!
+       * Sets the language number.
+       */
+      void setLanguage(int value);
+
+      /*!
+       * Returns the stream number, or 0 is no stream number was set.
+       */
+      int stream() const;
+
+      /*!
+       * Sets the stream number.
+       */
+      void setStream(int value);
+
+#ifndef DO_NOT_DOCUMENT
+      /* THIS IS PRIVATE, DON'T TOUCH IT! */
+      String parse(ASF::File &file, int kind = 0);
+#endif
+
+    private:
+      friend class File;
+
+      ByteVector render(const String &name, int kind = 0) const;
+
+      class AttributePrivate;
+      AttributePrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asffile.cpp b/lib-src/taglib/taglib/asf/asffile.cpp
new file mode 100644
index 0000000..e403934
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asffile.cpp
@@ -0,0 +1,562 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_ASF
+
+#include <tdebug.h>
+#include <tbytevectorlist.h>
+#include <tstring.h>
+#include "asffile.h"
+#include "asftag.h"
+#include "asfproperties.h"
+
+using namespace TagLib;
+
+class ASF::File::FilePrivate
+{
+public:
+  FilePrivate():
+    size(0),
+    tag(0),
+    properties(0),
+    contentDescriptionObject(0),
+    extendedContentDescriptionObject(0),
+    headerExtensionObject(0),
+    metadataObject(0),
+    metadataLibraryObject(0) {}
+  unsigned long long size;
+  ASF::Tag *tag;
+  ASF::Properties *properties;
+  List<ASF::File::BaseObject *> objects;
+  ASF::File::ContentDescriptionObject *contentDescriptionObject;
+  ASF::File::ExtendedContentDescriptionObject *extendedContentDescriptionObject;
+  ASF::File::HeaderExtensionObject *headerExtensionObject;
+  ASF::File::MetadataObject *metadataObject;
+  ASF::File::MetadataLibraryObject *metadataLibraryObject;
+};
+
+static ByteVector headerGuid("\x30\x26\xB2\x75\x8E\x66\xCF\x11\xA6\xD9\x00\xAA\x00\x62\xCE\x6C", 16);
+static ByteVector filePropertiesGuid("\xA1\xDC\xAB\x8C\x47\xA9\xCF\x11\x8E\xE4\x00\xC0\x0C\x20\x53\x65", 16);
+static ByteVector streamPropertiesGuid("\x91\x07\xDC\xB7\xB7\xA9\xCF\x11\x8E\xE6\x00\xC0\x0C\x20\x53\x65", 16);
+static ByteVector contentDescriptionGuid("\x33\x26\xB2\x75\x8E\x66\xCF\x11\xA6\xD9\x00\xAA\x00\x62\xCE\x6C", 16);
+static ByteVector extendedContentDescriptionGuid("\x40\xA4\xD0\xD2\x07\xE3\xD2\x11\x97\xF0\x00\xA0\xC9\x5E\xA8\x50", 16);
+static ByteVector headerExtensionGuid("\xb5\x03\xbf_.\xa9\xcf\x11\x8e\xe3\x00\xc0\x0c Se", 16);
+static ByteVector metadataGuid("\xEA\xCB\xF8\xC5\xAF[wH\204g\xAA\214D\xFAL\xCA", 16);
+static ByteVector metadataLibraryGuid("\224\034#D\230\224\321I\241A\x1d\x13NEpT", 16);
+
+class ASF::File::BaseObject
+{
+public:
+  ByteVector data;
+  virtual ~BaseObject() {}
+  virtual ByteVector guid() = 0;
+  virtual void parse(ASF::File *file, unsigned int size);
+  virtual ByteVector render(ASF::File *file);
+};
+
+class ASF::File::UnknownObject : public ASF::File::BaseObject
+{
+  ByteVector myGuid;
+public:
+  UnknownObject(const ByteVector &guid);
+  ByteVector guid();
+};
+
+class ASF::File::FilePropertiesObject : public ASF::File::BaseObject
+{
+public:
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+};
+
+class ASF::File::StreamPropertiesObject : public ASF::File::BaseObject
+{
+public:
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+};
+
+class ASF::File::ContentDescriptionObject : public ASF::File::BaseObject
+{
+public:
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+  ByteVector render(ASF::File *file);
+};
+
+class ASF::File::ExtendedContentDescriptionObject : public ASF::File::BaseObject
+{
+public:
+  ByteVectorList attributeData;
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+  ByteVector render(ASF::File *file);
+};
+
+class ASF::File::MetadataObject : public ASF::File::BaseObject
+{
+public:
+  ByteVectorList attributeData;
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+  ByteVector render(ASF::File *file);
+};
+
+class ASF::File::MetadataLibraryObject : public ASF::File::BaseObject
+{
+public:
+  ByteVectorList attributeData;
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+  ByteVector render(ASF::File *file);
+};
+
+class ASF::File::HeaderExtensionObject : public ASF::File::BaseObject
+{
+public:
+  List<ASF::File::BaseObject *> objects;
+  ByteVector guid();
+  void parse(ASF::File *file, uint size);
+  ByteVector render(ASF::File *file);
+};
+
+void
+ASF::File::BaseObject::parse(ASF::File *file, unsigned int size)
+{
+  data = file->readBlock(size - 24);
+}
+
+ByteVector
+ASF::File::BaseObject::render(ASF::File * /*file*/)
+{
+  return guid() + ByteVector::fromLongLong(data.size() + 24, false) + data;
+}
+
+ASF::File::UnknownObject::UnknownObject(const ByteVector &guid) : myGuid(guid)
+{
+}
+
+ByteVector
+ASF::File::UnknownObject::guid()
+{
+  return myGuid;
+}
+
+ByteVector
+ASF::File::FilePropertiesObject::guid()
+{
+  return filePropertiesGuid;
+}
+
+void
+ASF::File::FilePropertiesObject::parse(ASF::File *file, uint size)
+{
+  BaseObject::parse(file, size);
+  file->d->properties->setLength((int)(data.mid(40, 8).toLongLong(false) / 10000000L - data.mid(56, 8).toLongLong(false) / 1000L));
+}
+
+ByteVector
+ASF::File::StreamPropertiesObject::guid()
+{
+  return streamPropertiesGuid;
+}
+
+void
+ASF::File::StreamPropertiesObject::parse(ASF::File *file, uint size)
+{
+  BaseObject::parse(file, size);
+  file->d->properties->setChannels(data.mid(56, 2).toShort(false));
+  file->d->properties->setSampleRate(data.mid(58, 4).toUInt(false));
+  file->d->properties->setBitrate(data.mid(62, 4).toUInt(false) * 8 / 1000);
+}
+
+ByteVector
+ASF::File::ContentDescriptionObject::guid()
+{
+  return contentDescriptionGuid;
+}
+
+void
+ASF::File::ContentDescriptionObject::parse(ASF::File *file, uint /*size*/)
+{
+  file->d->contentDescriptionObject = this;
+  int titleLength = file->readWORD();
+  int artistLength = file->readWORD();
+  int copyrightLength = file->readWORD();
+  int commentLength = file->readWORD();
+  int ratingLength = file->readWORD();
+  file->d->tag->setTitle(file->readString(titleLength));
+  file->d->tag->setArtist(file->readString(artistLength));
+  file->d->tag->setCopyright(file->readString(copyrightLength));
+  file->d->tag->setComment(file->readString(commentLength));
+  file->d->tag->setRating(file->readString(ratingLength));
+}
+
+ByteVector
+ASF::File::ContentDescriptionObject::render(ASF::File *file)
+{
+  ByteVector v1 = file->renderString(file->d->tag->title());
+  ByteVector v2 = file->renderString(file->d->tag->artist());
+  ByteVector v3 = file->renderString(file->d->tag->copyright());
+  ByteVector v4 = file->renderString(file->d->tag->comment());
+  ByteVector v5 = file->renderString(file->d->tag->rating());
+  data.clear();
+  data.append(ByteVector::fromShort(v1.size(), false));
+  data.append(ByteVector::fromShort(v2.size(), false));
+  data.append(ByteVector::fromShort(v3.size(), false));
+  data.append(ByteVector::fromShort(v4.size(), false));
+  data.append(ByteVector::fromShort(v5.size(), false));
+  data.append(v1);
+  data.append(v2);
+  data.append(v3);
+  data.append(v4);
+  data.append(v5);
+  return BaseObject::render(file);
+}
+
+ByteVector
+ASF::File::ExtendedContentDescriptionObject::guid()
+{
+  return extendedContentDescriptionGuid;
+}
+
+void
+ASF::File::ExtendedContentDescriptionObject::parse(ASF::File *file, uint /*size*/)
+{
+  file->d->extendedContentDescriptionObject = this;
+  int count = file->readWORD();
+  while(count--) {
+    ASF::Attribute attribute;
+    String name = attribute.parse(*file);
+    file->d->tag->addAttribute(name, attribute);
+  }
+}
+
+ByteVector
+ASF::File::ExtendedContentDescriptionObject::render(ASF::File *file)
+{
+  data.clear();
+  data.append(ByteVector::fromShort(attributeData.size(), false));
+  data.append(attributeData.toByteVector(ByteVector::null));
+  return BaseObject::render(file);
+}
+
+ByteVector
+ASF::File::MetadataObject::guid()
+{
+  return metadataGuid;
+}
+
+void
+ASF::File::MetadataObject::parse(ASF::File *file, uint /*size*/)
+{
+  file->d->metadataObject = this;
+  int count = file->readWORD();
+  while(count--) {
+    ASF::Attribute attribute;
+    String name = attribute.parse(*file, 1);
+    file->d->tag->addAttribute(name, attribute);
+  }
+}
+
+ByteVector
+ASF::File::MetadataObject::render(ASF::File *file)
+{
+  data.clear();
+  data.append(ByteVector::fromShort(attributeData.size(), false));
+  data.append(attributeData.toByteVector(ByteVector::null));
+  return BaseObject::render(file);
+}
+
+ByteVector
+ASF::File::MetadataLibraryObject::guid()
+{
+  return metadataLibraryGuid;
+}
+
+void
+ASF::File::MetadataLibraryObject::parse(ASF::File *file, uint /*size*/)
+{
+  file->d->metadataLibraryObject = this;
+  int count = file->readWORD();
+  while(count--) {
+    ASF::Attribute attribute;
+    String name = attribute.parse(*file, 2);
+    file->d->tag->addAttribute(name, attribute);
+  }
+}
+
+ByteVector
+ASF::File::MetadataLibraryObject::render(ASF::File *file)
+{
+  data.clear();
+  data.append(ByteVector::fromShort(attributeData.size(), false));
+  data.append(attributeData.toByteVector(ByteVector::null));
+  return BaseObject::render(file);
+}
+
+ByteVector
+ASF::File::HeaderExtensionObject::guid()
+{
+  return headerExtensionGuid;
+}
+
+void
+ASF::File::HeaderExtensionObject::parse(ASF::File *file, uint /*size*/)
+{
+  file->d->headerExtensionObject = this;
+  file->seek(18, File::Current);
+  long long dataSize = file->readDWORD();
+  long long dataPos = 0;
+  while(dataPos < dataSize) {
+    ByteVector guid = file->readBlock(16);
+    long long size = file->readQWORD();
+    BaseObject *obj;
+    if(guid == metadataGuid) {
+      obj = new MetadataObject();
+    }
+    else if(guid == metadataLibraryGuid) {
+      obj = new MetadataLibraryObject();
+    }
+    else {
+      obj = new UnknownObject(guid);
+    }
+    obj->parse(file, size);
+    objects.append(obj);
+    dataPos += size;
+  }
+}
+
+ByteVector
+ASF::File::HeaderExtensionObject::render(ASF::File *file)
+{
+  data.clear();
+  for(unsigned int i = 0; i < objects.size(); i++) {
+    data.append(objects[i]->render(file));
+  }
+  data = ByteVector("\x11\xD2\xD3\xAB\xBA\xA9\xcf\x11\x8E\xE6\x00\xC0\x0C\x20\x53\x65\x06\x00", 18) + ByteVector::fromUInt(data.size(), false) + data;
+  return BaseObject::render(file);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ASF::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) 
+  : TagLib::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+ASF::File::~File()
+{
+  for(unsigned int i = 0; i < d->objects.size(); i++) {
+    delete d->objects[i];
+  }
+  if(d->tag) {
+    delete d->tag;
+  }
+  if(d->properties) {
+    delete d->properties;
+  }
+  delete d;
+}
+
+ASF::Tag *ASF::File::tag() const
+{
+  return d->tag;
+}
+
+ASF::Properties *ASF::File::audioProperties() const
+{
+  return d->properties;
+}
+
+void ASF::File::read(bool /*readProperties*/, Properties::ReadStyle /*propertiesStyle*/)
+{
+  if(!isValid())
+    return;
+
+  ByteVector guid = readBlock(16);
+  if(guid != headerGuid) {
+    debug("ASF: Not an ASF file.");
+    return;
+  }
+
+  d->tag = new ASF::Tag();
+  d->properties = new ASF::Properties();
+
+  d->size = readQWORD();
+  int numObjects = readDWORD();
+  seek(2, Current);
+
+  for(int i = 0; i < numObjects; i++) {
+    ByteVector guid = readBlock(16);
+    long size = (long)readQWORD();
+    BaseObject *obj;
+    if(guid == filePropertiesGuid) {
+      obj = new FilePropertiesObject();
+    }
+    else if(guid == streamPropertiesGuid) {
+      obj = new StreamPropertiesObject();
+    }
+    else if(guid == contentDescriptionGuid) {
+      obj = new ContentDescriptionObject();
+    }
+    else if(guid == extendedContentDescriptionGuid) {
+      obj = new ExtendedContentDescriptionObject();
+    }
+    else if(guid == headerExtensionGuid) {
+      obj = new HeaderExtensionObject();
+    }
+    else {
+      obj = new UnknownObject(guid);
+    }
+    obj->parse(this, size);
+    d->objects.append(obj);
+  }
+}
+
+bool ASF::File::save()
+{
+  if(readOnly()) {
+    debug("ASF: File is read-only.");
+    return false;
+  }
+
+  if(!d->contentDescriptionObject) {
+    d->contentDescriptionObject = new ContentDescriptionObject();
+    d->objects.append(d->contentDescriptionObject);
+  }
+  if(!d->extendedContentDescriptionObject) {
+    d->extendedContentDescriptionObject = new ExtendedContentDescriptionObject();
+    d->objects.append(d->extendedContentDescriptionObject);
+  }
+  if(!d->headerExtensionObject) {
+    d->headerExtensionObject = new HeaderExtensionObject();
+    d->objects.append(d->headerExtensionObject);
+  }
+  if(!d->metadataObject) {
+    d->metadataObject = new MetadataObject();
+    d->headerExtensionObject->objects.append(d->metadataObject);
+  }
+  if(!d->metadataLibraryObject) {
+    d->metadataLibraryObject = new MetadataLibraryObject();
+    d->headerExtensionObject->objects.append(d->metadataLibraryObject);
+  }
+
+  ASF::AttributeListMap::ConstIterator it = d->tag->attributeListMap().begin();
+  for(; it != d->tag->attributeListMap().end(); it++) {
+    const String &name = it->first;
+    const AttributeList &attributes = it->second;
+    bool inExtendedContentDescriptionObject = false;
+    bool inMetadataObject = false;
+    for(unsigned int j = 0; j < attributes.size(); j++) {
+      const Attribute &attribute = attributes[j];
+      if(!inExtendedContentDescriptionObject && attribute.language() == 0 && attribute.stream() == 0) {
+        d->extendedContentDescriptionObject->attributeData.append(attribute.render(name));
+        inExtendedContentDescriptionObject = true;
+      }
+      else if(!inMetadataObject && attribute.language() == 0 && attribute.stream() != 0) {
+        d->metadataObject->attributeData.append(attribute.render(name, 1));
+        inMetadataObject = true;
+      }
+      else {
+        d->metadataLibraryObject->attributeData.append(attribute.render(name, 2));
+      }
+    }
+  }
+
+  ByteVector data;
+  for(unsigned int i = 0; i < d->objects.size(); i++) {
+    data.append(d->objects[i]->render(this));
+  }
+  data = headerGuid + ByteVector::fromLongLong(data.size() + 30, false) + ByteVector::fromUInt(d->objects.size(), false) + ByteVector("\x01\x02", 2) + data;
+  insert(data, 0, d->size);
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+int ASF::File::readBYTE()
+{
+  ByteVector v = readBlock(1);
+  return v[0];
+}
+
+int ASF::File::readWORD()
+{
+  ByteVector v = readBlock(2);
+  return v.toShort(false);
+}
+
+unsigned int ASF::File::readDWORD()
+{
+  ByteVector v = readBlock(4);
+  return v.toUInt(false);
+}
+
+long long ASF::File::readQWORD()
+{
+  ByteVector v = readBlock(8);
+  return v.toLongLong(false);
+}
+
+String
+ASF::File::readString(int length)
+{
+  ByteVector data = readBlock(length);
+  unsigned int size = data.size();
+  while (size >= 2) {
+    if(data[size - 1] != '\0' || data[size - 2] != '\0') {
+      break;
+    }
+    size -= 2;
+  }
+  if(size != data.size()) {
+    data.resize(size);
+  }
+  return String(data, String::UTF16LE);
+}
+
+ByteVector
+ASF::File::renderString(const String &str, bool includeLength)
+{
+  ByteVector data = str.data(String::UTF16LE) + ByteVector::fromShort(0, false);
+  if(includeLength) {
+    data = ByteVector::fromShort(data.size(), false) + data;
+  }
+  return data;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asffile.h b/lib-src/taglib/taglib/asf/asffile.h
new file mode 100644
index 0000000..9d2913d
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asffile.h
@@ -0,0 +1,119 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ASFFILE_H
+#define TAGLIB_ASFFILE_H
+
+#include <tag.h>
+#include <tfile.h>
+#include "taglib_export.h"
+#include "asfproperties.h"
+#include "asftag.h"
+
+namespace TagLib {
+
+  //! An implementation of ASF (WMA) metadata
+  namespace ASF {
+
+    /*!
+     * This implements and provides an interface for ASF files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to ASF files.
+     */
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+
+      /*!
+       * Contructs an ASF file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * \note In the current implementation, both \a readProperties and
+       * \a propertiesStyle are ignored.
+       */
+      File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns a pointer to the ASF tag of the file.
+       *
+       * ASF::Tag implements the tag interface, so this serves as the
+       * reimplementation of TagLib::File::tag().
+       *
+       * \note The Tag <b>is still</b> owned by the ASF::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      virtual Tag *tag() const;
+
+      /*!
+       * Returns the ASF audio properties for this file.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Save the file.
+       *
+       * This returns true if the save was successful.
+       */
+      virtual bool save();
+
+    private:
+
+      int readBYTE();
+      int readWORD();
+      unsigned int readDWORD();
+      long long readQWORD();
+      static ByteVector renderString(const String &str, bool includeLength = false);
+      String readString(int len);
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+      friend class Attribute;
+
+      class BaseObject;
+      class UnknownObject;
+      class FilePropertiesObject;
+      class StreamPropertiesObject;
+      class ContentDescriptionObject;
+      class ExtendedContentDescriptionObject;
+      class HeaderExtensionObject;
+      class MetadataObject;
+      class MetadataLibraryObject;
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asfproperties.cpp b/lib-src/taglib/taglib/asf/asfproperties.cpp
new file mode 100644
index 0000000..68e2d4c
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asfproperties.cpp
@@ -0,0 +1,107 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_ASF
+
+#include <tdebug.h>
+#include <tstring.h>
+#include "asfproperties.h"
+
+using namespace TagLib;
+
+class ASF::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(): length(0), bitrate(0), sampleRate(0), channels(0) {}
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ASF::Properties::Properties() : AudioProperties(AudioProperties::Average)
+{
+  d = new PropertiesPrivate;
+}
+
+ASF::Properties::~Properties()
+{
+  if(d)
+    delete d;  
+}
+
+int ASF::Properties::length() const
+{
+  return d->length;
+}
+
+int ASF::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int ASF::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int ASF::Properties::channels() const
+{
+  return d->channels;
+} 
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void ASF::Properties::setLength(int length)
+{
+  d->length = length;
+}
+
+void ASF::Properties::setBitrate(int length)
+{
+  d->bitrate = length;
+}
+
+void ASF::Properties::setSampleRate(int length)
+{
+  d->sampleRate = length;
+}
+
+void ASF::Properties::setChannels(int length)
+{
+  d->channels = length;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asfproperties.h b/lib-src/taglib/taglib/asf/asfproperties.h
new file mode 100644
index 0000000..938b0c9
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asfproperties.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ASFPROPERTIES_H
+#define TAGLIB_ASFPROPERTIES_H
+
+#include <audioproperties.h>
+#include <tstring.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ASF {
+
+    //! An implementation of ASF audio properties
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+
+      /*!
+       * Create an instance of ASF::Properties.
+       */
+      Properties();
+
+      /*!
+       * Destroys this ASF::Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+#ifndef DO_NOT_DOCUMENT
+      void setLength(int value);
+      void setBitrate(int value);
+      void setSampleRate(int value);
+      void setChannels(int value);
+#endif
+
+    private:
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+
+  }
+
+}
+
+#endif 
diff --git a/lib-src/taglib/taglib/asf/asftag.cpp b/lib-src/taglib/taglib/asf/asftag.cpp
new file mode 100644
index 0000000..6bea247
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asftag.cpp
@@ -0,0 +1,214 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_ASF
+
+#include "asftag.h"
+
+using namespace TagLib;
+
+class ASF::Tag::TagPrivate
+{
+public:
+  String title;
+  String artist;
+  String copyright;
+  String comment;
+  String rating;
+  AttributeListMap attributeListMap;
+};
+
+ASF::Tag::Tag()
+: TagLib::Tag()
+{
+  d = new TagPrivate;
+}
+
+ASF::Tag::~Tag()
+{
+  if(d)
+    delete d;
+}
+
+String
+ASF::Tag::title() const
+{
+  return d->title;
+}
+
+String
+ASF::Tag::artist() const
+{
+  return d->artist;
+}
+
+String
+ASF::Tag::album() const
+{
+  if(d->attributeListMap.contains("WM/AlbumTitle"))
+    return d->attributeListMap["WM/AlbumTitle"][0].toString();
+  return String::null;
+}
+
+String
+ASF::Tag::copyright() const
+{
+  return d->copyright;
+}
+
+String
+ASF::Tag::comment() const
+{
+  return d->comment;
+}
+
+String
+ASF::Tag::rating() const
+{
+  return d->rating;
+}
+
+unsigned int
+ASF::Tag::year() const
+{
+  if(d->attributeListMap.contains("WM/Year"))
+    return d->attributeListMap["WM/Year"][0].toString().toInt();
+  return 0;
+}
+
+unsigned int
+ASF::Tag::track() const
+{
+  if(d->attributeListMap.contains("WM/TrackNumber"))
+    return d->attributeListMap["WM/TrackNumber"][0].toString().toInt();
+  if(d->attributeListMap.contains("WM/Track"))
+    return d->attributeListMap["WM/Track"][0].toUInt();
+  return 0;
+}
+
+String
+ASF::Tag::genre() const
+{
+  if(d->attributeListMap.contains("WM/Genre"))
+    return d->attributeListMap["WM/Genre"][0].toString();
+  return String::null;
+}
+
+void
+ASF::Tag::setTitle(const String &value)
+{
+  d->title = value;
+}
+
+void
+ASF::Tag::setArtist(const String &value)
+{
+  d->artist = value;
+}
+
+void
+ASF::Tag::setCopyright(const String &value)
+{
+  d->copyright = value;
+}
+
+void
+ASF::Tag::setComment(const String &value)
+{
+  d->comment = value;
+}
+
+void
+ASF::Tag::setRating(const String &value)
+{
+  d->rating = value;
+}
+
+void
+ASF::Tag::setAlbum(const String &value)
+{
+  setAttribute("WM/AlbumTitle", value);
+}
+
+void
+ASF::Tag::setGenre(const String &value)
+{
+  setAttribute("WM/Genre", value);
+}
+
+void
+ASF::Tag::setYear(uint value)
+{
+  setAttribute("WM/Year", String::number(value));
+}
+
+void
+ASF::Tag::setTrack(uint value)
+{
+  setAttribute("WM/TrackNumber", String::number(value));
+}
+
+ASF::AttributeListMap&
+ASF::Tag::attributeListMap()
+{
+  return d->attributeListMap;
+}
+
+void ASF::Tag::removeItem(const String &key)
+{
+  AttributeListMap::Iterator it = d->attributeListMap.find(key);
+  if(it != d->attributeListMap.end())
+    d->attributeListMap.erase(it);
+}
+
+void ASF::Tag::setAttribute(const String &name, const Attribute &attribute)
+{
+  AttributeList value;
+  value.append(attribute);
+  d->attributeListMap.insert(name, value);
+}
+
+void ASF::Tag::addAttribute(const String &name, const Attribute &attribute)
+{
+  if(d->attributeListMap.contains(name)) {
+    d->attributeListMap[name].append(attribute);
+  }
+  else {
+    setAttribute(name, attribute);
+  }
+}
+
+bool ASF::Tag::isEmpty() const {
+  return TagLib::Tag::isEmpty() &&
+         copyright().isEmpty() &&
+         rating().isEmpty() &&
+         d->attributeListMap.isEmpty();
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/asf/asftag.h b/lib-src/taglib/taglib/asf/asftag.h
new file mode 100644
index 0000000..78c90fc
--- /dev/null
+++ b/lib-src/taglib/taglib/asf/asftag.h
@@ -0,0 +1,186 @@
+/**************************************************************************
+    copyright            : (C) 2005-2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ASFTAG_H
+#define TAGLIB_ASFTAG_H
+
+#include <tag.h>
+#include <tlist.h>
+#include <tmap.h>
+#include "taglib_export.h"
+#include "asfattribute.h"
+
+namespace TagLib {
+
+  namespace ASF {
+
+    typedef List<Attribute> AttributeList;
+    typedef Map<String, AttributeList> AttributeListMap;
+
+    class TAGLIB_EXPORT Tag : public TagLib::Tag {
+
+      friend class File;
+
+    public:
+
+      Tag();
+
+      virtual ~Tag();
+
+      /*!
+       * Returns the track name.
+       */
+      virtual String title() const;
+
+      /*!
+       * Returns the artist name.
+       */
+      virtual String artist() const;
+
+      /*!
+       * Returns the album name; if no album name is present in the tag
+       * String::null will be returned.
+       */
+      virtual String album() const;
+
+      /*!
+       * Returns the track comment.
+       */
+      virtual String comment() const;
+
+      /*!
+       * Returns the genre name; if no genre is present in the tag String::null
+       * will be returned.
+       */
+      virtual String genre() const;
+
+      /*!
+       * Returns the rating.
+       */
+      virtual String rating() const;
+
+      /*!
+       * Returns the genre name; if no genre is present in the tag String::null
+       * will be returned.
+       */
+      virtual String copyright() const;
+
+      /*!
+       * Returns the year; if there is no year set, this will return 0.
+       */
+      virtual uint year() const;
+
+      /*!
+       * Returns the track number; if there is no track number set, this will
+       * return 0.
+       */
+      virtual uint track() const;
+
+      /*!
+       * Sets the title to \a s.
+       */
+      virtual void setTitle(const String &s);
+
+      /*!
+       * Sets the artist to \a s.
+       */
+      virtual void setArtist(const String &s);
+
+      /*!
+       * Sets the album to \a s.  If \a s is String::null then this value will be
+       * cleared.
+       */
+      virtual void setAlbum(const String &s);
+
+      /*!
+       * Sets the comment to \a s.
+       */
+      virtual void setComment(const String &s);
+
+      /*!
+       * Sets the rating to \a s. 
+       */
+      virtual void setRating(const String &s);
+
+      /*!
+       * Sets the copyright to \a s. 
+       */
+      virtual void setCopyright(const String &s);
+
+      /*!
+       * Sets the genre to \a s. 
+       */
+      virtual void setGenre(const String &s);
+
+      /*!
+       * Sets the year to \a i.  If \a s is 0 then this value will be cleared.
+       */
+      virtual void setYear(uint i);
+
+      /*!
+       * Sets the track to \a i.  If \a s is 0 then this value will be cleared.
+       */
+      virtual void setTrack(uint i);
+
+      /*!
+       * Returns true if the tag does not contain any data.  This should be
+       * reimplemented in subclasses that provide more than the basic tagging
+       * abilities in this class.
+       */
+      virtual bool isEmpty() const;
+
+      /*!
+       * Returns a reference to the item list map.  This is an AttributeListMap of
+       * all of the items in the tag.
+       *
+       * This is the most powerfull structure for accessing the items of the tag.
+       */
+      AttributeListMap &attributeListMap();
+
+      /*!
+       * Removes the \a key attribute from the tag
+       */
+      void removeItem(const String &name);
+
+      /*!
+       * Sets the \a key attribute to the value of \a attribute. If an attribute
+       * with the \a key is already present, it will be replaced.
+       */
+      void setAttribute(const String &name, const Attribute &attribute);
+
+      /*!
+       * Sets the \a key attribute to the value of \a attribute. If an attribute
+       * with the \a key is already present, it will be added to the list.
+       */
+      void addAttribute(const String &name, const Attribute &attribute);
+
+    private:
+
+      class TagPrivate;
+      TagPrivate *d;
+    };
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/audioproperties.cpp b/lib-src/taglib/taglib/audioproperties.cpp
new file mode 100644
index 0000000..324cc35
--- /dev/null
+++ b/lib-src/taglib/taglib/audioproperties.cpp
@@ -0,0 +1,51 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "audioproperties.h"
+
+using namespace TagLib;
+
+class AudioProperties::AudioPropertiesPrivate
+{
+
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
+AudioProperties::~AudioProperties()
+{
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected methods
+////////////////////////////////////////////////////////////////////////////////
+
+AudioProperties::AudioProperties(ReadStyle)
+{
+
+}
diff --git a/lib-src/taglib/taglib/audioproperties.h b/lib-src/taglib/taglib/audioproperties.h
new file mode 100644
index 0000000..4841031
--- /dev/null
+++ b/lib-src/taglib/taglib/audioproperties.h
@@ -0,0 +1,110 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_AUDIOPROPERTIES_H
+#define TAGLIB_AUDIOPROPERTIES_H
+
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  //! A simple, abstract interface to common audio properties
+
+  /*!
+   * The values here are common to most audio formats.  For more specific, codec
+   * dependant values, please see see the subclasses APIs.  This is meant to
+   * compliment the TagLib::File and TagLib::Tag APIs in providing a simple
+   * interface that is sufficient for most applications.
+   */
+
+  class TAGLIB_EXPORT AudioProperties
+  {
+  public:
+
+    /*!
+     * Reading audio properties from a file can sometimes be very time consuming
+     * and for the most accurate results can often involve reading the entire
+     * file.  Because in many situations speed is critical or the accuracy of the
+     * values is not particularly important this allows the level of desired
+     * accuracy to be set.
+     */
+    enum ReadStyle {
+      //! Read as little of the file as possible
+      Fast,
+      //! Read more of the file and make better values guesses
+      Average,
+      //! Read as much of the file as needed to report accurate values
+      Accurate
+    };
+
+    /*!
+     * Destroys this AudioProperties instance.
+     */
+    virtual ~AudioProperties();
+
+    /*!
+     * Returns the length of the file in seconds.
+     */
+    virtual int length() const = 0;
+
+    /*!
+     * Returns the most appropriate bit rate for the file in kb/s.  For constant
+     * bitrate formats this is simply the bitrate of the file.  For variable
+     * bitrate formats this is either the average or nominal bitrate.
+     */
+    virtual int bitrate() const = 0;
+
+    /*!
+     * Returns the sample rate in Hz.
+     */
+    virtual int sampleRate() const = 0;
+
+    /*!
+     * Returns the number of audio channels.
+     */
+    virtual int channels() const = 0;
+
+  protected:
+
+    /*!
+     * Construct an audio properties instance.  This is protected as this class
+     * should not be instantiated directly, but should be instantiated via its
+     * subclasses and can be fetched from the FileRef or File APIs.
+     *
+     * \see ReadStyle
+     */
+    AudioProperties(ReadStyle style);
+
+  private:
+    AudioProperties(const AudioProperties &);
+    AudioProperties &operator=(const AudioProperties &);
+
+    class AudioPropertiesPrivate;
+    AudioPropertiesPrivate *d;
+  };
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/fileref.cpp b/lib-src/taglib/taglib/fileref.cpp
new file mode 100644
index 0000000..b326bd2
--- /dev/null
+++ b/lib-src/taglib/taglib/fileref.cpp
@@ -0,0 +1,242 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <tfile.h>
+#include <tstring.h>
+
+#include "fileref.h"
+#include "asffile.h"
+#include "mpegfile.h"
+#include "vorbisfile.h"
+#include "flacfile.h"
+#include "oggflacfile.h"
+#include "mpcfile.h"
+#include "mp4file.h"
+#include "wavpackfile.h"
+#include "speexfile.h"
+#include "trueaudiofile.h"
+#include "aifffile.h"
+#include "wavfile.h"
+
+using namespace TagLib;
+
+class FileRef::FileRefPrivate : public RefCounter
+{
+public:
+  FileRefPrivate(File *f) : RefCounter(), file(f) {}
+  ~FileRefPrivate() {
+    delete file;
+  }
+
+  File *file;
+  static List<const FileTypeResolver *> fileTypeResolvers;
+};
+
+List<const FileRef::FileTypeResolver *> FileRef::FileRefPrivate::fileTypeResolvers;
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+FileRef::FileRef()
+{
+  d = new FileRefPrivate(0);
+}
+
+FileRef::FileRef(FileName fileName, bool readAudioProperties,
+                 AudioProperties::ReadStyle audioPropertiesStyle)
+{
+  d = new FileRefPrivate(create(fileName, readAudioProperties, audioPropertiesStyle));
+}
+
+FileRef::FileRef(File *file)
+{
+  d = new FileRefPrivate(file);
+}
+
+FileRef::FileRef(const FileRef &ref) : d(ref.d)
+{
+  d->ref();
+}
+
+FileRef::~FileRef()
+{
+  if(d->deref())
+    delete d;
+}
+
+Tag *FileRef::tag() const
+{
+  return d->file->tag();
+}
+
+AudioProperties *FileRef::audioProperties() const
+{
+  return d->file->audioProperties();
+}
+
+File *FileRef::file() const
+{
+  return d->file;
+}
+
+bool FileRef::save()
+{
+  return d->file->save();
+}
+
+const FileRef::FileTypeResolver *FileRef::addFileTypeResolver(const FileRef::FileTypeResolver *resolver) // static
+{
+  FileRefPrivate::fileTypeResolvers.prepend(resolver);
+  return resolver;
+}
+
+StringList FileRef::defaultFileExtensions()
+{
+  StringList l;
+
+  l.append("ogg");
+  l.append("flac");
+  l.append("oga");
+  l.append("mp3");
+  l.append("mpc");
+  l.append("wv");
+  l.append("spx");
+  l.append("tta");
+#ifdef WITH_MP4
+  l.append("m4a");
+  l.append("m4b");
+  l.append("m4p");
+  l.append("3g2");
+#endif
+#ifdef WITH_ASF
+  l.append("wma");
+#endif
+  l.append("aif");
+  l.append("aiff");
+  l.append("wav");
+
+  return l;
+}
+
+bool FileRef::isNull() const
+{
+  return !d->file || !d->file->isValid();
+}
+
+FileRef &FileRef::operator=(const FileRef &ref)
+{
+  if(&ref == this)
+    return *this;
+
+  if(d->deref())
+    delete d;
+
+  d = ref.d;
+  d->ref();
+
+  return *this;
+}
+
+bool FileRef::operator==(const FileRef &ref) const
+{
+  return ref.d->file == d->file;
+}
+
+bool FileRef::operator!=(const FileRef &ref) const
+{
+  return ref.d->file != d->file;
+}
+
+File *FileRef::create(FileName fileName, bool readAudioProperties,
+                      AudioProperties::ReadStyle audioPropertiesStyle) // static
+{
+
+  List<const FileTypeResolver *>::ConstIterator it = FileRefPrivate::fileTypeResolvers.begin();
+
+  for(; it != FileRefPrivate::fileTypeResolvers.end(); ++it) {
+    File *file = (*it)->createFile(fileName, readAudioProperties, audioPropertiesStyle);
+    if(file)
+      return file;
+  }
+
+  // Ok, this is really dumb for now, but it works for testing.
+
+  String s;
+
+#ifdef _WIN32
+  s = (wcslen((const wchar_t *) fileName) > 0) ? String((const wchar_t *) fileName) : String((const char *) fileName);
+#else
+  s = fileName;
+#endif
+
+  // If this list is updated, the method defaultFileExtensions() should also be
+  // updated.  However at some point that list should be created at the same time
+  // that a default file type resolver is created.
+
+  if(s.size() > 4) {
+    if(s.substr(s.size() - 4, 4).upper() == ".OGG")
+      return new Ogg::Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".MP3")
+      return new MPEG::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".OGA")
+      return new Ogg::FLAC::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 5, 5).upper() == ".FLAC")
+      return new FLAC::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".MPC")
+      return new MPC::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 3, 3).upper() == ".WV")
+      return new WavPack::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".SPX")
+      return new Ogg::Speex::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".TTA")
+      return new TrueAudio::File(fileName, readAudioProperties, audioPropertiesStyle);
+#ifdef WITH_MP4
+    if(s.substr(s.size() - 4, 4).upper() == ".M4A" ||
+       s.substr(s.size() - 4, 4).upper() == ".M4B" ||
+       s.substr(s.size() - 4, 4).upper() == ".M4P" ||
+       s.substr(s.size() - 4, 4).upper() == ".3G2")
+      return new MP4::File(fileName, readAudioProperties, audioPropertiesStyle);
+#endif
+#ifdef WITH_ASF
+    if(s.substr(s.size() - 4, 4).upper() == ".WMA")
+      return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle);
+#endif
+    if(s.substr(s.size() - 4, 4).upper() == ".AIF")
+      return new RIFF::AIFF::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".WAV")
+      return new RIFF::WAV::File(fileName, readAudioProperties, audioPropertiesStyle);
+  }
+  if(s.size() > 5) {
+    if(s.substr(s.size() - 5, 5).upper() == ".AIFF")
+      return new RIFF::AIFF::File(fileName, readAudioProperties, audioPropertiesStyle);
+  }
+
+  return 0;
+}
diff --git a/lib-src/taglib/taglib/fileref.h b/lib-src/taglib/taglib/fileref.h
new file mode 100644
index 0000000..cb4c2b4
--- /dev/null
+++ b/lib-src/taglib/taglib/fileref.h
@@ -0,0 +1,262 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_FILEREF_H
+#define TAGLIB_FILEREF_H
+
+#include <tfile.h>
+#include <tstringlist.h>
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  //! This class provides a simple abstraction for creating and handling files
+
+  /*!
+   * FileRef exists to provide a minimal, generic and value-based wrapper around
+   * a File.  It is lightweight and implicitly shared, and as such suitable for
+   * pass-by-value use.  This hides some of the uglier details of TagLib::File
+   * and the non-generic portions of the concrete file implementations.
+   *
+   * This class is useful in a "simple usage" situation where it is desirable
+   * to be able to get and set some of the tag information that is similar
+   * across file types.
+   *
+   * Also note that it is probably a good idea to plug this into your mime
+   * type system rather than using the constructor that accepts a file name using
+   * the FileTypeResolver.
+   *
+   * \see FileTypeResolver
+   * \see addFileTypeResolver()
+   */
+
+  class TAGLIB_EXPORT FileRef
+  {
+  public:
+
+  //! A class for pluggable file type resolution.
+
+  /*!
+   * This class is used to add extend TagLib's very basic file name based file
+   * type resolution.
+   *
+   * This can be accomplished with:
+   *
+   * \code
+   *
+   * class MyFileTypeResolver : FileTypeResolver
+   * {
+   *   TagLib::File *createFile(TagLib::FileName *fileName, bool, AudioProperties::ReadStyle)
+   *   {
+   *     if(someCheckForAnMP3File(fileName))
+   *       return new TagLib::MPEG::File(fileName);
+   *     return 0;
+   *   }
+   * }
+   *
+   * FileRef::addFileTypeResolver(new MyFileTypeResolver);
+   *
+   * \endcode
+   *
+   * Naturally a less contrived example would be slightly more complex.  This
+   * can be used to plug in mime-type detection systems or to add new file types
+   * to TagLib.
+   */
+
+    class TAGLIB_EXPORT FileTypeResolver
+    {
+    public:
+      // do not fix compiler warning about missing virtual destructor
+      // since this would not be binary compatible
+      // let Scott fix it whenever he thinks BIC changes can next be applied
+      /*!
+       * This method must be overridden to provide an additional file type
+       * resolver.  If the resolver is able to determine the file type it should
+       * return a valid File object; if not it should return 0.
+       *
+       * \note The created file is then owned by the FileRef and should not be
+       * deleted.  Deletion will happen automatically when the FileRef passes
+       * out of scope.
+       */
+      virtual File *createFile(FileName fileName,
+                               bool readAudioProperties = true,
+                               AudioProperties::ReadStyle
+                               audioPropertiesStyle = AudioProperties::Average) const = 0;
+    };
+
+    /*!
+     * Creates a null FileRef.
+     */
+    FileRef();
+
+    /*!
+     * Create a FileRef from \a fileName.  If \a readAudioProperties is true then
+     * the audio properties will be read using \a audioPropertiesStyle.  If
+     * \a readAudioProperties is false then \a audioPropertiesStyle will be
+     * ignored.
+     *
+     * Also see the note in the class documentation about why you may not want to
+     * use this method in your application.
+     */
+    explicit FileRef(FileName fileName,
+                     bool readAudioProperties = true,
+                     AudioProperties::ReadStyle
+                     audioPropertiesStyle = AudioProperties::Average);
+
+    /*!
+     * Contruct a FileRef using \a file.  The FileRef now takes ownership of the
+     * pointer and will delete the File when it passes out of scope.
+     */
+    explicit FileRef(File *file);
+
+    /*!
+     * Make a copy of \a ref.
+     */
+    FileRef(const FileRef &ref);
+
+    /*!
+     * Destroys this FileRef instance.
+     */
+    virtual ~FileRef();
+
+    /*!
+     * Returns a pointer to represented file's tag.
+     *
+     * \warning This pointer will become invalid when this FileRef and all
+     * copies pass out of scope.
+     *
+     * \see File::tag()
+     */
+    Tag *tag() const;
+
+    /*!
+     * Returns the audio properties for this FileRef.  If no audio properties
+     * were read then this will returns a null pointer.
+     */
+    AudioProperties *audioProperties() const;
+
+    /*!
+     * Returns a pointer to the file represented by this handler class.
+     *
+     * As a general rule this call should be avoided since if you need to work
+     * with file objects directly, you are probably better served instantiating
+     * the File subclasses (i.e. MPEG::File) manually and working with their APIs.
+     *
+     * This <i>handle</i> exists to provide a minimal, generic and value-based
+     * wrapper around a File.  Accessing the file directly generally indicates
+     * a moving away from this simplicity (and into things beyond the scope of
+     * FileRef).
+     *
+     * \warning This pointer will become invalid when this FileRef and all
+     * copies pass out of scope.
+     */
+    File *file() const;
+
+    /*!
+     * Saves the file.  Returns true on success.
+     */
+    bool save();
+
+    /*!
+     * Adds a FileTypeResolver to the list of those used by TagLib.  Each
+     * additional FileTypeResolver is added to the front of a list of resolvers
+     * that are tried.  If the FileTypeResolver returns zero the next resolver
+     * is tried.
+     *
+     * Returns a pointer to the added resolver (the same one that's passed in --
+     * this is mostly so that static inialializers have something to use for
+     * assignment).
+     *
+     * \see FileTypeResolver
+     */
+    static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver);
+
+    /*!
+     * As is mentioned elsewhere in this class's documentation, the default file
+     * type resolution code provided by TagLib only works by comparing file
+     * extensions.
+     *
+     * This method returns the list of file extensions that are used by default.
+     *
+     * The extensions are all returned in lowercase, though the comparison used
+     * by TagLib for resolution is case-insensitive.
+     *
+     * \note This does not account for any additional file type resolvers that
+     * are plugged in.  Also note that this is not intended to replace a propper
+     * mime-type resolution system, but is just here for reference.
+     *
+     * \see FileTypeResolver
+     */
+    static StringList defaultFileExtensions();
+
+    /*!
+     * Returns true if the file (and as such other pointers) are null.
+     */
+    bool isNull() const;
+
+    /*!
+     * Assign the file pointed to by \a ref to this FileRef.
+     */
+    FileRef &operator=(const FileRef &ref);
+
+    /*!
+     * Returns true if this FileRef and \a ref point to the same File object.
+     */
+    bool operator==(const FileRef &ref) const;
+
+    /*!
+     * Returns true if this FileRef and \a ref do not point to the same File
+     * object.
+     */
+    bool operator!=(const FileRef &ref) const;
+
+    /*!
+     * A simple implementation of file type guessing.  If \a readAudioProperties
+     * is true then the audio properties will be read using
+     * \a audioPropertiesStyle.  If \a readAudioProperties is false then
+     * \a audioPropertiesStyle will be ignored.
+     *
+     * \note You generally shouldn't use this method, but instead the constructor
+     * directly.
+     *
+     * \deprecated
+     */
+    static File *create(FileName fileName,
+                        bool readAudioProperties = true,
+                        AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average);
+
+
+  private:
+    class FileRefPrivate;
+    FileRefPrivate *d;
+  };
+
+} // namespace TagLib
+
+#endif
diff --git a/lib-src/taglib/taglib/flac/.deps/flacfile.Plo b/lib-src/taglib/taglib/flac/.deps/flacfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/.deps/flacfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/flac/.deps/flacproperties.Plo b/lib-src/taglib/taglib/flac/.deps/flacproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/.deps/flacproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/flac/CMakeLists.txt b/lib-src/taglib/taglib/flac/CMakeLists.txt
new file mode 100644
index 0000000..8c98315
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  flacfile.h flacproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib )
diff --git a/lib-src/taglib/taglib/flac/Makefile.am b/lib-src/taglib/taglib/flac/Makefile.am
new file mode 100644
index 0000000..337986a
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libflac.la
+
+libflac_la_SOURCES = flacfile.cpp flacproperties.cpp
+
+taglib_include_HEADERS = flacfile.h flacproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/flac/Makefile.in b/lib-src/taglib/taglib/flac/Makefile.in
new file mode 100644
index 0000000..3e1b5aa
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/Makefile.in
@@ -0,0 +1,625 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/flac
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libflac_la_LIBADD =
+am_libflac_la_OBJECTS = flacfile.lo flacproperties.lo
+#>- libflac_la_OBJECTS = $(am_libflac_la_OBJECTS)
+#>+ 4
+libflac_la_final_OBJECTS = libflac_la.all_cpp.lo 
+libflac_la_nofinal_OBJECTS = flacfile.lo flacproperties.lo
+ at KDE_USE_FINAL_FALSE@libflac_la_OBJECTS = $(libflac_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libflac_la_OBJECTS = $(libflac_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libflac_la_SOURCES)
+DIST_SOURCES = $(libflac_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libflac.la
+libflac_la_SOURCES = flacfile.cpp flacproperties.cpp
+taglib_include_HEADERS = flacfile.h flacproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/flac/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/flac/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/flac/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/flac/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/flac/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libflac.la: $(libflac_la_OBJECTS) $(libflac_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libflac_la_OBJECTS) $(libflac_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flacfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flacproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/flac/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/flac/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/flac/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libflac_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/flacfile.cpp $(srcdir)/flacproperties.cpp 
+	@echo 'creating libflac_la.all_cpp.cpp ...'; \
+	rm -f libflac_la.all_cpp.files libflac_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libflac_la.all_cpp.final; \
+	for file in flacfile.cpp flacproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libflac_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libflac_la.all_cpp.final; \
+	done; \
+	cat libflac_la.all_cpp.final libflac_la.all_cpp.files > libflac_la.all_cpp.cpp; \
+	rm -f libflac_la.all_cpp.final libflac_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libflac_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libflac_la_OBJECTS="$(libflac_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libflac_la_OBJECTS="$(libflac_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libflac_la_OBJECTS="$(libflac_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libflac_la_OBJECTS="$(libflac_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/flac/flacfile.cpp b/lib-src/taglib/taglib/flac/flacfile.cpp
new file mode 100644
index 0000000..2cf35ad
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/flacfile.cpp
@@ -0,0 +1,431 @@
+/***************************************************************************
+    copyright            : (C) 2003-2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tlist.h>
+#include <tdebug.h>
+#include <tagunion.h>
+
+#include <id3v2header.h>
+#include <id3v2tag.h>
+#include <id3v1tag.h>
+#include <xiphcomment.h>
+
+#include "flacfile.h"
+
+using namespace TagLib;
+
+namespace
+{
+  enum { XiphIndex = 0, ID3v2Index = 1, ID3v1Index = 2 };
+  enum { StreamInfo = 0, Padding, Application, SeekTable, VorbisComment, CueSheet };
+}
+
+class FLAC::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    ID3v2FrameFactory(ID3v2::FrameFactory::instance()),
+    ID3v2Location(-1),
+    ID3v2OriginalSize(0),
+    ID3v1Location(-1),
+    properties(0),
+    flacStart(0),
+    streamStart(0),
+    streamLength(0),
+    scanned(false),
+    hasXiphComment(false),
+    hasID3v2(false),
+    hasID3v1(false) {}
+
+  ~FilePrivate()
+  {
+    delete properties;
+  }
+
+  const ID3v2::FrameFactory *ID3v2FrameFactory;
+  long ID3v2Location;
+  uint ID3v2OriginalSize;
+
+  long ID3v1Location;
+
+  TagUnion tag;
+
+  Properties *properties;
+  ByteVector streamInfoData;
+  ByteVector xiphCommentData;
+
+  long flacStart;
+  long streamStart;
+  long streamLength;
+  bool scanned;
+
+  bool hasXiphComment;
+  bool hasID3v2;
+  bool hasID3v1;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+FLAC::File::File(FileName file, bool readProperties,
+                 Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate;
+  d->ID3v2FrameFactory = frameFactory;
+  read(readProperties, propertiesStyle);
+}
+
+FLAC::File::~File()
+{
+  delete d;
+}
+
+TagLib::Tag *FLAC::File::tag() const
+{
+  return &d->tag;
+}
+
+FLAC::Properties *FLAC::File::audioProperties() const
+{
+  return d->properties;
+}
+
+
+bool FLAC::File::save()
+{
+  if(readOnly()) {
+    debug("FLAC::File::save() - Cannot save to a read only file.");
+    return false;
+  }
+
+  // Create new vorbis comments
+
+  Tag::duplicate(&d->tag, xiphComment(true), true);
+
+  d->xiphCommentData = xiphComment()->render(false);
+
+  // A Xiph comment portion of the data stream starts with a 4-byte descriptor.
+  // The first byte indicates the frame type.  The last three bytes are used
+  // to give the length of the data segment.  Here we start
+
+  ByteVector data = ByteVector::fromUInt(d->xiphCommentData.size());
+
+  data[0] = char(VorbisComment);
+  data.append(d->xiphCommentData);
+
+
+   // If file already have comment => find and update it
+   // if not => insert one
+
+   // TODO: Search for padding and use that
+
+  if(d->hasXiphComment) {
+
+    long nextBlockOffset = d->flacStart;
+    bool isLastBlock = false;
+
+    while(!isLastBlock) {
+      seek(nextBlockOffset);
+
+      ByteVector header = readBlock(4);
+      char blockType = header[0] & 0x7f;
+      isLastBlock = (header[0] & 0x80) != 0;
+      uint blockLength = header.mid(1, 3).toUInt();
+
+      if(blockType == VorbisComment) {
+        data[0] = header[0];
+        insert(data, nextBlockOffset, blockLength + 4);
+        break;
+      }
+
+      nextBlockOffset += blockLength + 4;
+    }
+  }
+  else {
+
+    const long firstBlockOffset = d->flacStart;
+    seek(firstBlockOffset);
+
+    ByteVector header = readBlock(4);
+    bool isLastBlock = (header[0] & 0x80) != 0;
+    uint blockLength = header.mid(1, 3).toUInt();
+
+    if(isLastBlock) {
+
+      // If the first block was previously also the last block, then we want to
+      // mark it as no longer being the first block (the writeBlock() call) and
+      // then set the data for the block that we're about to write to mark our
+      // new block as the last block.
+
+      seek(firstBlockOffset);
+      writeBlock(static_cast<char>(header[0] & 0x7F));
+      data[0] |= 0x80;
+    }
+
+    insert(data, firstBlockOffset + blockLength + 4, 0);
+    d->hasXiphComment = true;
+  }
+
+  // Update ID3 tags
+
+  if(ID3v2Tag()) {
+    if(d->hasID3v2) {
+      if(d->ID3v2Location < d->flacStart)
+        debug("FLAC::File::save() -- This can't be right -- an ID3v2 tag after the "
+              "start of the FLAC bytestream?  Not writing the ID3v2 tag.");
+      else
+        insert(ID3v2Tag()->render(), d->ID3v2Location, d->ID3v2OriginalSize);
+    }
+    else
+      insert(ID3v2Tag()->render(), 0, 0);
+  }
+
+  if(ID3v1Tag()) {
+    seek(-128, End);
+    writeBlock(ID3v1Tag()->render());
+  }
+
+  return true;
+}
+
+ID3v2::Tag *FLAC::File::ID3v2Tag(bool create)
+{
+  if(!create || d->tag[ID3v2Index])
+    return static_cast<ID3v2::Tag *>(d->tag[ID3v2Index]);
+
+  d->tag.set(ID3v2Index, new ID3v2::Tag);
+  return static_cast<ID3v2::Tag *>(d->tag[ID3v2Index]);
+}
+
+ID3v1::Tag *FLAC::File::ID3v1Tag(bool create)
+{
+  return d->tag.access<ID3v1::Tag>(ID3v1Index, create);
+}
+
+Ogg::XiphComment *FLAC::File::xiphComment(bool create)
+{
+  return d->tag.access<Ogg::XiphComment>(XiphIndex, create);
+}
+
+void FLAC::File::setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
+{
+  d->ID3v2FrameFactory = factory;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void FLAC::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  // Look for an ID3v2 tag
+
+  d->ID3v2Location = findID3v2();
+
+  if(d->ID3v2Location >= 0) {
+
+    d->tag.set(ID3v2Index, new ID3v2::Tag(this, d->ID3v2Location, d->ID3v2FrameFactory));
+
+    d->ID3v2OriginalSize = ID3v2Tag()->header()->completeTagSize();
+
+    if(ID3v2Tag()->header()->tagSize() <= 0)
+      d->tag.set(ID3v2Index, 0);
+    else
+      d->hasID3v2 = true;
+  }
+
+  // Look for an ID3v1 tag
+
+  d->ID3v1Location = findID3v1();
+
+  if(d->ID3v1Location >= 0) {
+    d->tag.set(ID3v1Index, new ID3v1::Tag(this, d->ID3v1Location));
+    d->hasID3v1 = true;
+  }
+
+  // Look for FLAC metadata, including vorbis comments
+
+  scan();
+
+  if(!isValid())
+    return;
+
+  if(d->hasXiphComment)
+    d->tag.set(XiphIndex, new Ogg::XiphComment(xiphCommentData()));
+  else
+    d->tag.set(XiphIndex, new Ogg::XiphComment);
+
+  if(readProperties)
+    d->properties = new Properties(streamInfoData(), streamLength(), propertiesStyle);
+}
+
+ByteVector FLAC::File::streamInfoData()
+{
+  return isValid() ? d->streamInfoData : ByteVector();
+}
+
+ByteVector FLAC::File::xiphCommentData() const
+{
+  return (isValid() && d->hasXiphComment) ? d->xiphCommentData : ByteVector();
+}
+
+long FLAC::File::streamLength()
+{
+  return d->streamLength;
+}
+
+void FLAC::File::scan()
+{
+  // Scan the metadata pages
+
+  if(d->scanned)
+    return;
+
+  if(!isValid())
+    return;
+
+  long nextBlockOffset;
+
+  if(d->hasID3v2)
+    nextBlockOffset = find("fLaC", d->ID3v2Location + d->ID3v2OriginalSize);
+  else
+    nextBlockOffset = find("fLaC");
+
+  if(nextBlockOffset < 0) {
+    debug("FLAC::File::scan() -- FLAC stream not found");
+    setValid(false);
+    return;
+  }
+
+  nextBlockOffset += 4;
+  d->flacStart = nextBlockOffset;
+
+  seek(nextBlockOffset);
+
+  ByteVector header = readBlock(4);
+
+  // Header format (from spec):
+  // <1> Last-metadata-block flag
+  // <7> BLOCK_TYPE
+  //    0 : STREAMINFO
+  //    1 : PADDING
+  //    ..
+  //    4 : VORBIS_COMMENT
+  //    ..
+  // <24> Length of metadata to follow
+
+  char blockType = header[0] & 0x7f;
+  bool isLastBlock = (header[0] & 0x80) != 0;
+  uint length = header.mid(1, 3).toUInt();
+
+  // First block should be the stream_info metadata
+
+  if(blockType != StreamInfo) {
+    debug("FLAC::File::scan() -- invalid FLAC stream");
+    setValid(false);
+    return;
+  }
+
+  d->streamInfoData = readBlock(length);
+  nextBlockOffset += length + 4;
+
+  // Search through the remaining metadata
+
+  while(!isLastBlock) {
+
+    header = readBlock(4);
+    blockType = header[0] & 0x7f;
+    isLastBlock = (header[0] & 0x80) != 0;
+    length = header.mid(1, 3).toUInt();
+
+    if(blockType == Padding) {
+      // debug("FLAC::File::scan() -- Padding found");
+    }
+    // Found the vorbis-comment
+    else if(blockType == VorbisComment) {
+      d->xiphCommentData = readBlock(length);
+      d->hasXiphComment = true;
+    }
+
+    nextBlockOffset += length + 4;
+
+    if(nextBlockOffset >= File::length()) {
+      debug("FLAC::File::scan() -- FLAC stream corrupted");
+      setValid(false);
+      return;
+    }
+    seek(nextBlockOffset);
+  }
+
+  // End of metadata, now comes the datastream
+
+  d->streamStart = nextBlockOffset;
+  d->streamLength = File::length() - d->streamStart;
+
+  if(d->hasID3v1)
+    d->streamLength -= 128;
+
+  d->scanned = true;
+}
+
+long FLAC::File::findID3v1()
+{
+  if(!isValid())
+    return -1;
+
+  seek(-128, End);
+  long p = tell();
+
+  if(readBlock(3) == ID3v1::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
+
+long FLAC::File::findID3v2()
+{
+  if(!isValid())
+    return -1;
+
+  seek(0);
+
+  if(readBlock(3) == ID3v2::Header::fileIdentifier())
+    return 0;
+
+  return -1;
+}
diff --git a/lib-src/taglib/taglib/flac/flacfile.h b/lib-src/taglib/taglib/flac/flacfile.h
new file mode 100644
index 0000000..ae1fe69
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/flacfile.h
@@ -0,0 +1,201 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_FLACFILE_H
+#define TAGLIB_FLACFILE_H
+
+#include "taglib_export.h"
+#include "tfile.h"
+
+#include "flacproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  namespace ID3v2 { class FrameFactory; class Tag; }
+  namespace ID3v1 { class Tag; }
+  namespace Ogg { class XiphComment; }
+
+  //! An implementation of FLAC metadata
+
+  /*!
+   * This is implementation of FLAC metadata for non-Ogg FLAC files.  At some
+   * point when Ogg / FLAC is more common there will be a similar implementation
+   * under the Ogg hiearchy.
+   *
+   * This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream
+   * properties from the file.
+   */
+
+  namespace FLAC {
+
+    //! An implementation of TagLib::File with FLAC specific methods
+
+    /*!
+     * This implements and provides an interface for FLAC files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to FLAC files.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * Contructs a FLAC file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * \deprecated This constructor will be dropped in favor of the one below
+       * in a future version.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Contructs a FLAC file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * If this file contains and ID3v2 tag the frames will be created using
+       * \a frameFactory.
+       */
+      // BIC: merge with the above constructor
+      File(FileName file, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the Tag for this file.  This will be a union of XiphComment,
+       * ID3v1 and ID3v2 tags.
+       *
+       * \see ID3v2Tag()
+       * \see ID3v1Tag()
+       * \see XiphComment()
+       */
+      virtual TagLib::Tag *tag() const;
+
+      /*!
+       * Returns the FLAC::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Save the file.  This will primarily save the XiphComment, but
+       * will also keep any old ID3-tags up to date. If the file
+       * has no XiphComment, one will be constructed from the ID3-tags.
+       *
+       * This returns true if the save was successful.
+       */
+      virtual bool save();
+
+      /*!
+       * Returns a pointer to the ID3v2 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v2 tag.  If \a create is true it will create
+       * an ID3v2 tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v2::Tag *ID3v2Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the ID3v1 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v1 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v1::Tag *ID3v1Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the XiphComment for the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid XiphComment.  If \a create is true it will create
+       * a XiphComment if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      Ogg::XiphComment *xiphComment(bool create = false);
+
+      /*!
+       * Set the ID3v2::FrameFactory to something other than the default.  This
+       * can be used to specify the way that ID3v2 frames will be interpreted
+       * when
+       *
+       * \see ID3v2FrameFactory
+       */
+      void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+
+      /*!
+       * Returns the block of data used by FLAC::Properties for parsing the
+       * stream properties.
+       *
+       * \deprecated This method will not be public in a future release.
+       */
+      ByteVector streamInfoData(); // BIC: remove
+
+      /*!
+       * Returns the length of the audio-stream, used by FLAC::Properties for
+       * calculating the bitrate.
+       *
+       * \deprecated This method will not be public in a future release.
+       */
+      long streamLength();  // BIC: remove
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      void scan();
+      long findID3v2();
+      long findID3v1();
+      ByteVector xiphCommentData() const;
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/flac/flacproperties.cpp b/lib-src/taglib/taglib/flac/flacproperties.cpp
new file mode 100644
index 0000000..f137059
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/flacproperties.cpp
@@ -0,0 +1,150 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "flacproperties.h"
+#include "flacfile.h"
+
+using namespace TagLib;
+
+class FLAC::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(ByteVector d, long st, ReadStyle s) :
+    data(d),
+    streamLength(st),
+    style(s),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    sampleWidth(0),
+    channels(0) {}
+
+  ByteVector data;
+  long streamLength;
+  ReadStyle style;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int sampleWidth;
+  int channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+FLAC::Properties::Properties(ByteVector data, long streamLength, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(data, streamLength, style);
+  read();
+}
+
+FLAC::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(file->streamInfoData(), file->streamLength(), style);
+  read();
+}
+
+FLAC::Properties::~Properties()
+{
+  delete d;
+}
+
+int FLAC::Properties::length() const
+{
+  return d->length;
+}
+
+int FLAC::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int FLAC::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int FLAC::Properties::sampleWidth() const
+{
+  return d->sampleWidth;
+}
+
+int FLAC::Properties::channels() const
+{
+  return d->channels;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void FLAC::Properties::read()
+{
+  if(d->data.size() < 18) {
+    debug("FLAC::Properties::read() - FLAC properties must contain at least 18 bytes.");
+    return;
+  }
+
+  int pos = 0;
+
+  // Minimum block size (in samples)
+  pos += 2;
+
+  // Maximum block size (in samples)
+  pos += 2;
+
+  // Minimum frame size (in bytes)
+  pos += 3;
+
+  // Maximum frame size (in bytes)
+  pos += 3;
+
+  uint flags = d->data.mid(pos, 4).toUInt(true);
+  d->sampleRate = flags >> 12;
+  d->channels = ((flags >> 9) & 7) + 1;
+  d->sampleWidth = ((flags >> 4) & 31) + 1;
+
+  // The last 4 bits are the most significant 4 bits for the 36 bit
+  // stream length in samples. (Audio files measured in days)
+
+  uint highLength =d->sampleRate > 0 ? (((flags & 0xf) << 28) / d->sampleRate) << 4 : 0;
+  pos += 4;
+
+  d->length = d->sampleRate > 0 ?
+      (d->data.mid(pos, 4).toUInt(true)) / d->sampleRate + highLength : 0;
+  pos += 4;
+
+  // Uncompressed bitrate:
+
+  //d->bitrate = ((d->sampleRate * d->channels) / 1000) * d->sampleWidth;
+
+  // Real bitrate:
+
+  d->bitrate = d->length > 0 ? ((d->streamLength * 8UL) / d->length) / 1000 : 0;
+}
diff --git a/lib-src/taglib/taglib/flac/flacproperties.h b/lib-src/taglib/taglib/flac/flacproperties.h
new file mode 100644
index 0000000..9ac6766
--- /dev/null
+++ b/lib-src/taglib/taglib/flac/flacproperties.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_FLACPROPERTIES_H
+#define TAGLIB_FLACPROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace FLAC {
+
+    class File;
+
+    //! An implementation of audio property reading for FLAC
+
+    /*!
+     * This reads the data from an FLAC stream found in the AudioProperties
+     * API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of FLAC::Properties with the data read from the
+       * ByteVector \a data.
+       */
+       // BIC: switch to const reference
+      Properties(ByteVector data, long streamLength, ReadStyle style = Average);
+
+      /*!
+       * Create an instance of FLAC::Properties with the data read from the
+       * FLAC::File \a file.
+       */
+       // BIC: remove
+      Properties(File *file, ReadStyle style = Average);
+
+      /*!
+       * Destroys this FLAC::Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns the sample width as read from the FLAC identification
+       * header.
+       */
+      int sampleWidth() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/.deps/mp4atom.Plo b/lib-src/taglib/taglib/mp4/.deps/mp4atom.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/.deps/mp4atom.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mp4/.deps/mp4file.Plo b/lib-src/taglib/taglib/mp4/.deps/mp4file.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/.deps/mp4file.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mp4/.deps/mp4item.Plo b/lib-src/taglib/taglib/mp4/.deps/mp4item.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/.deps/mp4item.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mp4/.deps/mp4properties.Plo b/lib-src/taglib/taglib/mp4/.deps/mp4properties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/.deps/mp4properties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mp4/.deps/mp4tag.Plo b/lib-src/taglib/taglib/mp4/.deps/mp4tag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/.deps/mp4tag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mp4/CMakeLists.txt b/lib-src/taglib/taglib/mp4/CMakeLists.txt
new file mode 100644
index 0000000..803a9d5
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  mp4file.h mp4atom.h mp4tag.h mp4item.h mp4properties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/mp4/Makefile.am b/lib-src/taglib/taglib/mp4/Makefile.am
new file mode 100644
index 0000000..4ff5a30
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmp4.la
+
+libmp4_la_SOURCES = mp4atom.cpp mp4file.cpp mp4item.cpp mp4properties.cpp mp4tag.cpp
+
+taglib_include_HEADERS = mp4atom.h mp4file.h mp4item.h mp4properties.h mp4tag.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/mp4/Makefile.in b/lib-src/taglib/taglib/mp4/Makefile.in
new file mode 100644
index 0000000..f62a087
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/Makefile.in
@@ -0,0 +1,627 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mp4
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libmp4_la_LIBADD =
+am_libmp4_la_OBJECTS = mp4atom.lo mp4file.lo mp4item.lo \
+	mp4properties.lo mp4tag.lo
+#>- libmp4_la_OBJECTS = $(am_libmp4_la_OBJECTS)
+#>+ 5
+libmp4_la_final_OBJECTS = libmp4_la.all_cpp.lo 
+libmp4_la_nofinal_OBJECTS = mp4atom.lo mp4file.lo mp4item.lo \
+	mp4properties.lo mp4tag.lo
+ at KDE_USE_FINAL_FALSE@libmp4_la_OBJECTS = $(libmp4_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libmp4_la_OBJECTS = $(libmp4_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libmp4_la_SOURCES)
+DIST_SOURCES = $(libmp4_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmp4.la
+libmp4_la_SOURCES = mp4atom.cpp mp4file.cpp mp4item.cpp mp4properties.cpp mp4tag.cpp
+taglib_include_HEADERS = mp4atom.h mp4file.h mp4item.h mp4properties.h mp4tag.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mp4/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mp4/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mp4/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mp4/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mp4/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libmp4.la: $(libmp4_la_OBJECTS) $(libmp4_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libmp4_la_OBJECTS) $(libmp4_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mp4atom.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mp4file.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mp4item.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mp4properties.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mp4tag.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mp4/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mp4/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mp4/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libmp4_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/mp4atom.cpp $(srcdir)/mp4file.cpp $(srcdir)/mp4item.cpp $(srcdir)/mp4properties.cpp $(srcdir)/mp4tag.cpp 
+	@echo 'creating libmp4_la.all_cpp.cpp ...'; \
+	rm -f libmp4_la.all_cpp.files libmp4_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libmp4_la.all_cpp.final; \
+	for file in mp4atom.cpp mp4file.cpp mp4item.cpp mp4properties.cpp mp4tag.cpp ; do \
+	  echo "#include \"$$file\"" >> libmp4_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libmp4_la.all_cpp.final; \
+	done; \
+	cat libmp4_la.all_cpp.final libmp4_la.all_cpp.files > libmp4_la.all_cpp.cpp; \
+	rm -f libmp4_la.all_cpp.final libmp4_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libmp4_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libmp4_la_OBJECTS="$(libmp4_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libmp4_la_OBJECTS="$(libmp4_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libmp4_la_OBJECTS="$(libmp4_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libmp4_la_OBJECTS="$(libmp4_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mp4/mp4atom.cpp b/lib-src/taglib/taglib/mp4/mp4atom.cpp
new file mode 100644
index 0000000..e1a3682
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4atom.cpp
@@ -0,0 +1,175 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_MP4
+
+#include <tdebug.h>
+#include <tstring.h>
+#include "mp4atom.h"
+
+using namespace TagLib;
+
+const char *MP4::Atom::containers[10] = {
+    "moov", "udta", "mdia", "meta", "ilst",
+    "stbl", "minf", "moof", "traf", "trak",
+};
+
+MP4::Atom::Atom(File *file)
+{
+  offset = file->tell();
+  ByteVector header = file->readBlock(8);
+  length = header.mid(0, 4).toUInt();
+
+  if (length == 1) {
+    debug("MP4: 64-bit atoms are not supported");
+    length = 0;
+    file->seek(0, File::End);
+    return;
+  }
+  if (length < 8) {
+    debug("MP4: Invalid atom size");
+    length = 0;
+    file->seek(0, File::End);
+    return;
+  }
+
+  name = header.mid(4, 4);
+
+  for(int i = 0; i < numContainers; i++) {
+    if(name == containers[i]) {
+      if(name == "meta") {
+        file->seek(4, File::Current);
+      }
+      while(file->tell() < offset + length) {
+        children.append(new MP4::Atom(file));
+      }
+      return;
+    }
+  }
+
+  file->seek(offset + length);
+}
+
+MP4::Atom::~Atom()
+{
+  for(unsigned int i = 0; i < children.size(); i++) {
+    delete children[i];
+  }
+  children.clear();
+}
+
+MP4::Atom *
+MP4::Atom::find(const char *name1, const char *name2, const char *name3, const char *name4)
+{
+  if(name1 == 0) {
+    return this;
+  }
+  for(unsigned int i = 0; i < children.size(); i++) {
+    if(children[i]->name == name1) {
+      return children[i]->find(name2, name3, name4);
+    }
+  }
+  return 0;
+}
+
+MP4::AtomList
+MP4::Atom::findall(const char *name, bool recursive)
+{
+  MP4::AtomList result;
+  for(unsigned int i = 0; i < children.size(); i++) {
+    if(children[i]->name == name) {
+      result.append(children[i]);
+    }
+    if(recursive) {
+      result.append(children[i]->findall(name, recursive));
+    }
+  }
+  return result;
+}
+
+bool
+MP4::Atom::path(MP4::AtomList &path, const char *name1, const char *name2, const char *name3)
+{
+  path.append(this);
+  if(name1 == 0) {
+    return true;
+  }
+  for(unsigned int i = 0; i < children.size(); i++) {
+    if(children[i]->name == name1) {
+      return children[i]->path(path, name2, name3);
+    }
+  }
+  return false;
+}
+
+MP4::Atoms::Atoms(File *file)
+{
+  file->seek(0, File::End);
+  long end = file->tell();
+  file->seek(0);
+  while(file->tell() + 8 <= end) {
+    atoms.append(new MP4::Atom(file));
+  }
+}
+
+MP4::Atoms::~Atoms()
+{
+  for(unsigned int i = 0; i < atoms.size(); i++) {
+    delete atoms[i];
+  }
+  atoms.clear();
+}
+
+MP4::Atom *
+MP4::Atoms::find(const char *name1, const char *name2, const char *name3, const char *name4)
+{
+  for(unsigned int i = 0; i < atoms.size(); i++) {
+    if(atoms[i]->name == name1) {
+      return atoms[i]->find(name2, name3, name4);
+    }
+  }
+  return 0;
+}
+
+MP4::AtomList
+MP4::Atoms::path(const char *name1, const char *name2, const char *name3, const char *name4)
+{
+  MP4::AtomList path;
+  for(unsigned int i = 0; i < atoms.size(); i++) {
+    if(atoms[i]->name == name1) {
+      if(!atoms[i]->path(path, name2, name3, name4)) {
+        path.clear();
+      }
+      return path;
+    }
+  }
+  return path;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4atom.h b/lib-src/taglib/taglib/mp4/mp4atom.h
new file mode 100644
index 0000000..702566b
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4atom.h
@@ -0,0 +1,77 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+// This file is not part of the public API!
+
+#ifndef DO_NOT_DOCUMENT
+
+#ifndef TAGLIB_MP4ATOM_H
+#define TAGLIB_MP4ATOM_H
+
+#include <tfile.h>
+#include <tlist.h>
+
+namespace TagLib {
+
+  namespace MP4 {
+
+    class Atom;
+    typedef TagLib::List<Atom *> AtomList;
+
+    class Atom
+    {
+    public:
+        Atom(File *file);
+        ~Atom();
+        Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
+        bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0);
+        AtomList findall(const char *name, bool recursive = false);
+        long offset;
+        long length;
+        TagLib::ByteVector name;
+        AtomList children;
+    private:
+        static const int numContainers = 10;
+        static const char *containers[10];
+    };
+
+    //! Root-level atoms
+    class Atoms
+    {
+    public:
+        Atoms(File *file);
+        ~Atoms();
+        Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
+        AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
+        AtomList atoms;
+    };
+
+  }
+
+}
+
+#endif
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4file.cpp b/lib-src/taglib/taglib/mp4/mp4file.cpp
new file mode 100644
index 0000000..bcb88af
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4file.cpp
@@ -0,0 +1,111 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_MP4
+
+#include <tdebug.h>
+#include <tstring.h>
+#include "mp4atom.h"
+#include "mp4tag.h"
+#include "mp4file.h"
+
+using namespace TagLib;
+
+class MP4::File::FilePrivate
+{
+public:
+  FilePrivate() : tag(0), atoms(0)
+  {
+  }
+
+  ~FilePrivate()
+  {
+    if(atoms) {
+        delete atoms;
+        atoms = 0;
+    }
+    if(tag) {
+        delete tag;
+        tag = 0;
+    }
+    if(properties) {
+        delete properties;
+        properties = 0;
+    }
+  }
+
+  MP4::Tag *tag;
+  MP4::Atoms *atoms;
+  MP4::Properties *properties;
+};
+
+MP4::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle audioPropertiesStyle)
+    : TagLib::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, audioPropertiesStyle);
+}
+
+MP4::File::~File()
+{
+  delete d;
+}
+
+MP4::Tag *
+MP4::File::tag() const
+{
+  return d->tag;
+}
+
+MP4::Properties *
+MP4::File::audioProperties() const
+{
+  return d->properties;
+}
+
+void
+MP4::File::read(bool readProperties, Properties::ReadStyle audioPropertiesStyle)
+{
+  if(!isValid())
+    return;
+
+  d->atoms = new Atoms(this);
+  d->tag = new Tag(this, d->atoms);
+  if(readProperties) {
+    d->properties = new Properties(this, d->atoms, audioPropertiesStyle);
+  }
+}
+
+bool
+MP4::File::save()
+{
+  return d->tag->save();
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4file.h b/lib-src/taglib/taglib/mp4/mp4file.h
new file mode 100644
index 0000000..3bd15e3
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4file.h
@@ -0,0 +1,102 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MP4FILE_H
+#define TAGLIB_MP4FILE_H
+
+#include <tag.h>
+#include <tfile.h>
+#include "taglib_export.h"
+#include "mp4properties.h"
+#include "mp4tag.h"
+
+namespace TagLib {
+
+  //! An implementation of MP4 (AAC, ALAC, ...) metadata
+  namespace MP4 {
+
+    class Atoms;
+
+    /*!
+     * This implements and provides an interface for MP4 files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to MP4 files.
+     */
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * Contructs an ASF file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * \note In the current implementation, both \a readProperties and
+       * \a propertiesStyle are ignored.
+       */
+      File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns a pointer to the MP4 tag of the file.
+       *
+       * MP4::Tag implements the tag interface, so this serves as the
+       * reimplementation of TagLib::File::tag().
+       *
+       * \note The Tag <b>is still</b> owned by the ASF::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      Tag *tag() const;
+
+      /*!
+       * Returns the MP4 audio properties for this file.
+       */
+      Properties *audioProperties() const;
+
+      /*!
+       * Save the file.
+       *
+       * This returns true if the save was successful.
+       */
+      bool save();
+
+    private:
+
+      void read(bool readProperties, Properties::ReadStyle audioPropertiesStyle);
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4item.cpp b/lib-src/taglib/taglib/mp4/mp4item.cpp
new file mode 100644
index 0000000..2b5613a
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4item.cpp
@@ -0,0 +1,136 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_MP4
+
+#include <taglib.h>
+#include <tdebug.h>
+#include "mp4item.h"
+
+using namespace TagLib;
+
+class MP4::Item::ItemPrivate : public RefCounter
+{
+public:
+  ItemPrivate() : RefCounter(), valid(true) {}
+
+  bool valid;
+  union {
+    bool m_bool;
+    int m_int;
+    IntPair m_intPair;
+  };
+  StringList m_stringList;
+};
+
+MP4::Item::Item()
+{
+  d = new ItemPrivate;
+  d->valid = false;
+}
+
+MP4::Item::Item(const Item &item) : d(item.d)
+{
+  d->ref();
+}
+
+MP4::Item &
+MP4::Item::operator=(const Item &item)
+{
+  if(d->deref()) {
+    delete d;
+  }
+  d = item.d;
+  d->ref();
+  return *this;
+}
+
+MP4::Item::~Item()
+{
+  if(d->deref()) {
+    delete d;
+  }
+}
+
+MP4::Item::Item(bool value)
+{
+  d = new ItemPrivate;
+  d->m_bool = value;
+}
+
+MP4::Item::Item(int value)
+{
+  d = new ItemPrivate;
+  d->m_int = value;
+}
+
+MP4::Item::Item(int value1, int value2)
+{
+  d = new ItemPrivate;
+  d->m_intPair.first = value1;
+  d->m_intPair.second = value2;
+}
+
+MP4::Item::Item(const StringList &value)
+{
+  d = new ItemPrivate;
+  d->m_stringList = value;
+}
+
+bool
+MP4::Item::toBool() const
+{
+  return d->m_bool;
+}
+
+int
+MP4::Item::toInt() const
+{
+  return d->m_int;
+}
+
+MP4::Item::IntPair
+MP4::Item::toIntPair() const
+{
+  return d->m_intPair;
+}
+
+StringList
+MP4::Item::toStringList() const
+{
+  return d->m_stringList;
+}
+
+bool
+MP4::Item::isValid() const
+{
+  return d->valid;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4item.h b/lib-src/taglib/taglib/mp4/mp4item.h
new file mode 100644
index 0000000..d53c41c
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4item.h
@@ -0,0 +1,69 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MP4ITEM_H
+#define TAGLIB_MP4ITEM_H
+
+#include <tstringlist.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace MP4 {
+
+    class TAGLIB_EXPORT Item
+    {
+    public:
+      struct IntPair {
+        int first, second;
+      };
+
+      Item();
+      Item(const Item &item);
+      Item &operator=(const Item &item);
+      ~Item();
+
+      Item(int value);
+      Item(bool value);
+      Item(int first, int second);
+      Item(const StringList &value);
+
+      int toInt() const;
+      bool toBool() const;
+      IntPair toIntPair() const;
+      StringList toStringList() const;
+
+      bool isValid() const;
+
+    private:
+      class ItemPrivate;
+      ItemPrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4properties.cpp b/lib-src/taglib/taglib/mp4/mp4properties.cpp
new file mode 100644
index 0000000..c973d3a
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4properties.cpp
@@ -0,0 +1,169 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_MP4
+
+#include <tdebug.h>
+#include <tstring.h>
+#include "mp4file.h"
+#include "mp4atom.h"
+#include "mp4properties.h"
+
+using namespace TagLib;
+
+class MP4::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), bitsPerSample(0) {}
+
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int bitsPerSample;
+};
+
+MP4::Properties::Properties(File *file, MP4::Atoms *atoms, ReadStyle style)
+  : AudioProperties(style)
+{
+  d = new PropertiesPrivate;
+
+  MP4::Atom *moov = atoms->find("moov");
+  if(!moov) {
+    debug("MP4: Atom 'moov' not found");
+    return;
+  }
+
+  MP4::Atom *trak = 0;
+  ByteVector data;
+
+  MP4::AtomList trakList = moov->findall("trak");
+  for (unsigned int i = 0; i < trakList.size(); i++) {
+    trak = trakList[i];
+    MP4::Atom *hdlr = trak->find("mdia", "hdlr");
+    if(!hdlr) {
+      debug("MP4: Atom 'trak.mdia.hdlr' not found");
+      return;
+    }
+    file->seek(hdlr->offset);
+    data = file->readBlock(hdlr->length);
+    if(data.mid(16, 4) == "soun") {
+      break;
+    }
+    trak = 0;
+  }
+  if (!trak) {
+    debug("MP4: No audio tracks");
+    return;
+  }
+
+  MP4::Atom *mdhd = trak->find("mdia", "mdhd");
+  if(!mdhd) {
+    debug("MP4: Atom 'trak.mdia.mdhd' not found");
+    return;
+  }
+
+  file->seek(mdhd->offset);
+  data = file->readBlock(mdhd->length);
+  if(data[8] == 0) {
+    unsigned int unit = data.mid(20, 4).toUInt();
+    unsigned int length = data.mid(24, 4).toUInt();
+    d->length = length / unit;
+  }
+  else {
+    long long unit = data.mid(28, 8).toLongLong();
+    long long length = data.mid(36, 8).toLongLong();
+    d->length = int(length / unit);
+  }
+
+  MP4::Atom *atom = trak->find("mdia", "minf", "stbl", "stsd");
+  if(!atom) {
+    return;
+  }
+
+  file->seek(atom->offset);
+  data = file->readBlock(atom->length);
+  if(data.mid(20, 4) == "mp4a") {
+    d->channels = data.mid(40, 2).toShort();
+    d->bitsPerSample = data.mid(42, 2).toShort();
+    d->sampleRate = data.mid(46, 4).toUInt();
+    if(data.mid(56, 4) == "esds" && data[64] == 0x03) {
+      long pos = 65;
+      if(data.mid(pos, 3) == "\x80\x80\x80") {
+        pos += 3;
+      }
+      pos += 4;
+      if(data[pos] == 0x04) {
+        pos += 1;
+        if(data.mid(pos, 3) == "\x80\x80\x80") {
+          pos += 3;
+        }
+        pos += 10;
+        d->bitrate = (data.mid(pos, 4).toUInt() + 500) / 1000;
+      }
+    }
+  }
+}
+
+MP4::Properties::~Properties()
+{
+  delete d;
+}
+
+int
+MP4::Properties::channels() const
+{
+  return d->channels;
+}
+
+int
+MP4::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int
+MP4::Properties::length() const
+{
+  return d->length;
+}
+
+int
+MP4::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int
+MP4::Properties::bitsPerSample() const
+{
+  return d->bitsPerSample;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4properties.h b/lib-src/taglib/taglib/mp4/mp4properties.h
new file mode 100644
index 0000000..fb76c8a
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4properties.h
@@ -0,0 +1,61 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MP4PROPERTIES_H
+#define TAGLIB_MP4PROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace MP4 {
+
+    class Atoms;
+    class File;
+
+    //! An implementation of MP4 audio properties
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      Properties(File *file, Atoms *atoms, ReadStyle style = Average);
+      virtual ~Properties();
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+      virtual int bitsPerSample() const;
+
+    private:
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4tag.cpp b/lib-src/taglib/taglib/mp4/mp4tag.cpp
new file mode 100644
index 0000000..229c475
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4tag.cpp
@@ -0,0 +1,558 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef WITH_MP4
+
+#include <tdebug.h>
+#include <tstring.h>
+#include "mp4atom.h"
+#include "mp4tag.h"
+
+using namespace TagLib;
+
+class MP4::Tag::TagPrivate
+{
+public:
+  TagPrivate() : file(0), atoms(0) {}
+  ~TagPrivate() {}
+  File *file;
+  Atoms *atoms;
+  ItemListMap items;
+};
+
+MP4::Tag::Tag(File *file, MP4::Atoms *atoms)
+{
+  d = new TagPrivate;
+  d->file = file;
+  d->atoms = atoms;
+
+  MP4::Atom *ilst = atoms->find("moov", "udta", "meta", "ilst");
+  if(!ilst) {
+    //debug("Atom moov.udta.meta.ilst not found.");
+    return;
+  }
+
+  for(unsigned int i = 0; i < ilst->children.size(); i++) {
+    MP4::Atom *atom = ilst->children[i];
+    file->seek(atom->offset + 8);
+    if(atom->name == "----") {
+      parseFreeForm(atom, file);
+    }
+    else if(atom->name == "trkn" || atom->name == "disk") {
+      parseIntPair(atom, file);
+    }
+    else if(atom->name == "cpil" || atom->name == "pgap" || atom->name == "pcst") {
+      parseBool(atom, file);
+    }
+    else if(atom->name == "tmpo") {
+      parseInt(atom, file);
+    }
+    else {
+      parseText(atom, file);
+    }
+  }
+}
+
+ByteVectorList
+MP4::Tag::parseData(MP4::Atom *atom, TagLib::File *file, int expectedFlags, bool freeForm)
+{
+  ByteVectorList result;
+  ByteVector data = file->readBlock(atom->length - 8);
+  int i = 0;
+  unsigned int pos = 0;
+  while(pos < data.size()) {
+    int length = data.mid(pos, 4).toUInt();
+    ByteVector name = data.mid(pos + 4, 4);
+    int flags = data.mid(pos + 8, 4).toUInt();
+    if(freeForm && i < 2) {
+      if(i == 0 && name != "mean") {
+        debug("MP4: Unexpected atom \"" + name + "\", expecting \"mean\"");
+        return result;
+      }
+      else if(i == 1 && name != "name") {
+        debug("MP4: Unexpected atom \"" + name + "\", expecting \"name\"");
+        return result;
+      }
+      result.append(data.mid(pos + 12, length - 12));
+    }
+    else {
+      if(name != "data") {
+        debug("MP4: Unexpected atom \"" + name + "\", expecting \"data\"");
+        return result;
+      }
+      if(expectedFlags == -1 || flags == expectedFlags) {
+        result.append(data.mid(pos + 16, length - 16));
+      }
+    }
+    pos += length;
+    i++;
+  }
+  return result;
+}
+
+void
+MP4::Tag::parseInt(MP4::Atom *atom, TagLib::File *file)
+{
+  ByteVectorList data = parseData(atom, file);
+  if(data.size()) {
+    d->items.insert(atom->name, (int)data[0].toShort());
+  }
+}
+
+void
+MP4::Tag::parseIntPair(MP4::Atom *atom, TagLib::File *file)
+{
+  ByteVectorList data = parseData(atom, file);
+  if(data.size()) {
+    int a = data[0].mid(2, 2).toShort();
+    int b = data[0].mid(4, 2).toShort();
+    d->items.insert(atom->name, MP4::Item(a, b));
+  }
+}
+
+void
+MP4::Tag::parseBool(MP4::Atom *atom, TagLib::File *file)
+{
+  ByteVectorList data = parseData(atom, file);
+  if(data.size()) {
+    d->items.insert(atom->name, data[0][0] != '\0');
+  }
+}
+
+void
+MP4::Tag::parseText(MP4::Atom *atom, TagLib::File *file, int expectedFlags)
+{
+  ByteVectorList data = parseData(atom, file, expectedFlags);
+  if(data.size()) {
+    StringList value;
+    for(unsigned int i = 0; i < data.size(); i++) {
+      value.append(String(data[i], String::UTF8));
+    }
+    d->items.insert(atom->name, value);
+  }
+}
+
+void
+MP4::Tag::parseFreeForm(MP4::Atom *atom, TagLib::File *file)
+{
+  ByteVectorList data = parseData(atom, file, 1, true);
+  if(data.size() > 2) {
+    StringList value;
+    for(unsigned int i = 2; i < data.size(); i++) {
+      value.append(String(data[i], String::UTF8));
+    }
+    String name = "----:" + data[0] + ":" + data[1];
+    d->items.insert(name, value);
+  }
+}
+
+ByteVector
+MP4::Tag::padIlst(const ByteVector &data, int length)
+{
+  if (length == -1) {
+    length = ((data.size() + 1023) & ~1023) - data.size();
+  }
+  return renderAtom("free", ByteVector(length, '\1'));
+}
+
+ByteVector
+MP4::Tag::renderAtom(const ByteVector &name, const ByteVector &data)
+{
+  return ByteVector::fromUInt(data.size() + 8) + name + data;
+}
+
+ByteVector
+MP4::Tag::renderData(const ByteVector &name, int flags, const ByteVectorList &data)
+{
+  ByteVector result;
+  for(unsigned int i = 0; i < data.size(); i++) {
+    result.append(renderAtom("data", ByteVector::fromUInt(flags) + ByteVector(4, '\0') + data[i]));
+  }
+  return renderAtom(name, result);
+}
+
+ByteVector
+MP4::Tag::renderBool(const ByteVector &name, MP4::Item &item)
+{
+  ByteVectorList data;
+  data.append(ByteVector(1, item.toBool() ? '\1' : '\0'));
+  return renderData(name, 0x15, data);
+}
+
+ByteVector
+MP4::Tag::renderInt(const ByteVector &name, MP4::Item &item)
+{
+  ByteVectorList data;
+  data.append(ByteVector::fromShort(item.toInt()));
+  return renderData(name, 0x15, data);
+}
+
+ByteVector
+MP4::Tag::renderIntPair(const ByteVector &name, MP4::Item &item)
+{
+  ByteVectorList data;
+  data.append(ByteVector(2, '\0') +
+              ByteVector::fromShort(item.toIntPair().first) +
+              ByteVector::fromShort(item.toIntPair().second) +
+              ByteVector(2, '\0'));
+  return renderData(name, 0x15, data);
+}
+
+ByteVector
+MP4::Tag::renderIntPairNoTrailing(const ByteVector &name, MP4::Item &item)
+{
+  ByteVectorList data;
+  data.append(ByteVector(2, '\0') +
+              ByteVector::fromShort(item.toIntPair().first) +
+              ByteVector::fromShort(item.toIntPair().second));
+  return renderData(name, 0x15, data);
+}
+
+ByteVector
+MP4::Tag::renderText(const ByteVector &name, MP4::Item &item, int flags)
+{
+  ByteVectorList data;
+  StringList value = item.toStringList();
+  for(unsigned int i = 0; i < value.size(); i++) {
+    data.append(value[i].data(String::UTF8));
+  }
+  return renderData(name, flags, data);
+}
+
+ByteVector
+MP4::Tag::renderFreeForm(const String &name, MP4::Item &item)
+{
+  StringList header = StringList::split(name, ":");
+  if (header.size() != 3) {
+    debug("MP4: Invalid free-form item name \"" + name + "\"");
+    return ByteVector::null;
+  }
+  ByteVector data;
+  data.append(renderAtom("mean", ByteVector::fromUInt(0) + header[1].data(String::UTF8)));
+  data.append(renderAtom("name", ByteVector::fromUInt(0) + header[2].data(String::UTF8)));
+  StringList value = item.toStringList();
+  for(unsigned int i = 0; i < value.size(); i++) {
+    data.append(renderAtom("data", ByteVector::fromUInt(1) + ByteVector(4, '\0') + value[i].data(String::UTF8)));
+  }
+  return renderAtom("----", data);
+}
+
+bool
+MP4::Tag::save()
+{
+  ByteVector data;
+  for(MP4::ItemListMap::Iterator i = d->items.begin(); i != d->items.end(); i++) {
+    const String name = i->first;
+    if(name.startsWith("----")) {
+      data.append(renderFreeForm(name, i->second));
+    }
+    else if(name == "trkn") {
+      data.append(renderIntPair(name.data(String::Latin1), i->second));
+    }
+    else if(name == "disk") {
+      data.append(renderIntPairNoTrailing(name.data(String::Latin1), i->second));
+    }
+    else if(name == "cpil" || name == "pgap" || name == "pcst") {
+      data.append(renderBool(name.data(String::Latin1), i->second));
+    }
+    else if(name == "tmpo") {
+      data.append(renderInt(name.data(String::Latin1), i->second));
+    }
+    else if(name.size() == 4){
+      data.append(renderText(name.data(String::Latin1), i->second));
+    }
+    else {
+      debug("MP4: Unknown item name \"" + name + "\"");
+    }
+  }
+  data = renderAtom("ilst", data);
+
+  AtomList path = d->atoms->path("moov", "udta", "meta", "ilst");
+  if(path.size() == 4) {
+    saveExisting(data, path);
+  }
+  else {
+    saveNew(data);
+  }
+
+  return true;
+}
+
+void
+MP4::Tag::updateParents(AtomList &path, long delta, int ignore)
+{
+  for(unsigned int i = 0; i < path.size() - ignore; i++) {
+    d->file->seek(path[i]->offset);
+    long size = d->file->readBlock(4).toUInt() + delta;
+    d->file->seek(path[i]->offset);
+    d->file->writeBlock(ByteVector::fromUInt(size));
+  }
+}
+
+void
+MP4::Tag::updateOffsets(long delta, long offset)
+{
+  MP4::Atom *moov = d->atoms->find("moov");
+  if(moov) {
+    MP4::AtomList stco = moov->findall("stco", true);
+    for(unsigned int i = 0; i < stco.size(); i++) {
+      MP4::Atom *atom = stco[i];
+      if(atom->offset > offset) {
+        atom->offset += delta;
+      }
+      d->file->seek(atom->offset + 12);
+      ByteVector data = d->file->readBlock(atom->length - 12);
+      unsigned int count = data.mid(0, 4).toUInt();
+      d->file->seek(atom->offset + 16);
+      int pos = 4;
+      while(count--) {
+        long o = data.mid(pos, 4).toUInt();
+        if(o > offset) {
+          o += delta;
+        }
+        d->file->writeBlock(ByteVector::fromUInt(o));
+        pos += 4;
+      }
+    }
+
+    MP4::AtomList co64 = moov->findall("co64", true);
+    for(unsigned int i = 0; i < co64.size(); i++) {
+      MP4::Atom *atom = co64[i];
+      if(atom->offset > offset) {
+        atom->offset += delta;
+      }
+      d->file->seek(atom->offset + 12);
+      ByteVector data = d->file->readBlock(atom->length - 12);
+      unsigned int count = data.mid(0, 4).toUInt();
+      d->file->seek(atom->offset + 16);
+      int pos = 4;
+      while(count--) {
+        long long o = data.mid(pos, 8).toLongLong();
+        if(o > offset) {
+          o += delta;
+        }
+        d->file->writeBlock(ByteVector::fromLongLong(o));
+        pos += 8;
+      }
+    }
+  }
+
+  MP4::Atom *moof = d->atoms->find("moof");
+  if(moof) {
+    MP4::AtomList tfhd = moof->findall("tfhd", true);
+    for(unsigned int i = 0; i < tfhd.size(); i++) {
+      MP4::Atom *atom = tfhd[i];
+      if(atom->offset > offset) {
+        atom->offset += delta;
+      }
+      d->file->seek(atom->offset + 9);
+      ByteVector data = d->file->readBlock(atom->offset - 9);
+      unsigned int flags = (ByteVector(1, '\0') + data.mid(0, 3)).toUInt();
+      if(flags & 1) {
+        long long o = data.mid(7, 8).toLongLong();
+        if(o > offset) {
+          o += delta;
+        }
+        d->file->seek(atom->offset + 16);
+        d->file->writeBlock(ByteVector::fromLongLong(o));
+      }
+    }
+  }
+}
+
+void
+MP4::Tag::saveNew(ByteVector &data)
+{
+  data = renderAtom("meta", TagLib::ByteVector(4, '\0') +
+                    renderAtom("hdlr", TagLib::ByteVector(8, '\0') + TagLib::ByteVector("mdirappl") + TagLib::ByteVector(9, '\0')) +
+                    data + padIlst(data));
+
+  AtomList path = d->atoms->path("moov", "udta");
+  if(path.size() != 2) {
+    path = d->atoms->path("moov");
+    data = renderAtom("udta", data);
+  }
+
+  long offset = path[path.size() - 1]->offset + 8;
+  d->file->insert(data, offset, 0);
+
+  updateParents(path, data.size());
+  updateOffsets(data.size(), offset);
+}
+
+void
+MP4::Tag::saveExisting(ByteVector &data, AtomList &path)
+{
+  MP4::Atom *ilst = path[path.size() - 1];
+  long offset = ilst->offset;
+  long length = ilst->length;
+
+  MP4::Atom *meta = path[path.size() - 2];
+  AtomList::Iterator index = meta->children.find(ilst);
+  if(index != meta->children.begin()) {
+    AtomList::Iterator prevIndex = index;
+    prevIndex--;
+    MP4::Atom *prev = *prevIndex;
+    if(prev->name == "free") {
+      offset = prev->offset;
+      length += prev->length;
+    }
+  }
+  if(index != meta->children.end()) {
+    AtomList::Iterator nextIndex = index;
+    nextIndex++;
+    MP4::Atom *next = *nextIndex;
+    if(next->name == "free") {
+      length += next->length;
+    }
+  }
+
+  long delta = data.size() - length;
+  if(delta > 0 || (delta < 0 && delta > -8)) {
+    data.append(padIlst(data));
+    delta = data.size() - length;
+  }
+  else if(delta < 0) {
+    data.append(padIlst(data, -delta - 8));
+    delta = 0;
+  }
+
+  d->file->insert(data, offset, length);
+
+  if(delta) {
+    updateParents(path, delta, 1);
+    updateOffsets(delta, offset);
+  }
+}
+
+String
+MP4::Tag::title() const
+{
+  if(d->items.contains("\251nam"))
+    return d->items["\251nam"].toStringList().toString(", ");
+  return String::null;
+}
+
+String
+MP4::Tag::artist() const
+{
+  if(d->items.contains("\251ART"))
+    return d->items["\251ART"].toStringList().toString(", ");
+  return String::null;
+}
+
+String
+MP4::Tag::album() const
+{
+  if(d->items.contains("\251alb"))
+    return d->items["\251alb"].toStringList().toString(", ");
+  return String::null;
+}
+
+String
+MP4::Tag::comment() const
+{
+  if(d->items.contains("\251cmt"))
+    return d->items["\251cmt"].toStringList().toString(", ");
+  return String::null;
+}
+
+String
+MP4::Tag::genre() const
+{
+  if(d->items.contains("\251gen"))
+    return d->items["\251gen"].toStringList().toString(", ");
+  return String::null;
+}
+
+unsigned int
+MP4::Tag::year() const
+{
+  if(d->items.contains("\251day"))
+    return d->items["\251day"].toStringList().toString().toInt();
+  return 0;
+}
+
+unsigned int
+MP4::Tag::track() const
+{
+  if(d->items.contains("trkn"))
+    return d->items["trkn"].toIntPair().first;
+  return 0;
+}
+
+void
+MP4::Tag::setTitle(const String &value)
+{
+  d->items["\251nam"] = StringList(value);
+}
+
+void
+MP4::Tag::setArtist(const String &value)
+{
+  d->items["\251ART"] = StringList(value);
+}
+
+void
+MP4::Tag::setAlbum(const String &value)
+{
+  d->items["\251alb"] = StringList(value);
+}
+
+void
+MP4::Tag::setComment(const String &value)
+{
+  d->items["\251cmt"] = StringList(value);
+}
+
+void
+MP4::Tag::setGenre(const String &value)
+{
+  d->items["\251gen"] = StringList(value);
+}
+
+void
+MP4::Tag::setYear(uint value)
+{
+  d->items["\251day"] = StringList(String::number(value));
+}
+
+void
+MP4::Tag::setTrack(uint value)
+{
+  d->items["trkn"] = MP4::Item(value, 0);
+}
+
+MP4::ItemListMap &
+MP4::Tag::itemListMap()
+{
+  return d->items;
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mp4/mp4tag.h b/lib-src/taglib/taglib/mp4/mp4tag.h
new file mode 100644
index 0000000..4671d16
--- /dev/null
+++ b/lib-src/taglib/taglib/mp4/mp4tag.h
@@ -0,0 +1,100 @@
+/**************************************************************************
+    copyright            : (C) 2007 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+ **************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MP4TAG_H
+#define TAGLIB_MP4TAG_H
+
+#include <tag.h>
+#include <tbytevectorlist.h>
+#include <tfile.h>
+#include <tmap.h>
+#include <tstringlist.h>
+#include "taglib_export.h"
+#include "mp4atom.h"
+#include "mp4item.h"
+
+namespace TagLib {
+
+  namespace MP4 {
+
+    typedef TagLib::Map<String, Item> ItemListMap;
+
+    class TAGLIB_EXPORT Tag: public TagLib::Tag
+    {
+    public:
+        Tag(TagLib::File *file, Atoms *atoms);
+        bool save();
+
+        String title() const;
+        String artist() const;
+        String album() const;
+        String comment() const;
+        String genre() const;
+        uint year() const;
+        uint track() const;
+
+        void setTitle(const String &value);
+        void setArtist(const String &value);
+        void setAlbum(const String &value);
+        void setComment(const String &value);
+        void setGenre(const String &value);
+        void setYear(uint value);
+        void setTrack(uint value);
+
+        ItemListMap &itemListMap();
+
+    private:
+        TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false);
+        void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1);
+        void parseFreeForm(Atom *atom, TagLib::File *file);
+        void parseInt(Atom *atom, TagLib::File *file);
+        void parseIntPair(Atom *atom, TagLib::File *file);
+        void parseBool(Atom *atom, TagLib::File *file);
+
+        TagLib::ByteVector padIlst(const ByteVector &data, int length = -1);
+        TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data);
+        TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data);
+        TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = 1);
+        TagLib::ByteVector renderFreeForm(const String &name, Item &item);
+        TagLib::ByteVector renderBool(const ByteVector &name, Item &item);
+        TagLib::ByteVector renderInt(const ByteVector &name, Item &item);
+        TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item);
+        TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item);
+
+        void updateParents(AtomList &path, long delta, int ignore = 0);
+        void updateOffsets(long delta, long offset);
+
+        void saveNew(TagLib::ByteVector &data);
+        void saveExisting(TagLib::ByteVector &data, AtomList &path);
+
+        class TagPrivate;
+        TagPrivate *d;
+    };
+
+  }
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpc/.deps/mpcfile.Plo b/lib-src/taglib/taglib/mpc/.deps/mpcfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/.deps/mpcfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpc/.deps/mpcproperties.Plo b/lib-src/taglib/taglib/mpc/.deps/mpcproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/.deps/mpcproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpc/CMakeLists.txt b/lib-src/taglib/taglib/mpc/CMakeLists.txt
new file mode 100644
index 0000000..238c9cb
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  mpcfile.h mpcproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/mpc/Makefile.am b/lib-src/taglib/taglib/mpc/Makefile.am
new file mode 100644
index 0000000..6924756
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmpc.la
+
+libmpc_la_SOURCES = mpcfile.cpp mpcproperties.cpp
+
+taglib_include_HEADERS = mpcfile.h mpcproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/mpc/Makefile.in b/lib-src/taglib/taglib/mpc/Makefile.in
new file mode 100644
index 0000000..47152a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/Makefile.in
@@ -0,0 +1,625 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mpc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libmpc_la_LIBADD =
+am_libmpc_la_OBJECTS = mpcfile.lo mpcproperties.lo
+#>- libmpc_la_OBJECTS = $(am_libmpc_la_OBJECTS)
+#>+ 4
+libmpc_la_final_OBJECTS = libmpc_la.all_cpp.lo 
+libmpc_la_nofinal_OBJECTS = mpcfile.lo mpcproperties.lo
+ at KDE_USE_FINAL_FALSE@libmpc_la_OBJECTS = $(libmpc_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libmpc_la_OBJECTS = $(libmpc_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libmpc_la_SOURCES)
+DIST_SOURCES = $(libmpc_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmpc.la
+libmpc_la_SOURCES = mpcfile.cpp mpcproperties.cpp
+taglib_include_HEADERS = mpcfile.h mpcproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpc/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mpc/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpc/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpc/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpc/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libmpc.la: $(libmpc_la_OBJECTS) $(libmpc_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libmpc_la_OBJECTS) $(libmpc_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpcfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpcproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpc/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpc/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpc/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libmpc_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/mpcfile.cpp $(srcdir)/mpcproperties.cpp 
+	@echo 'creating libmpc_la.all_cpp.cpp ...'; \
+	rm -f libmpc_la.all_cpp.files libmpc_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libmpc_la.all_cpp.final; \
+	for file in mpcfile.cpp mpcproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libmpc_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libmpc_la.all_cpp.final; \
+	done; \
+	cat libmpc_la.all_cpp.final libmpc_la.all_cpp.files > libmpc_la.all_cpp.cpp; \
+	rm -f libmpc_la.all_cpp.final libmpc_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libmpc_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libmpc_la_OBJECTS="$(libmpc_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libmpc_la_OBJECTS="$(libmpc_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libmpc_la_OBJECTS="$(libmpc_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libmpc_la_OBJECTS="$(libmpc_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mpc/mpcfile.cpp b/lib-src/taglib/taglib/mpc/mpcfile.cpp
new file mode 100644
index 0000000..922bf83
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/mpcfile.cpp
@@ -0,0 +1,325 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tagunion.h>
+#include <tdebug.h>
+
+#include "mpcfile.h"
+#include "id3v1tag.h"
+#include "id3v2header.h"
+#include "apetag.h"
+#include "apefooter.h"
+
+using namespace TagLib;
+
+namespace
+{
+  enum { APEIndex, ID3v1Index };
+}
+
+class MPC::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    APELocation(-1),
+    APESize(0),
+    ID3v1Location(-1),
+    ID3v2Header(0),
+    ID3v2Location(-1),
+    ID3v2Size(0),
+    properties(0),
+    scanned(false),
+    hasAPE(false),
+    hasID3v1(false),
+    hasID3v2(false) {}
+
+  ~FilePrivate()
+  {
+    delete ID3v2Header;
+    delete properties;
+  }
+
+  long APELocation;
+  uint APESize;
+
+  long ID3v1Location;
+
+  ID3v2::Header *ID3v2Header;
+  long ID3v2Location;
+  uint ID3v2Size;
+
+  TagUnion tag;
+
+  Properties *properties;
+  bool scanned;
+
+  // These indicate whether the file *on disk* has these tags, not if
+  // this data structure does.  This is used in computing offsets.
+
+  bool hasAPE;
+  bool hasID3v1;
+  bool hasID3v2;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+MPC::File::File(FileName file, bool readProperties,
+                Properties::ReadStyle propertiesStyle) : TagLib::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+MPC::File::~File()
+{
+  delete d;
+}
+
+TagLib::Tag *MPC::File::tag() const
+{
+  return &d->tag;
+}
+
+MPC::Properties *MPC::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool MPC::File::save()
+{
+  if(readOnly()) {
+    debug("MPC::File::save() -- File is read only.");
+    return false;
+  }
+
+  // Possibly strip ID3v2 tag
+
+  if(d->hasID3v2 && !d->ID3v2Header) {
+    removeBlock(d->ID3v2Location, d->ID3v2Size);
+    d->hasID3v2 = false;
+    if(d->hasID3v1)
+      d->ID3v1Location -= d->ID3v2Size;
+    if(d->hasAPE)
+      d->APELocation -= d->ID3v2Size;
+  }
+
+  // Update ID3v1 tag
+
+  if(ID3v1Tag()) {
+    if(d->hasID3v1) {
+      seek(d->ID3v1Location);
+      writeBlock(ID3v1Tag()->render());
+    }
+    else {
+      seek(0, End);
+      d->ID3v1Location = tell();
+      writeBlock(ID3v1Tag()->render());
+      d->hasID3v1 = true;
+    }
+  } else
+    if(d->hasID3v1) {
+      removeBlock(d->ID3v1Location, 128);
+      d->hasID3v1 = false;
+      if(d->hasAPE) {
+        if(d->APELocation > d->ID3v1Location)
+          d->APELocation -= 128;
+      }
+    }
+
+  // Update APE tag
+
+  if(APETag()) {
+    if(d->hasAPE)
+      insert(APETag()->render(), d->APELocation, d->APESize);
+    else {
+      if(d->hasID3v1)  {
+        insert(APETag()->render(), d->ID3v1Location, 0);
+        d->APESize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+        d->APELocation = d->ID3v1Location;
+        d->ID3v1Location += d->APESize;
+      }
+      else {
+        seek(0, End);
+        d->APELocation = tell();
+        writeBlock(APETag()->render());
+        d->APESize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+      }
+    }
+  }
+  else
+    if(d->hasAPE) {
+      removeBlock(d->APELocation, d->APESize);
+      d->hasAPE = false;
+      if(d->hasID3v1) {
+        if(d->ID3v1Location > d->APELocation)
+          d->ID3v1Location -= d->APESize;
+      }
+    }
+
+  return true;
+}
+
+ID3v1::Tag *MPC::File::ID3v1Tag(bool create)
+{
+  return d->tag.access<ID3v1::Tag>(ID3v1Index, create);
+}
+
+APE::Tag *MPC::File::APETag(bool create)
+{
+  return d->tag.access<APE::Tag>(APEIndex, create);
+}
+
+void MPC::File::strip(int tags)
+{
+  if(tags & ID3v1) {
+    d->tag.set(ID3v1Index, 0);
+    APETag(true);
+  }
+
+  if(tags & ID3v2) {
+    delete d->ID3v2Header;
+    d->ID3v2Header = 0;
+  }
+
+  if(tags & APE) {
+    d->tag.set(APEIndex, 0);
+
+    if(!ID3v1Tag())
+      APETag(true);
+  }
+}
+
+void MPC::File::remove(int tags)
+{
+  strip(tags);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void MPC::File::read(bool readProperties, Properties::ReadStyle /* propertiesStyle */)
+{
+  // Look for an ID3v1 tag
+
+  d->ID3v1Location = findID3v1();
+
+  if(d->ID3v1Location >= 0) {
+    d->tag.set(ID3v1Index, new ID3v1::Tag(this, d->ID3v1Location));
+    d->hasID3v1 = true;
+  }
+
+  // Look for an APE tag
+
+  findAPE();
+
+  d->APELocation = findAPE();
+
+  if(d->APELocation >= 0) {
+    d->tag.set(APEIndex, new APE::Tag(this, d->APELocation));
+
+    d->APESize = APETag()->footer()->completeTagSize();
+    d->APELocation = d->APELocation + APETag()->footer()->size() - d->APESize;
+    d->hasAPE = true;
+  }
+
+  if(!d->hasID3v1)
+    APETag(true);
+
+  // Look for and skip an ID3v2 tag
+
+  d->ID3v2Location = findID3v2();
+
+  if(d->ID3v2Location >= 0) {
+    seek(d->ID3v2Location);
+    d->ID3v2Header = new ID3v2::Header(readBlock(ID3v2::Header::size()));
+    d->ID3v2Size = d->ID3v2Header->completeTagSize();
+    d->hasID3v2 = true;
+  }
+
+  if(d->hasID3v2)
+    seek(d->ID3v2Location + d->ID3v2Size);
+  else
+    seek(0);
+
+  // Look for MPC metadata
+
+  if(readProperties) {
+    d->properties = new Properties(readBlock(MPC::HeaderSize),
+                                   length() - d->ID3v2Size - d->APESize);
+  }
+}
+
+long MPC::File::findAPE()
+{
+  if(!isValid())
+    return -1;
+
+  if(d->hasID3v1)
+    seek(-160, End);
+  else
+    seek(-32, End);
+
+  long p = tell();
+
+  if(readBlock(8) == APE::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
+
+long MPC::File::findID3v1()
+{
+  if(!isValid())
+    return -1;
+
+  seek(-128, End);
+  long p = tell();
+
+  if(readBlock(3) == ID3v1::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
+
+long MPC::File::findID3v2()
+{
+  if(!isValid())
+    return -1;
+
+  seek(0);
+
+  if(readBlock(3) == ID3v2::Header::fileIdentifier())
+    return 0;
+
+  return -1;
+}
diff --git a/lib-src/taglib/taglib/mpc/mpcfile.h b/lib-src/taglib/taglib/mpc/mpcfile.h
new file mode 100644
index 0000000..7e34c86
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/mpcfile.h
@@ -0,0 +1,175 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MPCFILE_H
+#define TAGLIB_MPCFILE_H
+
+#include "taglib_export.h"
+#include "tfile.h"
+
+#include "mpcproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  namespace ID3v1 { class Tag; }
+  namespace APE { class Tag; }
+
+  //! An implementation of MPC metadata
+
+  /*!
+   * This is implementation of MPC metadata.
+   *
+   * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream
+   * properties from the file. ID3v2 tags are invalid in MPC-files, but will be skipped
+   * and ignored.
+   */
+
+  namespace MPC {
+
+    //! An implementation of TagLib::File with MPC specific methods
+
+    /*!
+     * This implements and provides an interface for MPC files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to MPC files.
+     * The only invalid tag combination supported is an ID3v1 tag after an APE tag.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * This set of flags is used for various operations and is suitable for
+       * being OR-ed together.
+       */
+      enum TagTypes {
+        //! Empty set.  Matches no tag types.
+        NoTags  = 0x0000,
+        //! Matches ID3v1 tags.
+        ID3v1   = 0x0001,
+        //! Matches ID3v2 tags.
+        ID3v2   = 0x0002,
+        //! Matches APE tags.
+        APE     = 0x0004,
+        //! Matches all tag types.
+        AllTags = 0xffff
+      };
+
+      /*!
+       * Contructs an MPC file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the Tag for this file.  This will be an APE tag, an ID3v1 tag
+       * or a combination of the two.
+       */
+      virtual TagLib::Tag *tag() const;
+
+      /*!
+       * Returns the MPC::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Saves the file.
+       */
+      virtual bool save();
+
+      /*!
+       * Returns a pointer to the ID3v1 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v1 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist. If there is already an APE tag, the
+       * new ID3v1 tag will be placed after it.
+       *
+       * \note The Tag <b>is still</b> owned by the APE::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v1::Tag *ID3v1Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the APE tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid APE tag.  If \a create is true it will create
+       * a APE tag if one does not exist. If there is already an ID3v1 tag, thes
+       * new APE tag will be placed before it.
+       *
+       * \note The Tag <b>is still</b> owned by the APE::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      APE::Tag *APETag(bool create = false);
+
+      /*!
+       * This will remove the tags that match the OR-ed together TagTypes from the
+       * file.  By default it removes all tags.
+       *
+       * \warning This will also invalidate pointers to the tags
+       * as their memory will be freed.
+       *
+       * \note In order to make the removal permanent save() still needs to be called.
+       */
+      void strip(int tags = AllTags);
+
+      /*!
+       * \deprecated
+       * \see strip
+       */
+      void remove(int tags = AllTags);
+
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      void scan();
+      long findAPE();
+      long findID3v1();
+      long findID3v2();
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpc/mpcproperties.cpp b/lib-src/taglib/taglib/mpc/mpcproperties.cpp
new file mode 100644
index 0000000..2114a86
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/mpcproperties.cpp
@@ -0,0 +1,140 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <bitset>
+
+#include "mpcproperties.h"
+#include "mpcfile.h"
+
+using namespace TagLib;
+
+class MPC::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(const ByteVector &d, long length, ReadStyle s) :
+    data(d),
+    streamLength(length),
+    style(s),
+    version(0),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0) {}
+
+  ByteVector data;
+  long streamLength;
+  ReadStyle style;
+  int version;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+MPC::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(data, streamLength, style);
+  read();
+}
+
+MPC::Properties::~Properties()
+{
+  delete d;
+}
+
+int MPC::Properties::length() const
+{
+  return d->length;
+}
+
+int MPC::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int MPC::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int MPC::Properties::channels() const
+{
+  return d->channels;
+}
+
+int MPC::Properties::mpcVersion() const
+{
+  return d->version;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+static const unsigned short sftable [4] = { 44100, 48000, 37800, 32000 };
+
+void MPC::Properties::read()
+{
+  if(!d->data.startsWith("MP+"))
+    return;
+
+  d->version = d->data[3] & 15;
+
+  unsigned int frames;
+
+  if(d->version >= 7) {
+    frames = d->data.mid(4, 4).toUInt(false);
+
+    std::bitset<32> flags = d->data.mid(8, 4).toUInt(false);
+    d->sampleRate = sftable[flags[17] * 2 + flags[16]];
+    d->channels = 2;
+  }
+  else {
+    uint headerData = d->data.mid(0, 4).toUInt(false);
+
+    d->bitrate = (headerData >> 23) & 0x01ff;
+    d->version = (headerData >> 11) & 0x03ff;
+    d->sampleRate = 44100;
+    d->channels = 2;
+
+    if(d->version >= 5)
+      frames = d->data.mid(4, 4).toUInt(false);
+    else
+      frames = d->data.mid(6, 2).toUInt(false);
+  }
+
+  uint samples = frames * 1152 - 576;
+
+  d->length = d->sampleRate > 0 ? (samples + (d->sampleRate / 2)) / d->sampleRate : 0;
+
+  if(!d->bitrate)
+    d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;
+}
diff --git a/lib-src/taglib/taglib/mpc/mpcproperties.h b/lib-src/taglib/taglib/mpc/mpcproperties.h
new file mode 100644
index 0000000..bdbc887
--- /dev/null
+++ b/lib-src/taglib/taglib/mpc/mpcproperties.h
@@ -0,0 +1,85 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MPCPROPERTIES_H
+#define TAGLIB_MPCPROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace MPC {
+
+    class File;
+
+    static const uint HeaderSize = 8*7;
+
+    //! An implementation of audio property reading for MPC
+
+    /*!
+     * This reads the data from an MPC stream found in the AudioProperties
+     * API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of MPC::Properties with the data read from the
+       * ByteVector \a data.
+       */
+      Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
+
+      /*!
+       * Destroys this MPC::Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns the version of the bitstream (SV4-SV7)
+       */
+      int mpcVersion() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/.deps/mpegfile.Plo b/lib-src/taglib/taglib/mpeg/.deps/mpegfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/.deps/mpegfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/.deps/mpegheader.Plo b/lib-src/taglib/taglib/mpeg/.deps/mpegheader.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/.deps/mpegheader.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/.deps/mpegproperties.Plo b/lib-src/taglib/taglib/mpeg/.deps/mpegproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/.deps/mpegproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/.deps/xingheader.Plo b/lib-src/taglib/taglib/mpeg/.deps/xingheader.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/.deps/xingheader.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/CMakeLists.txt b/lib-src/taglib/taglib/mpeg/CMakeLists.txt
new file mode 100644
index 0000000..9b0e308
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/CMakeLists.txt
@@ -0,0 +1,4 @@
+ADD_SUBDIRECTORY( id3v1 ) 
+ADD_SUBDIRECTORY( id3v2 ) 
+
+INSTALL(FILES  mpegfile.h mpegproperties.h mpegheader.h xingheader.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib )
diff --git a/lib-src/taglib/taglib/mpeg/Makefile.am b/lib-src/taglib/taglib/mpeg/Makefile.am
new file mode 100644
index 0000000..330aec3
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/Makefile.am
@@ -0,0 +1,17 @@
+SUBDIRS = id3v1 id3v2
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+        -I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 -I./id3v2 \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 -I./id3v1 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmpeg.la
+
+libmpeg_la_SOURCES = mpegfile.cpp mpegproperties.cpp mpegheader.cpp xingheader.cpp
+
+taglib_include_HEADERS = mpegfile.h mpegproperties.h mpegheader.h xingheader.h
+taglib_includedir = $(includedir)/taglib
+
+libmpeg_la_LIBADD = ./id3v2/libid3v2.la ./id3v1/libid3v1.la
diff --git a/lib-src/taglib/taglib/mpeg/Makefile.in b/lib-src/taglib/taglib/mpeg/Makefile.in
new file mode 100644
index 0000000..32035bc
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/Makefile.in
@@ -0,0 +1,753 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mpeg
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libmpeg_la_DEPENDENCIES = ./id3v2/libid3v2.la ./id3v1/libid3v1.la
+am_libmpeg_la_OBJECTS = mpegfile.lo mpegproperties.lo mpegheader.lo \
+	xingheader.lo
+#>- libmpeg_la_OBJECTS = $(am_libmpeg_la_OBJECTS)
+#>+ 5
+libmpeg_la_final_OBJECTS = libmpeg_la.all_cpp.lo 
+libmpeg_la_nofinal_OBJECTS = mpegfile.lo mpegproperties.lo mpegheader.lo \
+	xingheader.lo
+ at KDE_USE_FINAL_FALSE@libmpeg_la_OBJECTS = $(libmpeg_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libmpeg_la_OBJECTS = $(libmpeg_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libmpeg_la_SOURCES)
+DIST_SOURCES = $(libmpeg_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = id3v1 id3v2
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+        -I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 -I./id3v2 \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 -I./id3v1 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libmpeg.la
+libmpeg_la_SOURCES = mpegfile.cpp mpegproperties.cpp mpegheader.cpp xingheader.cpp
+taglib_include_HEADERS = mpegfile.h mpegproperties.h mpegheader.h xingheader.h
+taglib_includedir = $(includedir)/taglib
+libmpeg_la_LIBADD = ./id3v2/libid3v2.la ./id3v1/libid3v1.la
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mpeg/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libmpeg.la: $(libmpeg_la_OBJECTS) $(libmpeg_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libmpeg_la_OBJECTS) $(libmpeg_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpegfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpegheader.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpegproperties.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xingheader.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libmpeg_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/mpegfile.cpp $(srcdir)/mpegproperties.cpp $(srcdir)/mpegheader.cpp $(srcdir)/xingheader.cpp 
+	@echo 'creating libmpeg_la.all_cpp.cpp ...'; \
+	rm -f libmpeg_la.all_cpp.files libmpeg_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libmpeg_la.all_cpp.final; \
+	for file in mpegfile.cpp mpegproperties.cpp mpegheader.cpp xingheader.cpp ; do \
+	  echo "#include \"$$file\"" >> libmpeg_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libmpeg_la.all_cpp.final; \
+	done; \
+	cat libmpeg_la.all_cpp.final libmpeg_la.all_cpp.files > libmpeg_la.all_cpp.cpp; \
+	rm -f libmpeg_la.all_cpp.final libmpeg_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libmpeg_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libmpeg_la_OBJECTS="$(libmpeg_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libmpeg_la_OBJECTS="$(libmpeg_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libmpeg_la_OBJECTS="$(libmpeg_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libmpeg_la_OBJECTS="$(libmpeg_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1genres.Plo b/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1genres.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1genres.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1tag.Plo b/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1tag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/.deps/id3v1tag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/CMakeLists.txt b/lib-src/taglib/taglib/mpeg/id3v1/CMakeLists.txt
new file mode 100644
index 0000000..64b21ec
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  id3v1tag.h id3v1genres.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/Makefile.am b/lib-src/taglib/taglib/mpeg/id3v1/Makefile.am
new file mode 100644
index 0000000..8614468
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libid3v1.la
+
+libid3v1_la_SOURCES = id3v1tag.cpp id3v1genres.cpp
+
+taglib_include_HEADERS = id3v1tag.h id3v1genres.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/Makefile.in b/lib-src/taglib/taglib/mpeg/id3v1/Makefile.in
new file mode 100644
index 0000000..235627e
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/Makefile.in
@@ -0,0 +1,623 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mpeg/id3v1
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libid3v1_la_LIBADD =
+am_libid3v1_la_OBJECTS = id3v1tag.lo id3v1genres.lo
+#>- libid3v1_la_OBJECTS = $(am_libid3v1_la_OBJECTS)
+#>+ 4
+libid3v1_la_final_OBJECTS = libid3v1_la.all_cpp.lo 
+libid3v1_la_nofinal_OBJECTS = id3v1tag.lo id3v1genres.lo
+ at KDE_USE_FINAL_FALSE@libid3v1_la_OBJECTS = $(libid3v1_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libid3v1_la_OBJECTS = $(libid3v1_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libid3v1_la_SOURCES)
+DIST_SOURCES = $(libid3v1_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libid3v1.la
+libid3v1_la_SOURCES = id3v1tag.cpp id3v1genres.cpp
+taglib_include_HEADERS = id3v1tag.h id3v1genres.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v1/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libid3v1.la: $(libid3v1_la_OBJECTS) $(libid3v1_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libid3v1_la_OBJECTS) $(libid3v1_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v1genres.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v1tag.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v1/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v1/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libid3v1_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/id3v1tag.cpp $(srcdir)/id3v1genres.cpp 
+	@echo 'creating libid3v1_la.all_cpp.cpp ...'; \
+	rm -f libid3v1_la.all_cpp.files libid3v1_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libid3v1_la.all_cpp.final; \
+	for file in id3v1tag.cpp id3v1genres.cpp ; do \
+	  echo "#include \"$$file\"" >> libid3v1_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libid3v1_la.all_cpp.final; \
+	done; \
+	cat libid3v1_la.all_cpp.final libid3v1_la.all_cpp.files > libid3v1_la.all_cpp.cpp; \
+	rm -f libid3v1_la.all_cpp.final libid3v1_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libid3v1_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libid3v1_la_OBJECTS="$(libid3v1_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libid3v1_la_OBJECTS="$(libid3v1_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libid3v1_la_OBJECTS="$(libid3v1_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libid3v1_la_OBJECTS="$(libid3v1_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.cpp b/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.cpp
new file mode 100644
index 0000000..7cd42f3
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.cpp
@@ -0,0 +1,219 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "id3v1genres.h"
+
+using namespace TagLib;
+
+namespace TagLib {
+  namespace ID3v1 {
+
+    static const int genresSize = 148;
+    static const String genres[] = {
+      "Blues",
+      "Classic Rock",
+      "Country",
+      "Dance",
+      "Disco",
+      "Funk",
+      "Grunge",
+      "Hip-Hop",
+      "Jazz",
+      "Metal",
+      "New Age",
+      "Oldies",
+      "Other",
+      "Pop",
+      "R&B",
+      "Rap",
+      "Reggae",
+      "Rock",
+      "Techno",
+      "Industrial",
+      "Alternative",
+      "Ska",
+      "Death Metal",
+      "Pranks",
+      "Soundtrack",
+      "Euro-Techno",
+      "Ambient",
+      "Trip-Hop",
+      "Vocal",
+      "Jazz+Funk",
+      "Fusion",
+      "Trance",
+      "Classical",
+      "Instrumental",
+      "Acid",
+      "House",
+      "Game",
+      "Sound Clip",
+      "Gospel",
+      "Noise",
+      "Alternative Rock",
+      "Bass",
+      "Soul",
+      "Punk",
+      "Space",
+      "Meditative",
+      "Instrumental Pop",
+      "Instrumental Rock",
+      "Ethnic",
+      "Gothic",
+      "Darkwave",
+      "Techno-Industrial",
+      "Electronic",
+      "Pop-Folk",
+      "Eurodance",
+      "Dream",
+      "Southern Rock",
+      "Comedy",
+      "Cult",
+      "Gangsta",
+      "Top 40",
+      "Christian Rap",
+      "Pop/Funk",
+      "Jungle",
+      "Native American",
+      "Cabaret",
+      "New Wave",
+      "Psychedelic",
+      "Rave",
+      "Showtunes",
+      "Trailer",
+      "Lo-Fi",
+      "Tribal",
+      "Acid Punk",
+      "Acid Jazz",
+      "Polka",
+      "Retro",
+      "Musical",
+      "Rock & Roll",
+      "Hard Rock",
+      "Folk",
+      "Folk/Rock",
+      "National Folk",
+      "Swing",
+      "Fusion",
+      "Bebob",
+      "Latin",
+      "Revival",
+      "Celtic",
+      "Bluegrass",
+      "Avantgarde",
+      "Gothic Rock",
+      "Progressive Rock",
+      "Psychedelic Rock",
+      "Symphonic Rock",
+      "Slow Rock",
+      "Big Band",
+      "Chorus",
+      "Easy Listening",
+      "Acoustic",
+      "Humour",
+      "Speech",
+      "Chanson",
+      "Opera",
+      "Chamber Music",
+      "Sonata",
+      "Symphony",
+      "Booty Bass",
+      "Primus",
+      "Porn Groove",
+      "Satire",
+      "Slow Jam",
+      "Club",
+      "Tango",
+      "Samba",
+      "Folklore",
+      "Ballad",
+      "Power Ballad",
+      "Rhythmic Soul",
+      "Freestyle",
+      "Duet",
+      "Punk Rock",
+      "Drum Solo",
+      "A Cappella",
+      "Euro-House",
+      "Dance Hall",
+      "Goa",
+      "Drum & Bass",
+      "Club-House",
+      "Hardcore",
+      "Terror",
+      "Indie",
+      "BritPop",
+      "Negerpunk",
+      "Polsk Punk",
+      "Beat",
+      "Christian Gangsta Rap",
+      "Heavy Metal",
+      "Black Metal",
+      "Crossover",
+      "Contemporary Christian",
+      "Christian Rock",
+      "Merengue",
+      "Salsa",
+      "Thrash Metal",
+      "Anime",
+      "Jpop",
+      "Synthpop"
+    };
+  }
+}
+
+StringList ID3v1::genreList()
+{
+  static StringList l;
+  if(l.isEmpty()) {
+    for(int i = 0; i < genresSize; i++)
+      l.append(genres[i]);
+  }
+  return l;
+}
+
+ID3v1::GenreMap ID3v1::genreMap()
+{
+  static GenreMap m;
+  if(m.isEmpty()) {
+    for(int i = 0; i < genresSize; i++)
+      m.insert(genres[i], i);
+  }
+  return m;
+}
+
+String ID3v1::genre(int i)
+{
+  if(i >= 0 && i < genresSize)
+    return genres[i];
+  return String::null;
+}
+
+int ID3v1::genreIndex(const String &name)
+{
+  if(genreMap().contains(name))
+    return genreMap()[name];
+  return 255;
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.h b/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.h
new file mode 100644
index 0000000..6e5d82e
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/id3v1genres.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V1GENRE_H
+#define TAGLIB_ID3V1GENRE_H
+
+#include "tmap.h"
+#include "tstringlist.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+  namespace ID3v1 {
+
+    typedef Map<String, int> GenreMap;
+
+    /*!
+     * Returns the list of canonical ID3v1 genre names in the order that they
+     * are listed in the standard.
+     */
+    StringList TAGLIB_EXPORT genreList();
+
+    /*!
+     * A "reverse mapping" that goes from the canonical ID3v1 genre name to the
+     * respective genre number.   genreMap()["Rock"] ==
+     */
+    GenreMap genreMap();
+
+    /*!
+     * Returns the name of the genre at \a index in the ID3v1 genre list.  If
+     * \a index is out of range -- less than zero or greater than 146 -- a null
+     * string will be returned.
+     */
+    String genre(int index);
+
+    /*!
+     * Returns the genre index for the (case sensitive) genre \a name.  If the
+     * genre is not in the list 255 (which signifies an unknown genre in ID3v1)
+     * will be returned.
+     */
+    int genreIndex(const String &name);
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.cpp b/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.cpp
new file mode 100644
index 0000000..490f8dd
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.cpp
@@ -0,0 +1,248 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tdebug.h>
+#include <tfile.h>
+
+#include "id3v1tag.h"
+#include "id3v1genres.h"
+
+using namespace TagLib;
+using namespace ID3v1;
+
+class ID3v1::Tag::TagPrivate
+{
+public:
+  TagPrivate() : file(0), tagOffset(-1), track(0), genre(255) {}
+
+  File *file;
+  long tagOffset;
+
+  String title;
+  String artist;
+  String album;
+  String year;
+  String comment;
+  uchar track;
+  uchar genre;
+
+  static const StringHandler *stringHandler;
+};
+
+const ID3v1::StringHandler *ID3v1::Tag::TagPrivate::stringHandler = new StringHandler;
+
+////////////////////////////////////////////////////////////////////////////////
+// StringHandler implementation
+////////////////////////////////////////////////////////////////////////////////
+
+String ID3v1::StringHandler::parse(const ByteVector &data) const
+{
+  return String(data, String::Latin1).stripWhiteSpace();
+}
+
+ByteVector ID3v1::StringHandler::render(const String &s) const
+{
+  if(!s.isLatin1())
+  {
+    return ByteVector();
+  }
+
+  return s.data(String::Latin1);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
+ID3v1::Tag::Tag() : TagLib::Tag()
+{
+  d = new TagPrivate;
+}
+
+ID3v1::Tag::Tag(File *file, long tagOffset) : TagLib::Tag()
+{
+  d = new TagPrivate;
+  d->file = file;
+  d->tagOffset = tagOffset;
+
+  read();
+}
+
+ID3v1::Tag::~Tag()
+{
+  delete d;
+}
+
+ByteVector ID3v1::Tag::render() const
+{
+  ByteVector data;
+
+  data.append(fileIdentifier());
+  data.append(TagPrivate::stringHandler->render(d->title).resize(30));
+  data.append(TagPrivate::stringHandler->render(d->artist).resize(30));
+  data.append(TagPrivate::stringHandler->render(d->album).resize(30));
+  data.append(TagPrivate::stringHandler->render(d->year).resize(4));
+  data.append(TagPrivate::stringHandler->render(d->comment).resize(28));
+  data.append(char(0));
+  data.append(char(d->track));
+  data.append(char(d->genre));
+
+  return data;
+}
+
+ByteVector ID3v1::Tag::fileIdentifier()
+{
+  return ByteVector::fromCString("TAG");
+}
+
+String ID3v1::Tag::title() const
+{
+  return d->title;
+}
+
+String ID3v1::Tag::artist() const
+{
+  return d->artist;
+}
+
+String ID3v1::Tag::album() const
+{
+  return d->album;
+}
+
+String ID3v1::Tag::comment() const
+{
+  return d->comment;
+}
+
+String ID3v1::Tag::genre() const
+{
+  return ID3v1::genre(d->genre);
+}
+
+TagLib::uint ID3v1::Tag::year() const
+{
+  return d->year.toInt();
+}
+
+TagLib::uint ID3v1::Tag::track() const
+{
+  return d->track;
+}
+
+void ID3v1::Tag::setTitle(const String &s)
+{
+  d->title = s;
+}
+
+void ID3v1::Tag::setArtist(const String &s)
+{
+  d->artist = s;
+}
+
+void ID3v1::Tag::setAlbum(const String &s)
+{
+  d->album = s;
+}
+
+void ID3v1::Tag::setComment(const String &s)
+{
+  d->comment = s;
+}
+
+void ID3v1::Tag::setGenre(const String &s)
+{
+  d->genre = ID3v1::genreIndex(s);
+}
+
+void ID3v1::Tag::setYear(uint i)
+{
+  d->year = i > 0 ? String::number(i) : String::null;
+}
+
+void ID3v1::Tag::setTrack(uint i)
+{
+  d->track = i < 256 ? i : 0;
+}
+
+void ID3v1::Tag::setStringHandler(const StringHandler *handler)
+{
+  delete TagPrivate::stringHandler;
+  TagPrivate::stringHandler = handler;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected methods
+////////////////////////////////////////////////////////////////////////////////
+
+void ID3v1::Tag::read()
+{
+  if(d->file && d->file->isValid()) {
+    d->file->seek(d->tagOffset);
+    // read the tag -- always 128 bytes
+    ByteVector data = d->file->readBlock(128);
+
+    // some initial sanity checking
+    if(data.size() == 128 && data.startsWith("TAG"))
+      parse(data);
+    else
+      debug("ID3v1 tag is not valid or could not be read at the specified offset.");
+  }
+}
+
+void ID3v1::Tag::parse(const ByteVector &data)
+{
+  int offset = 3;
+
+  d->title = TagPrivate::stringHandler->parse(data.mid(offset, 30));
+  offset += 30;
+
+  d->artist = TagPrivate::stringHandler->parse(data.mid(offset, 30));
+  offset += 30;
+
+  d->album = TagPrivate::stringHandler->parse(data.mid(offset, 30));
+  offset += 30;
+
+  d->year = TagPrivate::stringHandler->parse(data.mid(offset, 4));
+  offset += 4;
+
+  // Check for ID3v1.1 -- Note that ID3v1 *does not* support "track zero" -- this
+  // is not a bug in TagLib.  Since a zeroed byte is what we would expect to
+  // indicate the end of a C-String, specifically the comment string, a value of
+  // zero must be assumed to be just that.
+
+  if(data[offset + 28] == 0 && data[offset + 29] != 0) {
+    // ID3v1.1 detected
+
+    d->comment = TagPrivate::stringHandler->parse(data.mid(offset, 28));
+    d->track = uchar(data[offset + 29]);
+  }
+  else
+    d->comment = data.mid(offset, 30);
+
+  offset += 30;
+
+  d->genre = uchar(data[offset]);
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.h b/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.h
new file mode 100644
index 0000000..8dc60c3
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v1/id3v1tag.h
@@ -0,0 +1,180 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V1TAG_H
+#define TAGLIB_ID3V1TAG_H
+
+#include "tag.h"
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  class File;
+
+  //! An ID3v1 implementation
+
+  namespace ID3v1 {
+
+    //! A abstraction for the string to data encoding in ID3v1 tags.
+
+    /*!
+     * ID3v1 should in theory always contain ISO-8859-1 (Latin1) data.  In
+     * practice it does not.  TagLib by default only supports ISO-8859-1 data
+     * in ID3v1 tags.
+     *
+     * However by subclassing this class and reimplementing parse() and render()
+     * and setting your reimplementation as the default with
+     * ID3v1::Tag::setStringHandler() you can define how you would like these
+     * transformations to be done.
+     *
+     * \warning It is advisable <b>not</b> to write non-ISO-8859-1 data to ID3v1
+     * tags.  Please consider disabling the writing of ID3v1 tags in the case
+     * that the data is ISO-8859-1.
+     *
+     * \see ID3v1::Tag::setStringHandler()
+     */
+
+    class TAGLIB_EXPORT StringHandler
+    {
+    public:
+      // BIC: Add virtual destructor.
+
+      /*!
+       * Decode a string from \a data.  The default implementation assumes that
+       * \a data is an ISO-8859-1 (Latin1) character array.
+       */
+      virtual String parse(const ByteVector &data) const;
+
+      /*!
+       * Encode a ByteVector with the data from \a s.  The default implementation
+       * assumes that \a s is an ISO-8859-1 (Latin1) string.  If the string is
+       * does not conform to ISO-8859-1, no value is written.
+       *
+       * \warning It is recommended that you <b>not</b> override this method, but
+       * instead do not write an ID3v1 tag in the case that the data is not
+       * ISO-8859-1.
+       */
+      virtual ByteVector render(const String &s) const;
+    };
+
+    //! The main class in the ID3v1 implementation
+
+    /*!
+     * This is an implementation of the ID3v1 format.  ID3v1 is both the simplist
+     * and most common of tag formats but is rather limited.  Because of its
+     * pervasiveness and the way that applications have been written around the
+     * fields that it provides, the generic TagLib::Tag API is a mirror of what is
+     * provided by ID3v1.
+     *
+     * ID3v1 tags should generally only contain Latin1 information.  However because
+     * many applications do not follow this rule there is now support for overriding
+     * the ID3v1 string handling using the ID3v1::StringHandler class.  Please see
+     * the documentation for that class for more information.
+     *
+     * \see StringHandler
+     *
+     * \note Most fields are truncated to a maximum of 28-30 bytes.  The
+     * truncation happens automatically when the tag is rendered.
+     */
+
+    class TAGLIB_EXPORT Tag : public TagLib::Tag
+    {
+    public:
+      /*!
+       * Create an ID3v1 tag with default values.
+       */
+      Tag();
+
+      /*!
+       * Create an ID3v1 tag and parse the data in \a file starting at
+       * \a tagOffset.
+       */
+      Tag(File *file, long tagOffset);
+
+      /*!
+       * Destroys this Tag instance.
+       */
+      virtual ~Tag();
+
+      /*!
+       * Renders the in memory values to a ByteVector suitable for writing to
+       * the file.
+       */
+      ByteVector render() const;
+
+      /*!
+       * Returns the string "TAG" suitable for usage in locating the tag in a
+       * file.
+       */
+      static ByteVector fileIdentifier();
+
+      // Reimplementations.
+
+      virtual String title() const;
+      virtual String artist() const;
+      virtual String album() const;
+      virtual String comment() const;
+      virtual String genre() const;
+      virtual uint year() const;
+      virtual uint track() const;
+
+      virtual void setTitle(const String &s);
+      virtual void setArtist(const String &s);
+      virtual void setAlbum(const String &s);
+      virtual void setComment(const String &s);
+      virtual void setGenre(const String &s);
+      virtual void setYear(uint i);
+      virtual void setTrack(uint i);
+
+      /*!
+       * Sets the string handler that decides how the ID3v1 data will be
+       * converted to and from binary data.
+       *
+       * \see StringHandler
+       */
+      static void setStringHandler(const StringHandler *handler);
+
+    protected:
+      /*!
+       * Reads from the file specified in the constructor.
+       */
+      void read();
+      /*!
+       * Pareses the body of the tag in \a data.
+       */
+      void parse(const ByteVector &data);
+
+    private:
+      Tag(const Tag &);
+      Tag &operator=(const Tag &);
+
+      class TagPrivate;
+      TagPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2extendedheader.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2extendedheader.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2extendedheader.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2footer.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2footer.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2footer.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2frame.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2frame.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2frame.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2framefactory.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2framefactory.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2framefactory.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2header.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2header.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2header.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2synchdata.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2synchdata.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2synchdata.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2tag.Plo b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2tag.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/.deps/id3v2tag.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/CMakeLists.txt b/lib-src/taglib/taglib/mpeg/id3v2/CMakeLists.txt
new file mode 100644
index 0000000..f6e1ef1
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/CMakeLists.txt
@@ -0,0 +1,4 @@
+ADD_SUBDIRECTORY( frames ) 
+
+INSTALL(FILES  id3v2extendedheader.h id3v2frame.h id3v2header.h  	id3v2synchdata.h id3v2footer.h id3v2framefactory.h id3v2tag.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
+
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/Makefile.am b/lib-src/taglib/taglib/mpeg/id3v2/Makefile.am
new file mode 100644
index 0000000..1a45ae5
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/Makefile.am
@@ -0,0 +1,26 @@
+SUBDIRS = frames
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	 $(all_includes)
+
+noinst_LTLIBRARIES = libid3v2.la
+
+libid3v2_la_SOURCES = \
+	id3v2framefactory.cpp id3v2synchdata.cpp id3v2tag.cpp \
+	id3v2header.cpp id3v2frame.cpp id3v2footer.cpp \
+	id3v2extendedheader.cpp
+
+taglib_include_HEADERS = \
+	id3v2extendedheader.h id3v2frame.h id3v2header.h \
+	id3v2synchdata.h id3v2footer.h id3v2framefactory.h id3v2tag.h
+
+taglib_includedir = $(includedir)/taglib
+
+if link_zlib
+zlib = -lz
+endif
+
+libid3v2_la_LIBADD = ./frames/libframes.la $(zlib)
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/Makefile.in b/lib-src/taglib/taglib/mpeg/id3v2/Makefile.in
new file mode 100644
index 0000000..8c34dc6
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/Makefile.in
@@ -0,0 +1,766 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mpeg/id3v2
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libid3v2_la_DEPENDENCIES = ./frames/libframes.la $(am__DEPENDENCIES_1)
+am_libid3v2_la_OBJECTS = id3v2framefactory.lo id3v2synchdata.lo \
+	id3v2tag.lo id3v2header.lo id3v2frame.lo id3v2footer.lo \
+	id3v2extendedheader.lo
+#>- libid3v2_la_OBJECTS = $(am_libid3v2_la_OBJECTS)
+#>+ 6
+libid3v2_la_final_OBJECTS = libid3v2_la.all_cpp.lo 
+libid3v2_la_nofinal_OBJECTS = id3v2framefactory.lo id3v2synchdata.lo \
+	id3v2tag.lo id3v2header.lo id3v2frame.lo id3v2footer.lo \
+	id3v2extendedheader.lo
+ at KDE_USE_FINAL_FALSE@libid3v2_la_OBJECTS = $(libid3v2_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libid3v2_la_OBJECTS = $(libid3v2_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libid3v2_la_SOURCES)
+DIST_SOURCES = $(libid3v2_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = frames
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	 $(all_includes)
+
+noinst_LTLIBRARIES = libid3v2.la
+libid3v2_la_SOURCES = \
+	id3v2framefactory.cpp id3v2synchdata.cpp id3v2tag.cpp \
+	id3v2header.cpp id3v2frame.cpp id3v2footer.cpp \
+	id3v2extendedheader.cpp
+
+taglib_include_HEADERS = \
+	id3v2extendedheader.h id3v2frame.h id3v2header.h \
+	id3v2synchdata.h id3v2footer.h id3v2framefactory.h id3v2tag.h
+
+taglib_includedir = $(includedir)/taglib
+ at link_zlib_TRUE@zlib = -lz
+libid3v2_la_LIBADD = ./frames/libframes.la $(zlib)
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v2/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libid3v2.la: $(libid3v2_la_OBJECTS) $(libid3v2_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libid3v2_la_OBJECTS) $(libid3v2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2extendedheader.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2footer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2frame.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2framefactory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2header.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2synchdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/id3v2tag.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in id3v2.3.0.txt id3v2.4.0-structure.txt id3v2.2.0.txt id3v2.4.0-frames.txt Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v2/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libid3v2_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/id3v2framefactory.cpp $(srcdir)/id3v2synchdata.cpp $(srcdir)/id3v2tag.cpp $(srcdir)/id3v2header.cpp $(srcdir)/id3v2frame.cpp $(srcdir)/id3v2footer.cpp $(srcdir)/id3v2extendedheader.cpp 
+	@echo 'creating libid3v2_la.all_cpp.cpp ...'; \
+	rm -f libid3v2_la.all_cpp.files libid3v2_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libid3v2_la.all_cpp.final; \
+	for file in id3v2framefactory.cpp id3v2synchdata.cpp id3v2tag.cpp id3v2header.cpp id3v2frame.cpp id3v2footer.cpp id3v2extendedheader.cpp ; do \
+	  echo "#include \"$$file\"" >> libid3v2_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libid3v2_la.all_cpp.final; \
+	done; \
+	cat libid3v2_la.all_cpp.final libid3v2_la.all_cpp.files > libid3v2_la.all_cpp.cpp; \
+	rm -f libid3v2_la.all_cpp.final libid3v2_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libid3v2_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libid3v2_la_OBJECTS="$(libid3v2_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libid3v2_la_OBJECTS="$(libid3v2_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libid3v2_la_OBJECTS="$(libid3v2_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libid3v2_la_OBJECTS="$(libid3v2_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/attachedpictureframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/attachedpictureframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/attachedpictureframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/commentsframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/commentsframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/commentsframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/generalencapsulatedobjectframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/generalencapsulatedobjectframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/generalencapsulatedobjectframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/popularimeterframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/popularimeterframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/popularimeterframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/privateframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/privateframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/privateframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/relativevolumeframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/relativevolumeframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/relativevolumeframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/textidentificationframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/textidentificationframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/textidentificationframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/uniquefileidentifierframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/uniquefileidentifierframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/uniquefileidentifierframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unknownframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unknownframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unknownframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unsynchronizedlyricsframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unsynchronizedlyricsframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/unsynchronizedlyricsframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/urllinkframe.Plo b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/urllinkframe.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/.deps/urllinkframe.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/CMakeLists.txt b/lib-src/taglib/taglib/mpeg/id3v2/frames/CMakeLists.txt
new file mode 100644
index 0000000..6636dde
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/CMakeLists.txt
@@ -0,0 +1,13 @@
+INSTALL(FILES
+	attachedpictureframe.h
+	commentsframe.h
+	generalencapsulatedobjectframe.h
+	popularimeterframe.h
+	privateframe.h
+	relativevolumeframe.h
+	textidentificationframe.h
+	uniquefileidentifierframe.h
+	unknownframe.h
+	unsynchronizedlyricsframe.h
+	urllinkframe.h
+	DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.am b/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.am
new file mode 100644
index 0000000..0f8231f
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.am
@@ -0,0 +1,35 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libframes.la
+
+libframes_la_SOURCES = \
+	attachedpictureframe.cpp \
+	commentsframe.cpp \
+	generalencapsulatedobjectframe.cpp \
+	popularimeterframe.cpp \
+	privateframe.cpp \
+	relativevolumeframe.cpp \
+	textidentificationframe.cpp \
+	uniquefileidentifierframe.cpp \
+	unknownframe.cpp \
+	unsynchronizedlyricsframe.cpp \
+	urllinkframe.cpp
+
+taglib_include_HEADERS = \
+	attachedpictureframe.h \
+	commentsframe.h \
+	generalencapsulatedobjectframe.h \
+	popularimeterframe.h \
+	privateframe.h \
+	relativevolumeframe.h \
+	textidentificationframe.h \
+	uniquefileidentifierframe.h \
+	unknownframe.h \
+	unsynchronizedlyricsframe.h \
+	urllinkframe.h
+
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.in b/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.in
new file mode 100644
index 0000000..f6c9014
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/Makefile.in
@@ -0,0 +1,664 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/mpeg/id3v2/frames
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libframes_la_LIBADD =
+am_libframes_la_OBJECTS = attachedpictureframe.lo commentsframe.lo \
+	generalencapsulatedobjectframe.lo popularimeterframe.lo \
+	privateframe.lo relativevolumeframe.lo \
+	textidentificationframe.lo uniquefileidentifierframe.lo \
+	unknownframe.lo unsynchronizedlyricsframe.lo urllinkframe.lo
+#>- libframes_la_OBJECTS = $(am_libframes_la_OBJECTS)
+#>+ 8
+libframes_la_final_OBJECTS = libframes_la.all_cpp.lo 
+libframes_la_nofinal_OBJECTS = attachedpictureframe.lo commentsframe.lo \
+	generalencapsulatedobjectframe.lo popularimeterframe.lo \
+	privateframe.lo relativevolumeframe.lo \
+	textidentificationframe.lo uniquefileidentifierframe.lo \
+	unknownframe.lo unsynchronizedlyricsframe.lo urllinkframe.lo
+ at KDE_USE_FINAL_FALSE@libframes_la_OBJECTS = $(libframes_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libframes_la_OBJECTS = $(libframes_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libframes_la_SOURCES)
+DIST_SOURCES = $(libframes_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libframes.la
+libframes_la_SOURCES = \
+	attachedpictureframe.cpp \
+	commentsframe.cpp \
+	generalencapsulatedobjectframe.cpp \
+	popularimeterframe.cpp \
+	privateframe.cpp \
+	relativevolumeframe.cpp \
+	textidentificationframe.cpp \
+	uniquefileidentifierframe.cpp \
+	unknownframe.cpp \
+	unsynchronizedlyricsframe.cpp \
+	urllinkframe.cpp
+
+taglib_include_HEADERS = \
+	attachedpictureframe.h \
+	commentsframe.h \
+	generalencapsulatedobjectframe.h \
+	popularimeterframe.h \
+	privateframe.h \
+	relativevolumeframe.h \
+	textidentificationframe.h \
+	uniquefileidentifierframe.h \
+	unknownframe.h \
+	unsynchronizedlyricsframe.h \
+	urllinkframe.h
+
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v2/frames/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libframes.la: $(libframes_la_OBJECTS) $(libframes_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libframes_la_OBJECTS) $(libframes_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/attachedpictureframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/commentsframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/generalencapsulatedobjectframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/popularimeterframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/privateframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/relativevolumeframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/textidentificationframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/uniquefileidentifierframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unknownframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unsynchronizedlyricsframe.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/urllinkframe.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/mpeg/id3v2/frames/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/mpeg/id3v2/frames/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libframes_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/attachedpictureframe.cpp $(srcdir)/commentsframe.cpp $(srcdir)/generalencapsulatedobjectframe.cpp $(srcdir)/popularimeterframe.cpp $(srcdir)/privateframe.cpp $(srcdir)/relativevolumeframe.cpp $(srcdir)/textidentificationframe.cpp $(srcdir)/uniquefileidentifierframe.cpp $(srcdir)/unknownframe.cpp $(srcdir)/unsynchronizedlyricsframe.cpp $(srcdir)/urllinkframe.cpp 
+	@echo 'creating libframes_la.all_cpp.cpp ...'; \
+	rm -f libframes_la.all_cpp.files libframes_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libframes_la.all_cpp.final; \
+	for file in attachedpictureframe.cpp commentsframe.cpp generalencapsulatedobjectframe.cpp popularimeterframe.cpp privateframe.cpp relativevolumeframe.cpp textidentificationframe.cpp uniquefileidentifierframe.cpp unknownframe.cpp unsynchronizedlyricsframe.cpp urllinkframe.cpp ; do \
+	  echo "#include \"$$file\"" >> libframes_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libframes_la.all_cpp.final; \
+	done; \
+	cat libframes_la.all_cpp.final libframes_la.all_cpp.files > libframes_la.all_cpp.cpp; \
+	rm -f libframes_la.all_cpp.final libframes_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libframes_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libframes_la_OBJECTS="$(libframes_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libframes_la_OBJECTS="$(libframes_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libframes_la_OBJECTS="$(libframes_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libframes_la_OBJECTS="$(libframes_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp
new file mode 100644
index 0000000..8a88253
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp
@@ -0,0 +1,170 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "attachedpictureframe.h"
+
+#include <tstringlist.h>
+#include <tdebug.h>
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class AttachedPictureFrame::AttachedPictureFramePrivate
+{
+public:
+  AttachedPictureFramePrivate() : textEncoding(String::Latin1),
+                                  type(AttachedPictureFrame::Other) {}
+
+  String::Type textEncoding;
+  String mimeType;
+  AttachedPictureFrame::Type type;
+  String description;
+  ByteVector data;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+AttachedPictureFrame::AttachedPictureFrame() : Frame("APIC")
+{
+    d = new AttachedPictureFramePrivate;
+}
+
+AttachedPictureFrame::AttachedPictureFrame(const ByteVector &data) : Frame(data)
+{
+  d = new AttachedPictureFramePrivate;
+  setData(data);
+}
+
+AttachedPictureFrame::~AttachedPictureFrame()
+{
+  delete d;
+}
+
+String AttachedPictureFrame::toString() const
+{
+  String s = "[" + d->mimeType + "]";
+  return d->description.isEmpty() ? s : d->description + " " + s;
+}
+
+String::Type AttachedPictureFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void AttachedPictureFrame::setTextEncoding(String::Type t)
+{
+  d->textEncoding = t;
+}
+
+String AttachedPictureFrame::mimeType() const
+{
+  return d->mimeType;
+}
+
+void AttachedPictureFrame::setMimeType(const String &m)
+{
+  d->mimeType = m;
+}
+
+AttachedPictureFrame::Type AttachedPictureFrame::type() const
+{
+  return d->type;
+}
+
+void AttachedPictureFrame::setType(Type t)
+{
+  d->type = t;
+}
+
+String AttachedPictureFrame::description() const
+{
+  return d->description;
+}
+
+void AttachedPictureFrame::setDescription(const String &desc)
+{
+  d->description = desc;
+}
+
+ByteVector AttachedPictureFrame::picture() const
+{
+  return d->data;
+}
+
+void AttachedPictureFrame::setPicture(const ByteVector &p)
+{
+  d->data = p;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void AttachedPictureFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 5) {
+    debug("A picture frame must contain at least 5 bytes.");
+    return;
+  }
+
+  d->textEncoding = String::Type(data[0]);
+
+  int pos = 1;
+
+  d->mimeType = readStringField(data, String::Latin1, &pos);
+  d->type = (TagLib::ID3v2::AttachedPictureFrame::Type)data[pos++];
+  d->description = readStringField(data, d->textEncoding, &pos);
+
+  d->data = data.mid(pos);
+}
+
+ByteVector AttachedPictureFrame::renderFields() const
+{
+  ByteVector data;
+
+  String::Type encoding = checkEncoding(d->description, d->textEncoding);
+
+  data.append(char(encoding));
+  data.append(d->mimeType.data(String::Latin1));
+  data.append(textDelimiter(String::Latin1));
+  data.append(char(d->type));
+  data.append(d->description.data(encoding));
+  data.append(textDelimiter(encoding));
+  data.append(d->data);
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+AttachedPictureFrame::AttachedPictureFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new AttachedPictureFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.h
new file mode 100644
index 0000000..bd95ed2
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/attachedpictureframe.h
@@ -0,0 +1,220 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ATTACHEDPICTUREFRAME_H
+#define TAGLIB_ATTACHEDPICTUREFRAME_H
+
+#include <id3v2frame.h>
+#include <id3v2header.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An ID3v2 attached picture frame implementation
+
+    /*!
+     * This is an implementation of ID3v2 attached pictures.  Pictures may be
+     * included in tags, one per APIC frame (but there may be multiple APIC
+     * frames in a single tag).  These pictures are usually in either JPEG or
+     * PNG format.
+     */
+
+    class TAGLIB_EXPORT AttachedPictureFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+
+      /*!
+       * This describes the function or content of the picture.
+       */
+      enum Type {
+        //! A type not enumerated below
+        Other              = 0x00,
+        //! 32x32 PNG image that should be used as the file icon
+        FileIcon           = 0x01,
+        //! File icon of a different size or format
+        OtherFileIcon      = 0x02,
+        //! Front cover image of the album
+        FrontCover         = 0x03,
+        //! Back cover image of the album
+        BackCover          = 0x04,
+        //! Inside leaflet page of the album
+        LeafletPage        = 0x05,
+        //! Image from the album itself
+        Media              = 0x06,
+        //! Picture of the lead artist or soloist
+        LeadArtist         = 0x07,
+        //! Picture of the artist or performer
+        Artist             = 0x08,
+        //! Picture of the conductor
+        Conductor          = 0x09,
+        //! Picture of the band or orchestra
+        Band               = 0x0A,
+        //! Picture of the composer
+        Composer           = 0x0B,
+        //! Picture of the lyricist or text writer
+        Lyricist           = 0x0C,
+        //! Picture of the recording location or studio
+        RecordingLocation  = 0x0D,
+        //! Picture of the artists during recording
+        DuringRecording    = 0x0E,
+        //! Picture of the artists during performance
+        DuringPerformance  = 0x0F,
+        //! Picture from a movie or video related to the track
+        MovieScreenCapture = 0x10,
+        //! Picture of a large, coloured fish
+        ColouredFish       = 0x11,
+        //! Illustration related to the track
+        Illustration       = 0x12,
+        //! Logo of the band or performer
+        BandLogo           = 0x13,
+        //! Logo of the publisher (record company)
+        PublisherLogo      = 0x14
+      };
+
+      /*!
+       * Constructs an empty picture frame.  The description, content and text
+       * encoding should be set manually.
+       */
+      AttachedPictureFrame();
+
+      /*!
+       * Constructs an AttachedPicture frame based on \a data.
+       */
+      explicit AttachedPictureFrame(const ByteVector &data);
+
+      /*!
+       * Destroys the AttahcedPictureFrame instance.
+       */
+      virtual ~AttachedPictureFrame();
+
+      /*!
+       * Returns a string containing the description and mime-type
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns the text encoding used for the description.
+       *
+       * \see setTextEncoding()
+       * \see description()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Set the text encoding used for the description.
+       *
+       * \see description()
+       */
+      void setTextEncoding(String::Type t);
+
+      /*!
+       * Returns the mime type of the image.  This should in most cases be
+       * "image/png" or "image/jpeg".
+       */
+      String mimeType() const;
+
+      /*!
+       * Sets the mime type of the image.  This should in most cases be
+       * "image/png" or "image/jpeg".
+       */
+      void setMimeType(const String &m);
+
+      /*!
+       * Returns the type of the image.
+       *
+       * \see Type
+       * \see setType()
+       */
+      Type type() const;
+
+      /*!
+       * Sets the type for the image.
+       *
+       * \see Type
+       * \see type()
+       */
+      void setType(Type t);
+
+      /*!
+       * Returns a text description of the image.
+       *
+       * \see setDescription()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      String description() const;
+
+      /*!
+       * Sets a textual description of the image to \a desc.
+       *
+       * \see description()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      void setDescription(const String &desc);
+
+      /*!
+       * Returns the image data as a ByteVector.
+       *
+       * \note ByteVector has a data() method that returns a const char * which
+       * should make it easy to export this data to external programs.
+       *
+       * \see setPicture()
+       * \see mimeType()
+       */
+      ByteVector picture() const;
+
+      /*!
+       * Sets the image data to \a p.  \a p should be of the type specified in
+       * this frame's mime-type specification.
+       *
+       * \see picture()
+       * \see mimeType()
+       * \see setMimeType()
+       */
+      void setPicture(const ByteVector &p);
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      AttachedPictureFrame(const ByteVector &data, Header *h);
+      AttachedPictureFrame(const AttachedPictureFrame &);
+      AttachedPictureFrame &operator=(const AttachedPictureFrame &);
+
+      class AttachedPictureFramePrivate;
+      AttachedPictureFramePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.cpp
new file mode 100644
index 0000000..2df176b
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.cpp
@@ -0,0 +1,178 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <id3v2tag.h>
+#include <tdebug.h>
+#include <tstringlist.h>
+
+#include "commentsframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class CommentsFrame::CommentsFramePrivate
+{
+public:
+  CommentsFramePrivate() : textEncoding(String::Latin1) {}
+  String::Type textEncoding;
+  ByteVector language;
+  String description;
+  String text;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+CommentsFrame::CommentsFrame(String::Type encoding) : Frame("COMM")
+{
+  d = new CommentsFramePrivate;
+  d->textEncoding = encoding;
+}
+
+CommentsFrame::CommentsFrame(const ByteVector &data) : Frame(data)
+{
+  d = new CommentsFramePrivate;
+  setData(data);
+}
+
+CommentsFrame::~CommentsFrame()
+{
+  delete d;
+}
+
+String CommentsFrame::toString() const
+{
+  return d->text;
+}
+
+ByteVector CommentsFrame::language() const
+{
+  return d->language;
+}
+
+String CommentsFrame::description() const
+{
+  return d->description;
+}
+
+String CommentsFrame::text() const
+{
+  return d->text;
+}
+
+void CommentsFrame::setLanguage(const ByteVector &languageEncoding)
+{
+  d->language = languageEncoding.mid(0, 3);
+}
+
+void CommentsFrame::setDescription(const String &s)
+{
+  d->description = s;
+}
+
+void CommentsFrame::setText(const String &s)
+{
+  d->text = s;
+}
+
+String::Type CommentsFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void CommentsFrame::setTextEncoding(String::Type encoding)
+{
+  d->textEncoding = encoding;
+}
+
+CommentsFrame *CommentsFrame::findByDescription(const ID3v2::Tag *tag, const String &d) // static
+{
+  ID3v2::FrameList comments = tag->frameList("COMM");
+
+  for(ID3v2::FrameList::ConstIterator it = comments.begin();
+      it != comments.end();
+      ++it)
+  {
+    CommentsFrame *frame = dynamic_cast<CommentsFrame *>(*it);
+    if(frame && frame->description() == d)
+      return frame;
+  }
+
+  return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void CommentsFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 5) {
+    debug("A comment frame must contain at least 5 bytes.");
+    return;
+  }
+
+  d->textEncoding = String::Type(data[0]);
+  d->language = data.mid(1, 3);
+
+  int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
+
+  ByteVectorList l = ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2);
+
+  if(l.size() == 2) {
+    d->description = String(l.front(), d->textEncoding);
+    d->text = String(l.back(), d->textEncoding);
+  }
+}
+
+ByteVector CommentsFrame::renderFields() const
+{
+  ByteVector v;
+
+  String::Type encoding = d->textEncoding;
+
+  encoding = checkEncoding(d->description, encoding);
+  encoding = checkEncoding(d->text, encoding);
+
+  v.append(char(encoding));
+  v.append(d->language.size() == 3 ? d->language : "XXX");
+  v.append(d->description.data(encoding));
+  v.append(textDelimiter(encoding));
+  v.append(d->text.data(encoding));
+
+  return v;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+CommentsFrame::CommentsFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new CommentsFramePrivate();
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.h
new file mode 100644
index 0000000..9123c73
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/commentsframe.h
@@ -0,0 +1,168 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_COMMENTSFRAME_H
+#define TAGLIB_COMMENTSFRAME_H
+
+#include <id3v2frame.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An implementation of ID3v2 comments
+
+    /*!
+     * This implements the ID3v2 comment format.  An ID3v2 comment concists of
+     * a language encoding, a description and a single text field.
+     */
+
+    class TAGLIB_EXPORT CommentsFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Construct an empty comment frame that will use the text encoding
+       * \a encoding.
+       */
+      explicit CommentsFrame(String::Type encoding = String::Latin1);
+
+      /*!
+       * Construct a comment based on the data in \a data.
+       */
+      explicit CommentsFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this CommentFrame instance.
+       */
+      virtual ~CommentsFrame();
+
+      /*!
+       * Returns the text of this comment.
+       *
+       * \see text()
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns the language encoding as a 3 byte encoding as specified by
+       * <a href="http://en.wikipedia.org/wiki/ISO_639">ISO-639-2</a>.
+       *
+       * \note Most taggers simply ignore this value.
+       *
+       * \see setLanguage()
+       */
+      ByteVector language() const;
+
+      /*!
+       * Returns the description of this comment.
+       *
+       * \note Most taggers simply ignore this value.
+       *
+       * \see setDescription()
+       */
+      String description() const;
+
+      /*!
+       * Returns the text of this comment.
+       *
+       * \see setText()
+       */
+      String text() const;
+
+      /*!
+       * Set the language using the 3 byte language code from
+       * <a href="http://en.wikipedia.org/wiki/ISO_639">ISO-639-2</a> to
+       * \a languageCode.
+       *
+       * \see language()
+       */
+      void setLanguage(const ByteVector &languageCode);
+
+      /*!
+       * Sets the description of the comment to \a s.
+       *
+       * \see decription()
+       */
+      void setDescription(const String &s);
+
+      /*!
+       * Sets the text portion of the comment to \a s.
+       *
+       * \see text()
+       */
+      virtual void setText(const String &s);
+
+      /*!
+       * Returns the text encoding that will be used in rendering this frame.
+       * This defaults to the type that was either specified in the constructor
+       * or read from the frame when parsed.
+       *
+       * \see setTextEncoding()
+       * \see render()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Sets the text encoding to be used when rendering this frame to
+       * \a encoding.
+       *
+       * \see textEncoding()
+       * \see render()
+       */
+      void setTextEncoding(String::Type encoding);
+
+      /*!
+       * Comments each have a unique description.  This searches for a comment
+       * frame with the decription \a d and returns a pointer to it.  If no
+       * frame is found that matches the given description null is returned.
+       *
+       * \see description()
+       */
+      static CommentsFrame *findByDescription(const Tag *tag, const String &d);
+
+    protected:
+      // Reimplementations.
+
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      CommentsFrame(const ByteVector &data, Header *h);
+      CommentsFrame(const CommentsFrame &);
+      CommentsFrame &operator=(const CommentsFrame &);
+
+      class CommentsFramePrivate;
+      CommentsFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp
new file mode 100644
index 0000000..58b7b63
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp
@@ -0,0 +1,176 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Aaron VonderHaar
+    email                : avh4 at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tdebug.h>
+
+#include "generalencapsulatedobjectframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFramePrivate
+{
+public:
+  GeneralEncapsulatedObjectFramePrivate() : textEncoding(String::Latin1) {}
+
+  String::Type textEncoding;
+  String mimeType;
+  String fileName;
+  String description;
+  ByteVector data;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFrame() : Frame("GEOB")
+{
+    d = new GeneralEncapsulatedObjectFramePrivate;
+}
+
+GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFrame(const ByteVector &data) : Frame(data)
+{
+  d = new GeneralEncapsulatedObjectFramePrivate;
+  setData(data);
+}
+
+GeneralEncapsulatedObjectFrame::~GeneralEncapsulatedObjectFrame()
+{
+  delete d;
+}
+
+String GeneralEncapsulatedObjectFrame::toString() const
+{
+  String text = "[" + d->mimeType + "]";
+
+  if(!d->fileName.isEmpty())
+    text += " " + d->fileName;
+
+  if(!d->description.isEmpty())
+    text += " \"" + d->description + "\"";
+
+  return text;
+}
+
+String::Type GeneralEncapsulatedObjectFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void GeneralEncapsulatedObjectFrame::setTextEncoding(String::Type encoding)
+{
+  d->textEncoding = encoding;
+}
+
+String GeneralEncapsulatedObjectFrame::mimeType() const
+{
+  return d->mimeType;
+}
+
+void GeneralEncapsulatedObjectFrame::setMimeType(const String &type)
+{
+  d->mimeType = type;
+}
+
+String GeneralEncapsulatedObjectFrame::fileName() const
+{
+  return d->fileName;
+}
+
+void GeneralEncapsulatedObjectFrame::setFileName(const String &name)
+{
+  d->fileName = name;
+}
+
+String GeneralEncapsulatedObjectFrame::description() const
+{
+  return d->description;
+}
+
+void GeneralEncapsulatedObjectFrame::setDescription(const String &desc)
+{
+  d->description = desc;
+}
+
+ByteVector GeneralEncapsulatedObjectFrame::object() const
+{
+  return d->data;
+}
+
+void GeneralEncapsulatedObjectFrame::setObject(const ByteVector &data)
+{
+  d->data = data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void GeneralEncapsulatedObjectFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 4) {
+    debug("An object frame must contain at least 4 bytes.");
+    return;
+  }
+
+  d->textEncoding = String::Type(data[0]);
+
+  int pos = 1;
+
+  d->mimeType = readStringField(data, String::Latin1, &pos);
+  d->fileName = readStringField(data, d->textEncoding, &pos);
+  d->description = readStringField(data, d->textEncoding, &pos);
+
+  d->data = data.mid(pos);
+}
+
+ByteVector GeneralEncapsulatedObjectFrame::renderFields() const
+{
+  ByteVector data;
+
+  data.append(char(d->textEncoding));
+  data.append(d->mimeType.data(String::Latin1));
+  data.append(textDelimiter(String::Latin1));
+  data.append(d->fileName.data(d->textEncoding));
+  data.append(textDelimiter(d->textEncoding));
+  data.append(d->description.data(d->textEncoding));
+  data.append(textDelimiter(d->textEncoding));
+  data.append(d->data);
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+GeneralEncapsulatedObjectFrame::GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new GeneralEncapsulatedObjectFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.h
new file mode 100644
index 0000000..116ab3f
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/generalencapsulatedobjectframe.h
@@ -0,0 +1,178 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Aaron VonderHaar
+    email                : avh4 at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H
+#define TAGLIB_GENERALENCAPSULATEDOBJECT_H
+
+#include <id3v2frame.h>
+#include <id3v2header.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An ID3v2 general encapsulated object frame implementation
+
+    /*!
+     * This is an implementation of ID3v2 general encapsulated objects.
+     * Arbitrary binary data may be included in tags, stored in GEOB frames.
+     * There may be multiple GEOB frames in a single tag.  Each GEOB it
+     * labelled with a content description (which may be blank), a required
+     * mime-type, and a file name (may be blank).  The content description
+     * uniquely identifies the GEOB frame in the tag.
+     */
+
+    class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+
+      /*!
+       * Constructs an empty object frame.  The description, file name and text
+       * encoding should be set manually.
+       */
+      GeneralEncapsulatedObjectFrame();
+
+      /*!
+       * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data.
+       *
+       * \warning This is \em not data for the encapsulated object, for that use
+       * setObject().  This constructor is used when reading the frame from the
+       * disk.
+       */
+      explicit GeneralEncapsulatedObjectFrame(const ByteVector &data);
+
+      /*!
+       * Destroys the GeneralEncapsulatedObjectFrame instance.
+       */
+      virtual ~GeneralEncapsulatedObjectFrame();
+
+      /*!
+       * Returns a string containing the description, file name and mime-type
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns the text encoding used for the description and file name.
+       *
+       * \see setTextEncoding()
+       * \see description()
+       * \see fileName()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Set the text encoding used for the description and file name.
+       *
+       * \see description()
+       * \see fileName()
+       */
+      void setTextEncoding(String::Type encoding);
+
+      /*!
+       * Returns the mime type of the object.
+       */
+      String mimeType() const;
+
+      /*!
+       * Sets the mime type of the object.
+       */
+      void setMimeType(const String &type);
+
+      /*!
+       * Returns the file name of the object.
+       *
+       * \see setFileName()
+       */
+      String fileName() const;
+
+      /*!
+       * Sets the file name for the object.
+       *
+       * \see fileName()
+       */
+      void setFileName(const String &name);
+
+      /*!
+       * Returns the content description of the object.
+       *
+       * \see setDescription()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      String description() const;
+
+      /*!
+       * Sets the content description of the object to \a desc.
+       *
+       * \see description()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      void setDescription(const String &desc);
+
+      /*!
+       * Returns the object data as a ByteVector.
+       *
+       * \note ByteVector has a data() method that returns a const char * which
+       * should make it easy to export this data to external programs.
+       *
+       * \see setObject()
+       * \see mimeType()
+       */
+      ByteVector object() const;
+
+      /*!
+       * Sets the object data to \a data.  \a data should be of the type specified in
+       * this frame's mime-type specification.
+       *
+       * \see object()
+       * \see mimeType()
+       * \see setMimeType()
+       */
+      void setObject(const ByteVector &object);
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
+      GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &);
+      GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &);
+
+      class GeneralEncapsulatedObjectFramePrivate;
+      GeneralEncapsulatedObjectFramePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.cpp
new file mode 100644
index 0000000..e65cbe0
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.cpp
@@ -0,0 +1,137 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Lukas Lalinsky
+    email                : lalinsky at gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tdebug.h>
+
+#include "popularimeterframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class PopularimeterFrame::PopularimeterFramePrivate
+{
+public:
+  PopularimeterFramePrivate() : rating(0), counter(0) {}
+  String email;
+  int rating;
+  TagLib::uint counter;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+PopularimeterFrame::PopularimeterFrame() : Frame("POPM")
+{
+  d = new PopularimeterFramePrivate;
+}
+
+PopularimeterFrame::PopularimeterFrame(const ByteVector &data) : Frame(data)
+{
+  d = new PopularimeterFramePrivate;
+  setData(data);
+}
+
+PopularimeterFrame::~PopularimeterFrame()
+{
+  delete d;
+}
+
+String PopularimeterFrame::toString() const
+{
+  return d->email + " rating=" + String::number(d->rating) + " counter=" + String::number(d->counter);
+}
+
+String PopularimeterFrame::email() const
+{
+  return d->email;
+}
+
+void PopularimeterFrame::setEmail(const String &s)
+{
+  d->email = s;
+}
+
+int PopularimeterFrame::rating() const
+{
+  return d->rating;
+}
+
+void PopularimeterFrame::setRating(int s)
+{
+  d->rating = s;
+}
+
+TagLib::uint PopularimeterFrame::counter() const
+{
+  return d->counter;
+}
+
+void PopularimeterFrame::setCounter(TagLib::uint s)
+{
+  d->counter = s;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void PopularimeterFrame::parseFields(const ByteVector &data)
+{
+  int pos = 0, size = int(data.size());
+
+  d->email = readStringField(data, String::Latin1, &pos);
+
+  d->rating = 0;
+  d->counter = 0;
+  if(pos < size) {
+    d->rating = (unsigned char)(data[pos++]);
+    if(pos < size) {
+      d->counter = data.mid(pos, 4).toUInt();
+    }
+  }
+}
+
+ByteVector PopularimeterFrame::renderFields() const
+{
+  ByteVector data;
+
+  data.append(d->email.data(String::Latin1));
+  data.append(textDelimiter(String::Latin1));
+  data.append(char(d->rating));
+  data.append(ByteVector::fromUInt(d->counter));
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+PopularimeterFrame::PopularimeterFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new PopularimeterFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.h
new file mode 100644
index 0000000..2d626f4
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/popularimeterframe.h
@@ -0,0 +1,132 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Lukas Lalinsky
+    email                : lalinsky at gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_POPULARIMETERFRAME_H
+#define TAGLIB_POPULARIMETERFRAME_H
+
+#include <id3v2frame.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An implementation of ID3v2 "popularimeter"
+
+    /*!
+     * This implements the ID3v2 popularimeter (POPM frame).  It concists of
+     * an email, a rating and an optional counter.
+     */
+
+    class TAGLIB_EXPORT PopularimeterFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Construct an empty popularimeter frame.
+       */
+      explicit PopularimeterFrame();
+
+      /*!
+       * Construct a popularimeter based on the data in \a data.
+       */
+      explicit PopularimeterFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this PopularimeterFrame instance.
+       */
+      virtual ~PopularimeterFrame();
+
+      /*!
+       * Returns the text of this popularimeter.
+       *
+       * \see text()
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns the email.
+       *
+       * \see setEmail()
+       */
+      String email() const;
+
+      /*!
+       * Set the email.
+       *
+       * \see email()
+       */
+      void setEmail(const String &email);
+
+      /*!
+       * Returns the rating.
+       *
+       * \see setRating()
+       */
+      int rating() const;
+
+      /*!
+       * Set the rating.
+       *
+       * \see rating()
+       */
+      void setRating(int rating);
+
+      /*!
+       * Returns the counter.
+       *
+       * \see setCounter()
+       */
+      uint counter() const;
+
+      /*!
+       * Set the counter.
+       *
+       * \see counter()
+       */
+      void setCounter(uint counter);
+
+    protected:
+      // Reimplementations.
+
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      PopularimeterFrame(const ByteVector &data, Header *h);
+      PopularimeterFrame(const PopularimeterFrame &);
+      PopularimeterFrame &operator=(const PopularimeterFrame &);
+
+      class PopularimeterFramePrivate;
+      PopularimeterFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.cpp
new file mode 100644
index 0000000..9491561
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Serkan Kalyoncu
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <id3v2tag.h>
+#include <tdebug.h>
+
+#include "privateframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+
+class PrivateFrame::PrivateFramePrivate
+{
+public:
+  ByteVector data;
+  String owner;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+PrivateFrame::PrivateFrame() : Frame("PRIV")
+{
+  d = new PrivateFramePrivate;
+}
+
+PrivateFrame::PrivateFrame(const ByteVector &data) : Frame(data)
+{
+  d = new PrivateFramePrivate;
+  setData(data);
+}
+
+PrivateFrame::~PrivateFrame()
+{
+  delete d;
+}
+
+String PrivateFrame::toString() const
+{
+  return d->owner;
+}
+
+String PrivateFrame::owner() const
+{
+  return d->owner;
+}
+
+ByteVector PrivateFrame::data() const
+{
+  return d->data;
+}
+
+void PrivateFrame::setOwner(const String &s)
+{
+  d->owner = s;
+}
+
+void PrivateFrame::setData(const ByteVector & data)
+{
+  d->data = data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void PrivateFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 2) {
+    debug("A private frame must contain at least 2 bytes.");
+    return;
+  }
+
+  // Owner identifier is assumed to be Latin1
+  
+  const int byteAlign =  1;
+  const int endOfOwner = data.find(textDelimiter(String::Latin1), 0, byteAlign);
+
+  d->owner =  String(data.mid(0, endOfOwner));
+  d->data = data.mid(endOfOwner + 1);
+}
+
+ByteVector PrivateFrame::renderFields() const
+{
+  ByteVector v;
+
+  v.append(d->owner.data(String::Latin1));
+  v.append(textDelimiter(String::Latin1));
+  v.append(d->data);
+
+  return v;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+PrivateFrame::PrivateFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new PrivateFramePrivate();
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.h
new file mode 100644
index 0000000..866a6d4
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/privateframe.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Serkan Kalyoncu
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_PRIVATEFRAME_H
+#define TAGLIB_PRIVATEFRAME_H
+
+#include "id3v2frame.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An implementation of ID3v2 privateframe
+
+    class TAGLIB_EXPORT PrivateFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Construct an empty private frame.
+       */
+      PrivateFrame();
+
+      /*!
+       * Construct a private frame based on the data in \a data.
+       *
+       * \note This is the constructor used when parsing the frame from a file.
+       */
+      explicit PrivateFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this private frame instance.
+       */
+      virtual ~PrivateFrame();
+
+      /*!
+       * Returns the text of this private frame, currently just the owner.
+       *
+       * \see text()
+       */
+      virtual String toString() const;
+
+      /*!
+       * \return The owner of the private frame.
+       * \note This should contain an email address or link to a website.
+       */
+      String owner() const;
+
+      /*!
+       *
+       */
+      ByteVector data() const;
+
+      /*!
+       * Sets the owner of the frame to \a s.
+       * \note This should contain an email address or link to a website.
+       */
+      void setOwner(const String &s);
+
+      /*!
+       *
+       */
+      void setData(const ByteVector &v);
+
+    protected:
+      // Reimplementations.
+
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      PrivateFrame(const ByteVector &data, Header *h);
+
+      PrivateFrame(const PrivateFrame &);
+      PrivateFrame &operator=(const PrivateFrame &);
+
+      class PrivateFramePrivate;
+      PrivateFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp
new file mode 100644
index 0000000..8495197
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.cpp
@@ -0,0 +1,236 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tdebug.h>
+#include <tmap.h>
+
+#include "relativevolumeframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+static inline int bitsToBytes(int i)
+{
+  return i % 8 == 0 ? i / 8 : (i - i % 8) / 8 + 1;
+}
+
+struct ChannelData
+{
+  ChannelData() : channelType(RelativeVolumeFrame::Other), volumeAdjustment(0) {}
+
+  RelativeVolumeFrame::ChannelType channelType;
+  short volumeAdjustment;
+  RelativeVolumeFrame::PeakVolume peakVolume;
+};
+
+class RelativeVolumeFrame::RelativeVolumeFramePrivate
+{
+public:
+  String identification;
+  Map<ChannelType, ChannelData> channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RelativeVolumeFrame::RelativeVolumeFrame() : Frame("RVA2")
+{
+  d = new RelativeVolumeFramePrivate;
+}
+
+RelativeVolumeFrame::RelativeVolumeFrame(const ByteVector &data) : Frame(data)
+{
+  d = new RelativeVolumeFramePrivate;
+  setData(data);
+}
+
+RelativeVolumeFrame::~RelativeVolumeFrame()
+{
+  delete d;
+}
+
+String RelativeVolumeFrame::toString() const
+{
+  return d->identification;
+}
+
+List<RelativeVolumeFrame::ChannelType> RelativeVolumeFrame::channels() const
+{
+  List<ChannelType> l;
+
+  Map<ChannelType, ChannelData>::ConstIterator it = d->channels.begin();
+  for(; it != d->channels.end(); ++it)
+    l.append((*it).first);
+
+  return l;
+}
+
+// deprecated
+
+RelativeVolumeFrame::ChannelType RelativeVolumeFrame::channelType() const
+{
+  return MasterVolume;
+}
+
+// deprecated
+
+void RelativeVolumeFrame::setChannelType(ChannelType)
+{
+
+}
+
+short RelativeVolumeFrame::volumeAdjustmentIndex(ChannelType type) const
+{
+  return d->channels.contains(type) ? d->channels[type].volumeAdjustment : 0;
+}
+
+short RelativeVolumeFrame::volumeAdjustmentIndex() const
+{
+  return volumeAdjustmentIndex(MasterVolume);
+}
+
+void RelativeVolumeFrame::setVolumeAdjustmentIndex(short index, ChannelType type)
+{
+  d->channels[type].volumeAdjustment = index;
+}
+
+void RelativeVolumeFrame::setVolumeAdjustmentIndex(short index)
+{
+  setVolumeAdjustmentIndex(index, MasterVolume);
+}
+
+float RelativeVolumeFrame::volumeAdjustment(ChannelType type) const
+{
+  return d->channels.contains(type) ? float(d->channels[type].volumeAdjustment) / float(512) : 0;
+}
+
+float RelativeVolumeFrame::volumeAdjustment() const
+{
+  return volumeAdjustment(MasterVolume);
+}
+
+void RelativeVolumeFrame::setVolumeAdjustment(float adjustment, ChannelType type)
+{
+  d->channels[type].volumeAdjustment = short(adjustment * float(512));
+}
+
+void RelativeVolumeFrame::setVolumeAdjustment(float adjustment)
+{
+  setVolumeAdjustment(adjustment, MasterVolume);
+}
+
+RelativeVolumeFrame::PeakVolume RelativeVolumeFrame::peakVolume(ChannelType type) const
+{
+  return d->channels.contains(type) ? d->channels[type].peakVolume : PeakVolume();
+}
+
+RelativeVolumeFrame::PeakVolume RelativeVolumeFrame::peakVolume() const
+{
+  return peakVolume(MasterVolume);
+}
+
+void RelativeVolumeFrame::setPeakVolume(const PeakVolume &peak, ChannelType type)
+{
+  d->channels[type].peakVolume = peak;
+}
+
+void RelativeVolumeFrame::setPeakVolume(const PeakVolume &peak)
+{
+  setPeakVolume(peak, MasterVolume);
+}
+
+String RelativeVolumeFrame::identification() const
+{
+  return d->identification;
+}
+
+void RelativeVolumeFrame::setIdentification(const String &s)
+{
+  d->identification = s;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void RelativeVolumeFrame::parseFields(const ByteVector &data)
+{
+  int pos = 0;
+  d->identification = readStringField(data, String::Latin1, &pos);
+
+  // Each channel is at least 4 bytes.
+
+  while(pos <= (int)data.size() - 4) {
+
+
+    ChannelType type = ChannelType(data[pos]);
+    pos += 1;
+
+    ChannelData &channel = d->channels[type];
+
+    channel.volumeAdjustment = data.mid(pos, 2).toShort();
+    pos += 2;
+
+    channel.peakVolume.bitsRepresentingPeak = data[pos];
+    pos += 1;
+
+    int bytes = bitsToBytes(channel.peakVolume.bitsRepresentingPeak);
+    channel.peakVolume.peakVolume = data.mid(pos, bytes);
+    pos += bytes;
+  }
+}
+
+ByteVector RelativeVolumeFrame::renderFields() const
+{
+  ByteVector data;
+
+  data.append(d->identification.data(String::Latin1));
+  data.append(textDelimiter(String::Latin1));
+
+  Map<ChannelType, ChannelData>::ConstIterator it = d->channels.begin();
+
+  for(; it != d->channels.end(); ++it) {
+    ChannelType type = (*it).first;
+    const ChannelData &channel = (*it).second;
+
+    data.append(char(type));
+    data.append(ByteVector::fromShort(channel.volumeAdjustment));
+    data.append(char(channel.peakVolume.bitsRepresentingPeak));
+    data.append(channel.peakVolume.peakVolume);
+  }
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+RelativeVolumeFrame::RelativeVolumeFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new RelativeVolumeFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.h
new file mode 100644
index 0000000..f852198
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/relativevolumeframe.h
@@ -0,0 +1,274 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_RELATIVEVOLUMEFRAME_H
+#define TAGLIB_RELATIVEVOLUMEFRAME_H
+
+#include <tlist.h>
+#include <id3v2frame.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An ID3v2 relative volume adjustment frame implementation
+
+    /*!
+     * This is an implementation of ID3v2 relative volume adjustment.  The
+     * presence of this frame makes it possible to specify an increase in volume
+     * for an audio file or specific audio tracks in that file.
+     *
+     * Multiple relative volume adjustment frames may be present in the tag
+     * each with a unique identification and describing volume adjustment for
+     * different channel types.
+     */
+
+    class TAGLIB_EXPORT RelativeVolumeFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+
+      /*!
+       * This indicates the type of volume adjustment that should be applied.
+       */
+      enum ChannelType {
+        //! A type not enumerated below
+        Other        = 0x00,
+        //! The master volume for the track
+        MasterVolume = 0x01,
+        //! The front right audio channel
+        FrontRight   = 0x02,
+        //! The front left audio channel
+        FrontLeft    = 0x03,
+        //! The back right audio channel
+        BackRight    = 0x04,
+        //! The back left audio channel
+        BackLeft     = 0x05,
+        //! The front center audio channel
+        FrontCentre  = 0x06,
+        //! The back center audio channel
+        BackCentre   = 0x07,
+        //! The subwoofer audio channel
+        Subwoofer    = 0x08
+      };
+
+      //! Struct that stores the relevant values for ID3v2 peak volume
+
+      /*!
+       * The peak volume is described as a series of bits that is padded to fill
+       * a block of bytes.  These two values should always be updated in tandem.
+       */
+      struct PeakVolume
+      {
+        /*!
+         * Constructs an empty peak volume description.
+         */
+        PeakVolume() : bitsRepresentingPeak(0) {}
+        /*!
+         * The number of bits (in the range of 0 to 255) used to describe the
+         * peak volume.
+         */
+        unsigned char bitsRepresentingPeak;
+        /*!
+         * The array of bits (represented as a series of bytes) used to describe
+         * the peak volume.
+         */
+        ByteVector peakVolume;
+      };
+
+      /*!
+       * Constructs a RelativeVolumeFrame.  The relevant data should be set
+       * manually.
+       */
+      RelativeVolumeFrame();
+
+      /*!
+       * Constructs a RelativeVolumeFrame based on the contents of \a data.
+       */
+      RelativeVolumeFrame(const ByteVector &data);
+
+      /*!
+       * Destroys the RelativeVolumeFrame instance.
+       */
+      virtual ~RelativeVolumeFrame();
+
+      /*!
+       * Returns the frame's identification.
+       *
+       * \see identification()
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns a list of channels with information currently in the frame.
+       */
+      List<ChannelType> channels() const;
+
+      /*!
+       * \deprecated Always returns master volume.
+       */
+      ChannelType channelType() const;
+
+      /*!
+       * \deprecated This method no longer has any effect.
+       */
+      void setChannelType(ChannelType t);
+
+      /*
+       * There was a terrible API goof here, and while this can't be changed to
+       * the way it appears below for binary compaibility reasons, let's at
+       * least pretend that it looks clean.
+       */
+
+#ifdef DOXYGEN
+
+      /*!
+       * Returns the relative volume adjustment "index".  As indicated by the
+       * ID3v2 standard this is a 16-bit signed integer that reflects the
+       * decibils of adjustment when divided by 512.
+       *
+       * This defaults to returning the value for the master volume channel if
+       * available and returns 0 if the specified channel does not exist.
+       *
+       * \see setVolumeAdjustmentIndex()
+       * \see volumeAjustment()
+       */
+      short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
+
+      /*!
+       * Set the volume adjustment to \a index.  As indicated by the ID3v2
+       * standard this is a 16-bit signed integer that reflects the decibils of
+       * adjustment when divided by 512.
+       *
+       * By default this sets the value for the master volume.
+       *
+       * \see volumeAdjustmentIndex()
+       * \see setVolumeAjustment()
+       */
+      void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
+
+      /*!
+       * Returns the relative volume adjustment in decibels.
+       *
+       * \note Because this is actually stored internally as an "index" to this
+       * value the value returned by this method may not be identical to the
+       * value set using setVolumeAdjustment().
+       *
+       * This defaults to returning the value for the master volume channel if
+       * available and returns 0 if the specified channel does not exist.
+       *
+       * \see setVolumeAdjustment()
+       * \see volumeAdjustmentIndex()
+       */
+      float volumeAdjustment(ChannelType type = MasterVolume) const;
+
+      /*!
+       * Set the relative volume adjustment in decibels to \a adjustment.
+       *
+       * By default this sets the value for the master volume.
+       *
+       * \note Because this is actually stored internally as an "index" to this
+       * value the value set by this method may not be identical to the one
+       * returned by volumeAdjustment().
+       *
+       * \see setVolumeAdjustment()
+       * \see volumeAdjustmentIndex()
+       */
+      void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
+
+      /*!
+       * Returns the peak volume (represented as a length and a string of bits).
+       *
+       * This defaults to returning the value for the master volume channel if
+       * available and returns 0 if the specified channel does not exist.
+       *
+       * \see setPeakVolume()
+       */
+      PeakVolume peakVolume(ChannelType type = MasterVolume) const;
+
+      /*!
+       * Sets the peak volume to \a peak.
+       *
+       * By default this sets the value for the master volume.
+       *
+       * \see peakVolume()
+       */
+      void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
+
+#else
+
+      // BIC: Combine each of the following pairs of functions (or maybe just
+      // rework this junk altogether).
+
+      short volumeAdjustmentIndex(ChannelType type) const;
+      short volumeAdjustmentIndex() const;
+
+      void setVolumeAdjustmentIndex(short index, ChannelType type);
+      void setVolumeAdjustmentIndex(short index);
+
+      float volumeAdjustment(ChannelType type) const;
+      float volumeAdjustment() const;
+
+      void setVolumeAdjustment(float adjustment, ChannelType type);
+      void setVolumeAdjustment(float adjustment);
+
+      PeakVolume peakVolume(ChannelType type) const;
+      PeakVolume peakVolume() const;
+
+      void setPeakVolume(const PeakVolume &peak, ChannelType type);
+      void setPeakVolume(const PeakVolume &peak);
+
+#endif
+
+      /*!
+       * Returns the identification for this frame.
+       */
+      String identification() const;
+
+      /*!
+       * Sets the identification of the frame to \a s. The string
+       * is used to identify the situation and/or device where this
+       * adjustment should apply.
+       */
+      void setIdentification(const String &s);
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      RelativeVolumeFrame(const ByteVector &data, Header *h);
+      RelativeVolumeFrame(const RelativeVolumeFrame &);
+      RelativeVolumeFrame &operator=(const RelativeVolumeFrame &);
+
+      class RelativeVolumeFramePrivate;
+      RelativeVolumeFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.cpp
new file mode 100644
index 0000000..7d3b4ff
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.cpp
@@ -0,0 +1,271 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <id3v2tag.h>
+
+#include "textidentificationframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class TextIdentificationFrame::TextIdentificationFramePrivate
+{
+public:
+  TextIdentificationFramePrivate() : textEncoding(String::Latin1) {}
+  String::Type textEncoding;
+  StringList fieldList;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// TextIdentificationFrame public members
+////////////////////////////////////////////////////////////////////////////////
+
+TextIdentificationFrame::TextIdentificationFrame(const ByteVector &type, String::Type encoding) :
+  Frame(type)
+{
+  d = new TextIdentificationFramePrivate;
+  d->textEncoding = encoding;
+}
+
+TextIdentificationFrame::TextIdentificationFrame(const ByteVector &data) :
+  Frame(data)
+{
+  d = new TextIdentificationFramePrivate;
+  setData(data);
+}
+
+TextIdentificationFrame::~TextIdentificationFrame()
+{
+  delete d;
+}
+
+void TextIdentificationFrame::setText(const StringList &l)
+{
+  d->fieldList = l;
+}
+
+void TextIdentificationFrame::setText(const String &s)
+{
+  d->fieldList = s;
+}
+
+String TextIdentificationFrame::toString() const
+{
+  return d->fieldList.toString();
+}
+
+StringList TextIdentificationFrame::fieldList() const
+{
+  return d->fieldList;
+}
+
+String::Type TextIdentificationFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void TextIdentificationFrame::setTextEncoding(String::Type encoding)
+{
+  d->textEncoding = encoding;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TextIdentificationFrame protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void TextIdentificationFrame::parseFields(const ByteVector &data)
+{
+  // Don't try to parse invalid frames
+
+  if(data.size() < 2)
+    return;
+
+  // read the string data type (the first byte of the field data)
+
+  d->textEncoding = String::Type(data[0]);
+
+  // split the byte array into chunks based on the string type (two byte delimiter
+  // for unicode encodings)
+
+  int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
+
+  // build a small counter to strip nulls off the end of the field
+
+  int dataLength = data.size() - 1;
+
+  while(dataLength > 0 && data[dataLength] == 0)
+    dataLength--;
+
+  while(dataLength % byteAlign != 0)
+    dataLength++;
+
+  ByteVectorList l = ByteVectorList::split(data.mid(1, dataLength), textDelimiter(d->textEncoding), byteAlign);
+
+  d->fieldList.clear();
+
+  // append those split values to the list and make sure that the new string's
+  // type is the same specified for this frame
+
+  for(ByteVectorList::Iterator it = l.begin(); it != l.end(); it++) {
+    if(!(*it).isEmpty()) {
+      String s(*it, d->textEncoding);
+      d->fieldList.append(s);
+    }
+  }
+}
+
+ByteVector TextIdentificationFrame::renderFields() const
+{
+  String::Type encoding = checkEncoding(d->fieldList, d->textEncoding);
+
+  ByteVector v;
+
+  v.append(char(encoding));
+
+  for(StringList::ConstIterator it = d->fieldList.begin(); it != d->fieldList.end(); it++) {
+
+    // Since the field list is null delimited, if this is not the first
+    // element in the list, append the appropriate delimiter for this
+    // encoding.
+
+    if(it != d->fieldList.begin())
+      v.append(textDelimiter(encoding));
+
+    v.append((*it).data(encoding));
+  }
+
+  return v;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// TextIdentificationFrame private members
+////////////////////////////////////////////////////////////////////////////////
+
+TextIdentificationFrame::TextIdentificationFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new TextIdentificationFramePrivate;
+  parseFields(fieldData(data));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// UserTextIdentificationFrame public members
+////////////////////////////////////////////////////////////////////////////////
+
+UserTextIdentificationFrame::UserTextIdentificationFrame(String::Type encoding) :
+  TextIdentificationFrame("TXXX", encoding),
+  d(0)
+{
+  StringList l;
+  l.append(String::null);
+  l.append(String::null);
+  setText(l);
+}
+
+
+UserTextIdentificationFrame::UserTextIdentificationFrame(const ByteVector &data) :
+  TextIdentificationFrame(data)
+{
+  checkFields();
+}
+
+String UserTextIdentificationFrame::toString() const
+{
+  return "[" + description() + "] " + fieldList().toString();
+}
+
+String UserTextIdentificationFrame::description() const
+{
+  return !TextIdentificationFrame::fieldList().isEmpty()
+    ? TextIdentificationFrame::fieldList().front()
+    : String::null;
+}
+
+StringList UserTextIdentificationFrame::fieldList() const
+{
+  // TODO: remove this function
+
+  return TextIdentificationFrame::fieldList();
+}
+
+void UserTextIdentificationFrame::setText(const String &text)
+{
+  if(description().isEmpty())
+    setDescription(String::null);
+
+  TextIdentificationFrame::setText(StringList(description()).append(text));
+}
+
+void UserTextIdentificationFrame::setText(const StringList &fields)
+{
+  if(description().isEmpty())
+    setDescription(String::null);
+
+  TextIdentificationFrame::setText(StringList(description()).append(fields));
+}
+
+void UserTextIdentificationFrame::setDescription(const String &s)
+{
+  StringList l = fieldList();
+
+  if(l.isEmpty())
+    l.append(s);
+  else
+    l[0] = s;
+
+  TextIdentificationFrame::setText(l);
+}
+
+UserTextIdentificationFrame *UserTextIdentificationFrame::find(
+  ID3v2::Tag *tag, const String &description) // static
+{
+  FrameList l = tag->frameList("TXXX");
+  for(FrameList::Iterator it = l.begin(); it != l.end(); ++it) {
+    UserTextIdentificationFrame *f = dynamic_cast<UserTextIdentificationFrame *>(*it);
+    if(f && f->description() == description)
+      return f;
+  }
+  return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// UserTextIdentificationFrame private members
+////////////////////////////////////////////////////////////////////////////////
+
+UserTextIdentificationFrame::UserTextIdentificationFrame(const ByteVector &data, Header *h) :
+  TextIdentificationFrame(data, h)
+{
+  checkFields();
+}
+
+void UserTextIdentificationFrame::checkFields()
+{
+  int fields = fieldList().size();
+
+  if(fields == 0)
+    setDescription(String::null);
+  if(fields <= 1)
+    setText(String::null);
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.h
new file mode 100644
index 0000000..291cba5
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.h
@@ -0,0 +1,258 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H
+#define TAGLIB_TEXTIDENTIFICATIONFRAME_H
+
+#include <tstringlist.h>
+#include "taglib_export.h"
+
+#include <id3v2frame.h>
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    class Tag;
+
+    //! An ID3v2 text identification frame implementation
+
+    /*!
+     * This is an implementation of the most common type of ID3v2 frame -- text
+     * identification frames.  There are a number of variations on this.  Those
+     * enumerated in the ID3v2.4 standard are:
+     *
+     * <ul>
+     *   <li><b>TALB</b> Album/Movie/Show title</li>
+     *   <li><b>TBPM</b> BPM (beats per minute)</li>
+     *   <li><b>TCOM</b> Composer</li>
+     *   <li><b>TCON</b> Content type</li>
+     *   <li><b>TCOP</b> Copyright message</li>
+     *   <li><b>TDEN</b> Encoding time</li>
+     *   <li><b>TDLY</b> Playlist delay</li>
+     *   <li><b>TDOR</b> Original release time</li>
+     *   <li><b>TDRC</b> Recording time</li>
+     *   <li><b>TDRL</b> Release time</li>
+     *   <li><b>TDTG</b> Tagging time</li>
+     *   <li><b>TENC</b> Encoded by</li>
+     *   <li><b>TEXT</b> Lyricist/Text writer</li>
+     *   <li><b>TFLT</b> File type</li>
+     *   <li><b>TIPL</b> Involved people list</li>
+     *   <li><b>TIT1</b> Content group description</li>
+     *   <li><b>TIT2</b> Title/songname/content description</li>
+     *   <li><b>TIT3</b> Subtitle/Description refinement</li>
+     *   <li><b>TKEY</b> Initial key</li>
+     *   <li><b>TLAN</b> Language(s)</li>
+     *   <li><b>TLEN</b> Length</li>
+     *   <li><b>TMCL</b> Musician credits list</li>
+     *   <li><b>TMED</b> Media type</li>
+     *   <li><b>TMOO</b> Mood</li>
+     *   <li><b>TOAL</b> Original album/movie/show title</li>
+     *   <li><b>TOFN</b> Original filename</li>
+     *   <li><b>TOLY</b> Original lyricist(s)/text writer(s)</li>
+     *   <li><b>TOPE</b> Original artist(s)/performer(s)</li>
+     *   <li><b>TOWN</b> File owner/licensee</li>
+     *   <li><b>TPE1</b> Lead performer(s)/Soloist(s)</li>
+     *   <li><b>TPE2</b> Band/orchestra/accompaniment</li>
+     *   <li><b>TPE3</b> Conductor/performer refinement</li>
+     *   <li><b>TPE4</b> Interpreted, remixed, or otherwise modified by</li>
+     *   <li><b>TPOS</b> Part of a set</li>
+     *   <li><b>TPRO</b> Produced notice</li>
+     *   <li><b>TPUB</b> Publisher</li>
+     *   <li><b>TRCK</b> Track number/Position in set</li>
+     *   <li><b>TRSN</b> Internet radio station name</li>
+     *   <li><b>TRSO</b> Internet radio station owner</li>
+     *   <li><b>TSOA</b> Album sort order</li>
+     *   <li><b>TSOP</b> Performer sort order</li>
+     *   <li><b>TSOT</b> Title sort order</li>
+     *   <li><b>TSRC</b> ISRC (international standard recording code)</li>
+     *   <li><b>TSSE</b> Software/Hardware and settings used for encoding</li>
+     *   <li><b>TSST</b> Set subtitle</li>
+     * </ul>
+     *
+     * The ID3v2 Frames document gives a description of each of these formats
+     * and the expected order of strings in each.  ID3v2::Header::frameID() can
+     * be used to determine the frame type.
+     *
+     * \note If non-Latin1 compatible strings are used with this class, even if
+     * the text encoding is set to Latin1, the frame will be written using UTF8
+     * (with the encoding flag appropriately set in the output).
+     */
+
+    class TAGLIB_EXPORT TextIdentificationFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Construct an empty frame of type \a type.  Uses \a encoding as the
+       * default text encoding.
+       *
+       * \note In this case you must specify the text encoding as it
+       * resolves the ambiguity between constructors.
+       *
+       * \note Please see the note in the class description regarding Latin1.
+       */
+      TextIdentificationFrame(const ByteVector &type, String::Type encoding);
+
+      /*!
+       * This is a dual purpose constructor.  \a data can either be binary data
+       * that should be parsed or (at a minimum) the frame ID.
+       */
+      explicit TextIdentificationFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this TextIdentificationFrame instance.
+       */
+      virtual ~TextIdentificationFrame();
+
+      /*!
+       * Text identification frames are a list of string fields.
+       *
+       * This function will accept either a StringList or a String (using the
+       * StringList constructor that accepts a single String).
+       *
+       * \note This will not change the text encoding of the frame even if the
+       * strings passed in are not of the same encoding.  Please use
+       * setEncoding(s.type()) if you wish to change the encoding of the frame.
+       */
+      void setText(const StringList &l);
+
+      // Reimplementations.
+
+      virtual void setText(const String &s);
+      virtual String toString() const;
+
+      /*!
+       * Returns the text encoding that will be used in rendering this frame.
+       * This defaults to the type that was either specified in the constructor
+       * or read from the frame when parsed.
+       *
+       * \note Please see the note in the class description regarding Latin1.
+       *
+       * \see setTextEncoding()
+       * \see render()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Sets the text encoding to be used when rendering this frame to
+       * \a encoding.
+       *
+       * \note Please see the note in the class description regarding Latin1.
+       *
+       * \see textEncoding()
+       * \see render()
+       */
+      void setTextEncoding(String::Type encoding);
+
+      /*!
+       * Returns a list of the strings in this frame.
+       */
+      StringList fieldList() const;
+
+    protected:
+      // Reimplementations.
+
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      TextIdentificationFrame(const ByteVector &data, Header *h);
+
+    private:
+      TextIdentificationFrame(const TextIdentificationFrame &);
+      TextIdentificationFrame &operator=(const TextIdentificationFrame &);
+
+      class TextIdentificationFramePrivate;
+      TextIdentificationFramePrivate *d;
+    };
+
+    /*!
+     * This is a specialization of text identification frames that allows for
+     * user defined entries.  Each entry has a description in addition to the
+     * normal list of fields that a text identification frame has.
+     *
+     * This description identifies the frame and must be unique.
+     */
+
+    //! An ID3v2 custom text identification frame implementationx
+
+    class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Constructs an empty user defined text identification frame.  For this to be
+       * a useful frame both a description and text must be set.
+       */
+      explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1);
+
+      /*!
+       * Creates a frame based on \a data.
+       */
+      explicit UserTextIdentificationFrame(const ByteVector &data);
+
+      virtual String toString() const;
+
+      /*!
+       * Returns the description for this frame.
+       */
+      String description() const;
+
+      /*!
+       * Sets the description of the frame to \a s.  \a s must be unique.  You can
+       * check for the presence of another user defined text frame of the same type
+       * using find() and testing for null.
+       */
+      void setDescription(const String &s);
+
+      StringList fieldList() const;
+      void setText(const String &text);
+      void setText(const StringList &fields);
+
+      /*!
+       * Searches for the user defined text frame with the description \a description
+       * in \a tag.  This returns null if no matching frames were found.
+       */
+      static UserTextIdentificationFrame *find(Tag *tag, const String &description);
+
+    private:
+      UserTextIdentificationFrame(const ByteVector &data, Header *h);
+      UserTextIdentificationFrame(const TextIdentificationFrame &);
+      UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &);
+
+      void checkFields();
+
+      class UserTextIdentificationFramePrivate;
+      UserTextIdentificationFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp
new file mode 100644
index 0000000..836982b
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.cpp
@@ -0,0 +1,118 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <tdebug.h>
+
+#include "uniquefileidentifierframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class UniqueFileIdentifierFrame::UniqueFileIdentifierFramePrivate
+{
+public:
+  String owner;
+  ByteVector identifier;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
+UniqueFileIdentifierFrame::UniqueFileIdentifierFrame(const ByteVector &data) :
+    ID3v2::Frame(data)
+{
+  d = new UniqueFileIdentifierFramePrivate;
+  setData(data);
+}
+
+UniqueFileIdentifierFrame::UniqueFileIdentifierFrame(const String &owner, const ByteVector &id) :
+    ID3v2::Frame("UFID")
+{
+  d = new UniqueFileIdentifierFramePrivate;
+  d->owner = owner;
+  d->identifier = id;
+}
+
+UniqueFileIdentifierFrame::~UniqueFileIdentifierFrame()
+{
+  delete d;
+}
+
+String UniqueFileIdentifierFrame::owner() const
+{
+    return d->owner;
+}
+
+ByteVector UniqueFileIdentifierFrame::identifier() const
+{
+  return d->identifier;
+}
+
+void UniqueFileIdentifierFrame::setOwner(const String &s)
+{
+  d->owner = s;
+}
+
+void UniqueFileIdentifierFrame::setIdentifier(const ByteVector &v)
+{
+  d->identifier = v;
+}
+
+String UniqueFileIdentifierFrame::toString() const
+{
+  return String::null;
+}
+
+void UniqueFileIdentifierFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 1) {
+    debug("An UFID frame must contain at least 1 byte.");
+    return;
+  }
+
+  int pos = 0;
+  d->owner = readStringField(data, String::Latin1, &pos);
+  d->identifier = data.mid(pos);
+}
+
+ByteVector UniqueFileIdentifierFrame::renderFields() const
+{
+  ByteVector data;
+
+  data.append(d->owner.data(String::Latin1));
+  data.append(char(0));
+  data.append(d->identifier);
+
+  return data;
+}
+
+UniqueFileIdentifierFrame::UniqueFileIdentifierFrame(const ByteVector &data, Header *h) :
+  Frame(h)
+{
+  d = new UniqueFileIdentifierFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h
new file mode 100644
index 0000000..a0a66bb
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_UNIQUEFILEIDENTIFIERFRAME
+#define TAGLIB_UNIQUEFILEIDENTIFIERFRAME
+
+#include <id3v2frame.h>
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    /*!
+     * This is an implementation of ID3v2 unique file identifier frames.  This
+     * frame is used to identify the file in an arbitrary database identified
+     * by the owner field.
+     */
+
+    //! An implementation of ID3v2 unique identifier frames
+
+    class TAGLIB_EXPORT UniqueFileIdentifierFrame : public ID3v2::Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Creates a uniqe file identifier frame based on \a data.
+       */
+      UniqueFileIdentifierFrame(const ByteVector &data);
+
+      /*!
+       * Creates a unique file identifier frame with the owner \a owner and
+       * the identification \a id.
+       */
+      UniqueFileIdentifierFrame(const String &owner, const ByteVector &id);
+
+      /*!
+       * Destroys the frame.
+       */
+      ~UniqueFileIdentifierFrame();
+
+      /*!
+       * Returns the owner for the frame; essentially this is the key for
+       * determining which identification scheme this key belongs to.  This
+       * will usually either be an email address or URL for the person or tool
+       * used to create the unique identifier.
+       *
+       * \see setOwner()
+       */
+      String owner() const;
+
+      /*!
+       * Returns the unique identifier.  Though sometimes this is a text string
+       * it also may be binary data and as much should be assumed when handling
+       * it.
+       */
+      ByteVector identifier() const;
+
+      /*!
+       * Sets the owner of the identification scheme to \a s.
+       *
+       * \see owner()
+       */
+      void setOwner(const String &s);
+
+      /*!
+       * Sets the unique file identifier to \a v.
+       *
+       * \see identifier()
+       */
+      void setIdentifier(const ByteVector &v);
+
+      virtual String toString() const;
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      UniqueFileIdentifierFrame(const UniqueFileIdentifierFrame &);
+      UniqueFileIdentifierFrame &operator=(UniqueFileIdentifierFrame &);
+
+      UniqueFileIdentifierFrame(const ByteVector &data, Header *h);
+
+      class UniqueFileIdentifierFramePrivate;
+      UniqueFileIdentifierFramePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.cpp
new file mode 100644
index 0000000..42b87c6
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.cpp
@@ -0,0 +1,84 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "unknownframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class UnknownFrame::UnknownFramePrivate
+{
+public:
+  ByteVector fieldData;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+UnknownFrame::UnknownFrame(const ByteVector &data) : Frame(data)
+{
+  d = new UnknownFramePrivate;
+  setData(data);
+}
+
+UnknownFrame::~UnknownFrame()
+{
+  delete d;
+}
+
+String UnknownFrame::toString() const
+{
+  return String::null;
+}
+
+ByteVector UnknownFrame::data() const
+{
+  return d->fieldData;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void UnknownFrame::parseFields(const ByteVector &data)
+{
+  d->fieldData = data;
+}
+
+ByteVector UnknownFrame::renderFields() const
+{
+  return d->fieldData;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+UnknownFrame::UnknownFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new UnknownFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.h
new file mode 100644
index 0000000..164a44a
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/unknownframe.h
@@ -0,0 +1,79 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_UNKNOWNFRAME_H
+#define TAGLIB_UNKNOWNFRAME_H
+
+#include <id3v2frame.h>
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! A frame type \e unknown to TagLib.
+
+    /*!
+     * This class represents a frame type not known (or more often simply
+     * unimplemented) in TagLib.  This is here provide a basic API for
+     * manipulating the binary data of unknown frames and to provide a means
+     * of rendering such \e unknown frames.
+     *
+     * Please note that a cleaner way of handling frame types that TagLib
+     * does not understand is to subclass ID3v2::Frame and ID3v2::FrameFactory
+     * to have your frame type supported through the standard ID3v2 mechanism.
+     */
+
+    class TAGLIB_EXPORT UnknownFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      UnknownFrame(const ByteVector &data);
+      virtual ~UnknownFrame();
+
+      virtual String toString() const;
+
+      /*!
+       * Returns the field data (everything but the header) for this frame.
+       */
+      ByteVector data() const;
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      UnknownFrame(const ByteVector &data, Header *h);
+      UnknownFrame(const UnknownFrame &);
+      UnknownFrame &operator=(const UnknownFrame &);
+
+      class UnknownFramePrivate;
+      UnknownFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp
new file mode 100644
index 0000000..4c907dd
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp
@@ -0,0 +1,162 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Urs Fleisch
+    email                : ufleisch at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it  under the terms of the GNU Lesser General Public License version  *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "unsynchronizedlyricsframe.h"
+#include <tbytevectorlist.h>
+#include <tdebug.h>
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class UnsynchronizedLyricsFrame::UnsynchronizedLyricsFramePrivate
+{
+public:
+  UnsynchronizedLyricsFramePrivate() : textEncoding(String::Latin1) {}
+  String::Type textEncoding;
+  ByteVector language;
+  String description;
+  String text;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+UnsynchronizedLyricsFrame::UnsynchronizedLyricsFrame(String::Type encoding) :
+  Frame("USLT")
+{
+  d = new UnsynchronizedLyricsFramePrivate;
+  d->textEncoding = encoding;
+}
+
+UnsynchronizedLyricsFrame::UnsynchronizedLyricsFrame(const ByteVector &data) :
+  Frame(data)
+{
+  d = new UnsynchronizedLyricsFramePrivate;
+  setData(data);
+}
+
+UnsynchronizedLyricsFrame::~UnsynchronizedLyricsFrame()
+{
+  delete d;
+}
+
+String UnsynchronizedLyricsFrame::toString() const
+{
+  return d->text;
+}
+
+ByteVector UnsynchronizedLyricsFrame::language() const
+{
+  return d->language;
+}
+
+String UnsynchronizedLyricsFrame::description() const
+{
+  return d->description;
+}
+
+String UnsynchronizedLyricsFrame::text() const
+{
+  return d->text;
+}
+
+void UnsynchronizedLyricsFrame::setLanguage(const ByteVector &languageEncoding)
+{
+  d->language = languageEncoding.mid(0, 3);
+}
+
+void UnsynchronizedLyricsFrame::setDescription(const String &s)
+{
+  d->description = s;
+}
+
+void UnsynchronizedLyricsFrame::setText(const String &s)
+{
+  d->text = s;
+}
+
+
+String::Type UnsynchronizedLyricsFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void UnsynchronizedLyricsFrame::setTextEncoding(String::Type encoding)
+{
+  d->textEncoding = encoding;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void UnsynchronizedLyricsFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 5) {
+    debug("An unsynchronized lyrics frame must contain at least 5 bytes.");
+    return;
+  }
+
+  d->textEncoding = String::Type(data[0]);
+  d->language = data.mid(1, 3);
+
+  int byteAlign
+    = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
+
+  ByteVectorList l =
+    ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2);
+
+  if(l.size() == 2) {
+    d->description = String(l.front(), d->textEncoding);
+    d->text = String(l.back(), d->textEncoding);
+  }
+}
+
+ByteVector UnsynchronizedLyricsFrame::renderFields() const
+{
+  ByteVector v;
+
+  v.append(char(d->textEncoding));
+  v.append(d->language.size() == 3 ? d->language : "XXX");
+  v.append(d->description.data(d->textEncoding));
+  v.append(textDelimiter(d->textEncoding));
+  v.append(d->text.data(d->textEncoding));
+
+  return v;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+UnsynchronizedLyricsFrame::UnsynchronizedLyricsFrame(const ByteVector &data, Header *h)
+  : Frame(h)
+{
+  d = new UnsynchronizedLyricsFramePrivate();
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.h
new file mode 100644
index 0000000..28cc1e8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.h
@@ -0,0 +1,157 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Urs Fleisch
+    email                : ufleisch at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it  under the terms of the GNU Lesser General Public License version  *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H
+#define TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H
+
+#include <id3v2frame.h>
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! ID3v2 unsynchronized lyrics frame
+    /*!
+     * An implementation of ID3v2 unsynchronized lyrics.
+     */
+    class TAGLIB_EXPORT UnsynchronizedLyricsFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Construct an empty unsynchronized lyrics frame that will use the text encoding
+       * \a encoding.
+       */
+      explicit UnsynchronizedLyricsFrame(String::Type encoding = String::Latin1);
+
+      /*!
+       * Construct a unsynchronized lyrics frame based on the data in \a data.
+       */
+      explicit UnsynchronizedLyricsFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this UnsynchronizedLyricsFrame instance.
+       */
+      virtual ~UnsynchronizedLyricsFrame();
+
+      /*!
+       * Returns the text of this unsynchronized lyrics frame.
+       *
+       * \see text()
+       */
+      virtual String toString() const;
+
+      /*!
+       * Returns the language encoding as a 3 byte encoding as specified by
+       * <a href="http://en.wikipedia.org/wiki/ISO_639">ISO-639-2</a>.
+       *
+       * \note Most taggers simply ignore this value.
+       *
+       * \see setLanguage()
+       */
+      ByteVector language() const;
+
+      /*!
+       * Returns the description of this unsynchronized lyrics frame.
+       *
+       * \note Most taggers simply ignore this value.
+       *
+       * \see setDescription()
+       */
+      String description() const;
+
+      /*!
+       * Returns the text of this unsynchronized lyrics frame.
+       *
+       * \see setText()
+       */
+      String text() const;
+
+      /*!
+       * Set the language using the 3 byte language code from
+       * <a href="http://en.wikipedia.org/wiki/ISO_639">ISO-639-2</a> to
+       * \a languageCode.
+       *
+       * \see language()
+       */
+      void setLanguage(const ByteVector &languageCode);
+
+      /*!
+       * Sets the description of the unsynchronized lyrics frame to \a s.
+       *
+       * \see decription()
+       */
+      void setDescription(const String &s);
+
+      /*!
+       * Sets the text portion of the unsynchronized lyrics frame to \a s.
+       *
+       * \see text()
+       */
+      virtual void setText(const String &s);
+
+      /*!
+       * Returns the text encoding that will be used in rendering this frame.
+       * This defaults to the type that was either specified in the constructor
+       * or read from the frame when parsed.
+       *
+       * \see setTextEncoding()
+       * \see render()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Sets the text encoding to be used when rendering this frame to
+       * \a encoding.
+       *
+       * \see textEncoding()
+       * \see render()
+       */
+      void setTextEncoding(String::Type encoding);
+
+    protected:
+      // Reimplementations.
+
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+    private:
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      UnsynchronizedLyricsFrame(const ByteVector &data, Header *h);
+      UnsynchronizedLyricsFrame(const UnsynchronizedLyricsFrame &);
+      UnsynchronizedLyricsFrame &operator=(const UnsynchronizedLyricsFrame &);
+
+      class UnsynchronizedLyricsFramePrivate;
+      UnsynchronizedLyricsFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.cpp b/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.cpp
new file mode 100644
index 0000000..25bdd18
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.cpp
@@ -0,0 +1,192 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Urs Fleisch
+    email                : ufleisch at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "urllinkframe.h"
+#include <tdebug.h>
+#include <tstringlist.h>
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class UrlLinkFrame::UrlLinkFramePrivate
+{
+public:
+  String url;
+};
+
+class UserUrlLinkFrame::UserUrlLinkFramePrivate
+{
+public:
+  UserUrlLinkFramePrivate() : textEncoding(String::Latin1) {}
+  String::Type textEncoding;
+  String description;
+};
+
+UrlLinkFrame::UrlLinkFrame(const ByteVector &data) :
+  Frame(data)
+{
+  d = new UrlLinkFramePrivate;
+  setData(data);
+}
+
+UrlLinkFrame::~UrlLinkFrame()
+{
+  delete d;
+}
+
+void UrlLinkFrame::setUrl(const String &s)
+{
+  d->url = s;
+}
+
+String UrlLinkFrame::url() const
+{
+  return d->url;
+}
+
+void UrlLinkFrame::setText(const String &s)
+{
+  setUrl(s);
+}
+
+String UrlLinkFrame::toString() const
+{
+  return url();
+}
+
+void UrlLinkFrame::parseFields(const ByteVector &data)
+{
+  d->url = String(data);
+}
+
+ByteVector UrlLinkFrame::renderFields() const
+{
+  return d->url.data(String::Latin1);
+}
+
+UrlLinkFrame::UrlLinkFrame(const ByteVector &data, Header *h) : Frame(h)
+{
+  d = new UrlLinkFramePrivate;
+  parseFields(fieldData(data));
+}
+
+
+UserUrlLinkFrame::UserUrlLinkFrame(String::Type encoding) :
+  UrlLinkFrame("WXXX")
+{
+  d = new UserUrlLinkFramePrivate;
+  d->textEncoding = encoding;
+}
+
+UserUrlLinkFrame::UserUrlLinkFrame(const ByteVector &data) :
+  UrlLinkFrame(data)
+{
+  d = new UserUrlLinkFramePrivate;
+  setData(data);
+}
+
+UserUrlLinkFrame::~UserUrlLinkFrame()
+{
+  delete d;
+}
+
+String UserUrlLinkFrame::toString() const
+{
+  return "[" + description() + "] " + url();
+}
+
+String::Type UserUrlLinkFrame::textEncoding() const
+{
+  return d->textEncoding;
+}
+
+void UserUrlLinkFrame::setTextEncoding(String::Type encoding)
+{
+  d->textEncoding = encoding;
+}
+
+String UserUrlLinkFrame::description() const
+{
+  return d->description;
+}
+
+void UserUrlLinkFrame::setDescription(const String &s)
+{
+  d->description = s;
+}
+
+void UserUrlLinkFrame::parseFields(const ByteVector &data)
+{
+  if(data.size() < 2) {
+    debug("A user URL link frame must contain at least 2 bytes.");
+    return;
+  }
+
+  int pos = 0;
+
+  d->textEncoding = String::Type(data[0]);
+  pos += 1;
+
+  if(d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8) {
+    int offset = data.find(textDelimiter(d->textEncoding), pos);
+    if(offset < pos)
+      return;
+
+    d->description = String(data.mid(pos, offset - pos), d->textEncoding);
+    pos = offset + 1;
+  }
+  else {
+    int len = data.mid(pos).find(textDelimiter(d->textEncoding), 0, 2);
+    if(len < 0)
+      return;
+
+    d->description = String(data.mid(pos, len), d->textEncoding);
+    pos += len + 2;
+  }
+
+  setUrl(String(data.mid(pos)));
+}
+
+ByteVector UserUrlLinkFrame::renderFields() const
+{
+  ByteVector v;
+
+  String::Type encoding = checkEncoding(d->description, d->textEncoding);
+
+  v.append(char(encoding));
+  v.append(d->description.data(encoding));
+  v.append(textDelimiter(encoding));
+  v.append(url().data(String::Latin1));
+
+  return v;
+}
+
+UserUrlLinkFrame::UserUrlLinkFrame(const ByteVector &data, Header *h) : UrlLinkFrame(data, h)
+{
+  d = new UserUrlLinkFramePrivate;
+  parseFields(fieldData(data));
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.h b/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.h
new file mode 100644
index 0000000..649f85d
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/frames/urllinkframe.h
@@ -0,0 +1,172 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+    copyright            : (C) 2006 by Urs Fleisch
+    email                : ufleisch at users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_URLLINKFRAME_H
+#define TAGLIB_URLLINKFRAME_H
+
+#include <id3v2frame.h>
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! ID3v2 URL frame
+    /*!
+     * An implementation of ID3v2 URL link frames.
+     */
+    class TAGLIB_EXPORT UrlLinkFrame : public Frame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * This is a dual purpose constructor.  \a data can either be binary data
+       * that should be parsed or (at a minimum) the frame ID.
+       */
+      explicit UrlLinkFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this UrlLinkFrame instance.
+       */
+      virtual ~UrlLinkFrame();
+
+      /*!
+       * Returns the URL.
+       */
+      virtual String url() const;
+
+      /*!
+       * Sets the URL to \a s.
+       */
+      virtual void setUrl(const String &s);
+
+      // Reimplementations.
+
+      virtual void setText(const String &s);
+      virtual String toString() const;
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      UrlLinkFrame(const ByteVector &data, Header *h);
+
+    private:
+      UrlLinkFrame(const UrlLinkFrame &);
+      UrlLinkFrame &operator=(const UrlLinkFrame &);
+
+      class UrlLinkFramePrivate;
+      UrlLinkFramePrivate *d;
+    };
+
+    //! ID3v2 User defined URL frame
+
+    /*!
+     * This is a specialization of URL link frames that allows for
+     * user defined entries.  Each entry has a description in addition to the
+     * normal list of fields that a URL link frame has.
+     *
+     * This description identifies the frame and must be unique.
+     */
+    class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
+    {
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Constructs an empty user defined URL link frame.  For this to be
+       * a useful frame both a description and text must be set.
+       */
+      explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
+
+      /*!
+       * This is a dual purpose constructor.  \a data can either be binary data
+       * that should be parsed or (at a minimum) the frame ID.
+       */
+      explicit UserUrlLinkFrame(const ByteVector &data);
+
+      /*!
+       * Destroys this UserUrlLinkFrame instance.
+       */
+      virtual ~UserUrlLinkFrame();
+
+      // Reimplementations.
+
+      virtual String toString() const;
+
+      /*!
+       * Returns the text encoding that will be used in rendering this frame.
+       * This defaults to the type that was either specified in the constructor
+       * or read from the frame when parsed.
+       *
+       * \see setTextEncoding()
+       * \see render()
+       */
+      String::Type textEncoding() const;
+
+      /*!
+       * Sets the text encoding to be used when rendering this frame to
+       * \a encoding.
+       *
+       * \see textEncoding()
+       * \see render()
+       */
+      void setTextEncoding(String::Type encoding);
+
+      /*!
+       * Returns the description for this frame.
+       */
+      String description() const;
+
+      /*!
+       * Sets the description of the frame to \a s.  \a s must be unique.
+       */
+      void setDescription(const String &s);
+
+    protected:
+      virtual void parseFields(const ByteVector &data);
+      virtual ByteVector renderFields() const;
+
+      /*!
+       * The constructor used by the FrameFactory.
+       */
+      UserUrlLinkFrame(const ByteVector &data, Header *h);
+
+    private:
+      UserUrlLinkFrame(const UserUrlLinkFrame &);
+      UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
+
+      class UserUrlLinkFramePrivate;
+      UserUrlLinkFramePrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2.2.0.txt b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.2.0.txt
new file mode 100644
index 0000000..a69bddd
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.2.0.txt
@@ -0,0 +1,1660 @@
+
+Informal standard                                             M. Nilsson
+Document: id3v2-00.txt                                   26th March 1998
+
+
+                            ID3 tag version 2
+
+Status of this document
+
+   This document is an Informal standard and is released so that
+   implementors could have a set standard before the formal standard is
+   set. The formal standard will use another version number if not
+   identical to what is described in this document. The contents in this
+   document may change for clarifications but never for added or altered
+   functionallity.
+
+   Distribution of this document is unlimited.
+
+
+Abstract
+
+   The recent gain of popularity for MPEG layer III audio files on the
+   internet forced a standardised way of storing information about an
+   audio file within itself to determinate its origin and contents.
+
+   Today the most accepted way to do this is with the so called ID3 tag,
+   which is simple but very limited and in some cases very unsuitable.
+   The ID3 tag has very limited space in every field, very limited
+   numbers of fields, not expandable or upgradeable and is placed at the
+   end of a the file, which is unsuitable for streaming audio. This draft
+   is an attempt to answer these issues with a new version of the ID3
+   tag.
+
+
+1.   Table of contents
+
+   2.   Conventions in this document
+   3.   ID3v2 overview
+     3.1.   ID3v2 header
+     3.2.   ID3v2 frames overview
+   4.   Declared ID3v2 frames
+     4.1.   Unique file identifier
+     4.2.   Text information frames
+       4.2.1.   Text information frames - details
+       4.2.2.   User defined text information frame
+     4.3.   URL link frames
+       4.3.1.   URL link frames - details
+       4.3.2.   User defined URL link frame
+     4.4.   Involved people list
+     4.5.   Music CD Identifier
+     4.6.   Event timing codes
+     4.7.   MPEG location lookup table
+     4.8.   Synced tempo codes
+     4.9.   Unsychronised lyrics/text transcription
+     4.10.  Synchronised lyrics/text
+     4.11.  Comments
+     4.12.  Relative volume adjustment
+     4.13.  Equalisation
+     4.14.  Reverb
+     4.15.  Attached picture
+     4.16.  General encapsulated object
+     4.17.  Play counter
+     4.18.  Popularimeter
+     4.19.  Recommended buffer size
+     4.20.  Encrypted meta frame
+     4.21.  Audio encryption
+     4.22.  Linked information
+   5.   The 'unsynchronisation scheme'
+   6.   Copyright
+   7.   References
+   8.   Appendix
+     A.   Appendix A - ID3-Tag Specification V1.1
+       A.1.   Overview
+       A.2.   ID3v1 Implementation
+       A.3.   Genre List
+       A.4.   Track addition - ID3v1.1
+   9.   Author's Address
+
+
+2.   Conventions in this document
+
+   In the examples, text within "" is a text string exactly as it appears
+   in a file. Numbers preceded with $ are hexadecimal and numbers
+   preceded with % are binary. $xx is used to indicate a byte with
+   unknown content. %x is used to indicate a bit with unknown content.
+   The most significant bit (MSB) of a byte is called 'bit 7' and the
+   least significant bit (LSB) is called 'bit 0'.
+
+   A tag is the whole tag described in this document. A frame is a block
+   of information in the tag. The tag consists of a header, frames and
+   optional padding. A field is a piece of information; one value, a
+   string etc. A numeric string is a string that consists of the
+   characters 0-9 only.
+
+
+3.   ID3v2 overview
+
+   The two biggest design goals were to be able to implement ID3v2
+   without disturbing old software too much and that ID3v2 should be
+   expandable.
+
+   The first criterion is met by the simple fact that the MPEG [MPEG]
+   decoding software uses a syncsignal, embedded in the audiostream, to
+   'lock on to' the audio. Since the ID3v2 tag doesn't contain a valid
+   syncsignal, no software will attempt to play the tag. If, for any
+   reason, coincidence make a syncsignal appear within the tag it will be
+   taken care of by the 'unsynchronisation scheme' described in section
+   5.
+
+   The second criterion has made a more noticeable impact on the design
+   of the ID3v2 tag. It is constructed as a container for several
+   information blocks, called frames, whose format need not be known to
+   the software that encounters them. At the start of every frame there
+   is an identifier that explains the frames's format and content, and a
+   size descriptor that allows software to skip unknown frames.
+
+   If a total revision of the ID3v2 tag should be needed, there is a
+   version number and a size descriptor in the ID3v2 header.
+
+   The ID3 tag described in this document is mainly targeted to files
+   encoded with MPEG-2 layer I, MPEG-2 layer II, MPEG-2 layer III and
+   MPEG-2.5, but may work with other types of encoded audio.
+
+   The bitorder in ID3v2 is most significant bit first (MSB). The
+   byteorder in multibyte numbers is most significant byte first (e.g.
+   $12345678 would be encoded $12 34 56 78).
+
+   It is permitted to include padding after all the final frame (at the
+   end of the ID3 tag), making the size of all the frames together
+   smaller than the size given in the head of the tag. A possible purpose
+   of this padding is to allow for adding a few additional frames or
+   enlarge existing frames within the tag without having to rewrite the
+   entire file. The value of the padding bytes must be $00.
+
+
+3.1.   ID3v2 header
+
+   The ID3v2 tag header, which should be the first information in the
+   file, is 10 bytes as follows:
+
+     ID3/file identifier      "ID3"
+     ID3 version              $02 00
+     ID3 flags                %xx000000
+     ID3 size             4 * %0xxxxxxx
+
+   The first three bytes of the tag are always "ID3" to indicate that
+   this is an ID3 tag, directly followed by the two version bytes. The
+   first byte of ID3 version is it's major version, while the second byte
+   is its revision number. All revisions are backwards compatible while
+   major versions are not. If software with ID3v2 and below support
+   should encounter version three or higher it should simply ignore the
+   whole tag. Version and revision will never be $FF.
+
+   The first bit (bit 7) in the 'ID3 flags' is indicating whether or not
+   unsynchronisation is used (see section 5 for details); a set bit
+   indicates usage.
+
+   The second bit (bit 6) is indicating whether or not compression is
+   used; a set bit indicates usage. Since no compression scheme has been
+   decided yet, the ID3 decoder (for now) should just ignore the entire
+   tag if the compression bit is set.
+
+   The ID3 tag size is encoded with four bytes where the first bit (bit
+   7) is set to zero in every byte, making a total of 28 bits. The zeroed
+   bits are ignored, so a 257 bytes long tag is represented as $00 00 02
+   01.
+
+   The ID3 tag size is the size of the complete tag after
+   unsychronisation, including padding, excluding the header (total tag
+   size - 10). The reason to use 28 bits (representing up to 256MB) for
+   size description is that we don't want to run out of space here.
+
+   A ID3v2 tag can be detected with the following pattern:
+     $49 44 33 yy yy xx zz zz zz zz
+   Where yy is less than $FF, xx is the 'flags' byte and zz is less than
+   $80.
+
+
+3.2.   ID3v2 frames overview
+
+   The headers of the frames are similar in their construction. They
+   consist of one three character identifier (capital A-Z and 0-9) and
+   one three byte size field, making a total of six bytes. The header is
+   excluded from the size. Identifiers beginning with "X", "Y" and "Z"
+   are for experimental use and free for everyone to use. Have in mind
+   that someone else might have used the same identifier as you. All
+   other identifiers are either used or reserved for future use.
+
+   The three character frame identifier is followed by a three byte size
+   descriptor, making a total header size of six bytes in every frame.
+   The size is calculated as framesize excluding frame identifier and
+   size descriptor (frame size - 6).
+
+   There is no fixed order of the frames' appearance in the tag, although
+   it is desired that the frames are arranged in order of significance
+   concerning the recognition of the file. An example of such order:
+   UFI, MCI, TT2 ...
+
+   A tag must contain at least one frame. A frame must be at least 1 byte
+   big, excluding the 6-byte header.
+
+   If nothing else is said a string is represented as ISO-8859-1
+   [ISO-8859-1] characters in the range $20 - $FF. All unicode strings
+   [UNICODE] use 16-bit unicode 2.0 (ISO/IEC 10646-1:1993, UCS-2). All
+   numeric strings are always encoded as ISO-8859-1. Terminated strings
+   are terminated with $00 if encoded with ISO-8859-1 and $00 00 if
+   encoded as unicode. If nothing else is said newline character is
+   forbidden. In ISO-8859-1 a new line is represented, when allowed, with
+   $0A only. Frames that allow different types of text encoding have a
+   text encoding description byte directly after the frame size. If
+   ISO-8859-1 is used this byte should be $00, if unicode is used it
+   should be $01.
+
+   The three byte language field is used to describe the language of the
+   frame's content, according to ISO-639-2 [ISO-639-2].
+
+   All URLs [URL] may be relative, e.g. "picture.png", "../doc.txt".
+
+   If a frame is longer than it should be, e.g. having more fields than
+   specified in this document, that indicates that additions to the
+   frame have been made in a later version of the ID3 standard. This
+   is reflected by the revision number in the header of the tag.
+
+
+4.   Declared ID3v2 frames
+
+   The following frames are declared in this draft.
+
+   4.19  BUF Recommended buffer size
+
+   4.17  CNT Play counter
+   4.11  COM Comments
+   4.21  CRA Audio encryption
+   4.20  CRM Encrypted meta frame
+
+   4.6   ETC Event timing codes
+   4.13  EQU Equalization
+
+   4.16  GEO General encapsulated object
+
+   4.4   IPL Involved people list
+
+   4.22  LNK Linked information
+
+   4.5   MCI Music CD Identifier
+   4.7   MLL MPEG location lookup table
+
+   4.15  PIC Attached picture
+   4.18  POP Popularimeter
+
+   4.14  REV Reverb
+   4.12  RVA Relative volume adjustment
+
+   4.10  SLT Synchronized lyric/text
+   4.8   STC Synced tempo codes
+
+   4.2.1 TAL Album/Movie/Show title
+   4.2.1 TBP BPM (Beats Per Minute)
+   4.2.1 TCM Composer
+   4.2.1 TCO Content type
+   4.2.1 TCR Copyright message
+   4.2.1 TDA Date
+   4.2.1 TDY Playlist delay
+   4.2.1 TEN Encoded by
+   4.2.1 TFT File type
+   4.2.1 TIM Time
+   4.2.1 TKE Initial key
+   4.2.1 TLA Language(s)
+   4.2.1 TLE Length
+   4.2.1 TMT Media type
+   4.2.1 TOA Original artist(s)/performer(s)
+   4.2.1 TOF Original filename
+   4.2.1 TOL Original Lyricist(s)/text writer(s)
+   4.2.1 TOR Original release year
+   4.2.1 TOT Original album/Movie/Show title
+   4.2.1 TP1 Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group
+   4.2.1 TP2 Band/Orchestra/Accompaniment
+   4.2.1 TP3 Conductor/Performer refinement
+   4.2.1 TP4 Interpreted, remixed, or otherwise modified by
+   4.2.1 TPA Part of a set
+   4.2.1 TPB Publisher
+   4.2.1 TRC ISRC (International Standard Recording Code)
+   4.2.1 TRD Recording dates
+   4.2.1 TRK Track number/Position in set
+   4.2.1 TSI Size
+   4.2.1 TSS Software/hardware and settings used for encoding
+   4.2.1 TT1 Content group description
+   4.2.1 TT2 Title/Songname/Content description
+   4.2.1 TT3 Subtitle/Description refinement
+   4.2.1 TXT Lyricist/text writer
+   4.2.2 TXX User defined text information frame
+   4.2.1 TYE Year
+
+   4.1   UFI Unique file identifier
+   4.9   ULT Unsychronized lyric/text transcription
+
+   4.3.1 WAF Official audio file webpage
+   4.3.1 WAR Official artist/performer webpage
+   4.3.1 WAS Official audio source webpage
+   4.3.1 WCM Commercial information
+   4.3.1 WCP Copyright/Legal information
+   4.3.1 WPB Publishers official webpage
+   4.3.2 WXX User defined URL link frame
+
+
+4.1.   Unique file identifier
+
+   This frame's purpose is to be able to identify the audio file in a
+   database that may contain more information relevant to the content.
+   Since standardisation of such a database is beyond this document, all
+   frames begin with a null-terminated string with a URL [URL] containing
+   an email address, or a link to a location where an email address can
+   be found, that belongs to the organisation responsible for this
+   specific database implementation. Questions regarding the database
+   should be sent to the indicated email address. The URL should not be
+   used for the actual database queries. If a $00 is found directly after
+   the 'Frame size' the whole frame should be ignored, and preferably be
+   removed. The 'Owner identifier' is then followed by the actual
+   identifier, which may be up to 64 bytes. There may be more than one
+   "UFI" frame in a tag, but only one with the same 'Owner identifier'.
+
+     Unique file identifier  "UFI"
+     Frame size              $xx xx xx
+     Owner identifier        <textstring> $00
+     Identifier              <up to 64 bytes binary data>
+
+
+4.2.   Text information frames
+
+   The text information frames are the most important frames, containing
+   information like artist, album and more. There may only be one text
+   information frame of its kind in an tag. If the textstring is followed
+   by a termination ($00 (00)) all the following information should be
+   ignored and not be displayed. All the text information frames have the
+   following format:
+
+     Text information identifier  "T00" - "TZZ" , excluding "TXX",
+                                   described in 4.2.2.
+     Frame size                   $xx xx xx
+     Text encoding                $xx
+     Information                  <textstring>
+
+
+4.2.1.   Text information frames - details
+
+  TT1
+   The 'Content group description' frame is used if the sound belongs to
+   a larger category of sounds/music. For example, classical music is
+   often sorted in different musical sections (e.g. "Piano Concerto",
+   "Weather - Hurricane").
+
+  TT2
+   The 'Title/Songname/Content description' frame is the actual name of
+   the piece (e.g. "Adagio", "Hurricane Donna").
+
+  TT3
+   The 'Subtitle/Description refinement' frame is used for information
+   directly related to the contents title (e.g. "Op. 16" or "Performed
+   live at wembley").
+
+  TP1
+   The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is
+   used for the main artist(s). They are seperated with the "/"
+   character.
+
+  TP2
+   The 'Band/Orchestra/Accompaniment' frame is used for additional
+   information about the performers in the recording.
+
+  TP3
+   The 'Conductor' frame is used for the name of the conductor.
+   
+  TP4
+   The 'Interpreted, remixed, or otherwise modified by' frame contains
+   more information about the people behind a remix and similar
+   interpretations of another existing piece.
+
+  TCM
+   The 'Composer(s)' frame is intended for the name of the composer(s).
+   They are seperated with the "/" character.
+
+  TXT
+   The 'Lyricist(s)/text writer(s)' frame is intended for the writer(s)
+   of the text or lyrics in the recording. They are seperated with the
+   "/" character.
+
+  TLA
+   The 'Language(s)' frame should contain the languages of the text or
+   lyrics in the audio file. The language is represented with three
+   characters according to ISO-639-2. If more than one language is used
+   in the text their language codes should follow according to their
+   usage.
+
+  TCO
+   The content type, which previously (in ID3v1.1, see appendix A) was
+   stored as a one byte numeric value only, is now a numeric string. You
+   may use one or several of the types as ID3v1.1 did or, since the
+   category list would be impossible to maintain with accurate and up to
+   date categories, define your own.
+   References to the ID3v1 genres can be made by, as first byte, enter
+   "(" followed by a number from the genres list (section A.3.) and
+   ended with a ")" character. This is optionally followed by a
+   refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be
+   made in the same frame, e.g. "(51)(39)". If the refinement should
+   begin with a "(" character it should be replaced with "((", e.g. "((I
+   can figure out any genre)" or "(55)((I think...)". The following new
+   content types is defined in ID3v2 and is implemented in the same way
+   as the numerig content types, e.g. "(RX)".
+   
+     RX  Remix
+     CR  Cover
+
+  TAL
+   The 'Album/Movie/Show title' frame is intended for the title of the
+   recording(/source of sound) which the audio in the file is taken from.
+   
+  TPA
+   The 'Part of a set' frame is a numeric string that describes which
+   part of a set the audio came from. This frame is used if the source
+   described in the "TAL" frame is divided into several mediums, e.g. a
+   double CD. The value may be extended with a "/" character and a
+   numeric string containing the total number of parts in the set. E.g.
+   "1/2".
+
+  TRK
+   The 'Track number/Position in set' frame is a numeric string
+   containing the order number of the audio-file on its original
+   recording. This may be extended with a "/" character and a numeric
+   string containing the total numer of tracks/elements on the original
+   recording. E.g. "4/9".
+
+  TRC
+   The 'ISRC' frame should contian the International Standard Recording
+   Code [ISRC].
+
+  TYE
+   The 'Year' frame is a numeric string with a year of the recording.
+   This frames is always four characters long (until the year 10000).
+
+  TDA
+   The 'Date' frame is a numeric string in the DDMM format containing
+   the date for the recording. This field is always four characters
+   long.
+
+  TIM
+   The 'Time' frame is a numeric string in the HHMM format containing
+   the time for the recording. This field is always four characters
+   long.
+   
+  TRD
+   The 'Recording dates' frame is a intended to be used as complement to
+   the "TYE", "TDA" and "TIM" frames. E.g. "4th-7th June, 12th June" in
+   combination with the "TYE" frame.
+
+  TMT
+   The 'Media type' frame describes from which media the sound
+   originated. This may be a textstring or a reference to the predefined
+   media types found in the list below. References are made within "("
+   and ")" and are optionally followed by a text refinement, e.g. "(MC)
+   with four channels". If a text refinement should begin with a "("
+   character it should be replaced with "((" in the same way as in the
+   "TCO" frame. Predefined refinements is appended after the media type,
+   e.g. "(CD/S)" or "(VID/PAL/VHS)".
+
+    DIG    Other digital media
+      /A    Analog transfer from media
+
+    ANA    Other analog media
+      /WAC  Wax cylinder
+      /8CA  8-track tape cassette
+
+    CD     CD
+      /A    Analog transfer from media
+      /DD   DDD
+      /AD   ADD
+      /AA   AAD
+
+    LD     Laserdisc
+      /A     Analog transfer from media
+
+    TT     Turntable records
+      /33    33.33 rpm
+      /45    45 rpm
+      /71    71.29 rpm
+      /76    76.59 rpm
+      /78    78.26 rpm
+      /80    80 rpm
+     
+    MD     MiniDisc
+      /A    Analog transfer from media
+     
+    DAT    DAT
+      /A    Analog transfer from media
+      /1    standard, 48 kHz/16 bits, linear
+      /2    mode 2, 32 kHz/16 bits, linear
+      /3    mode 3, 32 kHz/12 bits, nonlinear, low speed
+      /4    mode 4, 32 kHz/12 bits, 4 channels
+      /5    mode 5, 44.1 kHz/16 bits, linear
+      /6    mode 6, 44.1 kHz/16 bits, 'wide track' play
+     
+    DCC    DCC
+      /A    Analog transfer from media
+    
+    DVD    DVD
+      /A    Analog transfer from media
+    
+    TV     Television
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+    
+    VID    Video
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+      /VHS    VHS
+      /SVHS   S-VHS
+      /BETA   BETAMAX
+    
+    RAD    Radio
+      /FM   FM
+      /AM   AM
+      /LW   LW
+      /MW   MW
+    
+    TEL    Telephone
+      /I    ISDN
+    
+    MC     MC (normal cassette)
+      /4    4.75 cm/s (normal speed for a two sided cassette)
+      /9    9.5 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+    
+    REE    Reel
+      /9    9.5 cm/s
+      /19   19 cm/s
+      /38   38 cm/s
+      /76   76 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+
+  TFT
+   The 'File type' frame indicates which type of audio this tag defines.
+   The following type and refinements are defined:
+   
+     MPG    MPEG Audio
+       /1     MPEG 2 layer I
+       /2     MPEG 2 layer II
+       /3     MPEG 2 layer III
+       /2.5   MPEG 2.5
+       /AAC   Advanced audio compression
+     
+   but other types may be used, not for these types though. This is used
+   in a similar way to the predefined types in the "TMT" frame, but
+   without parenthesis. If this frame is not present audio type is
+   assumed to be "MPG".
+
+  TBP
+   BPM is short for beats per minute, and is easily computed by
+   dividing the number of beats in a musical piece with its length. To
+   get a more accurate result, do the BPM calculation on the main-part
+   only. To acquire best result measure the time between each beat and
+   calculate individual BPM for each beat and use the median value as
+   result. BPM is an integer and represented as a numerical string.
+
+  TCR
+   The 'Copyright message' frame, which must begin with a year and a
+   space character (making five characters), is intended for the
+   copyright holder of the original sound, not the audio file itself. The
+   absence of this frame means only that the copyright information is
+   unavailable or has been removed, and must not be interpreted to mean
+   that the sound is public domain. Every time this field is displayed
+   the field must be preceded with "Copyright " (C) " ", where (C) is one
+   character showing a C in a circle.
+
+  TPB
+   The 'Publisher' frame simply contains the name of the label or
+   publisher.
+
+  TEN
+   The 'Encoded by' frame contains the name of the person or
+   organisation that encoded the audio file. This field may contain a
+   copyright message, if the audio file also is copyrighted by the
+   encoder.
+
+  TSS
+   The 'Software/hardware and settings used for encoding' frame
+   includes the used audio encoder and its settings when the file was
+   encoded. Hardware refers to hardware encoders, not the computer on
+   which a program was run.
+
+  TOF
+   The 'Original filename' frame contains the preferred filename for the
+   file, since some media doesn't allow the desired length of the
+   filename. The filename is case sensitive and includes its suffix.
+
+  TLE
+   The 'Length' frame contains the length of the audiofile in
+   milliseconds, represented as a numeric string.
+
+  TSI
+   The 'Size' frame contains the size of the audiofile in bytes
+   excluding the tag, represented as a numeric string.
+
+  TDY
+   The 'Playlist delay' defines the numbers of milliseconds of silence
+   between every song in a playlist. The player should use the "ETC"
+   frame, if present, to skip initial silence and silence at the end of
+   the audio to match the 'Playlist delay' time. The time is represented
+   as a numeric string.
+
+  TKE
+   The 'Initial key' frame contains the musical key in which the sound
+   starts. It is represented as a string with a maximum length of three
+   characters. The ground keys are represented with "A","B","C","D","E",
+   "F" and "G" and halfkeys represented with "b" and "#". Minor is
+   represented as "m". Example "Cbm". Off key is represented with an "o"
+   only.
+
+  TOT
+   The 'Original album/Movie/Show title' frame is intended for the title
+   of the original recording(/source of sound), if for example the music
+   in the file should be a cover of a previously released song.
+   
+  TOA
+   The 'Original artist(s)/performer(s)' frame is intended for the
+   performer(s) of the original recording, if for example the music in
+   the file should be a cover of a previously released song. The
+   performers are seperated with the "/" character.
+
+  TOL
+   The 'Original Lyricist(s)/text writer(s)' frame is intended for the
+   text writer(s) of the original recording, if for example the music in
+   the file should be a cover of a previously released song. The text
+   writers are seperated with the "/" character.
+
+  TOR
+   The 'Original release year' frame is intended for the year when the
+   original recording, if for example the music in the file should be a
+   cover of a previously released song, was released. The field is
+   formatted as in the "TDY" frame.
+
+
+4.2.2.   User defined text information frame
+
+   This frame is intended for one-string text information concerning the
+   audiofile in a similar way to the other "T"xx frames. The frame body
+   consists of a description of the string, represented as a terminated
+   string, followed by the actual string. There may be more than one
+   "TXX" frame in each tag, but only one with the same description.
+
+     User defined...   "TXX"
+     Frame size        $xx xx xx
+     Text encoding     $xx
+     Description       <textstring> $00 (00)
+     Value             <textstring>
+
+
+4.3.   URL link frames
+
+   With these frames dynamic data such as webpages with touring
+   information, price information or plain ordinary news can be added to
+   the tag. There may only be one URL [URL] link frame of its kind in an
+   tag, except when stated otherwise in the frame description. If the
+   textstring is followed by a termination ($00 (00)) all the following
+   information should be ignored and not be displayed. All URL link
+   frames have the following format:
+
+     URL link frame   "W00" - "WZZ" , excluding "WXX" 
+                                      (described in 4.3.2.)
+     Frame size       $xx xx xx
+     URL              <textstring>
+
+
+4.3.1.   URL link frames - details
+
+  WAF
+   The 'Official audio file webpage' frame is a URL pointing at a file
+   specific webpage.
+   
+  WAR
+   The 'Official artist/performer webpage' frame is a URL pointing at
+   the artists official webpage. There may be more than one "WAR" frame
+   in a tag if the audio contains more than one performer.
+   
+  WAS
+   The 'Official audio source webpage' frame is a URL pointing at the
+   official webpage for the source of the audio file, e.g. a movie.
+   
+  WCM
+   The 'Commercial information' frame is a URL pointing at a webpage
+   with information such as where the album can be bought. There may be
+   more than one "WCM" frame in a tag.
+   
+  WCP
+   The 'Copyright/Legal information' frame is a URL pointing at a
+   webpage where the terms of use and ownership of the file is described.
+   
+  WPB
+   The 'Publishers official webpage' frame is a URL pointing at the
+   official wepage for the publisher.
+
+
+4.3.2.   User defined URL link frame
+
+   This frame is intended for URL [URL] links concerning the audiofile in
+   a similar way to the other "W"xx frames. The frame body consists of a
+   description of the string, represented as a terminated string,
+   followed by the actual URL. The URL is always encoded with ISO-8859-1
+   [ISO-8859-1]. There may be more than one "WXX" frame in each tag, but
+   only one with the same description.
+
+     User defined...   "WXX"
+     Frame size        $xx xx xx
+     Text encoding     $xx
+     Description       <textstring> $00 (00)
+     URL               <textstring>
+
+
+4.4.   Involved people list
+
+   Since there might be a lot of people contributing to an audio file in
+   various ways, such as musicians and technicians, the 'Text
+   information frames' are often insufficient to list everyone involved
+   in a project. The 'Involved people list' is a frame containing the
+   names of those involved, and how they were involved. The body simply
+   contains a terminated string with the involvement directly followed by
+   a terminated string with the involvee followed by a new involvement
+   and so on. There may only be one "IPL" frame in each tag.
+
+     Involved people list   "IPL"
+     Frame size             $xx xx xx
+     Text encoding          $xx
+     People list strings    <textstrings>
+
+
+4.5.   Music CD Identifier
+
+   This frame is intended for music that comes from a CD, so that the CD
+   can be identified in databases such as the CDDB [CDDB]. The frame
+   consists of a binary dump of the Table Of Contents, TOC,  from the CD,
+   which is a header of 4 bytes and then 8 bytes/track on the CD making a
+   maximum of 804 bytes. This frame requires a present and valid "TRK"
+   frame. There may only be one "MCI" frame in each tag.
+
+     Music CD identifier   "MCI"
+     Frame size            $xx xx xx
+     CD TOC                <binary data>
+
+
+4.6.   Event timing codes
+
+   This frame allows synchronisation with key events in a song or sound.
+   The head is:
+
+     Event timing codes   "ETC"
+     Frame size           $xx xx xx
+     Time stamp format    $xx
+     
+   Where time stamp format is:
+     
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   Followed by a list of key events in the following format:
+
+     Type of event   $xx
+     Time stamp      $xx (xx ...)
+
+   The 'Time stamp' is set to zero if directly at the beginning of the
+   sound or after the previous event. All events should be sorted in
+   chronological order. The type of event is as follows:
+
+     $00  padding (has no meaning)
+     $01  end of initial silence
+     $02  intro start
+     $03  mainpart start
+     $04  outro start
+     $05  outro end
+     $06  verse begins
+     $07  refrain begins
+     $08  interlude
+     $09  theme start
+     $0A  variation
+     $0B  key change
+     $0C  time change
+     $0D  unwanted noise (Snap, Crackle & Pop)
+
+     $0E-$DF  reserved for future use
+
+     $E0-$EF  not predefined sync 0-F
+
+     $F0-$FC  reserved for future use
+
+     $FD  audio end (start of silence)
+     $FE  audio file ends
+     $FF  one more byte of events follows (all the following bytes with
+          the value $FF have the same function)
+
+   The 'Not predefined sync's ($E0-EF) are for user events. You might
+   want to synchronise your music to something, like setting of an
+   explosion on-stage, turning on your screensaver etc.
+
+   There may only be one "ETC" frame in each tag.
+
+
+4.7.   MPEG location lookup table
+
+   To increase performance and accuracy of jumps within a MPEG [MPEG]
+   audio file, frames with timecodes in different locations in the file
+   might be useful. The ID3 frame includes references that the software
+   can use to calculate positions in the file. After the frame header is
+   a descriptor of how much the 'frame counter' should increase for every
+   reference. If this value is two then the first reference points out
+   the second frame, the 2nd reference the 4th frame, the 3rd reference
+   the 6th frame etc. In a similar way the 'bytes between reference' and
+   'milliseconds between reference' points out bytes and milliseconds
+   respectively.
+   
+   Each reference consists of two parts; a certain number of bits, as
+   defined in 'bits for bytes deviation', that describes the difference
+   between what is said in 'bytes between reference' and the reality and
+   a certain number of bits, as defined in 'bits for milliseconds
+   deviation', that describes the difference between what is said in
+   'milliseconds between reference' and the reality. The number of bits
+   in every reference, i.e. 'bits for bytes deviation'+'bits for
+   milliseconds deviation', must be a multiple of four. There may only be
+   one "MLL" frame in each tag.
+   
+     Location lookup table          "MLL"
+     ID3 frame size                 $xx xx xx
+     MPEG frames between reference  $xx xx
+     Bytes between reference        $xx xx xx
+     Milliseconds between reference $xx xx xx
+     Bits for bytes deviation       $xx
+     Bits for milliseconds dev.     $xx
+
+   Then for every reference the following data is included;
+
+     Deviation in bytes         %xxx....
+     Deviation in milliseconds  %xxx....
+
+
+4.8.   Synced tempo codes
+
+   For a more accurate description of the tempo of a musical piece this
+   frame might be used. After the header follows one byte describing
+   which time stamp format should be used. Then follows one or more tempo
+   codes. Each tempo code consists of one tempo part and one time part.
+   The tempo is in BPM described with one or two bytes. If the first byte
+   has the value $FF, one more byte follows, which is added to the first
+   giving a range from 2 - 510 BPM, since $00 and $01 is reserved. $00 is
+   used to describe a beat-free time period, which is not the same as a
+   music-free time period. $01 is used to indicate one single beat-stroke
+   followed by a beat-free period.
+
+   The tempo descriptor is followed by a time stamp. Every time the tempo
+   in the music changes, a tempo descriptor may indicate this for the
+   player. All tempo descriptors should be sorted in chronological order.
+   The first beat-stroke in a time-period is at the same time as the beat
+   description occurs. There may only be one "STC" frame in each tag.
+
+     Synced tempo codes  "STC"
+     Frame size          $xx xx xx
+     Time stamp format   $xx
+     Tempo data          <binary data>
+
+   Where time stamp format is:
+     
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+
+4.9.   Unsychronised lyrics/text transcription
+
+   This frame contains the lyrics of the song or a text transcription of
+   other vocal activities. The head includes an encoding descriptor and
+   a content descriptor. The body consists of the actual text. The
+   'Content descriptor' is a terminated string. If no descriptor is
+   entered, 'Content descriptor' is $00 (00) only. Newline characters
+   are allowed in the text. Maximum length for the descriptor is 64
+   bytes. There may be more than one lyrics/text frame in each tag, but
+   only one with the same language and content descriptor.
+
+     Unsynced lyrics/text "ULT"
+     Frame size           $xx xx xx
+     Text encoding        $xx
+     Language             $xx xx xx
+     Content descriptor   <textstring> $00 (00)
+     Lyrics/text          <textstring>
+
+
+4.10.   Synchronised lyrics/text
+
+   This is another way of incorporating the words, said or sung lyrics,
+   in the audio file as text, this time, however, in sync with the audio.
+   It might also be used to describing events e.g. occurring on a stage
+   or on the screen in sync with the audio. The header includes a content
+   descriptor, represented with as terminated textstring. If no
+   descriptor is entered, 'Content descriptor' is $00 (00) only.
+
+     Synced lyrics/text   "SLT"
+     Frame size           $xx xx xx
+     Text encoding        $xx
+     Language             $xx xx xx
+     Time stamp format    $xx
+     Content type         $xx
+     Content descriptor   <textstring> $00 (00)
+
+
+   Encoding:   $00  ISO-8859-1 [ISO-8859-1] character set is used => $00
+                    is sync identifier.
+               $01  Unicode [UNICODE] character set is used => $00 00 is
+                    sync identifier.
+
+   Content type:   $00 is other
+                   $01 is lyrics
+                   $02 is text transcription
+                   $03 is movement/part name (e.g. "Adagio")
+                   $04 is events (e.g. "Don Quijote enters the stage")
+                   $05 is chord (e.g. "Bb F Fsus")
+
+   Time stamp format is:
+     
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   The text that follows the frame header differs from that of the
+   unsynchronised lyrics/text transcription in one major way. Each
+   syllable (or whatever size of text is considered to be convenient by
+   the encoder) is a null terminated string followed by a time stamp
+   denoting where in the sound file it belongs. Each sync thus has the
+   following structure:
+
+     Terminated text to be synced (typically a syllable)
+     Sync identifier (terminator to above string)   $00 (00)
+     Time stamp                                     $xx (xx ...)
+
+   The 'time stamp' is set to zero or the whole sync is omitted if
+   located directly at the beginning of the sound. All time stamps should
+   be sorted in chronological order. The sync can be considered as a
+   validator of the subsequent string.
+
+   Newline characters are allowed in all "SLT" frames and should be used
+   after every entry (name, event etc.) in a frame with the content type
+   $03 - $04.
+
+   A few considerations regarding whitespace characters: Whitespace
+   separating words should mark the beginning of a new word, thus
+   occurring in front of the first syllable of a new word. This is also
+   valid for new line characters. A syllable followed by a comma should
+   not be broken apart with a sync (both the syllable and the comma
+   should be before the sync).
+
+   An example: The "ULT" passage
+
+     "Strangers in the night" $0A "Exchanging glances"
+
+   would be "SLT" encoded as:
+
+     "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx
+     " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx
+     xx "glan" $00 xx xx "ces" $00 xx xx
+
+   There may be more than one "SLT" frame in each tag, but only one with
+   the same language and content descriptor.
+
+
+4.11.   Comments
+
+   This frame replaces the old 30-character comment field in ID3v1. It
+   consists of a frame head followed by encoding, language and content
+   descriptors and is ended with the actual comment as a text string.
+   Newline characters are allowed in the comment text string. There may
+   be more than one comment frame in each tag, but only one with the same
+   language and content descriptor.
+
+     Comment                   "COM"
+     Frame size                $xx xx xx
+     Text encoding             $xx
+     Language                  $xx xx xx
+     Short content description <textstring> $00 (00)
+     The actual text           <textstring>
+
+
+4.12.   Relative volume adjustment
+
+   This is a more subjective function than the previous ones. It allows
+   the user to say how much he wants to increase/decrease the volume on
+   each channel while the file is played. The purpose is to be able to
+   align all files to a reference volume, so that you don't have to
+   change the volume constantly. This frame may also be used to balance
+   adjust the audio. If the volume peak levels are known then this could
+   be described with the 'Peak volume right' and 'Peak volume left'
+   field. If Peakvolume is not known these fields could be left zeroed
+   or completely omitted.  There may only be one "RVA" frame in each
+   tag.
+
+     Relative volume adjustment    "RVA"
+     Frame size                    $xx xx xx
+     Increment/decrement           %000000xx
+     Bits used for volume descr.   $xx
+     Relative volume change, right $xx xx (xx ...)
+     Relative volume change, left  $xx xx (xx ...)
+     Peak volume right             $xx xx (xx ...)
+     Peak volume left              $xx xx (xx ...)
+
+   In the increment/decrement field bit 0 is used to indicate the right
+   channel and bit 1 is used to indicate the left channel. 1 is
+   increment and 0 is decrement.
+
+   The 'bits used for volume description' field is normally $10 (16 bits)
+   for MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not
+   be $00. The volume is always represented with whole bytes, padded in
+   the beginning (highest bits) when 'bits used for volume description'
+   is not a multiple of eight.
+
+
+4.13.   Equalisation
+
+   This is another subjective, alignment frame. It allows the user to
+   predefine an equalisation curve within the audio file. There may only
+   be one "EQU" frame in each tag.
+
+     Equalisation       "EQU"
+     Frame size         $xx xx xx
+     Adjustment bits    $xx
+
+   The 'adjustment bits' field defines the number of bits used for
+   representation of the adjustment. This is normally $10 (16 bits) for
+   MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not be
+   $00.
+
+   This is followed by 2 bytes + ('adjustment bits' rounded up to the
+   nearest byte) for every equalisation band in the following format,
+   giving a frequency range of 0 - 32767Hz:
+
+     Increment/decrement   %x (MSB of the Frequency)
+     Frequency             (lower 15 bits)
+     Adjustment            $xx (xx ...)
+
+   The increment/decrement bit is 1 for increment and 0 for decrement.
+   The equalisation bands should be ordered increasingly with reference
+   to frequency. All frequencies don't have to be declared. Adjustments
+   with the value $00 should be omitted. A frequency should only be
+   described once in the frame.
+
+
+4.14.   Reverb
+
+   Yet another subjective one. You may here adjust echoes of different
+   kinds. Reverb left/right is the delay between every bounce in ms.
+   Reverb bounces left/right is the number of bounces that should be
+   made. $FF equals an infinite number of bounces. Feedback is the amount
+   of volume that should be returned to the next echo bounce. $00 is 0%,
+   $FF is 100%. If this value were $7F, there would be 50% volume
+   reduction on the first bounce, yet 50% on the second and so on. Left
+   to left means the sound from the left bounce to be played in the left
+   speaker, while left to right means sound from the left bounce to be
+   played in the right speaker.
+
+   'Premix left to right' is the amount of left sound to be mixed in the
+   right before any reverb is applied, where $00 id 0% and $FF is 100%.
+   'Premix right to left' does the same thing, but right to left. Setting
+   both premix to $FF would result in a mono output (if the reverb is
+   applied symmetric). There may only be one "REV" frame in each tag.
+
+     Reverb settings                  "REV"
+     Frame size                       $00 00 0C
+     Reverb left (ms)                 $xx xx
+     Reverb right (ms)                $xx xx
+     Reverb bounces, left             $xx
+     Reverb bounces, right            $xx
+     Reverb feedback, left to left    $xx
+     Reverb feedback, left to right   $xx
+     Reverb feedback, right to right  $xx
+     Reverb feedback, right to left   $xx
+     Premix left to right             $xx
+     Premix right to left             $xx
+
+
+4.15.   Attached picture
+
+   This frame contains a picture directly related to the audio file.
+   Image format is preferably "PNG" [PNG] or "JPG" [JFIF]. Description
+   is a short description of the picture, represented as a terminated
+   textstring. The description has a maximum length of 64 characters,
+   but may be empty. There may be several pictures attached to one file,
+   each in their individual "PIC" frame, but only one with the same
+   content descriptor. There may only be one picture with the picture
+   type declared as picture type $01 and $02 respectively. There is a
+   possibility to put only a link to the image file by using the 'image
+   format' "-->" and having a complete URL [URL] instead of picture data.
+   The use of linked files should however be used restrictively since
+   there is the risk of separation of files.
+
+     Attached picture   "PIC"
+     Frame size         $xx xx xx
+     Text encoding      $xx
+     Image format       $xx xx xx
+     Picture type       $xx
+     Description        <textstring> $00 (00)
+     Picture data       <binary data>
+
+
+   Picture type:  $00  Other
+                  $01  32x32 pixels 'file icon' (PNG only)
+                  $02  Other file icon
+                  $03  Cover (front)
+                  $04  Cover (back)
+                  $05  Leaflet page
+                  $06  Media (e.g. lable side of CD)
+                  $07  Lead artist/lead performer/soloist
+                  $08  Artist/performer
+                  $09  Conductor
+                  $0A  Band/Orchestra
+                  $0B  Composer
+                  $0C  Lyricist/text writer
+                  $0D  Recording Location
+                  $0E  During recording
+                  $0F  During performance
+                  $10  Movie/video screen capture
+                  $11  A bright coloured fish
+                  $12  Illustration
+                  $13  Band/artist logotype
+                  $14  Publisher/Studio logotype
+
+
+4.16.   General encapsulated object
+
+   In this frame any type of file can be encapsulated. After the header,
+   'Frame size' and 'Encoding' follows 'MIME type' [MIME] and 'Filename'
+   for the encapsulated object, both represented as terminated strings
+   encoded with ISO 8859-1 [ISO-8859-1]. The filename is case sensitive.
+   Then follows a content description as terminated string, encoded as
+   'Encoding'. The last thing in the frame is the actual object. The
+   first two strings may be omitted, leaving only their terminations.
+   MIME type is always an ISO-8859-1 text string. There may be more than
+   one "GEO" frame in each tag, but only one with the same content
+   descriptor.
+
+     General encapsulated object "GEO"
+     Frame size                  $xx xx xx
+     Text encoding               $xx
+     MIME type                   <textstring> $00
+     Filename                    <textstring> $00 (00)
+     Content description         <textstring> $00 (00)
+     Encapsulated object         <binary data>
+
+
+4.17.   Play counter
+
+   This is simply a counter of the number of times a file has been
+   played. The value is increased by one every time the file begins to
+   play. There may only be one "CNT" frame in each tag. When the counter
+   reaches all one's, one byte is inserted in front of the counter thus
+   making the counter eight bits bigger.  The counter must be at least
+   32-bits long to begin with.
+
+     Play counter   "CNT"
+     Frame size     $xx xx xx
+     Counter        $xx xx xx xx (xx ...)
+
+
+4.18.   Popularimeter
+
+   The purpose of this frame is to specify how good an audio file is.
+   Many interesting applications could be found to this frame such as a
+   playlist that features better audiofiles more often than others or it
+   could be used to profile a persons taste and find other 'good' files
+   by comparing people's profiles. The frame is very simple. It contains
+   the email address to the user, one rating byte and a four byte play
+   counter, intended to be increased with one for every time the file is
+   played. The email is a terminated string. The rating is 1-255 where
+   1 is worst and 255 is best. 0 is unknown. If no personal counter is
+   wanted it may be omitted.  When the counter reaches all one's, one
+   byte is inserted in front of the counter thus making the counter
+   eight bits bigger in the same away as the play counter ("CNT").
+   There may be more than one "POP" frame in each tag, but only one with
+   the same email address.
+   
+     Popularimeter   "POP"
+     Frame size      $xx xx xx
+     Email to user   <textstring> $00
+     Rating          $xx
+     Counter         $xx xx xx xx (xx ...)
+
+
+4.19.   Recommended buffer size
+
+   Sometimes the server from which a audio file is streamed is aware of
+   transmission or coding problems resulting in interruptions in the
+   audio stream. In these cases, the size of the buffer can be
+   recommended by the server using this frame. If the 'embedded info
+   flag' is true (1) then this indicates that an ID3 tag with the
+   maximum size described in 'Buffer size' may occur in the audiostream.
+   In such case the tag should reside between two MPEG [MPEG] frames, if
+   the audio is MPEG encoded. If the position of the next tag is known,
+   'offset to next tag' may be used. The offset is calculated from the
+   end of tag in which this frame resides to the first byte of the header
+   in the next. This field may be omitted. Embedded tags is currently not
+   recommended since this could render unpredictable behaviour from
+   present software/hardware. The 'Buffer size' should be kept to a
+   minimum. There may only be one "BUF" frame in each tag.
+
+     Recommended buffer size   "BUF"
+     Frame size                $xx xx xx
+     Buffer size               $xx xx xx
+     Embedded info flag        %0000000x
+     Offset to next tag        $xx xx xx xx
+
+
+4.20.   Encrypted meta frame
+
+   This frame contains one or more encrypted frames. This enables
+   protection of copyrighted information such as pictures and text, that
+   people might want to pay extra for. Since standardisation of such an
+   encryption scheme is beyond this document, all "CRM" frames begin with
+   a terminated string with a URL [URL] containing an email address, or a
+   link to a location where an email adress can be found, that belongs to
+   the organisation responsible for this specific encrypted meta frame.
+
+   Questions regarding the encrypted frame should be sent to the
+   indicated email address. If a $00 is found directly after the 'Frame
+   size', the whole frame should be ignored, and preferably be removed.
+   The 'Owner identifier' is then followed by a short content description
+   and explanation as to why it's encrypted. After the
+   'content/explanation' description, the actual encrypted block follows.
+
+   When an ID3v2 decoder encounters a "CRM" frame, it should send the
+   datablock to the 'plugin' with the corresponding 'owner identifier'
+   and expect to receive either a datablock with one or several ID3v2
+   frames after each other or an error. There may be more than one "CRM"
+   frames in a tag, but only one with the same 'owner identifier'.
+
+     Encrypted meta frame  "CRM"
+     Frame size            $xx xx xx
+     Owner identifier      <textstring> $00 (00)
+     Content/explanation   <textstring> $00 (00)
+     Encrypted datablock   <binary data>
+
+
+4.21.   Audio encryption
+
+   This frame indicates if the actual audio stream is encrypted, and by
+   whom. Since standardisation of such encrypion scheme is beyond this
+   document, all "CRA" frames begin with a terminated string with a
+   URL containing an email address, or a link to a location where an
+   email address can be found, that belongs to the organisation
+   responsible for this specific encrypted audio file. Questions
+   regarding the encrypted audio should be sent to the email address
+   specified. If a $00 is found directly after the 'Frame size' and the
+   audiofile indeed is encrypted, the whole file may be considered
+   useless.
+
+   After the 'Owner identifier', a pointer to an unencrypted part of the
+   audio can be specified. The 'Preview start' and 'Preview length' is
+   described in frames. If no part is unencrypted, these fields should be
+   left zeroed. After the 'preview length' field follows optionally a
+   datablock required for decryption of the audio. There may be more than
+   one "CRA" frames in a tag, but only one with the same 'Owner
+   identifier'.
+
+     Audio encryption   "CRA"
+     Frame size         $xx xx xx
+     Owner identifier   <textstring> $00 (00)
+     Preview start      $xx xx
+     Preview length     $xx xx
+     Encryption info    <binary data>
+
+
+4.22.   Linked information
+
+   To keep space waste as low as possible this frame may be used to link
+   information from another ID3v2 tag that might reside in another audio
+   file or alone in a binary file. It is recommended that this method is
+   only used when the files are stored on a CD-ROM or other circumstances
+   when the risk of file seperation is low. The frame contains a frame
+   identifier, which is the frame that should be linked into this tag, a
+   URL [URL] field, where a reference to the file where the frame is
+   given, and additional ID data, if needed. Data should be retrieved
+   from the first tag found in the file to which this link points. There
+   may be more than one "LNK" frame in a tag, but only one with the same
+   contents. A linked frame is to be considered as part of the tag and
+   has the same restrictions as if it was a physical part of the tag
+   (i.e. only one "REV" frame allowed, whether it's linked or not).
+   
+     Linked information  "LNK"
+     Frame size          $xx xx xx
+     Frame identifier    $xx xx xx
+     URL                 <textstring> $00 (00)
+     Additional ID data  <textstring(s)>
+   
+   Frames that may be linked and need no additional data are "IPL",
+   "MCI", "ETC", "LLT", "STC", "RVA", "EQU", "REV", "BUF", the text
+   information frames and the URL link frames.
+   
+   The "TXX", "PIC", "GEO", "CRM" and "CRA" frames may be linked with the
+   content descriptor as additional ID data.
+   
+   The "COM", "SLT" and "ULT" frames may be linked with three bytes of
+   language descriptor directly followed by a content descriptor as
+   additional ID data.
+
+
+5.   The 'unsynchronisation scheme'
+
+   The only purpose of the 'unsychronisation scheme' is to make the ID3v2
+   tag as compatible as possible with existing software. There is no use
+   in 'unsynchronising' tags if the file is only to be processed by new
+   software. Unsynchronisation may only be made with MPEG 2 layer I, II
+   and III and MPEG 2.5 files.
+
+   Whenever a false synchronisation is found within the tag, one zeroed
+   byte is inserted after the first false synchronisation byte. The
+   format of a correct sync that should be altered by ID3 encoders is as
+   follows:
+
+         %11111111 111xxxxx
+
+   And should be replaced with:
+
+         %11111111 00000000 111xxxxx
+
+   This has the side effect that all $FF 00 combinations have to be
+   altered, so they won't be affected by the decoding process. Therefore
+   all the $FF 00 combinations have to be replaced with the $FF 00 00
+   combination during the unsynchonisation.
+
+   To indicate usage of the unsynchronisation, the first bit in 'ID3
+   flags' should be set. This bit should only be set if the tag
+   contained a, now corrected, false synchronisation. The bit should
+   only be clear if the tag does not contain any false synchronisations.
+   
+   Do bear in mind, that if a compression scheme is used by the encoder,
+   the unsyncronisation scheme should be applied *afterwards*. When
+   decoding a compressed, 'unsyncronised' file, the 'unsyncronisation
+   scheme' should be parsed first, compression afterwards.
+
+
+6.   Copyright
+
+   Copyright (C) Martin Nilsson 1998. All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that a reference to this document is included on all
+   such copies and derivative works. However, this document itself may
+   not be modified in any way and reissued as the original document.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked.
+
+   This document and the information contained herein is provided on an
+   "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
+   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
+   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+
+7.   References
+
+   [CDDB] Compact Disc Data Base
+
+      <url:http://www.cddb.com>
+
+   [ISO-639-2] ISO/FDIS 639-2.
+   Codes for the representation of names of languages, Part 2: Alpha-3
+   code. Technical committee / subcommittee: TC 37 / SC 2
+
+   [ISO-8859-1] ISO/IEC DIS 8859-1.
+   8-bit single-byte coded graphic character sets, Part 1: Latin
+   alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2
+
+   [ISRC] ISO 3901:1986
+   International Standard Recording Code (ISRC).
+   Technical committee / subcommittee: TC 46 / SC 9
+
+   [JFIF] JPEG File Interchange Format, version 1.02
+
+      <url:http://www.w3.org/Graphics/JPEG/jfif.txt>
+      
+   [MIME] Freed, N.  and N. Borenstein,  "Multipurpose Internet Mail
+   Extensions (MIME) Part One: Format of Internet Message Bodies",
+   RFC 2045, November 1996.
+ 
+      <url:ftp://ftp.isi.edu/in-notes/rfc2045.txt>
+      
+   [MPEG] ISO/IEC 11172-3:1993.
+   Coding of moving pictures and associated audio for digital storage
+   media at up to about 1,5 Mbit/s, Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+   and   
+   ISO/IEC 13818-3:1995
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+   and   
+   ISO/IEC DIS 13818-3
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio (Revision of ISO/IEC 13818-3:1995)
+
+
+   [PNG] Portable Network Graphics, version 1.0
+
+      <url:http://www.w3.org/TR/REC-png-multi.html>
+
+   [UNICODE] ISO/IEC 10646-1:1993.
+   Universal Multiple-Octet Coded Character Set (UCS), Part 1:
+   Architecture and Basic Multilingual Plane. Technical committee
+   / subcommittee: JTC 1 / SC 2
+
+      <url:http://www.unicode.org>
+
+   [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource
+   Locators (URL).", RFC 1738, December 1994.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc1738.txt>
+
+
+8.   Appendix
+
+
+A.   Appendix A - ID3-Tag Specification V1.1
+
+   ID3-Tag Specification V1.1 (12 dec 1997) by Michael Mutschler
+   <amiga2 at info2.rus.uni-stuttgart.de>, edited for space and clarity
+   reasons.
+
+
+A.1.   Overview
+
+   The ID3-Tag is an information field for MPEG Layer 3 audio files.
+   Since a standalone MP3 doesn't provide a method of storing other
+   information than those directly needed for replay reasons, the
+   ID3-tag was invented by Eric Kemp in 1996.
+
+   A revision from ID3v1 to ID3v1.1 was made by Michael Mutschler to
+   support track number information is described in A.4.
+
+
+A.2.   ID3v1 Implementation
+
+   The Information is stored in the last 128 bytes of an MP3. The Tag
+   has got the following fields, and the offsets given here, are from
+   0-127.
+
+     Field      Length    Offsets
+     Tag        3           0-2
+     Songname   30          3-32
+     Artist     30         33-62
+     Album      30         63-92
+     Year       4          93-96
+     Comment    30         97-126
+     Genre      1           127
+
+
+   The string-fields contain ASCII-data, coded in ISO-Latin 1 codepage.
+   Strings which are smaller than the field length are padded with zero-
+   bytes.
+
+     Tag: The tag is valid if this field contains the string "TAG". This
+        has to be uppercase!
+
+     Songname: This field contains the title of the MP3 (string as
+        above).
+
+     Artist: This field contains the artist of the MP3 (string as above).
+
+     Album: this field contains the album where the MP3 comes from
+        (string as above).
+
+     Year: this field contains the year when this song has originally
+        been released (string as above).
+
+     Comment: this field contains a comment for the MP3 (string as
+        above). Revision to this field has been made in ID3v1.1. See
+        A.4.
+
+     Genre: this byte contains the offset of a genre in a predefined
+        list the byte is treated as an unsigned byte. The offset is
+        starting from 0. See A.3.
+
+
+A.3.   Genre List
+
+   The following genres is defined in ID3v1 
+
+      0.Blues
+      1.Classic Rock
+      2.Country
+      3.Dance
+      4.Disco
+      5.Funk
+      6.Grunge
+      7.Hip-Hop
+      8.Jazz
+      9.Metal
+     10.New Age
+     11.Oldies
+     12.Other
+     13.Pop
+     14.R&B
+     15.Rap
+     16.Reggae
+     17.Rock
+     18.Techno
+     19.Industrial
+     20.Alternative
+     21.Ska
+     22.Death Metal
+     23.Pranks
+     24.Soundtrack
+     25.Euro-Techno
+     26.Ambient
+     27.Trip-Hop
+     28.Vocal
+     29.Jazz+Funk
+     30.Fusion
+     31.Trance
+     32.Classical
+     33.Instrumental
+     34.Acid
+     35.House
+     36.Game
+     37.Sound Clip
+     38.Gospel
+     39.Noise
+     40.AlternRock
+     41.Bass
+     42.Soul
+     43.Punk
+     44.Space
+     45.Meditative
+     46.Instrumental Pop
+     47.Instrumental Rock
+     48.Ethnic
+     49.Gothic
+     50.Darkwave
+     51.Techno-Industrial
+     52.Electronic
+     53.Pop-Folk
+     54.Eurodance
+     55.Dream
+     56.Southern Rock
+     57.Comedy
+     58.Cult
+     59.Gangsta
+     60.Top 40
+     61.Christian Rap
+     62.Pop/Funk
+     63.Jungle
+     64.Native American
+     65.Cabaret
+     66.New Wave
+     67.Psychadelic
+     68.Rave
+     69.Showtunes
+     70.Trailer
+     71.Lo-Fi
+     72.Tribal
+     73.Acid Punk
+     74.Acid Jazz
+     75.Polka
+     76.Retro
+     77.Musical
+     78.Rock & Roll
+     79.Hard Rock
+     
+   The following genres are Winamp extensions
+     
+     80.Folk
+     81.Folk-Rock
+     82.National Folk
+     83.Swing
+     84.Fast Fusion
+     85.Bebob
+     86.Latin
+     87.Revival
+     88.Celtic
+     89.Bluegrass
+     90.Avantgarde
+     91.Gothic Rock
+     92.Progressive Rock
+     93.Psychedelic Rock
+     94.Symphonic Rock
+     95.Slow Rock
+     96.Big Band
+     97.Chorus
+     98.Easy Listening
+     99.Acoustic
+    100.Humour
+    101.Speech
+    102.Chanson
+    103.Opera
+    104.Chamber Music
+    105.Sonata
+    106.Symphony
+    107.Booty Bass
+    108.Primus
+    109.Porn Groove
+    110.Satire
+    111.Slow Jam
+    112.Club
+    113.Tango
+    114.Samba
+    115.Folklore
+    116.Ballad
+    117.Power Ballad
+    118.Rhythmic Soul
+    119.Freestyle
+    120.Duet
+    121.Punk Rock
+    122.Drum Solo
+    123.A capella
+    124.Euro-House
+    125.Dance Hall
+
+
+A.4.   Track addition - ID3v1.1
+
+   In ID3v1.1, Michael Mutschler revised the specification of the
+   comment field in order to implement the track number. The new format
+   of the comment field is a 28 character string followed by a mandatory
+   null ($00) character and the original album tracknumber stored as an
+   unsigned byte-size integer. In such cases where the 29th byte is not
+   the null character or when the 30th is a null character, the
+   tracknumber is to be considered undefined.
+
+
+9.   Author's Address
+
+   Martin Nilsson
+   Rydsvägen 246 C. 30
+   S-584 34 Linköping
+   Sweden
+
+   Email: nilsson at id3.org
+
+   Co-authors:
+
+   Johan Sundström   Email: johan at id3.org
+
+
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2.3.0.txt b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.3.0.txt
new file mode 100644
index 0000000..b4ed763
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.3.0.txt
@@ -0,0 +1,2022 @@
+Informal standard                                             M. Nilsson
+Document: id3v2.3.0.txt                                3rd February 1999
+
+
+                           ID3 tag version 2.3.0
+
+Status of this document
+
+   This document is an informal standard and replaces the ID3v2.2.0
+   standard [ID3v2]. The informal standard is released so that
+   implementors could have a set standard before a formal standard is
+   set. The formal standard will use another version or revision number
+   if not identical to what is described in this document. The contents
+   in this document may change for clarifications but never for added or
+   altered functionallity.
+
+   Distribution of this document is unlimited.
+
+
+Abstract
+
+   This document describes the ID3v2.3.0, which is a more developed
+   version of the ID3v2 informal standard [ID3v2] (version 2.2.0),
+   evolved from the ID3 tagging system. The ID3v2 offers a flexible way
+   of storing information about an audio file within itself to determine
+   its origin and contents. The information may be technical
+   information, such as equalisation curves, as well as related meta
+   information, such as title, performer, copyright etc.
+
+
+1.   Table of contents
+
+   2.   Conventions in this document
+   3.   ID3v2 overview
+     3.1.   ID3v2 header
+     3.2.   ID3v2 extended header
+     3.3.   ID3v2 frames overview
+       3.3.1.   Frame header flags
+       3.3.2.   Default flags
+   4.   Declared ID3v2 frames
+     4.1.   Unique file identifier
+     4.2.   Text information frames
+       4.2.1.   Text information frames - details
+       4.2.2.   User defined text information frame
+     4.3.   URL link frames
+       4.3.1.   URL link frames - details
+       4.3.2.   User defined URL link frame
+     4.4.   Involved people list
+     4.5.   Music CD Identifier
+     4.6.   Event timing codes
+     4.7.   MPEG location lookup table
+     4.8.   Synced tempo codes
+     4.9.   Unsychronised lyrics/text transcription
+     4.10.  Synchronised lyrics/text
+     4.11.  Comments
+     4.12.  Relative volume adjustment
+     4.13.  Equalisation
+     4.14.  Reverb
+     4.15.  Attached picture
+     4.16.  General encapsulated object
+     4.17.  Play counter
+     4.18.  Popularimeter
+     4.19.  Recommended buffer size
+     4.20.  Audio encryption
+     4.21.  Linked information
+     4.22.  Position synchronisation frame
+     4.23.  Terms of use
+     4.24.  Ownership frame
+     4.25.  Commercial frame
+     4.26.  Encryption method registration
+     4.27.  Group identification registration
+	 4.28.  Private frame
+   5.   The 'unsynchronisation scheme'
+   6.   Copyright
+   7.   References
+   8.   Appendix
+     A.   Appendix A - Genre List from ID3v1
+   9.   Author's Address
+
+
+2.   Conventions in this document
+
+   In the examples, text within "" is a text string exactly as it
+   appears in a file. Numbers preceded with $ are hexadecimal and
+   numbers preceded with % are binary. $xx is used to indicate a byte
+   with unknown content. %x is used to indicate a bit with unknown
+   content. The most significant bit (MSB) of a byte is called 'bit 7'
+   and the least significant bit (LSB) is called 'bit 0'.
+
+   A tag is the whole tag described in this document. A frame is a block
+   of information in the tag. The tag consists of a header, frames and
+   optional padding. A field is a piece of information; one value, a
+   string etc. A numeric string is a string that consists of the
+   characters 0-9 only.
+
+
+3.   ID3v2 overview
+
+   The two biggest design goals were to be able to implement ID3v2
+   without disturbing old software too much and that ID3v2 should be
+   as flexible and expandable as possible.
+
+   The first criterion is met by the simple fact that the MPEG [MPEG]
+   decoding software uses a syncsignal, embedded in the audiostream, to
+   'lock on to' the audio. Since the ID3v2 tag doesn't contain a valid
+   syncsignal, no software will attempt to play the tag. If, for any
+   reason, coincidence make a syncsignal appear within the tag it will
+   be taken care of by the 'unsynchronisation scheme' described in
+   section 5.
+
+   The second criterion has made a more noticeable impact on the design
+   of the ID3v2 tag. It is constructed as a container for several
+   information blocks, called frames, whose format need not be known to
+   the software that encounters them. At the start of every frame there
+   is an identifier that explains the frames' format and content, and a
+   size descriptor that allows software to skip unknown frames.
+
+   If a total revision of the ID3v2 tag should be needed, there is a
+   version number and a size descriptor in the ID3v2 header.
+
+   The ID3 tag described in this document is mainly targeted at files
+   encoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2 layer III
+   and MPEG-2.5, but may work with other types of encoded audio.
+
+   The bitorder in ID3v2 is most significant bit first (MSB). The
+   byteorder in multibyte numbers is most significant byte first (e.g.
+   $12345678 would be encoded $12 34 56 78).
+
+   It is permitted to include padding after all the final frame (at the
+   end of the ID3 tag), making the size of all the frames together
+   smaller than the size given in the head of the tag. A possible
+   purpose of this padding is to allow for adding a few additional
+   frames or enlarge existing frames within the tag without having to
+   rewrite the entire file. The value of the padding bytes must be $00.
+
+
+3.1.   ID3v2 header
+
+   The ID3v2 tag header, which should be the first information in the
+   file, is 10 bytes as follows:
+
+     ID3v2/file identifier      "ID3"
+     ID3v2 version              $03 00
+     ID3v2 flags                %abc00000
+     ID3v2 size             4 * %0xxxxxxx
+
+   The first three bytes of the tag are always "ID3" to indicate that
+   this is an ID3v2 tag, directly followed by the two version bytes. The
+   first byte of ID3v2 version is it's major version, while the second
+   byte is its revision number. In this case this is ID3v2.3.0. All
+   revisions are backwards compatible while major versions are not. If
+   software with ID3v2.2.0 and below support should encounter version
+   three or higher it should simply ignore the whole tag. Version and
+   revision will never be $FF.
+
+   The version is followed by one the ID3v2 flags field, of which
+   currently only three flags are used.
+
+
+   a - Unsynchronisation
+
+     Bit 7 in the 'ID3v2 flags' indicates whether or not
+     unsynchronisation is used (see section 5 for details); a set bit
+     indicates usage.
+
+
+   b - Extended header
+
+     The second bit (bit 6) indicates whether or not the header is
+     followed by an extended header. The extended header is described in
+     section 3.2.
+
+
+   c - Experimental indicator
+
+     The third bit (bit 5) should be used as an 'experimental
+     indicator'. This flag should always be set when the tag is in an
+     experimental stage.
+
+   All the other flags should be cleared. If one of these undefined
+   flags are set that might mean that the tag is not readable for a
+   parser that does not know the flags function.
+
+   The ID3v2 tag size is encoded with four bytes where the most
+   significant bit (bit 7) is set to zero in every byte, making a total
+   of 28 bits. The zeroed bits are ignored, so a 257 bytes long tag is
+   represented as $00 00 02 01.
+
+   The ID3v2 tag size is the size of the complete tag after
+   unsychronisation, including padding, excluding the header but not
+   excluding the extended header (total tag size - 10). Only 28 bits
+   (representing up to 256MB) are used in the size description to avoid
+   the introducuction of 'false syncsignals'.
+
+   An ID3v2 tag can be detected with the following pattern:
+     $49 44 33 yy yy xx zz zz zz zz
+   Where yy is less than $FF, xx is the 'flags' byte and zz is less than
+   $80.
+
+
+3.2.   ID3v2 extended header
+
+   The extended header contains information that is not vital to the
+   correct parsing of the tag information, hence the extended header is
+   optional.
+
+     Extended header size   $xx xx xx xx
+     Extended Flags         $xx xx
+     Size of padding        $xx xx xx xx
+
+   Where the 'Extended header size', currently 6 or 10 bytes, excludes
+   itself. The 'Size of padding' is simply the total tag size excluding
+   the frames and the headers, in other words the padding. The extended
+   header is considered separate from the header proper, and as such is
+   subject to unsynchronisation.
+
+   The extended flags are a secondary flag set which describes further
+   attributes of the tag. These attributes are currently defined as
+   follows
+
+     %x0000000 00000000
+
+
+   x - CRC data present
+
+     If this flag is set four bytes of CRC-32 data is appended to the
+     extended header. The CRC should be calculated before
+     unsynchronisation on the data between the extended header and the
+     padding, i.e. the frames and only the frames.
+
+        Total frame CRC        $xx xx xx xx
+
+
+3.3.   ID3v2 frame overview
+
+   As the tag consists of a tag header and a tag body with one or more
+   frames, all the frames consists of a frame header followed by one or
+   more fields containing the actual information. The layout of the
+   frame header:
+
+     Frame ID   $xx xx xx xx  (four characters)
+     Size       $xx xx xx xx
+     Flags      $xx xx
+
+   The frame ID made out of the characters capital A-Z and 0-9.
+   Identifiers beginning with "X", "Y" and "Z" are for experimental use
+   and free for everyone to use, without the need to set the
+   experimental bit in the tag header. Have in mind that someone else
+   might have used the same identifier as you. All other identifiers are
+   either used or reserved for future use.
+
+   The frame ID is followed by a size descriptor, making a total header
+   size of ten bytes in every frame. The size is calculated as frame
+   size excluding frame header (frame size - 10).
+
+   In the frame header the size descriptor is followed by two flags
+   bytes. These flags are described in section 3.3.1.
+
+   There is no fixed order of the frames' appearance in the tag,
+   although it is desired that the frames are arranged in order of
+   significance concerning the recognition of the file. An example of
+   such order: UFID, TIT2, MCDI, TRCK ...
+
+   A tag must contain at least one frame. A frame must be at least 1
+   byte big, excluding the header.
+
+   If nothing else is said a string is represented as ISO-8859-1
+   [ISO-8859-1] characters in the range $20 - $FF. Such strings are
+   represented as <text string>, or <full text string> if newlines are
+   allowed, in the frame descriptions. All Unicode strings [UNICODE] use
+   16-bit unicode 2.0 (ISO/IEC 10646-1:1993, UCS-2). Unicode strings
+   must begin with the Unicode BOM ($FF FE or $FE FF) to identify the
+   byte order.
+
+   All numeric strings and URLs [URL] are always encoded as ISO-8859-1.
+   Terminated strings are terminated with $00 if encoded with ISO-8859-1
+   and $00 00 if encoded as unicode. If nothing else is said newline
+   character is forbidden. In ISO-8859-1 a new line is represented, when
+   allowed, with $0A only. Frames that allow different types of text
+   encoding have a text encoding description byte directly after the
+   frame size. If ISO-8859-1 is used this byte should be $00, if Unicode
+   is used it should be $01. Strings dependent on encoding is
+   represented as <text string according to encoding>, or <full text
+   string according to encoding> if newlines are allowed.  Any empty
+   Unicode strings which are NULL-terminated may have the Unicode BOM
+   followed by a Unicode NULL ($FF FE 00 00 or $FE FF 00 00).
+
+   The three byte language field is used to describe the language of the
+   frame's content, according to ISO-639-2 [ISO-639-2].
+
+   All URLs [URL] may be relative, e.g. "picture.png", "../doc.txt".
+
+   If a frame is longer than it should be, e.g. having more fields than
+   specified in this document, that indicates that additions to the
+   frame have been made in a later version of the ID3v2 standard. This
+   is reflected by the revision number in the header of the tag.
+
+
+3.3.1.   Frame header flags
+
+   In the frame header the size descriptor is followed by two flags
+   bytes. All unused flags must be cleared. The first byte is for
+   'status messages' and the second byte is for encoding purposes. If an
+   unknown flag is set in the first byte the frame may not be changed
+   without the bit cleared. If an unknown flag is set in the second byte
+   it is likely to not be readable. The flags field is defined as
+   follows.
+
+     %abc00000 %ijk00000
+
+
+   a - Tag alter preservation
+
+     This flag tells the software what to do with this frame if it is
+     unknown and the tag is altered in any way. This applies to all
+     kinds of alterations, including adding more padding and reordering
+     the frames.
+
+     0     Frame should be preserved.
+     1     Frame should be discarded.
+
+
+   b - File alter preservation
+
+     This flag tells the software what to do with this frame if it is
+     unknown and the file, excluding the tag, is altered. This does not
+     apply when the audio is completely replaced with other audio data.
+
+     0     Frame should be preserved.
+     1     Frame should be discarded.
+
+
+   c - Read only
+
+      This flag, if set, tells the software that the contents of this
+      frame is intended to be read only. Changing the contents might
+      break something, e.g. a signature. If the contents are changed,
+      without knowledge in why the frame was flagged read only and
+      without taking the proper means to compensate, e.g. recalculating
+      the signature, the bit should be cleared.
+
+
+   i - Compression
+
+      This flag indicates whether or not the frame is compressed.
+
+      0     Frame is not compressed.
+      1     Frame is compressed using zlib [zlib] with 4 bytes for
+            'decompressed size' appended to the frame header.
+
+
+   j - Encryption
+
+      This flag indicates wether or not the frame is enrypted. If set
+      one byte indicating with which method it was encrypted will be
+      appended to the frame header. See section 4.26. for more
+      information about encryption method registration.
+
+      0     Frame is not encrypted.
+      1     Frame is encrypted.
+
+
+   k - Grouping identity
+
+      This flag indicates whether or not this frame belongs in a group
+      with other frames. If set a group identifier byte is added to the
+      frame header. Every frame with the same group identifier belongs
+      to the same group.
+
+      0     Frame does not contain group information
+      1     Frame contains group information
+
+
+   Some flags indicates that the frame header is extended with
+   additional information. This information will be added to the frame
+   header in the same order as the flags indicating the additions. I.e.
+   the four bytes of decompressed size will preceed the encryption
+   method byte. These additions to the frame header, while not included
+   in the frame header size but are included in the 'frame size' field,
+   are not subject to encryption or compression.
+
+
+3.3.2.   Default flags
+
+   The default settings for the frames described in this document can be
+   divided into the following classes. The flags may be set differently
+   if found more suitable by the software.
+
+    1. Discarded if tag is altered, discarded if file is altered.
+
+       None.
+
+    2. Discarded if tag is altered, preserved if file is altered.
+
+       None.
+
+    3. Preserved if tag is altered, discarded if file is altered.
+
+       AENC, ETCO, EQUA, MLLT, POSS, SYLT, SYTC, RVAD, TENC, TLEN, TSIZ
+
+    4. Preserved if tag is altered, preserved if file is altered.
+
+       The rest of the frames.
+
+
+4.   Declared ID3v2 frames
+
+   The following frames are declared in this draft.
+
+  4.21  AENC Audio encryption
+  4.15  APIC Attached picture
+
+  4.11  COMM Comments
+  4.25  COMR Commercial frame
+
+  4.26  ENCR Encryption method registration
+  4.13  EQUA Equalization
+  4.6   ETCO Event timing codes
+
+  4.16  GEOB General encapsulated object
+  4.27  GRID Group identification registration
+
+  4.4   IPLS Involved people list
+
+  4.21  LINK Linked information
+
+  4.5   MCDI Music CD identifier
+  4.7   MLLT MPEG location lookup table
+
+  4.24  OWNE Ownership frame
+
+  4.28. PRIV Private frame
+  4.17  PCNT Play counter
+  4.18  POPM Popularimeter
+  4.22  POSS Position synchronisation frame
+
+  4.19  RBUF Recommended buffer size
+  4.12  RVAD Relative volume adjustment
+  4.14  RVRB Reverb
+
+  4.10  SYLT Synchronized lyric/text
+  4.8   SYTC Synchronized tempo codes
+
+  4.2.1 TALB Album/Movie/Show title
+  4.2.1 TBPM BPM (beats per minute)
+  4.2.1 TCOM Composer
+  4.2.1 TCON Content type
+  4.2.1 TCOP Copyright message
+  4.2.1 TDAT Date
+  4.2.1 TDLY Playlist delay
+  4.2.1 TENC Encoded by
+  4.2.1 TEXT Lyricist/Text writer
+  4.2.1 TFLT File type
+  4.2.1 TIME Time
+  4.2.1 TIT1 Content group description
+  4.2.1 TIT2 Title/songname/content description
+  4.2.1 TIT3 Subtitle/Description refinement
+  4.2.1 TKEY Initial key
+  4.2.1 TLAN Language(s)
+  4.2.1 TLEN Length
+  4.2.1 TMED Media type
+  4.2.1 TOAL Original album/movie/show title
+  4.2.1 TOFN Original filename
+  4.2.1 TOLY Original lyricist(s)/text writer(s)
+  4.2.1 TOPE Original artist(s)/performer(s)
+  4.2.1 TORY Original release year
+  4.2.1 TOWN File owner/licensee
+  4.2.1 TPE1 Lead performer(s)/Soloist(s)
+  4.2.1 TPE2 Band/orchestra/accompaniment
+  4.2.1 TPE3 Conductor/performer refinement
+  4.2.1 TPE4 Interpreted, remixed, or otherwise modified by
+  4.2.1 TPOS Part of a set
+  4.2.1 TPUB Publisher
+  4.2.1 TRCK Track number/Position in set
+  4.2.1 TRDA Recording dates
+  4.2.1 TRSN Internet radio station name
+  4.2.1 TRSO Internet radio station owner
+  4.2.1 TSIZ Size
+  4.2.1 TSRC ISRC (international standard recording code)
+  4.2.1 TSSE Software/Hardware and settings used for encoding
+  4.2.1 TYER Year
+  4.2.2 TXXX User defined text information frame
+
+  4.1   UFID Unique file identifier
+  4.23  USER Terms of use
+  4.9   USLT Unsychronized lyric/text transcription
+
+  4.3.1 WCOM Commercial information
+  4.3.1 WCOP Copyright/Legal information
+  4.3.1 WOAF Official audio file webpage
+  4.3.1 WOAR Official artist/performer webpage
+  4.3.1 WOAS Official audio source webpage
+  4.3.1 WORS Official internet radio station homepage
+  4.3.1 WPAY Payment
+  4.3.1 WPUB Publishers official webpage
+  4.3.2 WXXX User defined URL link frame
+
+
+4.1.   Unique file identifier
+
+   This frame's purpose is to be able to identify the audio file in a
+   database that may contain more information relevant to the content.
+   Since standardisation of such a database is beyond this document, all
+   frames begin with a null-terminated string with a URL [URL]
+   containing an email address, or a link to a location where an email
+   address can be found, that belongs to the organisation responsible
+   for this specific database implementation. Questions regarding the
+   database should be sent to the indicated email address. The URL
+   should not be used for the actual database queries. The string
+   "<a href="http://www.id3.org/dummy/ufid.html">http://www.id3.org/dummy/ufid.html</a>" should be used for tests.
+   Software that isn't told otherwise may safely remove such frames. The
+   'Owner identifier' must be non-empty (more than just a termination).
+   The 'Owner identifier' is then followed by the actual identifier,
+   which may be up to 64 bytes. There may be more than one "UFID" frame
+   in a tag, but only one with the same 'Owner identifier'.
+
+     <Header for 'Unique file identifier', ID: "UFID">
+     Owner identifier        <text string> $00
+     Identifier              <up to 64 bytes binary data>
+
+
+4.2.   Text information frames
+
+   The text information frames are the most important frames, containing
+   information like artist, album and more. There may only be one text
+   information frame of its kind in an tag. If the textstring is
+   followed by a termination ($00 (00)) all the following information
+   should be ignored and not be displayed. All text frame identifiers
+   begin with "T". Only text frame identifiers begin with "T", with the
+   exception of the "TXXX" frame. All the text information frames have
+   the following format:
+
+     <Header for 'Text information frame', ID: "T000" - "TZZZ",
+     excluding "TXXX" described in 4.2.2.>
+     Text encoding                $xx
+     Information                  <text string according to encoding>
+
+
+4.2.1.   Text information frames - details
+
+  TALB
+   The 'Album/Movie/Show title' frame is intended for the title of the
+   recording(/source of sound) which the audio in the file is taken
+   from.
+
+  TBPM
+   The 'BPM' frame contains the number of beats per minute in the
+   mainpart of the audio. The BPM is an integer and represented as a
+   numerical string.
+
+  TCOM
+   The 'Composer(s)' frame is intended for the name of the composer(s).
+   They are seperated with the "/" character.
+
+  TCON
+   The 'Content type', which previously was stored as a one byte numeric
+   value only, is now a numeric string. You may use one or several of
+   the types as ID3v1.1 did or, since the category list would be
+   impossible to maintain with accurate and up to date categories,
+   define your own.
+
+   References to the ID3v1 genres can be made by, as first byte, enter
+   "(" followed by a number from the genres list (appendix A.) and
+   ended with a ")" character. This is optionally followed by a
+   refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be
+   made in the same frame, e.g. "(51)(39)". If the refinement should
+   begin with a "(" character it should be replaced with "((", e.g. "((I
+   can figure out any genre)" or "(55)((I think...)". The following new
+   content types is defined in ID3v2 and is implemented in the same way
+   as the numerig content types, e.g. "(RX)".
+
+     RX  Remix
+     CR  Cover
+
+  TCOP
+   The 'Copyright message' frame, which must begin with a year and a
+   space character (making five characters), is intended for the
+   copyright holder of the original sound, not the audio file itself.
+   The absence of this frame means only that the copyright information
+   is unavailable or has been removed, and must not be interpreted to
+   mean that the sound is public domain. Every time this field is
+   displayed the field must be preceded with "Copyright " (C) " ", where
+   (C) is one character showing a C in a circle.
+
+  TDAT
+   The 'Date' frame is a numeric string in the DDMM format containing
+   the date for the recording. This field is always four characters
+   long.
+
+  TDLY
+   The 'Playlist delay' defines the numbers of milliseconds of silence
+   between every song in a playlist. The player should use the "ETC"
+   frame, if present, to skip initial silence and silence at the end of
+   the audio to match the 'Playlist delay' time. The time is represented
+   as a numeric string.
+
+  TENC
+   The 'Encoded by' frame contains the name of the person or
+   organisation that encoded the audio file. This field may contain a
+   copyright message, if the audio file also is copyrighted by the
+   encoder.
+
+  TEXT
+   The 'Lyricist(s)/Text writer(s)' frame is intended for the writer(s)
+   of the text or lyrics in the recording. They are seperated with the
+   "/" character.
+
+  TFLT
+   The 'File type' frame indicates which type of audio this tag defines.
+   The following type and refinements are defined:
+
+     MPG    MPEG Audio
+       /1     MPEG 1/2 layer I
+       /2     MPEG 1/2 layer II
+       /3     MPEG 1/2 layer III
+       /2.5   MPEG 2.5
+       /AAC   Advanced audio compression
+     VQF    Transform-domain Weighted Interleave Vector Quantization
+     PCM    Pulse Code Modulated audio
+
+   but other types may be used, not for these types though. This is used
+   in a similar way to the predefined types in the "TMED" frame, but
+   without parentheses. If this frame is not present audio type is
+   assumed to be "MPG".
+
+  TIME
+   The 'Time' frame is a numeric string in the HHMM format containing
+   the time for the recording. This field is always four characters
+   long.
+
+  TIT1
+   The 'Content group description' frame is used if the sound belongs to
+   a larger category of sounds/music. For example, classical music is
+   often sorted in different musical sections (e.g. "Piano Concerto",
+   "Weather - Hurricane").
+
+  TIT2
+   The 'Title/Songname/Content description' frame is the actual name of
+   the piece (e.g. "Adagio", "Hurricane Donna").
+
+  TIT3
+   The 'Subtitle/Description refinement' frame is used for information
+   directly related to the contents title (e.g. "Op. 16" or "Performed
+   live at Wembley").
+
+  TKEY
+   The 'Initial key' frame contains the musical key in which the sound
+   starts. It is represented as a string with a maximum length of three
+   characters. The ground keys are represented with "A","B","C","D","E",
+   "F" and "G" and halfkeys represented with "b" and "#". Minor is
+   represented as "m". Example "Cbm". Off key is represented with an "o"
+   only.
+
+  TLAN
+   The 'Language(s)' frame should contain the languages of the text or
+   lyrics spoken or sung in the audio. The language is represented with
+   three characters according to ISO-639-2. If more than one language is
+   used in the text their language codes should follow according to
+   their usage.
+
+  TLEN
+   The 'Length' frame contains the length of the audiofile in
+   milliseconds, represented as a numeric string.
+
+  TMED
+   The 'Media type' frame describes from which media the sound
+   originated. This may be a text string or a reference to the
+   predefined media types found in the list below. References are made
+   within "(" and ")" and are optionally followed by a text refinement,
+   e.g. "(MC) with four channels". If a text refinement should begin
+   with a "(" character it should be replaced with "((" in the same way
+   as in the "TCO" frame. Predefined refinements is appended after the
+   media type, e.g. "(CD/A)" or "(VID/PAL/VHS)".
+
+    DIG    Other digital media
+      /A    Analog transfer from media
+
+    ANA    Other analog media
+      /WAC  Wax cylinder
+      /8CA  8-track tape cassette
+
+    CD     CD
+      /A    Analog transfer from media
+      /DD   DDD
+      /AD   ADD
+      /AA   AAD
+
+    LD     Laserdisc
+      /A     Analog transfer from media
+
+    TT     Turntable records
+      /33    33.33 rpm
+      /45    45 rpm
+      /71    71.29 rpm
+      /76    76.59 rpm
+      /78    78.26 rpm
+      /80    80 rpm
+
+    MD     MiniDisc
+      /A    Analog transfer from media
+
+    DAT    DAT
+      /A    Analog transfer from media
+      /1    standard, 48 kHz/16 bits, linear
+      /2    mode 2, 32 kHz/16 bits, linear
+      /3    mode 3, 32 kHz/12 bits, nonlinear, low speed
+      /4    mode 4, 32 kHz/12 bits, 4 channels
+      /5    mode 5, 44.1 kHz/16 bits, linear
+      /6    mode 6, 44.1 kHz/16 bits, 'wide track' play
+
+    DCC    DCC
+      /A    Analog transfer from media
+
+    DVD    DVD
+      /A    Analog transfer from media
+
+    TV     Television
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+
+    VID    Video
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+      /VHS    VHS
+      /SVHS   S-VHS
+      /BETA   BETAMAX
+
+    RAD    Radio
+      /FM   FM
+      /AM   AM
+      /LW   LW
+      /MW   MW
+
+    TEL    Telephone
+      /I    ISDN
+
+    MC     MC (normal cassette)
+      /4    4.75 cm/s (normal speed for a two sided cassette)
+      /9    9.5 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+
+    REE    Reel
+      /9    9.5 cm/s
+      /19   19 cm/s
+      /38   38 cm/s
+      /76   76 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+
+  TOAL
+   The 'Original album/movie/show title' frame is intended for the title
+   of the original recording (or source of sound), if for example the
+   music in the file should be a cover of a previously released song.
+
+  TOFN
+   The 'Original filename' frame contains the preferred filename for the
+   file, since some media doesn't allow the desired length of the
+   filename. The filename is case sensitive and includes its suffix.
+
+  TOLY
+   The 'Original lyricist(s)/text writer(s)' frame is intended for the
+   text writer(s) of the original recording, if for example the music in
+   the file should be a cover of a previously released song. The text
+   writers are seperated with the "/" character.
+
+  TOPE
+   The 'Original artist(s)/performer(s)' frame is intended for the
+   performer(s) of the original recording, if for example the music in
+   the file should be a cover of a previously released song. The
+   performers are seperated with the "/" character.
+
+  TORY
+   The 'Original release year' frame is intended for the year when the
+   original recording, if for example the music in the file should be a
+   cover of a previously released song, was released. The field is
+   formatted as in the "TYER" frame.
+
+  TOWN
+   The 'File owner/licensee' frame contains the name of the owner or
+   licensee of the file and it's contents.
+
+  TPE1
+   The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is
+   used for the main artist(s). They are seperated with the "/"
+   character.
+
+  TPE2
+   The 'Band/Orchestra/Accompaniment' frame is used for additional
+   information about the performers in the recording.
+
+  TPE3
+   The 'Conductor' frame is used for the name of the conductor.
+
+  TPE4
+   The 'Interpreted, remixed, or otherwise modified by' frame contains
+   more information about the people behind a remix and similar
+   interpretations of another existing piece.
+
+  TPOS
+   The 'Part of a set' frame is a numeric string that describes which
+   part of a set the audio came from. This frame is used if the source
+   described in the "TALB" frame is divided into several mediums, e.g. a
+   double CD. The value may be extended with a "/" character and a
+   numeric string containing the total number of parts in the set. E.g.
+   "1/2".
+
+  TPUB
+   The 'Publisher' frame simply contains the name of the label or
+   publisher.
+
+  TRCK
+   The 'Track number/Position in set' frame is a numeric string
+   containing the order number of the audio-file on its original
+   recording. This may be extended with a "/" character and a numeric
+   string containing the total numer of tracks/elements on the original
+   recording. E.g. "4/9".
+
+  TRDA
+   The 'Recording dates' frame is a intended to be used as complement to
+   the "TYER", "TDAT" and "TIME" frames. E.g. "4th-7th June, 12th June"
+   in combination with the "TYER" frame.
+
+  TRSN
+   The 'Internet radio station name' frame contains the name of the
+   internet radio station from which the audio is streamed.
+
+  TRSO
+   The 'Internet radio station owner' frame contains the name of the
+   owner of the internet radio station from which the audio is
+   streamed.
+
+  TSIZ
+   The 'Size' frame contains the size of the audiofile in bytes,
+   excluding the ID3v2 tag, represented as a numeric string.
+
+  TSRC
+   The 'ISRC' frame should contain the International Standard Recording
+   Code [ISRC] (12 characters).
+
+  TSSE
+   The 'Software/Hardware and settings used for encoding' frame
+   includes the used audio encoder and its settings when the file was
+   encoded. Hardware refers to hardware encoders, not the computer on
+   which a program was run.
+
+  TYER
+   The 'Year' frame is a numeric string with a year of the recording.
+   This frames is always four characters long (until the year 10000).
+
+
+4.2.2.   User defined text information frame
+
+   This frame is intended for one-string text information concerning the
+   audiofile in a similar way to the other "T"-frames. The frame body
+   consists of a description of the string, represented as a terminated
+   string, followed by the actual string. There may be more than one
+   "TXXX" frame in each tag, but only one with the same description.
+
+     <Header for 'User defined text information frame', ID: "TXXX">
+     Text encoding     $xx
+     Description       <text string according to encoding> $00 (00)
+     Value             <text string according to encoding>
+
+
+4.3.   URL link frames
+
+   With these frames dynamic data such as webpages with touring
+   information, price information or plain ordinary news can be added to
+   the tag. There may only be one URL [URL] link frame of its kind in an
+   tag, except when stated otherwise in the frame description. If the
+   textstring is followed by a termination ($00 (00)) all the following
+   information should be ignored and not be displayed. All URL link
+   frame identifiers begins with "W". Only URL link frame identifiers
+   begins with "W". All URL link frames have the following format:
+
+     <Header for 'URL link frame', ID: "W000" - "WZZZ", excluding "WXXX"
+     described in 4.3.2.>
+     URL              <text string>
+
+
+4.3.1.   URL link frames - details
+
+  WCOM
+   The 'Commercial information' frame is a URL pointing at a webpage
+   with information such as where the album can be bought. There may be
+   more than one "WCOM" frame in a tag, but not with the same content.
+
+  WCOP
+   The 'Copyright/Legal information' frame is a URL pointing at a
+   webpage where the terms of use and ownership of the file is
+   described.
+
+  WOAF
+   The 'Official audio file webpage' frame is a URL pointing at a file
+   specific webpage.
+
+  WOAR
+   The 'Official artist/performer webpage' frame is a URL pointing at
+   the artists official webpage. There may be more than one "WOAR" frame
+   in a tag if the audio contains more than one performer, but not with
+   the same content.
+
+  WOAS
+   The 'Official audio source webpage' frame is a URL pointing at the
+   official webpage for the source of the audio file, e.g. a movie.
+
+  WORS
+   The 'Official internet radio station homepage' contains a URL
+   pointing at the homepage of the internet radio station.
+
+  WPAY
+   The 'Payment' frame is a URL pointing at a webpage that will handle
+   the process of paying for this file.
+
+  WPUB
+   The 'Publishers official webpage' frame is a URL pointing at the
+   official wepage for the publisher.
+
+
+4.3.2.   User defined URL link frame
+
+   This frame is intended for URL [URL] links concerning the audiofile
+   in a similar way to the other "W"-frames. The frame body consists
+   of a description of the string, represented as a terminated string,
+   followed by the actual URL. The URL is always encoded with ISO-8859-1
+   [ISO-8859-1]. There may be more than one "WXXX" frame in each tag,
+   but only one with the same description.
+
+     <Header for 'User defined URL link frame', ID: "WXXX">
+     Text encoding     $xx
+     Description       <text string according to encoding> $00 (00)
+     URL               <text string>
+
+
+4.4.   Involved people list
+
+   Since there might be a lot of people contributing to an audio file in
+   various ways, such as musicians and technicians, the 'Text
+   information frames' are often insufficient to list everyone involved
+   in a project. The 'Involved people list' is a frame containing the
+   names of those involved, and how they were involved. The body simply
+   contains a terminated string with the involvement directly followed
+   by a terminated string with the involvee followed by a new
+   involvement and so on. There may only be one "IPLS" frame in each
+   tag.
+
+     <Header for 'Involved people list', ID: "IPLS">
+     Text encoding          $xx
+     People list strings    <text strings according to encoding>
+
+
+4.5.   Music CD identifier
+
+   This frame is intended for music that comes from a CD, so that the CD
+   can be identified in databases such as the CDDB [CDDB]. The frame
+   consists of a binary dump of the Table Of Contents, TOC, from the CD,
+   which is a header of 4 bytes and then 8 bytes/track on the CD plus 8
+   bytes for the 'lead out' making a maximum of 804 bytes. The offset to
+   the beginning of every track on the CD should be described with a
+   four bytes absolute CD-frame address per track, and not with absolute
+   time. This frame requires a present and valid "TRCK" frame, even if
+   the CD's only got one track. There may only be one "MCDI" frame in
+   each tag.
+
+     <Header for 'Music CD identifier', ID: "MCDI">
+     CD TOC                <binary data>
+
+
+4.6.   Event timing codes
+
+   This frame allows synchronisation with key events in a song or sound.
+   The header is:
+
+     <Header for 'Event timing codes', ID: "ETCO">
+     Time stamp format    $xx
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   Followed by a list of key events in the following format:
+
+     Type of event   $xx
+     Time stamp      $xx (xx ...)
+
+   The 'Time stamp' is set to zero if directly at the beginning of the
+   sound or after the previous event. All events should be sorted in
+   chronological order. The type of event is as follows:
+
+     $00  padding (has no meaning)
+     $01  end of initial silence
+     $02  intro start
+     $03  mainpart start
+     $04  outro start
+     $05  outro end
+     $06  verse start
+     $07  refrain start
+     $08  interlude start
+     $09  theme start
+     $0A  variation start
+     $0B  key change
+     $0C  time change
+     $0D  momentary unwanted noise (Snap, Crackle & Pop)
+     $0E  sustained noise
+     $0F  sustained noise end
+     $10  intro end
+     $11  mainpart end
+     $12  verse end
+     $13  refrain end
+     $14  theme end
+
+     $15-$DF  reserved for future use
+
+     $E0-$EF  not predefined sync 0-F
+
+     $F0-$FC  reserved for future use
+
+     $FD  audio end (start of silence)
+     $FE  audio file ends
+     $FF  one more byte of events follows (all the following bytes with
+          the value $FF have the same function)
+
+   Terminating the start events such as "intro start" is not required.
+   The 'Not predefined sync's ($E0-EF) are for user events. You might
+   want to synchronise your music to something, like setting of an
+   explosion on-stage, turning on your screensaver etc.
+
+   There may only be one "ETCO" frame in each tag.
+
+
+4.7.   MPEG location lookup table
+
+   To increase performance and accuracy of jumps within a MPEG [MPEG]
+   audio file, frames with timecodes in different locations in the file
+   might be useful. The ID3v2 frame includes references that the
+   software can use to calculate positions in the file. After the frame
+   header is a descriptor of how much the 'frame counter' should
+   increase for every reference. If this value is two then the first
+   reference points out the second frame, the 2nd reference the 4th
+   frame, the 3rd reference the 6th frame etc. In a similar way the
+   'bytes between reference' and 'milliseconds between reference' points
+   out bytes and milliseconds respectively.
+
+   Each reference consists of two parts; a certain number of bits, as
+   defined in 'bits for bytes deviation', that describes the difference
+   between what is said in 'bytes between reference' and the reality and
+   a certain number of bits, as defined in 'bits for milliseconds
+   deviation', that describes the difference between what is said in
+   'milliseconds between reference' and the reality. The number of bits
+   in every reference, i.e. 'bits for bytes deviation'+'bits for
+   milliseconds deviation', must be a multiple of four. There may only
+   be one "MLLT" frame in each tag.
+
+     <Header for 'Location lookup table', ID: "MLLT">
+     MPEG frames between reference  $xx xx
+     Bytes between reference        $xx xx xx
+     Milliseconds between reference $xx xx xx
+     Bits for bytes deviation       $xx
+     Bits for milliseconds dev.     $xx
+
+   Then for every reference the following data is included;
+
+     Deviation in bytes         %xxx....
+     Deviation in milliseconds  %xxx....
+
+
+4.8.   Synchronised tempo codes
+
+   For a more accurate description of the tempo of a musical piece this
+   frame might be used. After the header follows one byte describing
+   which time stamp format should be used. Then follows one or more
+   tempo codes. Each tempo code consists of one tempo part and one time
+   part. The tempo is in BPM described with one or two bytes. If the
+   first byte has the value $FF, one more byte follows, which is added
+   to the first giving a range from 2 - 510 BPM, since $00 and $01 is
+   reserved. $00 is used to describe a beat-free time period, which is
+   not the same as a music-free time period. $01 is used to indicate one
+   single beat-stroke followed by a beat-free period.
+
+   The tempo descriptor is followed by a time stamp. Every time the
+   tempo in the music changes, a tempo descriptor may indicate this for
+   the player. All tempo descriptors should be sorted in chronological
+   order. The first beat-stroke in a time-period is at the same time as
+   the beat description occurs. There may only be one "SYTC" frame in
+   each tag.
+
+     <Header for 'Synchronised tempo codes', ID: "SYTC">
+     Time stamp format   $xx
+     Tempo data          <binary data>
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+
+4.9.   Unsychronised lyrics/text transcription
+
+   This frame contains the lyrics of the song or a text transcription of
+   other vocal activities. The head includes an encoding descriptor and
+   a content descriptor. The body consists of the actual text. The
+   'Content descriptor' is a terminated string. If no descriptor is
+   entered, 'Content descriptor' is $00 (00) only. Newline characters
+   are allowed in the text. There may be more than one 'Unsynchronised
+   lyrics/text transcription' frame in each tag, but only one with the
+   same language and content descriptor.
+
+     <Header for 'Unsynchronised lyrics/text transcription', ID: "USLT">
+     Text encoding        $xx
+     Language             $xx xx xx
+     Content descriptor   <text string according to encoding> $00 (00)
+     Lyrics/text          <full text string according to encoding>
+
+
+4.10.   Synchronised lyrics/text
+
+   This is another way of incorporating the words, said or sung lyrics,
+   in the audio file as text, this time, however, in sync with the
+   audio. It might also be used to describing events e.g. occurring on a
+   stage or on the screen in sync with the audio. The header includes a
+   content descriptor, represented with as terminated textstring. If no
+   descriptor is entered, 'Content descriptor' is $00 (00) only.
+
+     <Header for 'Synchronised lyrics/text', ID: "SYLT">
+     Text encoding        $xx
+     Language             $xx xx xx
+     Time stamp format    $xx
+     Content type         $xx
+     Content descriptor   <text string according to encoding> $00 (00)
+
+
+   Encoding:   $00  ISO-8859-1 [ISO-8859-1] character set is used => $00
+                    is sync identifier.
+               $01  Unicode [UNICODE] character set is used => $00 00 is
+                    sync identifier.
+
+   Content type:   $00 is other
+                   $01 is lyrics
+                   $02 is text transcription
+                   $03 is movement/part name (e.g. "Adagio")
+                   $04 is events (e.g. "Don Quijote enters the stage")
+                   $05 is chord (e.g. "Bb F Fsus")
+                   $06 is trivia/'pop up' information
+
+   Time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Abolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   The text that follows the frame header differs from that of the
+   unsynchronised lyrics/text transcription in one major way. Each
+   syllable (or whatever size of text is considered to be convenient by
+   the encoder) is a null terminated string followed by a time stamp
+   denoting where in the sound file it belongs. Each sync thus has the
+   following structure:
+
+     Terminated text to be synced (typically a syllable)
+     Sync identifier (terminator to above string)   $00 (00)
+     Time stamp                                     $xx (xx ...)
+
+   The 'time stamp' is set to zero or the whole sync is omitted if
+   located directly at the beginning of the sound. All time stamps
+   should be sorted in chronological order. The sync can be considered
+   as a validator of the subsequent string.
+
+   Newline ($0A) characters are allowed in all "SYLT" frames and should
+   be used after every entry (name, event etc.) in a frame with the
+   content type $03 - $04.
+
+   A few considerations regarding whitespace characters: Whitespace
+   separating words should mark the beginning of a new word, thus
+   occurring in front of the first syllable of a new word. This is also
+   valid for new line characters. A syllable followed by a comma should
+   not be broken apart with a sync (both the syllable and the comma
+   should be before the sync).
+
+   An example: The "USLT" passage
+
+     "Strangers in the night" $0A "Exchanging glances"
+
+   would be "SYLT" encoded as:
+
+     "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx
+     " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx
+     xx "glan" $00 xx xx "ces" $00 xx xx
+
+   There may be more than one "SYLT" frame in each tag, but only one
+   with the same language and content descriptor.
+
+
+4.11.   Comments
+
+   This frame is indended for any kind of full text information that
+   does not fit in any other frame. It consists of a frame header
+   followed by encoding, language and content descriptors and is ended
+   with the actual comment as a text string. Newline characters are
+   allowed in the comment text string. There may be more than one
+   comment frame in each tag, but only one with the same language and
+   content descriptor.
+
+     <Header for 'Comment', ID: "COMM">
+     Text encoding          $xx
+     Language               $xx xx xx
+     Short content descrip. <text string according to encoding> $00 (00)
+     The actual text        <full text string according to encoding>
+
+
+4.12.   Relative volume adjustment
+
+   This is a more subjective function than the previous ones. It allows
+   the user to say how much he wants to increase/decrease the volume on
+   each channel while the file is played. The purpose is to be able to
+   align all files to a reference volume, so that you don't have to
+   change the volume constantly. This frame may also be used to balance
+   adjust the audio. If the volume peak levels are known then this could
+   be described with the 'Peak volume right' and 'Peak volume left'
+   field. If Peakvolume is not known these fields could be left zeroed
+   or, if no other data follows, be completely omitted. There may only
+   be one "RVAD" frame in each tag.
+
+     <Header for 'Relative volume adjustment', ID: "RVAD">
+     Increment/decrement           %00xxxxxx
+     Bits used for volume descr.   $xx
+     Relative volume change, right $xx xx (xx ...)
+     Relative volume change, left  $xx xx (xx ...)
+     Peak volume right             $xx xx (xx ...)
+     Peak volume left              $xx xx (xx ...)
+
+   In the increment/decrement field bit 0 is used to indicate the right
+   channel and bit 1 is used to indicate the left channel. 1 is
+   increment and 0 is decrement.
+
+   The 'bits used for volume description' field is normally $10 (16
+   bits) for MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value
+   may not be $00. The volume is always represented with whole bytes,
+   padded in the beginning (highest bits) when 'bits used for volume
+   description' is not a multiple of eight.
+
+   This datablock is then optionally followed by a volume definition for
+   the left and right back channels. If this information is appended to
+   the frame the first two channels will be treated as front channels.
+   In the increment/decrement field bit 2 is used to indicate the right
+   back channel and bit 3 for the left back channel.
+
+     Relative volume change, right back $xx xx (xx ...)
+     Relative volume change, left back  $xx xx (xx ...)
+     Peak volume right back             $xx xx (xx ...)
+     Peak volume left back              $xx xx (xx ...)
+
+   If the center channel adjustment is present the following is appended
+   to the existing frame, after the left and right back channels. The
+   center channel is represented by bit 4 in the increase/decrease
+   field.
+
+     Relative volume change, center  $xx xx (xx ...)
+     Peak volume center              $xx xx (xx ...)
+
+   If the bass channel adjustment is present the following is appended
+   to the existing frame, after the center channel. The bass channel is
+   represented by bit 5 in the increase/decrease field.
+
+     Relative volume change, bass  $xx xx (xx ...)
+     Peak volume bass              $xx xx (xx ...)
+
+
+4.13.   Equalisation
+
+   This is another subjective, alignment frame. It allows the user to
+   predefine an equalisation curve within the audio file. There may only
+   be one "EQUA" frame in each tag.
+
+     <Header of 'Equalisation', ID: "EQUA">
+     Adjustment bits    $xx
+
+   The 'adjustment bits' field defines the number of bits used for
+   representation of the adjustment. This is normally $10 (16 bits) for
+   MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not be
+   $00.
+
+   This is followed by 2 bytes + ('adjustment bits' rounded up to the
+   nearest byte) for every equalisation band in the following format,
+   giving a frequency range of 0 - 32767Hz:
+
+     Increment/decrement   %x (MSB of the Frequency)
+     Frequency             (lower 15 bits)
+     Adjustment            $xx (xx ...)
+
+   The increment/decrement bit is 1 for increment and 0 for decrement.
+   The equalisation bands should be ordered increasingly with reference
+   to frequency. All frequencies don't have to be declared. The
+   equalisation curve in the reading software should be interpolated
+   between the values in this frame. Three equal adjustments for three
+   subsequent frequencies. A frequency should only be described once in
+   the frame.
+
+
+4.14.   Reverb
+
+   Yet another subjective one. You may here adjust echoes of different
+   kinds. Reverb left/right is the delay between every bounce in ms.
+   Reverb bounces left/right is the number of bounces that should be
+   made. $FF equals an infinite number of bounces. Feedback is the
+   amount of volume that should be returned to the next echo bounce. $00
+   is 0%, $FF is 100%. If this value were $7F, there would be 50% volume
+   reduction on the first bounce, 50% of that on the second and so on.
+   Left to left means the sound from the left bounce to be played in the
+   left speaker, while left to right means sound from the left bounce to
+   be played in the right speaker.
+
+   'Premix left to right' is the amount of left sound to be mixed in the
+   right before any reverb is applied, where $00 id 0% and $FF is 100%.
+   'Premix right to left' does the same thing, but right to left.
+   Setting both premix to $FF would result in a mono output (if the
+   reverb is applied symmetric). There may only be one "RVRB" frame in
+   each tag.
+
+     <Header for 'Reverb', ID: "RVRB">
+     Reverb left (ms)                 $xx xx
+     Reverb right (ms)                $xx xx
+     Reverb bounces, left             $xx
+     Reverb bounces, right            $xx
+     Reverb feedback, left to left    $xx
+     Reverb feedback, left to right   $xx
+     Reverb feedback, right to right  $xx
+     Reverb feedback, right to left   $xx
+     Premix left to right             $xx
+     Premix right to left             $xx
+
+
+4.15.   Attached picture
+
+   This frame contains a picture directly related to the audio file.
+   Image format is the MIME type and subtype [MIME] for the image. In
+   the event that the MIME media type name is omitted, "image/" will be
+   implied. The "image/png" [PNG] or "image/jpeg" [JFIF] picture format
+   should be used when interoperability is wanted. Description is a
+   short description of the picture, represented as a terminated
+   textstring. The description has a maximum length of 64 characters,
+   but may be empty. There may be several pictures attached to one file,
+   each in their individual "APIC" frame, but only one with the same
+   content descriptor. There may only be one picture with the picture
+   type declared as picture type $01 and $02 respectively. There is the
+   possibility to put only a link to the image file by using the 'MIME
+   type' "-->" and having a complete URL [URL] instead of picture data.
+   The use of linked files should however be used sparingly since there
+   is the risk of separation of files.
+
+     <Header for 'Attached picture', ID: "APIC">
+     Text encoding      $xx
+     MIME type          <text string> $00
+     Picture type       $xx
+     Description        <text string according to encoding> $00 (00)
+     Picture data       <binary data>
+
+
+   Picture type:  $00  Other
+                  $01  32x32 pixels 'file icon' (PNG only)
+                  $02  Other file icon
+                  $03  Cover (front)
+                  $04  Cover (back)
+                  $05  Leaflet page
+                  $06  Media (e.g. lable side of CD)
+                  $07  Lead artist/lead performer/soloist
+                  $08  Artist/performer
+                  $09  Conductor
+                  $0A  Band/Orchestra
+                  $0B  Composer
+                  $0C  Lyricist/text writer
+                  $0D  Recording Location
+                  $0E  During recording
+                  $0F  During performance
+                  $10  Movie/video screen capture
+                  $11  A bright coloured fish
+                  $12  Illustration
+                  $13  Band/artist logotype
+                  $14  Publisher/Studio logotype
+
+
+4.16.   General encapsulated object
+
+   In this frame any type of file can be encapsulated. After the header,
+   'Frame size' and 'Encoding' follows 'MIME type' [MIME] represented as
+   as a terminated string encoded with ISO 8859-1 [ISO-8859-1]. The
+   filename is case sensitive and is encoded as 'Encoding'. Then follows
+   a content description as terminated string, encoded as 'Encoding'.
+   The last thing in the frame is the actual object. The first two
+   strings may be omitted, leaving only their terminations. MIME type is
+   always an ISO-8859-1 text string. There may be more than one "GEOB"
+   frame in each tag, but only one with the same content descriptor.
+
+     <Header for 'General encapsulated object', ID: "GEOB">
+     Text encoding          $xx
+     MIME type              <text string> $00
+     Filename               <text string according to encoding> $00 (00)
+     Content description    <text string according to encóding> $00 (00)
+     Encapsulated object    <binary data>
+
+
+4.17.   Play counter
+
+   This is simply a counter of the number of times a file has been
+   played. The value is increased by one every time the file begins to
+   play. There may only be one "PCNT" frame in each tag. When the
+   counter reaches all one's, one byte is inserted in front of the
+   counter thus making the counter eight bits bigger.  The counter must
+   be at least 32-bits long to begin with.
+
+     <Header for 'Play counter', ID: "PCNT">
+     Counter        $xx xx xx xx (xx ...)
+
+
+4.18.   Popularimeter
+
+   The purpose of this frame is to specify how good an audio file is.
+   Many interesting applications could be found to this frame such as a
+   playlist that features better audiofiles more often than others or it
+   could be used to profile a person's taste and find other 'good' files
+   by comparing people's profiles. The frame is very simple. It contains
+   the email address to the user, one rating byte and a four byte play
+   counter, intended to be increased with one for every time the file is
+   played. The email is a terminated string. The rating is 1-255 where
+   1 is worst and 255 is best. 0 is unknown. If no personal counter is
+   wanted it may be omitted.  When the counter reaches all one's, one
+   byte is inserted in front of the counter thus making the counter
+   eight bits bigger in the same away as the play counter ("PCNT").
+   There may be more than one "POPM" frame in each tag, but only one
+   with the same email address.
+
+     <Header for 'Popularimeter', ID: "POPM">
+     Email to user   <text string> $00
+     Rating          $xx
+     Counter         $xx xx xx xx (xx ...)
+
+
+4.19.   Recommended buffer size
+
+   Sometimes the server from which a audio file is streamed is aware of
+   transmission or coding problems resulting in interruptions in the
+   audio stream. In these cases, the size of the buffer can be
+   recommended by the server using this frame. If the 'embedded info
+   flag' is true (1) then this indicates that an ID3 tag with the
+   maximum size described in 'Buffer size' may occur in the audiostream.
+   In such case the tag should reside between two MPEG [MPEG] frames, if
+   the audio is MPEG encoded. If the position of the next tag is known,
+   'offset to next tag' may be used. The offset is calculated from the
+   end of tag in which this frame resides to the first byte of the
+   header in the next. This field may be omitted. Embedded tags are
+   generally not recommended since this could render unpredictable
+   behaviour from present software/hardware.
+
+   For applications like streaming audio it might be an idea to embed
+   tags into the audio stream though. If the clients connects to
+   individual connections like HTTP and there is a possibility to begin
+   every transmission with a tag, then this tag should include a
+   'recommended buffer size' frame. If the client is connected to a
+   arbitrary point in the stream, such as radio or multicast, then the
+   'recommended buffer size' frame should be included in every tag.
+   Every tag that is picked up after the initial/first tag is to be
+   considered as an update of the previous one. E.g. if there is a
+   "TIT2" frame in the first received tag and one in the second tag,
+   then the first should be 'replaced' with the second.
+
+   The 'Buffer size' should be kept to a minimum. There may only be one
+   "RBUF" frame in each tag.
+
+     <Header for 'Recommended buffer size', ID: "RBUF">
+     Buffer size               $xx xx xx
+     Embedded info flag        %0000000x
+     Offset to next tag        $xx xx xx xx
+
+
+4.20.   Audio encryption
+
+   This frame indicates if the actual audio stream is encrypted, and by
+   whom. Since standardisation of such encrypion scheme is beyond this
+   document, all "AENC" frames begin with a terminated string with a
+   URL containing an email address, or a link to a location where an
+   email address can be found, that belongs to the organisation
+   responsible for this specific encrypted audio file. Questions
+   regarding the encrypted audio should be sent to the email address
+   specified. If a $00 is found directly after the 'Frame size' and the
+   audiofile indeed is encrypted, the whole file may be considered
+   useless.
+
+   After the 'Owner identifier', a pointer to an unencrypted part of the
+   audio can be specified. The 'Preview start' and 'Preview length' is
+   described in frames. If no part is unencrypted, these fields should
+   be left zeroed. After the 'preview length' field follows optionally a
+   datablock required for decryption of the audio. There may be more
+   than one "AENC" frames in a tag, but only one with the same 'Owner
+   identifier'.
+
+     <Header for 'Audio encryption', ID: "AENC">
+     Owner identifier   <text string> $00
+     Preview start      $xx xx
+     Preview length     $xx xx
+     Encryption info    <binary data>
+
+
+4.21.   Linked information
+
+   To keep space waste as low as possible this frame may be used to link
+   information from another ID3v2 tag that might reside in another audio
+   file or alone in a binary file. It is recommended that this method is
+   only used when the files are stored on a CD-ROM or other
+   circumstances when the risk of file seperation is low. The frame
+   contains a frame identifier, which is the frame that should be linked
+   into this tag, a URL [URL] field, where a reference to the file where
+   the frame is given, and additional ID data, if needed. Data should be
+   retrieved from the first tag found in the file to which this link
+   points. There may be more than one "LINK" frame in a tag, but only
+   one with the same contents. A linked frame is to be considered as
+   part of the tag and has the same restrictions as if it was a physical
+   part of the tag (i.e. only one "RVRB" frame allowed, whether it's
+   linked or not).
+
+     <Header for 'Linked information', ID: "LINK">
+     Frame identifier        $xx xx xx
+     URL                     <text string> $00
+     ID and additional data  <text string(s)>
+
+   Frames that may be linked and need no additional data are "IPLS",
+   "MCID", "ETCO", "MLLT", "SYTC", "RVAD", "EQUA", "RVRB", "RBUF", the
+   text information frames and the URL link frames.
+
+   The "TXXX", "APIC", "GEOB" and "AENC" frames may be linked with
+   the content descriptor as additional ID data.
+
+   The "COMM", "SYLT" and "USLT" frames may be linked with three bytes
+   of language descriptor directly followed by a content descriptor as
+   additional ID data.
+
+
+4.22.   Position synchronisation frame
+
+   This frame delivers information to the listener of how far into the
+   audio stream he picked up; in effect, it states the time offset of
+   the first frame in the stream. The frame layout is:
+
+     <Head for 'Position synchronisation', ID: "POSS">
+     Time stamp format         $xx
+     Position                  $xx (xx ...)
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   and position is where in the audio the listener starts to receive,
+   i.e. the beginning of the next frame. If this frame is used in the
+   beginning of a file the value is always 0. There may only be one
+   "POSS" frame in each tag.
+
+
+4.23.   Terms of use frame
+
+   This frame contains a brief description of the terms of use and
+   ownership of the file. More detailed information concerning the legal
+   terms might be available through the "WCOP" frame. Newlines are
+   allowed in the text. There may only be one "USER" frame in a tag.
+
+     <Header for 'Terms of use frame', ID: "USER">
+     Text encoding        $xx
+     Language             $xx xx xx
+     The actual text      <text string according to encoding>
+
+
+4.24.   Ownership frame
+
+   The ownership frame might be used as a reminder of a made transaction
+   or, if signed, as proof. Note that the "USER" and "TOWN" frames are
+   good to use in conjunction with this one. The frame begins, after the
+   frame ID, size and encoding fields, with a 'price payed' field. The
+   first three characters of this field contains the currency used for
+   the transaction, encoded according to ISO 4217 [ISO-4217] alphabetic
+   currency code. Concatenated to this is the actual price payed, as a
+   numerical string using "." as the decimal separator. Next is an 8
+   character date string (YYYYMMDD) followed by a string with the name
+   of the seller as the last field in the frame. There may only be one
+   "OWNE" frame in a tag.
+
+     <Header for 'Ownership frame', ID: "OWNE">
+     Text encoding     $xx
+     Price payed       <text string> $00
+     Date of purch.    <text string>
+     Seller            <text string according to encoding>
+
+
+4.25.   Commercial frame
+
+   This frame enables several competing offers in the same tag by
+   bundling all needed information. That makes this frame rather complex
+   but it's an easier solution than if one tries to achieve the same
+   result with several frames. The frame begins, after the frame ID,
+   size and encoding fields, with a price string field. A price is
+   constructed by one three character currency code, encoded according
+   to ISO 4217 [ISO-4217] alphabetic currency code, followed by a
+   numerical value where "." is used as decimal seperator. In the price
+   string several prices may be concatenated, seperated by a "/"
+   character, but there may only be one currency of each type.
+
+   The price string is followed by an 8 character date string in the
+   format YYYYMMDD, describing for how long the price is valid. After
+   that is a contact URL, with which the user can contact the seller,
+   followed by a one byte 'received as' field. It describes how the
+   audio is delivered when bought according to the following list:
+
+        $00  Other
+        $01  Standard CD album with other songs
+        $02  Compressed audio on CD
+        $03  File over the Internet
+        $04  Stream over the Internet
+        $05  As note sheets
+        $06  As note sheets in a book with other sheets
+        $07  Music on other media
+        $08  Non-musical merchandise
+
+   Next follows a terminated string with the name of the seller followed
+   by a terminated string with a short description of the product. The
+   last thing is the ability to include a company logotype. The first of
+   them is the 'Picture MIME type' field containing information about
+   which picture format is used. In the event that the MIME media type
+   name is omitted, "image/" will be implied. Currently only "image/png"
+   and "image/jpeg" are allowed. This format string is followed by the
+   binary picture data. This two last fields may be omitted if no
+   picture is to attach.
+
+     <Header for 'Commercial frame', ID: "COMR">
+     Text encoding      $xx
+     Price string       <text string> $00
+     Valid until        <text string>
+     Contact URL        <text string> $00
+     Received as        $xx
+     Name of seller     <text string according to encoding> $00 (00)
+     Description        <text string according to encoding> $00 (00)
+     Picture MIME type  <string> $00
+     Seller logo        <binary data>
+
+
+4.26.   Encryption method registration
+
+   To identify with which method a frame has been encrypted the
+   encryption method must be registered in the tag with this frame. The
+   'Owner identifier' is a null-terminated string with a URL [URL]
+   containing an email address, or a link to a location where an email
+   address can be found, that belongs to the organisation responsible
+   for this specific encryption method. Questions regarding the
+   encryption method should be sent to the indicated email address. The
+   'Method symbol' contains a value that is associated with this method
+   throughout the whole tag. Values below $80 are reserved. The 'Method
+   symbol' may optionally be followed by encryption specific data. There
+   may be several "ENCR" frames in a tag but only one containing the
+   same symbol and only one containing the same owner identifier. The
+   method must be used somewhere in the tag. See section 3.3.1, flag j
+   for more information.
+
+     <Header for 'Encryption method registration', ID: "ENCR">
+     Owner identifier    <text string> $00
+     Method symbol       $xx
+     Encryption data     <binary data>
+
+
+4.27.   Group identification registration
+
+   This frame enables grouping of otherwise unrelated frames. This can
+   be used when some frames are to be signed. To identify which frames
+   belongs to a set of frames a group identifier must be registered in
+   the tag with this frame. The 'Owner identifier' is a null-terminated
+   string with a URL [URL] containing an email address, or a link to a
+   location where an email address can be found, that belongs to the
+   organisation responsible for this grouping. Questions regarding the
+   grouping should be sent to the indicated email address. The 'Group
+   symbol' contains a value that associates the frame with this group
+   throughout the whole tag. Values below $80 are reserved. The 'Group
+   symbol' may optionally be followed by some group specific data, e.g.
+   a digital signature. There may be several "GRID" frames in a tag but
+   only one containing the same symbol and only one containing the same
+   owner identifier. The group symbol must be used somewhere in the tag.
+   See section 3.3.1, flag j for more information.
+
+     <Header for 'Group ID registration', ID: "GRID">
+     Owner identifier      <text string> $00
+     Group symbol          $xx
+	 Group dependent data  <binary data>
+
+
+4.28.   Private frame
+
+   This frame is used to contain information from a software producer
+   that its program uses and does not fit into the other frames. The
+   frame consists of an 'Owner identifier' string and the binary data.
+   The 'Owner identifier' is a null-terminated string with a URL [URL]
+   containing an email address, or a link to a location where an email
+   address can be found, that belongs to the organisation responsible
+   for the frame. Questions regarding the frame should be sent to the
+   indicated email address. The tag may contain more than one "PRIV"
+   frame but only with different contents. It is recommended to keep the
+   number of "PRIV" frames as low as possible.
+
+     <Header for 'Private frame', ID: "PRIV">
+     Owner identifier      <text string> $00
+	 The private data      <binary data>
+
+
+5.   The 'unsynchronisation scheme'
+
+   The only purpose of the 'unsynchronisation scheme' is to make the
+   ID3v2 tag as compatible as possible with existing software. There is
+   no use in 'unsynchronising' tags if the file is only to be processed
+   by new software. Unsynchronisation may only be made with MPEG 2 layer
+   I, II and III and MPEG 2.5 files.
+
+   Whenever a false synchronisation is found within the tag, one zeroed
+   byte is inserted after the first false synchronisation byte. The
+   format of a correct sync that should be altered by ID3 encoders is as
+   follows:
+
+         %11111111 111xxxxx
+
+   And should be replaced with:
+
+         %11111111 00000000 111xxxxx
+
+   This has the side effect that all $FF 00 combinations have to be
+   altered, so they won't be affected by the decoding process. Therefore
+   all the $FF 00 combinations have to be replaced with the $FF 00 00
+   combination during the unsynchronisation.
+
+   To indicate usage of the unsynchronisation, the first bit in 'ID3
+   flags' should be set. This bit should only be set if the tag
+   contains a, now corrected, false synchronisation. The bit should
+   only be clear if the tag does not contain any false synchronisations.
+
+   Do bear in mind, that if a compression scheme is used by the encoder,
+   the unsynchronisation scheme should be applied *afterwards*. When
+   decoding a compressed, 'unsynchronised' file, the 'unsynchronisation
+   scheme' should be parsed first, decompression afterwards.
+
+   If the last byte in the tag is $FF, and there is a need to eliminate
+   false synchronisations in the tag, at least one byte of padding
+   should be added.
+
+
+6.   Copyright
+
+   Copyright (C) Martin Nilsson 1998. All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that a reference to this document is included on all
+   such copies and derivative works. However, this document itself may
+   not be modified in any way and reissued as the original document.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked.
+
+   This document and the information contained herein is provided on an
+   "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
+   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
+   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+
+7.   References
+
+   [CDDB] Compact Disc Data Base
+
+      http://www.cddb.com
+
+   [ID3v2] Martin Nilsson, "ID3v2 informal standard".
+
+      http://www.id3lib.org/id3/id3v2-00.txt
+
+   [ISO-639-2] ISO/FDIS 639-2.
+   Codes for the representation of names of languages, Part 2: Alpha-3
+   code. Technical committee / subcommittee: TC 37 / SC 2
+
+   [ISO-4217] ISO 4217:1995.
+   Codes for the representation of currencies and funds.
+   Technical committee / subcommittee: TC 68
+
+   [ISO-8859-1] ISO/IEC DIS 8859-1.
+   8-bit single-byte coded graphic character sets, Part 1: Latin
+   alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2
+
+   [ISRC] ISO 3901:1986
+   International Standard Recording Code (ISRC).
+   Technical committee / subcommittee: TC 46 / SC 9
+
+   [JFIF] JPEG File Interchange Format, version 1.02
+
+      http://www.w3.org/Graphics/JPEG/jfif.txt">http://www.w3.org/Graphics/JPEG/jfif.txt
+
+   [MIME] Freed, N.  and N. Borenstein,  "Multipurpose Internet Mail
+   Extensions (MIME) Part One: Format of Internet Message Bodies",
+   RFC 2045, November 1996.
+
+      ftp://ftp.isi.edu/in-notes/rfc2045.txt">ftp://ftp.isi.edu/in-notes/rfc2045.txt
+
+   [MPEG] ISO/IEC 11172-3:1993.
+   Coding of moving pictures and associated audio for digital storage
+   media at up to about 1,5 Mbit/s, Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC 13818-3:1995
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC DIS 13818-3
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio (Revision of ISO/IEC 13818-3:1995)
+
+
+   [PNG] Portable Network Graphics, version 1.0
+
+      http://www.w3.org/TR/REC-png-multi.html
+
+   [UNICODE] ISO/IEC 10646-1:1993.
+   Universal Multiple-Octet Coded Character Set (UCS), Part 1:
+   Architecture and Basic Multilingual Plane.
+   Technical committee / subcommittee: JTC 1 / SC 2
+
+      http://www.unicode.org/
+
+   [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource
+   Locators (URL).", RFC 1738, December 1994.
+
+      ftp://ftp.isi.edu/in-notes/rfc1738.txt
+
+   [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, "ZLIB
+   Compressed
+   Data Format Specification version 3.3", RFC 1950, May 1996.
+
+      ftp://ftp.isi.edu/in-notes/rfc1950.txt
+
+
+8.   Appendix
+
+
+A.   Appendix A - Genre List from ID3v1
+
+   The following genres is defined in ID3v1
+
+      0.Blues
+      1.Classic Rock
+      2.Country
+      3.Dance
+      4.Disco
+      5.Funk
+      6.Grunge
+      7.Hip-Hop
+      8.Jazz
+      9.Metal
+     10.New Age
+     11.Oldies
+     12.Other
+     13.Pop
+     14.R&B
+     15.Rap
+     16.Reggae
+     17.Rock
+     18.Techno
+     19.Industrial
+     20.Alternative
+     21.Ska
+     22.Death Metal
+     23.Pranks
+     24.Soundtrack
+     25.Euro-Techno
+     26.Ambient
+     27.Trip-Hop
+     28.Vocal
+     29.Jazz+Funk
+     30.Fusion
+     31.Trance
+     32.Classical
+     33.Instrumental
+     34.Acid
+     35.House
+     36.Game
+     37.Sound Clip
+     38.Gospel
+     39.Noise
+     40.AlternRock
+     41.Bass
+     42.Soul
+     43.Punk
+     44.Space
+     45.Meditative
+     46.Instrumental Pop
+     47.Instrumental Rock
+     48.Ethnic
+     49.Gothic
+     50.Darkwave
+     51.Techno-Industrial
+     52.Electronic
+     53.Pop-Folk
+     54.Eurodance
+     55.Dream
+     56.Southern Rock
+     57.Comedy
+     58.Cult
+     59.Gangsta
+     60.Top 40
+     61.Christian Rap
+     62.Pop/Funk
+     63.Jungle
+     64.Native American
+     65.Cabaret
+     66.New Wave
+     67.Psychadelic
+     68.Rave
+     69.Showtunes
+     70.Trailer
+     71.Lo-Fi
+     72.Tribal
+     73.Acid Punk
+     74.Acid Jazz
+     75.Polka
+     76.Retro
+     77.Musical
+     78.Rock & Roll
+     79.Hard Rock
+
+   The following genres are Winamp extensions
+
+     80.Folk
+     81.Folk-Rock
+     82.National Folk
+     83.Swing
+     84.Fast Fusion
+     85.Bebob
+     86.Latin
+     87.Revival
+     88.Celtic
+     89.Bluegrass
+     90.Avantgarde
+     91.Gothic Rock
+     92.Progressive Rock
+     93.Psychedelic Rock
+     94.Symphonic Rock
+     95.Slow Rock
+     96.Big Band
+     97.Chorus
+     98.Easy Listening
+     99.Acoustic
+    100.Humour
+    101.Speech
+    102.Chanson
+    103.Opera
+    104.Chamber Music
+    105.Sonata
+    106.Symphony
+    107.Booty Bass
+    108.Primus
+    109.Porn Groove
+    110.Satire
+    111.Slow Jam
+    112.Club
+    113.Tango
+    114.Samba
+    115.Folklore
+    116.Ballad
+    117.Power Ballad
+    118.Rhythmic Soul
+    119.Freestyle
+    120.Duet
+    121.Punk Rock
+    122.Drum Solo
+    123.Acapella
+    124.Euro-House
+    125.Dance Hall
+
+
+9.   Author's Address
+
+   Written by
+
+     Martin Nilsson
+     Rydsvägen 246 C. 30
+     S-584 34 Linköping
+     Sweden
+
+     Email: nilsson at id3.org
+
+
+   Edited by
+
+     Dirk Mahoney
+     57 Pechey Street
+     Chermside Q
+     Australia 4032
+
+     Email: dirk at id3.org
+
+
+     Johan Sundström
+     Alsättersgatan 5 A. 34
+     S-584 35 Linköping
+     Sweden
+
+     Email: johan at id3.org
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-frames.txt b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-frames.txt
new file mode 100644
index 0000000..c788cbe
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-frames.txt
@@ -0,0 +1,1734 @@
+$Id: id3v2.4.0-frames.txt,v 1.1 2009/02/11 06:05:00 llucius Exp $
+
+Informal standard                                             M. Nilsson
+Document: id3v2.4.0-frames.txt                         1st November 2000
+
+
+                  ID3 tag version 2.4.0 - Native Frames
+
+Status of this document
+
+   This document is an informal standard and replaces the ID3v2.3.0
+   standard [ID3v2]. A formal standard will use another revision number
+   even if the content is identical to document. The contents in this
+   document may change for clarifications but never for added or altered
+   functionallity.
+
+   Distribution of this document is unlimited.
+
+
+Abstract
+
+   This document describes the frames natively supported by ID3v2.4.0,
+   which is a revised version of the ID3v2 informal standard [ID3v2.3.0]
+   version 2.3.0. The ID3v2 offers a flexible way of storing audio meta
+   information within audio file itself. The information may be
+   technical information, such as equalisation curves, as well as title,
+   performer, copyright etc.
+
+   ID3v2.4.0 is meant to be as close as possible to ID3v2.3.0 in order
+   to allow for implementations to be revised as easily as possible.
+
+
+1.   Table of contents
+
+   2.   Conventions in this document
+   3.   Default flags
+   4.   Declared ID3v2 frames
+     4.1.   Unique file identifier
+     4.2.   Text information frames
+       4.2.1.   Identification frames
+       4.2.2.   Involved persons frames
+       4.2.3.   Derived and subjective properties frames
+       4.2.4.   Rights and license frames
+       4.2.5.   Other text frames
+       4.2.6.   User defined text information frame
+     4.3.   URL link frames
+       4.3.1.   URL link frames - details
+       4.3.2.   User defined URL link frame
+     4.4.   Music CD Identifier
+     4.5.   Event timing codes
+     4.6.   MPEG location lookup table
+     4.7.   Synced tempo codes
+     4.8.   Unsynchronised lyrics/text transcription
+     4.9.  Synchronised lyrics/text
+     4.10.  Comments
+     4.11.  Relative volume adjustment (2)
+     4.12.  Equalisation (2)
+     4.13.  Reverb
+     4.14.  Attached picture
+     4.15.  General encapsulated object
+     4.16.  Play counter
+     4.17.  Popularimeter
+     4.18.  Recommended buffer size
+     4.19.  Audio encryption
+     4.20.  Linked information
+     4.21.  Position synchronisation frame
+     4.22.  Terms of use
+     4.23.  Ownership frame
+     4.24.  Commercial frame
+     4.25.  Encryption method registration
+     4.26.  Group identification registration
+     4.27.  Private frame
+     4.28.  Signature frame
+     4.29.  Seek frame
+     4.30.  Audio seek point index
+   5.   Copyright
+   6.   References
+   7.   Appendix
+     A.   Appendix A - Genre List from ID3v1
+   8.   Author's Address
+
+
+2.   Conventions in this document
+
+   Text within "" is a text string exactly as it appears in a tag.
+   Numbers preceded with $ are hexadecimal and numbers preceded with %
+   are binary. $xx is used to indicate a byte with unknown content. %x
+   is used to indicate a bit with unknown content. The most significant
+   bit (MSB) of a byte is called 'bit 7' and the least significant bit
+   (LSB) is called 'bit 0'.
+
+   A tag is the whole tag described the ID3v2 main structure document
+   [ID3v2-strct]. A frame is a block of information in the tag. The tag
+   consists of a header, frames and optional padding. A field is a piece
+   of information; one value, a string etc. A numeric string is a string
+   that consists of the characters "0123456789" only.
+
+   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+   "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
+   document are to be interpreted as described in RFC 2119 [KEYWORDS].
+
+
+3.   Default flags
+
+   The default settings for the frames described in this document can be
+   divided into the following classes. The flags may be set differently
+   if found more suitable by the software.
+
+    1. Discarded if tag is altered, discarded if file is altered.
+
+       None.
+
+    2. Discarded if tag is altered, preserved if file is altered.
+
+       None.
+
+    3. Preserved if tag is altered, discarded if file is altered.
+
+       ASPI, AENC, ETCO, EQU2, MLLT, POSS, SEEK, SYLT, SYTC, RVA2, TENC,
+       TLEN
+
+    4. Preserved if tag is altered, preserved if file is altered.
+
+       The rest of the frames.
+
+
+4.   Declared ID3v2 frames
+
+   The following frames are declared in this draft.
+
+  4.19  AENC Audio encryption
+  4.14  APIC Attached picture
+  4.30  ASPI Audio seek point index
+
+  4.10  COMM Comments
+  4.24  COMR Commercial frame
+
+  4.25  ENCR Encryption method registration
+  4.12  EQU2 Equalisation (2)
+  4.5   ETCO Event timing codes
+
+  4.15  GEOB General encapsulated object
+  4.26  GRID Group identification registration
+
+  4.20  LINK Linked information
+
+  4.4   MCDI Music CD identifier
+  4.6   MLLT MPEG location lookup table
+
+  4.23  OWNE Ownership frame
+
+  4.27  PRIV Private frame
+  4.16  PCNT Play counter
+  4.17  POPM Popularimeter
+  4.21  POSS Position synchronisation frame
+
+  4.18  RBUF Recommended buffer size
+  4.11  RVA2 Relative volume adjustment (2)
+  4.13  RVRB Reverb
+
+  4.29  SEEK Seek frame
+  4.28  SIGN Signature frame
+  4.9   SYLT Synchronised lyric/text
+  4.7   SYTC Synchronised tempo codes
+
+  4.2.1 TALB Album/Movie/Show title
+  4.2.3 TBPM BPM (beats per minute)
+  4.2.2 TCOM Composer
+  4.2.3 TCON Content type
+  4.2.4 TCOP Copyright message
+  4.2.5 TDEN Encoding time
+  4.2.5 TDLY Playlist delay
+  4.2.5 TDOR Original release time
+  4.2.5 TDRC Recording time
+  4.2.5 TDRL Release time
+  4.2.5 TDTG Tagging time
+  4.2.2 TENC Encoded by
+  4.2.2 TEXT Lyricist/Text writer
+  4.2.3 TFLT File type
+  4.2.2 TIPL Involved people list
+  4.2.1 TIT1 Content group description
+  4.2.1 TIT2 Title/songname/content description
+  4.2.1 TIT3 Subtitle/Description refinement
+  4.2.3 TKEY Initial key
+  4.2.3 TLAN Language(s)
+  4.2.3 TLEN Length
+  4.2.2 TMCL Musician credits list
+  4.2.3 TMED Media type
+  4.2.3 TMOO Mood
+  4.2.1 TOAL Original album/movie/show title
+  4.2.5 TOFN Original filename
+  4.2.2 TOLY Original lyricist(s)/text writer(s)
+  4.2.2 TOPE Original artist(s)/performer(s)
+  4.2.4 TOWN File owner/licensee
+  4.2.2 TPE1 Lead performer(s)/Soloist(s)
+  4.2.2 TPE2 Band/orchestra/accompaniment
+  4.2.2 TPE3 Conductor/performer refinement
+  4.2.2 TPE4 Interpreted, remixed, or otherwise modified by
+  4.2.1 TPOS Part of a set
+  4.2.4 TPRO Produced notice
+  4.2.4 TPUB Publisher
+  4.2.1 TRCK Track number/Position in set
+  4.2.4 TRSN Internet radio station name
+  4.2.4 TRSO Internet radio station owner
+  4.2.5 TSOA Album sort order
+  4.2.5 TSOP Performer sort order
+  4.2.5 TSOT Title sort order
+  4.2.1 TSRC ISRC (international standard recording code)
+  4.2.5 TSSE Software/Hardware and settings used for encoding
+  4.2.1 TSST Set subtitle
+  4.2.2 TXXX User defined text information frame
+
+  4.1   UFID Unique file identifier
+  4.22  USER Terms of use
+  4.8   USLT Unsynchronised lyric/text transcription
+
+  4.3.1 WCOM Commercial information
+  4.3.1 WCOP Copyright/Legal information
+  4.3.1 WOAF Official audio file webpage
+  4.3.1 WOAR Official artist/performer webpage
+  4.3.1 WOAS Official audio source webpage
+  4.3.1 WORS Official Internet radio station homepage
+  4.3.1 WPAY Payment
+  4.3.1 WPUB Publishers official webpage
+  4.3.2 WXXX User defined URL link frame
+
+
+4.1.   Unique file identifier
+
+   This frame's purpose is to be able to identify the audio file in a
+   database, that may provide more information relevant to the content.
+   Since standardisation of such a database is beyond this document, all
+   UFID frames begin with an 'owner identifier' field. It is a null-
+   terminated string with a URL [URL] containing an email address, or a
+   link to a location where an email address can be found, that belongs
+   to the organisation responsible for this specific database
+   implementation. Questions regarding the database should be sent to
+   the indicated email address. The URL should not be used for the
+   actual database queries. The string
+   "http://www.id3.org/dummy/ufid.html" should be used for tests. The
+   'Owner identifier' must be non-empty (more than just a termination).
+   The 'Owner identifier' is then followed by the actual identifier,
+   which may be up to 64 bytes. There may be more than one "UFID" frame
+   in a tag, but only one with the same 'Owner identifier'.
+
+     <Header for 'Unique file identifier', ID: "UFID">
+     Owner identifier        <text string> $00
+     Identifier              <up to 64 bytes binary data>
+
+
+4.2.   Text information frames
+
+   The text information frames are often the most important frames,
+   containing information like artist, album and more. There may only be
+   one text information frame of its kind in an tag. All text
+   information frames supports multiple strings, stored as a null
+   separated list, where null is reperesented by the termination code
+   for the charater encoding. All text frame identifiers begin with "T".
+   Only text frame identifiers begin with "T", with the exception of the
+   "TXXX" frame. All the text information frames have the following
+   format:
+
+     <Header for 'Text information frame', ID: "T000" - "TZZZ",
+     excluding "TXXX" described in 4.2.6.>
+     Text encoding                $xx
+     Information                  <text string(s) according to encoding>
+
+
+4.2.1.   Identification frames
+
+  TIT1
+   The 'Content group description' frame is used if the sound belongs to
+   a larger category of sounds/music. For example, classical music is
+   often sorted in different musical sections (e.g. "Piano Concerto",
+   "Weather - Hurricane").
+
+  TIT2
+   The 'Title/Songname/Content description' frame is the actual name of
+   the piece (e.g. "Adagio", "Hurricane Donna").
+
+  TIT3
+   The 'Subtitle/Description refinement' frame is used for information
+   directly related to the contents title (e.g. "Op. 16" or "Performed
+   live at Wembley").
+
+  TALB
+   The 'Album/Movie/Show title' frame is intended for the title of the
+   recording (or source of sound) from which the audio in the file is
+   taken.
+
+  TOAL
+   The 'Original album/movie/show title' frame is intended for the title
+   of the original recording (or source of sound), if for example the
+   music in the file should be a cover of a previously released song.
+
+  TRCK
+   The 'Track number/Position in set' frame is a numeric string
+   containing the order number of the audio-file on its original
+   recording. This MAY be extended with a "/" character and a numeric
+   string containing the total number of tracks/elements on the original
+   recording. E.g. "4/9".
+
+  TPOS
+   The 'Part of a set' frame is a numeric string that describes which
+   part of a set the audio came from. This frame is used if the source
+   described in the "TALB" frame is divided into several mediums, e.g. a
+   double CD. The value MAY be extended with a "/" character and a
+   numeric string containing the total number of parts in the set. E.g.
+   "1/2".
+
+  TSST
+   The 'Set subtitle' frame is intended for the subtitle of the part of
+   a set this track belongs to.
+
+  TSRC
+   The 'ISRC' frame should contain the International Standard Recording
+   Code [ISRC] (12 characters).
+
+
+4.2.2.   Involved persons frames
+
+  TPE1
+   The 'Lead artist/Lead performer/Soloist/Performing group' is
+   used for the main artist.
+
+  TPE2
+   The 'Band/Orchestra/Accompaniment' frame is used for additional
+   information about the performers in the recording.
+
+  TPE3
+   The 'Conductor' frame is used for the name of the conductor.
+
+  TPE4
+   The 'Interpreted, remixed, or otherwise modified by' frame contains
+   more information about the people behind a remix and similar
+   interpretations of another existing piece.
+
+  TOPE
+   The 'Original artist/performer' frame is intended for the performer
+   of the original recording, if for example the music in the file
+   should be a cover of a previously released song.
+
+  TEXT
+   The 'Lyricist/Text writer' frame is intended for the writer of the
+   text or lyrics in the recording.
+
+  TOLY
+   The 'Original lyricist/text writer' frame is intended for the
+   text writer of the original recording, if for example the music in
+   the file should be a cover of a previously released song.
+
+  TCOM
+   The 'Composer' frame is intended for the name of the composer.
+
+  TMCL
+   The 'Musician credits list' is intended as a mapping between
+   instruments and the musician that played it. Every odd field is an
+   instrument and every even is an artist or a comma delimited list of
+   artists.
+
+  TIPL
+   The 'Involved people list' is very similar to the musician credits
+   list, but maps between functions, like producer, and names.
+
+  TENC
+   The 'Encoded by' frame contains the name of the person or
+   organisation that encoded the audio file. This field may contain a
+   copyright message, if the audio file also is copyrighted by the
+   encoder.
+
+
+4.2.3.   Derived and subjective properties frames
+
+  TBPM
+   The 'BPM' frame contains the number of beats per minute in the
+   main part of the audio. The BPM is an integer and represented as a
+   numerical string.
+
+  TLEN
+   The 'Length' frame contains the length of the audio file in
+   milliseconds, represented as a numeric string.
+
+  TKEY
+   The 'Initial key' frame contains the musical key in which the sound
+   starts. It is represented as a string with a maximum length of three
+   characters. The ground keys are represented with "A","B","C","D","E",
+   "F" and "G" and halfkeys represented with "b" and "#". Minor is
+   represented as "m", e.g. "Dbm" $00. Off key is represented with an
+   "o" only.
+
+  TLAN
+   The 'Language' frame should contain the languages of the text or
+   lyrics spoken or sung in the audio. The language is represented with
+   three characters according to ISO-639-2 [ISO-639-2]. If more than one
+   language is used in the text their language codes should follow
+   according to the amount of their usage, e.g. "eng" $00 "sve" $00.
+
+  TCON
+   The 'Content type', which ID3v1 was stored as a one byte numeric
+   value only, is now a string. You may use one or several of the ID3v1
+   types as numerical strings, or, since the category list would be
+   impossible to maintain with accurate and up to date categories,
+   define your own. Example: "21" $00 "Eurodisco" $00
+
+   You may also use any of the following keywords:
+   
+     RX  Remix
+     CR  Cover
+
+  TFLT
+   The 'File type' frame indicates which type of audio this tag defines.
+   The following types and refinements are defined:
+
+     MIME   MIME type follows
+     MPG    MPEG Audio
+       /1     MPEG 1/2 layer I
+       /2     MPEG 1/2 layer II
+       /3     MPEG 1/2 layer III
+       /2.5   MPEG 2.5
+       /AAC   Advanced audio compression
+     VQF    Transform-domain Weighted Interleave Vector Quantisation
+     PCM    Pulse Code Modulated audio
+
+   but other types may be used, but not for these types though. This is
+   used in a similar way to the predefined types in the "TMED" frame,
+   but without parentheses. If this frame is not present audio type is
+   assumed to be "MPG".
+
+  TMED
+   The 'Media type' frame describes from which media the sound
+   originated. This may be a text string or a reference to the
+   predefined media types found in the list below. Example:
+   "VID/PAL/VHS" $00.
+
+    DIG    Other digital media
+      /A    Analogue transfer from media
+
+    ANA    Other analogue media
+      /WAC  Wax cylinder
+      /8CA  8-track tape cassette
+
+    CD     CD
+      /A    Analogue transfer from media
+      /DD   DDD
+      /AD   ADD
+      /AA   AAD
+
+    LD     Laserdisc
+
+    TT     Turntable records
+      /33    33.33 rpm
+      /45    45 rpm
+      /71    71.29 rpm
+      /76    76.59 rpm
+      /78    78.26 rpm
+      /80    80 rpm
+
+    MD     MiniDisc
+      /A    Analogue transfer from media
+
+    DAT    DAT
+      /A    Analogue transfer from media
+      /1    standard, 48 kHz/16 bits, linear
+      /2    mode 2, 32 kHz/16 bits, linear
+      /3    mode 3, 32 kHz/12 bits, non-linear, low speed
+      /4    mode 4, 32 kHz/12 bits, 4 channels
+      /5    mode 5, 44.1 kHz/16 bits, linear
+      /6    mode 6, 44.1 kHz/16 bits, 'wide track' play
+
+    DCC    DCC
+      /A    Analogue transfer from media
+
+    DVD    DVD
+      /A    Analogue transfer from media
+
+    TV     Television
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+
+    VID    Video
+      /PAL    PAL
+      /NTSC   NTSC
+      /SECAM  SECAM
+      /VHS    VHS
+      /SVHS   S-VHS
+      /BETA   BETAMAX
+
+    RAD    Radio
+      /FM   FM
+      /AM   AM
+      /LW   LW
+      /MW   MW
+
+    TEL    Telephone
+      /I    ISDN
+
+    MC     MC (normal cassette)
+      /4    4.75 cm/s (normal speed for a two sided cassette)
+      /9    9.5 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+
+    REE    Reel
+      /9    9.5 cm/s
+      /19   19 cm/s
+      /38   38 cm/s
+      /76   76 cm/s
+      /I    Type I cassette (ferric/normal)
+      /II   Type II cassette (chrome)
+      /III  Type III cassette (ferric chrome)
+      /IV   Type IV cassette (metal)
+
+  TMOO
+   The 'Mood' frame is intended to reflect the mood of the audio with a
+   few keywords, e.g. "Romantic" or "Sad".
+
+
+4.2.4.   Rights and license frames
+
+  TCOP
+   The 'Copyright message' frame, in which the string must begin with a
+   year and a space character (making five characters), is intended for
+   the copyright holder of the original sound, not the audio file
+   itself. The absence of this frame means only that the copyright
+   information is unavailable or has been removed, and must not be
+   interpreted to mean that the audio is public domain. Every time this
+   field is displayed the field must be preceded with "Copyright " (C) "
+   ", where (C) is one character showing a C in a circle.
+
+  TPRO
+   The 'Produced notice' frame, in which the string must begin with a
+   year and a space character (making five characters), is intended for
+   the production copyright holder of the original sound, not the audio
+   file itself. The absence of this frame means only that the production
+   copyright information is unavailable or has been removed, and must
+   not be interpreted to mean that the audio is public domain. Every
+   time this field is displayed the field must be preceded with
+   "Produced " (P) " ", where (P) is one character showing a P in a
+   circle.
+
+  TPUB
+   The 'Publisher' frame simply contains the name of the label or
+   publisher.
+
+  TOWN
+   The 'File owner/licensee' frame contains the name of the owner or
+   licensee of the file and it's contents.
+
+  TRSN
+   The 'Internet radio station name' frame contains the name of the
+   internet radio station from which the audio is streamed.
+
+  TRSO
+   The 'Internet radio station owner' frame contains the name of the
+   owner of the internet radio station from which the audio is
+   streamed.
+
+4.2.5.   Other text frames
+
+  TOFN
+   The 'Original filename' frame contains the preferred filename for the
+   file, since some media doesn't allow the desired length of the
+   filename. The filename is case sensitive and includes its suffix.
+
+  TDLY
+   The 'Playlist delay' defines the numbers of milliseconds of silence
+   that should be inserted before this audio. The value zero indicates
+   that this is a part of a multifile audio track that should be played
+   continuously.
+
+  TDEN
+   The 'Encoding time' frame contains a timestamp describing when the
+   audio was encoded. Timestamp format is described in the ID3v2
+   structure document [ID3v2-strct].
+
+  TDOR
+   The 'Original release time' frame contains a timestamp describing
+   when the original recording of the audio was released. Timestamp
+   format is described in the ID3v2 structure document [ID3v2-strct].
+
+  TDRC
+   The 'Recording time' frame contains a timestamp describing when the
+   audio was recorded. Timestamp format is described in the ID3v2
+   structure document [ID3v2-strct].
+
+  TDRL
+   The 'Release time' frame contains a timestamp describing when the
+   audio was first released. Timestamp format is described in the ID3v2
+   structure document [ID3v2-strct].
+
+  TDTG
+   The 'Tagging time' frame contains a timestamp describing then the
+   audio was tagged. Timestamp format is described in the ID3v2
+   structure document [ID3v2-strct].
+
+  TSSE
+   The 'Software/Hardware and settings used for encoding' frame
+   includes the used audio encoder and its settings when the file was
+   encoded. Hardware refers to hardware encoders, not the computer on
+   which a program was run.
+
+  TSOA
+   The 'Album sort order' frame defines a string which should be used
+   instead of the album name (TALB) for sorting purposes. E.g. an album
+   named "A Soundtrack" might preferably be sorted as "Soundtrack".
+
+  TSOP
+   The 'Performer sort order' frame defines a string which should be
+   used instead of the performer (TPE2) for sorting purposes.
+
+  TSOT
+   The 'Title sort order' frame defines a string which should be used
+   instead of the title (TIT2) for sorting purposes.
+
+
+4.2.6.   User defined text information frame
+
+   This frame is intended for one-string text information concerning the
+   audio file in a similar way to the other "T"-frames. The frame body
+   consists of a description of the string, represented as a terminated
+   string, followed by the actual string. There may be more than one
+   "TXXX" frame in each tag, but only one with the same description.
+
+     <Header for 'User defined text information frame', ID: "TXXX">
+     Text encoding     $xx
+     Description       <text string according to encoding> $00 (00)
+     Value             <text string according to encoding>
+
+
+4.3.   URL link frames
+
+   With these frames dynamic data such as webpages with touring
+   information, price information or plain ordinary news can be added to
+   the tag. There may only be one URL [URL] link frame of its kind in an
+   tag, except when stated otherwise in the frame description. If the
+   text string is followed by a string termination, all the following
+   information should be ignored and not be displayed. All URL link
+   frame identifiers begins with "W". Only URL link frame identifiers
+   begins with "W", except for "WXXX". All URL link frames have the
+   following format:
+
+     <Header for 'URL link frame', ID: "W000" - "WZZZ", excluding "WXXX"
+     described in 4.3.2.>
+     URL              <text string>
+
+
+4.3.1.   URL link frames - details
+
+  WCOM
+   The 'Commercial information' frame is a URL pointing at a webpage
+   with information such as where the album can be bought. There may be
+   more than one "WCOM" frame in a tag, but not with the same content.
+
+  WCOP
+   The 'Copyright/Legal information' frame is a URL pointing at a
+   webpage where the terms of use and ownership of the file is
+   described.
+
+  WOAF
+   The 'Official audio file webpage' frame is a URL pointing at a file
+   specific webpage.
+
+  WOAR
+   The 'Official artist/performer webpage' frame is a URL pointing at
+   the artists official webpage. There may be more than one "WOAR" frame
+   in a tag if the audio contains more than one performer, but not with
+   the same content.
+
+  WOAS
+   The 'Official audio source webpage' frame is a URL pointing at the
+   official webpage for the source of the audio file, e.g. a movie.
+
+  WORS
+   The 'Official Internet radio station homepage' contains a URL
+   pointing at the homepage of the internet radio station.
+
+  WPAY
+   The 'Payment' frame is a URL pointing at a webpage that will handle
+   the process of paying for this file.
+
+  WPUB
+   The 'Publishers official webpage' frame is a URL pointing at the
+   official webpage for the publisher.
+
+
+4.3.2.   User defined URL link frame
+
+   This frame is intended for URL [URL] links concerning the audio file
+   in a similar way to the other "W"-frames. The frame body consists
+   of a description of the string, represented as a terminated string,
+   followed by the actual URL. The URL is always encoded with ISO-8859-1
+   [ISO-8859-1]. There may be more than one "WXXX" frame in each tag,
+   but only one with the same description.
+
+     <Header for 'User defined URL link frame', ID: "WXXX">
+     Text encoding     $xx
+     Description       <text string according to encoding> $00 (00)
+     URL               <text string>
+
+
+4.4.   Music CD identifier
+
+   This frame is intended for music that comes from a CD, so that the CD
+   can be identified in databases such as the CDDB [CDDB]. The frame
+   consists of a binary dump of the Table Of Contents, TOC, from the CD,
+   which is a header of 4 bytes and then 8 bytes/track on the CD plus 8
+   bytes for the 'lead out', making a maximum of 804 bytes. The offset
+   to the beginning of every track on the CD should be described with a
+   four bytes absolute CD-frame address per track, and not with absolute
+   time. When this frame is used the presence of a valid "TRCK" frame is
+   REQUIRED, even if the CD's only got one track. It is recommended that
+   this frame is always added to tags originating from CDs. There may
+   only be one "MCDI" frame in each tag.
+
+     <Header for 'Music CD identifier', ID: "MCDI">
+     CD TOC                <binary data>
+
+
+4.5.   Event timing codes
+
+   This frame allows synchronisation with key events in the audio. The
+   header is:
+
+     <Header for 'Event timing codes', ID: "ETCO">
+     Time stamp format    $xx
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Absolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   Followed by a list of key events in the following format:
+
+     Type of event   $xx
+     Time stamp      $xx (xx ...)
+
+   The 'Time stamp' is set to zero if directly at the beginning of the
+   sound or after the previous event. All events MUST be sorted in
+   chronological order. The type of event is as follows:
+
+     $00  padding (has no meaning)
+     $01  end of initial silence
+     $02  intro start
+     $03  main part start
+     $04  outro start
+     $05  outro end
+     $06  verse start
+     $07  refrain start
+     $08  interlude start
+     $09  theme start
+     $0A  variation start
+     $0B  key change
+     $0C  time change
+     $0D  momentary unwanted noise (Snap, Crackle & Pop)
+     $0E  sustained noise
+     $0F  sustained noise end
+     $10  intro end
+     $11  main part end
+     $12  verse end
+     $13  refrain end
+     $14  theme end
+     $15  profanity
+     $16  profanity end
+
+     $17-$DF  reserved for future use
+
+     $E0-$EF  not predefined synch 0-F
+
+     $F0-$FC  reserved for future use
+
+     $FD  audio end (start of silence)
+     $FE  audio file ends
+     $FF  one more byte of events follows (all the following bytes with
+          the value $FF have the same function)
+
+   Terminating the start events such as "intro start" is OPTIONAL. The
+   'Not predefined synch's ($E0-EF) are for user events. You might want
+   to synchronise your music to something, like setting off an explosion
+   on-stage, activating a screensaver etc.
+
+   There may only be one "ETCO" frame in each tag.
+
+
+4.6.   MPEG location lookup table
+
+   To increase performance and accuracy of jumps within a MPEG [MPEG]
+   audio file, frames with time codes in different locations in the file
+   might be useful. This ID3v2 frame includes references that the
+   software can use to calculate positions in the file. After the frame
+   header follows a descriptor of how much the 'frame counter' should be
+   increased for every reference. If this value is two then the first
+   reference points out the second frame, the 2nd reference the 4th
+   frame, the 3rd reference the 6th frame etc. In a similar way the
+   'bytes between reference' and 'milliseconds between reference' points
+   out bytes and milliseconds respectively.
+
+   Each reference consists of two parts; a certain number of bits, as
+   defined in 'bits for bytes deviation', that describes the difference
+   between what is said in 'bytes between reference' and the reality and
+   a certain number of bits, as defined in 'bits for milliseconds
+   deviation', that describes the difference between what is said in
+   'milliseconds between reference' and the reality. The number of bits
+   in every reference, i.e. 'bits for bytes deviation'+'bits for
+   milliseconds deviation', must be a multiple of four. There may only
+   be one "MLLT" frame in each tag.
+
+     <Header for 'Location lookup table', ID: "MLLT">
+     MPEG frames between reference  $xx xx
+     Bytes between reference        $xx xx xx
+     Milliseconds between reference $xx xx xx
+     Bits for bytes deviation       $xx
+     Bits for milliseconds dev.     $xx
+
+   Then for every reference the following data is included;
+
+     Deviation in bytes         %xxx....
+     Deviation in milliseconds  %xxx....
+
+
+4.7.   Synchronised tempo codes
+
+   For a more accurate description of the tempo of a musical piece, this
+   frame might be used. After the header follows one byte describing
+   which time stamp format should be used. Then follows one or more
+   tempo codes. Each tempo code consists of one tempo part and one time
+   part. The tempo is in BPM described with one or two bytes. If the
+   first byte has the value $FF, one more byte follows, which is added
+   to the first giving a range from 2 - 510 BPM, since $00 and $01 is
+   reserved. $00 is used to describe a beat-free time period, which is
+   not the same as a music-free time period. $01 is used to indicate one
+   single beat-stroke followed by a beat-free period.
+
+   The tempo descriptor is followed by a time stamp. Every time the
+   tempo in the music changes, a tempo descriptor may indicate this for
+   the player. All tempo descriptors MUST be sorted in chronological
+   order. The first beat-stroke in a time-period is at the same time as
+   the beat description occurs. There may only be one "SYTC" frame in
+   each tag.
+
+     <Header for 'Synchronised tempo codes', ID: "SYTC">
+     Time stamp format   $xx
+     Tempo data          <binary data>
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Absolute time means that every stamp contains the time from the
+   beginning of the file.
+
+
+4.8.   Unsynchronised lyrics/text transcription
+
+   This frame contains the lyrics of the song or a text transcription of
+   other vocal activities. The head includes an encoding descriptor and
+   a content descriptor. The body consists of the actual text. The
+   'Content descriptor' is a terminated string. If no descriptor is
+   entered, 'Content descriptor' is $00 (00) only. Newline characters
+   are allowed in the text. There may be more than one 'Unsynchronised
+   lyrics/text transcription' frame in each tag, but only one with the
+   same language and content descriptor.
+
+     <Header for 'Unsynchronised lyrics/text transcription', ID: "USLT">
+     Text encoding        $xx
+     Language             $xx xx xx
+     Content descriptor   <text string according to encoding> $00 (00)
+     Lyrics/text          <full text string according to encoding>
+
+
+4.9.   Synchronised lyrics/text
+
+   This is another way of incorporating the words, said or sung lyrics,
+   in the audio file as text, this time, however, in sync with the
+   audio. It might also be used to describing events e.g. occurring on a
+   stage or on the screen in sync with the audio. The header includes a
+   content descriptor, represented with as terminated text string. If no
+   descriptor is entered, 'Content descriptor' is $00 (00) only.
+
+     <Header for 'Synchronised lyrics/text', ID: "SYLT">
+     Text encoding        $xx
+     Language             $xx xx xx
+     Time stamp format    $xx
+     Content type         $xx
+     Content descriptor   <text string according to encoding> $00 (00)
+
+   Content type:   $00 is other
+                   $01 is lyrics
+                   $02 is text transcription
+                   $03 is movement/part name (e.g. "Adagio")
+                   $04 is events (e.g. "Don Quijote enters the stage")
+                   $05 is chord (e.g. "Bb F Fsus")
+                   $06 is trivia/'pop up' information
+                   $07 is URLs to webpages
+                   $08 is URLs to images
+
+   Time stamp format:
+
+     $01  Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   Absolute time means that every stamp contains the time from the
+   beginning of the file.
+
+   The text that follows the frame header differs from that of the
+   unsynchronised lyrics/text transcription in one major way. Each
+   syllable (or whatever size of text is considered to be convenient by
+   the encoder) is a null terminated string followed by a time stamp
+   denoting where in the sound file it belongs. Each sync thus has the
+   following structure:
+
+     Terminated text to be synced (typically a syllable)
+     Sync identifier (terminator to above string)   $00 (00)
+     Time stamp                                     $xx (xx ...)
+
+   The 'time stamp' is set to zero or the whole sync is omitted if
+   located directly at the beginning of the sound. All time stamps
+   should be sorted in chronological order. The sync can be considered
+   as a validator of the subsequent string.
+
+   Newline characters are allowed in all "SYLT" frames and MUST be used
+   after every entry (name, event etc.) in a frame with the content type
+   $03 - $04.
+
+   A few considerations regarding whitespace characters: Whitespace
+   separating words should mark the beginning of a new word, thus
+   occurring in front of the first syllable of a new word. This is also
+   valid for new line characters. A syllable followed by a comma should
+   not be broken apart with a sync (both the syllable and the comma
+   should be before the sync).
+
+   An example: The "USLT" passage
+
+     "Strangers in the night" $0A "Exchanging glances"
+
+   would be "SYLT" encoded as:
+
+     "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx
+     " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx
+     xx "glan" $00 xx xx "ces" $00 xx xx
+
+   There may be more than one "SYLT" frame in each tag, but only one
+   with the same language and content descriptor.
+
+
+4.10.   Comments
+
+   This frame is intended for any kind of full text information that
+   does not fit in any other frame. It consists of a frame header
+   followed by encoding, language and content descriptors and is ended
+   with the actual comment as a text string. Newline characters are
+   allowed in the comment text string. There may be more than one
+   comment frame in each tag, but only one with the same language and
+   content descriptor.
+
+     <Header for 'Comment', ID: "COMM">
+     Text encoding          $xx
+     Language               $xx xx xx
+     Short content descrip. <text string according to encoding> $00 (00)
+     The actual text        <full text string according to encoding>
+
+
+4.11.   Relative volume adjustment (2)
+
+   This is a more subjective frame than the previous ones. It allows the
+   user to say how much he wants to increase/decrease the volume on each
+   channel when the file is played. The purpose is to be able to align
+   all files to a reference volume, so that you don't have to change the
+   volume constantly. This frame may also be used to balance adjust the
+   audio. The volume adjustment is encoded as a fixed point decibel
+   value, 16 bit signed integer representing (adjustment*512), giving
+   +/- 64 dB with a precision of 0.001953125 dB. E.g. +2 dB is stored as
+   $04 00 and -2 dB is $FC 00. There may be more than one "RVA2" frame
+   in each tag, but only one with the same identification string.
+
+     <Header for 'Relative volume adjustment (2)', ID: "RVA2">
+     Identification          <text string> $00
+
+   The 'identification' string is used to identify the situation and/or
+   device where this adjustment should apply. The following is then
+   repeated for every channel
+
+     Type of channel         $xx
+     Volume adjustment       $xx xx
+     Bits representing peak  $xx
+     Peak volume             $xx (xx ...)
+
+
+   Type of channel:  $00  Other
+                     $01  Master volume
+                     $02  Front right
+                     $03  Front left
+                     $04  Back right
+                     $05  Back left
+                     $06  Front centre
+                     $07  Back centre
+                     $08  Subwoofer
+
+   Bits representing peak can be any number between 0 and 255. 0 means
+   that there is no peak volume field. The peak volume field is always
+   padded to whole bytes, setting the most significant bits to zero.
+
+
+4.12.   Equalisation (2)
+
+   This is another subjective, alignment frame. It allows the user to
+   predefine an equalisation curve within the audio file. There may be
+   more than one "EQU2" frame in each tag, but only one with the same
+   identification string.
+
+     <Header of 'Equalisation (2)', ID: "EQU2">
+     Interpolation method  $xx
+     Identification        <text string> $00
+
+   The 'interpolation method' describes which method is preferred when
+   an interpolation between the adjustment point that follows. The
+   following methods are currently defined:
+
+     $00  Band
+          No interpolation is made. A jump from one adjustment level to
+          another occurs in the middle between two adjustment points.
+     $01  Linear
+          Interpolation between adjustment points is linear.
+
+   The 'identification' string is used to identify the situation and/or
+   device where this adjustment should apply. The following is then
+   repeated for every adjustment point
+
+     Frequency          $xx xx
+     Volume adjustment  $xx xx
+
+   The frequency is stored in units of 1/2 Hz, giving it a range from 0
+   to 32767 Hz.
+
+   The volume adjustment is encoded as a fixed point decibel value, 16
+   bit signed integer representing (adjustment*512), giving +/- 64 dB
+   with a precision of 0.001953125 dB. E.g. +2 dB is stored as $04 00
+   and -2 dB is $FC 00.
+
+   Adjustment points should be ordered by frequency and one frequency
+   should only be described once in the frame.
+
+
+4.13.   Reverb
+
+   Yet another subjective frame, with which you can adjust echoes of
+   different kinds. Reverb left/right is the delay between every bounce
+   in ms. Reverb bounces left/right is the number of bounces that should
+   be made. $FF equals an infinite number of bounces. Feedback is the
+   amount of volume that should be returned to the next echo bounce. $00
+   is 0%, $FF is 100%. If this value were $7F, there would be 50% volume
+   reduction on the first bounce, 50% of that on the second and so on.
+   Left to left means the sound from the left bounce to be played in the
+   left speaker, while left to right means sound from the left bounce to
+   be played in the right speaker.
+
+   'Premix left to right' is the amount of left sound to be mixed in the
+   right before any reverb is applied, where $00 id 0% and $FF is 100%.
+   'Premix right to left' does the same thing, but right to left.
+   Setting both premix to $FF would result in a mono output (if the
+   reverb is applied symmetric). There may only be one "RVRB" frame in
+   each tag.
+
+     <Header for 'Reverb', ID: "RVRB">
+     Reverb left (ms)                 $xx xx
+     Reverb right (ms)                $xx xx
+     Reverb bounces, left             $xx
+     Reverb bounces, right            $xx
+     Reverb feedback, left to left    $xx
+     Reverb feedback, left to right   $xx
+     Reverb feedback, right to right  $xx
+     Reverb feedback, right to left   $xx
+     Premix left to right             $xx
+     Premix right to left             $xx
+
+
+4.14.   Attached picture
+
+   This frame contains a picture directly related to the audio file.
+   Image format is the MIME type and subtype [MIME] for the image. In
+   the event that the MIME media type name is omitted, "image/" will be
+   implied. The "image/png" [PNG] or "image/jpeg" [JFIF] picture format
+   should be used when interoperability is wanted. Description is a
+   short description of the picture, represented as a terminated
+   text string. There may be several pictures attached to one file, each
+   in their individual "APIC" frame, but only one with the same content
+   descriptor. There may only be one picture with the picture type
+   declared as picture type $01 and $02 respectively. There is the
+   possibility to put only a link to the image file by using the 'MIME
+   type' "-->" and having a complete URL [URL] instead of picture data.
+   The use of linked files should however be used sparingly since there
+   is the risk of separation of files.
+
+     <Header for 'Attached picture', ID: "APIC">
+     Text encoding      $xx
+     MIME type          <text string> $00
+     Picture type       $xx
+     Description        <text string according to encoding> $00 (00)
+     Picture data       <binary data>
+
+
+   Picture type:  $00  Other
+                  $01  32x32 pixels 'file icon' (PNG only)
+                  $02  Other file icon
+                  $03  Cover (front)
+                  $04  Cover (back)
+                  $05  Leaflet page
+                  $06  Media (e.g. label side of CD)
+                  $07  Lead artist/lead performer/soloist
+                  $08  Artist/performer
+                  $09  Conductor
+                  $0A  Band/Orchestra
+                  $0B  Composer
+                  $0C  Lyricist/text writer
+                  $0D  Recording Location
+                  $0E  During recording
+                  $0F  During performance
+                  $10  Movie/video screen capture
+                  $11  A bright coloured fish
+                  $12  Illustration
+                  $13  Band/artist logotype
+                  $14  Publisher/Studio logotype
+
+
+4.15.   General encapsulated object
+
+   In this frame any type of file can be encapsulated. After the header,
+   'Frame size' and 'Encoding' follows 'MIME type' [MIME] represented as
+   as a terminated string encoded with ISO 8859-1 [ISO-8859-1]. The
+   filename is case sensitive and is encoded as 'Encoding'. Then follows
+   a content description as terminated string, encoded as 'Encoding'.
+   The last thing in the frame is the actual object. The first two
+   strings may be omitted, leaving only their terminations. MIME type is
+   always an ISO-8859-1 text string. There may be more than one "GEOB"
+   frame in each tag, but only one with the same content descriptor.
+
+     <Header for 'General encapsulated object', ID: "GEOB">
+     Text encoding          $xx
+     MIME type              <text string> $00
+     Filename               <text string according to encoding> $00 (00)
+     Content description    <text string according to encoding> $00 (00)
+     Encapsulated object    <binary data>
+
+
+4.16.   Play counter
+
+   This is simply a counter of the number of times a file has been
+   played. The value is increased by one every time the file begins to
+   play. There may only be one "PCNT" frame in each tag. When the
+   counter reaches all one's, one byte is inserted in front of the
+   counter thus making the counter eight bits bigger.  The counter must
+   be at least 32-bits long to begin with.
+
+     <Header for 'Play counter', ID: "PCNT">
+     Counter        $xx xx xx xx (xx ...)
+
+
+4.17.   Popularimeter
+
+   The purpose of this frame is to specify how good an audio file is.
+   Many interesting applications could be found to this frame such as a
+   playlist that features better audio files more often than others or
+   it could be used to profile a person's taste and find other 'good'
+   files by comparing people's profiles. The frame contains the email
+   address to the user, one rating byte and a four byte play counter,
+   intended to be increased with one for every time the file is played.
+   The email is a terminated string. The rating is 1-255 where 1 is
+   worst and 255 is best. 0 is unknown. If no personal counter is wanted
+   it may be omitted. When the counter reaches all one's, one byte is
+   inserted in front of the counter thus making the counter eight bits
+   bigger in the same away as the play counter ("PCNT"). There may be
+   more than one "POPM" frame in each tag, but only one with the same
+   email address.
+
+     <Header for 'Popularimeter', ID: "POPM">
+     Email to user   <text string> $00
+     Rating          $xx
+     Counter         $xx xx xx xx (xx ...)
+
+
+4.18.   Recommended buffer size
+
+   Sometimes the server from which an audio file is streamed is aware of
+   transmission or coding problems resulting in interruptions in the
+   audio stream. In these cases, the size of the buffer can be
+   recommended by the server using this frame. If the 'embedded info
+   flag' is true (1) then this indicates that an ID3 tag with the
+   maximum size described in 'Buffer size' may occur in the audio
+   stream. In such case the tag should reside between two MPEG [MPEG]
+   frames, if the audio is MPEG encoded. If the position of the next tag
+   is known, 'offset to next tag' may be used. The offset is calculated
+   from the end of tag in which this frame resides to the first byte of
+   the header in the next. This field may be omitted. Embedded tags are
+   generally not recommended since this could render unpredictable
+   behaviour from present software/hardware.
+
+   For applications like streaming audio it might be an idea to embed
+   tags into the audio stream though. If the clients connects to
+   individual connections like HTTP and there is a possibility to begin
+   every transmission with a tag, then this tag should include a
+   'recommended buffer size' frame. If the client is connected to a
+   arbitrary point in the stream, such as radio or multicast, then the
+   'recommended buffer size' frame SHOULD be included in every tag.
+
+   The 'Buffer size' should be kept to a minimum. There may only be one
+   "RBUF" frame in each tag.
+
+     <Header for 'Recommended buffer size', ID: "RBUF">
+     Buffer size               $xx xx xx
+     Embedded info flag        %0000000x
+     Offset to next tag        $xx xx xx xx
+
+
+4.19.   Audio encryption
+
+   This frame indicates if the actual audio stream is encrypted, and by
+   whom. Since standardisation of such encryption scheme is beyond this
+   document, all "AENC" frames begin with a terminated string with a
+   URL containing an email address, or a link to a location where an
+   email address can be found, that belongs to the organisation
+   responsible for this specific encrypted audio file. Questions
+   regarding the encrypted audio should be sent to the email address
+   specified. If a $00 is found directly after the 'Frame size' and the
+   audio file indeed is encrypted, the whole file may be considered
+   useless.
+
+   After the 'Owner identifier', a pointer to an unencrypted part of the
+   audio can be specified. The 'Preview start' and 'Preview length' is
+   described in frames. If no part is unencrypted, these fields should
+   be left zeroed. After the 'preview length' field follows optionally a
+   data block required for decryption of the audio. There may be more
+   than one "AENC" frames in a tag, but only one with the same 'Owner
+   identifier'.
+
+     <Header for 'Audio encryption', ID: "AENC">
+     Owner identifier   <text string> $00
+     Preview start      $xx xx
+     Preview length     $xx xx
+     Encryption info    <binary data>
+
+
+4.20.   Linked information
+
+   To keep information duplication as low as possible this frame may be
+   used to link information from another ID3v2 tag that might reside in
+   another audio file or alone in a binary file. It is RECOMMENDED that
+   this method is only used when the files are stored on a CD-ROM or
+   other circumstances when the risk of file separation is low. The
+   frame contains a frame identifier, which is the frame that should be
+   linked into this tag, a URL [URL] field, where a reference to the
+   file where the frame is given, and additional ID data, if needed.
+   Data should be retrieved from the first tag found in the file to
+   which this link points. There may be more than one "LINK" frame in a
+   tag, but only one with the same contents. A linked frame is to be
+   considered as part of the tag and has the same restrictions as if it
+   was a physical part of the tag (i.e. only one "RVRB" frame allowed,
+   whether it's linked or not).
+
+     <Header for 'Linked information', ID: "LINK">
+     Frame identifier        $xx xx xx xx
+     URL                     <text string> $00
+     ID and additional data  <text string(s)>
+
+   Frames that may be linked and need no additional data are "ASPI",
+   "ETCO", "EQU2", "MCID", "MLLT", "OWNE", "RVA2", "RVRB", "SYTC", the
+   text information frames and the URL link frames.
+
+   The "AENC", "APIC", "GEOB" and "TXXX" frames may be linked with
+   the content descriptor as additional ID data.
+
+   The "USER" frame may be linked with the language field as additional
+   ID data.
+   
+   The "PRIV" frame may be linked with the owner identifier as
+   additional ID data.
+
+   The "COMM", "SYLT" and "USLT" frames may be linked with three bytes
+   of language descriptor directly followed by a content descriptor as
+   additional ID data.
+
+
+4.21.   Position synchronisation frame
+
+   This frame delivers information to the listener of how far into the
+   audio stream he picked up; in effect, it states the time offset from
+   the first frame in the stream. The frame layout is:
+
+     <Head for 'Position synchronisation', ID: "POSS">
+     Time stamp format         $xx
+     Position                  $xx (xx ...)
+
+   Where time stamp format is:
+
+     $01  Absolute time, 32 bit sized, using MPEG frames as unit
+     $02  Absolute time, 32 bit sized, using milliseconds as unit
+
+   and position is where in the audio the listener starts to receive,
+   i.e. the beginning of the next frame. If this frame is used in the
+   beginning of a file the value is always 0. There may only be one
+   "POSS" frame in each tag.
+
+
+4.22.   Terms of use frame
+
+   This frame contains a brief description of the terms of use and
+   ownership of the file. More detailed information concerning the legal
+   terms might be available through the "WCOP" frame. Newlines are
+   allowed in the text. There may be more than one 'Terms of use' frame
+   in a tag, but only one with the same 'Language'.
+
+     <Header for 'Terms of use frame', ID: "USER">
+     Text encoding        $xx
+     Language             $xx xx xx
+     The actual text      <text string according to encoding>
+
+
+4.23.   Ownership frame
+
+   The ownership frame might be used as a reminder of a made transaction
+   or, if signed, as proof. Note that the "USER" and "TOWN" frames are
+   good to use in conjunction with this one. The frame begins, after the
+   frame ID, size and encoding fields, with a 'price paid' field. The
+   first three characters of this field contains the currency used for
+   the transaction, encoded according to ISO 4217 [ISO-4217] alphabetic
+   currency code. Concatenated to this is the actual price paid, as a
+   numerical string using "." as the decimal separator. Next is an 8
+   character date string (YYYYMMDD) followed by a string with the name
+   of the seller as the last field in the frame. There may only be one
+   "OWNE" frame in a tag.
+
+     <Header for 'Ownership frame', ID: "OWNE">
+     Text encoding     $xx
+     Price paid        <text string> $00
+     Date of purch.    <text string>
+     Seller            <text string according to encoding>
+
+
+4.24.   Commercial frame
+
+   This frame enables several competing offers in the same tag by
+   bundling all needed information. That makes this frame rather complex
+   but it's an easier solution than if one tries to achieve the same
+   result with several frames. The frame begins, after the frame ID,
+   size and encoding fields, with a price string field. A price is
+   constructed by one three character currency code, encoded according
+   to ISO 4217 [ISO-4217] alphabetic currency code, followed by a
+   numerical value where "." is used as decimal separator. In the price
+   string several prices may be concatenated, separated by a "/"
+   character, but there may only be one currency of each type.
+
+   The price string is followed by an 8 character date string in the
+   format YYYYMMDD, describing for how long the price is valid. After
+   that is a contact URL, with which the user can contact the seller,
+   followed by a one byte 'received as' field. It describes how the
+   audio is delivered when bought according to the following list:
+
+        $00  Other
+        $01  Standard CD album with other songs
+        $02  Compressed audio on CD
+        $03  File over the Internet
+        $04  Stream over the Internet
+        $05  As note sheets
+        $06  As note sheets in a book with other sheets
+        $07  Music on other media
+        $08  Non-musical merchandise
+
+   Next follows a terminated string with the name of the seller followed
+   by a terminated string with a short description of the product. The
+   last thing is the ability to include a company logotype. The first of
+   them is the 'Picture MIME type' field containing information about
+   which picture format is used. In the event that the MIME media type
+   name is omitted, "image/" will be implied. Currently only "image/png"
+   and "image/jpeg" are allowed. This format string is followed by the
+   binary picture data. This two last fields may be omitted if no
+   picture is attached. There may be more than one 'commercial frame' in
+   a tag, but no two may be identical.
+
+     <Header for 'Commercial frame', ID: "COMR">
+     Text encoding      $xx
+     Price string       <text string> $00
+     Valid until        <text string>
+     Contact URL        <text string> $00
+     Received as        $xx
+     Name of seller     <text string according to encoding> $00 (00)
+     Description        <text string according to encoding> $00 (00)
+     Picture MIME type  <string> $00
+     Seller logo        <binary data>
+
+
+4.25.   Encryption method registration
+
+   To identify with which method a frame has been encrypted the
+   encryption method must be registered in the tag with this frame. The
+   'Owner identifier' is a null-terminated string with a URL [URL]
+   containing an email address, or a link to a location where an email
+   address can be found, that belongs to the organisation responsible
+   for this specific encryption method. Questions regarding the
+   encryption method should be sent to the indicated email address. The
+   'Method symbol' contains a value that is associated with this method
+   throughout the whole tag, in the range $80-F0. All other values are
+   reserved. The 'Method symbol' may optionally be followed by
+   encryption specific data. There may be several "ENCR" frames in a tag
+   but only one containing the same symbol and only one containing the
+   same owner identifier. The method must be used somewhere in the tag.
+   See the description of the frame encryption flag in the ID3v2
+   structure document [ID3v2-strct] for more information.
+
+     <Header for 'Encryption method registration', ID: "ENCR">
+     Owner identifier    <text string> $00
+     Method symbol       $xx
+     Encryption data     <binary data>
+
+
+4.26.   Group identification registration
+
+   This frame enables grouping of otherwise unrelated frames. This can
+   be used when some frames are to be signed. To identify which frames
+   belongs to a set of frames a group identifier must be registered in
+   the tag with this frame. The 'Owner identifier' is a null-terminated
+   string with a URL [URL] containing an email address, or a link to a
+   location where an email address can be found, that belongs to the
+   organisation responsible for this grouping. Questions regarding the
+   grouping should be sent to the indicated email address. The 'Group
+   symbol' contains a value that associates the frame with this group
+   throughout the whole tag, in the range $80-F0. All other values are
+   reserved. The 'Group symbol' may optionally be followed by some group
+   specific data, e.g. a digital signature. There may be several "GRID"
+   frames in a tag but only one containing the same symbol and only one
+   containing the same owner identifier. The group symbol must be used
+   somewhere in the tag. See the description of the frame grouping flag
+   in the ID3v2 structure document [ID3v2-strct] for more information.
+
+     <Header for 'Group ID registration', ID: "GRID">
+     Owner identifier      <text string> $00
+     Group symbol          $xx
+     Group dependent data  <binary data>
+
+
+4.27.   Private frame
+
+   This frame is used to contain information from a software producer
+   that its program uses and does not fit into the other frames. The
+   frame consists of an 'Owner identifier' string and the binary data.
+   The 'Owner identifier' is a null-terminated string with a URL [URL]
+   containing an email address, or a link to a location where an email
+   address can be found, that belongs to the organisation responsible
+   for the frame. Questions regarding the frame should be sent to the
+   indicated email address. The tag may contain more than one "PRIV"
+   frame but only with different contents.
+
+     <Header for 'Private frame', ID: "PRIV">
+     Owner identifier      <text string> $00
+     The private data      <binary data>
+
+
+4.28.   Signature frame
+
+   This frame enables a group of frames, grouped with the 'Group
+   identification registration', to be signed. Although signatures can
+   reside inside the registration frame, it might be desired to store
+   the signature elsewhere, e.g. in watermarks. There may be more than
+   one 'signature frame' in a tag, but no two may be identical.
+
+     <Header for 'Signature frame', ID: "SIGN">
+     Group symbol      $xx
+     Signature         <binary data>
+
+
+4.29.   Seek frame
+
+   This frame indicates where other tags in a file/stream can be found.
+   The 'minimum offset to next tag' is calculated from the end of this
+   tag to the beginning of the next. There may only be one 'seek frame'
+   in a tag.
+
+   <Header for 'Seek frame', ID: "SEEK">
+   Minimum offset to next tag       $xx xx xx xx
+
+
+4.30.   Audio seek point index
+
+   Audio files with variable bit rates are intrinsically difficult to
+   deal with in the case of seeking within the file. The ASPI frame
+   makes seeking easier by providing a list a seek points within the
+   audio file. The seek points are a fractional offset within the audio
+   data, providing a starting point from which to find an appropriate
+   point to start decoding. The presence of an ASPI frame requires the
+   existence of a TLEN frame, indicating the duration of the file in
+   milliseconds. There may only be one 'audio seek point index' frame in
+   a tag.
+
+     <Header for 'Seek Point Index', ID: "ASPI">
+     Indexed data start (S)         $xx xx xx xx
+     Indexed data length (L)        $xx xx xx xx
+     Number of index points (N)     $xx xx
+     Bits per index point (b)       $xx
+
+   Then for every index point the following data is included;
+
+     Fraction at index (Fi)          $xx (xx)
+
+   'Indexed data start' is a byte offset from the beginning of the file.
+   'Indexed data length' is the byte length of the audio data being
+   indexed. 'Number of index points' is the number of index points, as
+   the name implies. The recommended number is 100. 'Bits per index
+   point' is 8 or 16, depending on the chosen precision. 8 bits works
+   well for short files (less than 5 minutes of audio), while 16 bits is
+   advantageous for long files. 'Fraction at index' is the numerator of
+   the fraction representing a relative position in the data. The
+   denominator is 2 to the power of b.
+
+   Here are the algorithms to be used in the calculation. The known data
+   must be the offset of the start of the indexed data (S), the offset
+   of the end of the indexed data (E), the number of index points (N),
+   the offset at index i (Oi). We calculate the fraction at index i
+   (Fi).
+
+   Oi is the offset of the frame whose start is soonest after the point
+   for which the time offset is (i/N * duration).
+
+   The frame data should be calculated as follows:
+
+     Fi = Oi/L * 2^b    (rounded down to the nearest integer)
+
+   Offset calculation should be calculated as follows from data in the
+   frame:
+
+     Oi = (Fi/2^b)*L    (rounded up to the nearest integer)
+
+
+5.  Copyright
+
+   Copyright (C) Martin Nilsson 2000. All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that a reference to this document is included on all
+   such copies and derivative works. However, this document itself may
+   not be modified in any way and reissued as the original document.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked.
+
+   This document and the information contained herein is provided on an
+   "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
+   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
+   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+
+6.   References
+
+   [CDDB] Compact Disc Data Base
+
+      <url:http://www.cddb.com>
+
+   [ID3v2.3.0] Martin Nilsson, "ID3v2 informal standard".
+
+      <url:http://www.id3.org/id3v2.3.0.txt>
+
+   [ID3v2-strct] Martin Nilsson,
+   "ID3 tag version 2.4.0 - Main Structure"
+   
+      <url:http//www.id3.org/id3v2.4.0-structure.txt>
+
+   [ISO-639-2] ISO/FDIS 639-2.
+   Codes for the representation of names of languages, Part 2: Alpha-3
+   code. Technical committee / subcommittee: TC 37 / SC 2
+
+   [ISO-4217] ISO 4217:1995.
+   Codes for the representation of currencies and funds.
+   Technical committee / subcommittee: TC 68
+
+   [ISO-8859-1] ISO/IEC DIS 8859-1.
+   8-bit single-byte coded graphic character sets, Part 1: Latin
+   alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2
+
+   [ISRC] ISO 3901:1986
+   International Standard Recording Code (ISRC).
+   Technical committee / subcommittee: TC 46 / SC 9
+
+   [JFIF] JPEG File Interchange Format, version 1.02
+
+      <url:http://www.w3.org/Graphics/JPEG/jfif.txt>
+
+   [KEYWORDS] S. Bradner, 'Key words for use in RFCs to Indicate
+   Requirement Levels', RFC 2119, March 1997.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc2119.txt>
+
+   [MIME] Freed, N.  and N. Borenstein,  "Multipurpose Internet Mail
+   Extensions (MIME) Part One: Format of Internet Message Bodies",
+   RFC 2045, November 1996.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc2045.txt>
+
+   [MPEG] ISO/IEC 11172-3:1993.
+   Coding of moving pictures and associated audio for digital storage
+   media at up to about 1,5 Mbit/s, Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC 13818-3:1995
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio.
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC DIS 13818-3
+   Generic coding of moving pictures and associated audio information,
+   Part 3: Audio (Revision of ISO/IEC 13818-3:1995)
+
+
+   [PNG] Portable Network Graphics, version 1.0
+
+      <url:http://www.w3.org/TR/REC-png-multi.html>
+
+   [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource
+   Locators (URL).", RFC 1738, December 1994.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc1738.txt>
+
+   [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, "ZLIB
+   Compressed
+   Data Format Specification version 3.3", RFC 1950, May 1996.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc1950.txt>
+
+
+7.   Appendix
+
+
+A.   Appendix A - Genre List from ID3v1
+
+   The following genres is defined in ID3v1
+
+      0.Blues
+      1.Classic Rock
+      2.Country
+      3.Dance
+      4.Disco
+      5.Funk
+      6.Grunge
+      7.Hip-Hop
+      8.Jazz
+      9.Metal
+     10.New Age
+     11.Oldies
+     12.Other
+     13.Pop
+     14.R&B
+     15.Rap
+     16.Reggae
+     17.Rock
+     18.Techno
+     19.Industrial
+     20.Alternative
+     21.Ska
+     22.Death Metal
+     23.Pranks
+     24.Soundtrack
+     25.Euro-Techno
+     26.Ambient
+     27.Trip-Hop
+     28.Vocal
+     29.Jazz+Funk
+     30.Fusion
+     31.Trance
+     32.Classical
+     33.Instrumental
+     34.Acid
+     35.House
+     36.Game
+     37.Sound Clip
+     38.Gospel
+     39.Noise
+     40.AlternRock
+     41.Bass
+     42.Soul
+     43.Punk
+     44.Space
+     45.Meditative
+     46.Instrumental Pop
+     47.Instrumental Rock
+     48.Ethnic
+     49.Gothic
+     50.Darkwave
+     51.Techno-Industrial
+     52.Electronic
+     53.Pop-Folk
+     54.Eurodance
+     55.Dream
+     56.Southern Rock
+     57.Comedy
+     58.Cult
+     59.Gangsta
+     60.Top 40
+     61.Christian Rap
+     62.Pop/Funk
+     63.Jungle
+     64.Native American
+     65.Cabaret
+     66.New Wave
+     67.Psychadelic
+     68.Rave
+     69.Showtunes
+     70.Trailer
+     71.Lo-Fi
+     72.Tribal
+     73.Acid Punk
+     74.Acid Jazz
+     75.Polka
+     76.Retro
+     77.Musical
+     78.Rock & Roll
+     79.Hard Rock
+
+
+8.   Author's Address
+
+   Written by
+
+     Martin Nilsson
+     Rydsvägen 246 C. 30
+     SE-584 34 Linköping
+     Sweden
+
+     Email: nilsson at id3.org
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-structure.txt b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-structure.txt
new file mode 100644
index 0000000..5fa156a
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2.4.0-structure.txt
@@ -0,0 +1,733 @@
+
+Informal standard                                             M. Nilsson
+Document: id3v2.4.0-structure.txt                      16 September 2001
+
+
+                 ID3 tag version 2.4.0 - Main Structure
+
+Status of this document
+
+   This document is an informal standard and replaces the ID3v2.3.0
+   standard [ID3v2]. A formal standard will use another revision number
+   even if the content is identical to document. The contents in this
+   document may change for clarifications but never for added or altered
+   functionallity.
+
+   Distribution of this document is unlimited.
+
+
+Abstract
+
+   This document describes the main structure of ID3v2.4.0, which is a
+   revised version of the ID3v2 informal standard [ID3v2] version
+   2.3.0. The ID3v2 offers a flexible way of storing audio meta
+   information within the audio file itself. The information may be
+   technical information, such as equalisation curves, as well as
+   title, performer, copyright etc.
+
+   ID3v2.4.0 is meant to be as close as possible to ID3v2.3.0 in order
+   to allow for implementations to be revised as easily as possible.
+
+
+1.   Table of contents
+
+        Status of this document
+        Abstract
+   1.   Table of contents
+   2.   Conventions in this document
+   2.   Standard overview
+   3.   ID3v2 overview
+     3.1.   ID3v2 header
+     3.2.   ID3v2 extended header
+     3.3.   Padding
+     3.4.   ID3v2 footer
+   4.   ID3v2 frames overview
+     4.1.   Frame header flags
+       4.1.1. Frame status flags
+       4.1.2. Frame format flags
+   5.   Tag location
+   6.   Unsynchronisation
+     6.1.   The unsynchronisation scheme
+     6.2.   Synchsafe integers
+   7.   Copyright
+   8.   References
+   9.   Author's Address
+
+
+2.   Conventions in this document
+
+   Text within "" is a text string exactly as it appears in a tag.
+   Numbers preceded with $ are hexadecimal and numbers preceded with %
+   are binary. $xx is used to indicate a byte with unknown content. %x
+   is used to indicate a bit with unknown content. The most significant
+   bit (MSB) of a byte is called 'bit 7' and the least significant bit
+   (LSB) is called 'bit 0'.
+
+   A tag is the whole tag described in this document. A frame is a block
+   of information in the tag. The tag consists of a header, frames and
+   optional padding. A field is a piece of information; one value, a
+   string etc. A numeric string is a string that consists of the
+   characters "0123456789" only.
+
+   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+   "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
+   document are to be interpreted as described in RFC 2119 [KEYWORDS].
+
+
+3.   ID3v2 overview
+
+   ID3v2 is a general tagging format for audio, which makes it possible
+   to store meta data about the audio inside the audio file itself. The
+   ID3 tag described in this document is mainly targeted at files
+   encoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2 layer III
+   and MPEG-2.5, but may work with other types of encoded audio or as a
+   stand alone format for audio meta data.
+
+   ID3v2 is designed to be as flexible and expandable as possible to
+   meet new meta information needs that might arise. To achieve that
+   ID3v2 is constructed as a container for several information blocks,
+   called frames, whose format need not be known to the software that
+   encounters them. At the start of every frame is an unique and
+   predefined identifier, a size descriptor that allows software to skip
+   unknown frames and a flags field. The flags describes encoding
+   details and if the frame should remain in the tag, should it be
+   unknown to the software, if the file is altered.
+
+   The bitorder in ID3v2 is most significant bit first (MSB). The
+   byteorder in multibyte numbers is most significant byte first (e.g.
+   $12345678 would be encoded $12 34 56 78), also known as big endian
+   and network byte order.
+
+   Overall tag structure:
+
+     +-----------------------------+
+     |      Header (10 bytes)      |
+     +-----------------------------+
+     |       Extended Header       |
+     | (variable length, OPTIONAL) |
+     +-----------------------------+
+     |   Frames (variable length)  |
+     +-----------------------------+
+     |           Padding           |
+     | (variable length, OPTIONAL) |
+     +-----------------------------+
+     | Footer (10 bytes, OPTIONAL) |
+     +-----------------------------+
+
+   In general, padding and footer are mutually exclusive. See details in
+   sections 3.3, 3.4 and 5.
+
+
+3.1.   ID3v2 header
+
+   The first part of the ID3v2 tag is the 10 byte tag header, laid out
+   as follows:
+
+     ID3v2/file identifier      "ID3"
+     ID3v2 version              $04 00
+     ID3v2 flags                %abcd0000
+     ID3v2 size             4 * %0xxxxxxx
+
+   The first three bytes of the tag are always "ID3", to indicate that
+   this is an ID3v2 tag, directly followed by the two version bytes. The
+   first byte of ID3v2 version is its major version, while the second
+   byte is its revision number. In this case this is ID3v2.4.0. All
+   revisions are backwards compatible while major versions are not. If
+   software with ID3v2.4.0 and below support should encounter version
+   five or higher it should simply ignore the whole tag. Version or
+   revision will never be $FF.
+
+   The version is followed by the ID3v2 flags field, of which currently
+   four flags are used.
+
+
+   a - Unsynchronisation
+
+     Bit 7 in the 'ID3v2 flags' indicates whether or not
+     unsynchronisation is applied on all frames (see section 6.1 for
+     details); a set bit indicates usage.
+
+
+   b - Extended header
+
+     The second bit (bit 6) indicates whether or not the header is
+     followed by an extended header. The extended header is described in
+     section 3.2. A set bit indicates the presence of an extended
+     header.
+
+
+   c - Experimental indicator
+
+     The third bit (bit 5) is used as an 'experimental indicator'. This
+     flag SHALL always be set when the tag is in an experimental stage.
+
+
+   d - Footer present
+
+     Bit 4 indicates that a footer (section 3.4) is present at the very
+     end of the tag. A set bit indicates the presence of a footer.
+
+
+   All the other flags MUST be cleared. If one of these undefined flags
+   are set, the tag might not be readable for a parser that does not
+   know the flags function.
+
+   The ID3v2 tag size is stored as a 32 bit synchsafe integer (section
+   6.2), making a total of 28 effective bits (representing up to 256MB).
+
+   The ID3v2 tag size is the sum of the byte length of the extended
+   header, the padding and the frames after unsynchronisation. If a
+   footer is present this equals to ('total size' - 20) bytes, otherwise
+   ('total size' - 10) bytes.
+
+   An ID3v2 tag can be detected with the following pattern:
+     $49 44 33 yy yy xx zz zz zz zz
+   Where yy is less than $FF, xx is the 'flags' byte and zz is less than
+   $80.
+
+
+3.2. Extended header
+
+   The extended header contains information that can provide further
+   insight in the structure of the tag, but is not vital to the correct
+   parsing of the tag information; hence the extended header is
+   optional.
+
+     Extended header size   4 * %0xxxxxxx
+     Number of flag bytes       $01
+     Extended Flags             $xx
+
+   Where the 'Extended header size' is the size of the whole extended
+   header, stored as a 32 bit synchsafe integer. An extended header can
+   thus never have a size of fewer than six bytes.
+
+   The extended flags field, with its size described by 'number of flag
+   bytes', is defined as:
+
+     %0bcd0000
+
+   Each flag that is set in the extended header has data attached, which
+   comes in the order in which the flags are encountered (i.e. the data
+   for flag 'b' comes before the data for flag 'c'). Unset flags cannot
+   have any attached data. All unknown flags MUST be unset and their
+   corresponding data removed when a tag is modified.
+
+   Every set flag's data starts with a length byte, which contains a
+   value between 0 and 127 ($00 - $7f), followed by data that has the
+   field length indicated by the length byte. If a flag has no attached
+   data, the value $00 is used as length byte.
+
+
+   b - Tag is an update
+
+     If this flag is set, the present tag is an update of a tag found
+     earlier in the present file or stream. If frames defined as unique
+     are found in the present tag, they are to override any
+     corresponding ones found in the earlier tag. This flag has no
+     corresponding data.
+
+         Flag data length      $00
+
+   c - CRC data present
+
+     If this flag is set, a CRC-32 [ISO-3309] data is included in the
+     extended header. The CRC is calculated on all the data between the
+     header and footer as indicated by the header's tag length field,
+     minus the extended header. Note that this includes the padding (if
+     there is any), but excludes the footer. The CRC-32 is stored as an
+     35 bit synchsafe integer, leaving the upper four bits always
+     zeroed.
+
+        Flag data length       $05
+        Total frame CRC    5 * %0xxxxxxx
+
+   d - Tag restrictions
+
+     For some applications it might be desired to restrict a tag in more
+     ways than imposed by the ID3v2 specification. Note that the
+     presence of these restrictions does not affect how the tag is
+     decoded, merely how it was restricted before encoding. If this flag
+     is set the tag is restricted as follows:
+
+        Flag data length       $01
+        Restrictions           %ppqrrstt
+
+     p - Tag size restrictions
+
+       00   No more than 128 frames and 1 MB total tag size.
+       01   No more than 64 frames and 128 KB total tag size.
+       10   No more than 32 frames and 40 KB total tag size.
+       11   No more than 32 frames and 4 KB total tag size.
+
+     q - Text encoding restrictions
+
+       0    No restrictions
+       1    Strings are only encoded with ISO-8859-1 [ISO-8859-1] or
+            UTF-8 [UTF-8].
+
+     r - Text fields size restrictions
+
+       00   No restrictions
+       01   No string is longer than 1024 characters.
+       10   No string is longer than 128 characters.
+       11   No string is longer than 30 characters.
+
+       Note that nothing is said about how many bytes is used to
+       represent those characters, since it is encoding dependent. If a
+       text frame consists of more than one string, the sum of the
+       strungs is restricted as stated.
+
+     s - Image encoding restrictions
+
+       0   No restrictions
+       1   Images are encoded only with PNG [PNG] or JPEG [JFIF].
+
+     t - Image size restrictions
+
+       00  No restrictions
+       01  All images are 256x256 pixels or smaller.
+       10  All images are 64x64 pixels or smaller.
+       11  All images are exactly 64x64 pixels, unless required
+           otherwise.
+
+
+3.3.   Padding
+
+   It is OPTIONAL to include padding after the final frame (at the end
+   of the ID3 tag), making the size of all the frames together smaller
+   than the size given in the tag header. A possible purpose of this
+   padding is to allow for adding a few additional frames or enlarge
+   existing frames within the tag without having to rewrite the entire
+   file. The value of the padding bytes must be $00. A tag MUST NOT have
+   any padding between the frames or between the tag header and the
+   frames. Furthermore it MUST NOT have any padding when a tag footer is
+   added to the tag.
+
+
+3.4.   ID3v2 footer
+
+   To speed up the process of locating an ID3v2 tag when searching from
+   the end of a file, a footer can be added to the tag. It is REQUIRED
+   to add a footer to an appended tag, i.e. a tag located after all
+   audio data. The footer is a copy of the header, but with a different
+   identifier.
+
+     ID3v2 identifier           "3DI"
+     ID3v2 version              $04 00
+     ID3v2 flags                %abcd0000
+     ID3v2 size             4 * %0xxxxxxx
+
+
+4.   ID3v2 frame overview
+
+   All ID3v2 frames consists of one frame header followed by one or more
+   fields containing the actual information. The header is always 10
+   bytes and laid out as follows:
+
+     Frame ID      $xx xx xx xx  (four characters)
+     Size      4 * %0xxxxxxx
+     Flags         $xx xx
+
+   The frame ID is made out of the characters capital A-Z and 0-9.
+   Identifiers beginning with "X", "Y" and "Z" are for experimental
+   frames and free for everyone to use, without the need to set the
+   experimental bit in the tag header. Bear in mind that someone else
+   might have used the same identifier as you. All other identifiers are
+   either used or reserved for future use.
+
+   The frame ID is followed by a size descriptor containing the size of
+   the data in the final frame, after encryption, compression and
+   unsynchronisation. The size is excluding the frame header ('total
+   frame size' - 10 bytes) and stored as a 32 bit synchsafe integer.
+
+   In the frame header the size descriptor is followed by two flag
+   bytes. These flags are described in section 4.1.
+
+   There is no fixed order of the frames' appearance in the tag,
+   although it is desired that the frames are arranged in order of
+   significance concerning the recognition of the file. An example of
+   such order: UFID, TIT2, MCDI, TRCK ...
+
+   A tag MUST contain at least one frame. A frame must be at least 1
+   byte big, excluding the header.
+
+   If nothing else is said, strings, including numeric strings and URLs
+   [URL], are represented as ISO-8859-1 [ISO-8859-1] characters in the
+   range $20 - $FF. Such strings are represented in frame descriptions
+   as <text string>, or <full text string> if newlines are allowed. If
+   nothing else is said newline character is forbidden. In ISO-8859-1 a
+   newline is represented, when allowed, with $0A only.
+
+   Frames that allow different types of text encoding contains a text
+   encoding description byte. Possible encodings:
+
+     $00   ISO-8859-1 [ISO-8859-1]. Terminated with $00.
+     $01   UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM. All
+           strings in the same frame SHALL have the same byteorder.
+           Terminated with $00 00.
+     $02   UTF-16BE [UTF-16] encoded Unicode [UNICODE] without BOM.
+           Terminated with $00 00.
+     $03   UTF-8 [UTF-8] encoded Unicode [UNICODE]. Terminated with $00.
+
+   Strings dependent on encoding are represented in frame descriptions
+   as <text string according to encoding>, or <full text string
+   according to encoding> if newlines are allowed. Any empty strings of
+   type $01 which are NULL-terminated may have the Unicode BOM followed
+   by a Unicode NULL ($FF FE 00 00 or $FE FF 00 00).
+
+   The timestamp fields are based on a subset of ISO 8601. When being as
+   precise as possible the format of a time string is
+   yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of
+   24), ":", minutes, ":", seconds), but the precision may be reduced by
+   removing as many time indicators as wanted. Hence valid timestamps
+   are
+   yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and
+   yyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, use
+   the slash character as described in 8601, and for multiple non-
+   contiguous dates, use multiple strings, if allowed by the frame
+   definition.
+
+   The three byte language field, present in several frames, is used to
+   describe the language of the frame's content, according to ISO-639-2
+   [ISO-639-2]. The language should be represented in lower case. If the
+   language is not known the string "XXX" should be used.
+
+   All URLs [URL] MAY be relative, e.g. "picture.png", "../doc.txt".
+
+   If a frame is longer than it should be, e.g. having more fields than
+   specified in this document, that indicates that additions to the
+   frame have been made in a later version of the ID3v2 standard. This
+   is reflected by the revision number in the header of the tag.
+
+
+4.1.   Frame header flags
+
+   In the frame header the size descriptor is followed by two flag
+   bytes. All unused flags MUST be cleared. The first byte is for
+   'status messages' and the second byte is a format description. If an
+   unknown flag is set in the first byte the frame MUST NOT be changed
+   without that bit cleared. If an unknown flag is set in the second
+   byte the frame is likely to not be readable. Some flags in the second
+   byte indicates that extra information is added to the header. These
+   fields of extra information is ordered as the flags that indicates
+   them. The flags field is defined as follows (l and o left out because
+   ther resemblence to one and zero):
+
+     %0abc0000 %0h00kmnp
+
+   Some frame format flags indicate that additional information fields
+   are added to the frame. This information is added after the frame
+   header and before the frame data in the same order as the flags that
+   indicates them. I.e. the four bytes of decompressed size will precede
+   the encryption method byte. These additions affects the 'frame size'
+   field, but are not subject to encryption or compression.
+   
+   The default status flags setting for a frame is, unless stated
+   otherwise, 'preserved if tag is altered' and 'preserved if file is
+   altered', i.e. %00000000.
+
+
+4.1.1. Frame status flags
+
+   a - Tag alter preservation
+
+     This flag tells the tag parser what to do with this frame if it is
+     unknown and the tag is altered in any way. This applies to all
+     kinds of alterations, including adding more padding and reordering
+     the frames.
+
+     0     Frame should be preserved.
+     1     Frame should be discarded.
+
+
+   b - File alter preservation
+
+     This flag tells the tag parser what to do with this frame if it is
+     unknown and the file, excluding the tag, is altered. This does not
+     apply when the audio is completely replaced with other audio data.
+
+     0     Frame should be preserved.
+     1     Frame should be discarded.
+
+
+   c - Read only
+
+      This flag, if set, tells the software that the contents of this
+      frame are intended to be read only. Changing the contents might
+      break something, e.g. a signature. If the contents are changed,
+      without knowledge of why the frame was flagged read only and
+      without taking the proper means to compensate, e.g. recalculating
+      the signature, the bit MUST be cleared.
+
+
+4.1.2. Frame format flags
+
+   h - Grouping identity
+
+      This flag indicates whether or not this frame belongs in a group
+      with other frames. If set, a group identifier byte is added to the
+      frame. Every frame with the same group identifier belongs to the
+      same group.
+
+      0     Frame does not contain group information
+      1     Frame contains group information
+
+
+   k - Compression
+
+      This flag indicates whether or not the frame is compressed.
+      A 'Data Length Indicator' byte MUST be included in the frame.
+
+      0     Frame is not compressed.
+      1     Frame is compressed using zlib [zlib] deflate method.
+            If set, this requires the 'Data Length Indicator' bit
+            to be set as well.
+
+
+   m - Encryption
+   
+      This flag indicates whether or not the frame is encrypted. If set,
+      one byte indicating with which method it was encrypted will be
+      added to the frame. See description of the ENCR frame for more
+      information about encryption method registration. Encryption
+      should be done after compression. Whether or not setting this flag
+      requires the presence of a 'Data Length Indicator' depends on the
+      specific algorithm used.
+
+      0     Frame is not encrypted.
+      1     Frame is encrypted.
+
+   n - Unsynchronisation
+
+      This flag indicates whether or not unsynchronisation was applied
+      to this frame. See section 6 for details on unsynchronisation.
+      If this flag is set all data from the end of this header to the
+      end of this frame has been unsynchronised. Although desirable, the
+      presence of a 'Data Length Indicator' is not made mandatory by
+      unsynchronisation.
+
+      0     Frame has not been unsynchronised.
+      1     Frame has been unsyrchronised.
+
+   p - Data length indicator
+
+      This flag indicates that a data length indicator has been added to
+      the frame. The data length indicator is the value one would write
+      as the 'Frame length' if all of the frame format flags were
+      zeroed, represented as a 32 bit synchsafe integer.
+
+      0      There is no Data Length Indicator.
+      1      A data length Indicator has been added to the frame.
+
+
+5.   Tag location
+
+   The default location of an ID3v2 tag is prepended to the audio so
+   that players can benefit from the information when the data is
+   streamed. It is however possible to append the tag, or make a
+   prepend/append combination. When deciding upon where an unembedded
+   tag should be located, the following order of preference SHOULD be
+   considered.
+   
+     1. Prepend the tag.
+
+     2. Prepend a tag with all vital information and add a second tag at 
+        the end of the file, before tags from other tagging systems. The
+        first tag is required to have a SEEK frame.
+      
+     3. Add a tag at the end of the file, before tags from other tagging
+        systems.
+      
+   In case 2 and 3 the tag can simply be appended if no other known tags
+   are present. The suggested method to find ID3v2 tags are:
+   
+     1. Look for a prepended tag using the pattern found in section 3.1.
+
+     2. If a SEEK frame was found, use its values to guide further
+        searching.
+
+     3. Look for a tag footer, scanning from the back of the file.
+
+   For every new tag that is found, the old tag should be discarded
+   unless the update flag in the extended header (section 3.2) is set.
+   
+
+6.   Unsynchronisation
+
+   The only purpose of unsynchronisation is to make the ID3v2 tag as
+   compatible as possible with existing software and hardware. There is
+   no use in 'unsynchronising' tags if the file is only to be processed
+   only by ID3v2 aware software and hardware. Unsynchronisation is only
+   useful with tags in MPEG 1/2 layer I, II and III, MPEG 2.5 and AAC
+   files.
+
+
+6.1.   The unsynchronisation scheme
+
+   Whenever a false synchronisation is found within the tag, one zeroed
+   byte is inserted after the first false synchronisation byte. The
+   format of synchronisations that should be altered by ID3 encoders is
+   as follows:
+
+         %11111111 111xxxxx
+
+   and should be replaced with:
+
+         %11111111 00000000 111xxxxx
+
+   This has the side effect that all $FF 00 combinations have to be
+   altered, so they will not be affected by the decoding process.
+   Therefore all the $FF 00 combinations have to be replaced with the
+   $FF 00 00 combination during the unsynchronisation.
+
+   To indicate usage of the unsynchronisation, the unsynchronisation
+   flag in the frame header should be set. This bit MUST be set if the
+   frame was altered by the unsynchronisation and SHOULD NOT be set if
+   unaltered. If all frames in the tag are unsynchronised the
+   unsynchronisation flag in the tag header SHOULD be set. It MUST NOT
+   be set if the tag has a frame which is not unsynchronised.
+
+   Assume the first byte of the audio to be $FF. The special case when
+   the last byte of the last frame is $FF and no padding nor footer is
+   used will then introduce a false synchronisation. This can be solved
+   by adding a footer, adding padding or unsynchronising the frame and
+   add $00 to the end of the frame data, thus adding more byte to the
+   frame size than a normal unsynchronisation would. Although not
+   preferred, it is allowed to apply the last method on all frames
+   ending with $FF.
+
+   It is preferred that the tag is either completely unsynchronised or
+   not unsynchronised at all. A completely unsynchronised tag has no 
+   false synchonisations in it, as defined above, and does not end with
+   $FF. A completely non-unsynchronised tag contains no unsynchronised
+   frames, and thus the unsynchronisation flag in the header is cleared.
+
+   Do bear in mind, that if compression or encryption is used, the
+   unsynchronisation scheme MUST be applied afterwards. When decoding an
+   unsynchronised frame, the unsynchronisation scheme MUST be reversed
+   first, encryption and decompression afterwards.
+
+
+6.2.   Synchsafe integers
+
+   In some parts of the tag it is inconvenient to use the
+   unsychronisation scheme because the size of unsynchronised data is
+   not known in advance, which is particularly problematic with size
+   descriptors. The solution in ID3v2 is to use synchsafe integers, in
+   which there can never be any false synchs. Synchsafe integers are
+   integers that keep its highest bit (bit 7) zeroed, making seven bits
+   out of eight available. Thus a 32 bit synchsafe integer can store 28
+   bits of information.
+   
+   Example:
+   
+     255 (%11111111) encoded as a 16 bit synchsafe integer is 383
+     (%00000001 01111111).
+
+
+7.   Copyright
+
+   Copyright (C) Martin Nilsson 2000. All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that a reference to this document is included on all
+   such copies and derivative works. However, this document itself may
+   not be modified in any way and reissued as the original document.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked.
+
+   This document and the information contained herein is provided on an
+   'AS IS' basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
+   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
+   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+
+8.   References
+
+   [ID3v2] Martin Nilsson, 'ID3v2 informal standard'.
+
+      <url:http://www.id3.org/id3v2.3.0.txt>
+
+   [ISO-639-2] ISO/FDIS 639-2.
+   'Codes for the representation of names of languages, Part 2: Alpha-3
+   code.' Technical committee / subcommittee: TC 37 / SC 2
+
+   [ISO-3309] ISO 3309
+   'Information Processing Systems--Data Communication High-Level Data
+   Link Control Procedure--Frame Structure', IS 3309, October 1984, 3rd
+   Edition.
+
+   [ISO-8859-1] ISO/IEC DIS 8859-1.
+   '8-bit single-byte coded graphic character sets, Part 1: Latin
+   alphabet No. 1.' Technical committee / subcommittee: JTC 1 / SC 2
+
+   [JFIF] 'JPEG File Interchange Format, version 1.02'
+
+      <url:http://www.w3.org/Graphics/JPEG/jfif.txt>
+
+   [KEYWORDS] S. Bradner, 'Key words for use in RFCs to Indicate
+   Requirement Levels', RFC 2119, March 1997.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc2119.txt>
+
+   [MPEG] ISO/IEC 11172-3:1993.
+   'Coding of moving pictures and associated audio for digital storage
+   media at up to about 1,5 Mbit/s, Part 3: Audio.'
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC 13818-3:1995
+   'Generic coding of moving pictures and associated audio information,
+   Part 3: Audio.'
+   Technical committee / subcommittee: JTC 1 / SC 29
+    and
+   ISO/IEC DIS 13818-3
+   'Generic coding of moving pictures and associated audio information,
+   Part 3: Audio (Revision of ISO/IEC 13818-3:1995)'
+
+   [PNG] 'Portable Network Graphics, version 1.0'
+
+      <url:http://www.w3.org/TR/REC-png-multi.html>
+
+   [UNICODE] The Unicode Consortium,
+   'The Unicode Standard Version 3.0', ISBN 0-201-61633-5.
+
+   <url:http://www.unicode.org/unicode/standard/versions/Unicode3.0.htm>
+
+   [URL] T. Berners-Lee, L. Masinter & M. McCahill, 'Uniform Resource
+   Locators (URL)', RFC 1738, December 1994.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc1738.txt>
+
+   [UTF-8] F. Yergeau, 'UTF-8, a transformation format of ISO 10646',
+   RFC 2279, January 1998.
+   
+      <url:ftp://ftp.isi.edu/in-notes/rfc2279.txt>
+
+   [UTF-16] F. Yergeau, 'UTF-16, an encoding of ISO 10646', RFC 2781,
+   February 2000.
+   
+      <url:ftp://ftp.isi.edu/in-notes/rfc2781.txt>
+   
+   [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, 'ZLIB
+   Compressed Data Format Specification version 3.3', RFC 1950,
+   May 1996.
+
+      <url:ftp://ftp.isi.edu/in-notes/rfc1950.txt>
+
+
+9.   Author's Address
+
+   Written by
+
+     Martin Nilsson
+     Rydsvägen 246 C. 30
+     SE-584 34 Linköping
+     Sweden
+
+     Email: nilsson at id3.org
+
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.cpp
new file mode 100644
index 0000000..bd470a0
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.cpp
@@ -0,0 +1,71 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "id3v2extendedheader.h"
+#include "id3v2synchdata.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class ExtendedHeader::ExtendedHeaderPrivate
+{
+public:
+  ExtendedHeaderPrivate() : size(0) {}
+
+  uint size;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
+ExtendedHeader::ExtendedHeader()
+{
+  d = new ExtendedHeaderPrivate();
+}
+
+ExtendedHeader::~ExtendedHeader()
+{
+  delete d;
+}
+
+TagLib::uint ExtendedHeader::size() const
+{
+  return d->size;
+}
+
+void ExtendedHeader::setData(const ByteVector &data)
+{
+  parse(data);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void ExtendedHeader::parse(const ByteVector &data)
+{
+  d->size = SynchData::toUInt(data.mid(0, 4)); // (structure 3.2 "Extended header size")
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.h
new file mode 100644
index 0000000..9750fae
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2extendedheader.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2EXTENDEDHEADER_H
+#define TAGLIB_ID3V2EXTENDEDHEADER_H
+
+#include "taglib_export.h"
+#include "tbytevector.h"
+#include "taglib.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! ID3v2 extended header implementation
+
+    /*!
+     * This class implements ID3v2 extended headers.  It attempts to follow,
+     * both  semantically and programatically, the structure specified in
+     * the ID3v2 standard.  The API is based on the properties of ID3v2 extended
+     * headers specified there.  If any of the terms used in this documentation
+     * are unclear please check the specification in the linked section.
+     * (Structure, <a href="id3v2-structure.html#3.2">3.2</a>)
+     */
+
+    class TAGLIB_EXPORT ExtendedHeader
+    {
+    public:
+      /*!
+       * Constructs an empty ID3v2 extended header.
+       */
+      ExtendedHeader();
+
+      /*!
+       * Destroys the extended header.
+       */
+      virtual ~ExtendedHeader();
+
+      /*!
+       * Returns the size of the extended header.  This is variable for the
+       * extended header.
+       */
+      uint size() const;
+
+      /*!
+       * Sets the data that will be used as the extended header.  Since the
+       * length is not known before the extended header has been parsed, this
+       * should just be a pointer to the first byte of the extended header.  It
+       * will determine the length internally and make that available through
+       * size().
+       */
+      void setData(const ByteVector &data);
+
+    protected:
+      /*!
+       * Called by setData() to parse the extended header data.  It makes this
+       * information available through the public API.
+       */
+      void parse(const ByteVector &data);
+
+    private:
+      ExtendedHeader(const ExtendedHeader &);
+      ExtendedHeader &operator=(const ExtendedHeader &);
+
+      class ExtendedHeaderPrivate;
+      ExtendedHeaderPrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.cpp
new file mode 100644
index 0000000..d542433
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.cpp
@@ -0,0 +1,60 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "id3v2footer.h"
+#include "id3v2header.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class Footer::FooterPrivate
+{
+public:
+  static const uint size = 10;
+};
+
+Footer::Footer()
+{
+
+}
+
+Footer::~Footer()
+{
+
+}
+
+TagLib::uint Footer::size()
+{
+  return FooterPrivate::size;
+}
+
+ByteVector Footer::render(const Header *header) const
+{
+    ByteVector headerData = header->render();
+    headerData[0] = '3';
+    headerData[1] = 'D';
+    headerData[2] = 'I';
+    return headerData;
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.h
new file mode 100644
index 0000000..5d0e1af
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2footer.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2FOOTER_H
+#define TAGLIB_ID3V2FOOTER_H
+
+#include "taglib_export.h"
+#include "tbytevector.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    class Header;
+
+    //! ID3v2 footer implementation
+
+    /*!
+     * Per the ID3v2 specification, the tag's footer is just a copy of the
+     * information in the header.  As such there is no API for reading the
+     * data from the header, it can just as easily be done from the header.
+     *
+     * In fact, at this point, TagLib does not even parse the footer since
+     * it is not useful internally.  However, if the flag to include a footer
+     * has been set in the ID3v2::Tag, TagLib will render a footer.
+     */
+
+    class TAGLIB_EXPORT Footer
+    {
+    public:
+      /*!
+       * Constructs an empty ID3v2 footer.
+       */
+      Footer();
+      /*!
+       * Destroys the footer.
+       */
+      virtual ~Footer();
+
+      /*!
+       * Returns the size of the footer.  Presently this is always 10 bytes.
+       */
+      static uint size();
+
+      /*!
+       * Renders the footer based on the data in \a header.
+       */
+      ByteVector render(const Header *header) const;
+
+    private:
+      Footer(const Footer &);
+      Footer &operator=(const Footer &);
+
+      class FooterPrivate;
+      FooterPrivate *d;
+    };
+
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.cpp
new file mode 100644
index 0000000..7c76ac7
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.cpp
@@ -0,0 +1,549 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef HAVE_ZLIB
+#include <config.h>
+#endif
+
+#if HAVE_ZLIB
+#include <zlib.h>
+#endif
+
+#include <bitset>
+
+#include <tdebug.h>
+#include <tstringlist.h>
+
+#include "id3v2frame.h"
+#include "id3v2synchdata.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class Frame::FramePrivate
+{
+public:
+  FramePrivate() :
+    header(0)
+    {}
+
+  ~FramePrivate()
+  {
+    delete header;
+  }
+
+  Frame::Header *header;
+};
+
+namespace
+{
+  bool isValidFrameID(const ByteVector &frameID)
+  {
+    if(frameID.size() != 4)
+      return false;
+
+    for(ByteVector::ConstIterator it = frameID.begin(); it != frameID.end(); it++) {
+      if( (*it < 'A' || *it > 'Z') && (*it < '1' || *it > '9') ) {
+        return false;
+      }
+    }
+    return true;
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// static methods
+////////////////////////////////////////////////////////////////////////////////
+
+TagLib::uint Frame::headerSize()
+{
+  return Header::size();
+}
+
+TagLib::uint Frame::headerSize(uint version)
+{
+  return Header::size(version);
+}
+
+ByteVector Frame::textDelimiter(String::Type t)
+{
+  ByteVector d = char(0);
+  if(t == String::UTF16 || t == String::UTF16BE || t == String::UTF16LE)
+    d.append(char(0));
+  return d;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Frame::~Frame()
+{
+  delete d;
+}
+
+ByteVector Frame::frameID() const
+{
+  if(d->header)
+    return d->header->frameID();
+  else
+    return ByteVector::null;
+}
+
+TagLib::uint Frame::size() const
+{
+  if(d->header)
+    return d->header->frameSize();
+  else
+    return 0;
+}
+
+void Frame::setData(const ByteVector &data)
+{
+  parse(data);
+}
+
+void Frame::setText(const String &)
+{
+
+}
+
+ByteVector Frame::render() const
+{
+  ByteVector fieldData = renderFields();
+  d->header->setFrameSize(fieldData.size());
+  ByteVector headerData = d->header->render();
+
+  return headerData + fieldData;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+Frame::Frame(const ByteVector &data)
+{
+  d = new FramePrivate;
+  d->header = new Header(data);
+}
+
+Frame::Frame(Header *h)
+{
+  d = new FramePrivate;
+  d->header = h;
+}
+
+Frame::Header *Frame::header() const
+{
+  return d->header;
+}
+
+void Frame::setHeader(Header *h, bool deleteCurrent)
+{
+  if(deleteCurrent)
+    delete d->header;
+
+  d->header = h;
+}
+
+void Frame::parse(const ByteVector &data)
+{
+  if(d->header)
+    d->header->setData(data);
+  else
+    d->header = new Header(data);
+
+  parseFields(fieldData(data));
+}
+
+ByteVector Frame::fieldData(const ByteVector &frameData) const
+{
+  uint headerSize = Header::size(d->header->version());
+
+  uint frameDataOffset = headerSize;
+  uint frameDataLength = size();
+
+  if(d->header->compression() || d->header->dataLengthIndicator()) {
+    frameDataLength = SynchData::toUInt(frameData.mid(headerSize, 4));
+    frameDataOffset += 4;
+  }
+
+#if HAVE_ZLIB
+  if(d->header->compression() &&
+     !d->header->encryption())
+  {
+    ByteVector data(frameDataLength);
+    uLongf uLongTmp = frameDataLength;
+    ::uncompress((Bytef *) data.data(),
+                 (uLongf *) &uLongTmp,
+                 (Bytef *) frameData.data() + frameDataOffset,
+                 size());
+    return data;
+  }
+  else
+#endif
+    return frameData.mid(frameDataOffset, frameDataLength);
+}
+
+String Frame::readStringField(const ByteVector &data, String::Type encoding, int *position)
+{
+  int start = 0;
+
+  if(!position)
+    position = &start;
+
+  ByteVector delimiter = textDelimiter(encoding);
+
+  int end = data.find(delimiter, *position, delimiter.size());
+
+  if(end < *position)
+    return String::null;
+
+  String str = String(data.mid(*position, end - *position), encoding);
+
+  *position = end + delimiter.size();
+
+  return str;
+}
+
+String::Type Frame::checkEncoding(const StringList &fields, String::Type encoding) // static
+{
+  if(encoding != String::Latin1)
+    return encoding;
+
+  for(StringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) {
+    if(!(*it).isLatin1()) {
+      debug("Frame::checkEncoding() -- Rendering using UTF8.");
+      return String::UTF8;
+    }
+  }
+
+  return String::Latin1;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Frame::Header class
+////////////////////////////////////////////////////////////////////////////////
+
+class Frame::Header::HeaderPrivate
+{
+public:
+  HeaderPrivate() :
+    frameSize(0),
+    version(4),
+    tagAlterPreservation(false),
+    fileAlterPreservation(false),
+    readOnly(false),
+    groupingIdentity(false),
+    compression(false),
+    encryption(false),
+    unsynchronisation(false),
+    dataLengthIndicator(false)
+    {}
+
+  ByteVector frameID;
+  uint frameSize;
+  uint version;
+
+  // flags
+
+  bool tagAlterPreservation;
+  bool fileAlterPreservation;
+  bool readOnly;
+  bool groupingIdentity;
+  bool compression;
+  bool encryption;
+  bool unsynchronisation;
+  bool dataLengthIndicator;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members (Frame::Header)
+////////////////////////////////////////////////////////////////////////////////
+
+TagLib::uint Frame::Header::size()
+{
+  return size(4);
+}
+
+TagLib::uint Frame::Header::size(uint version)
+{
+  switch(version) {
+  case 0:
+  case 1:
+  case 2:
+    return 6;
+  case 3:
+  case 4:
+  default:
+    return 10;
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members (Frame::Header)
+////////////////////////////////////////////////////////////////////////////////
+
+Frame::Header::Header(const ByteVector &data, bool synchSafeInts)
+{
+  d = new HeaderPrivate;
+  setData(data, synchSafeInts);
+}
+
+Frame::Header::Header(const ByteVector &data, uint version)
+{
+  d = new HeaderPrivate;
+  setData(data, version);
+}
+
+Frame::Header::~Header()
+{
+  delete d;
+}
+
+void Frame::Header::setData(const ByteVector &data, bool synchSafeInts)
+{
+  setData(data, uint(synchSafeInts ? 4 : 3));
+}
+
+void Frame::Header::setData(const ByteVector &data, uint version)
+{
+  d->version = version;
+
+  switch(version) {
+  case 0:
+  case 1:
+  case 2:
+  {
+    // ID3v2.2
+
+    if(data.size() < 3) {
+      debug("You must at least specify a frame ID.");
+      return;
+    }
+
+    // Set the frame ID -- the first three bytes
+
+    d->frameID = data.mid(0, 3);
+
+    // If the full header information was not passed in, do not continue to the
+    // steps to parse the frame size and flags.
+
+    if(data.size() < 6) {
+      d->frameSize = 0;
+      return;
+    }
+
+    d->frameSize = data.mid(3, 3).toUInt();
+
+    break;
+  }
+  case 3:
+  {
+    // ID3v2.3
+
+    if(data.size() < 4) {
+      debug("You must at least specify a frame ID.");
+      return;
+    }
+
+    // Set the frame ID -- the first four bytes
+
+    d->frameID = data.mid(0, 4);
+
+    // If the full header information was not passed in, do not continue to the
+    // steps to parse the frame size and flags.
+
+    if(data.size() < 10) {
+      d->frameSize = 0;
+      return;
+    }
+
+    // Set the size -- the frame size is the four bytes starting at byte four in
+    // the frame header (structure 4)
+
+    d->frameSize = data.mid(4, 4).toUInt();
+
+    { // read the first byte of flags
+      std::bitset<8> flags(data[8]);
+      d->tagAlterPreservation  = flags[7]; // (structure 3.3.1.a)
+      d->fileAlterPreservation = flags[6]; // (structure 3.3.1.b)
+      d->readOnly              = flags[5]; // (structure 3.3.1.c)
+    }
+
+    { // read the second byte of flags
+      std::bitset<8> flags(data[9]);
+      d->compression         = flags[7]; // (structure 3.3.1.i)
+      d->encryption          = flags[6]; // (structure 3.3.1.j)
+      d->groupingIdentity    = flags[5]; // (structure 3.3.1.k)
+    }
+    break;
+  }
+  case 4:
+  default:
+  {
+    // ID3v2.4
+
+    if(data.size() < 4) {
+      debug("You must at least specify a frame ID.");
+      return;
+    }
+
+    // Set the frame ID -- the first four bytes
+
+    d->frameID = data.mid(0, 4);
+
+    // If the full header information was not passed in, do not continue to the
+    // steps to parse the frame size and flags.
+
+    if(data.size() < 10) {
+      d->frameSize = 0;
+      return;
+    }
+
+    // Set the size -- the frame size is the four bytes starting at byte four in
+    // the frame header (structure 4)
+
+    d->frameSize = SynchData::toUInt(data.mid(4, 4));
+#ifndef NO_ITUNES_HACKS
+    // iTunes writes v2.4 tags with v2.3-like frame sizes
+    if(d->frameSize > 127) {
+      if(!isValidFrameID(data.mid(d->frameSize + 10, 4))) {
+        unsigned int uintSize = data.mid(4, 4).toUInt();
+        if(isValidFrameID(data.mid(uintSize + 10, 4))) {
+          d->frameSize = uintSize;
+        }
+      }
+    }
+#endif
+
+    { // read the first byte of flags
+      std::bitset<8> flags(data[8]);
+      d->tagAlterPreservation  = flags[6]; // (structure 4.1.1.a)
+      d->fileAlterPreservation = flags[5]; // (structure 4.1.1.b)
+      d->readOnly              = flags[4]; // (structure 4.1.1.c)
+    }
+
+    { // read the second byte of flags
+      std::bitset<8> flags(data[9]);
+      d->groupingIdentity    = flags[6]; // (structure 4.1.2.h)
+      d->compression         = flags[3]; // (structure 4.1.2.k)
+      d->encryption          = flags[2]; // (structure 4.1.2.m)
+      d->unsynchronisation   = flags[1]; // (structure 4.1.2.n)
+      d->dataLengthIndicator = flags[0]; // (structure 4.1.2.p)
+    }
+    break;
+  }
+  }
+}
+
+ByteVector Frame::Header::frameID() const
+{
+  return d->frameID;
+}
+
+void Frame::Header::setFrameID(const ByteVector &id)
+{
+  d->frameID = id.mid(0, 4);
+}
+
+TagLib::uint Frame::Header::frameSize() const
+{
+  return d->frameSize;
+}
+
+void Frame::Header::setFrameSize(uint size)
+{
+  d->frameSize = size;
+}
+
+TagLib::uint Frame::Header::version() const
+{
+  return d->version;
+}
+
+bool Frame::Header::tagAlterPreservation() const
+{
+  return d->tagAlterPreservation;
+}
+
+void Frame::Header::setTagAlterPreservation(bool preserve)
+{
+  d->tagAlterPreservation = preserve;
+}
+
+bool Frame::Header::fileAlterPreservation() const
+{
+  return d->fileAlterPreservation;
+}
+
+bool Frame::Header::readOnly() const
+{
+  return d->readOnly;
+}
+
+bool Frame::Header::groupingIdentity() const
+{
+  return d->groupingIdentity;
+}
+
+bool Frame::Header::compression() const
+{
+  return d->compression;
+}
+
+bool Frame::Header::encryption() const
+{
+  return d->encryption;
+}
+
+bool Frame::Header::unsycronisation() const
+{
+  return unsynchronisation();
+}
+
+bool Frame::Header::unsynchronisation() const
+{
+  return d->unsynchronisation;
+}
+
+bool Frame::Header::dataLengthIndicator() const
+{
+  return d->dataLengthIndicator;
+}
+
+ByteVector Frame::Header::render() const
+{
+  ByteVector flags(2, char(0)); // just blank for the moment
+
+  ByteVector v = d->frameID + SynchData::fromUInt(d->frameSize) + flags;
+
+  return v;
+}
+
+bool Frame::Header::frameAlterPreservation() const
+{
+  return fileAlterPreservation();
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.h
new file mode 100644
index 0000000..e76d060
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2frame.h
@@ -0,0 +1,414 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2FRAME_H
+#define TAGLIB_ID3V2FRAME_H
+
+#include "tstring.h"
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  class StringList;
+
+  namespace ID3v2 {
+
+    class Tag;
+    class FrameFactory;
+
+    //! ID3v2 frame implementation
+
+    /*!
+     * This class is the main ID3v2 frame implementation.  In ID3v2, a tag is
+     * split between a collection of frames (which are in turn split into fields
+     * (Structure, <a href="id3v2-structure.html#4">4</a>)
+     * (<a href="id3v2-frames.html">Frames</a>).  This class provides an API for
+     * gathering information about and modifying ID3v2 frames.  Funtionallity
+     * specific to a given frame type is handed in one of the many subclasses.
+     */
+
+    class TAGLIB_EXPORT Frame
+    {
+      friend class Tag;
+      friend class FrameFactory;
+
+    public:
+      /*!
+       * Destroys this Frame instance.
+       */
+      virtual ~Frame();
+
+      /*!
+       * Returns the Frame ID (Structure, <a href="id3v2-structure.html#4">4</a>)
+       * (Frames, <a href="id3v2-frames.html#4">4</a>)
+       */
+      ByteVector frameID() const;
+
+      /*!
+       * Returns the size of the frame.
+       */
+      uint size() const;
+
+      /*!
+       * Returns the size of the frame header
+       *
+       * \deprecated This is only accurate for ID3v2.3 or ID3v2.4.  Please use
+       * the call below which accepts an ID3v2 version number.  In the next
+       * non-binary compatible release this will be made into a non-static
+       * member that checks the internal ID3v2 version.
+       */
+      static uint headerSize(); // BIC: remove and make non-static
+
+      /*!
+       * Returns the size of the frame header for the given ID3v2 version.
+       *
+       * \deprecated Please see the explanation above.
+       */
+      static uint headerSize(uint version); // BIC: remove and make non-static
+
+      /*!
+       * Sets the data that will be used as the frame.  Since the length is not
+       * known before the frame has been parsed, this should just be a pointer to
+       * the first byte of the frame.  It will determine the length internally
+       * and make that available through size().
+       */
+      void setData(const ByteVector &data);
+
+      /*!
+       * Set the text of frame in the sanest way possible.  This should only be
+       * reimplemented in frames where there is some logical mapping to text.
+       *
+       * \note If the frame type supports multiple text encodings, this will not
+       * change the text encoding of the frame; the string will be converted to
+       * that frame's encoding.  Please use the specific APIs of the frame types
+       * to set the encoding if that is desired.
+       */
+      virtual void setText(const String &text);
+
+      /*!
+       * This returns the textual representation of the data in the frame.
+       * Subclasses must reimplement this method to provide a string
+       * representation of the frame's data.
+       */
+      virtual String toString() const = 0;
+
+      /*!
+       * Render the frame back to its binary format in a ByteVector.
+       */
+      ByteVector render() const;
+
+      /*!
+       * Returns the text delimiter that is used between fields for the string
+       * type \a t.
+       */
+      static ByteVector textDelimiter(String::Type t);
+
+    protected:
+      class Header;
+
+      /*!
+       * Constructs an ID3v2 frame using \a data to read the header information.
+       * All other processing of \a data should be handled in a subclass.
+       *
+       * \note This need not contain anything more than a frame ID, but
+       * \e must constain at least that.
+       */
+      explicit Frame(const ByteVector &data);
+
+      /*!
+       * This creates an Frame using the header \a h.
+       *
+       * The ownership of this header will be assigned to the frame and the
+       * header will be deleted when the frame is destroyed.
+       */
+      Frame(Header *h);
+
+      /*!
+       * Returns a pointer to the frame header.
+       */
+      Header *header() const;
+
+      /*!
+       * Sets the header to \a h.  If \a deleteCurrent is true, this will free
+       * the memory of the current header.
+       *
+       * The ownership of this header will be assigned to the frame and the
+       * header will be deleted when the frame is destroyed.
+       */
+      void setHeader(Header *h, bool deleteCurrent = true);
+
+      /*!
+       * Called by setData() to parse the frame data.  It makes this information
+       * available through the public API.
+       */
+      void parse(const ByteVector &data);
+
+      /*!
+       * Called by parse() to parse the field data.  It makes this information
+       * available through the public API.  This must be overridden by the
+       * subclasses.
+       */
+      virtual void parseFields(const ByteVector &data) = 0;
+
+      /*!
+       * Render the field data back to a binary format in a ByteVector.  This
+       * must be overridden by subclasses.
+       */
+      virtual ByteVector renderFields() const = 0;
+
+      /*!
+       * Returns a ByteVector containing the field data given the frame data.
+       * This correctly adjusts for the header size plus any additional frame
+       * data that's specified in the frame header flags.
+       */
+      ByteVector fieldData(const ByteVector &frameData) const;
+
+      /*!
+       * Reads a String of type \a encodiong from the ByteVector \a data.  If \a
+       * position is passed in it is used both as the starting point and is
+       * updated to replect the position just after the string that has been read.
+       * This is useful for reading strings sequentially.
+       */
+      String readStringField(const ByteVector &data, String::Type encoding,
+                             int *positon = 0);
+
+      /*!
+       * Checks a the list of string values to see if they can be used with the
+       * specified encoding and returns the recommended encoding.
+       */
+      static String::Type checkEncoding(const StringList &fields,
+                                        String::Type encoding);
+
+    private:
+      Frame(const Frame &);
+      Frame &operator=(const Frame &);
+
+      class FramePrivate;
+      friend class FramePrivate;
+      FramePrivate *d;
+    };
+
+    //! ID3v2 frame header implementation
+
+    /*!
+     * The ID3v2 Frame Header (Structure, <a href="id3v2-structure.html#4">4</a>)
+     *
+     * Every ID3v2::Frame has an associated header that gives some general
+     * properties of the frame and also makes it possible to identify the frame
+     * type.
+     *
+     * As such when reading an ID3v2 tag ID3v2::FrameFactory first creates the
+     * frame headers and then creates the appropriate Frame subclass based on
+     * the type and attaches the header.
+     */
+
+    class TAGLIB_EXPORT Frame::Header
+    {
+    public:
+      /*!
+       * Construct a Frame Header based on \a data.  \a data must at least
+       * contain a 4 byte frame ID, and optionally can contain flag data and the
+       * frame size.  i.e. Just the frame id -- "TALB" -- is a valid value.
+       *
+       * \deprecated Please use the constructor below that accepts a version
+       * number.
+       */
+      Header(const ByteVector &data, bool synchSafeInts);
+
+      /*!
+       * Construct a Frame Header based on \a data.  \a data must at least
+       * contain a 4 byte frame ID, and optionally can contain flag data and the
+       * frame size.  i.e. Just the frame id -- "TALB" -- is a valid value.
+       *
+       * \a version should be the ID3v2 version of the tag.
+       */
+      explicit Header(const ByteVector &data, uint version = 4);
+
+      /*!
+       * Destroys this Header instance.
+       */
+      virtual ~Header();
+
+      /*!
+       * Sets the data for the Header.
+       *
+       * \deprecated Please use the version below that accepts an ID3v2 version
+       * number.
+       */
+      void setData(const ByteVector &data, bool synchSafeInts);
+
+      /*!
+       * Sets the data for the Header.  \a version should indicate the ID3v2
+       * version number of the tag that this frame is contained in.
+       */
+      void setData(const ByteVector &data, uint version = 4);
+
+      /*!
+       * Returns the Frame ID (Structure, <a href="id3v2-structure.html#4">4</a>)
+       * (Frames, <a href="id3v2-frames.html#4">4</a>)
+       */
+      ByteVector frameID() const;
+
+      /*!
+       * Sets the frame's ID to \a id.  Only the first four bytes of \a id will
+       * be used.
+       *
+       * \warning This method should in general be avoided.  It exists simply to
+       * provide a mechanism for transforming frames from a deprecated frame type
+       * to a newer one -- i.e. TYER to TDRC from ID3v2.3 to ID3v2.4.
+       */
+      void setFrameID(const ByteVector &id);
+
+      /*!
+       * Returns the size of the frame data portion, as set when setData() was
+       * called or set explicitly via setFrameSize().
+       */
+      uint frameSize() const;
+
+      /*!
+       * Sets the size of the frame data portion.
+       */
+      void setFrameSize(uint size);
+
+      /*!
+       * Returns the ID3v2 version of the header (as passed in from the
+       * construction of the header).
+       */
+      uint version() const;
+
+      /*!
+       * Returns the size of the frame header in bytes.
+       *
+       * \deprecated Please use the version of this method that accepts a
+       * version.  This is only accurate for ID3v2.3 and ID3v2.4.  This will be
+       * removed in the next binary incompatible release (2.0) and will be
+       * replaced with a non-static method that checks the frame version.
+       */
+      static uint size();
+
+      /*!
+       * Returns the size of the frame header in bytes for the ID3v2 version
+       * that's given.
+       *
+       * \deprecated Please see the explanation in the version above.
+       */
+      static uint size(uint version);
+
+      /*!
+       * Returns true if the flag for tag alter preservation is set.
+       *
+       * The semantics are a little backwards from what would seem natural
+       * (setting the preservation flag to throw away the frame), but this
+       * follows the ID3v2 standard.
+       *
+       * \see setTagAlterPreservation()
+       */
+      bool tagAlterPreservation() const;
+
+      /*!
+       * Sets the flag for preservation of this frame if the tag is set.  If
+       * this is set to true the frame will not be written when the tag is
+       * saved.
+       *
+       * The semantics are a little backwards from what would seem natural
+       * (setting the preservation flag to throw away the frame), but this
+       * follows the ID3v2 standard.
+       *
+       * \see tagAlterPreservation()
+       */
+      void setTagAlterPreservation(bool discard);
+
+      /*!
+       * Returns true if the flag for file alter preservation is set.
+       *
+       * \note This flag is currently ignored internally in TagLib.
+       */
+      bool fileAlterPreservation() const;
+
+      /*!
+       * Returns true if the frame is meant to be read only.
+       *
+       * \note This flag is currently ignored internally in TagLib.
+       */
+      bool readOnly() const;
+
+      /*!
+       * Returns true if the flag for the grouping identifity is set.
+       *
+       * \note This flag is currently ignored internally in TagLib.
+       */
+      bool groupingIdentity() const;
+
+      /*!
+       * Returns true if compression is enabled for this frame.
+       *
+       * \note This flag is currently ignored internally in TagLib.
+       */
+      bool compression() const;
+
+      /*!
+       * Returns true if encryption is enabled for this frame.
+       *
+       * \note This flag is currently ignored internally in TagLib.
+       */
+      bool encryption() const;
+
+#ifndef DO_NOT_DOCUMENT
+      bool unsycronisation() const;
+#endif
+
+      /*!
+       * Returns true if unsynchronisation is enabled for this frame.
+       */
+      bool unsynchronisation() const;
+
+      /*!
+       * Returns true if the flag for a data length indicator is set.
+       */
+      bool dataLengthIndicator() const;
+
+      /*!
+       * Render the Header back to binary format in a ByteVector.
+       */
+      ByteVector render() const;
+
+      /*!
+       * \deprecated
+       */
+      bool frameAlterPreservation() const;
+
+    private:
+      Header(const Header &);
+      Header &operator=(const Header &);
+
+      class HeaderPrivate;
+      HeaderPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp
new file mode 100644
index 0000000..8faaa54
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp
@@ -0,0 +1,419 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef HAVE_ZLIB
+#include <config.h>
+#endif
+
+#include <tdebug.h>
+
+#include "id3v2framefactory.h"
+#include "id3v2synchdata.h"
+
+#include "frames/attachedpictureframe.h"
+#include "frames/commentsframe.h"
+#include "frames/relativevolumeframe.h"
+#include "frames/textidentificationframe.h"
+#include "frames/uniquefileidentifierframe.h"
+#include "frames/unknownframe.h"
+#include "frames/generalencapsulatedobjectframe.h"
+#include "frames/urllinkframe.h"
+#include "frames/unsynchronizedlyricsframe.h"
+#include "frames/popularimeterframe.h"
+#include "frames/privateframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class FrameFactory::FrameFactoryPrivate
+{
+public:
+  FrameFactoryPrivate() :
+    defaultEncoding(String::Latin1),
+    useDefaultEncoding(false) {}
+
+  String::Type defaultEncoding;
+  bool useDefaultEncoding;
+
+  template <class T> void setTextEncoding(T *frame)
+  {
+    if(useDefaultEncoding)
+      frame->setTextEncoding(defaultEncoding);
+  }
+};
+
+FrameFactory *FrameFactory::factory = 0;
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+FrameFactory *FrameFactory::instance()
+{
+  if(!factory)
+    factory = new FrameFactory;
+  return factory;
+}
+
+Frame *FrameFactory::createFrame(const ByteVector &data, bool synchSafeInts) const
+{
+  return createFrame(data, uint(synchSafeInts ? 4 : 3));
+}
+
+Frame *FrameFactory::createFrame(const ByteVector &data, uint version) const
+{
+  Header tagHeader;
+  tagHeader.setMajorVersion(version);
+  return createFrame(data, &tagHeader);
+}
+
+Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader) const
+{
+  ByteVector data = origData;
+  uint version = tagHeader->majorVersion();
+  Frame::Header *header = new Frame::Header(data, version);
+  ByteVector frameID = header->frameID();
+
+  // A quick sanity check -- make sure that the frameID is 4 uppercase Latin1
+  // characters.  Also make sure that there is data in the frame.
+
+  if(!frameID.size() == (version < 3 ? 3 : 4) ||
+     header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) ||
+     header->frameSize() > data.size())
+  {
+    delete header;
+    return 0;
+  }
+
+  for(ByteVector::ConstIterator it = frameID.begin(); it != frameID.end(); it++) {
+    if( (*it < 'A' || *it > 'Z') && (*it < '1' || *it > '9') ) {
+      delete header;
+      return 0;
+    }
+  }
+
+  if(version > 3 && (tagHeader->unsynchronisation() || header->unsynchronisation())) {
+    // Data lengths are not part of the encoded data, but since they are synch-safe
+    // integers they will be never actually encoded.
+    ByteVector frameData = data.mid(Frame::Header::size(version), header->frameSize());
+    frameData = SynchData::decode(frameData);
+    data = data.mid(0, Frame::Header::size(version)) + frameData;
+  }
+
+  // TagLib doesn't mess with encrypted frames, so just treat them
+  // as unknown frames.
+
+#if HAVE_ZLIB == 0
+  if(header->compression()) {
+    debug("Compressed frames are currently not supported.");
+    return new UnknownFrame(data, header);
+  }
+#endif
+  if(header->encryption()) {
+    debug("Encrypted frames are currently not supported.");
+    return new UnknownFrame(data, header);
+  }
+
+  if(!updateFrame(header)) {
+    header->setTagAlterPreservation(true);
+    return new UnknownFrame(data, header);
+  }
+
+  // updateFrame() might have updated the frame ID.
+
+  frameID = header->frameID();
+
+  // This is where things get necissarily nasty.  Here we determine which
+  // Frame subclass (or if none is found simply an Frame) based
+  // on the frame ID.  Since there are a lot of possibilities, that means
+  // a lot of if blocks.
+
+  // Text Identification (frames 4.2)
+
+  if(frameID.startsWith("T")) {
+
+    TextIdentificationFrame *f = frameID != "TXXX"
+      ? new TextIdentificationFrame(data, header)
+      : new UserTextIdentificationFrame(data, header);
+
+    d->setTextEncoding(f);
+
+    if(frameID == "TCON")
+      updateGenre(f);
+
+    return f;
+  }
+
+  // Comments (frames 4.10)
+
+  if(frameID == "COMM") {
+    CommentsFrame *f = new CommentsFrame(data, header);
+    d->setTextEncoding(f);
+    return f;
+  }
+
+  // Attached Picture (frames 4.14)
+
+  if(frameID == "APIC") {
+    AttachedPictureFrame *f = new AttachedPictureFrame(data, header);
+    d->setTextEncoding(f);
+    return f;
+  }
+
+  // Relative Volume Adjustment (frames 4.11)
+
+  if(frameID == "RVA2")
+    return new RelativeVolumeFrame(data, header);
+
+  // Unique File Identifier (frames 4.1)
+
+  if(frameID == "UFID")
+    return new UniqueFileIdentifierFrame(data, header);
+
+  // General Encapsulated Object (frames 4.15)
+
+  if(frameID == "GEOB") {
+    GeneralEncapsulatedObjectFrame *f = new GeneralEncapsulatedObjectFrame(data, header);
+    d->setTextEncoding(f);
+    return f;
+  }
+
+  // URL link (frames 4.3)
+
+  if(frameID.startsWith("W")) {
+    if(frameID != "WXXX") {
+      return new UrlLinkFrame(data, header);
+    }
+    else {
+      UserUrlLinkFrame *f = new UserUrlLinkFrame(data, header);
+      d->setTextEncoding(f);
+      return f;
+    }
+  }
+
+  // Unsynchronized lyric/text transcription (frames 4.8)
+
+  if(frameID == "USLT") {
+    UnsynchronizedLyricsFrame *f = new UnsynchronizedLyricsFrame(data, header);
+    if(d->useDefaultEncoding)
+      f->setTextEncoding(d->defaultEncoding);
+    return f;
+  }
+
+  // Popularimeter (frames 4.17)
+
+  if(frameID == "POPM")
+    return new PopularimeterFrame(data, header);
+
+  // Private (frames 4.27)
+
+  if(frameID == "PRIV")
+    return new PrivateFrame(data, header);
+
+  return new UnknownFrame(data, header);
+}
+
+String::Type FrameFactory::defaultTextEncoding() const
+{
+  return d->defaultEncoding;
+}
+
+void FrameFactory::setDefaultTextEncoding(String::Type encoding)
+{
+  d->useDefaultEncoding = true;
+  d->defaultEncoding = encoding;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+FrameFactory::FrameFactory()
+{
+  d = new FrameFactoryPrivate;
+}
+
+FrameFactory::~FrameFactory()
+{
+  delete d;
+}
+
+bool FrameFactory::updateFrame(Frame::Header *header) const
+{
+  TagLib::ByteVector frameID = header->frameID();
+
+  switch(header->version()) {
+
+  case 2: // ID3v2.2
+  {
+    if(frameID == "CRM" ||
+       frameID == "EQU" ||
+       frameID == "LNK" ||
+       frameID == "RVA" ||
+       frameID == "TIM" ||
+       frameID == "TSI")
+    {
+      debug("ID3v2.4 no longer supports the frame type " + String(frameID) +
+            ".  It will be discarded from the tag.");
+      return false;
+    }
+
+    // ID3v2.2 only used 3 bytes for the frame ID, so we need to convert all of
+    // the frames to their 4 byte ID3v2.4 equivalent.
+
+    convertFrame("BUF", "RBUF", header);
+    convertFrame("CNT", "PCNT", header);
+    convertFrame("COM", "COMM", header);
+    convertFrame("CRA", "AENC", header);
+    convertFrame("ETC", "ETCO", header);
+    convertFrame("GEO", "GEOB", header);
+    convertFrame("IPL", "TIPL", header);
+    convertFrame("MCI", "MCDI", header);
+    convertFrame("MLL", "MLLT", header);
+    convertFrame("PIC", "APIC", header);
+    convertFrame("POP", "POPM", header);
+    convertFrame("REV", "RVRB", header);
+    convertFrame("SLT", "SYLT", header);
+    convertFrame("STC", "SYTC", header);
+    convertFrame("TAL", "TALB", header);
+    convertFrame("TBP", "TBPM", header);
+    convertFrame("TCM", "TCOM", header);
+    convertFrame("TCO", "TCON", header);
+    convertFrame("TCR", "TCOP", header);
+    convertFrame("TDA", "TDRC", header);
+    convertFrame("TDY", "TDLY", header);
+    convertFrame("TEN", "TENC", header);
+    convertFrame("TFT", "TFLT", header);
+    convertFrame("TKE", "TKEY", header);
+    convertFrame("TLA", "TLAN", header);
+    convertFrame("TLE", "TLEN", header);
+    convertFrame("TMT", "TMED", header);
+    convertFrame("TOA", "TOAL", header);
+    convertFrame("TOF", "TOFN", header);
+    convertFrame("TOL", "TOLY", header);
+    convertFrame("TOR", "TDOR", header);
+    convertFrame("TOT", "TOAL", header);
+    convertFrame("TP1", "TPE1", header);
+    convertFrame("TP2", "TPE2", header);
+    convertFrame("TP3", "TPE3", header);
+    convertFrame("TP4", "TPE4", header);
+    convertFrame("TPA", "TPOS", header);
+    convertFrame("TPB", "TPUB", header);
+    convertFrame("TRC", "TSRC", header);
+    convertFrame("TRD", "TDRC", header);
+    convertFrame("TRK", "TRCK", header);
+    convertFrame("TSS", "TSSE", header);
+    convertFrame("TT1", "TIT1", header);
+    convertFrame("TT2", "TIT2", header);
+    convertFrame("TT3", "TIT3", header);
+    convertFrame("TXT", "TOLY", header);
+    convertFrame("TXX", "TXXX", header);
+    convertFrame("TYE", "TDRC", header);
+    convertFrame("UFI", "UFID", header);
+    convertFrame("ULT", "USLT", header);
+    convertFrame("WAF", "WOAF", header);
+    convertFrame("WAR", "WOAR", header);
+    convertFrame("WAS", "WOAS", header);
+    convertFrame("WCM", "WCOM", header);
+    convertFrame("WCP", "WCOP", header);
+    convertFrame("WPB", "WPUB", header);
+    convertFrame("WXX", "WXXX", header);
+
+    break;
+  }
+
+  case 3: // ID3v2.3
+  {
+    if(frameID == "EQUA" ||
+       frameID == "RVAD" ||
+       frameID == "TIME" ||
+       frameID == "TRDA" ||
+       frameID == "TSIZ" ||
+       frameID == "TDAT")
+    {
+      debug("ID3v2.4 no longer supports the frame type " + String(frameID) +
+            ".  It will be discarded from the tag.");
+      return false;
+    }
+
+    convertFrame("TORY", "TDOR", header);
+    convertFrame("TYER", "TDRC", header);
+
+    break;
+  }
+
+  default:
+
+    // This should catch a typo that existed in TagLib up to and including
+    // version 1.1 where TRDC was used for the year rather than TDRC.
+
+    convertFrame("TRDC", "TDRC", header);
+    break;
+  }
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void FrameFactory::convertFrame(const char *from, const char *to,
+                                Frame::Header *header) const
+{
+  if(header->frameID() != from)
+    return;
+
+  // debug("ID3v2.4 no longer supports the frame type " + String(from) + "  It has" +
+  //       "been converted to the type " + String(to) + ".");
+
+  header->setFrameID(to);
+}
+
+void FrameFactory::updateGenre(TextIdentificationFrame *frame) const
+{
+  StringList fields;
+  String s = frame->toString();
+
+  while(s.startsWith("(")) {
+
+    int closing = s.find(")");
+
+    if(closing < 0)
+      break;
+
+    fields.append(s.substr(1, closing - 1));
+
+    s = s.substr(closing + 1);
+  }
+
+  if(!s.isEmpty())
+    fields.append(s);
+
+  if(fields.isEmpty())
+    fields.append(String::null);
+
+  frame->setText(fields);
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.h
new file mode 100644
index 0000000..15eb61b
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2framefactory.h
@@ -0,0 +1,167 @@
+ /***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2FRAMEFACTORY_H
+#define TAGLIB_ID3V2FRAMEFACTORY_H
+
+#include "taglib_export.h"
+#include "tbytevector.h"
+#include "id3v2frame.h"
+#include "id3v2header.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    class TAGLIB_EXPORT TextIdentificationFrame;
+
+    //! A factory for creating ID3v2 frames during parsing
+
+    /*!
+     * This factory abstracts away the frame creation process and instantiates
+     * the appropriate ID3v2::Frame subclasses based on the contents of the
+     * data.
+     *
+     * Reimplementing this factory is the key to adding support for frame types
+     * not directly supported by TagLib to your application.  To do so you would
+     * subclass this factory reimplement createFrame().  Then by setting your
+     * factory to be the default factory in ID3v2::Tag constructor or with
+     * MPEG::File::setID3v2FrameFactory() you can implement behavior that will
+     * allow for new ID3v2::Frame subclasses (also provided by you) to be used.
+     *
+     * This implements both <i>abstract factory</i> and <i>singleton</i> patterns
+     * of which more information is available on the web and in software design
+     * textbooks (Notably <i>Design Patters</i>).
+     *
+     * \note You do not need to use this factory to create new frames to add to
+     * an ID3v2::Tag.  You can instantiate frame subclasses directly (with new)
+     * and add them to a tag using ID3v2::Tag::addFrame()
+     *
+     * \see ID3v2::Tag::addFrame()
+     */
+
+    class TAGLIB_EXPORT FrameFactory
+    {
+    public:
+      static FrameFactory *instance();
+      /*!
+       * Create a frame based on \a data.  \a synchSafeInts should only be set
+       * false if we are parsing an old tag (v2.3 or older) that does not support
+       * synchsafe ints.
+       *
+       * \deprecated Please use the method below that accepts a ID3v2::Header
+       * instance in new code.
+       */
+      Frame *createFrame(const ByteVector &data, bool synchSafeInts) const;
+
+      /*!
+       * Create a frame based on \a data.  \a version should indicate the ID3v2
+       * version of the tag.  As ID3v2.4 is the most current version of the
+       * standard 4 is the default.
+       *
+       * \deprecated Please use the method below that accepts a ID3v2::Header
+       * instance in new code.
+       */
+      Frame *createFrame(const ByteVector &data, uint version = 4) const;
+
+      /*!
+       * Create a frame based on \a data.  \a tagHeader should be a valid
+       * ID3v2::Header instance.
+       */
+      // BIC: make virtual
+      Frame *createFrame(const ByteVector &data, Header *tagHeader) const;
+
+      /*!
+       * Returns the default text encoding for text frames.  If setTextEncoding()
+       * has not been explicitly called this will only be used for new text
+       * frames.  However, if this value has been set explicitly all frames will be
+       * converted to this type (unless it's explitly set differently for the
+       * individual frame) when being rendered.
+       *
+       * \see setDefaultTextEncoding()
+       */
+      String::Type defaultTextEncoding() const;
+
+      /*!
+       * Set the default text encoding for all text frames that are created to
+       * \a encoding.  If no value is set the frames with either default to the
+       * encoding type that was parsed and new frames default to Latin1.
+       *
+       * Valid string types for ID3v2 tags are Latin1, UTF8, UTF16 and UTF16BE.
+       *
+       * \see defaultTextEncoding()
+       */
+      void setDefaultTextEncoding(String::Type encoding);
+
+    protected:
+      /*!
+       * Constructs a frame factory.  Because this is a singleton this method is
+       * protected, but may be used for subclasses.
+       */
+      FrameFactory();
+
+      /*!
+       * Destroys the frame factory.  In most cases this will never be called (as
+       * is typical of singletons).
+       */
+      virtual ~FrameFactory();
+
+      /*!
+       * This method checks for compliance to the current ID3v2 standard (2.4)
+       * and does nothing in the common case.  However if a frame is found that
+       * is not compatible with the current standard, this method either updates
+       * the frame or indicates that it should be discarded.
+       *
+       * This method with return true (with or without changes to the frame) if
+       * this frame should be kept or false if it should be discarded.
+       *
+       * See the id3v2.4.0-changes.txt document for further information.
+       */
+      virtual bool updateFrame(Frame::Header *header) const;
+
+    private:
+      FrameFactory(const FrameFactory &);
+      FrameFactory &operator=(const FrameFactory &);
+
+      /*!
+       * This method is used internally to convert a frame from ID \a from to ID
+       * \a to.  If the frame matches the \a from pattern and converts the frame
+       * ID in the \a header or simply does nothing if the frame ID does not match.
+       */
+      void convertFrame(const char *from, const char *to,
+                        Frame::Header *header) const;
+
+      void updateGenre(TextIdentificationFrame *frame) const;
+
+      static FrameFactory *factory;
+
+      class FrameFactoryPrivate;
+      FrameFactoryPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.cpp
new file mode 100644
index 0000000..e14adcc
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.cpp
@@ -0,0 +1,243 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <iostream>
+#include <bitset>
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "id3v2header.h"
+#include "id3v2footer.h"
+#include "id3v2synchdata.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class Header::HeaderPrivate
+{
+public:
+  HeaderPrivate() : majorVersion(4),
+                    revisionNumber(0),
+                    unsynchronisation(false),
+                    extendedHeader(false),
+                    experimentalIndicator(false),
+                    footerPresent(false),
+                    tagSize(0) {}
+
+  ~HeaderPrivate() {}
+
+  uint majorVersion;
+  uint revisionNumber;
+
+  bool unsynchronisation;
+  bool extendedHeader;
+  bool experimentalIndicator;
+  bool footerPresent;
+
+  uint tagSize;
+
+  static const uint size = 10;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members
+////////////////////////////////////////////////////////////////////////////////
+
+TagLib::uint Header::size()
+{
+  return HeaderPrivate::size;
+}
+
+ByteVector Header::fileIdentifier()
+{
+  return ByteVector::fromCString("ID3");
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Header::Header()
+{
+  d = new HeaderPrivate;
+}
+
+Header::Header(const ByteVector &data)
+{
+  d = new HeaderPrivate;
+  parse(data);
+}
+
+Header::~Header()
+{
+  delete d;
+}
+
+TagLib::uint Header::majorVersion() const
+{
+  return d->majorVersion;
+}
+
+void Header::setMajorVersion(TagLib::uint version)
+{
+  d->majorVersion = version;
+}
+
+TagLib::uint Header::revisionNumber() const
+{
+  return d->revisionNumber;
+}
+
+bool Header::unsynchronisation() const
+{
+  return d->unsynchronisation;
+}
+
+bool Header::extendedHeader() const
+{
+  return d->extendedHeader;
+}
+
+bool Header::experimentalIndicator() const
+{
+  return d->experimentalIndicator;
+}
+
+bool Header::footerPresent() const
+{
+  return d->footerPresent;
+}
+
+TagLib::uint Header::tagSize() const
+{
+  return d->tagSize;
+}
+
+TagLib::uint Header::completeTagSize() const
+{
+  if(d->footerPresent)
+    return d->tagSize + d->size + Footer::size();
+  else
+    return d->tagSize + d->size;
+}
+
+void Header::setTagSize(uint s)
+{
+  d->tagSize = s;
+}
+
+void Header::setData(const ByteVector &data)
+{
+  parse(data);
+}
+
+ByteVector Header::render() const
+{
+  ByteVector v;
+
+  // add the file identifier -- "ID3"
+  v.append(fileIdentifier());
+
+  // add the version number -- we always render a 2.4.0 tag regardless of what
+  // the tag originally was.
+
+  v.append(char(4));
+  v.append(char(0));
+
+  // Currently we don't actually support writing extended headers, footers or
+  // unsynchronized tags, make sure that the flags are set accordingly.
+
+  d->extendedHeader = false;
+  d->footerPresent = false;
+  d->unsynchronisation = false;
+
+  // render and add the flags
+  std::bitset<8> flags;
+
+  flags[7] = d->unsynchronisation;
+  flags[6] = d->extendedHeader;
+  flags[5] = d->experimentalIndicator;
+  flags[4] = d->footerPresent;
+
+  v.append(char(flags.to_ulong()));
+
+  // add the size
+  v.append(SynchData::fromUInt(d->tagSize));
+
+  return v;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void Header::parse(const ByteVector &data)
+{
+  if(data.size() < size())
+    return;
+
+
+  // do some sanity checking -- even in ID3v2.3.0 and less the tag size is a
+  // synch-safe integer, so all bytes must be less than 128.  If this is not
+  // true then this is an invalid tag.
+
+  // note that we're doing things a little out of order here -- the size is
+  // later in the bytestream than the version
+
+  ByteVector sizeData = data.mid(6, 4);
+
+  if(sizeData.size() != 4) {
+    d->tagSize = 0;
+    debug("TagLib::ID3v2::Header::parse() - The tag size as read was 0 bytes!");
+    return;
+  }
+
+  for(ByteVector::Iterator it = sizeData.begin(); it != sizeData.end(); it++) {
+    if(uchar(*it) >= 128) {
+      d->tagSize = 0;
+      debug("TagLib::ID3v2::Header::parse() - One of the size bytes in the id3v2 header was greater than the allowed 128.");
+      return;
+    }
+  }
+
+  // The first three bytes, data[0..2], are the File Identifier, "ID3". (structure 3.1 "file identifier")
+
+  // Read the version number from the fourth and fifth bytes.
+  d->majorVersion = data[3];   // (structure 3.1 "major version")
+  d->revisionNumber = data[4]; // (structure 3.1 "revision number")
+
+  // Read the flags, the first four bits of the sixth byte.
+  std::bitset<8> flags(data[5]);
+
+  d->unsynchronisation     = flags[7]; // (structure 3.1.a)
+  d->extendedHeader        = flags[6]; // (structure 3.1.b)
+  d->experimentalIndicator = flags[5]; // (structure 3.1.c)
+  d->footerPresent         = flags[4]; // (structure 3.1.d)
+
+  // Get the size from the remaining four bytes (read above)
+
+  d->tagSize = SynchData::toUInt(sizeData); // (structure 3.1 "size")
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.h
new file mode 100644
index 0000000..99a7e7f
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2header.h
@@ -0,0 +1,175 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2HEADER_H
+#define TAGLIB_ID3V2HEADER_H
+
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! An implementation of ID3v2 headers
+
+    /*!
+     * This class implements ID3v2 headers.  It attempts to follow, both
+     * semantically and programatically, the structure specified in
+     * the ID3v2 standard.  The API is based on the properties of ID3v2 headers
+     * specified there.  If any of the terms used in this documentation are
+     * unclear please check the specification in the linked section.
+     * (Structure, <a href="id3v2-structure.html#3.1">3.1</a>)
+     */
+
+    class TAGLIB_EXPORT Header
+    {
+    public:
+      /*!
+       * Constructs an empty ID3v2 header.
+       */
+      Header();
+
+      /*!
+       * Constructs an ID3v2 header based on \a data.  parse() is called
+       * immediately.
+       */
+      Header(const ByteVector &data);
+
+      /*!
+       * Destroys the header.
+       */
+      virtual ~Header();
+
+      /*!
+       * Returns the major version number.  (Note: This is the 4, not the 2 in
+       * ID3v2.4.0.  The 2 is implied.)
+       */
+      uint majorVersion() const;
+
+      /*!
+       * Set the the major version number to \a version.  (Note: This is
+       * the 4, not the 2 in ID3v2.4.0.  The 2 is implied.)
+       * \see majorVersion()
+       *
+       * \note This is used by the internal parser; this will not change the
+       * version which is written and in general should not be called by API
+       * users.
+       */
+      void setMajorVersion(uint version);
+
+      /*!
+       * Returns the revision number.  (Note: This is the 0, not the 4 in
+       * ID3v2.4.0.  The 2 is implied.)
+       */
+      uint revisionNumber() const;
+
+      /*!
+       * Returns true if unsynchronisation has been applied to all frames.
+       */
+      bool unsynchronisation() const;
+
+      /*!
+       * Returns true if an extended header is present in the tag.
+       */
+      bool extendedHeader() const;
+
+      /*!
+       * Returns true if the experimental indicator flag is set.
+       */
+      bool experimentalIndicator() const;
+
+      /*!
+       * Returns true if a footer is present in the tag.
+       */
+      bool footerPresent() const;
+      /*!
+       * Returns the tag size in bytes.  This is the size of the frame content.
+       * The size of the \e entire tag will be this plus the header size (10
+       * bytes) and, if present, the footer size (potentially another 10 bytes).
+       *
+       * \note This is the value as read from the header to which TagLib attempts
+       * to provide an API to; it was not a design decision on the part of TagLib
+       * to not include the mentioned portions of the tag in the \e size.
+       *
+       * \see completeTagSize()
+       */
+      uint tagSize() const;
+
+      /*!
+       * Returns the tag size, including the header and, if present, the footer
+       * size.
+       *
+       * \see tagSize()
+       */
+      uint completeTagSize() const;
+
+      /*!
+       * Set the tag size to \a s.
+       * \see tagSize()
+       */
+      void setTagSize(uint s);
+
+      /*!
+       * Returns the size of the header.  Presently this is always 10 bytes.
+       */
+      static uint size();
+
+      /*!
+       * Returns the string used to identify and ID3v2 tag inside of a file.
+       * Presently this is always "ID3".
+       */
+      static ByteVector fileIdentifier();
+
+      /*!
+       * Sets the data that will be used as the header.  10 bytes, starting from
+       * the beginning of \a data are used.
+       */
+      void setData(const ByteVector &data);
+
+      /*!
+       * Renders the Header back to binary format.
+       */
+      ByteVector render() const;
+
+    protected:
+      /*!
+       * Called by setData() to parse the header data.  It makes this information
+       * available through the public API.
+       */
+      void parse(const ByteVector &data);
+
+    private:
+      Header(const Header &);
+      Header &operator=(const Header &);
+
+      class HeaderPrivate;
+      HeaderPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.cpp
new file mode 100644
index 0000000..17503ba
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.cpp
@@ -0,0 +1,63 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <iostream>
+
+#include "id3v2synchdata.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+TagLib::uint SynchData::toUInt(const ByteVector &data)
+{
+  uint sum = 0;
+  int last = data.size() > 4 ? 3 : data.size() - 1;
+
+  for(int i = 0; i <= last; i++)
+    sum |= (data[i] & 0x7f) << ((last - i) * 7);
+
+  return sum;
+}
+
+ByteVector SynchData::fromUInt(uint value)
+{
+  ByteVector v(4, 0);
+
+  for(int i = 0; i < 4; i++)
+    v[i] = uchar(value >> ((3 - i) * 7) & 0x7f);
+
+  return v;
+}
+
+ByteVector SynchData::decode(const ByteVector &data)
+{
+  ByteVector result = data;
+
+  ByteVector pattern(2, char(0));
+  pattern[0] = '\xFF';
+  pattern[1] = '\x00';
+
+  return result.replace(pattern, '\xFF');
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.h
new file mode 100644
index 0000000..86e0bfe
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2synchdata.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2SYNCHDATA_H
+#define TAGLIB_ID3V2SYNCHDATA_H
+
+#include "tbytevector.h"
+#include "taglib.h"
+
+namespace TagLib {
+
+  namespace ID3v2 {
+
+    //! A few functions for ID3v2 synch safe integer conversion
+
+    /*!
+     * In the ID3v2.4 standard most integer values are encoded as "synch safe"
+     * integers which are encoded in such a way that they will not give false
+     * MPEG syncs and confuse MPEG decoders.  This namespace provides some
+     * methods for converting to and from these values to ByteVectors for
+     * things rendering and parsing ID3v2 data.
+     */
+
+    namespace SynchData
+    {
+      /*!
+       * This returns the unsigned integer value of \a data where \a data is a
+       * ByteVector that contains a \e synchsafe integer (Structure,
+       * <a href="id3v2-structure.html#6.2">6.2</a>).  The default \a length of
+       * 4 is used if another value is not specified.
+       */
+      TAGLIB_EXPORT uint toUInt(const ByteVector &data);
+
+      /*!
+       * Returns a 4 byte (32 bit) synchsafe integer based on \a value.
+       */
+      TAGLIB_EXPORT ByteVector fromUInt(uint value);
+
+      /*!
+       * Convert the data from unsynchronized data to its original format.
+       */
+      TAGLIB_EXPORT ByteVector decode(const ByteVector &input);
+    }
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.cpp b/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.cpp
new file mode 100644
index 0000000..c7eb6d6
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.cpp
@@ -0,0 +1,479 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tfile.h>
+#include <tdebug.h>
+
+#include "id3v2tag.h"
+#include "id3v2header.h"
+#include "id3v2extendedheader.h"
+#include "id3v2footer.h"
+#include "id3v2synchdata.h"
+
+#include "id3v1genres.h"
+
+#include "frames/textidentificationframe.h"
+#include "frames/commentsframe.h"
+
+using namespace TagLib;
+using namespace ID3v2;
+
+class ID3v2::Tag::TagPrivate
+{
+public:
+  TagPrivate() : file(0), tagOffset(-1), extendedHeader(0), footer(0), paddingSize(0)
+  {
+    frameList.setAutoDelete(true);
+  }
+  ~TagPrivate()
+  {
+    delete extendedHeader;
+    delete footer;
+  }
+
+  File *file;
+  long tagOffset;
+  const FrameFactory *factory;
+
+  Header header;
+  ExtendedHeader *extendedHeader;
+  Footer *footer;
+
+  int paddingSize;
+
+  FrameListMap frameListMap;
+  FrameList frameList;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ID3v2::Tag::Tag() : TagLib::Tag()
+{
+  d = new TagPrivate;
+  d->factory = FrameFactory::instance();
+}
+
+ID3v2::Tag::Tag(File *file, long tagOffset, const FrameFactory *factory) :
+  TagLib::Tag()
+{
+  d = new TagPrivate;
+
+  d->file = file;
+  d->tagOffset = tagOffset;
+  d->factory = factory;
+
+  read();
+}
+
+ID3v2::Tag::~Tag()
+{
+  delete d;
+}
+
+
+String ID3v2::Tag::title() const
+{
+  if(!d->frameListMap["TIT2"].isEmpty())
+    return d->frameListMap["TIT2"].front()->toString();
+  return String::null;
+}
+
+String ID3v2::Tag::artist() const
+{
+  if(!d->frameListMap["TPE1"].isEmpty())
+    return d->frameListMap["TPE1"].front()->toString();
+  return String::null;
+}
+
+String ID3v2::Tag::album() const
+{
+  if(!d->frameListMap["TALB"].isEmpty())
+    return d->frameListMap["TALB"].front()->toString();
+  return String::null;
+}
+
+String ID3v2::Tag::comment() const
+{
+  const FrameList &comments = d->frameListMap["COMM"];
+
+  if(comments.isEmpty())
+    return String::null;
+
+  for(FrameList::ConstIterator it = comments.begin(); it != comments.end(); ++it)
+  {
+    CommentsFrame *frame = dynamic_cast<CommentsFrame *>(*it);
+
+    if(frame && frame->description().isEmpty())
+      return (*it)->toString();
+  }
+
+  return comments.front()->toString();
+}
+
+String ID3v2::Tag::genre() const
+{
+  // TODO: In the next major version (TagLib 2.0) a list of multiple genres
+  // should be separated by " / " instead of " ".  For the moment to keep
+  // the behavior the same as released versions it is being left with " ".
+
+  if(d->frameListMap["TCON"].isEmpty() ||
+     !dynamic_cast<TextIdentificationFrame *>(d->frameListMap["TCON"].front()))
+  {
+    return String::null;
+  }
+
+  // ID3v2.4 lists genres as the fields in its frames field list.  If the field
+  // is simply a number it can be assumed that it is an ID3v1 genre number.
+  // Here was assume that if an ID3v1 string is present that it should be
+  // appended to the genre string.  Multiple fields will be appended as the
+  // string is built.
+
+  TextIdentificationFrame *f = static_cast<TextIdentificationFrame *>(
+    d->frameListMap["TCON"].front());
+
+  StringList fields = f->fieldList();
+
+  StringList genres;
+
+  for(StringList::Iterator it = fields.begin(); it != fields.end(); ++it) {
+
+    if((*it).isEmpty())
+      continue;
+
+    bool isNumber = true;
+
+    for(String::ConstIterator charIt = (*it).begin();
+        isNumber && charIt != (*it).end();
+        ++charIt)
+    {
+      isNumber = *charIt >= '0' && *charIt <= '9';
+    }
+
+    if(isNumber) {
+      int number = (*it).toInt();
+      if(number >= 0 && number <= 255)
+        *it = ID3v1::genre(number);
+    }
+
+    if(std::find(genres.begin(), genres.end(), *it) == genres.end())
+      genres.append(*it);
+  }
+
+  return genres.toString();
+}
+
+TagLib::uint ID3v2::Tag::year() const
+{
+  if(!d->frameListMap["TDRC"].isEmpty())
+    return d->frameListMap["TDRC"].front()->toString().substr(0, 4).toInt();
+  return 0;
+}
+
+TagLib::uint ID3v2::Tag::track() const
+{
+  if(!d->frameListMap["TRCK"].isEmpty())
+    return d->frameListMap["TRCK"].front()->toString().toInt();
+  return 0;
+}
+
+void ID3v2::Tag::setTitle(const String &s)
+{
+  setTextFrame("TIT2", s);
+}
+
+void ID3v2::Tag::setArtist(const String &s)
+{
+  setTextFrame("TPE1", s);
+}
+
+void ID3v2::Tag::setAlbum(const String &s)
+{
+  setTextFrame("TALB", s);
+}
+
+void ID3v2::Tag::setComment(const String &s)
+{
+  if(s.isEmpty()) {
+    removeFrames("COMM");
+    return;
+  }
+
+  if(!d->frameListMap["COMM"].isEmpty())
+    d->frameListMap["COMM"].front()->setText(s);
+  else {
+    CommentsFrame *f = new CommentsFrame(d->factory->defaultTextEncoding());
+    addFrame(f);
+    f->setText(s);
+  }
+}
+
+void ID3v2::Tag::setGenre(const String &s)
+{
+  if(s.isEmpty()) {
+    removeFrames("TCON");
+    return;
+  }
+
+  // iTunes can't handle correctly encoded ID3v2.4 numerical genres.  Just use
+  // strings until iTunes sucks less.
+
+#ifdef NO_ITUNES_HACKS
+
+  int index = ID3v1::genreIndex(s);
+
+  if(index != 255)
+    setTextFrame("TCON", String::number(index));
+  else
+    setTextFrame("TCON", s);
+
+#else
+
+  setTextFrame("TCON", s);
+
+#endif
+}
+
+void ID3v2::Tag::setYear(uint i)
+{
+  if(i <= 0) {
+    removeFrames("TDRC");
+    return;
+  }
+  setTextFrame("TDRC", String::number(i));
+}
+
+void ID3v2::Tag::setTrack(uint i)
+{
+  if(i <= 0) {
+    removeFrames("TRCK");
+    return;
+  }
+  setTextFrame("TRCK", String::number(i));
+}
+
+bool ID3v2::Tag::isEmpty() const
+{
+  return d->frameList.isEmpty();
+}
+
+Header *ID3v2::Tag::header() const
+{
+  return &(d->header);
+}
+
+ExtendedHeader *ID3v2::Tag::extendedHeader() const
+{
+  return d->extendedHeader;
+}
+
+Footer *ID3v2::Tag::footer() const
+{
+  return d->footer;
+}
+
+const FrameListMap &ID3v2::Tag::frameListMap() const
+{
+  return d->frameListMap;
+}
+
+const FrameList &ID3v2::Tag::frameList() const
+{
+  return d->frameList;
+}
+
+const FrameList &ID3v2::Tag::frameList(const ByteVector &frameID) const
+{
+  return d->frameListMap[frameID];
+}
+
+void ID3v2::Tag::addFrame(Frame *frame)
+{
+  d->frameList.append(frame);
+  d->frameListMap[frame->frameID()].append(frame);
+}
+
+void ID3v2::Tag::removeFrame(Frame *frame, bool del)
+{
+  // remove the frame from the frame list
+  FrameList::Iterator it = d->frameList.find(frame);
+  d->frameList.erase(it);
+
+  // ...and from the frame list map
+  it = d->frameListMap[frame->frameID()].find(frame);
+  d->frameListMap[frame->frameID()].erase(it);
+
+  // ...and delete as desired
+  if(del)
+    delete frame;
+}
+
+void ID3v2::Tag::removeFrames(const ByteVector &id)
+{
+    FrameList l = d->frameListMap[id];
+    for(FrameList::Iterator it = l.begin(); it != l.end(); ++it)
+      removeFrame(*it, true);
+}
+
+ByteVector ID3v2::Tag::render() const
+{
+  // We need to render the "tag data" first so that we have to correct size to
+  // render in the tag's header.  The "tag data" -- everything that is included
+  // in ID3v2::Header::tagSize() -- includes the extended header, frames and
+  // padding, but does not include the tag's header or footer.
+
+  ByteVector tagData;
+
+  // TODO: Render the extended header.
+
+  // Loop through the frames rendering them and adding them to the tagData.
+
+  for(FrameList::Iterator it = d->frameList.begin(); it != d->frameList.end(); it++) {
+    if(!(*it)->header()->tagAlterPreservation())
+      tagData.append((*it)->render());
+  }
+
+  // Compute the amount of padding, and append that to tagData.
+
+  uint paddingSize = 0;
+  uint originalSize = d->header.tagSize();
+
+  if(tagData.size() < originalSize)
+    paddingSize = originalSize - tagData.size();
+  else
+    paddingSize = 1024;
+
+  tagData.append(ByteVector(paddingSize, char(0)));
+
+  // Set the tag size.
+  d->header.setTagSize(tagData.size());
+
+  // TODO: This should eventually include d->footer->render().
+  return d->header.render() + tagData;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void ID3v2::Tag::read()
+{
+  if(d->file && d->file->isOpen()) {
+
+    d->file->seek(d->tagOffset);
+    d->header.setData(d->file->readBlock(Header::size()));
+
+    // if the tag size is 0, then this is an invalid tag (tags must contain at
+    // least one frame)
+
+    if(d->header.tagSize() == 0)
+      return;
+
+    parse(d->file->readBlock(d->header.tagSize()));
+  }
+}
+
+void ID3v2::Tag::parse(const ByteVector &origData)
+{
+  ByteVector data = origData;
+
+  if(d->header.unsynchronisation() && d->header.majorVersion() <= 3)
+    data = SynchData::decode(data);
+
+  uint frameDataPosition = 0;
+  uint frameDataLength = data.size();
+
+  // check for extended header
+
+  if(d->header.extendedHeader()) {
+    if(!d->extendedHeader)
+      d->extendedHeader = new ExtendedHeader;
+    d->extendedHeader->setData(data);
+    if(d->extendedHeader->size() <= data.size()) {
+      frameDataPosition += d->extendedHeader->size();
+      frameDataLength -= d->extendedHeader->size();
+    }
+  }
+
+  // check for footer -- we don't actually need to parse it, as it *must*
+  // contain the same data as the header, but we do need to account for its
+  // size.
+
+  if(d->header.footerPresent() && Footer::size() <= frameDataLength)
+    frameDataLength -= Footer::size();
+
+  // parse frames
+
+  // Make sure that there is at least enough room in the remaining frame data for
+  // a frame header.
+
+  while(frameDataPosition < frameDataLength - Frame::headerSize(d->header.majorVersion())) {
+
+    // If the next data is position is 0, assume that we've hit the padding
+    // portion of the frame data.
+
+    if(data.at(frameDataPosition) == 0) {
+      if(d->header.footerPresent())
+        debug("Padding *and* a footer found.  This is not allowed by the spec.");
+
+      d->paddingSize = frameDataLength - frameDataPosition;
+      return;
+    }
+
+    Frame *frame = d->factory->createFrame(data.mid(frameDataPosition),
+                                           &d->header);
+
+    if(!frame)
+      return;
+
+    // Checks to make sure that frame parsed correctly.
+
+    if(frame->size() <= 0) {
+      delete frame;
+      return;
+    }
+
+    frameDataPosition += frame->size() + Frame::headerSize(d->header.majorVersion());
+    addFrame(frame);
+  }
+}
+
+void ID3v2::Tag::setTextFrame(const ByteVector &id, const String &value)
+{
+  if(value.isEmpty()) {
+    removeFrames(id);
+    return;
+  }
+
+  if(!d->frameListMap[id].isEmpty())
+    d->frameListMap[id].front()->setText(value);
+  else {
+    const String::Type encoding = d->factory->defaultTextEncoding();
+    TextIdentificationFrame *f = new TextIdentificationFrame(id, encoding);
+    addFrame(f);
+    f->setText(value);
+  }
+}
diff --git a/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.h b/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.h
new file mode 100644
index 0000000..f43f6b7
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/id3v2/id3v2tag.h
@@ -0,0 +1,300 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_ID3V2TAG_H
+#define TAGLIB_ID3V2TAG_H
+
+#include "tag.h"
+#include "tbytevector.h"
+#include "tstring.h"
+#include "tlist.h"
+#include "tmap.h"
+#include "taglib_export.h"
+
+#include "id3v2framefactory.h"
+
+namespace TagLib {
+
+  class File;
+
+  //! An ID3v2 implementation
+
+  /*!
+   * This is a relatively complete and flexible framework for working with ID3v2
+   * tags.
+   *
+   * \see ID3v2::Tag
+   */
+
+  namespace ID3v2 {
+
+    class Header;
+    class ExtendedHeader;
+    class Footer;
+
+    typedef List<Frame *> FrameList;
+    typedef Map<ByteVector, FrameList> FrameListMap;
+
+    //! The main class in the ID3v2 implementation
+
+    /*!
+     * This is the main class in the ID3v2 implementation.  It serves two
+     * functions.  This first, as is obvious from the public API, is to provide a
+     * container for the other ID3v2 related classes.  In addition, through the
+     * read() and parse() protected methods, it provides the most basic level of
+     * parsing.  In these methods the ID3v2 tag is extracted from the file and
+     * split into data components.
+     *
+     * ID3v2 tags have several parts, TagLib attempts to provide an interface
+     * for them all.  header(), footer() and extendedHeader() corespond to those
+     * data structures in the ID3v2 standard and the APIs for the classes that
+     * they return attempt to reflect this.
+     *
+     * Also ID3v2 tags are built up from a list of frames, which are in turn
+     * have a header and a list of fields.  TagLib provides two ways of accessing
+     * the list of frames that are in a given ID3v2 tag.  The first is simply
+     * via the frameList() method.  This is just a list of pointers to the frames.
+     * The second is a map from the frame type -- i.e. "COMM" for comments -- and
+     * a list of frames of that type.  (In some cases ID3v2 allows for multiple
+     * frames of the same type, hence this being a map to a list rather than just
+     * a map to an individual frame.)
+     *
+     * More information on the structure of frames can be found in the ID3v2::Frame
+     * class.
+     *
+     * read() and parse() pass binary data to the other ID3v2 class structures,
+     * they do not handle parsing of flags or fields, for instace.  Those are
+     * handled by similar functions within those classes.
+     *
+     * \note All pointers to data structures within the tag will become invalid
+     * when the tag is destroyed.
+     *
+     * \warning Dealing with the nasty details of ID3v2 is not for the faint of
+     * heart and should not be done without much meditation on the spec.  It's
+     * rather long, but if you're planning on messing with this class and others
+     * that deal with the details of ID3v2 (rather than the nice, safe, abstract
+     * TagLib::Tag and friends), it's worth your time to familiarize yourself
+     * with said spec (which is distrubuted with the TagLib sources).  TagLib
+     * tries to do most of the work, but with a little luck, you can still
+     * convince it to generate invalid ID3v2 tags.  The APIs for ID3v2 assume a
+     * working knowledge of ID3v2 structure.  You're been warned.
+     */
+
+    class TAGLIB_EXPORT Tag : public TagLib::Tag
+    {
+    public:
+      /*!
+       * Constructs an empty ID3v2 tag.
+       *
+       * \note You must create at least one frame for this tag to be valid.
+       */
+      Tag();
+
+      /*!
+       * Constructs an ID3v2 tag read from \a file starting at \a tagOffset.
+       * \a factory specifies which FrameFactory will be used for the
+       * construction of new frames.
+       *
+       * \note You should be able to ignore the \a factory parameter in almost
+       * all situations.  You would want to specify your own FrameFactory
+       * subclass in the case that you are extending TagLib to support additional
+       * frame types, which would be incorperated into your factory.
+       *
+       * \see FrameFactory
+       */
+      Tag(File *file, long tagOffset,
+          const FrameFactory *factory = FrameFactory::instance());
+
+      /*!
+       * Destroys this Tag instance.
+       */
+      virtual ~Tag();
+
+      // Reimplementations.
+
+      virtual String title() const;
+      virtual String artist() const;
+      virtual String album() const;
+      virtual String comment() const;
+      virtual String genre() const;
+      virtual uint year() const;
+      virtual uint track() const;
+
+      virtual void setTitle(const String &s);
+      virtual void setArtist(const String &s);
+      virtual void setAlbum(const String &s);
+      virtual void setComment(const String &s);
+      virtual void setGenre(const String &s);
+      virtual void setYear(uint i);
+      virtual void setTrack(uint i);
+
+      virtual bool isEmpty() const;
+
+      /*!
+       * Returns a pointer to the tag's header.
+       */
+      Header *header() const;
+
+      /*!
+       * Returns a pointer to the tag's extended header or null if there is no
+       * extended header.
+       */
+      ExtendedHeader *extendedHeader() const;
+
+      /*!
+       * Returns a pointer to the tag's footer or null if there is no footer.
+       *
+       * \deprecated I don't see any reason to keep this around since there's
+       * nothing useful to be retrieved from the footer, but well, again, I'm
+       * prone to change my mind, so this gets to stay around until near a
+       * release.
+       */
+      Footer *footer() const;
+
+      /*!
+       * Returns a reference to the frame list map.  This is an FrameListMap of
+       * all of the frames in the tag.
+       *
+       * This is the most convenient structure for accessing the tag's frames.
+       * Many frame types allow multiple instances of the same frame type so this
+       * is a map of lists.  In most cases however there will only be a single
+       * frame of a certain type.
+       *
+       * Let's say for instance that you wanted to access the frame for total
+       * beats per minute -- the TBPM frame.
+       *
+       * \code
+       * TagLib::MPEG::File f("foo.mp3");
+       *
+       * // Check to make sure that it has an ID3v2 tag
+       *
+       * if(f.ID3v2Tag()) {
+       *
+       *   // Get the list of frames for a specific frame type
+       *
+       *   TagLib::ID3v2::FrameList l = f.ID3v2Tag()->frameListMap()["TBPM"];
+       *
+       *   if(!l.isEmpty())
+       *     std::cout << l.front()->toString() << std::endl;
+       * }
+       *
+       * \endcode
+       *
+       * \warning You should not modify this data structure directly, instead
+       * use addFrame() and removeFrame().
+       *
+       * \see frameList()
+       */
+      const FrameListMap &frameListMap() const;
+
+      /*!
+       * Returns a reference to the frame list.  This is an FrameList of all of
+       * the frames in the tag in the order that they were parsed.
+       *
+       * This can be useful if for example you want iterate over the tag's frames
+       * in the order that they occur in the tag.
+       *
+       * \warning You should not modify this data structure directly, instead
+       * use addFrame() and removeFrame().
+       */
+      const FrameList &frameList() const;
+
+      /*!
+       * Returns the frame list for frames with the id \a frameID or an empty
+       * list if there are no frames of that type.  This is just a convenience
+       * and is equivalent to:
+       *
+       * \code
+       * frameListMap()[frameID];
+       * \endcode
+       *
+       * \see frameListMap()
+       */
+      const FrameList &frameList(const ByteVector &frameID) const;
+
+      /*!
+       * Add a frame to the tag.  At this point the tag takes ownership of
+       * the frame and will handle freeing its memory.
+       *
+       * \note Using this method will invalidate any pointers on the list
+       * returned by frameList()
+       */
+      void addFrame(Frame *frame);
+
+      /*!
+       * Remove a frame from the tag.  If \a del is true the frame's memory
+       * will be freed; if it is false, it must be deleted by the user.
+       *
+       * \note Using this method will invalidate any pointers on the list
+       * returned by frameList()
+       */
+      void removeFrame(Frame *frame, bool del = true);
+
+      /*!
+       * Remove all frames of type \a id from the tag and free their memory.
+       *
+       * \note Using this method will invalidate any pointers on the list
+       * returned by frameList()
+       */
+      void removeFrames(const ByteVector &id);
+
+      /*!
+       * Render the tag back to binary data, suitable to be written to disk.
+       */
+      ByteVector render() const;
+
+    protected:
+      /*!
+       * Reads data from the file specified in the constructor.  It does basic
+       * parsing of the data in the largest chunks.  It partitions the tag into
+       * the Header, the body of the tag  (which contains the ExtendedHeader and
+       * frames) and Footer.
+       */
+      void read();
+
+      /*!
+       * This is called by read to parse the body of the tag.  It determines if an
+       * extended header exists and adds frames to the FrameListMap.
+       */
+      void parse(const ByteVector &data);
+
+      /*!
+       * Sets the value of the text frame with the Frame ID \a id to \a value.
+       * If the frame does not exist, it is created.
+       */
+      void setTextFrame(const ByteVector &id, const String &value);
+
+    private:
+      Tag(const Tag &);
+      Tag &operator=(const Tag &);
+
+      class TagPrivate;
+      TagPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/mpegfile.cpp b/lib-src/taglib/taglib/mpeg/mpegfile.cpp
new file mode 100644
index 0000000..024d811
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegfile.cpp
@@ -0,0 +1,593 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tagunion.h>
+#include <id3v2tag.h>
+#include <id3v2header.h>
+#include <id3v1tag.h>
+#include <apefooter.h>
+#include <apetag.h>
+#include <tdebug.h>
+
+#include <bitset>
+
+#include "mpegfile.h"
+#include "mpegheader.h"
+
+using namespace TagLib;
+
+namespace
+{
+  enum { ID3v2Index = 0, APEIndex = 1, ID3v1Index = 2 };
+}
+
+class MPEG::File::FilePrivate
+{
+public:
+  FilePrivate(ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
+    ID3v2FrameFactory(frameFactory),
+    ID3v2Location(-1),
+    ID3v2OriginalSize(0),
+    APELocation(-1),
+    APEFooterLocation(-1),
+    APEOriginalSize(0),
+    ID3v1Location(-1),
+    hasID3v2(false),
+    hasID3v1(false),
+    hasAPE(false),
+    properties(0)
+  {
+
+  }
+
+  ~FilePrivate()
+  {
+    delete properties;
+  }
+
+  const ID3v2::FrameFactory *ID3v2FrameFactory;
+
+  long ID3v2Location;
+  uint ID3v2OriginalSize;
+
+  long APELocation;
+  long APEFooterLocation;
+  uint APEOriginalSize;
+
+  long ID3v1Location;
+
+  TagUnion tag;
+
+  // These indicate whether the file *on disk* has these tags, not if
+  // this data structure does.  This is used in computing offsets.
+
+  bool hasID3v2;
+  bool hasID3v1;
+  bool hasAPE;
+
+  Properties *properties;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+MPEG::File::File(FileName file, bool readProperties,
+                 Properties::ReadStyle propertiesStyle) : TagLib::File(file)
+{
+  d = new FilePrivate;
+
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+MPEG::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate(frameFactory);
+
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+MPEG::File::~File()
+{
+  delete d;
+}
+
+TagLib::Tag *MPEG::File::tag() const
+{
+  return &d->tag;
+}
+
+MPEG::Properties *MPEG::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool MPEG::File::save()
+{
+  return save(AllTags);
+}
+
+bool MPEG::File::save(int tags)
+{
+  return save(tags, true);
+}
+
+bool MPEG::File::save(int tags, bool stripOthers)
+{
+  if(tags == NoTags && stripOthers)
+    return strip(AllTags);
+
+  if(!ID3v2Tag() && !ID3v1Tag() && !APETag()) {
+
+    if((d->hasID3v1 || d->hasID3v2 || d->hasAPE) && stripOthers)
+      return strip(AllTags);
+
+    return true;
+  }
+
+  if(readOnly()) {
+    debug("MPEG::File::save() -- File is read only.");
+    return false;
+  }
+
+  // Create the tags if we've been asked to.  Copy the values from the tag that
+  // does exist into the new tag.
+
+  if((tags & ID3v2) && ID3v1Tag())
+    Tag::duplicate(ID3v1Tag(), ID3v2Tag(true), false);
+
+  if((tags & ID3v1) && d->tag[ID3v2Index])
+    Tag::duplicate(ID3v2Tag(), ID3v1Tag(true), false);
+
+  bool success = true;
+
+  if(ID3v2 & tags) {
+
+    if(ID3v2Tag() && !ID3v2Tag()->isEmpty()) {
+
+      if(!d->hasID3v2)
+        d->ID3v2Location = 0;
+
+      insert(ID3v2Tag()->render(), d->ID3v2Location, d->ID3v2OriginalSize);
+
+      d->hasID3v2 = true;
+
+      // v1 tag location has changed, update if it exists
+
+      if(ID3v1Tag())
+        d->ID3v1Location = findID3v1();
+
+      // APE tag location has changed, update if it exists
+
+      if(APETag())
+	findAPE();
+    }
+    else if(stripOthers)
+      success = strip(ID3v2, false) && success;
+  }
+  else if(d->hasID3v2 && stripOthers)
+    success = strip(ID3v2) && success;
+
+  if(ID3v1 & tags) {
+    if(ID3v1Tag() && !ID3v1Tag()->isEmpty()) {
+      int offset = d->hasID3v1 ? -128 : 0;
+      seek(offset, End);
+      writeBlock(ID3v1Tag()->render());
+      d->hasID3v1 = true;
+      d->ID3v1Location = findID3v1();
+    }
+    else if(stripOthers)
+      success = strip(ID3v1) && success;
+  }
+  else if(d->hasID3v1 && stripOthers)
+    success = strip(ID3v1, false) && success;
+
+  // Dont save an APE-tag unless one has been created
+
+  if((APE & tags) && APETag()) {
+    if(d->hasAPE)
+      insert(APETag()->render(), d->APELocation, d->APEOriginalSize);
+    else {
+      if(d->hasID3v1) {
+        insert(APETag()->render(), d->ID3v1Location, 0);
+        d->APEOriginalSize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+        d->APELocation = d->ID3v1Location;
+        d->ID3v1Location += d->APEOriginalSize;
+      }
+      else {
+        seek(0, End);
+        d->APELocation = tell();
+	d->APEFooterLocation = d->APELocation
+	  + d->tag.access<APE::Tag>(APEIndex, false)->footer()->completeTagSize()
+	  - APE::Footer::size();
+        writeBlock(APETag()->render());
+        d->APEOriginalSize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+      }
+    }
+  }
+  else if(d->hasAPE && stripOthers)
+    success = strip(APE, false) && success;
+
+  return success;
+}
+
+ID3v2::Tag *MPEG::File::ID3v2Tag(bool create)
+{
+  return d->tag.access<ID3v2::Tag>(ID3v2Index, create);
+}
+
+ID3v1::Tag *MPEG::File::ID3v1Tag(bool create)
+{
+  return d->tag.access<ID3v1::Tag>(ID3v1Index, create);
+}
+
+APE::Tag *MPEG::File::APETag(bool create)
+{
+  return d->tag.access<APE::Tag>(APEIndex, create);
+}
+
+bool MPEG::File::strip(int tags)
+{
+  return strip(tags, true);
+}
+
+bool MPEG::File::strip(int tags, bool freeMemory)
+{
+  if(readOnly()) {
+    debug("MPEG::File::strip() - Cannot strip tags from a read only file.");
+    return false;
+  }
+
+  if((tags & ID3v2) && d->hasID3v2) {
+    removeBlock(d->ID3v2Location, d->ID3v2OriginalSize);
+    d->ID3v2Location = -1;
+    d->ID3v2OriginalSize = 0;
+    d->hasID3v2 = false;
+
+    if(freeMemory)
+      d->tag.set(ID3v2Index, 0);
+
+    // v1 tag location has changed, update if it exists
+
+    if(ID3v1Tag())
+      d->ID3v1Location = findID3v1();
+
+    // APE tag location has changed, update if it exists
+
+   if(APETag())
+      findAPE();
+  }
+
+  if((tags & ID3v1) && d->hasID3v1) {
+    truncate(d->ID3v1Location);
+    d->ID3v1Location = -1;
+    d->hasID3v1 = false;
+
+    if(freeMemory)
+      d->tag.set(ID3v1Index, 0);
+  }
+
+  if((tags & APE) && d->hasAPE) {
+    removeBlock(d->APELocation, d->APEOriginalSize);
+    d->APELocation = -1;
+    d->APEFooterLocation = -1;
+    d->hasAPE = false;
+    if(d->hasID3v1) {
+      if(d->ID3v1Location > d->APELocation)
+        d->ID3v1Location -= d->APEOriginalSize;
+    }
+
+    if(freeMemory)
+      d->tag.set(APEIndex, 0);
+  }
+
+  return true;
+}
+
+void MPEG::File::setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
+{
+  d->ID3v2FrameFactory = factory;
+}
+
+long MPEG::File::nextFrameOffset(long position)
+{
+  bool foundLastSyncPattern = false;
+
+  ByteVector buffer;
+
+  while(true) {
+    seek(position);
+    buffer = readBlock(bufferSize());
+
+    if(buffer.size() <= 0)
+      return -1;
+
+    if(foundLastSyncPattern && secondSynchByte(buffer[0]))
+      return position - 1;
+
+    for(uint i = 0; i < buffer.size() - 1; i++) {
+      if(uchar(buffer[i]) == 0xff && secondSynchByte(buffer[i + 1]))
+        return position + i;
+    }
+
+    foundLastSyncPattern = uchar(buffer[buffer.size() - 1]) == 0xff;
+    position += buffer.size();
+  }
+}
+
+long MPEG::File::previousFrameOffset(long position)
+{
+  bool foundFirstSyncPattern = false;
+  ByteVector buffer;
+
+  while (position > 0) {
+    long size = ulong(position) < bufferSize() ? position : bufferSize();
+    position -= size;
+
+    seek(position);
+    buffer = readBlock(size);
+
+    if(buffer.size() <= 0)
+      break;
+
+    if(foundFirstSyncPattern && uchar(buffer[buffer.size() - 1]) == 0xff)
+      return position + buffer.size() - 1;
+
+    for(int i = buffer.size() - 2; i >= 0; i--) {
+      if(uchar(buffer[i]) == 0xff && secondSynchByte(buffer[i + 1]))
+        return position + i;
+    }
+
+    foundFirstSyncPattern = secondSynchByte(buffer[0]);
+  }
+  return -1;
+}
+
+long MPEG::File::firstFrameOffset()
+{
+  long position = 0;
+
+  if(ID3v2Tag())
+    position = d->ID3v2Location + ID3v2Tag()->header()->completeTagSize();
+
+  return nextFrameOffset(position);
+}
+
+long MPEG::File::lastFrameOffset()
+{
+  return previousFrameOffset(ID3v1Tag() ? d->ID3v1Location - 1 : length());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void MPEG::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  // Look for an ID3v2 tag
+
+  d->ID3v2Location = findID3v2();
+
+  if(d->ID3v2Location >= 0) {
+
+    d->tag.set(ID3v2Index, new ID3v2::Tag(this, d->ID3v2Location, d->ID3v2FrameFactory));
+
+    d->ID3v2OriginalSize = ID3v2Tag()->header()->completeTagSize();
+
+    if(ID3v2Tag()->header()->tagSize() <= 0)
+      d->tag.set(ID3v2Index, 0);
+    else
+      d->hasID3v2 = true;
+  }
+
+  // Look for an ID3v1 tag
+
+  d->ID3v1Location = findID3v1();
+
+  if(d->ID3v1Location >= 0) {
+    d->tag.set(ID3v1Index, new ID3v1::Tag(this, d->ID3v1Location));
+    d->hasID3v1 = true;
+  }
+
+  // Look for an APE tag
+
+  findAPE();
+
+  if(d->APELocation >= 0) {
+
+    d->tag.set(APEIndex, new APE::Tag(this, d->APEFooterLocation));
+    d->APEOriginalSize = APETag()->footer()->completeTagSize();
+    d->hasAPE = true;
+  }
+
+  if(readProperties)
+    d->properties = new Properties(this, propertiesStyle);
+
+  // Make sure that we have our default tag types available.
+
+  ID3v2Tag(true);
+  ID3v1Tag(true);
+}
+
+long MPEG::File::findID3v2()
+{
+  // This method is based on the contents of TagLib::File::find(), but because
+  // of some subtlteies -- specifically the need to look for the bit pattern of
+  // an MPEG sync, it has been modified for use here.
+
+  if(isValid() && ID3v2::Header::fileIdentifier().size() <= bufferSize()) {
+
+    // The position in the file that the current buffer starts at.
+
+    long bufferOffset = 0;
+    ByteVector buffer;
+
+    // These variables are used to keep track of a partial match that happens at
+    // the end of a buffer.
+
+    int previousPartialMatch = -1;
+    bool previousPartialSynchMatch = false;
+
+    // Save the location of the current read pointer.  We will restore the
+    // position using seek() before all returns.
+
+    long originalPosition = tell();
+
+    // Start the search at the beginning of the file.
+
+    seek(0);
+
+    // This loop is the crux of the find method.  There are three cases that we
+    // want to account for:
+    // (1) The previously searched buffer contained a partial match of the search
+    // pattern and we want to see if the next one starts with the remainder of
+    // that pattern.
+    //
+    // (2) The search pattern is wholly contained within the current buffer.
+    //
+    // (3) The current buffer ends with a partial match of the pattern.  We will
+    // note this for use in the next itteration, where we will check for the rest
+    // of the pattern.
+
+    for(buffer = readBlock(bufferSize()); buffer.size() > 0; buffer = readBlock(bufferSize())) {
+
+      // (1) previous partial match
+
+      if(previousPartialSynchMatch && secondSynchByte(buffer[0]))
+        return -1;
+
+      if(previousPartialMatch >= 0 && int(bufferSize()) > previousPartialMatch) {
+        const int patternOffset = (bufferSize() - previousPartialMatch);
+        if(buffer.containsAt(ID3v2::Header::fileIdentifier(), 0, patternOffset)) {
+          seek(originalPosition);
+          return bufferOffset - bufferSize() + previousPartialMatch;
+        }
+      }
+
+      // (2) pattern contained in current buffer
+
+      long location = buffer.find(ID3v2::Header::fileIdentifier());
+      if(location >= 0) {
+        seek(originalPosition);
+        return bufferOffset + location;
+      }
+
+      int firstSynchByte = buffer.find(char(uchar(255)));
+
+      // Here we have to loop because there could be several of the first
+      // (11111111) byte, and we want to check all such instances until we find
+      // a full match (11111111 111) or hit the end of the buffer.
+
+      while(firstSynchByte >= 0) {
+
+        // if this *is not* at the end of the buffer
+
+        if(firstSynchByte < int(buffer.size()) - 1) {
+          if(secondSynchByte(buffer[firstSynchByte + 1])) {
+            // We've found the frame synch pattern.
+            seek(originalPosition);
+            return -1;
+          }
+          else {
+
+            // We found 11111111 at the end of the current buffer indicating a
+            // partial match of the synch pattern.  The find() below should
+            // return -1 and break out of the loop.
+
+            previousPartialSynchMatch = true;
+          }
+        }
+
+        // Check in the rest of the buffer.
+
+        firstSynchByte = buffer.find(char(uchar(255)), firstSynchByte + 1);
+      }
+
+      // (3) partial match
+
+      previousPartialMatch = buffer.endsWithPartialMatch(ID3v2::Header::fileIdentifier());
+
+      bufferOffset += bufferSize();
+    }
+
+    // Since we hit the end of the file, reset the status before continuing.
+
+    clear();
+
+    seek(originalPosition);
+  }
+
+  return -1;
+}
+
+long MPEG::File::findID3v1()
+{
+  if(isValid()) {
+    seek(-128, End);
+    long p = tell();
+
+    if(readBlock(3) == ID3v1::Tag::fileIdentifier())
+      return p;
+  }
+  return -1;
+}
+
+void MPEG::File::findAPE()
+{
+  if(isValid()) {
+    seek(d->hasID3v1 ? -160 : -32, End);
+
+    long p = tell();
+
+    if(readBlock(8) == APE::Tag::fileIdentifier()) {
+      d->APEFooterLocation = p;
+      seek(d->APEFooterLocation);
+      APE::Footer footer(readBlock(APE::Footer::size()));
+      d->APELocation = d->APEFooterLocation - footer.completeTagSize()
+	+ APE::Footer::size();
+      return;
+    }
+  }
+
+  d->APELocation = -1;
+  d->APEFooterLocation = -1;
+}
+
+bool MPEG::File::secondSynchByte(char byte)
+{
+  if(uchar(byte) == 0xff)
+    return false;
+
+  std::bitset<8> b(byte);
+
+  // check to see if the byte matches 111xxxxx
+  return b.test(7) && b.test(6) && b.test(5);
+}
diff --git a/lib-src/taglib/taglib/mpeg/mpegfile.h b/lib-src/taglib/taglib/mpeg/mpegfile.h
new file mode 100644
index 0000000..b53c94c
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegfile.h
@@ -0,0 +1,277 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MPEGFILE_H
+#define TAGLIB_MPEGFILE_H
+
+#include "taglib_export.h"
+#include "tfile.h"
+
+#include "mpegproperties.h"
+
+namespace TagLib {
+
+  namespace ID3v2 { class Tag; class FrameFactory; }
+  namespace ID3v1 { class Tag; }
+  namespace APE { class Tag; }
+
+  //! An implementation of TagLib::File with MPEG (MP3) specific methods
+
+  namespace MPEG {
+
+    //! An MPEG file class with some useful methods specific to MPEG
+
+    /*!
+     * This implements the generic TagLib::File API and additionally provides
+     * access to properties that are distinct to MPEG files, notably access
+     * to the different ID3 tags.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * This set of flags is used for various operations and is suitable for
+       * being OR-ed together.
+       */
+      enum TagTypes {
+        //! Empty set.  Matches no tag types.
+        NoTags  = 0x0000,
+        //! Matches ID3v1 tags.
+        ID3v1   = 0x0001,
+        //! Matches ID3v2 tags.
+        ID3v2   = 0x0002,
+        //! Matches APE tags.
+        APE     = 0x0004,
+        //! Matches all tag types.
+        AllTags = 0xffff
+      };
+
+      /*!
+       * Contructs an MPEG file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * \deprecated This constructor will be dropped in favor of the one below
+       * in a future version.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Contructs an MPEG file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.  The frames will be created using
+       * \a frameFactory.
+       */
+      // BIC: merge with the above constructor
+      File(FileName file, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns a pointer to a tag that is the union of the ID3v2 and ID3v1
+       * tags. The ID3v2 tag is given priority in reading the information -- if
+       * requested information exists in both the ID3v2 tag and the ID3v1 tag,
+       * the information from the ID3v2 tag will be returned.
+       *
+       * If you would like more granular control over the content of the tags,
+       * with the concession of generality, use the tag-type specific calls.
+       *
+       * \note As this tag is not implemented as an ID3v2 tag or an ID3v1 tag,
+       * but a union of the two this pointer may not be cast to the specific
+       * tag types.
+       *
+       * \see ID3v1Tag()
+       * \see ID3v2Tag()
+       * \see APETag()
+       */
+      virtual Tag *tag() const;
+
+      /*!
+       * Returns the MPEG::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Save the file.  If at least one tag -- ID3v1 or ID3v2 -- exists this
+       * will duplicate its content into the other tag.  This returns true
+       * if saving was successful.
+       *
+       * If neither exists or if both tags are empty, this will strip the tags
+       * from the file.
+       *
+       * This is the same as calling save(AllTags);
+       *
+       * If you would like more granular control over the content of the tags,
+       * with the concession of generality, use paramaterized save call below.
+       *
+       * \see save(int tags)
+       */
+      virtual bool save();
+
+      /*!
+       * Save the file.  This will attempt to save all of the tag types that are
+       * specified by OR-ing together TagTypes values.  The save() method above
+       * uses AllTags.  This returns true if saving was successful.
+       *
+       * This strips all tags not included in the mask, but does not modify them
+       * in memory, so later calls to save() which make use of these tags will
+       * remain valid.  This also strips empty tags.
+       */
+      bool save(int tags);
+
+      /*!
+       * Save the file.  This will attempt to save all of the tag types that are
+       * specified by OR-ing together TagTypes values.  The save() method above
+       * uses AllTags.  This returns true if saving was successful.
+       *
+       * If \a stripOthers is true this strips all tags not included in the mask,
+       * but does not modify them in memory, so later calls to save() which make
+       * use of these tags will remain valid.  This also strips empty tags.
+       */
+      // BIC: combine with the above method
+      bool save(int tags, bool stripOthers);
+
+      /*!
+       * Returns a pointer to the ID3v2 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v2 tag.  If \a create is true it will create
+       * an ID3v2 tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v2::Tag *ID3v2Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the ID3v1 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v1 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v1::Tag *ID3v1Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the APE tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid APE tag.  If \a create is true it will create
+       * an APE tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      APE::Tag *APETag(bool create = false);
+
+      /*!
+       * This will strip the tags that match the OR-ed together TagTypes from the
+       * file.  By default it strips all tags.  It returns true if the tags are
+       * successfully stripped.
+       *
+       * This is equivalent to strip(tags, true)
+       *
+       * \note This will also invalidate pointers to the ID3 and APE tags
+       * as their memory will be freed.
+       */
+      bool strip(int tags = AllTags);
+
+      /*!
+       * This will strip the tags that match the OR-ed together TagTypes from the
+       * file.  By default it strips all tags.  It returns true if the tags are
+       * successfully stripped.
+       *
+       * If \a freeMemory is true the ID3 and APE tags will be deleted and
+       * pointers to them will be invalidated.
+       */
+      // BIC: merge with the method above
+      bool strip(int tags, bool freeMemory);
+
+      /*!
+       * Set the ID3v2::FrameFactory to something other than the default.
+       *
+       * \see ID3v2FrameFactory
+       */
+      void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+
+      /*!
+       * Returns the position in the file of the first MPEG frame.
+       */
+      long firstFrameOffset();
+
+      /*!
+       * Returns the position in the file of the next MPEG frame,
+       * using the current position as start
+       */
+      long nextFrameOffset(long position);
+
+      /*!
+       * Returns the position in the file of the previous MPEG frame,
+       * using the current position as start
+       */
+      long previousFrameOffset(long position);
+
+      /*!
+       * Returns the position in the file of the last MPEG frame.
+       */
+      long lastFrameOffset();
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      long findID3v2();
+      long findID3v1();
+      void findAPE();
+
+      /*!
+       * MPEG frames can be recognized by the bit pattern 11111111 111, so the
+       * first byte is easy to check for, however checking to see if the second byte
+       * starts with \e 111 is a bit more tricky, hence this member function.
+       */
+      static bool secondSynchByte(char byte);
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/mpegheader.cpp b/lib-src/taglib/taglib/mpeg/mpegheader.cpp
new file mode 100644
index 0000000..8789530
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegheader.cpp
@@ -0,0 +1,276 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <bitset>
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "mpegheader.h"
+
+using namespace TagLib;
+
+class MPEG::Header::HeaderPrivate : public RefCounter
+{
+public:
+  HeaderPrivate() :
+    isValid(false),
+    version(Version1),
+    layer(0),
+    protectionEnabled(false),
+    sampleRate(0),
+    isPadded(false),
+    channelMode(Stereo),
+    isCopyrighted(false),
+    isOriginal(false),
+    frameLength(0),
+    samplesPerFrame(0) {}
+
+  bool isValid;
+  Version version;
+  int layer;
+  bool protectionEnabled;
+  int bitrate;
+  int sampleRate;
+  bool isPadded;
+  ChannelMode channelMode;
+  bool isCopyrighted;
+  bool isOriginal;
+  int frameLength;
+  int samplesPerFrame;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+MPEG::Header::Header(const ByteVector &data)
+{
+  d = new HeaderPrivate;
+  parse(data);
+}
+
+MPEG::Header::Header(const Header &h) : d(h.d)
+{
+  d->ref();
+}
+
+MPEG::Header::~Header()
+{
+  if (d->deref())
+    delete d;
+}
+
+bool MPEG::Header::isValid() const
+{
+  return d->isValid;
+}
+
+MPEG::Header::Version MPEG::Header::version() const
+{
+  return d->version;
+}
+
+int MPEG::Header::layer() const
+{
+  return d->layer;
+}
+
+bool MPEG::Header::protectionEnabled() const
+{
+  return d->protectionEnabled;
+}
+
+int MPEG::Header::bitrate() const
+{
+  return d->bitrate;
+}
+
+int MPEG::Header::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+bool MPEG::Header::isPadded() const
+{
+  return d->isPadded;
+}
+
+MPEG::Header::ChannelMode MPEG::Header::channelMode() const
+{
+  return d->channelMode;
+}
+
+bool MPEG::Header::isCopyrighted() const
+{
+  return d->isCopyrighted;
+}
+
+bool MPEG::Header::isOriginal() const
+{
+  return d->isOriginal;
+}
+
+int MPEG::Header::frameLength() const
+{
+  return d->frameLength;
+}
+
+int MPEG::Header::samplesPerFrame() const
+{
+  return d->samplesPerFrame;
+}
+
+MPEG::Header &MPEG::Header::operator=(const Header &h)
+{
+  if(&h == this)
+    return *this;
+
+  if(d->deref())
+    delete d;
+
+  d = h.d;
+  d->ref();
+  return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void MPEG::Header::parse(const ByteVector &data)
+{
+  if(data.size() < 4 || uchar(data[0]) != 0xff) {
+    debug("MPEG::Header::parse() -- First byte did not match MPEG synch.");
+    return;
+  }
+
+  std::bitset<32> flags(data.toUInt());
+
+  // Check for the second byte's part of the MPEG synch
+
+  if(!flags[23] || !flags[22] || !flags[21]) {
+    debug("MPEG::Header::parse() -- Second byte did not match MPEG synch.");
+    return;
+  }
+
+  // Set the MPEG version
+
+  if(!flags[20] && !flags[19])
+    d->version = Version2_5;
+  else if(flags[20] && !flags[19])
+    d->version = Version2;
+  else if(flags[20] && flags[19])
+    d->version = Version1;
+
+  // Set the MPEG layer
+
+  if(!flags[18] && flags[17])
+    d->layer = 3;
+  else if(flags[18] && !flags[17])
+    d->layer = 2;
+  else if(flags[18] && flags[17])
+    d->layer = 1;
+
+  d->protectionEnabled = !flags[16];
+
+  // Set the bitrate
+
+  static const int bitrates[2][3][16] = {
+    { // Version 1
+      { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0 }, // layer 1
+      { 0, 32, 48, 56, 64,  80,  96,  112, 128, 160, 192, 224, 256, 320, 384, 0 }, // layer 2
+      { 0, 32, 40, 48, 56,  64,  80,  96,  112, 128, 160, 192, 224, 256, 320, 0 }  // layer 3
+    },
+    { // Version 2 or 2.5
+      { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 }, // layer 1
+      { 0, 8,  16, 24, 32, 40, 48, 56,  64,  80,  96,  112, 128, 144, 160, 0 }, // layer 2
+      { 0, 8,  16, 24, 32, 40, 48, 56,  64,  80,  96,  112, 128, 144, 160, 0 }  // layer 3
+    }
+  };
+
+  const int versionIndex = d->version == Version1 ? 0 : 1;
+  const int layerIndex = d->layer > 0 ? d->layer - 1 : 0;
+
+  // The bitrate index is encoded as the first 4 bits of the 3rd byte,
+  // i.e. 1111xxxx
+
+  int i = uchar(data[2]) >> 4;
+
+  d->bitrate = bitrates[versionIndex][layerIndex][i];
+
+  // Set the sample rate
+
+  static const int sampleRates[3][4] = {
+    { 44100, 48000, 32000, 0 }, // Version 1
+    { 22050, 24000, 16000, 0 }, // Version 2
+    { 11025, 12000, 8000,  0 }  // Version 2.5
+  };
+
+  // The sample rate index is encoded as two bits in the 3nd byte, i.e. xxxx11xx
+
+  i = uchar(data[2]) >> 2 & 0x03;
+
+  d->sampleRate = sampleRates[d->version][i];
+
+  if(d->sampleRate == 0) {
+    debug("MPEG::Header::parse() -- Invalid sample rate.");
+    return;
+  }
+
+  // The channel mode is encoded as a 2 bit value at the end of the 3nd byte,
+  // i.e. xxxxxx11
+
+  d->channelMode = ChannelMode((uchar(data[3]) & 0xC0) >> 6);
+
+  // TODO: Add mode extension for completeness
+
+  d->isOriginal = flags[2];
+  d->isCopyrighted = flags[3];
+  d->isPadded = flags[9];
+
+  // Calculate the frame length
+
+  if(d->layer == 1)
+    d->frameLength = 24000 * 2 * d->bitrate / d->sampleRate + int(d->isPadded);
+  else
+    d->frameLength = 72000 * d->bitrate / d->sampleRate + int(d->isPadded);
+
+  // Samples per frame
+
+  static const int samplesPerFrame[3][2] = {
+    // MPEG1, 2/2.5
+    {  384,   384 }, // Layer I
+    { 1152,  1152 }, // Layer II
+    { 1152,   576 }  // Layer III
+  };
+
+  d->samplesPerFrame = samplesPerFrame[layerIndex][versionIndex];
+
+  // Now that we're done parsing, set this to be a valid frame.
+
+  d->isValid = true;
+}
diff --git a/lib-src/taglib/taglib/mpeg/mpegheader.h b/lib-src/taglib/taglib/mpeg/mpegheader.h
new file mode 100644
index 0000000..c774de8
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegheader.h
@@ -0,0 +1,166 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MPEGHEADER_H
+#define TAGLIB_MPEGHEADER_H
+
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  class ByteVector;
+
+  namespace MPEG {
+
+    //! An implementation of MP3 frame headers
+
+    /*!
+     * This is an implementation of MPEG Layer III headers.  The API follows more
+     * or less the binary format of these headers.  I've used
+     * <a href="http://www.mp3-tech.org/programmer/frame_header.html">this</a>
+     * document as a reference.
+     */
+
+    class TAGLIB_EXPORT Header
+    {
+    public:
+      /*!
+       * Parses an MPEG header based on \a data.
+       */
+      Header(const ByteVector &data);
+
+      /*!
+       * Does a shallow copy of \a h.
+       */
+      Header(const Header &h);
+
+      /*!
+       * Destroys this Header instance.
+       */
+      virtual ~Header();
+
+      /*!
+       * Returns true if the frame is at least an appropriate size and has
+       * legal values.
+       */
+      bool isValid() const;
+
+      /*!
+       * The MPEG Version.
+       */
+      enum Version {
+        //! MPEG Version 1
+        Version1 = 0,
+        //! MPEG Version 2
+        Version2 = 1,
+        //! MPEG Version 2.5
+        Version2_5 = 2
+      };
+
+      /*!
+       * Returns the MPEG Version of the header.
+       */
+      Version version() const;
+
+      /*!
+       * Returns the layer version.  This will be between the values 1-3.
+       */
+      int layer() const;
+
+      /*!
+       * Returns true if the MPEG protection bit is enabled.
+       */
+      bool protectionEnabled() const;
+
+      /*!
+       * Returns the bitrate encoded in the header.
+       */
+      int bitrate() const;
+
+      /*!
+       * Returns the sample rate in Hz.
+       */
+      int sampleRate() const;
+
+      /*!
+       * Returns true if the frame is padded.
+       */
+      bool isPadded() const;
+
+      /*!
+       * There are a few combinations or one or two channel audio that are
+       * possible:
+       */
+      enum ChannelMode {
+        //! Stereo
+        Stereo        = 0,
+        //! Stereo
+        JointStereo   = 1,
+        //! Dual Mono
+        DualChannel   = 2,
+        //! Mono
+        SingleChannel = 3
+      };
+
+      /*!
+       * Returns the channel mode for this frame.
+       */
+      ChannelMode channelMode() const;
+
+      /*!
+       * Returns true if the copyrighted bit is set.
+       */
+      bool isCopyrighted() const;
+
+      /*!
+       * Returns true if the "original" bit is set.
+       */
+      bool isOriginal() const;
+
+      /*!
+       * Returns the frame length.
+       */
+      int frameLength() const;
+
+      /*!
+       * Returns the number of frames per sample.
+       */
+      int samplesPerFrame() const;
+
+      /*!
+       * Makes a shallow copy of the header.
+       */
+      Header &operator=(const Header &h);
+
+    private:
+      void parse(const ByteVector &data);
+
+      class HeaderPrivate;
+      HeaderPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/mpegproperties.cpp b/lib-src/taglib/taglib/mpeg/mpegproperties.cpp
new file mode 100644
index 0000000..518de61
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegproperties.cpp
@@ -0,0 +1,252 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tdebug.h>
+#include <tstring.h>
+
+#include "mpegproperties.h"
+#include "mpegfile.h"
+#include "xingheader.h"
+
+using namespace TagLib;
+
+class MPEG::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(File *f, ReadStyle s) :
+    file(f),
+    xingHeader(0),
+    style(s),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0),
+    layer(0),
+    version(Header::Version1),
+    channelMode(Header::Stereo),
+    protectionEnabled(false),
+    isCopyrighted(false),
+    isOriginal(false) {}
+
+  ~PropertiesPrivate()
+  {
+    delete xingHeader;
+  }
+
+  File *file;
+  XingHeader *xingHeader;
+  ReadStyle style;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int layer;
+  Header::Version version;
+  Header::ChannelMode channelMode;
+  bool protectionEnabled;
+  bool isCopyrighted;
+  bool isOriginal;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+MPEG::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(file, style);
+
+  if(file && file->isOpen())
+    read();
+}
+
+MPEG::Properties::~Properties()
+{
+  delete d;
+}
+
+int MPEG::Properties::length() const
+{
+  return d->length;
+}
+
+int MPEG::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int MPEG::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int MPEG::Properties::channels() const
+{
+  return d->channels;
+}
+
+const MPEG::XingHeader *MPEG::Properties::xingHeader() const
+{
+  return d->xingHeader;
+}
+
+MPEG::Header::Version MPEG::Properties::version() const
+{
+  return d->version;
+}
+
+int MPEG::Properties::layer() const
+{
+  return d->layer;
+}
+
+bool MPEG::Properties::protectionEnabled() const
+{
+  return d->protectionEnabled;
+}
+
+MPEG::Header::ChannelMode MPEG::Properties::channelMode() const
+{
+  return d->channelMode;
+}
+
+bool MPEG::Properties::isCopyrighted() const
+{
+  return d->isCopyrighted;
+}
+
+bool MPEG::Properties::isOriginal() const
+{
+  return d->isOriginal;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void MPEG::Properties::read()
+{
+  // Since we've likely just looked for the ID3v1 tag, start at the end of the
+  // file where we're least likely to have to have to move the disk head.
+
+  long last = d->file->lastFrameOffset();
+
+  if(last < 0) {
+    debug("MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.");
+    return;
+  }
+
+  d->file->seek(last);
+  Header lastHeader(d->file->readBlock(4));
+
+  long first = d->file->firstFrameOffset();
+
+  if(first < 0) {
+    debug("MPEG::Properties::read() -- Could not find a valid first MPEG frame in the stream.");
+    return;
+  }
+
+  if(!lastHeader.isValid()) {
+
+    long pos = last;
+
+    while(pos > first) {
+
+      pos = d->file->previousFrameOffset(pos);
+
+      if(pos < 0)
+        break;
+
+      d->file->seek(pos);
+      Header header(d->file->readBlock(4));
+
+      if(header.isValid()) {
+        lastHeader = header;
+        last = pos;
+        break;
+      }
+    }
+  }
+
+  // Now jump back to the front of the file and read what we need from there.
+
+  d->file->seek(first);
+  Header firstHeader(d->file->readBlock(4));
+
+  if(!firstHeader.isValid() || !lastHeader.isValid()) {
+    debug("MPEG::Properties::read() -- Page headers were invalid.");
+    return;
+  }
+
+  // Check for a Xing header that will help us in gathering information about a
+  // VBR stream.
+
+  int xingHeaderOffset = MPEG::XingHeader::xingHeaderOffset(firstHeader.version(),
+                                                            firstHeader.channelMode());
+
+  d->file->seek(first + xingHeaderOffset);
+  d->xingHeader = new XingHeader(d->file->readBlock(16));
+
+  // Read the length and the bitrate from the Xing header.
+
+  if(d->xingHeader->isValid() &&
+     firstHeader.sampleRate() > 0 &&
+     d->xingHeader->totalFrames() > 0)
+  {
+      double timePerFrame =
+        double(firstHeader.samplesPerFrame()) / firstHeader.sampleRate();
+
+      d->length = int(timePerFrame * d->xingHeader->totalFrames());
+      d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / d->length / 1000 : 0;
+  }
+  else {
+    // Since there was no valid Xing header found, we hope that we're in a constant
+    // bitrate file.
+
+    delete d->xingHeader;
+    d->xingHeader = 0;
+
+    // TODO: Make this more robust with audio property detection for VBR without a
+    // Xing header.
+
+    if(firstHeader.frameLength() > 0 && firstHeader.bitrate() > 0) {
+      int frames = (last - first) / firstHeader.frameLength() + 1;
+
+      d->length = int(float(firstHeader.frameLength() * frames) /
+                      float(firstHeader.bitrate() * 125) + 0.5);
+      d->bitrate = firstHeader.bitrate();
+    }
+  }
+
+
+  d->sampleRate = firstHeader.sampleRate();
+  d->channels = firstHeader.channelMode() == Header::SingleChannel ? 1 : 2;
+  d->version = firstHeader.version();
+  d->layer = firstHeader.layer();
+  d->protectionEnabled = firstHeader.protectionEnabled();
+  d->channelMode = firstHeader.channelMode();
+  d->isCopyrighted = firstHeader.isCopyrighted();
+  d->isOriginal = firstHeader.isOriginal();
+}
diff --git a/lib-src/taglib/taglib/mpeg/mpegproperties.h b/lib-src/taglib/taglib/mpeg/mpegproperties.h
new file mode 100644
index 0000000..17452e1
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/mpegproperties.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MPEGPROPERTIES_H
+#define TAGLIB_MPEGPROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+#include "mpegheader.h"
+
+namespace TagLib {
+
+  namespace MPEG {
+
+    class File;
+    class XingHeader;
+
+    //! An implementation of audio property reading for MP3
+
+    /*!
+     * This reads the data from an MPEG Layer III stream found in the
+     * AudioProperties API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of MPEG::Properties with the data read from the
+       * MPEG::File \a file.
+       */
+      Properties(File *file, ReadStyle style = Average);
+
+      /*!
+       * Destroys this MPEG Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns a pointer to the XingHeader if one exists or null if no
+       * XingHeader was found.
+       */
+
+      const XingHeader *xingHeader() const;
+
+      /*!
+       * Returns the MPEG Version of the file.
+       */
+      Header::Version version() const;
+
+      /*!
+       * Returns the layer version.  This will be between the values 1-3.
+       */
+      int layer() const;
+
+      /*!
+       * Returns true if the MPEG protection bit is enabled.
+       */
+      bool protectionEnabled() const;
+
+      /*!
+       * Returns the channel mode for this frame.
+       */
+      Header::ChannelMode channelMode() const;
+
+      /*!
+       * Returns true if the copyrighted bit is set.
+       */
+      bool isCopyrighted() const;
+
+      /*!
+       * Returns true if the "original" bit is set.
+       */
+      bool isOriginal() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/mpeg/xingheader.cpp b/lib-src/taglib/taglib/mpeg/xingheader.cpp
new file mode 100644
index 0000000..626452e
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/xingheader.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Ismael Orenstein
+    email                : orenstein at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "xingheader.h"
+
+using namespace TagLib;
+
+class MPEG::XingHeader::XingHeaderPrivate
+{
+public:
+  XingHeaderPrivate() :
+    frames(0),
+    size(0),
+    valid(false)
+    {}
+
+  uint frames;
+  uint size;
+  bool valid;
+};
+
+MPEG::XingHeader::XingHeader(const ByteVector &data)
+{
+  d = new XingHeaderPrivate;
+  parse(data);
+}
+
+MPEG::XingHeader::~XingHeader()
+{
+  delete d;
+}
+
+bool MPEG::XingHeader::isValid() const
+{
+  return d->valid;
+}
+
+TagLib::uint MPEG::XingHeader::totalFrames() const
+{
+  return d->frames;
+}
+
+TagLib::uint MPEG::XingHeader::totalSize() const
+{
+  return d->size;
+}
+
+int MPEG::XingHeader::xingHeaderOffset(TagLib::MPEG::Header::Version v,
+                                       TagLib::MPEG::Header::ChannelMode c)
+{
+  if(v == MPEG::Header::Version1) {
+    if(c == MPEG::Header::SingleChannel)
+      return 0x15;
+    else
+      return 0x24;
+  }
+  else {
+    if(c == MPEG::Header::SingleChannel)
+      return 0x0D;
+    else
+      return 0x15;
+  }
+}
+
+void MPEG::XingHeader::parse(const ByteVector &data)
+{
+  // Check to see if a valid Xing header is available.
+
+  if(!data.startsWith("Xing") && !data.startsWith("Info"))
+    return;
+
+  // If the XingHeader doesn't contain the number of frames and the total stream
+  // info it's invalid.
+
+  if(!(data[7] & 0x01)) {
+    debug("MPEG::XingHeader::parse() -- Xing header doesn't contain the total number of frames.");
+    return;
+  }
+
+  if(!(data[7] & 0x02)) {
+    debug("MPEG::XingHeader::parse() -- Xing header doesn't contain the total stream size.");
+    return;
+  }
+
+  d->frames = data.mid(8, 4).toUInt();
+  d->size = data.mid(12, 4).toUInt();
+
+  d->valid = true;
+}
diff --git a/lib-src/taglib/taglib/mpeg/xingheader.h b/lib-src/taglib/taglib/mpeg/xingheader.h
new file mode 100644
index 0000000..1ffc03d
--- /dev/null
+++ b/lib-src/taglib/taglib/mpeg/xingheader.h
@@ -0,0 +1,100 @@
+/***************************************************************************
+    copyright            : (C) 2003 by Ismael Orenstein
+    email                : orenstein at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_XINGHEADER_H
+#define TAGLIB_XINGHEADER_H
+
+#include "mpegheader.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  class ByteVector;
+
+  namespace MPEG {
+
+    //! An implementation of the Xing VBR headers
+
+    /*!
+     * This is a minimalistic implementation of the Xing VBR headers.  Xing
+     * headers are often added to VBR (variable bit rate) MP3 streams to make it
+     * easy to compute the length and quality of a VBR stream.  Our implementation
+     * is only concerned with the total size of the stream (so that we can
+     * calculate the total playing time and the average bitrate).  It uses
+     * <a href="http://home.pcisys.net/~melanson/codecs/mp3extensions.txt">this text</a>
+     * and the XMMS sources as references.
+     */
+
+    class TAGLIB_EXPORT XingHeader
+    {
+    public:
+      /*!
+       * Parses a Xing header based on \a data.  The data must be at least 16
+       * bytes long (anything longer than this is discarded).
+       */
+      XingHeader(const ByteVector &data);
+
+      /*!
+       * Destroy this XingHeader instance.
+       */
+      virtual ~XingHeader();
+
+      /*!
+       * Returns true if the data was parsed properly and if there is a valid
+       * Xing header present.
+       */
+      bool isValid() const;
+
+      /*!
+       * Returns the total number of frames.
+       */
+      uint totalFrames() const;
+
+      /*!
+       * Returns the total size of stream in bytes.
+       */
+      uint totalSize() const;
+
+      /*!
+       * Returns the offset for the start of this Xing header, given the
+       * version and channels of the frame
+       */
+      // BIC: rename to offset()
+      static int xingHeaderOffset(TagLib::MPEG::Header::Version v,
+                                  TagLib::MPEG::Header::ChannelMode c);
+
+    private:
+      XingHeader(const XingHeader &);
+      XingHeader &operator=(const XingHeader &);
+
+      void parse(const ByteVector &data);
+
+      class XingHeaderPrivate;
+      XingHeaderPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/.deps/oggfile.Plo b/lib-src/taglib/taglib/ogg/.deps/oggfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/.deps/oggfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/.deps/oggpage.Plo b/lib-src/taglib/taglib/ogg/.deps/oggpage.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/.deps/oggpage.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/.deps/oggpageheader.Plo b/lib-src/taglib/taglib/ogg/.deps/oggpageheader.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/.deps/oggpageheader.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/.deps/xiphcomment.Plo b/lib-src/taglib/taglib/ogg/.deps/xiphcomment.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/.deps/xiphcomment.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/CMakeLists.txt b/lib-src/taglib/taglib/ogg/CMakeLists.txt
new file mode 100644
index 0000000..d506a3c
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/CMakeLists.txt
@@ -0,0 +1,6 @@
+ADD_SUBDIRECTORY( vorbis ) 
+ADD_SUBDIRECTORY( speex ) 
+ADD_SUBDIRECTORY( flac ) 
+
+INSTALL( FILES  oggfile.h  	oggpage.h  	oggpageheader.h  	xiphcomment.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib )
+
diff --git a/lib-src/taglib/taglib/ogg/Makefile.am b/lib-src/taglib/taglib/ogg/Makefile.am
new file mode 100644
index 0000000..d398c86
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/Makefile.am
@@ -0,0 +1,21 @@
+SUBDIRS = vorbis flac speex
+
+INCLUDES = -I$(top_srcdir)/taglib -I$(top_srcdir)/taglib/toolkit $(all_includes)
+
+noinst_LTLIBRARIES = libogg.la
+
+libogg_la_SOURCES = \
+	oggfile.cpp \
+	oggpage.cpp \
+	oggpageheader.cpp \
+	xiphcomment.cpp
+
+taglib_include_HEADERS = \
+	oggfile.h \
+	oggpage.h \
+	oggpageheader.h \
+	xiphcomment.h
+
+taglib_includedir = $(includedir)/taglib
+
+libogg_la_LIBADD = ./vorbis/libvorbis.la ./flac/liboggflac.la ./speex/libspeex.la
diff --git a/lib-src/taglib/taglib/ogg/Makefile.in b/lib-src/taglib/taglib/ogg/Makefile.in
new file mode 100644
index 0000000..9783618
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/Makefile.in
@@ -0,0 +1,757 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/ogg
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libogg_la_DEPENDENCIES = ./vorbis/libvorbis.la ./flac/liboggflac.la \
+	./speex/libspeex.la
+am_libogg_la_OBJECTS = oggfile.lo oggpage.lo oggpageheader.lo \
+	xiphcomment.lo
+#>- libogg_la_OBJECTS = $(am_libogg_la_OBJECTS)
+#>+ 5
+libogg_la_final_OBJECTS = libogg_la.all_cpp.lo 
+libogg_la_nofinal_OBJECTS = oggfile.lo oggpage.lo oggpageheader.lo \
+	xiphcomment.lo
+ at KDE_USE_FINAL_FALSE@libogg_la_OBJECTS = $(libogg_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libogg_la_OBJECTS = $(libogg_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libogg_la_SOURCES)
+DIST_SOURCES = $(libogg_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = vorbis flac speex
+INCLUDES = -I$(top_srcdir)/taglib -I$(top_srcdir)/taglib/toolkit $(all_includes)
+noinst_LTLIBRARIES = libogg.la
+libogg_la_SOURCES = \
+	oggfile.cpp \
+	oggpage.cpp \
+	oggpageheader.cpp \
+	xiphcomment.cpp
+
+taglib_include_HEADERS = \
+	oggfile.h \
+	oggpage.h \
+	oggpageheader.h \
+	xiphcomment.h
+
+taglib_includedir = $(includedir)/taglib
+libogg_la_LIBADD = ./vorbis/libvorbis.la ./flac/liboggflac.la ./speex/libspeex.la
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/ogg/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libogg.la: $(libogg_la_OBJECTS) $(libogg_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libogg_la_OBJECTS) $(libogg_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/oggfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/oggpage.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/oggpageheader.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xiphcomment.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libogg_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/oggfile.cpp $(srcdir)/oggpage.cpp $(srcdir)/oggpageheader.cpp $(srcdir)/xiphcomment.cpp 
+	@echo 'creating libogg_la.all_cpp.cpp ...'; \
+	rm -f libogg_la.all_cpp.files libogg_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libogg_la.all_cpp.final; \
+	for file in oggfile.cpp oggpage.cpp oggpageheader.cpp xiphcomment.cpp ; do \
+	  echo "#include \"$$file\"" >> libogg_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libogg_la.all_cpp.final; \
+	done; \
+	cat libogg_la.all_cpp.final libogg_la.all_cpp.files > libogg_la.all_cpp.cpp; \
+	rm -f libogg_la.all_cpp.final libogg_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libogg_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libogg_la_OBJECTS="$(libogg_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libogg_la_OBJECTS="$(libogg_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libogg_la_OBJECTS="$(libogg_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libogg_la_OBJECTS="$(libogg_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ogg/flac/.deps/oggflacfile.Plo b/lib-src/taglib/taglib/ogg/flac/.deps/oggflacfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/.deps/oggflacfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/flac/CMakeLists.txt b/lib-src/taglib/taglib/ogg/flac/CMakeLists.txt
new file mode 100644
index 0000000..6e7d9a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/CMakeLists.txt
@@ -0,0 +1,2 @@
+INSTALL( FILES  oggflacfile.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
+
diff --git a/lib-src/taglib/taglib/ogg/flac/Makefile.am b/lib-src/taglib/taglib/ogg/flac/Makefile.am
new file mode 100644
index 0000000..120aa2a
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/flac \
+	$(all_includes)
+
+noinst_LTLIBRARIES = liboggflac.la
+
+liboggflac_la_SOURCES = oggflacfile.cpp
+
+taglib_include_HEADERS = oggflacfile.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/ogg/flac/Makefile.in b/lib-src/taglib/taglib/ogg/flac/Makefile.in
new file mode 100644
index 0000000..22da8ea
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/Makefile.in
@@ -0,0 +1,604 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/ogg/flac
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+liboggflac_la_LIBADD =
+am_liboggflac_la_OBJECTS = oggflacfile.lo
+#>- liboggflac_la_OBJECTS = $(am_liboggflac_la_OBJECTS)
+#>+ 1
+liboggflac_la_OBJECTS = oggflacfile.lo
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(liboggflac_la_SOURCES)
+DIST_SOURCES = $(liboggflac_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	-I$(top_srcdir)/taglib/flac \
+	$(all_includes)
+
+noinst_LTLIBRARIES = liboggflac.la
+liboggflac_la_SOURCES = oggflacfile.cpp
+taglib_include_HEADERS = oggflacfile.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/flac/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+liboggflac.la: $(liboggflac_la_OBJECTS) $(liboggflac_la_DEPENDENCIES) 
+	$(CXXLINK)  $(liboggflac_la_OBJECTS) $(liboggflac_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/oggflacfile.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/flac/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/flac/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ogg/flac/oggflacfile.cpp b/lib-src/taglib/taglib/ogg/flac/oggflacfile.cpp
new file mode 100644
index 0000000..3070f3a
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/oggflacfile.cpp
@@ -0,0 +1,269 @@
+/***************************************************************************
+    copyright            : (C) 2004-2005 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tdebug.h>
+
+#include <xiphcomment.h>
+#include "oggflacfile.h"
+
+using namespace TagLib;
+using TagLib::FLAC::Properties;
+
+class Ogg::FLAC::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    comment(0),
+    properties(0),
+    streamStart(0),
+    streamLength(0),
+    scanned(false),
+    hasXiphComment(false),
+    commentPacket(0) {}
+
+  ~FilePrivate()
+  {
+    delete comment;
+    delete properties;
+  }
+
+  Ogg::XiphComment *comment;
+
+  Properties *properties;
+  ByteVector streamInfoData;
+  ByteVector xiphCommentData;
+  long streamStart;
+  long streamLength;
+  bool scanned;
+
+  bool hasXiphComment;
+  int commentPacket;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::FLAC::File::File(FileName file, bool readProperties,
+                      Properties::ReadStyle propertiesStyle) : Ogg::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+Ogg::FLAC::File::~File()
+{
+  delete d;
+}
+
+Ogg::XiphComment *Ogg::FLAC::File::tag() const
+{
+  return d->comment;
+}
+
+Properties *Ogg::FLAC::File::audioProperties() const
+{
+  return d->properties;
+}
+
+
+bool Ogg::FLAC::File::save()
+{
+  d->xiphCommentData = d->comment->render();
+
+  // Create FLAC metadata-block:
+
+  // Put the size in the first 32 bit (I assume no more than 24 bit are used)
+
+  ByteVector v = ByteVector::fromUInt(d->xiphCommentData.size());
+
+  // Set the type of the metadata-block to be a Xiph / Vorbis comment
+
+  v[0] = 4;
+
+  // Append the comment-data after the 32 bit header
+
+  v.append(d->xiphCommentData);
+
+  // Save the packet at the old spot
+  // FIXME: Use padding if size is increasing
+
+  setPacket(d->commentPacket, v);
+
+  return Ogg::File::save();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Ogg::FLAC::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  // Sanity: Check if we really have an Ogg/FLAC file
+
+/*
+  ByteVector oggHeader = packet(0);
+
+  if (oggHeader.mid(28,4) != "fLaC") {
+    debug("Ogg::FLAC::File::read() -- Not an Ogg/FLAC file");
+    setValid(false);
+    return;
+  }*/
+
+  // Look for FLAC metadata, including vorbis comments
+
+  scan();
+
+  if (!d->scanned) {
+    setValid(false);
+    return;
+  }
+
+
+  if(d->hasXiphComment)
+    d->comment = new Ogg::XiphComment(xiphCommentData());
+  else
+    d->comment = new Ogg::XiphComment;
+
+
+  if(readProperties)
+    d->properties = new Properties(streamInfoData(), streamLength(), propertiesStyle);
+}
+
+ByteVector Ogg::FLAC::File::streamInfoData()
+{
+  scan();
+  return d->streamInfoData;
+}
+
+ByteVector Ogg::FLAC::File::xiphCommentData()
+{
+  scan();
+  return d->xiphCommentData;
+}
+
+long Ogg::FLAC::File::streamLength()
+{
+  scan();
+  return d->streamLength;
+}
+
+void Ogg::FLAC::File::scan()
+{
+  // Scan the metadata pages
+
+  if(d->scanned)
+    return;
+
+  if(!isValid())
+    return;
+
+  int ipacket = 0;
+  long overhead = 0;
+
+  ByteVector metadataHeader = packet(ipacket);
+  if(metadataHeader.isNull())
+    return;
+
+  ByteVector header;
+
+  if (!metadataHeader.startsWith("fLaC"))  {
+    // FLAC 1.1.2+
+    if (metadataHeader.mid(1,4) != "FLAC") return;
+
+    if (metadataHeader[5] != 1) return; // not version 1
+
+    metadataHeader = metadataHeader.mid(13);
+  }
+  else {
+    // FLAC 1.1.0 & 1.1.1
+    metadataHeader = packet(++ipacket);
+
+    if(metadataHeader.isNull())
+      return;
+
+  }
+
+  header = metadataHeader.mid(0,4);
+  // Header format (from spec):
+  // <1> Last-metadata-block flag
+  // <7> BLOCK_TYPE
+  //    0 : STREAMINFO
+  //    1 : PADDING
+  //    ..
+  //    4 : VORBIS_COMMENT
+  //    ..
+  // <24> Length of metadata to follow
+
+  char blockType = header[0] & 0x7f;
+  bool lastBlock = (header[0] & 0x80) != 0;
+  uint length = header.mid(1, 3).toUInt();
+  overhead += length;
+
+  // Sanity: First block should be the stream_info metadata
+
+  if(blockType != 0) {
+    debug("Ogg::FLAC::File::scan() -- Invalid Ogg/FLAC stream");
+    return;
+  }
+
+  d->streamInfoData = metadataHeader.mid(4,length);
+
+  // Search through the remaining metadata
+
+  while(!lastBlock) {
+    metadataHeader = packet(++ipacket);
+
+    if(metadataHeader.isNull())
+      return;
+
+    header = metadataHeader.mid(0, 4);
+    blockType = header[0] & 0x7f;
+    lastBlock = (header[0] & 0x80) != 0;
+    length = header.mid(1, 3).toUInt();
+    overhead += length;
+
+    if(blockType == 1) {
+      // debug("Ogg::FLAC::File::scan() -- Padding found");
+    }
+    else if(blockType == 4) {
+      // debug("Ogg::FLAC::File::scan() -- Vorbis-comments found");
+      d->xiphCommentData = metadataHeader.mid(4, length);
+      d->hasXiphComment = true;
+      d->commentPacket = ipacket;
+    }
+    else if(blockType > 5)
+      debug("Ogg::FLAC::File::scan() -- Unknown metadata block");
+
+  }
+
+  // End of metadata, now comes the datastream
+  d->streamStart = overhead;
+  d->streamLength = File::length() - d->streamStart;
+
+  d->scanned = true;
+}
diff --git a/lib-src/taglib/taglib/ogg/flac/oggflacfile.h b/lib-src/taglib/taglib/ogg/flac/oggflacfile.h
new file mode 100644
index 0000000..ab1e79d
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/flac/oggflacfile.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_OGGFLACFILE_H
+#define TAGLIB_OGGFLACFILE_H
+
+#include "taglib_export.h"
+#include "oggfile.h"
+#include "xiphcomment.h"
+
+#include "flacproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  namespace Ogg {
+
+  //! An implementation of Ogg FLAC metadata
+
+  /*!
+   * This is implementation of FLAC metadata for Ogg FLAC files.  For "pure"
+   * FLAC files look under the FLAC hiearchy.
+   *
+   * Unlike "pure" FLAC-files, Ogg FLAC only supports Xiph-comments,
+   * while the audio-properties are the same.
+   */
+  namespace FLAC {
+
+    using TagLib::FLAC::Properties;
+
+    //! An implementation of TagLib::File with Ogg/FLAC specific methods
+
+    /*!
+     * This implements and provides an interface for Ogg/FLAC files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to Ogg FLAC files.
+     */
+
+    class TAGLIB_EXPORT File : public Ogg::File
+    {
+    public:
+      /*!
+       * Contructs an Ogg/FLAC file from \a file.  If \a readProperties is true
+       * the file's audio properties will also be read using \a propertiesStyle.
+       * If false, \a propertiesStyle is ignored.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the Tag for this file.  This will always be a XiphComment.
+       */
+      virtual XiphComment *tag() const;
+
+      /*!
+       * Returns the FLAC::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Save the file.  This will primarily save and update the XiphComment.
+       * Returns true if the save is successful.
+       */
+      virtual bool save();
+
+      /*!
+       * Returns the length of the audio-stream, used by FLAC::Properties for
+       * calculating the bitrate.
+       */
+      long streamLength();
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      void scan();
+      ByteVector streamInfoData();
+      ByteVector xiphCommentData();
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  } // namespace FLAC
+  } // namespace Ogg
+} // namespace TagLib
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/oggfile.cpp b/lib-src/taglib/taglib/ogg/oggfile.cpp
new file mode 100644
index 0000000..ce5ac79
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggfile.cpp
@@ -0,0 +1,336 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevectorlist.h>
+#include <tmap.h>
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "oggfile.h"
+#include "oggpage.h"
+#include "oggpageheader.h"
+
+using namespace TagLib;
+
+class Ogg::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    streamSerialNumber(0),
+    firstPageHeader(0),
+    lastPageHeader(0),
+    currentPage(0),
+    currentPacketPage(0)
+  {
+    pages.setAutoDelete(true);
+  }
+
+  ~FilePrivate()
+  {
+    delete firstPageHeader;
+    delete lastPageHeader;
+  }
+
+  uint streamSerialNumber;
+  List<Page *> pages;
+  PageHeader *firstPageHeader;
+  PageHeader *lastPageHeader;
+  std::vector< List<int> > packetToPageMap;
+  Map<int, ByteVector> dirtyPackets;
+  List<int> dirtyPages;
+
+  //! The current page for the reader -- used by nextPage()
+  Page *currentPage;
+  //! The current page for the packet parser -- used by packet()
+  Page *currentPacketPage;
+  //! The packets for the currentPacketPage -- used by packet()
+  ByteVectorList currentPackets;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::File::~File()
+{
+  delete d;
+}
+
+ByteVector Ogg::File::packet(uint i)
+{
+  // Check to see if we're called setPacket() for this packet since the last
+  // save:
+
+  if(d->dirtyPackets.contains(i))
+    return d->dirtyPackets[i];
+
+  // If we haven't indexed the page where the packet we're interested in starts,
+  // begin reading pages until we have.
+
+  while(d->packetToPageMap.size() <= i) {
+    if(!nextPage()) {
+      debug("Ogg::File::packet() -- Could not find the requested packet.");
+      return ByteVector::null;
+    }
+  }
+
+  // Start reading at the first page that contains part (or all) of this packet.
+  // If the last read stopped at the packet that we're interested in, don't
+  // reread its packet list.  (This should make sequential packet reads fast.)
+
+  uint pageIndex = d->packetToPageMap[i].front();
+  if(d->currentPacketPage != d->pages[pageIndex]) {
+    d->currentPacketPage = d->pages[pageIndex];
+    d->currentPackets = d->currentPacketPage->packets();
+  }
+
+  // If the packet is completely contained in the first page that it's in, then
+  // just return it now.
+
+  if(d->currentPacketPage->containsPacket(i) & Page::CompletePacket)
+    return d->currentPackets[i - d->currentPacketPage->firstPacketIndex()];
+
+  // If the packet is *not* completely contained in the first page that it's a
+  // part of then that packet trails off the end of the page.  Continue appending
+  // the pages' packet data until we hit a page that either does not end with the
+  // packet that we're fetching or where the last packet is complete.
+
+  ByteVector packet = d->currentPackets.back();
+  while(d->currentPacketPage->containsPacket(i) & Page::EndsWithPacket &&
+        !d->currentPacketPage->header()->lastPacketCompleted())
+  {
+    pageIndex++;
+    if(pageIndex == d->pages.size()) {
+      if(!nextPage()) {
+        debug("Ogg::File::packet() -- Could not find the requested packet.");
+        return ByteVector::null;
+      }
+    }
+    d->currentPacketPage = d->pages[pageIndex];
+    d->currentPackets = d->currentPacketPage->packets();
+    packet.append(d->currentPackets.front());
+  }
+
+  return packet;
+}
+
+void Ogg::File::setPacket(uint i, const ByteVector &p)
+{
+  while(d->packetToPageMap.size() <= i) {
+    if(!nextPage()) {
+      debug("Ogg::File::setPacket() -- Could not set the requested packet.");
+      return;
+    }
+  }
+
+  List<int>::ConstIterator it = d->packetToPageMap[i].begin();
+  for(; it != d->packetToPageMap[i].end(); ++it)
+    d->dirtyPages.sortedInsert(*it, true);
+
+  d->dirtyPackets.insert(i, p);
+}
+
+const Ogg::PageHeader *Ogg::File::firstPageHeader()
+{
+  if(d->firstPageHeader)
+    return d->firstPageHeader->isValid() ? d->firstPageHeader : 0;
+
+  long firstPageHeaderOffset = find("OggS");
+
+  if(firstPageHeaderOffset < 0)
+    return 0;
+
+  d->firstPageHeader = new PageHeader(this, firstPageHeaderOffset);
+  return d->firstPageHeader->isValid() ? d->firstPageHeader : 0;
+}
+
+const Ogg::PageHeader *Ogg::File::lastPageHeader()
+{
+  if(d->lastPageHeader)
+    return d->lastPageHeader->isValid() ? d->lastPageHeader : 0;
+
+  long lastPageHeaderOffset = rfind("OggS");
+
+  if(lastPageHeaderOffset < 0)
+    return 0;
+
+  d->lastPageHeader = new PageHeader(this, lastPageHeaderOffset);
+  return d->lastPageHeader->isValid() ? d->lastPageHeader : 0;
+}
+
+bool Ogg::File::save()
+{
+  if(readOnly()) {
+    debug("Ogg::File::save() - Cannot save to a read only file.");
+    return false;
+  }
+
+  List<int> pageGroup;
+
+  for(List<int>::ConstIterator it = d->dirtyPages.begin(); it != d->dirtyPages.end(); ++it) {
+    if(!pageGroup.isEmpty() && pageGroup.back() + 1 != *it) {
+      writePageGroup(pageGroup);
+      pageGroup.clear();
+    }
+    else
+      pageGroup.append(*it);
+  }
+  writePageGroup(pageGroup);
+  d->dirtyPages.clear();
+  d->dirtyPackets.clear();
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::File::File(FileName file) : TagLib::File(file)
+{
+  d = new FilePrivate;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+bool Ogg::File::nextPage()
+{
+  long nextPageOffset;
+  int currentPacket;
+
+  if(d->pages.isEmpty()) {
+    currentPacket = 0;
+    nextPageOffset = find("OggS");
+    if(nextPageOffset < 0)
+      return false;
+  }
+  else {
+    if(d->currentPage->header()->lastPageOfStream())
+      return false;
+
+    if(d->currentPage->header()->lastPacketCompleted())
+      currentPacket = d->currentPage->firstPacketIndex() + d->currentPage->packetCount();
+    else
+      currentPacket = d->currentPage->firstPacketIndex() + d->currentPage->packetCount() - 1;
+
+    nextPageOffset = d->currentPage->fileOffset() + d->currentPage->size();
+  }
+
+  // Read the next page and add it to the page list.
+
+  d->currentPage = new Page(this, nextPageOffset);
+
+  if(!d->currentPage->header()->isValid()) {
+    delete d->currentPage;
+    d->currentPage = 0;
+    return false;
+  }
+
+  d->currentPage->setFirstPacketIndex(currentPacket);
+
+  if(d->pages.isEmpty())
+    d->streamSerialNumber = d->currentPage->header()->streamSerialNumber();
+
+  d->pages.append(d->currentPage);
+
+  // Loop through the packets in the page that we just read appending the
+  // current page number to the packet to page map for each packet.
+
+  for(uint i = 0; i < d->currentPage->packetCount(); i++) {
+    uint currentPacket = d->currentPage->firstPacketIndex() + i;
+    if(d->packetToPageMap.size() <= currentPacket)
+      d->packetToPageMap.push_back(List<int>());
+    d->packetToPageMap[currentPacket].append(d->pages.size() - 1);
+  }
+
+  return true;
+}
+
+void Ogg::File::writePageGroup(const List<int> &pageGroup)
+{
+  if(pageGroup.isEmpty())
+    return;
+
+  ByteVectorList packets;
+
+  // If the first page of the group isn't dirty, append its partial content here.
+
+  if(!d->dirtyPages.contains(d->pages[pageGroup.front()]->firstPacketIndex()))
+    packets.append(d->pages[pageGroup.front()]->packets().front());
+
+  int previousPacket = -1;
+  int originalSize = 0;
+
+  for(List<int>::ConstIterator it = pageGroup.begin(); it != pageGroup.end(); ++it) {
+    uint firstPacket = d->pages[*it]->firstPacketIndex();
+    uint lastPacket = firstPacket + d->pages[*it]->packetCount() - 1;
+
+    List<int>::ConstIterator last = --pageGroup.end();
+
+    for(uint i = firstPacket; i <= lastPacket; i++) {
+
+      if(it == last && i == lastPacket && !d->dirtyPages.contains(i))
+        packets.append(d->pages[*it]->packets().back());
+      else if(int(i) != previousPacket) {
+        previousPacket = i;
+        packets.append(packet(i));
+      }
+    }
+    originalSize += d->pages[*it]->size();
+  }
+
+  const bool continued = d->pages[pageGroup.front()]->header()->firstPacketContinued();
+  const bool completed = d->pages[pageGroup.back()]->header()->lastPacketCompleted();
+
+  // TODO: This pagination method isn't accurate for what's being done here.
+  // This should account for real possibilities like non-aligned packets and such.
+
+  List<Page *> pages = Page::paginate(packets, Page::SinglePagePerGroup,
+                                      d->streamSerialNumber, pageGroup.front(),
+                                      continued, completed);
+
+  ByteVector data;
+  for(List<Page *>::ConstIterator it = pages.begin(); it != pages.end(); ++it)
+    data.append((*it)->render());
+
+  // The insertion algorithms could also be improve to queue and prioritize data
+  // on the way out.  Currently it requires rewriting the file for every page
+  // group rather than just once; however, for tagging applications there will
+  // generally only be one page group, so it's not worth the time for the
+  // optimization at the moment.
+
+  insert(data, d->pages[pageGroup.front()]->fileOffset(), originalSize);
+
+  // Update the page index to include the pages we just created and to delete the
+  // old pages.
+
+  for(List<Page *>::ConstIterator it = pages.begin(); it != pages.end(); ++it) {
+    const int index = (*it)->header()->pageSequenceNumber();
+    delete d->pages[index];
+    d->pages[index] = *it;
+  }
+}
diff --git a/lib-src/taglib/taglib/ogg/oggfile.h b/lib-src/taglib/taglib/ogg/oggfile.h
new file mode 100644
index 0000000..e5535f6
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggfile.h
@@ -0,0 +1,112 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "taglib_export.h"
+#include "tfile.h"
+#include "tbytevectorlist.h"
+
+#ifndef TAGLIB_OGGFILE_H
+#define TAGLIB_OGGFILE_H
+
+namespace TagLib {
+
+  //! A namespace for the classes used by Ogg-based metadata files
+
+  namespace Ogg {
+
+    class PageHeader;
+
+    //! An implementation of TagLib::File with some helpers for Ogg based formats
+
+    /*!
+     * This is an implementation of Ogg file page and packet rendering and is of
+     * use to Ogg based formats.  While the API is small this handles the
+     * non-trivial details of breaking up an Ogg stream into packets and makes
+     * these available (via subclassing) to the codec meta data implementations.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      virtual ~File();
+
+      /*!
+       * Returns the packet contents for the i-th packet (starting from zero)
+       * in the Ogg bitstream.
+       *
+       * \warning The requires reading at least the packet header for every page
+       * up to the requested page.
+       */
+      ByteVector packet(uint i);
+
+      /*!
+       * Sets the packet with index \a i to the value \a p.
+       */
+      void setPacket(uint i, const ByteVector &p);
+
+      /*!
+       * Returns a pointer to the PageHeader for the first page in the stream or
+       * null if the page could not be found.
+       */
+      const PageHeader *firstPageHeader();
+
+      /*!
+       * Returns a pointer to the PageHeader for the last page in the stream or
+       * null if the page could not be found.
+       */
+      const PageHeader *lastPageHeader();
+
+      virtual bool save();
+
+    protected:
+      /*!
+       * Contructs an Ogg file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * \note This constructor is protected since Ogg::File shouldn't be
+       * instantiated directly but rather should be used through the codec
+       * specific subclasses.
+       */
+      File(FileName file);
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      /*!
+       * Reads the next page and updates the internal "current page" pointer.
+       */
+      bool nextPage();
+      void writePageGroup(const List<int> &group);
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/oggpage.cpp b/lib-src/taglib/taglib/ogg/oggpage.cpp
new file mode 100644
index 0000000..0b82828
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggpage.cpp
@@ -0,0 +1,256 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "oggpage.h"
+#include "oggpageheader.h"
+#include "oggfile.h"
+
+using namespace TagLib;
+
+class Ogg::Page::PagePrivate
+{
+public:
+  PagePrivate(File *f = 0, long pageOffset = -1) :
+    file(f),
+    fileOffset(pageOffset),
+    packetOffset(0),
+    header(f, pageOffset),
+    firstPacketIndex(-1)
+  {
+    if(file) {
+      packetOffset = fileOffset + header.size();
+      packetSizes = header.packetSizes();
+      dataSize = header.dataSize();
+    }
+  }
+
+  File *file;
+  long fileOffset;
+  long packetOffset;
+  int dataSize;
+  List<int> packetSizes;
+  PageHeader header;
+  int firstPacketIndex;
+  ByteVectorList packets;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::Page::Page(Ogg::File *file, long pageOffset)
+{
+  d = new PagePrivate(file, pageOffset);
+}
+
+Ogg::Page::~Page()
+{
+  delete d;
+}
+
+long Ogg::Page::fileOffset() const
+{
+  return d->fileOffset;
+}
+
+const Ogg::PageHeader *Ogg::Page::header() const
+{
+  return &d->header;
+}
+
+int Ogg::Page::firstPacketIndex() const
+{
+  return d->firstPacketIndex;
+}
+
+void Ogg::Page::setFirstPacketIndex(int index)
+{
+  d->firstPacketIndex = index;
+}
+
+Ogg::Page::ContainsPacketFlags Ogg::Page::containsPacket(int index) const
+{
+  int lastPacketIndex = d->firstPacketIndex + packetCount() - 1;
+  if(index < d->firstPacketIndex || index > lastPacketIndex)
+    return DoesNotContainPacket;
+
+  ContainsPacketFlags flags = DoesNotContainPacket;
+
+  if(index == d->firstPacketIndex)
+    flags = ContainsPacketFlags(flags | BeginsWithPacket);
+
+  if(index == lastPacketIndex)
+    flags = ContainsPacketFlags(flags | EndsWithPacket);
+
+  // If there's only one page and it's complete:
+
+  if(packetCount() == 1 &&
+     !d->header.firstPacketContinued() &&
+     d->header.lastPacketCompleted())
+  {
+    flags = ContainsPacketFlags(flags | CompletePacket);
+  }
+
+  // Or if the page is (a) the first page and it's complete or (b) the last page
+  // and it's complete or (c) a page in the middle.
+
+  else if((flags & BeginsWithPacket && !d->header.firstPacketContinued()) ||
+          (flags & EndsWithPacket && d->header.lastPacketCompleted()) ||
+          (!(flags & BeginsWithPacket) && !(flags & EndsWithPacket)))
+  {
+    flags = ContainsPacketFlags(flags | CompletePacket);
+  }
+
+  return flags;
+}
+
+TagLib::uint Ogg::Page::packetCount() const
+{
+  return d->header.packetSizes().size();
+}
+
+ByteVectorList Ogg::Page::packets() const
+{
+  if(!d->packets.isEmpty())
+    return d->packets;
+
+  ByteVectorList l;
+
+  if(d->file && d->header.isValid()) {
+
+    d->file->seek(d->packetOffset);
+
+    List<int> packetSizes = d->header.packetSizes();
+
+    List<int>::ConstIterator it = packetSizes.begin();
+    for(; it != packetSizes.end(); ++it)
+      l.append(d->file->readBlock(*it));
+  }
+  else
+    debug("Ogg::Page::packets() -- attempting to read packets from an invalid page.");
+
+  return l;
+}
+
+int Ogg::Page::size() const
+{
+  return d->header.size() + d->header.dataSize();
+}
+
+ByteVector Ogg::Page::render() const
+{
+  ByteVector data;
+
+  data.append(d->header.render());
+
+  if(d->packets.isEmpty()) {
+    if(d->file) {
+      d->file->seek(d->packetOffset);
+      data.append(d->file->readBlock(d->dataSize));
+    }
+    else
+      debug("Ogg::Page::render() -- this page is empty!");
+  }
+  else {
+    ByteVectorList::ConstIterator it = d->packets.begin();
+    for(; it != d->packets.end(); ++it)
+      data.append(*it);
+  }
+
+  // Compute and set the checksum for the Ogg page.  The checksum is taken over
+  // the entire page with the 4 bytes reserved for the checksum zeroed and then
+  // inserted in bytes 22-25 of the page header.
+
+  ByteVector checksum = ByteVector::fromUInt(data.checksum(), false);
+  for(int i = 0; i < 4; i++)
+    data[i + 22] = checksum[i];
+
+  return data;
+}
+
+List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets,
+                                      PaginationStrategy strategy,
+                                      uint streamSerialNumber,
+                                      int firstPage,
+                                      bool firstPacketContinued,
+                                      bool lastPacketCompleted,
+                                      bool containsLastPacket)
+{
+  List<Page *> l;
+
+  int totalSize = 0;
+
+  for(ByteVectorList::ConstIterator it = packets.begin(); it != packets.end(); ++it)
+    totalSize += (*it).size();
+
+  if(strategy == Repaginate || totalSize + packets.size() > 255 * 256) {
+    debug("Ogg::Page::paginate() -- Sorry!  Repagination is not yet implemented.");
+    return l;
+  }
+
+  // TODO: Handle creation of multiple pages here with appropriate pagination.
+
+  Page *p = new Page(packets, streamSerialNumber, firstPage, firstPacketContinued,
+                     lastPacketCompleted, containsLastPacket);
+  l.append(p);
+
+  return l;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::Page::Page(const ByteVectorList &packets,
+                uint streamSerialNumber,
+                int pageNumber,
+                bool firstPacketContinued,
+                bool lastPacketCompleted,
+                bool containsLastPacket)
+{
+  d = new PagePrivate;
+
+  ByteVector data;
+  List<int> packetSizes;
+
+  d->header.setFirstPageOfStream(pageNumber == 0 && !firstPacketContinued);
+  d->header.setLastPageOfStream(containsLastPacket);
+  d->header.setFirstPacketContinued(firstPacketContinued);
+  d->header.setLastPacketCompleted(lastPacketCompleted);
+  d->header.setStreamSerialNumber(streamSerialNumber);
+  d->header.setPageSequenceNumber(pageNumber);
+
+  // Build a page from the list of packets.
+
+  for(ByteVectorList::ConstIterator it = packets.begin(); it != packets.end(); ++it) {
+    packetSizes.append((*it).size());
+    data.append(*it);
+  }
+  d->packets = packets;
+  d->header.setPacketSizes(packetSizes);
+}
diff --git a/lib-src/taglib/taglib/ogg/oggpage.h b/lib-src/taglib/taglib/ogg/oggpage.h
new file mode 100644
index 0000000..fbe0ebc
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggpage.h
@@ -0,0 +1,203 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_OGGPAGE_H
+#define TAGLIB_OGGPAGE_H
+
+#include "taglib_export.h"
+#include "tbytevectorlist.h"
+
+namespace TagLib {
+
+  namespace Ogg {
+
+    class File;
+    class PageHeader;
+
+    //! An implementation of Ogg pages
+
+    /*!
+     * This is an implementation of the pages that make up an Ogg stream.
+     * This handles parsing pages and breaking them down into packets and handles
+     * the details of packets spanning multiple pages and pages that contiain
+     * multiple packets.
+     *
+     * In most Xiph.org formats the comments are found in the first few packets,
+     * this however is a reasonably complete implementation of Ogg pages that
+     * could potentially be useful for non-meta data purposes.
+     */
+
+    class TAGLIB_EXPORT Page
+    {
+    public:
+      /*!
+       * Read an Ogg page from the \a file at the position \a pageOffset.
+       */
+      Page(File *file, long pageOffset);
+
+      virtual ~Page();
+
+      /*!
+       * Returns the page's position within the file (in bytes).
+       */
+      long fileOffset() const;
+
+      /*!
+       * Returns a pointer to the header for this page.  This pointer will become
+       * invalid when the page is deleted.
+       */
+      const PageHeader *header() const;
+
+      /*!
+       * Returns the index of the first packet wholly or partially contained in
+       * this page.
+       *
+       * \see setFirstPacketIndex()
+       */
+      int firstPacketIndex() const;
+
+      /*!
+       * Sets the index of the first packet in the page.
+       *
+       * \see firstPacketIndex()
+       */
+      void setFirstPacketIndex(int index);
+
+      /*!
+       * When checking to see if a page contains a given packet this set of flags
+       * represents the possible values for that packets status in the page.
+       *
+       * \see containsPacket()
+       */
+      enum ContainsPacketFlags {
+        //! No part of the packet is contained in the page
+        DoesNotContainPacket = 0x0000,
+        //! The packet is wholly contained in the page
+        CompletePacket       = 0x0001,
+        //! The page starts with the given packet
+        BeginsWithPacket     = 0x0002,
+        //! The page ends with the given packet
+        EndsWithPacket       = 0x0004
+      };
+
+      /*!
+       * Checks to see if the specified \a packet is contained in the current
+       * page.
+       *
+       * \see ContainsPacketFlags
+       */
+      ContainsPacketFlags containsPacket(int index) const;
+
+      /*!
+       * Returns the number of packets (whole or partial) in this page.
+       */
+      uint packetCount() const;
+
+      /*!
+       * Returns a list of the packets in this page.
+       *
+       * \note Either or both the first and last packets may be only partial.
+       * \see PageHeader::firstPacketContinued()
+       */
+      ByteVectorList packets() const;
+
+      /*!
+       * Returns the size of the page in bytes.
+       */
+      int size() const;
+
+      ByteVector render() const;
+
+      /*!
+       * Defines a strategy for pagination, or grouping pages into Ogg packets,
+       * for use with pagination methods.
+       *
+       * \note Yes, I'm aware that this is not a canonical "Strategy Pattern",
+       * the term was simply convenient.
+       */
+      enum PaginationStrategy {
+        /*!
+         * Attempt to put the specified set of packets into a single Ogg packet.
+         * If the sum of the packet data is greater than will fit into a single
+         * Ogg page -- 65280 bytes -- this will fall back to repagination using
+         * the recommended page sizes.
+         */
+        SinglePagePerGroup,
+        /*!
+         * Split the packet or group of packets into pages that conform to the
+         * sizes recommended in the Ogg standard.
+         */
+        Repaginate
+      };
+
+      /*!
+       * Pack \a packets into Ogg pages using the \a strategy for pagination.
+       * The page number indicater inside of the rendered packets will start
+       * with \a firstPage and be incremented for each page rendered.
+       * \a containsLastPacket should be set to true if \a packets contains the
+       * last page in the stream and will set the appropriate flag in the last
+       * rendered Ogg page's header.  \a streamSerialNumber should be set to
+       * the serial number for this stream.
+       *
+       * \note The "absolute granule position" is currently always zeroed using
+       * this method as this suffices for the comment headers.
+       *
+       * \warning The pages returned by this method must be deleted by the user.
+       * You can use List<T>::setAutoDelete(true) to set these pages to be
+       * automatically deleted when this list passes out of scope.
+       *
+       * \see PaginationStrategy
+       * \see List::setAutoDelete()
+       */
+      static List<Page *> paginate(const ByteVectorList &packets,
+                                   PaginationStrategy strategy,
+                                   uint streamSerialNumber,
+                                   int firstPage,
+                                   bool firstPacketContinued = false,
+                                   bool lastPacketCompleted = true,
+                                   bool containsLastPacket = false);
+
+    protected:
+      /*!
+       * Creates an Ogg packet based on the data in \a packets.  The page number
+       * for each page will be set to \a pageNumber.
+       */
+      Page(const ByteVectorList &packets,
+           uint streamSerialNumber,
+           int pageNumber,
+           bool firstPacketContinued = false,
+           bool lastPacketCompleted = true,
+           bool containsLastPacket = false);
+
+    private:
+      Page(const Page &);
+      Page &operator=(const Page &);
+
+      class PagePrivate;
+      PagePrivate *d;
+    };
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/ogg/oggpageheader.cpp b/lib-src/taglib/taglib/ogg/oggpageheader.cpp
new file mode 100644
index 0000000..5f86fcb
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggpageheader.cpp
@@ -0,0 +1,323 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <stdlib.h>
+
+#include <bitset>
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <taglib.h>
+
+#include "oggpageheader.h"
+#include "oggfile.h"
+
+using namespace TagLib;
+
+class Ogg::PageHeader::PageHeaderPrivate
+{
+public:
+  PageHeaderPrivate(File *f, long pageOffset) :
+    file(f),
+    fileOffset(pageOffset),
+    isValid(false),
+    firstPacketContinued(false),
+    lastPacketCompleted(false),
+    firstPageOfStream(false),
+    lastPageOfStream(false),
+    absoluteGranularPosition(0),
+    streamSerialNumber(0),
+    pageSequenceNumber(-1),
+    size(0),
+    dataSize(0)
+    {}
+
+  File *file;
+  long fileOffset;
+  bool isValid;
+  List<int> packetSizes;
+  bool firstPacketContinued;
+  bool lastPacketCompleted;
+  bool firstPageOfStream;
+  bool lastPageOfStream;
+  long long absoluteGranularPosition;
+  uint streamSerialNumber;
+  int pageSequenceNumber;
+  int size;
+  int dataSize;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::PageHeader::PageHeader(Ogg::File *file, long pageOffset)
+{
+  d = new PageHeaderPrivate(file, pageOffset);
+  if(file && pageOffset >= 0)
+      read();
+}
+
+Ogg::PageHeader::~PageHeader()
+{
+  delete d;
+}
+
+bool Ogg::PageHeader::isValid() const
+{
+  return d->isValid;
+}
+
+List<int> Ogg::PageHeader::packetSizes() const
+{
+  return d->packetSizes;
+}
+
+void Ogg::PageHeader::setPacketSizes(const List<int> &sizes)
+{
+  d->packetSizes = sizes;
+}
+
+bool Ogg::PageHeader::firstPacketContinued() const
+{
+  return d->firstPacketContinued;
+}
+
+void Ogg::PageHeader::setFirstPacketContinued(bool continued)
+{
+  d->firstPacketContinued = continued;
+}
+
+bool Ogg::PageHeader::lastPacketCompleted() const
+{
+  return d->lastPacketCompleted;
+}
+
+void Ogg::PageHeader::setLastPacketCompleted(bool completed)
+{
+  d->lastPacketCompleted = completed;
+}
+
+bool Ogg::PageHeader::firstPageOfStream() const
+{
+  return d->firstPageOfStream;
+}
+
+void Ogg::PageHeader::setFirstPageOfStream(bool first)
+{
+  d->firstPageOfStream = first;
+}
+
+bool Ogg::PageHeader::lastPageOfStream() const
+{
+  return d->lastPageOfStream;
+}
+
+void Ogg::PageHeader::setLastPageOfStream(bool last)
+{
+  d->lastPageOfStream = last;
+}
+
+long long Ogg::PageHeader::absoluteGranularPosition() const
+{
+  return d->absoluteGranularPosition;
+}
+
+void Ogg::PageHeader::setAbsoluteGranularPosition(long long agp)
+{
+  d->absoluteGranularPosition = agp;
+}
+
+int Ogg::PageHeader::pageSequenceNumber() const
+{
+  return d->pageSequenceNumber;
+}
+
+void Ogg::PageHeader::setPageSequenceNumber(int sequenceNumber)
+{
+  d->pageSequenceNumber = sequenceNumber;
+}
+
+TagLib::uint Ogg::PageHeader::streamSerialNumber() const
+{
+  return d->streamSerialNumber;
+}
+
+void Ogg::PageHeader::setStreamSerialNumber(uint n)
+{
+  d->streamSerialNumber = n;
+}
+
+int Ogg::PageHeader::size() const
+{
+  return d->size;
+}
+
+int Ogg::PageHeader::dataSize() const
+{
+  return d->dataSize;
+}
+
+ByteVector Ogg::PageHeader::render() const
+{
+  ByteVector data;
+
+  // capture patern
+
+  data.append("OggS");
+
+  // stream structure version
+
+  data.append(char(0));
+
+  // header type flag
+
+  std::bitset<8> flags;
+  flags[0] = d->firstPacketContinued;
+  flags[1] = d->pageSequenceNumber == 0;
+  flags[2] = d->lastPageOfStream;
+
+  data.append(char(flags.to_ulong()));
+
+  // absolute granular position
+
+  data.append(ByteVector::fromLongLong(d->absoluteGranularPosition, false));
+
+  // stream serial number
+
+  data.append(ByteVector::fromUInt(d->streamSerialNumber, false));
+
+  // page sequence number
+
+  data.append(ByteVector::fromUInt(d->pageSequenceNumber, false));
+
+  // checksum -- this is left empty and should be filled in by the Ogg::Page
+  // class
+
+  data.append(ByteVector(4, 0));
+
+  // page segment count and page segment table
+
+  ByteVector pageSegments = lacingValues();
+
+  data.append(char(uchar(pageSegments.size())));
+  data.append(pageSegments);
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Ogg::PageHeader::read()
+{
+  d->file->seek(d->fileOffset);
+
+  // An Ogg page header is at least 27 bytes, so we'll go ahead and read that
+  // much and then get the rest when we're ready for it.
+
+  ByteVector data = d->file->readBlock(27);
+
+  // Sanity check -- make sure that we were in fact able to read as much data as
+  // we asked for and that the page begins with "OggS".
+
+  if(data.size() != 27 || !data.startsWith("OggS")) {
+    debug("Ogg::PageHeader::read() -- error reading page header");
+    return;
+  }
+
+  std::bitset<8> flags(data[5]);
+
+  d->firstPacketContinued = flags.test(0);
+  d->firstPageOfStream = flags.test(1);
+  d->lastPageOfStream = flags.test(2);
+
+  d->absoluteGranularPosition = data.mid(6, 8).toLongLong(false);
+  d->streamSerialNumber = data.mid(14, 4).toUInt(false);
+  d->pageSequenceNumber = data.mid(18, 4).toUInt(false);
+
+  // Byte number 27 is the number of page segments, which is the only variable
+  // length portion of the page header.  After reading the number of page
+  // segments we'll then read in the corresponding data for this count.
+
+  int pageSegmentCount = uchar(data[26]);
+
+  ByteVector pageSegments = d->file->readBlock(pageSegmentCount);
+
+  // Another sanity check.
+
+  if(pageSegmentCount < 1 || int(pageSegments.size()) != pageSegmentCount)
+    return;
+
+  // The base size of an Ogg page 27 bytes plus the number of lacing values.
+
+  d->size = 27 + pageSegmentCount;
+
+  int packetSize = 0;
+
+  for(int i = 0; i < pageSegmentCount; i++) {
+    d->dataSize += uchar(pageSegments[i]);
+    packetSize += uchar(pageSegments[i]);
+
+    if(uchar(pageSegments[i]) < 255) {
+      d->packetSizes.append(packetSize);
+      packetSize = 0;
+    }
+  }
+
+  if(packetSize > 0) {
+    d->packetSizes.append(packetSize);
+    d->lastPacketCompleted = false;
+  }
+  else
+    d->lastPacketCompleted = true;
+
+  d->isValid = true;
+}
+
+ByteVector Ogg::PageHeader::lacingValues() const
+{
+  ByteVector data;
+
+  List<int> sizes = d->packetSizes;
+  for(List<int>::ConstIterator it = sizes.begin(); it != sizes.end(); ++it) {
+
+    // The size of a packet in an Ogg page is indicated by a series of "lacing
+    // values" where the sum of the values is the packet size in bytes.  Each of
+    // these values is a byte.  A value of less than 255 (0xff) indicates the end
+    // of the packet.
+
+    div_t n = div(*it, 255);
+
+    for(int i = 0; i < n.quot; i++)
+      data.append(char(uchar(255)));
+
+    if(it != --sizes.end() || d->lastPacketCompleted)
+      data.append(char(uchar(n.rem)));
+  }
+
+  return data;
+}
diff --git a/lib-src/taglib/taglib/ogg/oggpageheader.h b/lib-src/taglib/taglib/ogg/oggpageheader.h
new file mode 100644
index 0000000..4c683fe
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/oggpageheader.h
@@ -0,0 +1,232 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_OGGPAGEHEADER_H
+#define TAGLIB_OGGPAGEHEADER_H
+
+#include "tlist.h"
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace Ogg {
+
+    class File;
+
+    //! An implementation of the page headers associated with each Ogg::Page
+
+    /*!
+     * This class implements Ogg page headers which contain the information
+     * about Ogg pages needed to break them into packets which can be passed on
+     * to the codecs.
+     */
+
+    class TAGLIB_EXPORT PageHeader
+    {
+    public:
+      /*!
+       * Reads a PageHeader from \a file starting at \a pageOffset.  The defaults
+       * create a page with no (and as such, invalid) data that must be set
+       * later.
+       */
+      PageHeader(File *file = 0, long pageOffset = -1);
+
+      /*!
+       * Deletes this instance of the PageHeader.
+       */
+      virtual ~PageHeader();
+
+      /*!
+       * Returns true if the header parsed properly and is valid.
+       */
+      bool isValid() const;
+
+      /*!
+       * Ogg pages contain a list of packets (which are used by the contained
+       * codecs).  The sizes of these pages is encoded in the page header.  This
+       * returns a list of the packet sizes in bytes.
+       *
+       * \see setPacketSizes()
+       */
+      List<int> packetSizes() const;
+
+      /*!
+       * Sets the sizes of the packets in this page to \a sizes.  Internally this
+       * updates the lacing values in the header.
+       *
+       * \see packetSizes()
+       */
+      void setPacketSizes(const List<int> &sizes);
+
+      /*!
+       * Some packets can be <i>continued</i> across multiple pages.  If the
+       * first packet in the current page is a continuation this will return
+       * true.  If this is page starts with a new packet this will return false.
+       *
+       * \see lastPacketCompleted()
+       * \see setFirstPacketContinued()
+       */
+      bool firstPacketContinued() const;
+
+      /*!
+       * Sets the internal flag indicating if the first packet in this page is
+       * continued to \a continued.
+       *
+       * \see firstPacketContinued()
+       */
+      void setFirstPacketContinued(bool continued);
+
+      /*!
+       * Returns true if the last packet of this page is completely contained in
+       * this page.
+       *
+       * \see firstPacketContinued()
+       * \see setLastPacketCompleted()
+       */
+      bool lastPacketCompleted() const;
+
+      /*!
+       * Sets the internal flag indicating if the last packet in this page is
+       * complete to \a completed.
+       *
+       * \see lastPacketCompleted()
+       */
+      void setLastPacketCompleted(bool completed);
+
+      /*!
+       * This returns true if this is the first page of the Ogg (logical) stream.
+       *
+       * \see setFirstPageOfStream()
+       */
+      bool firstPageOfStream() const;
+
+      /*!
+       * Marks this page as the first page of the Ogg stream.
+       *
+       * \see firstPageOfStream()
+       */
+      void setFirstPageOfStream(bool first);
+
+      /*!
+       * This returns true if this is the last page of the Ogg (logical) stream.
+       *
+       * \see setLastPageOfStream()
+       */
+      bool lastPageOfStream() const;
+
+      /*!
+       * Marks this page as the last page of the Ogg stream.
+       *
+       * \see lastPageOfStream()
+       */
+      void setLastPageOfStream(bool last);
+
+      /*!
+       * A special value of containing the position of the packet to be
+       * interpreted by the codec.  In the case of Vorbis this contains the PCM
+       * value and is used to calculate the length of the stream.
+       *
+       * \see setAbsoluteGranularPosition()
+       */
+      long long absoluteGranularPosition() const;
+
+      /*!
+       * A special value of containing the position of the packet to be
+       * interpreted by the codec.  It is only supported here so that it may be
+       * coppied from one page to another.
+       *
+       * \see absoluteGranularPosition()
+       */
+      void setAbsoluteGranularPosition(long long agp);
+
+      /*!
+       * Every Ogg logical stream is given a random serial number which is common
+       * to every page in that logical stream.  This returns the serial number of
+       * the stream associated with this packet.
+       *
+       * \see setStreamSerialNumber()
+       */
+      uint streamSerialNumber() const;
+
+      /*!
+       * Every Ogg logical stream is given a random serial number which is common
+       * to every page in that logical stream.  This sets this pages serial
+       * number.  This method should be used when adding new pages to a logical
+       * stream.
+       *
+       * \see streamSerialNumber()
+       */
+      void setStreamSerialNumber(uint n);
+
+      /*!
+       * Returns the index of the page within the Ogg stream.  This helps make it
+       * possible to determine if pages have been lost.
+       *
+       * \see setPageSequenceNumber()
+       */
+      int pageSequenceNumber() const;
+
+      /*!
+       * Sets the page's position in the stream to \a sequenceNumber.
+       *
+       * \see pageSequenceNumber()
+       */
+      void setPageSequenceNumber(int sequenceNumber);
+
+      /*!
+       * Returns the complete header size.
+       */
+      int size() const;
+
+      /*!
+       * Returns the size of the data portion of the page -- i.e. the size of the
+       * page less the header size.
+       */
+      int dataSize() const;
+
+      /*!
+       * Render the page header to binary data.
+       *
+       * \note The checksum -- bytes 22 - 25 -- will be left empty and must be
+       * filled in when rendering the entire page.
+       */
+      ByteVector render() const;
+
+    private:
+      PageHeader(const PageHeader &);
+      PageHeader &operator=(const PageHeader &);
+
+      void read();
+      ByteVector lacingValues() const;
+
+      class PageHeaderPrivate;
+      PageHeaderPrivate *d;
+    };
+
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/speex/.deps/speexfile.Plo b/lib-src/taglib/taglib/ogg/speex/.deps/speexfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/.deps/speexfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/speex/.deps/speexproperties.Plo b/lib-src/taglib/taglib/ogg/speex/.deps/speexproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/.deps/speexproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/speex/CMakeLists.txt b/lib-src/taglib/taglib/ogg/speex/CMakeLists.txt
new file mode 100644
index 0000000..7f35b71
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  speexfile.h speexproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/ogg/speex/Makefile.am b/lib-src/taglib/taglib/ogg/speex/Makefile.am
new file mode 100644
index 0000000..ef95d5b
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libspeex.la
+
+libspeex_la_SOURCES = speexfile.cpp speexproperties.cpp
+
+taglib_include_HEADERS = speexfile.h speexproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/ogg/speex/Makefile.in b/lib-src/taglib/taglib/ogg/speex/Makefile.in
new file mode 100644
index 0000000..d8aaee6
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/Makefile.in
@@ -0,0 +1,623 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/ogg/speex
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libspeex_la_LIBADD =
+am_libspeex_la_OBJECTS = speexfile.lo speexproperties.lo
+#>- libspeex_la_OBJECTS = $(am_libspeex_la_OBJECTS)
+#>+ 4
+libspeex_la_final_OBJECTS = libspeex_la.all_cpp.lo 
+libspeex_la_nofinal_OBJECTS = speexfile.lo speexproperties.lo
+ at KDE_USE_FINAL_FALSE@libspeex_la_OBJECTS = $(libspeex_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libspeex_la_OBJECTS = $(libspeex_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libspeex_la_SOURCES)
+DIST_SOURCES = $(libspeex_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libspeex.la
+libspeex_la_SOURCES = speexfile.cpp speexproperties.cpp
+taglib_include_HEADERS = speexfile.h speexproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/speex/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libspeex.la: $(libspeex_la_OBJECTS) $(libspeex_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libspeex_la_OBJECTS) $(libspeex_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/speexfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/speexproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/speex/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/speex/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libspeex_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/speexfile.cpp $(srcdir)/speexproperties.cpp 
+	@echo 'creating libspeex_la.all_cpp.cpp ...'; \
+	rm -f libspeex_la.all_cpp.files libspeex_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libspeex_la.all_cpp.final; \
+	for file in speexfile.cpp speexproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libspeex_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libspeex_la.all_cpp.final; \
+	done; \
+	cat libspeex_la.all_cpp.final libspeex_la.all_cpp.files > libspeex_la.all_cpp.cpp; \
+	rm -f libspeex_la.all_cpp.final libspeex_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libspeex_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libspeex_la_OBJECTS="$(libspeex_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libspeex_la_OBJECTS="$(libspeex_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libspeex_la_OBJECTS="$(libspeex_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libspeex_la_OBJECTS="$(libspeex_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ogg/speex/speexfile.cpp b/lib-src/taglib/taglib/ogg/speex/speexfile.cpp
new file mode 100644
index 0000000..a1391b8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/speexfile.cpp
@@ -0,0 +1,112 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+                           (original Vorbis implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <bitset>
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "speexfile.h"
+
+using namespace TagLib;
+using namespace TagLib::Ogg;
+
+class Speex::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    comment(0),
+    properties(0) {}
+
+  ~FilePrivate()
+  {
+    delete comment;
+    delete properties;
+  }
+
+  Ogg::XiphComment *comment;
+  Properties *properties;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Speex::File::File(FileName file, bool readProperties,
+                   Properties::ReadStyle propertiesStyle) : Ogg::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+Speex::File::~File()
+{
+  delete d;
+}
+
+Ogg::XiphComment *Speex::File::tag() const
+{
+  return d->comment;
+}
+
+Speex::Properties *Speex::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool Speex::File::save()
+{
+  if(!d->comment)
+    d->comment = new Ogg::XiphComment;
+
+  setPacket(1, d->comment->render());
+
+  return Ogg::File::save();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Speex::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  ByteVector speexHeaderData = packet(0);
+
+  if(!speexHeaderData.startsWith("Speex   ")) {
+    debug("Speex::File::read() -- invalid Speex identification header");
+    return;
+  }
+
+  ByteVector commentHeaderData = packet(1);
+
+  d->comment = new Ogg::XiphComment(commentHeaderData);
+
+  if(readProperties)
+    d->properties = new Properties(this, propertiesStyle);
+}
diff --git a/lib-src/taglib/taglib/ogg/speex/speexfile.h b/lib-src/taglib/taglib/ogg/speex/speexfile.h
new file mode 100644
index 0000000..6b58545
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/speexfile.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+                           (original Vorbis implementation)
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_SPEEXFILE_H
+#define TAGLIB_SPEEXFILE_H
+
+#include <oggfile.h>
+#include <xiphcomment.h>
+
+#include "speexproperties.h"
+
+namespace TagLib {
+
+  namespace Ogg {
+
+    //! A namespace containing classes for Speex metadata
+
+    namespace Speex {
+
+      //! An implementation of Ogg::File with Speex specific methods
+
+      /*!
+       * This is the central class in the Ogg Speex metadata processing collection
+       * of classes.  It's built upon Ogg::File which handles processing of the Ogg
+       * logical bitstream and breaking it down into pages which are handled by
+       * the codec implementations, in this case Speex specifically.
+       */
+
+      class TAGLIB_EXPORT File : public Ogg::File
+      {
+      public:
+        /*!
+         * Contructs a Speex file from \a file.  If \a readProperties is true the
+         * file's audio properties will also be read using \a propertiesStyle.  If
+         * false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        /*!
+         * Returns the XiphComment for this file.  XiphComment implements the tag
+         * interface, so this serves as the reimplementation of
+         * TagLib::File::tag().
+         */
+        virtual Ogg::XiphComment *tag() const;
+
+        /*!
+         * Returns the Speex::Properties for this file.  If no audio properties
+         * were read then this will return a null pointer.
+         */
+        virtual Properties *audioProperties() const;
+
+        virtual bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+        class FilePrivate;
+        FilePrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/speex/speexproperties.cpp b/lib-src/taglib/taglib/ogg/speex/speexproperties.cpp
new file mode 100644
index 0000000..29deb01
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/speexproperties.cpp
@@ -0,0 +1,170 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+                           (original Vorbis implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include <oggpageheader.h>
+
+#include "speexproperties.h"
+#include "speexfile.h"
+
+using namespace TagLib;
+using namespace TagLib::Ogg;
+
+class Speex::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(File *f, ReadStyle s) :
+    file(f),
+    style(s),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0),
+    speexVersion(0),
+    vbr(false),
+    mode(0) {}
+
+  File *file;
+  ReadStyle style;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int speexVersion;
+  bool vbr;
+  int mode;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Speex::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(file, style);
+  read();
+}
+
+Speex::Properties::~Properties()
+{
+  delete d;
+}
+
+int Speex::Properties::length() const
+{
+  return d->length;
+}
+
+int Speex::Properties::bitrate() const
+{
+  return int(float(d->bitrate) / float(1000) + 0.5);
+}
+
+int Speex::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int Speex::Properties::channels() const
+{
+  return d->channels;
+}
+
+int Speex::Properties::speexVersion() const
+{
+  return d->speexVersion;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Speex::Properties::read()
+{
+  // Get the identification header from the Ogg implementation.
+
+  ByteVector data = d->file->packet(0);
+
+  int pos = 28;
+
+  // speex_version_id;       /**< Version for Speex (for checking compatibility) */
+  d->speexVersion = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // header_size;            /**< Total size of the header ( sizeof(SpeexHeader) ) */
+  pos += 4;
+
+  // rate;                   /**< Sampling rate used */
+  d->sampleRate = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // mode;                   /**< Mode used (0 for narrowband, 1 for wideband) */
+  d->mode = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // mode_bitstream_version; /**< Version ID of the bit-stream */
+  pos += 4;
+
+  // nb_channels;            /**< Number of channels encoded */
+  d->channels = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // bitrate;                /**< Bit-rate used */
+  d->bitrate = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // frame_size;             /**< Size of frames */
+  // unsigned int frameSize = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  // vbr;                    /**< 1 for a VBR encoding, 0 otherwise */
+  d->vbr = data.mid(pos, 4).toUInt(false) == 1;
+  pos += 4;
+
+  // frames_per_packet;      /**< Number of frames stored per Ogg packet */
+  // unsigned int framesPerPacket = data.mid(pos, 4).toUInt(false);
+
+  const Ogg::PageHeader *first = d->file->firstPageHeader();
+  const Ogg::PageHeader *last = d->file->lastPageHeader();
+
+  if(first && last) {
+    long long start = first->absoluteGranularPosition();
+    long long end = last->absoluteGranularPosition();
+
+    if(start >= 0 && end >= 0 && d->sampleRate > 0)
+      d->length = (int) ((end - start) / (long long) d->sampleRate);
+    else
+      debug("Speex::Properties::read() -- Either the PCM values for the start or "
+            "end of this file was incorrect or the sample rate is zero.");
+  }
+  else
+    debug("Speex::Properties::read() -- Could not find valid first and last Ogg pages.");
+}
diff --git a/lib-src/taglib/taglib/ogg/speex/speexproperties.h b/lib-src/taglib/taglib/ogg/speex/speexproperties.h
new file mode 100644
index 0000000..3bab797
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/speex/speexproperties.h
@@ -0,0 +1,89 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+                           (original Vorbis implementation)
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_SPEEXPROPERTIES_H
+#define TAGLIB_SPEEXPROPERTIES_H
+
+#include <audioproperties.h>
+
+namespace TagLib {
+
+  namespace Ogg {
+
+    namespace Speex {
+
+      class File;
+
+      //! An implementation of audio property reading for Ogg Speex
+
+      /*!
+       * This reads the data from an Ogg Speex stream found in the AudioProperties
+       * API.
+       */
+
+      class TAGLIB_EXPORT Properties : public AudioProperties
+      {
+      public:
+        /*!
+         * Create an instance of Speex::Properties with the data read from the
+         * Speex::File \a file.
+         */
+        Properties(File *file, ReadStyle style = Average);
+
+        /*!
+         * Destroys this Speex::Properties instance.
+         */
+        virtual ~Properties();
+
+        // Reimplementations.
+
+        virtual int length() const;
+        virtual int bitrate() const;
+        virtual int sampleRate() const;
+        virtual int channels() const;
+
+        /*!
+         * Returns the Speex version, currently "0" (as specified by the spec).
+         */
+        int speexVersion() const;
+
+      private:
+        Properties(const Properties &);
+        Properties &operator=(const Properties &);
+
+        void read();
+
+        class PropertiesPrivate;
+        PropertiesPrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisfile.Plo b/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisproperties.Plo b/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/.deps/vorbisproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/ogg/vorbis/CMakeLists.txt b/lib-src/taglib/taglib/ogg/vorbis/CMakeLists.txt
new file mode 100644
index 0000000..7033e13
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  vorbisfile.h vorbisproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/ogg/vorbis/Makefile.am b/lib-src/taglib/taglib/ogg/vorbis/Makefile.am
new file mode 100644
index 0000000..c7880fb
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libvorbis.la
+
+libvorbis_la_SOURCES = vorbisfile.cpp vorbisproperties.cpp
+
+taglib_include_HEADERS = vorbisfile.h vorbisproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/ogg/vorbis/Makefile.in b/lib-src/taglib/taglib/ogg/vorbis/Makefile.in
new file mode 100644
index 0000000..1e0ce67
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/Makefile.in
@@ -0,0 +1,623 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/ogg/vorbis
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libvorbis_la_LIBADD =
+am_libvorbis_la_OBJECTS = vorbisfile.lo vorbisproperties.lo
+#>- libvorbis_la_OBJECTS = $(am_libvorbis_la_OBJECTS)
+#>+ 4
+libvorbis_la_final_OBJECTS = libvorbis_la.all_cpp.lo 
+libvorbis_la_nofinal_OBJECTS = vorbisfile.lo vorbisproperties.lo
+ at KDE_USE_FINAL_FALSE@libvorbis_la_OBJECTS = $(libvorbis_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libvorbis_la_OBJECTS = $(libvorbis_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libvorbis_la_SOURCES)
+DIST_SOURCES = $(libvorbis_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ogg \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libvorbis.la
+libvorbis_la_SOURCES = vorbisfile.cpp vorbisproperties.cpp
+taglib_include_HEADERS = vorbisfile.h vorbisproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/vorbis/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libvorbis.la: $(libvorbis_la_OBJECTS) $(libvorbis_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libvorbis_la_OBJECTS) $(libvorbis_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vorbisfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vorbisproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/ogg/vorbis/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/ogg/vorbis/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libvorbis_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/vorbisfile.cpp $(srcdir)/vorbisproperties.cpp 
+	@echo 'creating libvorbis_la.all_cpp.cpp ...'; \
+	rm -f libvorbis_la.all_cpp.files libvorbis_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libvorbis_la.all_cpp.final; \
+	for file in vorbisfile.cpp vorbisproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libvorbis_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libvorbis_la.all_cpp.final; \
+	done; \
+	cat libvorbis_la.all_cpp.final libvorbis_la.all_cpp.files > libvorbis_la.all_cpp.cpp; \
+	rm -f libvorbis_la.all_cpp.final libvorbis_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libvorbis_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libvorbis_la_OBJECTS="$(libvorbis_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libvorbis_la_OBJECTS="$(libvorbis_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libvorbis_la_OBJECTS="$(libvorbis_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libvorbis_la_OBJECTS="$(libvorbis_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.cpp b/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.cpp
new file mode 100644
index 0000000..114166a
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.cpp
@@ -0,0 +1,117 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <bitset>
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include "vorbisfile.h"
+
+using namespace TagLib;
+
+class Vorbis::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    comment(0),
+    properties(0) {}
+
+  ~FilePrivate()
+  {
+    delete comment;
+    delete properties;
+  }
+
+  Ogg::XiphComment *comment;
+  Properties *properties;
+};
+
+namespace TagLib {
+  /*!
+   * Vorbis headers can be found with one type ID byte and the string "vorbis" in
+   * an Ogg stream.  0x03 indicates the comment header.
+   */
+  static const char vorbisCommentHeaderID[] = { 0x03, 'v', 'o', 'r', 'b', 'i', 's', 0 };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Vorbis::File::File(FileName file, bool readProperties,
+                   Properties::ReadStyle propertiesStyle) : Ogg::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+Vorbis::File::~File()
+{
+  delete d;
+}
+
+Ogg::XiphComment *Vorbis::File::tag() const
+{
+  return d->comment;
+}
+
+Vorbis::Properties *Vorbis::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool Vorbis::File::save()
+{
+  ByteVector v(vorbisCommentHeaderID);
+
+  if(!d->comment)
+    d->comment = new Ogg::XiphComment;
+  v.append(d->comment->render());
+
+  setPacket(1, v);
+
+  return Ogg::File::save();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Vorbis::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  ByteVector commentHeaderData = packet(1);
+
+  if(commentHeaderData.mid(0, 7) != vorbisCommentHeaderID) {
+    debug("Vorbis::File::read() - Could not find the Vorbis comment header.");
+    setValid(false);
+    return;
+  }
+
+  d->comment = new Ogg::XiphComment(commentHeaderData.mid(7));
+
+  if(readProperties)
+    d->properties = new Properties(this, propertiesStyle);
+}
diff --git a/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.h b/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.h
new file mode 100644
index 0000000..9eb5ac6
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/vorbisfile.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_VORBISFILE_H
+#define TAGLIB_VORBISFILE_H
+
+#include "taglib_export.h"
+#include "oggfile.h"
+#include "xiphcomment.h"
+
+#include "vorbisproperties.h"
+
+namespace TagLib {
+
+/*
+ * This is just to make this appear to be in the Ogg namespace in the
+ * documentation.  The typedef below will make this work with the current code.
+ * In the next BIC version of TagLib this will be really moved into the Ogg
+ * namespace.
+ */
+
+#ifdef DOXYGEN
+  namespace Ogg {
+#endif
+
+  //! A namespace containing classes for Vorbis metadata
+
+  namespace Vorbis {
+
+
+    //! An implementation of Ogg::File with Vorbis specific methods
+
+    /*!
+     * This is the central class in the Ogg Vorbis metadata processing collection
+     * of classes.  It's built upon Ogg::File which handles processing of the Ogg
+     * logical bitstream and breaking it down into pages which are handled by
+     * the codec implementations, in this case Vorbis specifically.
+     */
+
+    class TAGLIB_EXPORT File : public Ogg::File
+    {
+    public:
+      /*!
+       * Contructs a Vorbis file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the XiphComment for this file.  XiphComment implements the tag
+       * interface, so this serves as the reimplementation of
+       * TagLib::File::tag().
+       */
+      virtual Ogg::XiphComment *tag() const;
+
+      /*!
+       * Returns the Vorbis::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      virtual bool save();
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+
+/*
+ * To keep compatibility with the current version put Vorbis in the Ogg namespace
+ * only in the docs and provide a typedef to make it work.  In the next BIC
+ * version this will be removed and it will only exist in the Ogg namespace.
+ */
+
+#ifdef DOXYGEN
+  }
+#else
+  namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } }
+#endif
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.cpp b/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.cpp
new file mode 100644
index 0000000..c82a319
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.cpp
@@ -0,0 +1,183 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include <oggpageheader.h>
+
+#include "vorbisproperties.h"
+#include "vorbisfile.h"
+
+using namespace TagLib;
+
+class Vorbis::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(File *f, ReadStyle s) :
+    file(f),
+    style(s),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0),
+    vorbisVersion(0),
+    bitrateMaximum(0),
+    bitrateNominal(0),
+    bitrateMinimum(0) {}
+
+  File *file;
+  ReadStyle style;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int vorbisVersion;
+  int bitrateMaximum;
+  int bitrateNominal;
+  int bitrateMinimum;
+};
+
+namespace TagLib {
+  /*!
+   * Vorbis headers can be found with one type ID byte and the string "vorbis" in
+   * an Ogg stream.  0x01 indicates the setup header.
+   */
+  static const char vorbisSetupHeaderID[] = { 0x01, 'v', 'o', 'r', 'b', 'i', 's', 0 };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Vorbis::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(file, style);
+  read();
+}
+
+Vorbis::Properties::~Properties()
+{
+  delete d;
+}
+
+int Vorbis::Properties::length() const
+{
+  return d->length;
+}
+
+int Vorbis::Properties::bitrate() const
+{
+  return int(float(d->bitrate) / float(1000) + 0.5);
+}
+
+int Vorbis::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int Vorbis::Properties::channels() const
+{
+  return d->channels;
+}
+
+int Vorbis::Properties::vorbisVersion() const
+{
+  return d->vorbisVersion;
+}
+
+int Vorbis::Properties::bitrateMaximum() const
+{
+  return d->bitrateMaximum;
+}
+
+int Vorbis::Properties::bitrateNominal() const
+{
+  return d->bitrateNominal;
+}
+
+int Vorbis::Properties::bitrateMinimum() const
+{
+  return d->bitrateMinimum;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void Vorbis::Properties::read()
+{
+  // Get the identification header from the Ogg implementation.
+
+  ByteVector data = d->file->packet(0);
+
+  int pos = 0;
+
+  if(data.mid(pos, 7) != vorbisSetupHeaderID) {
+    debug("Vorbis::Properties::read() -- invalid Vorbis identification header");
+    return;
+  }
+
+  pos += 7;
+
+  d->vorbisVersion = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  d->channels = uchar(data[pos]);
+  pos += 1;
+
+  d->sampleRate = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  d->bitrateMaximum = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  d->bitrateNominal = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  d->bitrateMinimum = data.mid(pos, 4).toUInt(false);
+
+  // TODO: Later this should be only the "fast" mode.
+  d->bitrate = d->bitrateNominal;
+
+  // Find the length of the file.  See http://wiki.xiph.org/VorbisStreamLength/
+  // for my notes on the topic.
+
+  const Ogg::PageHeader *first = d->file->firstPageHeader();
+  const Ogg::PageHeader *last = d->file->lastPageHeader();
+
+  if(first && last) {
+    long long start = first->absoluteGranularPosition();
+    long long end = last->absoluteGranularPosition();
+
+    if(start >= 0 && end >= 0 && d->sampleRate > 0)
+      d->length = (end - start) / (long long) d->sampleRate;
+    else
+      debug("Vorbis::Properties::read() -- Either the PCM values for the start or "
+            "end of this file was incorrect or the sample rate is zero.");
+  }
+  else
+    debug("Vorbis::Properties::read() -- Could not find valid first and last Ogg pages.");
+}
diff --git a/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.h b/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.h
new file mode 100644
index 0000000..80804a2
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/vorbis/vorbisproperties.h
@@ -0,0 +1,125 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_VORBISPROPERTIES_H
+#define TAGLIB_VORBISPROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+/*
+ * This is just to make this appear to be in the Ogg namespace in the
+ * documentation.  The typedef below will make this work with the current code.
+ * In the next BIC version of TagLib this will be really moved into the Ogg
+ * namespace.
+ */
+
+#ifdef DOXYGEN
+  namespace Ogg {
+#endif
+
+  namespace Vorbis {
+
+    class File;
+
+    //! An implementation of audio property reading for Ogg Vorbis
+
+    /*!
+     * This reads the data from an Ogg Vorbis stream found in the AudioProperties
+     * API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of Vorbis::Properties with the data read from the
+       * Vorbis::File \a file.
+       */
+      Properties(File *file, ReadStyle style = Average);
+
+      /*!
+       * Destroys this VorbisProperties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns the Vorbis version, currently "0" (as specified by the spec).
+       */
+      int vorbisVersion() const;
+
+      /*!
+       * Returns the maximum bitrate as read from the Vorbis identification
+       * header.
+       */
+      int bitrateMaximum() const;
+
+      /*!
+       * Returns the nominal bitrate as read from the Vorbis identification
+       * header.
+       */
+      int bitrateNominal() const;
+
+      /*!
+       * Returns the minimum bitrate as read from the Vorbis identification
+       * header.
+       */
+      int bitrateMinimum() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+
+/*
+ * To keep compatibility with the current version put Vorbis in the Ogg namespace
+ * only in the docs and provide a typedef to make it work.  In the next BIC
+ * version this will be removed and it will only exist in the Ogg namespace.
+ */
+
+#ifdef DOXYGEN
+  }
+#else
+  namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } }
+#endif
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/ogg/xiphcomment.cpp b/lib-src/taglib/taglib/ogg/xiphcomment.cpp
new file mode 100644
index 0000000..d7c5c5c
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/xiphcomment.cpp
@@ -0,0 +1,313 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tdebug.h>
+
+#include <xiphcomment.h>
+
+using namespace TagLib;
+
+class Ogg::XiphComment::XiphCommentPrivate
+{
+public:
+  FieldListMap fieldListMap;
+  String vendorID;
+  String commentField;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+Ogg::XiphComment::XiphComment() : TagLib::Tag()
+{
+  d = new XiphCommentPrivate;
+}
+
+Ogg::XiphComment::XiphComment(const ByteVector &data) : TagLib::Tag()
+{
+  d = new XiphCommentPrivate;
+  parse(data);
+}
+
+Ogg::XiphComment::~XiphComment()
+{
+  delete d;
+}
+
+String Ogg::XiphComment::title() const
+{
+  if(d->fieldListMap["TITLE"].isEmpty())
+    return String::null;
+  return d->fieldListMap["TITLE"].front();
+}
+
+String Ogg::XiphComment::artist() const
+{
+  if(d->fieldListMap["ARTIST"].isEmpty())
+    return String::null;
+  return d->fieldListMap["ARTIST"].front();
+}
+
+String Ogg::XiphComment::album() const
+{
+  if(d->fieldListMap["ALBUM"].isEmpty())
+    return String::null;
+  return d->fieldListMap["ALBUM"].front();
+}
+
+String Ogg::XiphComment::comment() const
+{
+  if(!d->fieldListMap["DESCRIPTION"].isEmpty()) {
+    d->commentField = "DESCRIPTION";
+    return d->fieldListMap["DESCRIPTION"].front();
+  }
+
+  if(!d->fieldListMap["COMMENT"].isEmpty()) {
+    d->commentField = "COMMENT";
+    return d->fieldListMap["COMMENT"].front();
+  }
+
+  return String::null;
+}
+
+String Ogg::XiphComment::genre() const
+{
+  if(d->fieldListMap["GENRE"].isEmpty())
+    return String::null;
+  return d->fieldListMap["GENRE"].front();
+}
+
+TagLib::uint Ogg::XiphComment::year() const
+{
+  if(d->fieldListMap["DATE"].isEmpty())
+    return 0;
+  return d->fieldListMap["DATE"].front().toInt();
+}
+
+TagLib::uint Ogg::XiphComment::track() const
+{
+  if(d->fieldListMap["TRACKNUMBER"].isEmpty())
+    return 0;
+  return d->fieldListMap["TRACKNUMBER"].front().toInt();
+}
+
+void Ogg::XiphComment::setTitle(const String &s)
+{
+  addField("TITLE", s);
+}
+
+void Ogg::XiphComment::setArtist(const String &s)
+{
+  addField("ARTIST", s);
+}
+
+void Ogg::XiphComment::setAlbum(const String &s)
+{
+  addField("ALBUM", s);
+}
+
+void Ogg::XiphComment::setComment(const String &s)
+{
+  addField(d->commentField.isEmpty() ? "DESCRIPTION" : d->commentField, s);
+}
+
+void Ogg::XiphComment::setGenre(const String &s)
+{
+  addField("GENRE", s);
+}
+
+void Ogg::XiphComment::setYear(uint i)
+{
+  if(i == 0)
+    removeField("DATE");
+  else
+    addField("DATE", String::number(i));
+}
+
+void Ogg::XiphComment::setTrack(uint i)
+{
+  if(i == 0)
+    removeField("TRACKNUMBER");
+  else
+    addField("TRACKNUMBER", String::number(i));
+}
+
+bool Ogg::XiphComment::isEmpty() const
+{
+  FieldListMap::ConstIterator it = d->fieldListMap.begin();
+  for(; it != d->fieldListMap.end(); ++it)
+    if(!(*it).second.isEmpty())
+      return false;
+
+  return true;
+}
+
+TagLib::uint Ogg::XiphComment::fieldCount() const
+{
+  uint count = 0;
+
+  FieldListMap::ConstIterator it = d->fieldListMap.begin();
+  for(; it != d->fieldListMap.end(); ++it)
+    count += (*it).second.size();
+
+  return count;
+}
+
+const Ogg::FieldListMap &Ogg::XiphComment::fieldListMap() const
+{
+  return d->fieldListMap;
+}
+
+String Ogg::XiphComment::vendorID() const
+{
+  return d->vendorID;
+}
+
+void Ogg::XiphComment::addField(const String &key, const String &value, bool replace)
+{
+  if(replace)
+    removeField(key.upper());
+
+  if(!key.isEmpty() && !value.isEmpty())
+    d->fieldListMap[key.upper()].append(value);
+}
+
+void Ogg::XiphComment::removeField(const String &key, const String &value)
+{
+  if(!value.isNull()) {
+    StringList::Iterator it = d->fieldListMap[key].begin();
+    while(it != d->fieldListMap[key].end()) {
+      if(value == *it)
+        it = d->fieldListMap[key].erase(it);
+      else
+        it++;
+    }
+  }
+  else
+    d->fieldListMap.erase(key);
+}
+
+bool Ogg::XiphComment::contains(const String &key) const
+{
+  return d->fieldListMap.contains(key) && !d->fieldListMap[key].isEmpty();
+}
+
+ByteVector Ogg::XiphComment::render() const
+{
+  return render(true);
+}
+
+ByteVector Ogg::XiphComment::render(bool addFramingBit) const
+{
+  ByteVector data;
+
+  // Add the vendor ID length and the vendor ID.  It's important to use the
+  // length of the data(String::UTF8) rather than the length of the the string
+  // since this is UTF8 text and there may be more characters in the data than
+  // in the UTF16 string.
+
+  ByteVector vendorData = d->vendorID.data(String::UTF8);
+
+  data.append(ByteVector::fromUInt(vendorData.size(), false));
+  data.append(vendorData);
+
+  // Add the number of fields.
+
+  data.append(ByteVector::fromUInt(fieldCount(), false));
+
+  // Iterate over the the field lists.  Our iterator returns a
+  // std::pair<String, StringList> where the first String is the field name and
+  // the StringList is the values associated with that field.
+
+  FieldListMap::ConstIterator it = d->fieldListMap.begin();
+  for(; it != d->fieldListMap.end(); ++it) {
+
+    // And now iterate over the values of the current list.
+
+    String fieldName = (*it).first;
+    StringList values = (*it).second;
+
+    StringList::ConstIterator valuesIt = values.begin();
+    for(; valuesIt != values.end(); ++valuesIt) {
+      ByteVector fieldData = fieldName.data(String::UTF8);
+      fieldData.append('=');
+      fieldData.append((*valuesIt).data(String::UTF8));
+
+      data.append(ByteVector::fromUInt(fieldData.size(), false));
+      data.append(fieldData);
+    }
+  }
+
+  // Append the "framing bit".
+
+  if(addFramingBit)
+    data.append(char(1));
+
+  return data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void Ogg::XiphComment::parse(const ByteVector &data)
+{
+  // The first thing in the comment data is the vendor ID length, followed by a
+  // UTF8 string with the vendor ID.
+
+  int pos = 0;
+
+  int vendorLength = data.mid(0, 4).toUInt(false);
+  pos += 4;
+
+  d->vendorID = String(data.mid(pos, vendorLength), String::UTF8);
+  pos += vendorLength;
+
+  // Next the number of fields in the comment vector.
+
+  int commentFields = data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  for(int i = 0; i < commentFields; i++) {
+
+    // Each comment field is in the format "KEY=value" in a UTF8 string and has
+    // 4 bytes before the text starts that gives the length.
+
+    int commentLength = data.mid(pos, 4).toUInt(false);
+    pos += 4;
+
+    String comment = String(data.mid(pos, commentLength), String::UTF8);
+    pos += commentLength;
+
+    int commentSeparatorPosition = comment.find("=");
+
+    String key = comment.substr(0, commentSeparatorPosition);
+    String value = comment.substr(commentSeparatorPosition + 1);
+
+    addField(key, value, false);
+  }
+}
diff --git a/lib-src/taglib/taglib/ogg/xiphcomment.h b/lib-src/taglib/taglib/ogg/xiphcomment.h
new file mode 100644
index 0000000..818b3f4
--- /dev/null
+++ b/lib-src/taglib/taglib/ogg/xiphcomment.h
@@ -0,0 +1,202 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_VORBISCOMMENT_H
+#define TAGLIB_VORBISCOMMENT_H
+
+#include "tag.h"
+#include "tlist.h"
+#include "tmap.h"
+#include "tstring.h"
+#include "tstringlist.h"
+#include "tbytevector.h"
+#include "taglib_export.h"
+
+namespace TagLib {
+
+  namespace Ogg {
+
+    /*!
+     * A mapping between a list of field names, or keys, and a list of values
+     * associated with that field.
+     *
+     * \see XiphComment::fieldListMap()
+     */
+    typedef Map<String, StringList> FieldListMap;
+
+    //! Ogg Vorbis comment implementation
+
+    /*!
+     * This class is an implementation of the Ogg Vorbis comment specification,
+     * to be found in section 5 of the Ogg Vorbis specification.  Because this
+     * format is also used in other (currently unsupported) Xiph.org formats, it
+     * has been made part of a generic implementation rather than being limited
+     * to strictly Vorbis.
+     *
+     * Vorbis comments are a simple vector of keys and values, called fields.
+     * Multiple values for a given key are supported.
+     *
+     * \see fieldListMap()
+     */
+
+    class TAGLIB_EXPORT XiphComment : public TagLib::Tag
+    {
+    public:
+      /*!
+       * Constructs an empty Vorbis comment.
+       */
+      XiphComment();
+
+      /*!
+       * Constructs a Vorbis comment from \a data.
+       */
+      XiphComment(const ByteVector &data);
+
+      /*!
+       * Destroys this instance of the XiphComment.
+       */
+      virtual ~XiphComment();
+
+      virtual String title() const;
+      virtual String artist() const;
+      virtual String album() const;
+      virtual String comment() const;
+      virtual String genre() const;
+      virtual uint year() const;
+      virtual uint track() const;
+
+      virtual void setTitle(const String &s);
+      virtual void setArtist(const String &s);
+      virtual void setAlbum(const String &s);
+      virtual void setComment(const String &s);
+      virtual void setGenre(const String &s);
+      virtual void setYear(uint i);
+      virtual void setTrack(uint i);
+
+      virtual bool isEmpty() const;
+
+      /*!
+       * Returns the number of fields present in the comment.
+       */
+      uint fieldCount() const;
+
+      /*!
+       * Returns a reference to the map of field lists.  Because Xiph comments
+       * support multiple fields with the same key, a pure Map would not work.
+       * As such this is a Map of string lists, keyed on the comment field name.
+       *
+       * The standard set of Xiph/Vorbis fields (which may or may not be
+       * contained in any specific comment) is:
+       *
+       * <ul>
+       *   <li>TITLE</li>
+       *   <li>VERSION</li>
+       *   <li>ALBUM</li>
+       *   <li>ARTIST</li>
+       *   <li>PERFORMER</li>
+       *   <li>COPYRIGHT</li>
+       *   <li>ORGANIZATION</li>
+       *   <li>DESCRIPTION</li>
+       *   <li>GENRE</li>
+       *   <li>DATE</li>
+       *   <li>LOCATION</li>
+       *   <li>CONTACT</li>
+       *   <li>ISRC</li>
+       * </ul>
+       *
+       * For a more detailed description of these fields, please see the Ogg
+       * Vorbis specification, section 5.2.2.1.
+       *
+       * \note The Ogg Vorbis comment specification does allow these key values
+       * to be either upper or lower case.  However, it is conventional for them
+       * to be upper case.  As such, TagLib, when parsing a Xiph/Vorbis comment,
+       * converts all fields to uppercase.  When you are using this data
+       * structure, you will need to specify the field name in upper case.
+       *
+       * \warning You should not modify this data structure directly, instead
+       * use addField() and removeField().
+       */
+      const FieldListMap &fieldListMap() const;
+
+      /*!
+       * Returns the vendor ID of the Ogg Vorbis encoder.  libvorbis 1.0 as the
+       * most common case always returns "Xiph.Org libVorbis I 20020717".
+       */
+      String vendorID() const;
+
+      /*!
+       * Add the field specified by \a key with the data \a value.  If \a replace
+       * is true, then all of the other fields with the same key will be removed
+       * first.
+       *
+       * If the field value is empty, the field will be removed.
+       */
+      void addField(const String &key, const String &value, bool replace = true);
+
+      /*!
+       * Remove the field specified by \a key with the data \a value.  If
+       * \a value is null, all of the fields with the given key will be removed.
+       */
+      void removeField(const String &key, const String &value = String::null);
+
+      /*!
+       * Returns true if the field is contained within the comment.
+       *
+       * \note This is safer than checking for membership in the FieldListMap.
+       */
+      bool contains(const String &key) const;
+
+      /*!
+       * Renders the comment to a ByteVector suitable for inserting into a file.
+       */
+      ByteVector render() const; // BIC: remove and merge with below
+
+      /*!
+       * Renders the comment to a ByteVector suitable for inserting into a file.
+       *
+       * If \a addFramingBit is true the standard Vorbis comment framing bit will
+       * be appended.  However some formats (notably FLAC) do not work with this
+       * in place.
+       */
+      ByteVector render(bool addFramingBit) const;
+
+    protected:
+      /*!
+       * Reads the tag from the file specified in the constructor and fills the
+       * FieldListMap.
+       */
+      void parse(const ByteVector &data);
+
+    private:
+      XiphComment(const XiphComment &);
+      XiphComment &operator=(const XiphComment &);
+
+      class XiphCommentPrivate;
+      XiphCommentPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/riff/.deps/rifffile.Plo b/lib-src/taglib/taglib/riff/.deps/rifffile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/.deps/rifffile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/riff/CMakeLists.txt b/lib-src/taglib/taglib/riff/CMakeLists.txt
new file mode 100644
index 0000000..f691ee4
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/CMakeLists.txt
@@ -0,0 +1,4 @@
+ADD_SUBDIRECTORY( aiff )
+ADD_SUBDIRECTORY( wav )
+
+INSTALL( FILES  rifffile.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/riff/Makefile.am b/lib-src/taglib/taglib/riff/Makefile.am
new file mode 100644
index 0000000..5ef736b
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/Makefile.am
@@ -0,0 +1,15 @@
+SUBDIRS = aiff wav
+
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libriff.la
+
+libriff_la_SOURCES = rifffile.cpp
+
+taglib_include_HEADERS = rifffile.h
+taglib_includedir = $(includedir)/taglib
+
+libriff_la_LIBADD = ./aiff/libaiff.la ./wav/libwav.la
diff --git a/lib-src/taglib/taglib/riff/Makefile.in b/lib-src/taglib/taglib/riff/Makefile.in
new file mode 100644
index 0000000..b355014
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/Makefile.in
@@ -0,0 +1,726 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/riff
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libriff_la_DEPENDENCIES = ./aiff/libaiff.la ./wav/libwav.la
+am_libriff_la_OBJECTS = rifffile.lo
+#>- libriff_la_OBJECTS = $(am_libriff_la_OBJECTS)
+#>+ 1
+libriff_la_OBJECTS = rifffile.lo
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libriff_la_SOURCES)
+DIST_SOURCES = $(libriff_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- 	html-recursive info-recursive install-data-recursive \
+#>- 	install-dvi-recursive install-exec-recursive \
+#>- 	install-html-recursive install-info-recursive \
+#>- 	install-pdf-recursive install-ps-recursive install-recursive \
+#>- 	installcheck-recursive installdirs-recursive pdf-recursive \
+#>- 	ps-recursive uninstall-recursive
+#>+ 7
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive nmcheck-recursive bcheck-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = aiff wav
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libriff.la
+libriff_la_SOURCES = rifffile.cpp
+taglib_include_HEADERS = rifffile.h
+taglib_includedir = $(includedir)/taglib
+libriff_la_LIBADD = ./aiff/libaiff.la ./wav/libwav.la
+#>- all: all-recursive
+#>+ 1
+all: docs-am  all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/riff/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libriff.la: $(libriff_la_OBJECTS) $(libriff_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libriff_la_OBJECTS) $(libriff_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rifffile.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 3
+final:
+	$(MAKE) all-am
+
+#>+ 3
+final-install:
+	$(MAKE) install-am
+
+#>+ 3
+no-final:
+	$(MAKE) all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/riff/aiff/.deps/aifffile.Plo b/lib-src/taglib/taglib/riff/aiff/.deps/aifffile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/.deps/aifffile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/riff/aiff/.deps/aiffproperties.Plo b/lib-src/taglib/taglib/riff/aiff/.deps/aiffproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/.deps/aiffproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/riff/aiff/CMakeLists.txt b/lib-src/taglib/taglib/riff/aiff/CMakeLists.txt
new file mode 100644
index 0000000..7e8cdd6
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  aifffile.h aiffproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/riff/aiff/Makefile.am b/lib-src/taglib/taglib/riff/aiff/Makefile.am
new file mode 100644
index 0000000..dff13a5
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libaiff.la
+
+libaiff_la_SOURCES = aifffile.cpp aiffproperties.cpp
+
+taglib_include_HEADERS = aifffile.h aiffproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/riff/aiff/Makefile.in b/lib-src/taglib/taglib/riff/aiff/Makefile.in
new file mode 100644
index 0000000..64fa686
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/Makefile.in
@@ -0,0 +1,624 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/riff/aiff
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libaiff_la_LIBADD =
+am_libaiff_la_OBJECTS = aifffile.lo aiffproperties.lo
+#>- libaiff_la_OBJECTS = $(am_libaiff_la_OBJECTS)
+#>+ 4
+libaiff_la_final_OBJECTS = libaiff_la.all_cpp.lo 
+libaiff_la_nofinal_OBJECTS = aifffile.lo aiffproperties.lo
+ at KDE_USE_FINAL_FALSE@libaiff_la_OBJECTS = $(libaiff_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libaiff_la_OBJECTS = $(libaiff_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libaiff_la_SOURCES)
+DIST_SOURCES = $(libaiff_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libaiff.la
+libaiff_la_SOURCES = aifffile.cpp aiffproperties.cpp
+taglib_include_HEADERS = aifffile.h aiffproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/aiff/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libaiff.la: $(libaiff_la_OBJECTS) $(libaiff_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libaiff_la_OBJECTS) $(libaiff_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aifffile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aiffproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/aiff/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/aiff/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libaiff_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/aifffile.cpp $(srcdir)/aiffproperties.cpp 
+	@echo 'creating libaiff_la.all_cpp.cpp ...'; \
+	rm -f libaiff_la.all_cpp.files libaiff_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libaiff_la.all_cpp.final; \
+	for file in aifffile.cpp aiffproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libaiff_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libaiff_la.all_cpp.final; \
+	done; \
+	cat libaiff_la.all_cpp.final libaiff_la.all_cpp.files > libaiff_la.all_cpp.cpp; \
+	rm -f libaiff_la.all_cpp.final libaiff_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libaiff_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libaiff_la_OBJECTS="$(libaiff_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libaiff_la_OBJECTS="$(libaiff_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libaiff_la_OBJECTS="$(libaiff_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libaiff_la_OBJECTS="$(libaiff_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/riff/aiff/aifffile.cpp b/lib-src/taglib/taglib/riff/aiff/aifffile.cpp
new file mode 100644
index 0000000..9bc5cd1
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/aifffile.cpp
@@ -0,0 +1,108 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tdebug.h>
+#include <id3v2tag.h>
+
+#include "aifffile.h"
+
+using namespace TagLib;
+
+class RIFF::AIFF::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    properties(0),
+    tag(0)
+  {
+
+  }
+
+  ~FilePrivate()
+  {
+    delete properties;
+    delete tag;
+  }
+
+  Properties *properties;
+  ID3v2::Tag *tag;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::AIFF::File::File(FileName file, bool readProperties,
+                       Properties::ReadStyle propertiesStyle) : RIFF::File(file, BigEndian)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+RIFF::AIFF::File::~File()
+{
+  delete d;
+}
+
+ID3v2::Tag *RIFF::AIFF::File::tag() const
+{
+  return d->tag;
+}
+
+RIFF::AIFF::Properties *RIFF::AIFF::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool RIFF::AIFF::File::save()
+{
+  if(readOnly()) {
+    debug("RIFF::AIFF::File::save() -- File is read only.");
+    return false;
+  }
+
+  setChunkData("ID3 ", d->tag->render());
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void RIFF::AIFF::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  for(uint i = 0; i < chunkCount(); i++) {
+    if(chunkName(i) == "ID3 ")
+      d->tag = new ID3v2::Tag(this, chunkOffset(i));
+    else if(chunkName(i) == "COMM" && readProperties)
+      d->properties = new Properties(chunkData(i), propertiesStyle);
+  }
+
+  if(!d->tag)
+    d->tag = new ID3v2::Tag;
+}
diff --git a/lib-src/taglib/taglib/riff/aiff/aifffile.h b/lib-src/taglib/taglib/riff/aiff/aifffile.h
new file mode 100644
index 0000000..533d83d
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/aifffile.h
@@ -0,0 +1,102 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_AIFFFILE_H
+#define TAGLIB_AIFFFILE_H
+
+#include "rifffile.h"
+#include "id3v2tag.h"
+#include "aiffproperties.h"
+
+namespace TagLib {
+
+  namespace RIFF {
+
+    //! An implementation of AIFF metadata
+
+    /*!
+     * This is implementation of AIFF metadata.
+     *
+     * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF
+     * chunk as well as properties from the file.
+     */
+
+    namespace AIFF {
+
+      //! An implementation of TagLib::File with AIFF specific methods
+
+      /*!
+       * This implements and provides an interface for AIFF files to the
+       * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+       * the abstract TagLib::File API as well as providing some additional
+       * information specific to AIFF files.
+       */
+
+      class TAGLIB_EXPORT File : public TagLib::RIFF::File
+      {
+      public:
+        /*!
+         * Contructs an AIFF file from \a file.  If \a readProperties is true the
+         * file's audio properties will also be read using \a propertiesStyle.  If
+         * false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        /*!
+         * Returns the Tag for this file.
+         */
+        virtual ID3v2::Tag *tag() const;
+
+        /*!
+         * Returns the AIFF::Properties for this file.  If no audio properties
+         * were read then this will return a null pointer.
+         */
+        virtual Properties *audioProperties() const;
+
+        /*!
+         * Saves the file.
+         */
+        virtual bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+        class FilePrivate;
+        FilePrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/riff/aiff/aiffproperties.cpp b/lib-src/taglib/taglib/riff/aiff/aiffproperties.cpp
new file mode 100644
index 0000000..e60d936
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/aiffproperties.cpp
@@ -0,0 +1,146 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <cmath>
+// ldexp is a c99 function, which might not be defined in <cmath>
+// so we pull in math.h too and hope it does the right (wrong) thing
+// wrt. c99 functions in C++
+#include <math.h>
+
+#include "aiffproperties.h"
+
+////////////////////////////////////////////////////////////////////////////////
+// nasty 80-bit float helpers
+////////////////////////////////////////////////////////////////////////////////
+
+#define UnsignedToFloat(u) (((double)((long)(u - 2147483647L - 1))) + 2147483648.0)
+
+static double ConvertFromIeeeExtended(unsigned char *bytes)
+{
+  double f;
+  int expon;
+  unsigned long hiMant, loMant;
+    
+  expon  = ((bytes[0] & 0x7F) << 8) | (bytes[1] & 0xFF);
+
+  hiMant = ((unsigned long)(bytes[2] & 0xFF) << 24) |
+           ((unsigned long)(bytes[3] & 0xFF) << 16) |
+           ((unsigned long)(bytes[4] & 0xFF) << 8)  |
+           ((unsigned long)(bytes[5] & 0xFF));
+
+  loMant = ((unsigned long)(bytes[6] & 0xFF) << 24) |
+           ((unsigned long)(bytes[7] & 0xFF) << 16) |
+           ((unsigned long)(bytes[8] & 0xFF) << 8)  |
+           ((unsigned long)(bytes[9] & 0xFF));
+
+  if (expon == 0 && hiMant == 0 && loMant == 0)
+    f = 0;
+  else {
+    if(expon == 0x7FFF) /* Infinity or NaN */
+      f = HUGE_VAL;
+    else {
+      expon -= 16383;
+      f  = ldexp(UnsignedToFloat(hiMant), expon -= 31);
+      f += ldexp(UnsignedToFloat(loMant), expon -= 32);
+    }
+  }
+
+  if(bytes[0] & 0x80)
+    return -f;
+  else
+    return f;
+}
+
+using namespace TagLib;
+
+class RIFF::AIFF::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate() :
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0)
+  {
+
+  }
+
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::AIFF::Properties::Properties(const ByteVector &data, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate;
+  read(data);
+}
+
+RIFF::AIFF::Properties::~Properties()
+{
+  delete d;
+}
+
+int RIFF::AIFF::Properties::length() const
+{
+  return d->length;
+}
+
+int RIFF::AIFF::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int RIFF::AIFF::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int RIFF::AIFF::Properties::channels() const
+{
+  return d->channels;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void RIFF::AIFF::Properties::read(const ByteVector &data)
+{
+  d->channels       = data.mid(0, 2).toShort();
+  uint sampleFrames = data.mid(2, 4).toUInt();
+  short sampleSize  = data.mid(6, 2).toShort();
+  double sampleRate = ConvertFromIeeeExtended(reinterpret_cast<unsigned char *>(data.mid(8, 10).data()));
+  d->sampleRate     = sampleRate;
+  d->bitrate        = (sampleRate * sampleSize * d->channels) / 1024.0;
+  d->length         = sampleFrames / d->sampleRate;
+}
diff --git a/lib-src/taglib/taglib/riff/aiff/aiffproperties.h b/lib-src/taglib/taglib/riff/aiff/aiffproperties.h
new file mode 100644
index 0000000..1408cb3
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/aiff/aiffproperties.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_AIFFPROPERTIES_H
+#define TAGLIB_AIFFPROPERTIES_H
+
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace RIFF {
+
+    namespace AIFF {
+
+      class File;
+
+      //! An implementation of audio property reading for AIFF
+
+      /*!
+       * This reads the data from an AIFF stream found in the AudioProperties
+       * API.
+       */
+
+      class TAGLIB_EXPORT Properties : public AudioProperties
+      {
+      public:
+	/*!
+	 * Create an instance of AIFF::Properties with the data read from the
+	 * ByteVector \a data.
+	 */
+	Properties(const ByteVector &data, ReadStyle style);
+
+	/*!
+	 * Destroys this AIFF::Properties instance.
+	 */
+	virtual ~Properties();
+
+	// Reimplementations.
+
+	virtual int length() const;
+	virtual int bitrate() const;
+	virtual int sampleRate() const;
+	virtual int channels() const;
+
+      private:
+	Properties(const Properties &);
+	Properties &operator=(const Properties &);
+
+	void read(const ByteVector &data);
+
+	class PropertiesPrivate;
+	PropertiesPrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/riff/rifffile.cpp b/lib-src/taglib/taglib/riff/rifffile.cpp
new file mode 100644
index 0000000..2aca44a
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/rifffile.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tdebug.h>
+#include <tstring.h>
+
+#include "rifffile.h"
+#include <vector>
+
+using namespace TagLib;
+
+class RIFF::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    endianness(BigEndian),
+    size(0)
+  {
+
+  }
+  Endianness endianness;
+  ByteVector type;
+  uint size;
+  ByteVector format;
+
+  std::vector<ByteVector> chunkNames;
+  std::vector<uint> chunkOffsets;
+  std::vector<uint> chunkSizes;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::File::~File()
+{
+  delete d;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::File::File(FileName file, Endianness endianness) : TagLib::File(file)
+{
+  d = new FilePrivate;
+  d->endianness = endianness;
+
+  if(isOpen())
+    read();
+}
+
+TagLib::uint RIFF::File::chunkCount() const
+{
+  return d->chunkNames.size();
+}
+
+TagLib::uint RIFF::File::chunkOffset(uint i) const
+{
+  return d->chunkOffsets[i];
+}
+
+ByteVector RIFF::File::chunkName(uint i) const
+{
+  if(i >= chunkCount())
+    return ByteVector::null;
+
+  return d->chunkNames[i];
+}
+
+ByteVector RIFF::File::chunkData(uint i)
+{
+  if(i >= chunkCount())
+    return ByteVector::null;
+
+  // Offset for the first subchunk's data
+
+  long begin = 12 + 8;
+
+  for(uint it = 0; it < i; it++)
+    begin += 8 + d->chunkSizes[it];
+
+  seek(begin);
+
+  return readBlock(d->chunkSizes[i]);
+}
+
+void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data)
+{
+  if(d->chunkNames.size() == 0)
+  {
+    debug("RIFF::File::setChunkData - No valid chunks found.");
+    return;
+  }
+
+  for(uint i = 0; i < d->chunkNames.size(); i++) {
+    if(d->chunkNames[i] == name) {
+
+      int sizeDifference = data.size() - d->chunkSizes[i];
+
+      // First we update the global size
+
+      insert(ByteVector::fromUInt(d->size + sizeDifference,
+                                  d->endianness == BigEndian), 4, 4);
+
+      // Now update the specific chunk
+
+      writeChunk(name, data, d->chunkOffsets[i] - 8, d->chunkSizes[i] + 8);
+
+      // Now update the internal offsets
+
+      for(i++; i < d->chunkNames.size(); i++)
+        d->chunkOffsets[i] += sizeDifference;
+
+      return;
+    }
+  }
+
+  // Couldn't find an existing chunk, so let's create a new one.  First update
+  // the global size:
+
+  insert(ByteVector::fromUInt(d->size + data.size() + 8, d->endianness == BigEndian), 4, 4);
+  writeChunk(name, data, d->chunkOffsets.back() + d->chunkSizes.back());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void RIFF::File::read()
+{
+  bool bigEndian = (d->endianness == BigEndian);
+
+  d->type = readBlock(4);
+  d->size = readBlock(4).toUInt(bigEndian);
+  d->format = readBlock(4);
+
+  while(tell() < length()) {
+    ByteVector chunkName = readBlock(4);
+    uint chunkSize = readBlock(4).toUInt(bigEndian);
+
+    d->chunkNames.push_back(chunkName);
+    d->chunkSizes.push_back(chunkSize);
+
+    d->chunkOffsets.push_back(tell());
+
+    seek(chunkSize, Current);
+  }
+}
+
+void RIFF::File::writeChunk(const ByteVector &name, const ByteVector &data,
+                            ulong offset, ulong replace)
+{
+  ByteVector combined = name;
+  combined.append(ByteVector::fromUInt(data.size(), d->endianness == BigEndian));
+  combined.append(data);
+  insert(combined, offset, replace);
+}
diff --git a/lib-src/taglib/taglib/riff/rifffile.h b/lib-src/taglib/taglib/riff/rifffile.h
new file mode 100644
index 0000000..3b375e2
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/rifffile.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_RIFFFILE_H
+#define TAGLIB_RIFFFILE_H
+
+#include "taglib_export.h"
+#include "tfile.h"
+
+namespace TagLib {
+
+  //! An implementation of TagLib::File with RIFF specific methods
+
+  namespace RIFF {
+
+    //! An RIFF file class with some useful methods specific to RIFF
+
+    /*!
+     * This implements the generic TagLib::File API and additionally provides
+     * access to properties that are distinct to RIFF files, notably access
+     * to the different ID3 tags.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+    protected:
+
+      enum Endianness { BigEndian, LittleEndian };
+
+      File(FileName file, Endianness endianness);
+
+      /*!
+       * \return The number of chunks in the file.
+       */
+      uint chunkCount() const;
+
+      /*!
+       * \return The offset within the file for the selected chunk number.
+       */
+      uint chunkOffset(uint i) const;
+
+      /*!
+       * \return The name of the specified chunk, for instance, "COMM" or "ID3 "
+       */
+      ByteVector chunkName(uint i) const;
+
+      /*!
+       * Reads the chunk data from the file and returns it.
+       *
+       * \note This \e will move the read pointer for the file.
+       */
+      ByteVector chunkData(uint i);
+
+      /*!
+       * Sets the data for the chunk \a name to \a data.  If a chunk with the
+       * given name already exists it will be overwritten, otherwise it will be
+       * created after the existing chunks.
+       *
+       * \warning This will update the file immediately.
+       */
+      void setChunkData(const ByteVector &name, const ByteVector &data);
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read();
+      void writeChunk(const ByteVector &name, const ByteVector &data,
+                      ulong offset, ulong replace = 0);
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/riff/wav/.deps/wavfile.Plo b/lib-src/taglib/taglib/riff/wav/.deps/wavfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/.deps/wavfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/riff/wav/.deps/wavproperties.Plo b/lib-src/taglib/taglib/riff/wav/.deps/wavproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/.deps/wavproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/riff/wav/CMakeLists.txt b/lib-src/taglib/taglib/riff/wav/CMakeLists.txt
new file mode 100644
index 0000000..c011579
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  wavfile.h wavproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/riff/wav/Makefile.am b/lib-src/taglib/taglib/riff/wav/Makefile.am
new file mode 100644
index 0000000..767c29f
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libwav.la
+
+libwav_la_SOURCES = wavfile.cpp wavproperties.cpp
+
+taglib_include_HEADERS = wavfile.h wavproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/riff/wav/Makefile.in b/lib-src/taglib/taglib/riff/wav/Makefile.in
new file mode 100644
index 0000000..2874838
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/Makefile.in
@@ -0,0 +1,624 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/riff/wav
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libwav_la_LIBADD =
+am_libwav_la_OBJECTS = wavfile.lo wavproperties.lo
+#>- libwav_la_OBJECTS = $(am_libwav_la_OBJECTS)
+#>+ 4
+libwav_la_final_OBJECTS = libwav_la.all_cpp.lo 
+libwav_la_nofinal_OBJECTS = wavfile.lo wavproperties.lo
+ at KDE_USE_FINAL_FALSE@libwav_la_OBJECTS = $(libwav_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libwav_la_OBJECTS = $(libwav_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libwav_la_SOURCES)
+DIST_SOURCES = $(libwav_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/riff \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libwav.la
+libwav_la_SOURCES = wavfile.cpp wavproperties.cpp
+taglib_include_HEADERS = wavfile.h wavproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/wav/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libwav.la: $(libwav_la_OBJECTS) $(libwav_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libwav_la_OBJECTS) $(libwav_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wavfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wavproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/riff/wav/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/riff/wav/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libwav_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/wavfile.cpp $(srcdir)/wavproperties.cpp 
+	@echo 'creating libwav_la.all_cpp.cpp ...'; \
+	rm -f libwav_la.all_cpp.files libwav_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libwav_la.all_cpp.final; \
+	for file in wavfile.cpp wavproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libwav_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libwav_la.all_cpp.final; \
+	done; \
+	cat libwav_la.all_cpp.final libwav_la.all_cpp.files > libwav_la.all_cpp.cpp; \
+	rm -f libwav_la.all_cpp.final libwav_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libwav_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libwav_la_OBJECTS="$(libwav_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libwav_la_OBJECTS="$(libwav_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libwav_la_OBJECTS="$(libwav_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libwav_la_OBJECTS="$(libwav_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/riff/wav/wavfile.cpp b/lib-src/taglib/taglib/riff/wav/wavfile.cpp
new file mode 100644
index 0000000..b2123ad
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/wavfile.cpp
@@ -0,0 +1,108 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tdebug.h>
+#include <id3v2tag.h>
+
+#include "wavfile.h"
+
+using namespace TagLib;
+
+class RIFF::WAV::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    properties(0),
+    tag(0)
+  {
+
+  }
+
+  ~FilePrivate()
+  {
+    delete properties;
+    delete tag;
+  }
+
+  Properties *properties;
+  ID3v2::Tag *tag;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::WAV::File::File(FileName file, bool readProperties,
+                       Properties::ReadStyle propertiesStyle) : RIFF::File(file, LittleEndian)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+RIFF::WAV::File::~File()
+{
+  delete d;
+}
+
+ID3v2::Tag *RIFF::WAV::File::tag() const
+{
+  return d->tag;
+}
+
+RIFF::WAV::Properties *RIFF::WAV::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool RIFF::WAV::File::save()
+{
+  if(readOnly()) {
+    debug("RIFF::WAV::File::save() -- File is read only.");
+    return false;
+  }
+
+  setChunkData("ID3 ", d->tag->render());
+
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void RIFF::WAV::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
+{
+  for(uint i = 0; i < chunkCount(); i++) {
+    if(chunkName(i) == "ID3 ")
+      d->tag = new ID3v2::Tag(this, chunkOffset(i));
+    else if(chunkName(i) == "fmt " && readProperties)
+      d->properties = new Properties(chunkData(i), propertiesStyle);
+  }
+
+  if(!d->tag)
+    d->tag = new ID3v2::Tag;
+}
diff --git a/lib-src/taglib/taglib/riff/wav/wavfile.h b/lib-src/taglib/taglib/riff/wav/wavfile.h
new file mode 100644
index 0000000..6c36a3c
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/wavfile.h
@@ -0,0 +1,102 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_WAVFILE_H
+#define TAGLIB_WAVFILE_H
+
+#include "rifffile.h"
+#include "id3v2tag.h"
+#include "wavproperties.h"
+
+namespace TagLib {
+
+  namespace RIFF {
+
+    //! An implementation of WAV metadata
+
+    /*!
+     * This is implementation of WAV metadata.
+     *
+     * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF
+     * chunk as well as properties from the file.
+     */
+
+    namespace WAV {
+
+      //! An implementation of TagLib::File with WAV specific methods
+
+      /*!
+       * This implements and provides an interface for WAV files to the
+       * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+       * the abstract TagLib::File API as well as providing some additional
+       * information specific to WAV files.
+       */
+
+      class TAGLIB_EXPORT File : public TagLib::RIFF::File
+      {
+      public:
+        /*!
+         * Contructs an WAV file from \a file.  If \a readProperties is true the
+         * file's audio properties will also be read using \a propertiesStyle.  If
+         * false, \a propertiesStyle is ignored.
+         */
+        File(FileName file, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
+        /*!
+         * Destroys this instance of the File.
+         */
+        virtual ~File();
+
+        /*!
+         * Returns the Tag for this file.
+         */
+        virtual ID3v2::Tag *tag() const;
+
+        /*!
+         * Returns the WAV::Properties for this file.  If no audio properties
+         * were read then this will return a null pointer.
+         */
+        virtual Properties *audioProperties() const;
+
+        /*!
+         * Saves the file.
+         */
+        virtual bool save();
+
+      private:
+        File(const File &);
+        File &operator=(const File &);
+
+        void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+
+        class FilePrivate;
+        FilePrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/riff/wav/wavproperties.cpp b/lib-src/taglib/taglib/riff/wav/wavproperties.cpp
new file mode 100644
index 0000000..18920dd
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/wavproperties.cpp
@@ -0,0 +1,104 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "wavproperties.h"
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <cmath>
+#include <math.h>
+
+using namespace TagLib;
+
+class RIFF::WAV::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate() :
+    format(0),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0)
+  {
+
+  }
+
+  short format;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+RIFF::WAV::Properties::Properties(const ByteVector &data, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate;
+  read(data);
+}
+
+RIFF::WAV::Properties::~Properties()
+{
+  delete d;
+}
+
+int RIFF::WAV::Properties::length() const
+{
+  return d->length;
+}
+
+int RIFF::WAV::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int RIFF::WAV::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int RIFF::WAV::Properties::channels() const
+{
+  return d->channels;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void RIFF::WAV::Properties::read(const ByteVector &data)
+{
+  d->format     = data.mid(0, 2).toShort(false);
+  d->channels   = data.mid(2, 2).toShort(false);
+  d->sampleRate = data.mid(4, 4).toUInt(false);
+  d->bitrate    = data.mid(8, 4).toUInt(false) * 8 / 1024;
+
+  // short bitsPerSample = data.mid(10, 2).toShort();
+  // d->bitrate    = (sampleRate * sampleSize * d->channels) / 1024.0;
+  // d->length     = sampleFrames / d->sampleRate;
+}
diff --git a/lib-src/taglib/taglib/riff/wav/wavproperties.h b/lib-src/taglib/taglib/riff/wav/wavproperties.h
new file mode 100644
index 0000000..531f877
--- /dev/null
+++ b/lib-src/taglib/taglib/riff/wav/wavproperties.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+    copyright            : (C) 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_WAVPROPERTIES_H
+#define TAGLIB_WAVPROPERTIES_H
+
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  class ByteVector;
+
+  namespace RIFF {
+
+    namespace WAV {
+
+      class File;
+
+      //! An implementation of audio property reading for WAV
+
+      /*!
+       * This reads the data from an WAV stream found in the AudioProperties
+       * API.
+       */
+
+      class TAGLIB_EXPORT Properties : public AudioProperties
+      {
+      public:
+	/*!
+	 * Create an instance of WAV::Properties with the data read from the
+	 * ByteVector \a data.
+	 */
+	Properties(const ByteVector &data, ReadStyle style);
+
+	/*!
+	 * Destroys this WAV::Properties instance.
+	 */
+	virtual ~Properties();
+
+	// Reimplementations.
+
+	virtual int length() const;
+	virtual int bitrate() const;
+	virtual int sampleRate() const;
+	virtual int channels() const;
+
+      private:
+	Properties(const Properties &);
+	Properties &operator=(const Properties &);
+
+	void read(const ByteVector &data);
+
+	class PropertiesPrivate;
+	PropertiesPrivate *d;
+      };
+    }
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/tag.cpp b/lib-src/taglib/taglib/tag.cpp
new file mode 100644
index 0000000..2917540
--- /dev/null
+++ b/lib-src/taglib/taglib/tag.cpp
@@ -0,0 +1,83 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tag.h"
+
+using namespace TagLib;
+
+class Tag::TagPrivate
+{
+
+};
+
+Tag::Tag()
+{
+
+}
+
+Tag::~Tag()
+{
+
+}
+
+bool Tag::isEmpty() const
+{
+  return (title().isEmpty() &&
+          artist().isEmpty() &&
+          album().isEmpty() &&
+          comment().isEmpty() &&
+          genre().isEmpty() &&
+          year() == 0 &&
+          track() == 0);
+}
+
+void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static
+{
+  if(overwrite) {
+    target->setTitle(source->title());
+    target->setArtist(source->artist());
+    target->setAlbum(source->album());
+    target->setComment(source->comment());
+    target->setGenre(source->genre());
+    target->setYear(source->year());
+    target->setTrack(source->track());
+  }
+  else {
+    if(target->title().isEmpty())
+      target->setTitle(source->title());
+    if(target->artist().isEmpty())
+      target->setArtist(source->artist());
+    if(target->album().isEmpty())
+      target->setAlbum(source->album());
+    if(target->comment().isEmpty())
+      target->setComment(source->comment());
+    if(target->genre().isEmpty())
+      target->setGenre(source->genre());
+    if(target->year() <= 0)
+      target->setYear(source->year());
+    if(target->track() <= 0)
+      target->setTrack(source->track());
+  }
+}
diff --git a/lib-src/taglib/taglib/tag.h b/lib-src/taglib/taglib/tag.h
new file mode 100644
index 0000000..6404a70
--- /dev/null
+++ b/lib-src/taglib/taglib/tag.h
@@ -0,0 +1,173 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TAG_H
+#define TAGLIB_TAG_H
+
+#include "taglib_export.h"
+#include "tstring.h"
+
+namespace TagLib {
+
+  //! A simple, generic interface to common audio meta data fields
+
+  /*!
+   * This is an attempt to abstract away the difference in the meta data formats
+   * of various audio codecs and tagging schemes.  As such it is generally a
+   * subset of what is available in the specific formats but should be suitable
+   * for most applications.  This is meant to compliment the generic APIs found
+   * in TagLib::AudioProperties, TagLib::File and TagLib::FileRef.
+   */
+
+  class TAGLIB_EXPORT Tag
+  {
+  public:
+
+    /*!
+     * Detroys this Tag instance.
+     */
+    virtual ~Tag();
+
+    /*!
+     * Returns the track name; if no track name is present in the tag
+     * String::null will be returned.
+     */
+    virtual String title() const = 0;
+
+    /*!
+     * Returns the artist name; if no artist name is present in the tag
+     * String::null will be returned.
+     */
+    virtual String artist() const = 0;
+
+    /*!
+     * Returns the album name; if no album name is present in the tag
+     * String::null will be returned.
+     */
+    virtual String album() const = 0;
+
+    /*!
+     * Returns the track comment; if no comment is present in the tag
+     * String::null will be returned.
+     */
+    virtual String comment() const = 0;
+
+    /*!
+     * Returns the genre name; if no genre is present in the tag String::null
+     * will be returned.
+     */
+    virtual String genre() const = 0;
+
+    /*!
+     * Returns the year; if there is no year set, this will return 0.
+     */
+    virtual uint year() const = 0;
+
+    /*!
+     * Returns the track number; if there is no track number set, this will
+     * return 0.
+     */
+    virtual uint track() const = 0;
+
+    /*!
+     * Sets the title to \a s.  If \a s is String::null then this value will be
+     * cleared.
+     */
+    virtual void setTitle(const String &s) = 0;
+
+    /*!
+     * Sets the artist to \a s.  If \a s is String::null then this value will be
+     * cleared.
+     */
+    virtual void setArtist(const String &s) = 0;
+
+    /*!
+     * Sets the album to \a s.  If \a s is String::null then this value will be
+     * cleared.
+     */
+    virtual void setAlbum(const String &s) = 0;
+
+    /*!
+     * Sets the comment to \a s.  If \a s is String::null then this value will be
+     * cleared.
+     */
+    virtual void setComment(const String &s) = 0;
+
+    /*!
+     * Sets the genre to \a s.  If \a s is String::null then this value will be
+     * cleared.  For tag formats that use a fixed set of genres, the appropriate
+     * value will be selected based on a string comparison.  A list of available
+     * genres for those formats should be available in that type's
+     * implementation.
+     */
+    virtual void setGenre(const String &s) = 0;
+
+    /*!
+     * Sets the year to \a i.  If \a s is 0 then this value will be cleared.
+     */
+    virtual void setYear(uint i) = 0;
+
+    /*!
+     * Sets the track to \a i.  If \a s is 0 then this value will be cleared.
+     */
+    virtual void setTrack(uint i) = 0;
+
+    /*!
+     * Returns true if the tag does not contain any data.  This should be
+     * reimplemented in subclasses that provide more than the basic tagging
+     * abilities in this class.
+     */
+    virtual bool isEmpty() const;
+
+    /*!
+     * Copies the generic data from one tag to another.
+     *
+     * \note This will no affect any of the lower level details of the tag.  For
+     * instance if any of the tag type specific data (maybe a URL for a band) is
+     * set, this will not modify or copy that.  This just copies using the API
+     * in this class.
+     *
+     * If \a overwrite is true then the values will be unconditionally copied.
+     * If false only empty values will be overwritten.
+     */
+    static void duplicate(const Tag *source, Tag *target, bool overwrite = true);
+
+  protected:
+    /*!
+     * Construct a Tag.  This is protected since tags should only be instantiated
+     * through subclasses.
+     */
+    Tag();
+
+  private:
+    Tag(const Tag &);
+    Tag &operator=(const Tag &);
+
+    class TagPrivate;
+    TagPrivate *d;
+  };
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/taglib.pro b/lib-src/taglib/taglib/taglib.pro
new file mode 100644
index 0000000..a98727d
--- /dev/null
+++ b/lib-src/taglib/taglib/taglib.pro
@@ -0,0 +1,234 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Fri Feb 1 15:35:13 2008
+######################################################################
+
+TEMPLATE = lib
+CONFIG += lib_bundle
+CONFIG += x86 ppc
+CONFIG -= qt
+DEFINES += HAVE_ZLIB=1 NDEBUG
+LIBS += -lz
+TARGET = TagLib
+VERSION = 1.5
+DEPENDPATH += . \
+              ape \
+              flac \
+              mpc \
+              mp4 \
+              mpeg \
+              ogg \
+              ogg/speex \
+              toolkit \
+              trueaudio \
+              wavpack \
+              mpeg/id3v1 \
+              mpeg/id3v2 \
+              ogg/flac \
+              ogg/vorbis \
+              mpeg/id3v2/frames
+INCLUDEPATH += . \
+               toolkit \
+               mpeg \
+               ogg/vorbis \
+               ogg \
+               flac \
+               ogg/flac \
+               mpc \
+               mp4 \
+               wavpack \
+               ogg/speex \
+               trueaudio \
+               ape \
+               mpeg/id3v2 \
+               mpeg/id3v1 \
+               mpeg/id3v2/frames
+
+# Input
+HEADERS += audioproperties.h \
+           fileref.h \
+           tag.h \
+           taglib_export.h \
+           tagunion.h \
+           ape/apefooter.h \
+           ape/apeitem.h \
+           ape/apetag.h \
+           flac/flacfile.h \
+           flac/flacproperties.h \
+           mpc/mpcfile.h \
+           mpc/mpcproperties.h \
+           mp4/mp4atom.h \
+           mp4/mp4item.h \
+           mp4/mp4file.h \
+           mp4/mp4properties.h \
+           mpeg/mpegfile.h \
+           mpeg/mpegheader.h \
+           mpeg/mpegproperties.h \
+           mpeg/xingheader.h \
+           ogg/oggfile.h \
+           ogg/oggpage.h \
+           ogg/oggpageheader.h \
+           ogg/xiphcomment.h \
+           ogg/speex/speexfile.h \
+           ogg/speex/speexproperties.h \
+           toolkit/taglib.h \
+           toolkit/tbytevector.h \
+           toolkit/tbytevectorlist.h \
+           toolkit/tdebug.h \
+           toolkit/tfile.h \
+           toolkit/tlist.h \
+           toolkit/tmap.h \
+           toolkit/tstring.h \
+           toolkit/tstringlist.h \
+           toolkit/unicode.h \
+           trueaudio/trueaudiofile.h \
+           trueaudio/trueaudioproperties.h \
+           wavpack/wavpackfile.h \
+           wavpack/wavpackproperties.h \
+           mpeg/id3v1/id3v1genres.h \
+           mpeg/id3v1/id3v1tag.h \
+           mpeg/id3v2/id3v2extendedheader.h \
+           mpeg/id3v2/id3v2footer.h \
+           mpeg/id3v2/id3v2frame.h \
+           mpeg/id3v2/id3v2framefactory.h \
+           mpeg/id3v2/id3v2header.h \
+           mpeg/id3v2/id3v2synchdata.h \
+           mpeg/id3v2/id3v2tag.h \
+           ogg/flac/oggflacfile.h \
+           ogg/vorbis/vorbisfile.h \
+           ogg/vorbis/vorbisproperties.h \
+           mpeg/id3v2/frames/attachedpictureframe.h \
+           mpeg/id3v2/frames/commentsframe.h \
+           mpeg/id3v2/frames/generalencapsulatedobjectframe.h \
+           mpeg/id3v2/frames/popularimeterframe.h \
+           mpeg/id3v2/frames/relativevolumeframe.h \
+           mpeg/id3v2/frames/textidentificationframe.h \
+           mpeg/id3v2/frames/uniquefileidentifierframe.h \
+           mpeg/id3v2/frames/unknownframe.h \
+           mpeg/id3v2/frames/unsynchronizedlyricsframe.h \
+           mpeg/id3v2/frames/urllinkframe.h \
+           toolkit/tlist.tcc \
+           toolkit/tmap.tcc
+SOURCES += audioproperties.cpp \
+           fileref.cpp \
+           tag.cpp \
+           tagunion.cpp \
+           ape/apefooter.cpp \
+           ape/apeitem.cpp \
+           ape/apetag.cpp \
+           flac/flacfile.cpp \
+           flac/flacproperties.cpp \
+           mp4/mp4atom.cpp \
+           mp4/mp4item.cpp \
+           mp4/mp4file.cpp \
+           mp4/mp4properties.cpp \
+           mpc/mpcfile.cpp \
+           mpc/mpcproperties.cpp \
+           mpeg/mpegfile.cpp \
+           mpeg/mpegheader.cpp \
+           mpeg/mpegproperties.cpp \
+           mpeg/xingheader.cpp \
+           ogg/oggfile.cpp \
+           ogg/oggpage.cpp \
+           ogg/oggpageheader.cpp \
+           ogg/xiphcomment.cpp \
+           ogg/speex/speexfile.cpp \
+           ogg/speex/speexproperties.cpp \
+           toolkit/tbytevector.cpp \
+           toolkit/tbytevectorlist.cpp \
+           toolkit/tdebug.cpp \
+           toolkit/tfile.cpp \
+           toolkit/tstring.cpp \
+           toolkit/tstringlist.cpp \
+           toolkit/unicode.cpp \
+           trueaudio/trueaudiofile.cpp \
+           trueaudio/trueaudioproperties.cpp \
+           wavpack/wavpackfile.cpp \
+           wavpack/wavpackproperties.cpp \
+           mpeg/id3v1/id3v1genres.cpp \
+           mpeg/id3v1/id3v1tag.cpp \
+           mpeg/id3v2/id3v2extendedheader.cpp \
+           mpeg/id3v2/id3v2footer.cpp \
+           mpeg/id3v2/id3v2frame.cpp \
+           mpeg/id3v2/id3v2framefactory.cpp \
+           mpeg/id3v2/id3v2header.cpp \
+           mpeg/id3v2/id3v2synchdata.cpp \
+           mpeg/id3v2/id3v2tag.cpp \
+           ogg/flac/oggflacfile.cpp \
+           ogg/vorbis/vorbisfile.cpp \
+           ogg/vorbis/vorbisproperties.cpp \
+           mpeg/id3v2/frames/attachedpictureframe.cpp \
+           mpeg/id3v2/frames/commentsframe.cpp \
+           mpeg/id3v2/frames/generalencapsulatedobjectframe.cpp \
+           mpeg/id3v2/frames/popularimeterframe.cpp \
+           mpeg/id3v2/frames/relativevolumeframe.cpp \
+           mpeg/id3v2/frames/textidentificationframe.cpp \
+           mpeg/id3v2/frames/uniquefileidentifierframe.cpp \
+           mpeg/id3v2/frames/unknownframe.cpp \
+           mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp \
+           mpeg/id3v2/frames/urllinkframe.cpp
+
+ FRAMEWORK_HEADERS.version = Versions
+ FRAMEWORK_HEADERS.files = \
+           audioproperties.h \
+           fileref.h \
+           tag.h \
+           taglib_export.h \
+           ape/apefooter.h \
+           ape/apeitem.h \
+           ape/apetag.h \
+           flac/flacfile.h \
+           flac/flacproperties.h \
+           mp4/mp4atom.h \
+           mp4/mp4item.h \
+           mp4/mp4file.h \
+           mp4/mp4properties.h \
+           mpc/mpcfile.h \
+           mpc/mpcproperties.h \
+           mpeg/mpegfile.h \
+           mpeg/mpegheader.h \
+           mpeg/mpegproperties.h \
+           mpeg/xingheader.h \
+           ogg/oggfile.h \
+           ogg/oggpage.h \
+           ogg/oggpageheader.h \
+           ogg/xiphcomment.h \
+           ogg/speex/speexfile.h \
+           ogg/speex/speexproperties.h \
+           toolkit/taglib.h \
+           toolkit/tbytevector.h \
+           toolkit/tbytevectorlist.h \
+           toolkit/tfile.h \
+           toolkit/tlist.h \
+           toolkit/tmap.h \
+           toolkit/tstring.h \
+           toolkit/tstringlist.h \
+           toolkit/unicode.h \
+           trueaudio/trueaudiofile.h \
+           trueaudio/trueaudioproperties.h \
+           wavpack/wavpackfile.h \
+           wavpack/wavpackproperties.h \
+           mpeg/id3v1/id3v1genres.h \
+           mpeg/id3v1/id3v1tag.h \
+           mpeg/id3v2/id3v2extendedheader.h \
+           mpeg/id3v2/id3v2footer.h \
+           mpeg/id3v2/id3v2frame.h \
+           mpeg/id3v2/id3v2framefactory.h \
+           mpeg/id3v2/id3v2header.h \
+           mpeg/id3v2/id3v2synchdata.h \
+           mpeg/id3v2/id3v2tag.h \
+           ogg/flac/oggflacfile.h \
+           ogg/vorbis/vorbisfile.h \
+           ogg/vorbis/vorbisproperties.h \
+           mpeg/id3v2/frames/attachedpictureframe.h \
+           mpeg/id3v2/frames/commentsframe.h \
+           mpeg/id3v2/frames/generalencapsulatedobjectframe.h \
+           mpeg/id3v2/frames/relativevolumeframe.h \
+           mpeg/id3v2/frames/textidentificationframe.h \
+           mpeg/id3v2/frames/uniquefileidentifierframe.h \
+           mpeg/id3v2/frames/unknownframe.h \
+           mpeg/id3v2/frames/unsynchronizedlyricsframe.h \
+           mpeg/id3v2/frames/urllinkframe.h \
+           toolkit/tlist.tcc \
+           toolkit/tmap.tcc
+ FRAMEWORK_HEADERS.path = Headers
+ QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
diff --git a/lib-src/taglib/taglib/taglib_export.h b/lib-src/taglib/taglib/taglib_export.h
new file mode 100644
index 0000000..d14d69f
--- /dev/null
+++ b/lib-src/taglib/taglib/taglib_export.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_EXPORT_H
+#define TAGLIB_EXPORT_H
+
+#if defined(_WIN32) || defined(_WIN64)
+#ifdef MAKE_TAGLIB_LIB
+#define TAGLIB_EXPORT __declspec(dllexport)
+#else
+#define TAGLIB_EXPORT __declspec(dllimport)
+#endif
+#else
+#define TAGLIB_EXPORT
+#endif
+
+#endif
diff --git a/lib-src/taglib/taglib/tagunion.cpp b/lib-src/taglib/taglib/tagunion.cpp
new file mode 100644
index 0000000..08cc140
--- /dev/null
+++ b/lib-src/taglib/taglib/tagunion.cpp
@@ -0,0 +1,185 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tagunion.h"
+
+using namespace TagLib;
+
+#define stringUnion(method)                                          \
+  if(tag(0) && !tag(0)->method().isEmpty())                          \
+    return tag(0)->method();                                         \
+  if(tag(1) && !tag(1)->method().isEmpty())                          \
+    return tag(1)->method();                                         \
+  if(tag(2) && !tag(2)->method().isEmpty())                          \
+    return tag(2)->method();                                         \
+  return String::null                                                \
+
+#define numberUnion(method)                                          \
+  if(tag(0) && tag(0)->method() > 0)                                 \
+    return tag(0)->method();                                         \
+  if(tag(1) && tag(1)->method() > 0)                                 \
+    return tag(1)->method();                                         \
+  if(tag(2) && tag(2)->method() > 0)                                 \
+    return tag(2)->method();                                         \
+  return 0
+
+#define setUnion(method, value)                                      \
+  if(tag(0))                                                         \
+    tag(0)->set##method(value);                                      \
+  if(tag(1))                                                         \
+    tag(1)->set##method(value);                                      \
+  if(tag(2))                                                         \
+    tag(2)->set##method(value);                                      \
+
+class TagUnion::TagUnionPrivate
+{
+public:
+  TagUnionPrivate() : tags(3, static_cast<Tag *>(0))
+  {
+
+  }
+
+  ~TagUnionPrivate()
+  {
+    delete tags[0];
+    delete tags[1];
+    delete tags[2];
+  }
+
+  std::vector<Tag *> tags;
+};
+
+TagUnion::TagUnion(Tag *first, Tag *second, Tag *third)
+{
+  d = new TagUnionPrivate;
+
+  d->tags[0] = first;
+  d->tags[1] = second;
+  d->tags[2] = third;
+}
+
+TagUnion::~TagUnion()
+{
+  delete d;
+}
+
+Tag *TagUnion::operator[](int index) const
+{
+  return tag(index);
+}
+
+Tag *TagUnion::tag(int index) const
+{
+  return d->tags[index];
+}
+
+void TagUnion::set(int index, Tag *tag)
+{
+  delete d->tags[index];
+  d->tags[index] = tag;
+}
+
+String TagUnion::title() const
+{
+  stringUnion(title);
+}
+
+String TagUnion::artist() const
+{
+  stringUnion(artist);
+}
+
+String TagUnion::album() const
+{
+  stringUnion(album);
+}
+
+String TagUnion::comment() const
+{
+  stringUnion(comment);
+}
+
+String TagUnion::genre() const
+{
+  stringUnion(genre);
+}
+
+TagLib::uint TagUnion::year() const
+{
+  numberUnion(year);
+}
+
+TagLib::uint TagUnion::track() const
+{
+  numberUnion(track);
+}
+
+void TagUnion::setTitle(const String &s)
+{
+  setUnion(Title, s);
+}
+
+void TagUnion::setArtist(const String &s)
+{
+  setUnion(Artist, s);
+}
+
+void TagUnion::setAlbum(const String &s)
+{
+  setUnion(Album, s);
+}
+
+void TagUnion::setComment(const String &s)
+{
+  setUnion(Comment, s);
+}
+
+void TagUnion::setGenre(const String &s)
+{
+  setUnion(Genre, s);
+}
+
+void TagUnion::setYear(uint i)
+{
+  setUnion(Year, i);
+}
+
+void TagUnion::setTrack(uint i)
+{
+  setUnion(Track, i);
+}
+
+bool TagUnion::isEmpty() const
+{
+  if(d->tags[0] && !d->tags[0]->isEmpty())
+    return false;
+  if(d->tags[1] && !d->tags[1]->isEmpty())
+    return false;
+  if(d->tags[2] && !d->tags[2]->isEmpty())
+    return false;
+
+  return true;
+}
+
diff --git a/lib-src/taglib/taglib/tagunion.h b/lib-src/taglib/taglib/tagunion.h
new file mode 100644
index 0000000..76d407c
--- /dev/null
+++ b/lib-src/taglib/taglib/tagunion.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TAGUNION_H
+#define TAGLIB_TAGUNION_H
+
+#include "tag.h"
+
+#ifndef DO_NOT_DOCUMENT
+
+namespace TagLib {
+
+  /*!
+   * \internal
+   */
+
+  class TagUnion : public Tag
+  {
+  public:
+
+    enum AccessType { Read, Write };
+
+    /*!
+     * Creates a TagLib::Tag that is the union of \a first, \a second, and
+     * \a third.  The TagUnion takes ownership of these tags and will handle
+     * their deletion.
+     */
+    TagUnion(Tag *first = 0, Tag *second = 0, Tag *third = 0);
+
+    virtual ~TagUnion();
+
+    Tag *operator[](int index) const;
+    Tag *tag(int index) const;
+
+    void set(int index, Tag *tag);
+
+    virtual String title() const;
+    virtual String artist() const;
+    virtual String album() const;
+    virtual String comment() const;
+    virtual String genre() const;
+    virtual uint year() const;
+    virtual uint track() const;
+
+    virtual void setTitle(const String &s);
+    virtual void setArtist(const String &s);
+    virtual void setAlbum(const String &s);
+    virtual void setComment(const String &s);
+    virtual void setGenre(const String &s);
+    virtual void setYear(uint i);
+    virtual void setTrack(uint i);
+    virtual bool isEmpty() const;
+
+    template <class T> T *access(int index, bool create)
+    {
+      if(!create || tag(index))
+        return static_cast<T *>(tag(index));
+
+      set(index, new T);
+      return static_cast<T *>(tag(index));
+    }
+
+  private:
+    TagUnion(const Tag &);
+    TagUnion &operator=(const Tag &);
+
+    class TagUnionPrivate;
+    TagUnionPrivate *d;
+  };
+}
+
+#endif
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tbytevector.Plo b/lib-src/taglib/taglib/toolkit/.deps/tbytevector.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tbytevector.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tbytevectorlist.Plo b/lib-src/taglib/taglib/toolkit/.deps/tbytevectorlist.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tbytevectorlist.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tdebug.Plo b/lib-src/taglib/taglib/toolkit/.deps/tdebug.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tdebug.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tfile.Plo b/lib-src/taglib/taglib/toolkit/.deps/tfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tstring.Plo b/lib-src/taglib/taglib/toolkit/.deps/tstring.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tstring.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/tstringlist.Plo b/lib-src/taglib/taglib/toolkit/.deps/tstringlist.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/tstringlist.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/.deps/unicode.Plo b/lib-src/taglib/taglib/toolkit/.deps/unicode.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/.deps/unicode.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/toolkit/CMakeLists.txt b/lib-src/taglib/taglib/toolkit/CMakeLists.txt
new file mode 100644
index 0000000..2e39d31
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  taglib.h tstring.h tlist.h tlist.tcc tstringlist.h  	tbytevector.h tbytevectorlist.h tfile.h  	tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/toolkit/Makefile.am b/lib-src/taglib/taglib/toolkit/Makefile.am
new file mode 100644
index 0000000..cabe1a2
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libtoolkit.la
+
+libtoolkit_la_SOURCES = \
+	tstring.cpp tstringlist.cpp tbytevector.cpp \
+	tbytevectorlist.cpp tfile.cpp tdebug.cpp unicode.cpp
+
+taglib_include_HEADERS = \
+	taglib.h tstring.h tlist.h tlist.tcc tstringlist.h \
+	tbytevector.h tbytevectorlist.h tfile.h \
+	tmap.h tmap.tcc
+
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/toolkit/Makefile.in b/lib-src/taglib/taglib/toolkit/Makefile.in
new file mode 100644
index 0000000..64f7713
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/Makefile.in
@@ -0,0 +1,635 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/toolkit
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libtoolkit_la_LIBADD =
+am_libtoolkit_la_OBJECTS = tstring.lo tstringlist.lo tbytevector.lo \
+	tbytevectorlist.lo tfile.lo tdebug.lo unicode.lo
+#>- libtoolkit_la_OBJECTS = $(am_libtoolkit_la_OBJECTS)
+#>+ 5
+libtoolkit_la_final_OBJECTS = libtoolkit_la.all_cpp.lo 
+libtoolkit_la_nofinal_OBJECTS = tstring.lo tstringlist.lo tbytevector.lo \
+	tbytevectorlist.lo tfile.lo tdebug.lo unicode.lo
+ at KDE_USE_FINAL_FALSE@libtoolkit_la_OBJECTS = $(libtoolkit_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libtoolkit_la_OBJECTS = $(libtoolkit_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libtoolkit_la_SOURCES)
+DIST_SOURCES = $(libtoolkit_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libtoolkit.la
+libtoolkit_la_SOURCES = \
+	tstring.cpp tstringlist.cpp tbytevector.cpp \
+	tbytevectorlist.cpp tfile.cpp tdebug.cpp unicode.cpp
+
+taglib_include_HEADERS = \
+	taglib.h tstring.h tlist.h tlist.tcc tstringlist.h \
+	tbytevector.h tbytevectorlist.h tfile.h \
+	tmap.h tmap.tcc
+
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/toolkit/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/toolkit/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/toolkit/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/toolkit/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/toolkit/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libtoolkit.la: $(libtoolkit_la_OBJECTS) $(libtoolkit_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libtoolkit_la_OBJECTS) $(libtoolkit_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tbytevector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tbytevectorlist.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tdebug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tstring.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tstringlist.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unicode.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in unicode.h tdebug.h Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/toolkit/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/toolkit/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/toolkit/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libtoolkit_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/tstring.cpp $(srcdir)/tstringlist.cpp $(srcdir)/tbytevector.cpp $(srcdir)/tbytevectorlist.cpp $(srcdir)/tfile.cpp $(srcdir)/tdebug.cpp $(srcdir)/unicode.cpp 
+	@echo 'creating libtoolkit_la.all_cpp.cpp ...'; \
+	rm -f libtoolkit_la.all_cpp.files libtoolkit_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libtoolkit_la.all_cpp.final; \
+	for file in tstring.cpp tstringlist.cpp tbytevector.cpp tbytevectorlist.cpp tfile.cpp tdebug.cpp unicode.cpp ; do \
+	  echo "#include \"$$file\"" >> libtoolkit_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libtoolkit_la.all_cpp.final; \
+	done; \
+	cat libtoolkit_la.all_cpp.final libtoolkit_la.all_cpp.files > libtoolkit_la.all_cpp.cpp; \
+	rm -f libtoolkit_la.all_cpp.final libtoolkit_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libtoolkit_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libtoolkit_la_OBJECTS="$(libtoolkit_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libtoolkit_la_OBJECTS="$(libtoolkit_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libtoolkit_la_OBJECTS="$(libtoolkit_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libtoolkit_la_OBJECTS="$(libtoolkit_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/toolkit/taglib.h b/lib-src/taglib/taglib/toolkit/taglib.h
new file mode 100644
index 0000000..3a63cdb
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/taglib.h
@@ -0,0 +1,177 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_H
+#define TAGLIB_H
+
+#define TAGLIB_MAJOR_VERSION 1
+#define TAGLIB_MINOR_VERSION 5
+#define TAGLIB_PATCH_VERSION 0
+
+#include <string>
+
+//! A namespace for all TagLib related classes and functions
+
+/*!
+ * This namespace contains everything in TagLib.  For projects working with
+ * TagLib extensively it may be conveniten to add a
+ * \code
+ * using namespace TagLib;
+ * \endcode
+ */
+
+namespace TagLib {
+
+  class String;
+
+  typedef wchar_t wchar;
+  typedef unsigned char uchar;
+  typedef unsigned int  uint;
+  typedef unsigned long ulong;
+
+  /*!
+   * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3)
+   * so I'm providing something here that should be constant.
+   */
+  typedef std::basic_string<wchar> wstring;
+
+#ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class.
+  /*!
+   * \internal
+   * This is just used as a base class for shared classes in TagLib.
+   *
+   * \warning This <b>is not</b> part of the TagLib public API!
+   */
+
+  class RefCounter
+  {
+  public:
+    RefCounter() : refCount(1) {}
+    void ref() { refCount++; }
+    bool deref() { return ! --refCount ; }
+    int count() { return refCount; }
+  private:
+    uint refCount;
+  };
+
+#endif // DO_NOT_DOCUMENT
+
+}
+
+/*!
+ * \mainpage TagLib
+ *
+ * \section intro Introduction
+ *
+ * TagLib is a library for reading and editing audio meta data, commonly know as \e tags.
+ *
+ * Features:
+ * - A clean, high level, C++ API to handling audio meta data.
+ * - Format specific APIs for advanced API users.
+ * - ID3v1, ID3v2, APE, FLAC and Xiph tag formats.
+ * - MP3, MPC, FLAC, Ogg FLAC, Ogg Vorbis and Speex file formats.
+ * - Basic audio file properties such as length, sample rate, etc.
+ * - Long term binary and source compatibility.
+ * - Extensible design, notably the ability to add other formats or extend current formats as a library user.
+ * - Full support for unicode and internationalized tags.
+ * - Dual <a href="http://www.mozilla.org/MPL/MPL-1.1.html">MPL</a> and
+ *   <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</a> licenses.
+ * - No external toolkit dependancies.
+ *
+ * \section why Why TagLib?
+ *
+ * TagLib originally was written to provide an updated and improved ID3v2 implementation in C++ for use
+ * in a variety of Open Source projects.  Since development began in 2002 and the 1.0 release in 2004
+ * it has expanded to cover a wide variety of tag and file formats and is used in a wide variety of
+ * Open Source and proprietary applications.  It now supports a variety of UNIXes, including Apple's OS
+ * X, as well as Microsoft Windows.
+ *
+ * \section commercial Usage in Commercial Applications
+ *
+ * TagLib's licenses \e do allow usage within propriety (\e closed) applications, however TagLib is \e not
+ * public domain.  Please note the requirements of the LGPL or MPL, and adhere to at least one of them.
+ * In simple terms, you must at a minimum note your usage of TagLib, note the licensing terms of TagLib and
+ * if you make changes to TagLib publish them.  Please review the licenses above before using TagLib in your
+ * software.  Note that you may choose either the MPL or the LGPL, you do not have to fulfill the
+ * requirements of both.
+ *
+ * \section installing Installing TagLib
+ *
+ * Please see the <a href="http://developer.kde.org/~wheeler/taglib.html">TagLib website</a> for the latest
+ * downloads.
+ *
+ * Instructions for installing TagLib vary per platform, but generally speaking on UNIX standard configure and
+ * make commands are provided.  TagLib installs a taglib-config and package-config file to make it easier to
+ * integrate into various build systems.  Note that TagLib's include install directory \e must be included in
+ * the header include path.  Simply adding <taglib/tag.h> will \e not work.
+ *
+ * On Windows, TagLib can be built using the CMake build systems.
+ *
+ * \section start Getting Started
+ *
+ * TagLib provides both simple, abstract APIs which make it possible to ignore the differences between tagging
+ * formats and format specific APIs which allow programmers to work with the features of specific tagging
+ * schemes.  There is a similar abstraction mechanism for AudioProperties.
+ *
+ * The best place to start is with the <b>Class Hierarchy</b> linked at the top of the page.  The File and
+ * AudioProperties classes and their subclasses are the core of TagLib.  The FileRef class is also a convenient
+ * way for using a value-based handle.
+ *
+ * \note When working with FileRef please consider that it has only the most basic (extension-based) file
+ * type resolution.  Please see its documentation on how to plug in more advanced file type resolution.  (Such
+ * resolution may be part of later TagLib releases by default.)
+ *
+ * Here's a very simple example with TagLib:
+ *
+ * \code
+ *
+ * TagLib::FileRef f("Latex Solar Beef.mp3");
+ * TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa"
+ *
+ * f.tag()->setAlbum("Fillmore East");
+ * f.save();
+ *
+ * TagLib::FileRef g("Free City Rhymes.ogg");
+ * TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers"
+ *
+ * g.tag()->setTrack(1);
+ * g.save();
+ *
+ * \endcode
+ *
+ * More examples can be found in the \e examples directory of the source distribution.
+ *
+ * \section Contact
+ *
+ * Questions about TagLib should be directed to the TagLib mailing list, not directly to the author.
+ *
+ *  - <a href="http://developer.kde.org/~wheeler/taglib/">TagLib Homepage</a>
+ *  - <a href="https://mail.kde.org/mailman/listinfo/taglib-devel">TagLib Mailing List (taglib-devel at kde.org)</a>
+ *
+ * \author Scott Wheeler <wheeler at kde.org> et al.
+ *
+ */
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tbytevector.cpp b/lib-src/taglib/taglib/toolkit/tbytevector.cpp
new file mode 100644
index 0000000..7667977
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tbytevector.cpp
@@ -0,0 +1,677 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <iostream>
+
+#include <tstring.h>
+#include <tdebug.h>
+
+#include <string.h>
+
+#include "tbytevector.h"
+
+// This is a bit ugly to keep writing over and over again.
+
+// A rather obscure feature of the C++ spec that I hadn't thought of that makes
+// working with C libs much more effecient.  There's more here:
+//
+// http://www.informit.com/isapi/product_id~{9C84DAB4-FE6E-49C5-BB0A-FB50331233EA}/content/index.asp
+
+#define DATA(x) (&(x->data[0]))
+
+namespace TagLib {
+  static const uint crcTable[256] = {
+    0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
+    0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+    0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
+    0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+    0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3,
+    0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+    0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef,
+    0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+    0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb,
+    0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+    0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0,
+    0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+    0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4,
+    0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+    0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08,
+    0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+    0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc,
+    0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+    0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050,
+    0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+    0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34,
+    0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+    0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1,
+    0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+    0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5,
+    0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+    0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9,
+    0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+    0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd,
+    0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+    0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71,
+    0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+    0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2,
+    0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+    0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e,
+    0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+    0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a,
+    0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+    0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676,
+    0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+    0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662,
+    0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+    0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+  };
+
+  /*!
+   * A templatized KMP find that works both with a ByteVector and a ByteVectorMirror.
+   */
+
+  template <class Vector>
+  int vectorFind(const Vector &v, const Vector &pattern, uint offset, int byteAlign)
+  {
+    if(pattern.size() > v.size() || offset > v.size() - 1)
+      return -1;
+
+    // Let's go ahead and special case a pattern of size one since that's common
+    // and easy to make fast.
+
+    if(pattern.size() == 1) {
+      char p = pattern[0];
+      for(uint i = offset; i < v.size(); i++) {
+        if(v[i] == p && (i - offset) % byteAlign == 0)
+          return i;
+      }
+      return -1;
+    }
+
+    uchar lastOccurrence[256];
+
+    for(uint i = 0; i < 256; ++i)
+      lastOccurrence[i] = uchar(pattern.size());
+
+    for(uint i = 0; i < pattern.size() - 1; ++i)
+      lastOccurrence[uchar(pattern[i])] = uchar(pattern.size() - i - 1);
+
+    for(uint i = pattern.size() - 1 + offset; i < v.size(); i += lastOccurrence[uchar(v.at(i))]) {
+      int iBuffer = i;
+      int iPattern = pattern.size() - 1;
+
+      while(iPattern >= 0 && v.at(iBuffer) == pattern[iPattern]) {
+        --iBuffer;
+        --iPattern;
+      }
+
+      if(-1 == iPattern && (iBuffer + 1 - offset) % byteAlign == 0)
+        return iBuffer + 1;
+    }
+
+    return -1;
+  }
+
+  /*!
+   * Wraps the accessors to a ByteVector to make the search algorithm access the
+   * elements in reverse.
+   *
+   * \see vectorFind()
+   * \see ByteVector::rfind()
+   */
+
+  class ByteVectorMirror
+  {
+  public:
+    ByteVectorMirror(const ByteVector &source) : v(source) {}
+
+    char operator[](int index) const
+    {
+      return v[v.size() - index - 1];
+    }
+
+    char at(int index) const
+    {
+      return v.at(v.size() - index - 1);
+    }
+
+    ByteVectorMirror mid(uint index, uint length = 0xffffffff) const
+    {
+      return length == 0xffffffff ? v.mid(0, index) : v.mid(index - length, length);
+    }
+
+    uint size() const
+    {
+      return v.size();
+    }
+
+    int find(const ByteVectorMirror &pattern, uint offset = 0, int byteAlign = 1) const
+    {
+      ByteVectorMirror v(*this);
+
+      if(offset > 0) {
+        offset = size() - offset - pattern.size();
+        if(offset >= size())
+          offset = 0;
+      }
+
+      const int pos = vectorFind<ByteVectorMirror>(v, pattern, offset, byteAlign);
+
+      // If the offset is zero then we need to adjust the location in the search
+      // to be appropriately reversed.  If not we need to account for the fact
+      // that the recursive call (called from the above line) has already ajusted
+      // for this but that the normal templatized find above will add the offset
+      // to the returned value.
+      //
+      // This is a little confusing at first if you don't first stop to think
+      // through the logic involved in the forward search.
+
+      if(pos == -1)
+        return -1;
+
+      return size() - pos - pattern.size();
+    }
+
+  private:
+    const ByteVector &v;
+  };
+
+  template <class T>
+  T toNumber(const std::vector<char> &data, bool mostSignificantByteFirst)
+  {
+    T sum = 0;
+
+    if(data.size() <= 0) {
+      debug("ByteVectorMirror::toNumber<T>() -- data is empty, returning 0");
+      return sum;
+    }
+
+    uint size = sizeof(T);
+    uint last = data.size() > size ? size - 1 : data.size() - 1;
+
+    for(uint i = 0; i <= last; i++)
+      sum |= (T) uchar(data[i]) << ((mostSignificantByteFirst ? last - i : i) * 8);
+
+    return sum;
+  }
+
+  template <class T>
+  ByteVector fromNumber(T value, bool mostSignificantByteFirst)
+  {
+    int size = sizeof(T);
+
+    ByteVector v(size, 0);
+
+    for(int i = 0; i < size; i++)
+      v[i] = uchar(value >> ((mostSignificantByteFirst ? size - 1 - i : i) * 8) & 0xff);
+
+    return v;
+  }
+}
+
+using namespace TagLib;
+
+class ByteVector::ByteVectorPrivate : public RefCounter
+{
+public:
+  ByteVectorPrivate() : RefCounter(), size(0) {}
+  ByteVectorPrivate(const std::vector<char> &v) : RefCounter(), data(v), size(v.size()) {}
+  ByteVectorPrivate(TagLib::uint len, char value) : RefCounter(), data(len, value), size(len) {}
+
+  std::vector<char> data;
+
+  // std::vector<T>::size() is very slow, so we'll cache the value
+
+  uint size;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members
+////////////////////////////////////////////////////////////////////////////////
+
+ByteVector ByteVector::null;
+
+ByteVector ByteVector::fromCString(const char *s, uint length)
+{
+  ByteVector v;
+
+  if(length == 0xffffffff)
+    v.setData(s);
+  else
+    v.setData(s, length);
+
+  return v;
+}
+
+ByteVector ByteVector::fromUInt(uint value, bool mostSignificantByteFirst)
+{
+  return fromNumber<uint>(value, mostSignificantByteFirst);
+}
+
+ByteVector ByteVector::fromShort(short value, bool mostSignificantByteFirst)
+{
+  return fromNumber<short>(value, mostSignificantByteFirst);
+}
+
+ByteVector ByteVector::fromLongLong(long long value, bool mostSignificantByteFirst)
+{
+  return fromNumber<long long>(value, mostSignificantByteFirst);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ByteVector::ByteVector()
+{
+  d = new ByteVectorPrivate;
+}
+
+ByteVector::ByteVector(uint size, char value)
+{
+  d = new ByteVectorPrivate(size, value);
+}
+
+ByteVector::ByteVector(const ByteVector &v) : d(v.d)
+{
+  d->ref();
+}
+
+ByteVector::ByteVector(char c)
+{
+  d = new ByteVectorPrivate;
+  d->data.push_back(c);
+  d->size = 1;
+}
+
+ByteVector::ByteVector(const char *data, uint length)
+{
+  d = new ByteVectorPrivate;
+  setData(data, length);
+}
+
+ByteVector::ByteVector(const char *data)
+{
+  d = new ByteVectorPrivate;
+  setData(data);
+}
+
+ByteVector::~ByteVector()
+{
+  if(d->deref())
+    delete d;
+}
+
+ByteVector &ByteVector::setData(const char *data, uint length)
+{
+  detach();
+
+  resize(length);
+
+  if(length > 0)
+    ::memcpy(DATA(d), data, length);
+
+  return *this;
+}
+
+ByteVector &ByteVector::setData(const char *data)
+{
+  return setData(data, ::strlen(data));
+}
+
+char *ByteVector::data()
+{
+  detach();
+  return size() > 0 ? DATA(d) : 0;
+}
+
+const char *ByteVector::data() const
+{
+  return size() > 0 ? DATA(d) : 0;
+}
+
+ByteVector ByteVector::mid(uint index, uint length) const
+{
+  ByteVector v;
+
+  if(index > size())
+    return v;
+
+  ConstIterator endIt;
+
+  if(length < 0xffffffff && length + index < size())
+    endIt = d->data.begin() + index + length;
+  else
+    endIt = d->data.end();
+
+  v.d->data.insert(v.d->data.begin(), ConstIterator(d->data.begin() + index), endIt);
+  v.d->size = v.d->data.size();
+
+  return v;
+}
+
+char ByteVector::at(uint index) const
+{
+  return index < size() ? d->data[index] : 0;
+}
+
+int ByteVector::find(const ByteVector &pattern, uint offset, int byteAlign) const
+{
+  return vectorFind<ByteVector>(*this, pattern, offset, byteAlign);
+}
+
+int ByteVector::rfind(const ByteVector &pattern, uint offset, int byteAlign) const
+{
+  // Ok, this is a little goofy, but pretty cool after it sinks in.  Instead of
+  // reversing the find method's Boyer-Moore search algorithm I created a "mirror"
+  // for a ByteVector to reverse the behavior of the accessors.
+
+  ByteVectorMirror v(*this);
+  ByteVectorMirror p(pattern);
+
+  return v.find(p, offset, byteAlign);
+}
+
+bool ByteVector::containsAt(const ByteVector &pattern, uint offset, uint patternOffset, uint patternLength) const
+{
+  if(pattern.size() < patternLength)
+    patternLength = pattern.size();
+
+  // do some sanity checking -- all of these things are needed for the search to be valid
+
+  if(patternLength > size() || offset >= size() || patternOffset >= pattern.size() || patternLength == 0)
+    return false;
+
+  // loop through looking for a mismatch
+
+  for(uint i = 0; i < patternLength - patternOffset; i++) {
+    if(at(i + offset) != pattern[i + patternOffset])
+      return false;
+  }
+
+  return true;
+}
+
+bool ByteVector::startsWith(const ByteVector &pattern) const
+{
+  return containsAt(pattern, 0);
+}
+
+bool ByteVector::endsWith(const ByteVector &pattern) const
+{
+  return containsAt(pattern, size() - pattern.size());
+}
+
+ByteVector &ByteVector::replace(const ByteVector &pattern, const ByteVector &with)
+{
+  if(pattern.size() == 0 || pattern.size() > size())
+    return *this;
+
+  const int patternSize = pattern.size();
+  const int withSize = with.size();
+
+  int offset = find(pattern);
+
+  while(offset >= 0) {
+
+    const int originalSize = size();
+
+    if(withSize > patternSize)
+      resize(originalSize + withSize - patternSize);
+
+    if(patternSize != withSize)
+      ::memcpy(data() + offset + withSize, mid(offset + patternSize).data(), originalSize - offset - patternSize);
+
+    if(withSize < patternSize)
+      resize(originalSize + withSize - patternSize);
+
+    ::memcpy(data() + offset, with.data(), withSize);
+
+    offset = find(pattern, offset + withSize);
+  }
+
+  return *this;
+}
+
+int ByteVector::endsWithPartialMatch(const ByteVector &pattern) const
+{
+  if(pattern.size() > size())
+    return -1;
+
+  const int startIndex = size() - pattern.size();
+
+  // try to match the last n-1 bytes from the vector (where n is the pattern
+  // size) -- continue trying to match n-2, n-3...1 bytes
+
+  for(uint i = 1; i < pattern.size(); i++) {
+    if(containsAt(pattern, startIndex + i, 0, pattern.size() - i))
+      return startIndex + i;
+  }
+
+  return -1;
+}
+
+ByteVector &ByteVector::append(const ByteVector &v)
+{
+  if(v.d->size == 0)
+    return *this; // Simply return if appending nothing.
+
+  detach();
+
+  uint originalSize = d->size;
+  resize(d->size + v.d->size);
+  ::memcpy(DATA(d) + originalSize, DATA(v.d), v.size());
+
+  return *this;
+}
+
+ByteVector &ByteVector::clear()
+{
+  detach();
+  d->data.clear();
+  d->size = 0;
+
+  return *this;
+}
+
+TagLib::uint ByteVector::size() const
+{
+  return d->size;
+}
+
+ByteVector &ByteVector::resize(uint size, char padding)
+{
+  if(d->size < size) {
+    d->data.reserve(size);
+    d->data.insert(d->data.end(), size - d->size, padding);
+  }
+  else
+    d->data.erase(d->data.begin() + size, d->data.end());
+
+  d->size = size;
+
+  return *this;
+}
+
+ByteVector::Iterator ByteVector::begin()
+{
+  return d->data.begin();
+}
+
+ByteVector::ConstIterator ByteVector::begin() const
+{
+  return d->data.begin();
+}
+
+ByteVector::Iterator ByteVector::end()
+{
+  return d->data.end();
+}
+
+ByteVector::ConstIterator ByteVector::end() const
+{
+  return d->data.end();
+}
+
+bool ByteVector::isNull() const
+{
+  return d == null.d;
+}
+
+bool ByteVector::isEmpty() const
+{
+  return d->data.size() == 0;
+}
+
+TagLib::uint ByteVector::checksum() const
+{
+  uint sum = 0;
+  for(ByteVector::ConstIterator it = begin(); it != end(); ++it)
+    sum = (sum << 8) ^ crcTable[((sum >> 24) & 0xff) ^ uchar(*it)];
+  return sum;
+}
+
+TagLib::uint ByteVector::toUInt(bool mostSignificantByteFirst) const
+{
+  return toNumber<uint>(d->data, mostSignificantByteFirst);
+}
+
+short ByteVector::toShort(bool mostSignificantByteFirst) const
+{
+  return toNumber<unsigned short>(d->data, mostSignificantByteFirst);
+}
+
+long long ByteVector::toLongLong(bool mostSignificantByteFirst) const
+{
+  return toNumber<unsigned long long>(d->data, mostSignificantByteFirst);
+}
+
+const char &ByteVector::operator[](int index) const
+{
+  return d->data[index];
+}
+
+char &ByteVector::operator[](int index)
+{
+  detach();
+
+  return d->data[index];
+}
+
+bool ByteVector::operator==(const ByteVector &v) const
+{
+  if(d->size != v.d->size)
+    return false;
+
+  return ::memcmp(data(), v.data(), size()) == 0;
+}
+
+bool ByteVector::operator!=(const ByteVector &v) const
+{
+  return !operator==(v);
+}
+
+bool ByteVector::operator==(const char *s) const
+{
+  if(d->size != ::strlen(s))
+    return false;
+
+  return ::memcmp(data(), s, d->size) == 0;
+}
+
+bool ByteVector::operator!=(const char *s) const
+{
+  return !operator==(s);
+}
+
+bool ByteVector::operator<(const ByteVector &v) const
+{
+  int result = ::memcmp(data(), v.data(), d->size < v.d->size ? d->size : v.d->size);
+
+  if(result != 0)
+    return result < 0;
+  else
+    return size() < v.size();
+}
+
+bool ByteVector::operator>(const ByteVector &v) const
+{
+  return v < *this;
+}
+
+ByteVector ByteVector::operator+(const ByteVector &v) const
+{
+  ByteVector sum(*this);
+  sum.append(v);
+  return sum;
+}
+
+ByteVector &ByteVector::operator=(const ByteVector &v)
+{
+  if(&v == this)
+    return *this;
+
+  if(d->deref())
+    delete d;
+
+  d = v.d;
+  d->ref();
+  return *this;
+}
+
+ByteVector &ByteVector::operator=(char c)
+{
+  *this = ByteVector(c);
+  return *this;
+}
+
+ByteVector &ByteVector::operator=(const char *data)
+{
+  *this = ByteVector(data);
+  return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void ByteVector::detach()
+{
+  if(d->count() > 1) {
+    d->deref();
+    d = new ByteVectorPrivate(d->data);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// related functions
+////////////////////////////////////////////////////////////////////////////////
+
+std::ostream &operator<<(std::ostream &s, const ByteVector &v)
+{
+  for(TagLib::uint i = 0; i < v.size(); i++)
+    s << v[i];
+  return s;
+}
diff --git a/lib-src/taglib/taglib/toolkit/tbytevector.h b/lib-src/taglib/taglib/toolkit/tbytevector.h
new file mode 100644
index 0000000..66a424e
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tbytevector.h
@@ -0,0 +1,409 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_BYTEVECTOR_H
+#define TAGLIB_BYTEVECTOR_H
+
+#include "taglib.h"
+#include "taglib_export.h"
+
+#include <vector>
+#include <ostream>
+
+namespace TagLib {
+
+  //! A byte vector
+
+  /*!
+   * This class provides a byte vector with some methods that are useful for
+   * tagging purposes.  Many of the search functions are tailored to what is
+   * useful for finding tag related paterns in a data array.
+   */
+
+  class TAGLIB_EXPORT ByteVector
+  {
+  public:
+#ifndef DO_NOT_DOCUMENT
+    typedef std::vector<char>::iterator Iterator;
+    typedef std::vector<char>::const_iterator ConstIterator;
+#endif
+
+    /*!
+     * Constructs an empty byte vector.
+     */
+    ByteVector();
+
+    /*!
+     * Construct a vector of size \a size with all values set to \a value by
+     * default.
+     */
+    ByteVector(uint size, char value = 0);
+
+    /*!
+     * Contructs a byte vector that is a copy of \a v.
+     */
+    ByteVector(const ByteVector &v);
+
+    /*!
+     * Contructs a byte vector that contains \a c.
+     */
+    ByteVector(char c);
+
+    /*!
+     * Constructs a byte vector that copies \a data for up to \a length bytes.
+     */
+    ByteVector(const char *data, uint length);
+
+    /*!
+     * Constructs a byte vector that copies \a data up to the first null
+     * byte.  The behavior is undefined if \a data is not null terminated.
+     * This is particularly useful for constructing byte arrays from string
+     * constants.
+     */
+    ByteVector(const char *data);
+
+    /*!
+     * Destroys this ByteVector instance.
+     */
+    virtual ~ByteVector();
+
+    /*!
+     * Sets the data for the byte array using the first \a length bytes of \a data
+     */
+    ByteVector &setData(const char *data, uint length);
+
+    /*!
+     * Sets the data for the byte array copies \a data up to the first null
+     * byte.  The behavior is undefined if \a data is not null terminated.
+     */
+    ByteVector &setData(const char *data);
+
+    /*!
+     * Returns a pointer to the internal data structure.
+     *
+     * \warning Care should be taken when modifying this data structure as it is
+     * easy to corrupt the ByteVector when doing so.  Specifically, while the
+     * data may be changed, its length may not be.
+     */
+    char *data();
+
+    /*!
+     * Returns a pointer to the internal data structure which may not be modified.
+     */
+    const char *data() const;
+
+    /*!
+     * Returns a byte vector made up of the bytes starting at \a index and
+     * for \a length bytes.  If \a length is not specified it will return the bytes
+     * from \a index to the end of the vector.
+     */
+    ByteVector mid(uint index, uint length = 0xffffffff) const;
+
+    /*!
+     * This essentially performs the same as operator[](), but instead of causing
+     * a runtime error if the index is out of bounds, it will return a null byte.
+     */
+    char at(uint index) const;
+
+    /*!
+     * Searches the ByteVector for \a pattern starting at \a offset and returns
+     * the offset.  Returns -1 if the pattern was not found.  If \a byteAlign is
+     * specified the pattern will only be matched if it starts on a byte divisible
+     * by \a byteAlign (starting from \a offset).
+     */
+    int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const;
+
+    /*!
+     * Searches the ByteVector for \a pattern starting from either the end of the
+     * vector or \a offset and returns the offset.  Returns -1 if the pattern was
+     * not found.  If \a byteAlign is specified the pattern will only be matched
+     * if it starts on a byte divisible by \a byteAlign (starting from \a offset).
+     */
+    int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const;
+
+    /*!
+     * Checks to see if the vector contains the \a pattern starting at position
+     * \a offset.  Optionally, if you only want to search for part of the pattern
+     * you can specify an offset within the pattern to start from.  Also, you can
+     * specify to only check for the first \a patternLength bytes of \a pattern with
+     * the \a patternLength argument.
+     */
+    bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const;
+
+    /*!
+     * Returns true if the vector starts with \a pattern.
+     */
+    bool startsWith(const ByteVector &pattern) const;
+
+    /*!
+     * Returns true if the vector ends with \a pattern.
+     */
+    bool endsWith(const ByteVector &pattern) const;
+
+    /*!
+     * Replaces \a pattern with \a with and returns a reference to the ByteVector
+     * after the operation.  This \e does modify the vector.
+     */
+    ByteVector &replace(const ByteVector &pattern, const ByteVector &with);
+
+    /*!
+     * Checks for a partial match of \a pattern at the end of the vector.  It
+     * returns the offset of the partial match within the vector, or -1 if the
+     * pattern is not found.  This method is particularly useful when searching for
+     * patterns that start in one vector and end in another.  When combined with
+     * startsWith() it can be used to find a pattern that overlaps two buffers.
+     *
+     * \note This will not match the complete pattern at the end of the string; use
+     * endsWith() for that.
+     */
+    int endsWithPartialMatch(const ByteVector &pattern) const;
+
+    /*!
+     * Appends \a v to the end of the ByteVector.
+     */
+    ByteVector &append(const ByteVector &v);
+
+    /*!
+     * Clears the data.
+     */
+    ByteVector &clear();
+
+    /*!
+     * Returns the size of the array.
+     */
+    uint size() const;
+
+    /*!
+     * Resize the vector to \a size.  If the vector is currently less than
+     * \a size, pad the remaining spaces with \a padding.  Returns a reference
+     * to the resized vector.
+     */
+    ByteVector &resize(uint size, char padding = 0);
+
+    /*!
+     * Returns an Iterator that points to the front of the vector.
+     */
+    Iterator begin();
+
+    /*!
+     * Returns a ConstIterator that points to the front of the vector.
+     */
+    ConstIterator begin() const;
+
+    /*!
+     * Returns an Iterator that points to the back of the vector.
+     */
+    Iterator end();
+
+    /*!
+     * Returns a ConstIterator that points to the back of the vector.
+     */
+    ConstIterator end() const;
+
+    /*!
+     * Returns true if the vector is null.
+     *
+     * \note A vector may be empty without being null.
+     * \see isEmpty()
+     */
+    bool isNull() const;
+
+    /*!
+     * Returns true if the ByteVector is empty.
+     *
+     * \see size()
+     * \see isNull()
+     */
+    bool isEmpty() const;
+
+    /*!
+     * Returns a CRC checksum of the byte vector's data.
+     */
+    uint checksum() const;
+
+    /*!
+     * Converts the first 4 bytes of the vector to an unsigned integer.
+     *
+     * If \a mostSignificantByteFirst is true this will operate left to right
+     * evaluating the integer.  For example if \a mostSignificantByteFirst is
+     * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 ==
+     * 0x01000000 == 1.
+     *
+     * \see fromUInt()
+     */
+    uint toUInt(bool mostSignificantByteFirst = true) const;
+
+    /*!
+     * Converts the first 2 bytes of the vector to a short.
+     *
+     * If \a mostSignificantByteFirst is true this will operate left to right
+     * evaluating the integer.  For example if \a mostSignificantByteFirst is
+     * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1.
+     *
+     * \see fromShort()
+     */
+    short toShort(bool mostSignificantByteFirst = true) const;
+
+    /*!
+     * Converts the first 8 bytes of the vector to a (signed) long long.
+     *
+     * If \a mostSignificantByteFirst is true this will operate left to right
+     * evaluating the integer.  For example if \a mostSignificantByteFirst is
+     * true then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1,
+     * if false, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.
+     *
+     * \see fromUInt()
+     */
+    long long toLongLong(bool mostSignificantByteFirst = true) const;
+
+    /*!
+     * Creates a 4 byte ByteVector based on \a value.  If
+     * \a mostSignificantByteFirst is true, then this will operate left to right
+     * in building the ByteVector.  For example if \a mostSignificantByteFirst is
+     * true then $00 00 00 01 == 0x00000001 == 1, if false, $01 00 00 00 ==
+     * 0x01000000 == 1.
+     *
+     * \see toUInt()
+     */
+    static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true);
+
+    /*!
+     * Creates a 2 byte ByteVector based on \a value.  If
+     * \a mostSignificantByteFirst is true, then this will operate left to right
+     * in building the ByteVector.  For example if \a mostSignificantByteFirst is
+     * true then $00 01 == 0x0001 == 1, if false, $01 00 == 0x0100 == 1.
+     *
+     * \see toShort()
+     */
+    static ByteVector fromShort(short value, bool mostSignificantByteFirst = true);
+
+    /*!
+     * Creates a 8 byte ByteVector based on \a value.  If
+     * \a mostSignificantByteFirst is true, then this will operate left to right
+     * in building the ByteVector.  For example if \a mostSignificantByteFirst is
+     * true then $00 00 00 01 == 0x0000000000000001 == 1, if false,
+     * $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1.
+     *
+     * \see toLongLong()
+     */
+    static ByteVector fromLongLong(long long value, bool mostSignificantByteFirst = true);
+
+    /*!
+     * Returns a ByteVector based on the CString \a s.
+     */
+    static ByteVector fromCString(const char *s, uint length = 0xffffffff);
+
+    /*!
+     * Returns a const refernence to the byte at \a index.
+     */
+    const char &operator[](int index) const;
+
+    /*!
+     * Returns a reference to the byte at \a index.
+     */
+    char &operator[](int index);
+
+    /*!
+     * Returns true if this ByteVector and \a v are equal.
+     */
+    bool operator==(const ByteVector &v) const;
+
+    /*!
+     * Returns true if this ByteVector and \a v are not equal.
+     */
+    bool operator!=(const ByteVector &v) const;
+
+    /*!
+     * Returns true if this ByteVector and the null terminated C string \a s
+     * contain the same data.
+     */
+    bool operator==(const char *s) const;
+
+    /*!
+     * Returns true if this ByteVector and the null terminated C string \a s
+     * do not contain the same data.
+     */
+    bool operator!=(const char *s) const;
+
+    /*!
+     * Returns true if this ByteVector is less than \a v.  The value of the
+     * vectors is determined by evaluating the character from left to right, and
+     * in the event one vector is a superset of the other, the size is used.
+     */
+    bool operator<(const ByteVector &v) const;
+
+    /*!
+     * Returns true if this ByteVector is greater than \a v.
+     */
+    bool operator>(const ByteVector &v) const;
+
+    /*!
+     * Returns a vector that is \a v appended to this vector.
+     */
+    ByteVector operator+(const ByteVector &v) const;
+
+    /*!
+     * Copies ByteVector \a v.
+     */
+    ByteVector &operator=(const ByteVector &v);
+
+    /*!
+     * Copies ByteVector \a v.
+     */
+    ByteVector &operator=(char c);
+
+    /*!
+     * Copies ByteVector \a v.
+     */
+    ByteVector &operator=(const char *data);
+
+    /*!
+     * A static, empty ByteVector which is convenient and fast (since returning
+     * an empty or "null" value does not require instantiating a new ByteVector).
+     */
+    static ByteVector null;
+
+  protected:
+    /*
+     * If this ByteVector is being shared via implicit sharing, do a deep copy
+     * of the data and separate from the shared members.  This should be called
+     * by all non-const subclass members.
+     */
+    void detach();
+
+  private:
+    class ByteVectorPrivate;
+    ByteVectorPrivate *d;
+  };
+
+}
+
+/*!
+ * \relates TagLib::ByteVector
+ * Streams the ByteVector \a v to the output stream \a s.
+ */
+TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v);
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tbytevectorlist.cpp b/lib-src/taglib/taglib/toolkit/tbytevectorlist.cpp
new file mode 100644
index 0000000..71d6f69
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tbytevectorlist.cpp
@@ -0,0 +1,102 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tbytevectorlist.h"
+
+using namespace TagLib;
+
+class ByteVectorListPrivate
+{
+
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members
+////////////////////////////////////////////////////////////////////////////////
+
+ByteVectorList ByteVectorList::split(const ByteVector &v, const ByteVector &pattern,
+                                     int byteAlign)
+{
+  return split(v, pattern, byteAlign, 0);
+}
+
+ByteVectorList ByteVectorList::split(const ByteVector &v, const ByteVector &pattern,
+                                     int byteAlign, int max)
+{
+  ByteVectorList l;
+
+  uint previousOffset = 0;
+  for(int offset = v.find(pattern, 0, byteAlign);
+      offset != -1 && (max == 0 || max > int(l.size()) + 1);
+      offset = v.find(pattern, offset + pattern.size(), byteAlign))
+  {
+    if(offset - previousOffset > 1)
+      l.append(v.mid(previousOffset, offset - previousOffset));
+    else
+      l.append(ByteVector::null);
+
+    previousOffset = offset + pattern.size();
+  }
+
+  if(previousOffset < v.size())
+    l.append(v.mid(previousOffset, v.size() - previousOffset));
+
+  return l;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+ByteVectorList::ByteVectorList() : List<ByteVector>()
+{
+
+}
+
+ByteVectorList::ByteVectorList(const ByteVectorList &l) : List<ByteVector>(l)
+{
+
+}
+
+ByteVectorList::~ByteVectorList()
+{
+
+}
+
+ByteVector ByteVectorList::toByteVector(const ByteVector &separator) const
+{
+  ByteVector v;
+
+  ConstIterator it = begin();
+
+  while(it != end()) {
+    v.append(*it);
+    it++;
+    if(it != end())
+      v.append(separator);
+  }
+
+  return v;
+}
diff --git a/lib-src/taglib/taglib/toolkit/tbytevectorlist.h b/lib-src/taglib/taglib/toolkit/tbytevectorlist.h
new file mode 100644
index 0000000..8d84710
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tbytevectorlist.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_BYTEVECTORLIST_H
+#define TAGLIB_BYTEVECTORLIST_H
+
+#include "taglib_export.h"
+#include "tbytevector.h"
+#include "tlist.h"
+
+namespace TagLib {
+
+  //! A list of ByteVectors
+
+  /*!
+   * A List specialization with some handy features useful for ByteVectors.
+   */
+
+  class TAGLIB_EXPORT ByteVectorList : public List<ByteVector>
+  {
+  public:
+
+    /*!
+     * Construct an empty ByteVectorList.
+     */
+    ByteVectorList();
+
+    /*!
+     * Destroys this ByteVectorList instance.
+     */
+    virtual ~ByteVectorList();
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a l.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    ByteVectorList(const ByteVectorList &l);
+
+    /*!
+     * Convert the ByteVectorList to a ByteVector separated by \a separator.  By
+     * default a space is used.
+     */
+    ByteVector toByteVector(const ByteVector &separator = " ") const;
+
+    /*!
+     * Splits the ByteVector \a v into several strings at \a pattern.  This will
+     * not include the pattern in the returned ByteVectors.
+     */
+    static ByteVectorList split(const ByteVector &v, const ByteVector &pattern,
+                                int byteAlign = 1);
+    /*!
+     * Splits the ByteVector \a v into several strings at \a pattern.  This will
+     * not include the pattern in the returned ByteVectors.  \a max is the
+     * maximum number of entries that will be separated.  If \a max for instance
+     * is 2 then a maximum of 1 match will be found and the vector will be split
+     * on that match.
+     */
+    // BIC: merge with the function above
+    static ByteVectorList split(const ByteVector &v, const ByteVector &pattern,
+                                int byteAlign, int max);
+  private:
+    class ByteVectorListPrivate;
+    ByteVectorListPrivate *d;
+  };
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tdebug.cpp b/lib-src/taglib/taglib/toolkit/tdebug.cpp
new file mode 100644
index 0000000..341bb37
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tdebug.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <iostream>
+#include <bitset>
+
+#include "tdebug.h"
+#include "tstring.h"
+
+using namespace TagLib;
+
+#ifndef NDEBUG
+void TagLib::debug(const String &s)
+{
+  std::cerr << "TagLib: " << s << std::endl;
+}
+
+void TagLib::debugData(const ByteVector &v)
+{
+  for(uint i = 0; i < v.size(); i++) {
+
+    std::cout << "*** [" << i << "] - '" << char(v[i]) << "' - int " << int(v[i])
+              << std::endl;
+
+    std::bitset<8> b(v[i]);
+
+    for(int j = 0; j < 8; j++)
+      std::cout << i << ":" << j << " " << b.test(j) << std::endl;
+
+    std::cout << std::endl;
+  }
+}
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tdebug.h b/lib-src/taglib/taglib/toolkit/tdebug.h
new file mode 100644
index 0000000..a932b26
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tdebug.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_DEBUG_H
+#define TAGLIB_DEBUG_H
+
+namespace TagLib {
+
+  class String;
+  class ByteVector;
+
+#ifndef DO_NOT_DOCUMENT
+#ifndef NDEBUG
+
+  /*!
+   * A simple function that prints debugging output to cerr if debugging is
+   * not disabled.
+   *
+   * \warning Do not use this outside of TagLib, it could lead to undefined
+   * symbols in your build if TagLib is built with NDEBUG defined and your
+   * application is not.
+   *
+   * \internal
+   */
+  void debug(const String &s);
+
+  /*!
+   * For debugging binary data.
+   *
+   * \warning Do not use this outside of TagLib, it could lead to undefined
+   * symbols in your build if TagLib is built with NDEBUG defined and your
+   * application is not.
+   *
+   * \internal
+   */
+  void debugData(const ByteVector &v);
+
+#else
+
+  // Define these to an empty statement if debugging is disabled.
+
+#define debug(x)
+#define debugData(x)
+
+#endif
+#endif
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tfile.cpp b/lib-src/taglib/taglib/toolkit/tfile.cpp
new file mode 100644
index 0000000..7090a64
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tfile.cpp
@@ -0,0 +1,564 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tfile.h"
+#include "tstring.h"
+#include "tdebug.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+# include <wchar.h>
+# include <windows.h>
+# include <io.h>
+# define ftruncate _chsize
+#else
+# include <unistd.h>
+#endif
+
+#include <stdlib.h>
+
+#ifndef R_OK
+# define R_OK 4
+#endif
+#ifndef W_OK
+# define W_OK 2
+#endif
+
+using namespace TagLib;
+
+#ifdef _WIN32
+
+typedef FileName FileNameHandle;
+
+#else
+
+struct FileNameHandle : public std::string
+{
+  FileNameHandle(FileName name) : std::string(name) {}
+  operator FileName () const { return c_str(); }
+};
+
+#endif
+
+class File::FilePrivate
+{
+public:
+  FilePrivate(FileName fileName);
+
+  FILE *file;
+
+  FileNameHandle name;
+
+  bool readOnly;
+  bool valid;
+  ulong size;
+  static const uint bufferSize = 1024;
+};
+
+File::FilePrivate::FilePrivate(FileName fileName) :
+  file(0),
+  name(fileName),
+  readOnly(true),
+  valid(true),
+  size(0)
+{
+  // First try with read / write mode, if that fails, fall back to read only.
+
+#ifdef _WIN32
+
+  if(wcslen((const wchar_t *) fileName) > 0) {
+
+    file = _wfopen(name, L"rb+");
+
+    if(file)
+      readOnly = false;
+    else
+      file = _wfopen(name, L"rb");
+
+    if(file)
+      return;
+
+  }
+
+#endif
+
+  file = fopen(name, "rb+");
+
+  if(file)
+    readOnly = false;
+  else
+    file = fopen(name, "rb");
+
+  if(!file)
+    debug("Could not open file " + String((const char *) name));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+File::File(FileName file)
+{
+  d = new FilePrivate(file);
+}
+
+File::~File()
+{
+  if(d->file)
+    fclose(d->file);
+  delete d;
+}
+
+FileName File::name() const
+{
+  return d->name;
+}
+
+ByteVector File::readBlock(ulong length)
+{
+  if(!d->file) {
+    debug("File::readBlock() -- Invalid File");
+    return ByteVector::null;
+  }
+
+  if(length == 0)
+    return ByteVector::null;
+
+  if(length > FilePrivate::bufferSize &&
+     length > ulong(File::length()))
+  {
+    length = File::length();
+  }
+
+  ByteVector v(static_cast<uint>(length));
+  const int count = fread(v.data(), sizeof(char), length, d->file);
+  v.resize(count);
+  return v;
+}
+
+void File::writeBlock(const ByteVector &data)
+{
+  if(!d->file)
+    return;
+
+  if(d->readOnly) {
+    debug("File::writeBlock() -- attempted to write to a file that is not writable");
+    return;
+  }
+
+  fwrite(data.data(), sizeof(char), data.size(), d->file);
+}
+
+long File::find(const ByteVector &pattern, long fromOffset, const ByteVector &before)
+{
+  if(!d->file || pattern.size() > d->bufferSize)
+      return -1;
+
+  // The position in the file that the current buffer starts at.
+
+  long bufferOffset = fromOffset;
+  ByteVector buffer;
+
+  // These variables are used to keep track of a partial match that happens at
+  // the end of a buffer.
+
+  int previousPartialMatch = -1;
+  int beforePreviousPartialMatch = -1;
+
+  // Save the location of the current read pointer.  We will restore the
+  // position using seek() before all returns.
+
+  long originalPosition = tell();
+
+  // Start the search at the offset.
+
+  seek(fromOffset);
+
+  // This loop is the crux of the find method.  There are three cases that we
+  // want to account for:
+  //
+  // (1) The previously searched buffer contained a partial match of the search
+  // pattern and we want to see if the next one starts with the remainder of
+  // that pattern.
+  //
+  // (2) The search pattern is wholly contained within the current buffer.
+  //
+  // (3) The current buffer ends with a partial match of the pattern.  We will
+  // note this for use in the next itteration, where we will check for the rest
+  // of the pattern.
+  //
+  // All three of these are done in two steps.  First we check for the pattern
+  // and do things appropriately if a match (or partial match) is found.  We
+  // then check for "before".  The order is important because it gives priority
+  // to "real" matches.
+
+  for(buffer = readBlock(d->bufferSize); buffer.size() > 0; buffer = readBlock(d->bufferSize)) {
+
+    // (1) previous partial match
+
+    if(previousPartialMatch >= 0 && int(d->bufferSize) > previousPartialMatch) {
+      const int patternOffset = (d->bufferSize - previousPartialMatch);
+      if(buffer.containsAt(pattern, 0, patternOffset)) {
+        seek(originalPosition);
+        return bufferOffset - d->bufferSize + previousPartialMatch;
+      }
+    }
+
+    if(!before.isNull() && beforePreviousPartialMatch >= 0 && int(d->bufferSize) > beforePreviousPartialMatch) {
+      const int beforeOffset = (d->bufferSize - beforePreviousPartialMatch);
+      if(buffer.containsAt(before, 0, beforeOffset)) {
+        seek(originalPosition);
+        return -1;
+      }
+    }
+
+    // (2) pattern contained in current buffer
+
+    long location = buffer.find(pattern);
+    if(location >= 0) {
+      seek(originalPosition);
+      return bufferOffset + location;
+    }
+
+    if(!before.isNull() && buffer.find(before) >= 0) {
+      seek(originalPosition);
+      return -1;
+    }
+
+    // (3) partial match
+
+    previousPartialMatch = buffer.endsWithPartialMatch(pattern);
+
+    if(!before.isNull())
+      beforePreviousPartialMatch = buffer.endsWithPartialMatch(before);
+
+    bufferOffset += d->bufferSize;
+  }
+
+  // Since we hit the end of the file, reset the status before continuing.
+
+  clear();
+
+  seek(originalPosition);
+
+  return -1;
+}
+
+
+long File::rfind(const ByteVector &pattern, long fromOffset, const ByteVector &before)
+{
+  if(!d->file || pattern.size() > d->bufferSize)
+      return -1;
+
+  // The position in the file that the current buffer starts at.
+
+  ByteVector buffer;
+
+  // These variables are used to keep track of a partial match that happens at
+  // the end of a buffer.
+
+  /*
+  int previousPartialMatch = -1;
+  int beforePreviousPartialMatch = -1;
+  */
+
+  // Save the location of the current read pointer.  We will restore the
+  // position using seek() before all returns.
+
+  long originalPosition = tell();
+
+  // Start the search at the offset.
+
+  long bufferOffset;
+  if(fromOffset == 0) {
+    seek(-1 * int(d->bufferSize), End);
+    bufferOffset = tell();
+  }
+  else {
+    seek(fromOffset + -1 * int(d->bufferSize), Beginning);
+    bufferOffset = tell();
+  }
+
+  // See the notes in find() for an explanation of this algorithm.
+
+  for(buffer = readBlock(d->bufferSize); buffer.size() > 0; buffer = readBlock(d->bufferSize)) {
+
+    // TODO: (1) previous partial match
+
+    // (2) pattern contained in current buffer
+
+    long location = buffer.rfind(pattern);
+    if(location >= 0) {
+      seek(originalPosition);
+      return bufferOffset + location;
+    }
+
+    if(!before.isNull() && buffer.find(before) >= 0) {
+      seek(originalPosition);
+      return -1;
+    }
+
+    // TODO: (3) partial match
+
+    bufferOffset -= d->bufferSize;
+    seek(bufferOffset);
+  }
+
+  // Since we hit the end of the file, reset the status before continuing.
+
+  clear();
+
+  seek(originalPosition);
+
+  return -1;
+}
+
+void File::insert(const ByteVector &data, ulong start, ulong replace)
+{
+  if(!d->file)
+    return;
+
+  if(data.size() == replace) {
+    seek(start);
+    writeBlock(data);
+    return;
+  }
+  else if(data.size() < replace) {
+      seek(start);
+      writeBlock(data);
+      removeBlock(start + data.size(), replace - data.size());
+      return;
+  }
+
+  // Woohoo!  Faster (about 20%) than id3lib at last.  I had to get hardcore
+  // and avoid TagLib's high level API for rendering just copying parts of
+  // the file that don't contain tag data.
+  //
+  // Now I'll explain the steps in this ugliness:
+
+  // First, make sure that we're working with a buffer that is longer than
+  // the *differnce* in the tag sizes.  We want to avoid overwriting parts
+  // that aren't yet in memory, so this is necessary.
+
+  ulong bufferLength = bufferSize();
+
+  while(data.size() - replace > bufferLength)
+    bufferLength += bufferSize();
+
+  // Set where to start the reading and writing.
+
+  long readPosition = start + replace;
+  long writePosition = start;
+
+  ByteVector buffer;
+  ByteVector aboutToOverwrite(static_cast<uint>(bufferLength));
+
+  // This is basically a special case of the loop below.  Here we're just
+  // doing the same steps as below, but since we aren't using the same buffer
+  // size -- instead we're using the tag size -- this has to be handled as a
+  // special case.  We're also using File::writeBlock() just for the tag.
+  // That's a bit slower than using char *'s so, we're only doing it here.
+
+  seek(readPosition);
+  int bytesRead = fread(aboutToOverwrite.data(), sizeof(char), bufferLength, d->file);
+  readPosition += bufferLength;
+
+  seek(writePosition);
+  writeBlock(data);
+  writePosition += data.size();
+
+  buffer = aboutToOverwrite;
+
+  // In case we've already reached the end of file...
+
+  buffer.resize(bytesRead);
+
+  // Ok, here's the main loop.  We want to loop until the read fails, which
+  // means that we hit the end of the file.
+
+  while(!buffer.isEmpty()) {
+
+    // Seek to the current read position and read the data that we're about
+    // to overwrite.  Appropriately increment the readPosition.
+
+    seek(readPosition);
+    bytesRead = fread(aboutToOverwrite.data(), sizeof(char), bufferLength, d->file);
+    aboutToOverwrite.resize(bytesRead);
+    readPosition += bufferLength;
+
+    // Check to see if we just read the last block.  We need to call clear()
+    // if we did so that the last write succeeds.
+
+    if(ulong(bytesRead) < bufferLength)
+      clear();
+
+    // Seek to the write position and write our buffer.  Increment the
+    // writePosition.
+
+    seek(writePosition);
+    fwrite(buffer.data(), sizeof(char), buffer.size(), d->file);
+    writePosition += buffer.size();
+
+    // Make the current buffer the data that we read in the beginning.
+
+    buffer = aboutToOverwrite;
+
+    // Again, we need this for the last write.  We don't want to write garbage
+    // at the end of our file, so we need to set the buffer size to the amount
+    // that we actually read.
+
+    bufferLength = bytesRead;
+  }
+}
+
+void File::removeBlock(ulong start, ulong length)
+{
+  if(!d->file)
+    return;
+
+  ulong bufferLength = bufferSize();
+
+  long readPosition = start + length;
+  long writePosition = start;
+
+  ByteVector buffer(static_cast<uint>(bufferLength));
+
+  ulong bytesRead = 1;
+
+  while(bytesRead != 0) {
+    seek(readPosition);
+    bytesRead = fread(buffer.data(), sizeof(char), bufferLength, d->file);
+    readPosition += bytesRead;
+
+    // Check to see if we just read the last block.  We need to call clear()
+    // if we did so that the last write succeeds.
+
+    if(bytesRead < bufferLength)
+      clear();
+
+    seek(writePosition);
+    fwrite(buffer.data(), sizeof(char), bytesRead, d->file);
+    writePosition += bytesRead;
+  }
+  truncate(writePosition);
+}
+
+bool File::readOnly() const
+{
+  return d->readOnly;
+}
+
+bool File::isReadable(const char *file)
+{
+  return access(file, R_OK) == 0;
+}
+
+bool File::isOpen() const
+{
+  return (d->file != NULL);
+}
+
+bool File::isValid() const
+{
+  return isOpen() && d->valid;
+}
+
+void File::seek(long offset, Position p)
+{
+  if(!d->file) {
+    debug("File::seek() -- trying to seek in a file that isn't opened.");
+    return;
+  }
+
+  switch(p) {
+  case Beginning:
+    fseek(d->file, offset, SEEK_SET);
+    break;
+  case Current:
+    fseek(d->file, offset, SEEK_CUR);
+    break;
+  case End:
+    fseek(d->file, offset, SEEK_END);
+    break;
+  }
+}
+
+void File::clear()
+{
+  clearerr(d->file);
+}
+
+long File::tell() const
+{
+  return ftell(d->file);
+}
+
+long File::length()
+{
+  // Do some caching in case we do multiple calls.
+
+  if(d->size > 0)
+    return d->size;
+
+  if(!d->file)
+    return 0;
+
+  long curpos = tell();
+
+  seek(0, End);
+  long endpos = tell();
+
+  seek(curpos, Beginning);
+
+  d->size = endpos;
+  return endpos;
+}
+
+bool File::isWritable(const char *file)
+{
+  return access(file, W_OK) == 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void File::setValid(bool valid)
+{
+  d->valid = valid;
+}
+
+void File::truncate(long length)
+{
+  ftruncate(fileno(d->file), length);
+}
+
+TagLib::uint File::bufferSize()
+{
+  return FilePrivate::bufferSize;
+}
diff --git a/lib-src/taglib/taglib/toolkit/tfile.h b/lib-src/taglib/taglib/toolkit/tfile.h
new file mode 100644
index 0000000..680125a
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tfile.h
@@ -0,0 +1,271 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_FILE_H
+#define TAGLIB_FILE_H
+
+#include "taglib_export.h"
+#include "taglib.h"
+#include "tbytevector.h"
+
+namespace TagLib {
+
+  class String;
+  class Tag;
+  class AudioProperties;
+
+#ifdef _WIN32
+  class TAGLIB_EXPORT FileName
+  {
+  public:
+    FileName(const wchar_t *name) : m_wname(name) {}
+    FileName(const char *name) : m_name(name) {}
+    operator const wchar_t *() const { return m_wname.c_str(); }
+    operator const char *() const { return m_name.c_str(); }
+  private:
+    std::string m_name;
+    std::wstring m_wname;
+  };
+#else
+  typedef const char *FileName;
+#endif
+
+  //! A file class with some useful methods for tag manipulation
+
+  /*!
+   * This class is a basic file class with some methods that are particularly
+   * useful for tag editors.  It has methods to take advantage of
+   * ByteVector and a binary search method for finding patterns in a file.
+   */
+
+  class TAGLIB_EXPORT File
+  {
+  public:
+    /*!
+     * Position in the file used for seeking.
+     */
+    enum Position {
+      //! Seek from the beginning of the file.
+      Beginning,
+      //! Seek from the current position in the file.
+      Current,
+      //! Seek from the end of the file.
+      End
+    };
+
+    /*!
+     * Destroys this File instance.
+     */
+    virtual ~File();
+
+    /*!
+     * Returns the file name in the local file system encoding.
+     */
+    FileName name() const;
+
+    /*!
+     * Returns a pointer to this file's tag.  This should be reimplemented in
+     * the concrete subclasses.
+     */
+    virtual Tag *tag() const = 0;
+
+    /*!
+     * Returns a pointer to this file's audio properties.  This should be
+     * reimplemented in the concrete subclasses.  If no audio properties were
+     * read then this will return a null pointer.
+     */
+    virtual AudioProperties *audioProperties() const = 0;
+
+    /*!
+     * Save the file and its associated tags.  This should be reimplemented in
+     * the concrete subclasses.  Returns true if the save succeeds.
+     *
+     * \warning On UNIX multiple processes are able to write to the same file at
+     * the same time.  This can result in serious file corruption.  If you are
+     * developing a program that makes use of TagLib from multiple processes you
+     * must insure that you are only doing writes to a particular file from one
+     * of them.
+     */
+    virtual bool save() = 0;
+
+    /*!
+     * Reads a block of size \a length at the current get pointer.
+     */
+    ByteVector readBlock(ulong length);
+
+    /*!
+     * Attempts to write the block \a data at the current get pointer.  If the
+     * file is currently only opened read only -- i.e. readOnly() returns true --
+     * this attempts to reopen the file in read/write mode.
+     *
+     * \note This should be used instead of using the streaming output operator
+     * for a ByteVector.  And even this function is significantly slower than
+     * doing output with a char[].
+     */
+    void writeBlock(const ByteVector &data);
+
+    /*!
+     * Returns the offset in the file that \a pattern occurs at or -1 if it can
+     * not be found.  If \a before is set, the search will only continue until the
+     * pattern \a before is found.  This is useful for tagging purposes to search
+     * for a tag before the synch frame.
+     *
+     * Searching starts at \a fromOffset, which defaults to the beginning of the
+     * file.
+     *
+     * \note This has the practial limitation that \a pattern can not be longer
+     * than the buffer size used by readBlock().  Currently this is 1024 bytes.
+     */
+    long find(const ByteVector &pattern,
+              long fromOffset = 0,
+              const ByteVector &before = ByteVector::null);
+
+    /*!
+     * Returns the offset in the file that \a pattern occurs at or -1 if it can
+     * not be found.  If \a before is set, the search will only continue until the
+     * pattern \a before is found.  This is useful for tagging purposes to search
+     * for a tag before the synch frame.
+     *
+     * Searching starts at \a fromOffset and proceeds from the that point to the
+     * beginning of the file and defaults to the end of the file.
+     *
+     * \note This has the practial limitation that \a pattern can not be longer
+     * than the buffer size used by readBlock().  Currently this is 1024 bytes.
+     */
+    long rfind(const ByteVector &pattern,
+               long fromOffset = 0,
+               const ByteVector &before = ByteVector::null);
+
+    /*!
+     * Insert \a data at position \a start in the file overwriting \a replace
+     * bytes of the original content.
+     *
+     * \note This method is slow since it requires rewriting all of the file
+     * after the insertion point.
+     */
+    void insert(const ByteVector &data, ulong start = 0, ulong replace = 0);
+
+    /*!
+     * Removes a block of the file starting a \a start and continuing for
+     * \a length bytes.
+     *
+     * \note This method is slow since it involves rewriting all of the file
+     * after the removed portion.
+     */
+    void removeBlock(ulong start = 0, ulong length = 0);
+
+    /*!
+     * Returns true if the file is read only (or if the file can not be opened).
+     */
+    bool readOnly() const;
+
+    /*!
+     * Since the file can currently only be opened as an argument to the
+     * constructor (sort-of by design), this returns if that open succeeded.
+     */
+    bool isOpen() const;
+
+    /*!
+     * Returns true if the file is open and readble and valid information for
+     * the Tag and / or AudioProperties was found.
+     */
+    bool isValid() const;
+
+    /*!
+     * Move the I/O pointer to \a offset in the file from position \a p.  This
+     * defaults to seeking from the beginning of the file.
+     *
+     * \see Position
+     */
+    void seek(long offset, Position p = Beginning);
+
+    /*!
+     * Reset the end-of-file and error flags on the file.
+     */
+    void clear();
+
+    /*!
+     * Returns the current offset withing the file.
+     */
+    long tell() const;
+
+    /*!
+     * Returns the length of the file.
+     */
+    long length();
+
+    /*!
+     * Returns true if \a file can be opened for reading.  If the file does not
+     * exist, this will return false.
+     *
+     * \deprecated
+     */
+    static bool isReadable(const char *file);
+
+    /*!
+     * Returns true if \a file can be opened for writing.
+     *
+     * \deprecated
+     */
+    static bool isWritable(const char *name);
+
+  protected:
+    /*!
+     * Construct a File object and opens the \a file.  \a file should be a
+     * be a C-string in the local file system encoding.
+     *
+     * \note Constructor is protected since this class should only be
+     * instantiated through subclasses.
+     */
+    File(FileName file);
+
+    /*!
+     * Marks the file as valid or invalid.
+     *
+     * \see isValid()
+     */
+    void setValid(bool valid);
+
+    /*!
+     * Truncates the file to a \a length.
+     */
+    void truncate(long length);
+
+    /*!
+     * Returns the buffer size that is used for internal buffering.
+     */
+    static uint bufferSize();
+
+  private:
+    File(const File &);
+    File &operator=(const File &);
+
+    class FilePrivate;
+    FilePrivate *d;
+  };
+
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tlist.h b/lib-src/taglib/taglib/toolkit/tlist.h
new file mode 100644
index 0000000..70be324
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tlist.h
@@ -0,0 +1,252 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_LIST_H
+#define TAGLIB_LIST_H
+
+#include "taglib.h"
+
+#include <list>
+
+namespace TagLib {
+
+  //! A generic, implicitly shared list.
+
+  /*!
+   * This is basic generic list that's somewhere between a std::list and a
+   * QValueList.  This class is implicitly shared.  For example:
+   *
+   * \code
+   *
+   * TagLib::List<int> l = someOtherIntList;
+   *
+   * \endcode
+   *
+   * The above example is very cheap.  This also makes lists suitable for the
+   * return types of functions.  The above example will just copy a pointer rather
+   * than copying the data in the list.  When your \e shared list's data changes,
+   * only \e then will the data be copied.
+   */
+
+  template <class T> class List
+  {
+  public:
+#ifndef DO_NOT_DOCUMENT
+    typedef typename std::list<T>::iterator Iterator;
+    typedef typename std::list<T>::const_iterator ConstIterator;
+#endif
+
+    /*!
+     * Constructs an empty list.
+     */
+    List();
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a l.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    List(const List<T> &l);
+
+    /*!
+     * Destroys this List instance.  If auto deletion is enabled and this list
+     * contains a pointer type all of the memebers are also deleted.
+     */
+    virtual ~List();
+
+    /*!
+     * Returns an STL style iterator to the beginning of the list.  See
+     * std::list::const_iterator for the semantics.
+     */
+    Iterator begin();
+
+    /*!
+     * Returns an STL style constant iterator to the beginning of the list.  See
+     * std::list::iterator for the semantics.
+     */
+    ConstIterator begin() const;
+
+    /*!
+     * Returns an STL style iterator to the end of the list.  See
+     * std::list::iterator for the semantics.
+     */
+    Iterator end();
+
+    /*!
+     * Returns an STL style constant iterator to the end of the list.  See
+     * std::list::const_iterator for the semantics.
+     */
+    ConstIterator end() const;
+
+    /*!
+     * Inserts a copy of \a value before \a it.
+     */
+    Iterator insert(Iterator it, const T &value);
+
+    /*!
+     * Inserts the \a value into the list.  This assumes that the list is
+     * currently sorted.  If \a unique is true then the value will not
+     * be inserted if it is already in the list.
+     */
+    List<T> &sortedInsert(const T &value, bool unique = false);
+
+    /*!
+     * Appends \a item to the end of the list and returns a reference to the
+     * list.
+     */
+    List<T> &append(const T &item);
+
+    /*!
+     * Appends all of the values in \a l to the end of the list and returns a
+     * reference to the list.
+     */
+    List<T> &append(const List<T> &l);
+
+    /*!
+     * Prepends \a item to the beginning list and returns a reference to the
+     * list.
+     */
+    List<T> &prepend(const T &item);
+
+    /*!
+     * Prepends all of the items in \a l to the beginning list and returns a
+     * reference to the list.
+     */
+    List<T> &prepend(const List<T> &l);
+
+    /*!
+     * Clears the list.  If auto deletion is enabled and this list contains a
+     * pointer type the members are also deleted.
+     *
+     * \see setAutoDelete()
+     */
+    List<T> &clear();
+
+    /*!
+     * Returns the number of elements in the list.
+     */
+    uint size() const;
+    bool isEmpty() const;
+
+    /*!
+     * Find the first occurrence of \a value.
+     */
+    Iterator find(const T &value);
+
+    /*!
+     * Find the first occurrence of \a value.
+     */
+    ConstIterator find(const T &value) const;
+
+    /*!
+     * Returns true if the list contains \a value.
+     */
+    bool contains(const T &value) const;
+
+    /*!
+     * Erase the item at \a it from the list.
+     */
+    Iterator erase(Iterator it);
+
+    /*!
+     * Returns a reference to the first item in the list.
+     */
+    const T &front() const;
+
+    /*!
+     * Returns a reference to the first item in the list.
+     */
+    T &front();
+
+    /*!
+     * Returns a reference to the last item in the list.
+     */
+    const T &back() const;
+
+    /*!
+     * Returns a reference to the last item in the list.
+     */
+    T &back();
+
+    /*!
+     * Auto delete the members of the list when the last reference to the list
+     * passes out of scope.  This will have no effect on lists which do not
+     * contain a pointer type.
+     *
+     * \note This relies on partial template instantiation -- most modern C++
+     * compilers should now support this.
+     */
+    void setAutoDelete(bool autoDelete);
+
+    /*!
+     * Returns a reference to item \a i in the list.
+     *
+     * \warning This method is slow.  Use iterators to loop through the list.
+     */
+    T &operator[](uint i);
+
+    /*!
+     * Returns a const reference to item \a i in the list.
+     *
+     * \warning This method is slow.  Use iterators to loop through the list.
+     */
+    const T &operator[](uint i) const;
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a l.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    List<T> &operator=(const List<T> &l);
+
+    /*!
+     * Compares this list with \a l and returns true if all of the elements are
+     * the same.
+     */
+    bool operator==(const List<T> &l) const;
+
+  protected:
+    /*
+     * If this List is being shared via implicit sharing, do a deep copy of the
+     * data and separate from the shared members.  This should be called by all
+     * non-const subclass members.
+     */
+    void detach();
+
+  private:
+#ifndef DO_NOT_DOCUMENT
+    template <class TP> class ListPrivate;
+    ListPrivate<T> *d;
+#endif
+  };
+
+}
+
+// Since GCC doesn't support the "export" keyword, we have to include the
+// implementation.
+
+#include "tlist.tcc"
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tlist.tcc b/lib-src/taglib/taglib/toolkit/tlist.tcc
new file mode 100644
index 0000000..cbc328b
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tlist.tcc
@@ -0,0 +1,316 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <algorithm>
+
+namespace TagLib {
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+// The functionality of List<T>::setAutoDelete() is implemented here partial
+// template specialization.  This is implemented in such a way that calling
+// setAutoDelete() on non-pointer types will simply have no effect.
+
+// A base for the generic and specialized private class types.  New
+// non-templatized members should be added here.
+
+class ListPrivateBase : public RefCounter
+{
+public:
+  ListPrivateBase() : autoDelete(false) {}
+  bool autoDelete;
+};
+
+// A generic implementation
+
+template <class T>
+template <class TP> class List<T>::ListPrivate  : public ListPrivateBase
+{
+public:
+  ListPrivate() : ListPrivateBase() {}
+  ListPrivate(const std::list<TP> &l) : ListPrivateBase(), list(l) {}
+  void clear() {
+    list.clear();
+  }
+  std::list<TP> list;
+};
+
+// A partial specialization for all pointer types that implements the
+// setAutoDelete() functionality.
+
+template <class T>
+template <class TP> class List<T>::ListPrivate<TP *>  : public ListPrivateBase
+{
+public:
+  ListPrivate() : ListPrivateBase() {}
+  ListPrivate(const std::list<TP *> &l) : ListPrivateBase(), list(l) {}
+  ~ListPrivate() {
+    clear();
+  }
+  void clear() {
+    if(autoDelete) {
+      typename std::list<TP *>::const_iterator it = list.begin();
+      for(; it != list.end(); ++it)
+        delete *it;
+    }
+    list.clear();
+  }
+  std::list<TP *> list;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+template <class T>
+List<T>::List()
+{
+  d = new ListPrivate<T>;
+}
+
+template <class T>
+List<T>::List(const List<T> &l) : d(l.d)
+{
+  d->ref();
+}
+
+template <class T>
+List<T>::~List()
+{
+  if(d->deref())
+    delete d;
+}
+
+template <class T>
+typename List<T>::Iterator List<T>::begin()
+{
+  detach();
+  return d->list.begin();
+}
+
+template <class T>
+typename List<T>::ConstIterator List<T>::begin() const
+{
+  return d->list.begin();
+}
+
+template <class T>
+typename List<T>::Iterator List<T>::end()
+{
+  detach();
+  return d->list.end();
+}
+
+template <class T>
+typename List<T>::ConstIterator List<T>::end() const
+{
+  return d->list.end();
+}
+
+template <class T>
+typename List<T>::Iterator List<T>::insert(Iterator it, const T &item)
+{
+  detach();
+  return d->list.insert(it, item);
+}
+
+template <class T>
+List<T> &List<T>::sortedInsert(const T &value, bool unique)
+{
+  detach();
+  Iterator it = begin();
+  while(it != end() && *it < value)
+    ++it;
+  if(unique && it != end() && *it == value)
+    return *this;
+  insert(it, value);
+  return *this;
+}
+
+template <class T>
+List<T> &List<T>::append(const T &item)
+{
+  detach();
+  d->list.push_back(item);
+  return *this;
+}
+
+template <class T>
+List<T> &List<T>::append(const List<T> &l)
+{
+  detach();
+  d->list.insert(d->list.end(), l.begin(), l.end());
+  return *this;
+}
+
+template <class T>
+List<T> &List<T>::prepend(const T &item)
+{
+  detach();
+  d->list.push_front(item);
+  return *this;
+}
+
+template <class T>
+List<T> &List<T>::prepend(const List<T> &l)
+{
+  detach();
+  d->list.insert(d->list.begin(), l.begin(), l.end());
+  return *this;
+}
+
+template <class T>
+List<T> &List<T>::clear()
+{
+  detach();
+  d->clear();
+  return *this;
+}
+
+template <class T>
+TagLib::uint List<T>::size() const
+{
+  return d->list.size();
+}
+
+template <class T>
+bool List<T>::isEmpty() const
+{
+  return d->list.empty();
+}
+
+template <class T>
+typename List<T>::Iterator List<T>::find(const T &value)
+{
+  return std::find(d->list.begin(), d->list.end(), value);
+}
+
+template <class T>
+typename List<T>::ConstIterator List<T>::find(const T &value) const
+{
+  return std::find(d->list.begin(), d->list.end(), value);
+}
+
+template <class T>
+bool List<T>::contains(const T &value) const
+{
+  return std::find(d->list.begin(), d->list.end(), value) != d->list.end();
+}
+
+template <class T>
+typename List<T>::Iterator List<T>::erase(Iterator it)
+{
+  return d->list.erase(it);
+}
+
+template <class T>
+const T &List<T>::front() const
+{
+  return d->list.front();
+}
+
+template <class T>
+T &List<T>::front()
+{
+  detach();
+  return d->list.front();
+}
+
+template <class T>
+const T &List<T>::back() const
+{
+  return d->list.back();
+}
+
+template <class T>
+void List<T>::setAutoDelete(bool autoDelete)
+{
+  d->autoDelete = autoDelete;
+}
+
+template <class T>
+T &List<T>::back()
+{
+  detach();
+  return d->list.back();
+}
+
+template <class T>
+T &List<T>::operator[](uint i)
+{
+  Iterator it = d->list.begin();
+
+  for(uint j = 0; j < i; j++)
+    ++it;
+
+  return *it;
+}
+
+template <class T>
+const T &List<T>::operator[](uint i) const
+{
+  ConstIterator it = d->list.begin();
+
+  for(uint j = 0; j < i; j++)
+    ++it;
+
+  return *it;
+}
+
+template <class T>
+List<T> &List<T>::operator=(const List<T> &l)
+{
+  if(&l == this)
+    return *this;
+
+  if(d->deref())
+    delete d;
+  d = l.d;
+  d->ref();
+  return *this;
+}
+
+template <class T>
+bool List<T>::operator==(const List<T> &l) const
+{
+  return d->list == l.d->list;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+template <class T>
+void List<T>::detach()
+{
+  if(d->count() > 1) {
+    d->deref();
+    d = new ListPrivate<T>(d->list);
+  }
+}
+
+} // namespace TagLib
diff --git a/lib-src/taglib/taglib/toolkit/tmap.h b/lib-src/taglib/taglib/toolkit/tmap.h
new file mode 100644
index 0000000..3551b19
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tmap.h
@@ -0,0 +1,200 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_MAP_H
+#define TAGLIB_MAP_H
+
+#include <map>
+using namespace std;
+
+#include "taglib.h"
+
+namespace TagLib {
+
+  //! A generic, implicitly shared map.
+
+  /*!
+   * This implements a standard map container that associates a key with a value
+   * and has fast key-based lookups.  This map is also implicitly shared making
+   * it suitable for pass-by-value usage.
+   */
+
+  template <class Key, class T> class Map
+  {
+  public:
+#ifndef DO_NOT_DOCUMENT
+#ifdef WANT_CLASS_INSTANTIATION_OF_MAP
+    // Some STL implementations get snippy over the use of the
+    // class keyword to distinguish different templates; Sun Studio
+    // in particular finds multiple specializations in certain rare
+    // cases and complains about that. GCC doesn't seem to mind,
+    // and uses the typedefs further below without the class keyword.
+    // Not all the specializations of Map can use the class keyword
+    // (when T is not actually a class type), so don't apply this
+    // generally.
+    typedef typename std::map<class Key, class T>::iterator Iterator;
+    typedef typename std::map<class Key, class T>::const_iterator ConstIterator;
+#else
+    typedef typename std::map<Key, T>::iterator Iterator;
+    typedef typename std::map<Key, T>::const_iterator ConstIterator;
+#endif
+#endif
+
+    /*!
+     * Constructs an empty Map.
+     */
+    Map();
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a m.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    Map(const Map<Key, T> &m);
+
+    /*!
+     * Destroys this instance of the Map.
+     */
+    virtual ~Map();
+
+    /*!
+     * Returns an STL style iterator to the beginning of the map.  See
+     * std::map::iterator for the semantics.
+     */
+    Iterator begin();
+
+    /*!
+     * Returns an STL style iterator to the beginning of the map.  See
+     * std::map::const_iterator for the semantics.
+     */
+    ConstIterator begin() const;
+
+    /*!
+     * Returns an STL style iterator to the end of the map.  See
+     * std::map::iterator for the semantics.
+     */
+    Iterator end();
+
+    /*!
+     * Returns an STL style iterator to the end of the map.  See
+     * std::map::const_iterator for the semantics.
+     */
+    ConstIterator end() const;
+
+    /*!
+     * Inserts \a value under \a key in the map.  If a value for \a key already
+     * exists it will be overwritten.
+     */
+    Map<Key, T> &insert(const Key &key, const T &value);
+
+    /*!
+     * Removes all of the elements from elements from the map.  This however
+     * will not delete pointers if the mapped type is a pointer type.
+     */
+    Map<Key, T> &clear();
+
+    /*!
+     * The number of elements in the map.
+     *
+     * \see isEmpty()
+     */
+    uint size() const;
+
+    /*!
+     * Returns true if the map is empty.
+     *
+     * \see size()
+     */
+    bool isEmpty() const;
+
+    /*!
+     * Find the first occurrence of \a key.
+     */
+    Iterator find(const Key &key);
+
+    /*!
+     * Find the first occurrence of \a key.
+     */
+    ConstIterator find(const Key &key) const;
+
+    /*!
+     * Returns true if the map contains an instance of \a key.
+     */
+    bool contains(const Key &key) const;
+
+    /*!
+     * Erase the item at \a it from the list.
+     */
+    Map<Key, T> &erase(Iterator it);
+
+    /*!
+     * Erase the item with \a key from the list.
+     */
+    Map<Key, T> &erase(const Key &key);
+
+    /*!
+     * Returns a reference to the value associated with \a key.
+     *
+     * \note This has undefined behavior if the key is not present in the map.
+     */
+    const T &operator[](const Key &key) const;
+
+    /*!
+     * Returns a reference to the value associated with \a key.
+     *
+     * \note This has undefined behavior if the key is not present in the map.
+     */
+    T &operator[](const Key &key);
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a m.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    Map<Key, T> &operator=(const Map<Key, T> &m);
+
+  protected:
+    /*
+     * If this List is being shared via implicit sharing, do a deep copy of the
+     * data and separate from the shared members.  This should be called by all
+     * non-const subclass members.
+     */
+    void detach();
+
+  private:
+#ifndef DO_NOT_DOCUMENT
+    template <class KeyP, class TP> class MapPrivate;
+    MapPrivate<Key, T> *d;
+#endif
+  };
+
+}
+
+// Since GCC doesn't support the "export" keyword, we have to include the
+// implementation.
+
+#include "tmap.tcc"
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tmap.tcc b/lib-src/taglib/taglib/toolkit/tmap.tcc
new file mode 100644
index 0000000..6e689d3
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tmap.tcc
@@ -0,0 +1,196 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+namespace TagLib {
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+template <class Key, class T>
+template <class KeyP, class TP>
+class Map<Key, T>::MapPrivate : public RefCounter
+{
+public:
+  MapPrivate() : RefCounter() {}
+#ifdef WANT_CLASS_INSTANTIATION_OF_MAP
+  MapPrivate(const std::map<class KeyP, class TP>& m) : RefCounter(), map(m) {}
+  std::map<class KeyP, class TP> map;
+#else
+  MapPrivate(const std::map<KeyP, TP>& m) : RefCounter(), map(m) {}
+  std::map<KeyP, TP> map;
+#endif
+};
+
+template <class Key, class T>
+Map<Key, T>::Map()
+{
+  d = new MapPrivate<Key, T>;
+}
+
+template <class Key, class T>
+Map<Key, T>::Map(const Map<Key, T> &m) : d(m.d)
+{
+  d->ref();
+}
+
+template <class Key, class T>
+Map<Key, T>::~Map()
+{
+  if(d->deref())
+    delete(d);
+}
+
+template <class Key, class T>
+typename Map<Key, T>::Iterator Map<Key, T>::begin()
+{
+  detach();
+  return d->map.begin();
+}
+
+template <class Key, class T>
+typename Map<Key, T>::ConstIterator Map<Key, T>::begin() const
+{
+  return d->map.begin();
+}
+
+template <class Key, class T>
+typename Map<Key, T>::Iterator Map<Key, T>::end()
+{
+  detach();
+  return d->map.end();
+}
+
+template <class Key, class T>
+typename Map<Key, T>::ConstIterator Map<Key, T>::end() const
+{
+  return d->map.end();
+}
+
+template <class Key, class T>
+Map<Key, T> &Map<Key, T>::insert(const Key &key, const T &value)
+{
+  detach();
+  d->map[key] = value;
+  return *this;
+}
+
+template <class Key, class T>
+Map<Key, T> &Map<Key, T>::clear()
+{
+  detach();
+  d->map.clear();
+  return *this;
+}
+
+template <class Key, class T>
+bool Map<Key, T>::isEmpty() const
+{
+  return d->map.empty();
+}
+
+template <class Key, class T>
+typename Map<Key, T>::Iterator Map<Key, T>::find(const Key &key)
+{
+  detach();
+  return d->map.find(key);
+}
+
+template <class Key, class T>
+typename Map<Key,T>::ConstIterator Map<Key, T>::find(const Key &key) const
+{
+  return d->map.find(key);
+}
+
+template <class Key, class T>
+bool Map<Key, T>::contains(const Key &key) const
+{
+  return d->map.find(key) != d->map.end();
+}
+
+template <class Key, class T>
+Map<Key, T> &Map<Key,T>::erase(Iterator it)
+{
+  detach();
+  d->map.erase(it);
+  return *this;
+}
+
+template <class Key, class T>
+Map<Key, T> &Map<Key,T>::erase(const Key &key)
+{
+  detach();
+  Iterator it = d->map.find(key);
+  if(it != d->map.end())
+    d->map.erase(it);
+  return *this;
+}
+
+template <class Key, class T>
+TagLib::uint Map<Key, T>::size() const
+{
+  return d->map.size();
+}
+
+template <class Key, class T>
+const T &Map<Key, T>::operator[](const Key &key) const
+{
+  return d->map[key];
+}
+
+template <class Key, class T>
+T &Map<Key, T>::operator[](const Key &key)
+{
+  detach();
+  return d->map[key];
+}
+
+template <class Key, class T>
+Map<Key, T> &Map<Key, T>::operator=(const Map<Key, T> &m)
+{
+  if(&m == this)
+    return *this;
+
+  if(d->deref())
+    delete(d);
+  d = m.d;
+  d->ref();
+  return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+template <class Key, class T>
+void Map<Key, T>::detach()
+{
+  if(d->count() > 1) {
+    d->deref();
+    d = new MapPrivate<Key, T>(d->map);
+  }
+}
+
+} // namespace TagLib
diff --git a/lib-src/taglib/taglib/toolkit/tstring.cpp b/lib-src/taglib/taglib/toolkit/tstring.cpp
new file mode 100644
index 0000000..79b564f
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tstring.cpp
@@ -0,0 +1,788 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tstring.h"
+#include "unicode.h"
+#include "tdebug.h"
+
+#include <iostream>
+
+#include <string.h>
+
+namespace TagLib {
+
+  inline unsigned short byteSwap(unsigned short x)
+  {
+    return (((x) >> 8) & 0xff) | (((x) & 0xff) << 8);
+  }
+
+  inline unsigned short combine(unsigned char c1, unsigned char c2)
+  {
+    return (c1 << 8) | c2;
+  }
+}
+
+using namespace TagLib;
+
+class String::StringPrivate : public RefCounter
+{
+public:
+  StringPrivate(const wstring &s) :
+    RefCounter(),
+    data(s),
+    CString(0) {}
+
+  StringPrivate() :
+    RefCounter(),
+    CString(0) {}
+
+  ~StringPrivate() {
+    delete [] CString;
+  }
+
+  wstring data;
+
+  /*!
+   * This is only used to hold the a pointer to the most recent value of
+   * toCString.
+   */
+  char *CString;
+};
+
+String String::null;
+
+////////////////////////////////////////////////////////////////////////////////
+
+String::String()
+{
+  d = new StringPrivate;
+}
+
+String::String(const String &s) : d(s.d)
+{
+  d->ref();
+}
+
+String::String(const std::string &s, Type t)
+{
+  d = new StringPrivate;
+
+  if(t == UTF16 || t == UTF16BE || t == UTF16LE) {
+    debug("String::String() -- A std::string should not contain UTF16.");
+    return;
+  }
+
+  int length = s.length();
+  d->data.resize(length);
+  wstring::iterator targetIt = d->data.begin();
+
+  for(std::string::const_iterator it = s.begin(); it != s.end(); it++) {
+    *targetIt = uchar(*it);
+    ++targetIt;
+  }
+
+  prepare(t);
+}
+
+String::String(const wstring &s, Type t)
+{
+  d = new StringPrivate(s);
+  prepare(t);
+}
+
+String::String(const wchar_t *s, Type t)
+{
+  d = new StringPrivate(s);
+  prepare(t);
+}
+
+String::String(const char *s, Type t)
+{
+  d = new StringPrivate;
+
+  if(t == UTF16 || t == UTF16BE || t == UTF16LE) {
+    debug("String::String() -- A const char * should not contain UTF16.");
+    return;
+  }
+
+  int length = ::strlen(s);
+  d->data.resize(length);
+
+  wstring::iterator targetIt = d->data.begin();
+
+  for(int i = 0; i < length; i++) {
+    *targetIt = uchar(s[i]);
+    ++targetIt;
+  }
+
+  prepare(t);
+}
+
+String::String(wchar_t c, Type t)
+{
+  d = new StringPrivate;
+  d->data += c;
+  prepare(t);
+}
+
+String::String(char c, Type t)
+{
+  d = new StringPrivate;
+
+  if(t == UTF16 || t == UTF16BE || t == UTF16LE) {
+    debug("String::String() -- A std::string should not contain UTF16.");
+    return;
+  }
+
+  d->data += uchar(c);
+  prepare(t);
+}
+
+String::String(const ByteVector &v, Type t)
+{
+  d = new StringPrivate;
+
+  if(v.isEmpty())
+    return;
+
+  if(t == Latin1 || t == UTF8) {
+
+    int length = 0;
+    d->data.resize(v.size());
+    wstring::iterator targetIt = d->data.begin();
+    for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
+      *targetIt = uchar(*it);
+      ++targetIt;
+      ++length;
+    }
+    d->data.resize(length);
+  }
+  else  {
+    d->data.resize(v.size() / 2);
+    wstring::iterator targetIt = d->data.begin();
+
+    for(ByteVector::ConstIterator it = v.begin();
+        it != v.end() && it + 1 != v.end() && combine(*it, *(it + 1));
+        it += 2)
+    {
+      *targetIt = combine(*it, *(it + 1));
+      ++targetIt;
+    }
+  }
+  prepare(t);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+String::~String()
+{
+  if(d->deref())
+    delete d;
+}
+
+std::string String::to8Bit(bool unicode) const
+{
+  std::string s;
+  s.resize(d->data.size());
+
+  if(!unicode) {
+    std::string::iterator targetIt = s.begin();
+    for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+      *targetIt = char(*it);
+      ++targetIt;
+    }
+    return s;
+  }
+
+  const int outputBufferSize = d->data.size() * 3 + 1;
+
+  Unicode::UTF16 *sourceBuffer = new Unicode::UTF16[d->data.size() + 1];
+  Unicode::UTF8  *targetBuffer = new Unicode::UTF8[outputBufferSize];
+
+  for(unsigned int i = 0; i < d->data.size(); i++)
+    sourceBuffer[i] = Unicode::UTF16(d->data[i]);
+
+  const Unicode::UTF16 *source = sourceBuffer;
+  Unicode::UTF8 *target = targetBuffer;
+
+  Unicode::ConversionResult result =
+    Unicode::ConvertUTF16toUTF8(&source, sourceBuffer + d->data.size(),
+                                &target, targetBuffer + outputBufferSize,
+                                Unicode::lenientConversion);
+
+  if(result != Unicode::conversionOK)
+    debug("String::to8Bit() - Unicode conversion error.");
+
+  int newSize = target - targetBuffer;
+  s.resize(newSize);
+  targetBuffer[newSize] = 0;
+
+  s = (char *) targetBuffer;
+
+  delete [] sourceBuffer;
+  delete [] targetBuffer;
+
+  return s;
+}
+
+TagLib::wstring String::toWString() const
+{
+  return d->data;
+}
+
+const char *String::toCString(bool unicode) const
+{
+  delete [] d->CString;
+
+  std::string buffer = to8Bit(unicode);
+  d->CString = new char[buffer.size() + 1];
+  strcpy(d->CString, buffer.c_str());
+
+  return d->CString;
+}
+
+String::Iterator String::begin()
+{
+  return d->data.begin();
+}
+
+String::ConstIterator String::begin() const
+{
+  return d->data.begin();
+}
+
+String::Iterator String::end()
+{
+  return d->data.end();
+}
+
+String::ConstIterator String::end() const
+{
+  return d->data.end();
+}
+
+int String::find(const String &s, int offset) const
+{
+  wstring::size_type position = d->data.find(s.d->data, offset);
+
+  if(position != wstring::npos)
+    return position;
+  else
+    return -1;
+}
+
+bool String::startsWith(const String &s) const
+{
+  if(s.length() > length())
+    return false;
+
+  return substr(0, s.length()) == s;
+}
+
+String String::substr(uint position, uint n) const
+{
+  if(n > position + d->data.size())
+    n = d->data.size() - position;
+
+  String s;
+  s.d->data = d->data.substr(position, n);
+  return s;
+}
+
+String &String::append(const String &s)
+{
+  detach();
+  d->data += s.d->data;
+  return *this;
+}
+
+String String::upper() const
+{
+  String s;
+
+  static int shift = 'A' - 'a';
+
+  for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+    if(*it >= 'a' && *it <= 'z')
+      s.d->data.push_back(*it + shift);
+    else
+      s.d->data.push_back(*it);
+  }
+
+  return s;
+}
+
+TagLib::uint String::size() const
+{
+  return d->data.size();
+}
+
+TagLib::uint String::length() const
+{
+  return size();
+}
+
+bool String::isEmpty() const
+{
+  return d->data.size() == 0;
+}
+
+bool String::isNull() const
+{
+  return d == null.d;
+}
+
+ByteVector String::data(Type t) const
+{
+  ByteVector v;
+
+  switch(t) {
+
+  case Latin1:
+  {
+    for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++)
+      v.append(char(*it));
+    break;
+  }
+  case UTF8:
+  {
+    std::string s = to8Bit(true);
+    v.setData(s.c_str(), s.length());
+    break;
+  }
+  case UTF16:
+  {
+    // Assume that if we're doing UTF16 and not UTF16BE that we want little
+    // endian encoding.  (Byte Order Mark)
+
+    v.append(char(0xff));
+    v.append(char(0xfe));
+
+    for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+
+      char c1 = *it & 0xff;
+      char c2 = *it >> 8;
+
+      v.append(c1);
+      v.append(c2);
+    }
+    break;
+  }
+  case UTF16BE:
+  {
+    for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+
+      char c1 = *it >> 8;
+      char c2 = *it & 0xff;
+
+      v.append(c1);
+      v.append(c2);
+    }
+    break;
+  }
+  case UTF16LE:
+  {
+    for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+
+      char c1 = *it & 0xff;
+      char c2 = *it >> 8;
+
+      v.append(c1);
+      v.append(c2);
+    }
+    break;
+  }
+  }
+
+  return v;
+}
+
+int String::toInt() const
+{
+  int value = 0;
+
+  bool negative = d->data[0] == '-';
+  uint i = negative ? 1 : 0;
+
+  for(; i < d->data.size() && d->data[i] >= '0' && d->data[i] <= '9'; i++)
+    value = value * 10 + (d->data[i] - '0');
+
+  if(negative)
+    value = value * -1;
+
+  return value;
+}
+
+String String::stripWhiteSpace() const
+{
+  wstring::const_iterator begin = d->data.begin();
+  wstring::const_iterator end = d->data.end();
+
+  while(begin != end &&
+        (*begin == '\t' || *begin == '\n' || *begin == '\f' ||
+         *begin == '\r' || *begin == ' '))
+  {
+    ++begin;
+  }
+
+  if(begin == end)
+    return null;
+
+  // There must be at least one non-whitespace character here for us to have
+  // gotten this far, so we should be safe not doing bounds checking.
+
+  do {
+    --end;
+  } while(*end == '\t' || *end == '\n' ||
+          *end == '\f' || *end == '\r' || *end == ' ');
+
+  return String(wstring(begin, end + 1));
+}
+
+bool String::isLatin1() const
+{
+  for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+    if(*it >= 256)
+      return false;
+  }
+  return true;
+}
+
+bool String::isAscii() const
+{
+  for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
+    if(*it >= 128)
+      return false;
+  }
+  return true;
+}
+
+String String::number(int n) // static
+{
+  if(n == 0)
+    return String("0");
+
+  String charStack;
+
+  bool negative = n < 0;
+
+  if(negative)
+    n = n * -1;
+
+  while(n > 0) {
+    int remainder = n % 10;
+    charStack += char(remainder + '0');
+    n = (n - remainder) / 10;
+  }
+
+  String s;
+
+  if(negative)
+    s += '-';
+
+  for(int i = charStack.d->data.size() - 1; i >= 0; i--)
+    s += charStack.d->data[i];
+
+  return s;
+}
+
+TagLib::wchar &String::operator[](int i)
+{
+  detach();
+
+  return d->data[i];
+}
+
+const TagLib::wchar &String::operator[](int i) const
+{
+  return d->data[i];
+}
+
+bool String::operator==(const String &s) const
+{
+  return d == s.d || d->data == s.d->data;
+}
+
+String &String::operator+=(const String &s)
+{
+  detach();
+
+  d->data += s.d->data;
+  return *this;
+}
+
+String &String::operator+=(const wchar_t *s)
+{
+  detach();
+
+  d->data += s;
+  return *this;
+}
+
+String &String::operator+=(const char *s)
+{
+  detach();
+
+  for(int i = 0; s[i] != 0; i++)
+    d->data += uchar(s[i]);
+  return *this;
+}
+
+String &String::operator+=(wchar_t c)
+{
+  detach();
+
+  d->data += c;
+  return *this;
+}
+
+String &String::operator+=(char c)
+{
+  d->data += uchar(c);
+  return *this;
+}
+
+String &String::operator=(const String &s)
+{
+  if(&s == this)
+    return *this;
+
+  if(d->deref())
+    delete d;
+  d = s.d;
+  d->ref();
+  return *this;
+}
+
+String &String::operator=(const std::string &s)
+{
+  if(d->deref())
+    delete d;
+
+  d = new StringPrivate;
+
+  d->data.resize(s.size());
+
+  wstring::iterator targetIt = d->data.begin();
+  for(std::string::const_iterator it = s.begin(); it != s.end(); it++) {
+    *targetIt = uchar(*it);
+    ++targetIt;
+  }
+
+  return *this;
+}
+
+String &String::operator=(const wstring &s)
+{
+  if(d->deref())
+    delete d;
+  d = new StringPrivate(s);
+  return *this;
+}
+
+String &String::operator=(const wchar_t *s)
+{
+  if(d->deref())
+    delete d;
+  d = new StringPrivate(s);
+  return *this;
+}
+
+String &String::operator=(char c)
+{
+  if(d->deref())
+    delete d;
+  d = new StringPrivate;
+  d->data += uchar(c);
+  return *this;
+}
+
+String &String::operator=(wchar_t c)
+{
+  if(d->deref())
+    delete d;
+  d = new StringPrivate;
+  d->data += c;
+  return *this;
+}
+
+String &String::operator=(const char *s)
+{
+  if(d->deref())
+    delete d;
+
+  d = new StringPrivate;
+
+  int length = ::strlen(s);
+  d->data.resize(length);
+
+  wstring::iterator targetIt = d->data.begin();
+  for(int i = 0; i < length; i++) {
+    *targetIt = uchar(s[i]);
+    ++targetIt;
+  }
+
+  return *this;
+}
+
+String &String::operator=(const ByteVector &v)
+{
+  if(d->deref())
+    delete d;
+
+  d = new StringPrivate;
+  d->data.resize(v.size());
+  wstring::iterator targetIt = d->data.begin();
+
+  uint i = 0;
+
+  for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
+    *targetIt = uchar(*it);
+    ++targetIt;
+    ++i;
+  }
+
+  // If we hit a null in the ByteVector, shrink the string again.
+
+  d->data.resize(i);
+
+  return *this;
+}
+
+bool String::operator<(const String &s) const
+{
+  return d->data < s.d->data;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// protected members
+////////////////////////////////////////////////////////////////////////////////
+
+void String::detach()
+{
+  if(d->count() > 1) {
+    d->deref();
+    d = new StringPrivate(d->data);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void String::prepare(Type t)
+{
+  switch(t) {
+  case UTF16:
+  {
+    if(d->data.size() >= 1 && (d->data[0] == 0xfeff || d->data[0] == 0xfffe)) {
+      bool swap = d->data[0] != 0xfeff;
+      d->data.erase(d->data.begin(), d->data.begin() + 1);
+      if(swap) {
+        for(uint i = 0; i < d->data.size(); i++)
+          d->data[i] = byteSwap((unsigned short)d->data[i]);
+      }
+    }
+    else {
+      debug("String::prepare() - Invalid UTF16 string.");
+      d->data.erase(d->data.begin(), d->data.end());
+    }
+    break;
+  }
+  case UTF8:
+  {
+    int bufferSize = d->data.size() + 1;
+    Unicode::UTF8  *sourceBuffer = new Unicode::UTF8[bufferSize];
+    Unicode::UTF16 *targetBuffer = new Unicode::UTF16[bufferSize];
+
+    unsigned int i = 0;
+    for(; i < d->data.size(); i++)
+      sourceBuffer[i] = Unicode::UTF8(d->data[i]);
+    sourceBuffer[i] = 0;
+
+    const Unicode::UTF8 *source = sourceBuffer;
+    Unicode::UTF16 *target = targetBuffer;
+
+    Unicode::ConversionResult result =
+      Unicode::ConvertUTF8toUTF16(&source, sourceBuffer + bufferSize,
+                                  &target, targetBuffer + bufferSize,
+                                  Unicode::lenientConversion);
+
+    if(result != Unicode::conversionOK)
+      debug("String::prepare() - Unicode conversion error.");
+
+
+    int newSize = target != targetBuffer ? target - targetBuffer - 1 : 0;
+    d->data.resize(newSize);
+
+    for(int i = 0; i < newSize; i++)
+      d->data[i] = targetBuffer[i];
+
+    delete [] sourceBuffer;
+    delete [] targetBuffer;
+
+    break;
+  }
+  case UTF16LE:
+  {
+    for(uint i = 0; i < d->data.size(); i++)
+      d->data[i] = byteSwap((unsigned short)d->data[i]);
+    break;
+  }
+  default:
+    break;
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// related functions
+////////////////////////////////////////////////////////////////////////////////
+
+const TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2)
+{
+  String s(s1);
+  s.append(s2);
+  return s;
+}
+
+const TagLib::String operator+(const char *s1, const TagLib::String &s2)
+{
+  String s(s1);
+  s.append(s2);
+  return s;
+}
+
+const TagLib::String operator+(const TagLib::String &s1, const char *s2)
+{
+  String s(s1);
+  s.append(s2);
+  return s;
+}
+
+std::ostream &operator<<(std::ostream &s, const String &str)
+{
+  s << str.to8Bit();
+  return s;
+}
diff --git a/lib-src/taglib/taglib/toolkit/tstring.h b/lib-src/taglib/taglib/toolkit/tstring.h
new file mode 100644
index 0000000..660023b
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tstring.h
@@ -0,0 +1,456 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_STRING_H
+#define TAGLIB_STRING_H
+
+#include "taglib_export.h"
+#include "taglib.h"
+#include "tbytevector.h"
+
+#include <string>
+#include <ostream>
+
+/*!
+ * \relates TagLib::String
+ *
+ * Converts a TagLib::String to a QString without a requirement to link to Qt.
+ */
+#define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8)
+
+/*!
+ * \relates TagLib::String
+ *
+ * Converts a TagLib::String to a QString without a requirement to link to Qt.
+ */
+#define TStringToQString(s) QString::fromUtf8(s.toCString(true))
+
+namespace TagLib {
+
+  //! A \e wide string class suitable for unicode.
+
+  /*!
+   * This is an implicitly shared \e wide string.  For storage it uses
+   * TagLib::wstring, but as this is an <i>implementation detail</i> this of
+   * course could change.  Strings are stored internally as UTF-16BE.  (Without
+   * the BOM (Byte Order Mark)
+   *
+   * The use of implicit sharing means that copying a string is cheap, the only
+   * \e cost comes into play when the copy is modified.  Prior to that the string
+   * just has a pointer to the data of the \e parent String.  This also makes
+   * this class suitable as a function return type.
+   *
+   * In addition to adding implicit sharing, this class keeps track of four
+   * possible encodings, which are the four supported by the ID3v2 standard.
+   */
+
+  class TAGLIB_EXPORT String
+  {
+  public:
+
+#ifndef DO_NOT_DOCUMENT
+    typedef std::basic_string<wchar>::iterator Iterator;
+    typedef std::basic_string<wchar>::const_iterator ConstIterator;
+#endif
+
+    /**
+     * The four types of string encodings supported by the ID3v2 specification.
+     * ID3v1 is assumed to be Latin1 and Ogg Vorbis comments use UTF8.
+     */
+    enum Type {
+      /*!
+       * IS08859-1, or <i>Latin1</i> encoding.  8 bit characters.
+       */
+      Latin1 = 0,
+      /*!
+       * UTF16 with a <i>byte order mark</i>.  16 bit characters.
+       */
+      UTF16 = 1,
+      /*!
+       * UTF16 <i>big endian</i>.  16 bit characters.  This is the encoding used
+       * internally by TagLib.
+       */
+      UTF16BE = 2,
+      /*!
+       * UTF8 encoding.  Characters are usually 8 bits but can be up to 32.
+       */
+      UTF8 = 3,
+      /*!
+       * UTF16 <i>little endian</i>.  16 bit characters.
+       */
+      UTF16LE = 4
+    };
+
+    /*!
+     * Constructs an empty String.
+     */
+    String();
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a s.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    String(const String &s);
+
+    /*!
+     * Makes a deep copy of the data in \a s.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    String(const std::string &s, Type t = Latin1);
+
+    /*!
+     * Makes a deep copy of the data in \a s.
+     */
+    String(const wstring &s, Type t = UTF16BE);
+
+    /*!
+     * Makes a deep copy of the data in \a s.
+     */
+    String(const wchar_t *s, Type t = UTF16BE);
+
+    /*!
+     * Makes a deep copy of the data in \a c.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    String(char c, Type t = Latin1);
+
+    /*!
+     * Makes a deep copy of the data in \a c.
+     */
+    String(wchar_t c, Type t = Latin1);
+
+
+    /*!
+     * Makes a deep copy of the data in \a s.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    String(const char *s, Type t = Latin1);
+
+    /*!
+     * Makes a deep copy of the data in \a s.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    String(const ByteVector &v, Type t = Latin1);
+
+    /*!
+     * Destroys this String instance.
+     */
+    virtual ~String();
+
+    /*!
+     * If \a unicode if false (the default) this will return a \e Latin1 encoded
+     * std::string.  If it is true the returned std::wstring will be UTF-8
+     * encoded.
+     */
+    std::string to8Bit(bool unicode = false) const;
+
+    /*!
+     * Returns a wstring version of the TagLib string as a wide string.
+     */
+    wstring toWString() const;
+
+    /*!
+     * Creates and returns a C-String based on the data.  This string is still
+     * owned by the String (class) and as such should not be deleted by the user.
+     *
+     * If \a unicode if false (the default) this string will be encoded in
+     * \e Latin1.  If it is true the returned C-String will be UTF-8 encoded.
+     *
+     * This string remains valid until the String instance is destroyed or
+     * another export method is called.
+     *
+     * \warning This however has the side effect that this C-String will remain
+     * in memory <b>in addition to</b> other memory that is consumed by the
+     * String instance.  So, this method should not be used on large strings or
+     * where memory is critical.
+     */
+    const char *toCString(bool unicode = false) const;
+
+    /*!
+     * Returns an iterator pointing to the beginning of the string.
+     */
+    Iterator begin();
+
+    /*!
+     * Returns a const iterator pointing to the beginning of the string.
+     */
+    ConstIterator begin() const;
+
+    /*!
+     * Returns an iterator pointing to the end of the string (the position
+     * after the last character).
+     */
+    Iterator end();
+
+    /*!
+     * Returns a const iterator pointing to the end of the string (the position
+     * after the last character).
+     */
+    ConstIterator end() const;
+
+    /*!
+     * Finds the first occurrence of pattern \a s in this string starting from
+     * \a offset.  If the pattern is not found, -1 is returned.
+     */
+    int find(const String &s, int offset = 0) const;
+
+    /*!
+     * Returns true if the strings starts with the substring \a s.
+     */
+    bool startsWith(const String &s) const;
+
+    /*!
+     * Extract a substring from this string starting at \a position and
+     * continuing for \a n characters.
+     */
+    String substr(uint position, uint n = 0xffffffff) const;
+
+    /*!
+     * Append \a s to the current string and return a reference to the current
+     * string.
+     */
+    String &append(const String &s);
+
+    /*!
+     * Returns an upper case version of the string.
+     *
+     * \warning This only works for the characters in US-ASCII, i.e. A-Z.
+     */
+    String upper() const;
+
+    /*!
+     * Returns the size of the string.
+     */
+    uint size() const;
+
+    /*!
+     * Returns the length of the string.  Equivalent to size().
+     */
+    uint length() const;
+
+    /*!
+     * Returns true if the string is empty.
+     *
+     * \see isNull()
+     */
+    bool isEmpty() const;
+
+    /*!
+     * Returns true if this string is null -- i.e. it is a copy of the
+     * String::null string.
+     *
+     * \note A string can be empty and not null.
+     * \see isEmpty()
+     */
+    bool isNull() const;
+
+    /*!
+     * Returns a ByteVector containing the string's data.  If \a t is Latin1 or
+     * UTF8, this will return a vector of 8 bit characters, otherwise it will use
+     * 16 bit characters.
+     */
+    ByteVector data(Type t) const;
+
+    /*!
+     * Convert the string to an integer.
+     */
+    int toInt() const;
+
+    /*!
+     * Returns a string with the leading and trailing whitespace stripped.
+     */
+    String stripWhiteSpace() const;
+
+    /*!
+     * Returns true if the file only uses characters required by Latin1.
+     */
+    bool isLatin1() const;
+
+    /*!
+     * Returns true if the file only uses characters required by (7-bit) ASCII.
+     */
+    bool isAscii() const;
+
+    /*!
+     * Converts the base-10 integer \a n to a string.
+     */
+    static String number(int n);
+
+    /*!
+     * Returns a reference to the character at position \a i.
+     */
+    wchar &operator[](int i);
+
+    /*!
+     * Returns a const reference to the character at position \a i.
+     */
+    const wchar &operator[](int i) const;
+
+    /*!
+     * Compares each character of the String with each character of \a s and
+     * returns true if the strings match.
+     */
+    bool operator==(const String &s) const;
+
+    /*!
+     * Appends \a s to the end of the String.
+     */
+    String &operator+=(const String &s);
+
+    /*!
+     * Appends \a s to the end of the String.
+     */
+    String &operator+=(const wchar_t* s);
+
+    /*!
+     * Appends \a s to the end of the String.
+     */
+    String &operator+=(const char* s);
+
+    /*!
+     * Appends \a s to the end of the String.
+     */
+    String &operator+=(wchar_t c);
+
+    /*!
+     * Appends \a c to the end of the String.
+     */
+    String &operator+=(char c);
+
+    /*!
+     * Performs a shallow, implicitly shared, copy of \a s, overwriting the
+     * String's current data.
+     */
+    String &operator=(const String &s);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(const std::string &s);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(const wstring &s);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(const wchar_t *s);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(char c);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(wchar_t c);
+
+    /*!
+     * Performs a deep copy of the data in \a s.
+     */
+    String &operator=(const char *s);
+
+    /*!
+     * Performs a deep copy of the data in \a v.
+     */
+    String &operator=(const ByteVector &v);
+
+    /*!
+     * To be able to use this class in a Map, this operator needed to be
+     * implemented.  Returns true if \a s is less than this string in a bytewise
+     * comparison.
+     */
+    bool operator<(const String &s) const;
+
+    /*!
+     * A null string provided for convenience.
+     */
+    static String null;
+
+  protected:
+    /*!
+     * If this String is being shared via implicit sharing, do a deep copy of the
+     * data and separate from the shared members.  This should be called by all
+     * non-const subclass members.
+     */
+    void detach();
+
+  private:
+    /*!
+     * This checks to see if the string is in \e UTF-16 (with BOM) or \e UTF-8
+     * format and if so converts it to \e UTF-16BE for internal use.  \e Latin1
+     * does not require conversion since it is a subset of \e UTF-16BE and
+     * \e UTF16-BE requires no conversion since it is used internally.
+     */
+    void prepare(Type t);
+
+    class StringPrivate;
+    StringPrivate *d;
+  };
+
+}
+
+/*!
+ * \relates TagLib::String
+ *
+ * Concatenates \a s1 and \a s2 and returns the result as a string.
+ */
+TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2);
+
+/*!
+ * \relates TagLib::String
+ *
+ * Concatenates \a s1 and \a s2 and returns the result as a string.
+ */
+TAGLIB_EXPORT const TagLib::String operator+(const char *s1, const TagLib::String &s2);
+
+/*!
+ * \relates TagLib::String
+ *
+ * Concatenates \a s1 and \a s2 and returns the result as a string.
+ */
+TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const char *s2);
+
+
+/*!
+ * \relates TagLib::String
+ *
+ * Send the string to an output stream.
+ */
+TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::String &str);
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/tstringlist.cpp b/lib-src/taglib/taglib/toolkit/tstringlist.cpp
new file mode 100644
index 0000000..1da3a29
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tstringlist.cpp
@@ -0,0 +1,123 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include "tstringlist.h"
+
+using namespace TagLib;
+
+class StringListPrivate
+{
+
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// static members
+////////////////////////////////////////////////////////////////////////////////
+
+StringList StringList::split(const String &s, const String &pattern)
+{
+  StringList l;
+
+  int previousOffset = 0;
+  for(int offset = s.find(pattern); offset != -1; offset = s.find(pattern, offset + 1)) {
+    l.append(s.substr(previousOffset, offset - previousOffset));
+    previousOffset = offset + 1;
+  }
+
+  l.append(s.substr(previousOffset, s.size() - previousOffset));
+
+  return l;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+StringList::StringList() : List<String>()
+{
+
+}
+
+StringList::StringList(const StringList &l) : List<String>(l)
+{
+
+}
+
+StringList::StringList(const String &s) : List<String>()
+{
+  append(s);
+}
+
+StringList::StringList(const ByteVectorList &bl, String::Type t) : List<String>()
+{
+  ByteVectorList::ConstIterator i = bl.begin();
+  for(;i != bl.end(); i++) {
+    append(String(*i, t));
+  }
+}
+
+StringList::~StringList()
+{
+
+}
+
+String StringList::toString(const String &separator) const
+{
+  String s;
+
+  ConstIterator it = begin();
+  ConstIterator itEnd = end();
+
+  while(it != itEnd) {
+    s += *it;
+    it++;
+    if(it != itEnd)
+      s += separator;
+  }
+
+  return s;
+}
+
+StringList &StringList::append(const String &s)
+{
+  List<String>::append(s);
+  return *this;
+}
+
+StringList &StringList::append(const StringList &l)
+{
+  List<String>::append(l);
+  return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// related functions
+////////////////////////////////////////////////////////////////////////////////
+
+std::ostream &operator<<(std::ostream &s, const StringList &l)
+{
+  s << l.toString();
+  return s;
+}
diff --git a/lib-src/taglib/taglib/toolkit/tstringlist.h b/lib-src/taglib/taglib/toolkit/tstringlist.h
new file mode 100644
index 0000000..7bb8664
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/tstringlist.h
@@ -0,0 +1,115 @@
+/***************************************************************************
+    copyright            : (C) 2002 - 2008 by Scott Wheeler
+    email                : wheeler at kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_STRINGLIST_H
+#define TAGLIB_STRINGLIST_H
+
+#include "tstring.h"
+#include "tlist.h"
+#include "tbytevectorlist.h"
+#include "taglib_export.h"
+
+#include <iostream>
+
+namespace TagLib {
+
+  //! A list of strings
+
+  /*!
+   * This is a spcialization of the List class with some members convention for
+   * string operations.
+   */
+
+  class TAGLIB_EXPORT StringList : public List<String>
+  {
+  public:
+
+    /*!
+     * Constructs an empty StringList.
+     */
+    StringList();
+
+    /*!
+     * Make a shallow, implicitly shared, copy of \a l.  Because this is
+     * implicitly shared, this method is lightweight and suitable for
+     * pass-by-value usage.
+     */
+    StringList(const StringList &l);
+
+    /*!
+     * Constructs a StringList with \a s as a member.
+     */
+    StringList(const String &s);
+
+    /*!
+     * Makes a deep copy of the data in \a vl.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    StringList(const ByteVectorList &vl, String::Type t = String::Latin1);
+
+    /*!
+     * Destroys this StringList instance.
+     */
+    virtual ~StringList();
+
+    /*!
+     * Concatenate the list of strings into one string separated by \a separator.
+     */
+    String toString(const String &separator = " ") const;
+
+    /*!
+     * Appends \a s to the end of the list and returns a reference to the
+     * list.
+     */
+    StringList &append(const String &s);
+
+    /*!
+     * Appends all of the values in \a l to the end of the list and returns a
+     * reference to the list.
+     */
+    StringList &append(const StringList &l);
+
+    /*!
+     * Splits the String \a s into several strings at \a pattern.  This will not include
+     * the pattern in the returned strings.
+     */
+    static StringList split(const String &s, const String &pattern);
+
+  private:
+    class StringListPrivate;
+    StringListPrivate *d;
+  };
+
+}
+
+/*!
+ * \related TagLib::StringList
+ * Send the StringList to an output stream.
+ */
+std::ostream &operator<<(std::ostream &s, const TagLib::StringList &l);
+
+#endif
diff --git a/lib-src/taglib/taglib/toolkit/unicode.cpp b/lib-src/taglib/taglib/toolkit/unicode.cpp
new file mode 100644
index 0000000..b60264d
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/unicode.cpp
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ *                                                                             *
+ * THIS FILE IS INCLUDED IN TAGLIB, BUT IS NOT COPYRIGHTED BY THE TAGLIB       *
+ * AUTHORS, NOT PART OF THE TAGLIB API AND COULD GO AWAY AT ANY POINT IN TIME. *
+ * AS SUCH IT SHOULD BE CONSIERED FOR INTERNAL USE ONLY.                       *
+ *                                                                             *
+ *******************************************************************************/
+
+/*
+ * Copyright 2001 Unicode, Inc.
+ * 
+ * Disclaimer
+ * 
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ * 
+ * Limitations on Rights to Redistribute This Code
+ * 
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/*
+ * This file has been modified by Scott Wheeler <wheeler at kde.org> to remove
+ * the UTF32 conversion functions and to place the appropriate functions
+ * in their own C++ namespace.
+ */
+
+/* ---------------------------------------------------------------------
+
+    Conversions between UTF32, UTF-16, and UTF-8. Source code file.
+	Author: Mark E. Davis, 1994.
+	Rev History: Rick McGowan, fixes & updates May 2001.
+	Sept 2001: fixed const & error conditions per
+		mods suggested by S. Parent & A. Lillich.
+
+    See the header file "ConvertUTF.h" for complete documentation.
+
+------------------------------------------------------------------------ */
+
+
+#include "unicode.h"
+#include <stdio.h>
+
+#define UNI_SUR_HIGH_START	(UTF32)0xD800
+#define UNI_SUR_HIGH_END	(UTF32)0xDBFF
+#define UNI_SUR_LOW_START	(UTF32)0xDC00
+#define UNI_SUR_LOW_END		(UTF32)0xDFFF
+#define false			0
+#define true			1
+
+namespace Unicode {
+
+static const int halfShift	= 10; /* used for shifting by 10 bits */
+
+static const UTF32 halfBase	= 0x0010000UL;
+static const UTF32 halfMask	= 0x3FFUL;
+
+/*
+ * Index into the table below with the first byte of a UTF-8 sequence to
+ * get the number of trailing bytes that are supposed to follow it.
+ */
+static const char trailingBytesForUTF8[256] = {
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+	1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+	2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
+};
+
+/*
+ * Magic values subtracted from a buffer value during UTF8 conversion.
+ * This table contains as many values as there might be trailing bytes
+ * in a UTF-8 sequence.
+ */
+static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 
+					 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
+
+/*
+ * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
+ * into the first byte, depending on how many bytes follow.  There are
+ * as many entries in this table as there are UTF-8 sequence types.
+ * (I.e., one byte sequence, two byte... six byte sequence.)
+ */
+static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+
+/* --------------------------------------------------------------------- */
+
+/* The interface converts a whole buffer to avoid function-call overhead.
+ * Constants have been gathered. Loops & conditionals have been removed as
+ * much as possible for efficiency, in favor of drop-through switches.
+ * (See "Note A" at the bottom of the file for equivalent code.)
+ * If your compiler supports it, the "isLegalUTF8" call can be turned
+ * into an inline function.
+ */
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF16toUTF8 (
+		const UTF16** sourceStart, const UTF16* sourceEnd, 
+		UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+	ConversionResult result = conversionOK;
+	const UTF16* source = *sourceStart;
+	UTF8* target = *targetStart;
+	while (source < sourceEnd) {
+		UTF32 ch;
+		unsigned short bytesToWrite = 0;
+		const UTF32 byteMask = 0xBF;
+		const UTF32 byteMark = 0x80; 
+		const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
+		ch = *source++;
+		/* If we have a surrogate pair, convert to UTF32 first. */
+		if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END && source < sourceEnd) {
+			UTF32 ch2 = *source;
+			if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+				ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+					+ (ch2 - UNI_SUR_LOW_START) + halfBase;
+				++source;
+			} else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+				--source; /* return to the illegal value itself */
+				result = sourceIllegal;
+				break;
+			}
+		} else if ((flags == strictConversion) && (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END)) {
+			--source; /* return to the illegal value itself */
+			result = sourceIllegal;
+			break;
+		}
+		/* Figure out how many bytes the result will require */
+		if (ch < (UTF32)0x80) {			bytesToWrite = 1;
+		} else if (ch < (UTF32)0x800) {		bytesToWrite = 2;
+		} else if (ch < (UTF32)0x10000) {	bytesToWrite = 3;
+		} else if (ch < (UTF32)0x200000) {	bytesToWrite = 4;
+		} else {				bytesToWrite = 2;
+							ch = UNI_REPLACEMENT_CHAR;
+		}
+		// printf("bytes to write = %i\n", bytesToWrite);
+		target += bytesToWrite;
+		if (target > targetEnd) {
+			source = oldSource; /* Back up source pointer! */
+			target -= bytesToWrite; result = targetExhausted; break;
+		}
+		switch (bytesToWrite) {	/* note: everything falls through. */
+			case 4:	*--target = (ch | byteMark) & byteMask; ch >>= 6;
+			case 3:	*--target = (ch | byteMark) & byteMask; ch >>= 6;
+			case 2:	*--target = (ch | byteMark) & byteMask; ch >>= 6;
+			case 1:	*--target =  ch | firstByteMark[bytesToWrite];
+		}
+		target += bytesToWrite;
+	}
+	*sourceStart = source;
+	*targetStart = target;
+	return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Utility routine to tell whether a sequence of bytes is legal UTF-8.
+ * This must be called with the length pre-determined by the first byte.
+ * If not calling this from ConvertUTF8to*, then the length can be set by:
+ *	length = trailingBytesForUTF8[*source]+1;
+ * and the sequence is illegal right away if there aren't that many bytes
+ * available.
+ * If presented with a length > 4, this returns false.  The Unicode
+ * definition of UTF-8 goes up to 4-byte sequences.
+ */
+
+static Boolean isLegalUTF8(const UTF8 *source, int length) {
+	UTF8 a;
+	const UTF8 *srcptr = source+length;
+	switch (length) {
+	default: return false;
+		/* Everything else falls through when "true"... */
+	case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+	case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+	case 2: if ((a = (*--srcptr)) > 0xBF) return false;
+		switch (*source) {
+		    /* no fall-through in this inner switch */
+		    case 0xE0: if (a < 0xA0) return false; break;
+		    case 0xF0: if (a < 0x90) return false; break;
+		    case 0xF4: if (a > 0x8F) return false; break;
+		    default:  if (a < 0x80) return false;
+		}
+    	case 1: if (*source >= 0x80 && *source < 0xC2) return false;
+		if (*source > 0xF4) return false;
+	}
+	return true;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Exported function to return whether a UTF-8 sequence is legal or not.
+ * This is not used here; it's just exported.
+ */
+Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+	int length = trailingBytesForUTF8[*source]+1;
+	if (source+length > sourceEnd) {
+	    return false;
+	}
+	return isLegalUTF8(source, length);
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF8toUTF16 (
+		const UTF8** sourceStart, const UTF8* sourceEnd, 
+		UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+	ConversionResult result = conversionOK;
+	const UTF8* source = *sourceStart;
+	UTF16* target = *targetStart;
+	while (source < sourceEnd) {
+		UTF32 ch = 0;
+		unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+		if (source + extraBytesToRead >= sourceEnd) {
+			result = sourceExhausted; break;
+		}
+		/* Do this check whether lenient or strict */
+		if (! isLegalUTF8(source, extraBytesToRead+1)) {
+			result = sourceIllegal;
+			break;
+		}
+		/*
+		 * The cases all fall through. See "Note A" below.
+		 */
+		switch (extraBytesToRead) {
+			case 3:	ch += *source++; ch <<= 6;
+			case 2:	ch += *source++; ch <<= 6;
+			case 1:	ch += *source++; ch <<= 6;
+			case 0:	ch += *source++;
+		}
+		ch -= offsetsFromUTF8[extraBytesToRead];
+
+		if (target >= targetEnd) {
+			source -= (extraBytesToRead+1);	/* Back up source pointer! */
+			result = targetExhausted; break;
+		}
+		if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+			if ((flags == strictConversion) && (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END)) {
+				source -= (extraBytesToRead+1); /* return to the illegal value itself */
+				result = sourceIllegal;
+				break;
+			} else {
+			    *target++ = ch;	/* normal case */
+			}
+		} else if (ch > UNI_MAX_UTF16) {
+			if (flags == strictConversion) {
+				result = sourceIllegal;
+				source -= (extraBytesToRead+1); /* return to the start */
+				break; /* Bail out; shouldn't continue */
+			} else {
+				*target++ = UNI_REPLACEMENT_CHAR;
+			}
+		} else {
+			/* target is a character in range 0xFFFF - 0x10FFFF. */
+			if (target + 1 >= targetEnd) {
+				source -= (extraBytesToRead+1);	/* Back up source pointer! */
+				result = targetExhausted; break;
+			}
+			ch -= halfBase;
+			*target++ = (ch >> halfShift) + UNI_SUR_HIGH_START;
+			*target++ = (ch & halfMask) + UNI_SUR_LOW_START;
+		}
+	}
+	*sourceStart = source;
+	*targetStart = target;
+	return result;
+}
+
+}
+
+/* ---------------------------------------------------------------------
+
+	Note A.
+	The fall-through switches in UTF-8 reading code save a
+	temp variable, some decrements & conditionals.  The switches
+	are equivalent to the following loop:
+		{
+			int tmpBytesToRead = extraBytesToRead+1;
+			do {
+				ch += *source++;
+				--tmpBytesToRead;
+				if (tmpBytesToRead) ch <<= 6;
+			} while (tmpBytesToRead > 0);
+		}
+	In UTF-8 writing code, the switches on "bytesToWrite" are
+	similarly unrolled loops.
+
+   --------------------------------------------------------------------- */
+
+
diff --git a/lib-src/taglib/taglib/toolkit/unicode.h b/lib-src/taglib/taglib/toolkit/unicode.h
new file mode 100644
index 0000000..cf7eb3c
--- /dev/null
+++ b/lib-src/taglib/taglib/toolkit/unicode.h
@@ -0,0 +1,149 @@
+#ifndef TAGLIB_UNICODE_H
+#define TAGLIB_UNICODE_H
+
+/*******************************************************************************
+ *                                                                             *
+ * THIS FILE IS INCLUDED IN TAGLIB, BUT IS NOT COPYRIGHTED BY THE TAGLIB       *
+ * AUTHORS, NOT PART OF THE TAGLIB API AND COULD GO AWAY AT ANY POINT IN TIME. *
+ * AS SUCH IT SHOULD BE CONSIERED FOR INTERNAL USE ONLY.                       *
+ *                                                                             *
+ *******************************************************************************/
+
+#ifndef DO_NOT_DOCUMENT  // tell Doxygen not to document this header
+
+/*
+ * Copyright 2001 Unicode, Inc.
+ * 
+ * Disclaimer
+ * 
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ * 
+ * Limitations on Rights to Redistribute This Code
+ * 
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/*
+ * This file has been modified by Scott Wheeler <wheeler at kde.org> to remove
+ * the UTF32 conversion functions and to place the appropriate functions
+ * in their own C++ namespace.
+ */
+
+/* ---------------------------------------------------------------------
+
+    Conversions between UTF32, UTF-16, and UTF-8.  Header file.
+
+    Several functions are included here, forming a complete set of
+    conversions between the three formats.  UTF-7 is not included
+    here, but is handled in a separate source file.
+
+    Each of these routines takes pointers to input buffers and output
+    buffers.  The input buffers are const.
+
+    Each routine converts the text between *sourceStart and sourceEnd,
+    putting the result into the buffer between *targetStart and
+    targetEnd. Note: the end pointers are *after* the last item: e.g. 
+    *(sourceEnd - 1) is the last item.
+
+    The return result indicates whether the conversion was successful,
+    and if not, whether the problem was in the source or target buffers.
+    (Only the first encountered problem is indicated.)
+
+    After the conversion, *sourceStart and *targetStart are both
+    updated to point to the end of last text successfully converted in
+    the respective buffers.
+
+    Input parameters:
+	sourceStart - pointer to a pointer to the source buffer.
+		The contents of this are modified on return so that
+		it points at the next thing to be converted.
+	targetStart - similarly, pointer to pointer to the target buffer.
+	sourceEnd, targetEnd - respectively pointers to the ends of the
+		two buffers, for overflow checking only.
+
+    These conversion functions take a ConversionFlags argument. When this
+    flag is set to strict, both irregular sequences and isolated surrogates
+    will cause an error.  When the flag is set to lenient, both irregular
+    sequences and isolated surrogates are converted.
+
+    Whether the flag is strict or lenient, all illegal sequences will cause
+    an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
+    or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
+    must check for illegal sequences.
+
+    When the flag is set to lenient, characters over 0x10FFFF are converted
+    to the replacement character; otherwise (when the flag is set to strict)
+    they constitute an error.
+
+    Output parameters:
+	The value "sourceIllegal" is returned from some routines if the input
+	sequence is malformed.  When "sourceIllegal" is returned, the source
+	value will point to the illegal value that caused the problem. E.g.,
+	in UTF-8 when a sequence is malformed, it points to the start of the
+	malformed sequence.  
+
+    Author: Mark E. Davis, 1994.
+    Rev History: Rick McGowan, fixes & updates May 2001.
+		 Fixes & updates, Sept 2001.
+
+------------------------------------------------------------------------ */
+
+/* ---------------------------------------------------------------------
+    The following 4 definitions are compiler-specific.
+    The C standard does not guarantee that wchar_t has at least
+    16 bits, so wchar_t is no less portable than unsigned short!
+    All should be unsigned values to avoid sign extension during
+    bit mask & shift operations.
+------------------------------------------------------------------------ */
+
+/* Some fundamental constants */
+#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
+#define UNI_MAX_BMP (UTF32)0x0000FFFF
+#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
+#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
+
+namespace Unicode {
+
+typedef unsigned long	UTF32;	/* at least 32 bits */
+typedef unsigned short	UTF16;	/* at least 16 bits */
+typedef unsigned char	UTF8;	/* typically 8 bits */
+typedef unsigned char	Boolean; /* 0 or 1 */
+
+typedef enum {
+	conversionOK = 0,	/* conversion successful */
+	sourceExhausted = 1,	/* partial character in source, but hit end */
+	targetExhausted = 2,	/* insuff. room in target for conversion */
+	sourceIllegal = 3	/* source sequence is illegal/malformed */
+} ConversionResult;
+
+typedef enum {
+	strictConversion = 0,
+	lenientConversion
+} ConversionFlags;
+
+ConversionResult ConvertUTF8toUTF16 (
+		const UTF8** sourceStart, const UTF8* sourceEnd, 
+		UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF16toUTF8 (
+		const UTF16** sourceStart, const UTF16* sourceEnd, 
+		UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+		
+Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+
+} // namespace Unicode
+
+/* --------------------------------------------------------------------- */
+
+#endif
+#endif
diff --git a/lib-src/taglib/taglib/trueaudio/.deps/trueaudiofile.Plo b/lib-src/taglib/taglib/trueaudio/.deps/trueaudiofile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/.deps/trueaudiofile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/trueaudio/.deps/trueaudioproperties.Plo b/lib-src/taglib/taglib/trueaudio/.deps/trueaudioproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/.deps/trueaudioproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/trueaudio/CMakeLists.txt b/lib-src/taglib/taglib/trueaudio/CMakeLists.txt
new file mode 100644
index 0000000..3a1c3e7
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  trueaudiofile.h trueaudioproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/trueaudio/Makefile.am b/lib-src/taglib/taglib/trueaudio/Makefile.am
new file mode 100644
index 0000000..7c64030
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libtrueaudio.la
+
+libtrueaudio_la_SOURCES = trueaudiofile.cpp trueaudioproperties.cpp
+
+taglib_include_HEADERS = trueaudiofile.h trueaudioproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/trueaudio/Makefile.in b/lib-src/taglib/taglib/trueaudio/Makefile.in
new file mode 100644
index 0000000..49bd7de
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/Makefile.in
@@ -0,0 +1,625 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/trueaudio
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libtrueaudio_la_LIBADD =
+am_libtrueaudio_la_OBJECTS = trueaudiofile.lo trueaudioproperties.lo
+#>- libtrueaudio_la_OBJECTS = $(am_libtrueaudio_la_OBJECTS)
+#>+ 4
+libtrueaudio_la_final_OBJECTS = libtrueaudio_la.all_cpp.lo 
+libtrueaudio_la_nofinal_OBJECTS = trueaudiofile.lo trueaudioproperties.lo
+ at KDE_USE_FINAL_FALSE@libtrueaudio_la_OBJECTS = $(libtrueaudio_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libtrueaudio_la_OBJECTS = $(libtrueaudio_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libtrueaudio_la_SOURCES)
+DIST_SOURCES = $(libtrueaudio_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libtrueaudio.la
+libtrueaudio_la_SOURCES = trueaudiofile.cpp trueaudioproperties.cpp
+taglib_include_HEADERS = trueaudiofile.h trueaudioproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/trueaudio/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libtrueaudio.la: $(libtrueaudio_la_OBJECTS) $(libtrueaudio_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libtrueaudio_la_OBJECTS) $(libtrueaudio_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trueaudiofile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trueaudioproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/trueaudio/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/trueaudio/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libtrueaudio_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/trueaudiofile.cpp $(srcdir)/trueaudioproperties.cpp 
+	@echo 'creating libtrueaudio_la.all_cpp.cpp ...'; \
+	rm -f libtrueaudio_la.all_cpp.files libtrueaudio_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libtrueaudio_la.all_cpp.final; \
+	for file in trueaudiofile.cpp trueaudioproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libtrueaudio_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libtrueaudio_la.all_cpp.final; \
+	done; \
+	cat libtrueaudio_la.all_cpp.final libtrueaudio_la.all_cpp.files > libtrueaudio_la.all_cpp.cpp; \
+	rm -f libtrueaudio_la.all_cpp.final libtrueaudio_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libtrueaudio_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libtrueaudio_la_OBJECTS="$(libtrueaudio_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libtrueaudio_la_OBJECTS="$(libtrueaudio_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libtrueaudio_la_OBJECTS="$(libtrueaudio_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libtrueaudio_la_OBJECTS="$(libtrueaudio_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/trueaudio/trueaudiofile.cpp b/lib-src/taglib/taglib/trueaudio/trueaudiofile.cpp
new file mode 100644
index 0000000..2a0ccaa
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/trueaudiofile.cpp
@@ -0,0 +1,274 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tdebug.h>
+#include <tagunion.h>
+
+#include "trueaudiofile.h"
+#include "id3v1tag.h"
+#include "id3v2tag.h"
+#include "id3v2header.h"
+
+using namespace TagLib;
+
+namespace
+{
+  enum { ID3v2Index = 0, ID3v1Index = 1 };
+}
+
+class TrueAudio::File::FilePrivate
+{
+public:
+  FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
+    ID3v2FrameFactory(frameFactory),
+    ID3v2Location(-1),
+    ID3v2OriginalSize(0),
+    ID3v1Location(-1),
+    properties(0),
+    scanned(false),
+    hasID3v1(false),
+    hasID3v2(false) {}
+
+  ~FilePrivate()
+  {
+    delete properties;
+  }
+
+  const ID3v2::FrameFactory *ID3v2FrameFactory;
+  long ID3v2Location;
+  uint ID3v2OriginalSize;
+
+  long ID3v1Location;
+
+  TagUnion tag;
+
+  Properties *properties;
+  bool scanned;
+
+  // These indicate whether the file *on disk* has these tags, not if
+  // this data structure does.  This is used in computing offsets.
+
+  bool hasID3v1;
+  bool hasID3v2;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+TrueAudio::File::File(FileName file, bool readProperties,
+                 Properties::ReadStyle propertiesStyle) : TagLib::File(file)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate(frameFactory);
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+TrueAudio::File::~File()
+{
+  delete d;
+}
+
+TagLib::Tag *TrueAudio::File::tag() const
+{
+  return &d->tag;
+}
+
+TrueAudio::Properties *TrueAudio::File::audioProperties() const
+{
+  return d->properties;
+}
+
+void TrueAudio::File::setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
+{
+  d->ID3v2FrameFactory = factory;
+}
+
+bool TrueAudio::File::save()
+{
+  if(readOnly()) {
+    debug("TrueAudio::File::save() -- File is read only.");
+    return false;
+  }
+
+  // Update ID3v2 tag
+
+  if(ID3v2Tag() && !ID3v2Tag()->isEmpty()) {
+    if(!d->hasID3v2) {
+      d->ID3v2Location = 0;
+      d->ID3v2OriginalSize = 0;
+    }
+    ByteVector data = ID3v2Tag()->render();
+    insert(data, d->ID3v2Location, d->ID3v2OriginalSize);
+    d->ID3v1Location -= d->ID3v2OriginalSize - data.size();
+    d->ID3v2OriginalSize = data.size();
+    d->hasID3v2 = true;
+  }
+  else if(d->hasID3v2) {
+    removeBlock(d->ID3v2Location, d->ID3v2OriginalSize);
+    d->ID3v1Location -= d->ID3v2OriginalSize;
+    d->ID3v2Location = -1;
+    d->ID3v2OriginalSize = 0;
+    d->hasID3v2 = false;
+  }
+
+  // Update ID3v1 tag
+
+  if(ID3v1Tag() && !ID3v1Tag()->isEmpty()) {
+    if(!d->hasID3v1) {
+      seek(0, End);
+      d->ID3v1Location = tell();
+    }
+    else
+      seek(d->ID3v1Location);
+    writeBlock(ID3v1Tag()->render());
+    d->hasID3v1 = true;
+  }
+  else if(d->hasID3v1) {
+    removeBlock(d->ID3v1Location, 128);
+    d->ID3v1Location = -1;
+    d->hasID3v1 = false;
+  }
+
+  return true;
+}
+
+ID3v1::Tag *TrueAudio::File::ID3v1Tag(bool create)
+{
+  return d->tag.access<ID3v1::Tag>(ID3v1Index, create);
+}
+
+ID3v2::Tag *TrueAudio::File::ID3v2Tag(bool create)
+{
+  return d->tag.access<ID3v2::Tag>(ID3v2Index, create);
+}
+
+void TrueAudio::File::strip(int tags)
+{
+  if(tags & ID3v1) {
+    d->tag.set(ID3v1Index, 0);
+    ID3v2Tag(true);
+  }
+
+  if(tags & ID3v2) {
+    d->tag.set(ID3v2Index, 0);
+
+    if(!ID3v1Tag())
+      ID3v2Tag(true);
+  }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void TrueAudio::File::read(bool readProperties, Properties::ReadStyle /* propertiesStyle */)
+{
+  // Look for an ID3v2 tag
+
+  d->ID3v2Location = findID3v2();
+
+  if(d->ID3v2Location >= 0) {
+
+    d->tag.set(ID3v2Index, new ID3v2::Tag(this, d->ID3v2Location, d->ID3v2FrameFactory));
+
+    d->ID3v2OriginalSize = ID3v2Tag()->header()->completeTagSize();
+
+    if(ID3v2Tag()->header()->tagSize() <= 0)
+      d->tag.set(ID3v2Index, 0);
+    else
+      d->hasID3v2 = true;
+  }
+
+  // Look for an ID3v1 tag
+
+  d->ID3v1Location = findID3v1();
+
+  if(d->ID3v1Location >= 0) {
+    d->tag.set(ID3v1Index, new ID3v1::Tag(this, d->ID3v1Location));
+    d->hasID3v1 = true;
+  }
+
+  if(!d->hasID3v1)
+    ID3v2Tag(true);
+
+  // Look for TrueAudio metadata
+
+  if(readProperties) {
+    if(d->ID3v2Location >= 0) {
+      seek(d->ID3v2Location + d->ID3v2OriginalSize);
+      d->properties = new Properties(readBlock(TrueAudio::HeaderSize),
+                                     length() - d->ID3v2OriginalSize);
+    }
+    else {
+      seek(0);
+      d->properties = new Properties(readBlock(TrueAudio::HeaderSize),
+                                     length());
+    }
+  }
+}
+
+long TrueAudio::File::findID3v1()
+{
+  if(!isValid())
+    return -1;
+
+  seek(-128, End);
+  long p = tell();
+
+  if(readBlock(3) == ID3v1::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
+
+long TrueAudio::File::findID3v2()
+{
+  if(!isValid())
+    return -1;
+
+  seek(0);
+
+  if(readBlock(3) == ID3v2::Header::fileIdentifier())
+    return 0;
+
+  return -1;
+}
diff --git a/lib-src/taglib/taglib/trueaudio/trueaudiofile.h b/lib-src/taglib/taglib/trueaudio/trueaudiofile.h
new file mode 100644
index 0000000..bd30baa
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/trueaudiofile.h
@@ -0,0 +1,180 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TRUEAUDIOFILE_H
+#define TAGLIB_TRUEAUDIOFILE_H
+
+#include <tfile.h>
+#include "trueaudioproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  namespace ID3v2 { class Tag; class FrameFactory; }
+  namespace ID3v1 { class Tag; }
+
+  //! An implementation of TrueAudio metadata
+
+  /*!
+   * This is implementation of TrueAudio metadata.
+   *
+   * This supports ID3v1 and ID3v2 tags as well as reading stream
+   * properties from the file.
+   */
+
+  namespace TrueAudio {
+
+    //! An implementation of TagLib::File with TrueAudio specific methods
+
+    /*!
+     * This implements and provides an interface for TrueAudio files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to TrueAudio files.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * This set of flags is used for various operations and is suitable for
+       * being OR-ed together.
+       */
+      enum TagTypes {
+        //! Empty set.  Matches no tag types.
+        NoTags  = 0x0000,
+        //! Matches ID3v1 tags.
+        ID3v1   = 0x0001,
+        //! Matches ID3v2 tags.
+        ID3v2   = 0x0002,
+        //! Matches all tag types.
+        AllTags = 0xffff
+      };
+
+      /*!
+       * Contructs an TrueAudio file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Contructs an TrueAudio file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored. The frames will be created using
+       * \a frameFactory.
+       */
+      File(FileName file, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the Tag for this file.
+       */
+      virtual TagLib::Tag *tag() const;
+
+      /*!
+       * Returns the TrueAudio::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Set the ID3v2::FrameFactory to something other than the default.
+       *
+       * \see ID3v2FrameFactory
+       */
+      void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
+
+      /*!
+       * Saves the file.
+       */
+      virtual bool save();
+
+      /*!
+       * Returns a pointer to the ID3v2 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v2 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist. If there is already an APE tag, the
+       * new ID3v1 tag will be placed after it.
+       *
+       * \note The Tag <b>is still</b> owned by the TrueAudio::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v1::Tag *ID3v1Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the ID3v1 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v1 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist. If there is already an APE tag, the
+       * new ID3v1 tag will be placed after it.
+       *
+       * \note The Tag <b>is still</b> owned by the TrueAudio::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v2::Tag *ID3v2Tag(bool create = false);
+
+      /*!
+       * This will remove the tags that match the OR-ed together TagTypes from the
+       * file.  By default it removes all tags.
+       *
+       * \note This will also invalidate pointers to the tags
+       * as their memory will be freed.
+       * \note In order to make the removal permanent save() still needs to be called
+       */
+      void strip(int tags = AllTags);
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      void scan();
+      long findID3v1();
+      long findID3v2();
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/trueaudio/trueaudioproperties.cpp b/lib-src/taglib/taglib/trueaudio/trueaudioproperties.cpp
new file mode 100644
index 0000000..ff65edf
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/trueaudioproperties.cpp
@@ -0,0 +1,136 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <bitset>
+
+#include "trueaudioproperties.h"
+#include "trueaudiofile.h"
+
+using namespace TagLib;
+
+class TrueAudio::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(const ByteVector &d, long length, ReadStyle s) :
+    data(d),
+    streamLength(length),
+    style(s),
+    version(0),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0),
+    bitsPerSample(0) {}
+
+  ByteVector data;
+  long streamLength;
+  ReadStyle style;
+  int version;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int bitsPerSample;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+TrueAudio::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(data, streamLength, style);
+  read();
+}
+
+TrueAudio::Properties::~Properties()
+{
+  delete d;
+}
+
+int TrueAudio::Properties::length() const
+{
+  return d->length;
+}
+
+int TrueAudio::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int TrueAudio::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int TrueAudio::Properties::bitsPerSample() const
+{
+  return d->bitsPerSample;
+}
+
+int TrueAudio::Properties::channels() const
+{
+  return d->channels;
+}
+
+int TrueAudio::Properties::ttaVersion() const
+{
+  return d->version;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void TrueAudio::Properties::read()
+{
+  if(!d->data.startsWith("TTA"))
+    return;
+
+  int pos = 3;
+
+  d->version = d->data[pos] - '0';
+  pos += 1 + 2;
+
+  d->channels = d->data.mid(pos, 2).toShort(false);
+  pos += 2;
+
+  d->bitsPerSample = d->data.mid(pos, 2).toShort(false);
+  pos += 2;
+
+  d->sampleRate = d->data.mid(pos, 4).toUInt(false);
+  pos += 4;
+
+  unsigned long samples = d->data.mid(pos, 4).toUInt(false);
+  d->length = samples / d->sampleRate;
+
+  d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;
+}
diff --git a/lib-src/taglib/taglib/trueaudio/trueaudioproperties.h b/lib-src/taglib/taglib/trueaudio/trueaudioproperties.h
new file mode 100644
index 0000000..b89fe9d
--- /dev/null
+++ b/lib-src/taglib/taglib/trueaudio/trueaudioproperties.h
@@ -0,0 +1,93 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_TRUEAUDIOPROPERTIES_H
+#define TAGLIB_TRUEAUDIOPROPERTIES_H
+
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace TrueAudio {
+
+    class File;
+
+    static const uint HeaderSize = 18;
+
+    //! An implementation of audio property reading for TrueAudio
+
+    /*!
+     * This reads the data from an TrueAudio stream found in the AudioProperties
+     * API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of TrueAudio::Properties with the data read from the
+       * ByteVector \a data.
+       */
+      Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
+
+      /*!
+       * Destroys this TrueAudio::Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns number of bits per sample.
+       */
+      int bitsPerSample() const;
+
+      /*!
+       * Returns the major version number.
+       */
+      int ttaVersion() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/wavpack/.deps/wavpackfile.Plo b/lib-src/taglib/taglib/wavpack/.deps/wavpackfile.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/.deps/wavpackfile.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/wavpack/.deps/wavpackproperties.Plo b/lib-src/taglib/taglib/wavpack/.deps/wavpackproperties.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/.deps/wavpackproperties.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/taglib/wavpack/CMakeLists.txt b/lib-src/taglib/taglib/wavpack/CMakeLists.txt
new file mode 100644
index 0000000..8b9de0f
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/CMakeLists.txt
@@ -0,0 +1 @@
+INSTALL( FILES  wavpackfile.h wavpackproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
diff --git a/lib-src/taglib/taglib/wavpack/Makefile.am b/lib-src/taglib/taglib/wavpack/Makefile.am
new file mode 100644
index 0000000..4455177
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libwavpack.la
+
+libwavpack_la_SOURCES = wavpackfile.cpp wavpackproperties.cpp
+
+taglib_include_HEADERS = wavpackfile.h wavpackproperties.h
+taglib_includedir = $(includedir)/taglib
diff --git a/lib-src/taglib/taglib/wavpack/Makefile.in b/lib-src/taglib/taglib/wavpack/Makefile.in
new file mode 100644
index 0000000..c78c85a
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/Makefile.in
@@ -0,0 +1,626 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = taglib/wavpack
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(taglib_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libwavpack_la_LIBADD =
+am_libwavpack_la_OBJECTS = wavpackfile.lo wavpackproperties.lo
+#>- libwavpack_la_OBJECTS = $(am_libwavpack_la_OBJECTS)
+#>+ 4
+libwavpack_la_final_OBJECTS = libwavpack_la.all_cpp.lo 
+libwavpack_la_nofinal_OBJECTS = wavpackfile.lo wavpackproperties.lo
+ at KDE_USE_FINAL_FALSE@libwavpack_la_OBJECTS = $(libwavpack_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libwavpack_la_OBJECTS = $(libwavpack_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libwavpack_la_SOURCES)
+DIST_SOURCES = $(libwavpack_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(taglib_includedir)"
+taglib_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(taglib_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+	-I$(top_srcdir)/taglib \
+	-I$(top_srcdir)/taglib/toolkit \
+	-I$(top_srcdir)/taglib/ape \
+	-I$(top_srcdir)/taglib/mpc \
+	-I$(top_srcdir)/taglib/mpeg/id3v1 \
+	-I$(top_srcdir)/taglib/mpeg/id3v2 \
+	$(all_includes)
+
+noinst_LTLIBRARIES = libwavpack.la
+libwavpack_la_SOURCES = wavpackfile.cpp wavpackproperties.cpp
+taglib_include_HEADERS = wavpackfile.h wavpackproperties.h
+taglib_includedir = $(includedir)/taglib
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/wavpack/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  taglib/wavpack/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/wavpack/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/wavpack/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/wavpack/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libwavpack.la: $(libwavpack_la_OBJECTS) $(libwavpack_la_DEPENDENCIES) 
+	$(CXXLINK)  $(libwavpack_la_OBJECTS) $(libwavpack_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wavpackfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wavpackproperties.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-taglib_includeHEADERS: $(taglib_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(taglib_includedir)" || $(MKDIR_P) "$(DESTDIR)$(taglib_includedir)"
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(taglib_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  $(taglib_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+uninstall-taglib_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(taglib_include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(taglib_includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(taglib_includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(taglib_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-taglib_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-taglib_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-taglib_includeHEADERS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-taglib_includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=Makefile.in Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  taglib/wavpack/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  taglib/wavpack/Makefile
+	cd $(top_srcdir) && perl admin/am_edit taglib/wavpack/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in $(taglib_include_HEADERS); do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+libwavpack_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/wavpackfile.cpp $(srcdir)/wavpackproperties.cpp 
+	@echo 'creating libwavpack_la.all_cpp.cpp ...'; \
+	rm -f libwavpack_la.all_cpp.files libwavpack_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libwavpack_la.all_cpp.final; \
+	for file in wavpackfile.cpp wavpackproperties.cpp ; do \
+	  echo "#include \"$$file\"" >> libwavpack_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libwavpack_la.all_cpp.final; \
+	done; \
+	cat libwavpack_la.all_cpp.final libwavpack_la.all_cpp.files > libwavpack_la.all_cpp.cpp; \
+	rm -f libwavpack_la.all_cpp.final libwavpack_la.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libwavpack_la.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) libwavpack_la_OBJECTS="$(libwavpack_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) libwavpack_la_OBJECTS="$(libwavpack_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) libwavpack_la_OBJECTS="$(libwavpack_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) libwavpack_la_OBJECTS="$(libwavpack_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/taglib/wavpack/wavpackfile.cpp b/lib-src/taglib/taglib/wavpack/wavpackfile.cpp
new file mode 100644
index 0000000..9a64b8c
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/wavpackfile.cpp
@@ -0,0 +1,270 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tbytevector.h>
+#include <tstring.h>
+#include <tdebug.h>
+#include <tagunion.h>
+
+#include "wavpackfile.h"
+#include "id3v1tag.h"
+#include "id3v2header.h"
+#include "apetag.h"
+#include "apefooter.h"
+
+using namespace TagLib;
+
+namespace
+{
+  enum { APEIndex, ID3v1Index };
+}
+
+class WavPack::File::FilePrivate
+{
+public:
+  FilePrivate() :
+    APELocation(-1),
+    APESize(0),
+    ID3v1Location(-1),
+    properties(0),
+    scanned(false),
+    hasAPE(false),
+    hasID3v1(false) {}
+
+  ~FilePrivate()
+  {
+    delete properties;
+  }
+
+  long APELocation;
+  uint APESize;
+
+  long ID3v1Location;
+
+  TagUnion tag;
+
+  Properties *properties;
+  bool scanned;
+
+  // These indicate whether the file *on disk* has these tags, not if
+  // this data structure does.  This is used in computing offsets.
+
+  bool hasAPE;
+  bool hasID3v1;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+WavPack::File::File(FileName file, bool readProperties,
+                Properties::ReadStyle propertiesStyle) : TagLib::File(file)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
+WavPack::File::~File()
+{
+  delete d;
+}
+
+TagLib::Tag *WavPack::File::tag() const
+{
+  return &d->tag;
+}
+
+WavPack::Properties *WavPack::File::audioProperties() const
+{
+  return d->properties;
+}
+
+bool WavPack::File::save()
+{
+  if(readOnly()) {
+    debug("WavPack::File::save() -- File is read only.");
+    return false;
+  }
+
+  // Update ID3v1 tag
+
+  if(ID3v1Tag()) {
+    if(d->hasID3v1) {
+      seek(d->ID3v1Location);
+      writeBlock(ID3v1Tag()->render());
+    }
+    else {
+      seek(0, End);
+      d->ID3v1Location = tell();
+      writeBlock(ID3v1Tag()->render());
+      d->hasID3v1 = true;
+    }
+  }
+  else {
+    if(d->hasID3v1) {
+      removeBlock(d->ID3v1Location, 128);
+      d->hasID3v1 = false;
+      if(d->hasAPE) {
+        if(d->APELocation > d->ID3v1Location)
+          d->APELocation -= 128;
+      }
+    }
+  }
+
+  // Update APE tag
+
+  if(APETag()) {
+    if(d->hasAPE)
+      insert(APETag()->render(), d->APELocation, d->APESize);
+    else {
+      if(d->hasID3v1)  {
+        insert(APETag()->render(), d->ID3v1Location, 0);
+        d->APESize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+        d->APELocation = d->ID3v1Location;
+        d->ID3v1Location += d->APESize;
+      }
+      else {
+        seek(0, End);
+        d->APELocation = tell();
+        writeBlock(APETag()->render());
+        d->APESize = APETag()->footer()->completeTagSize();
+        d->hasAPE = true;
+      }
+    }
+  }
+  else {
+    if(d->hasAPE) {
+      removeBlock(d->APELocation, d->APESize);
+      d->hasAPE = false;
+      if(d->hasID3v1) {
+        if(d->ID3v1Location > d->APELocation) {
+          d->ID3v1Location -= d->APESize;
+        }
+      }
+    }
+  }
+
+   return true;
+}
+
+ID3v1::Tag *WavPack::File::ID3v1Tag(bool create)
+{
+  return d->tag.access<ID3v1::Tag>(ID3v1Index, create);
+}
+
+APE::Tag *WavPack::File::APETag(bool create)
+{
+  return d->tag.access<APE::Tag>(APEIndex, create);
+}
+
+void WavPack::File::strip(int tags)
+{
+  if(tags & ID3v1) {
+    d->tag.set(ID3v1Index, 0);
+    APETag(true);
+  }
+
+  if(tags & APE) {
+    d->tag.set(APEIndex, 0);
+
+    if(!ID3v1Tag())
+      APETag(true);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+void WavPack::File::read(bool readProperties, Properties::ReadStyle /* propertiesStyle */)
+{
+  // Look for an ID3v1 tag
+
+  d->ID3v1Location = findID3v1();
+
+  if(d->ID3v1Location >= 0) {
+    d->tag.set(ID3v1Index, new ID3v1::Tag(this, d->ID3v1Location));
+    d->hasID3v1 = true;
+  }
+
+  // Look for an APE tag
+
+  d->APELocation = findAPE();
+
+  if(d->APELocation >= 0) {
+    d->tag.set(APEIndex, new APE::Tag(this, d->APELocation));
+    d->APESize = APETag()->footer()->completeTagSize();
+    d->APELocation = d->APELocation + APETag()->footer()->size() - d->APESize;
+    d->hasAPE = true;
+  }
+
+  if(!d->hasID3v1)
+    APETag(true);
+
+  // Look for WavPack audio properties
+
+  if(readProperties) {
+    seek(0);
+    d->properties = new Properties(readBlock(WavPack::HeaderSize),
+                                   length() - d->APESize);
+  }
+}
+
+long WavPack::File::findAPE()
+{
+  if(!isValid())
+    return -1;
+
+  if(d->hasID3v1)
+    seek(-160, End);
+  else
+    seek(-32, End);
+
+  long p = tell();
+
+  if(readBlock(8) == APE::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
+
+long WavPack::File::findID3v1()
+{
+  if(!isValid())
+    return -1;
+
+  seek(-128, End);
+  long p = tell();
+
+  if(readBlock(3) == ID3v1::Tag::fileIdentifier())
+    return p;
+
+  return -1;
+}
diff --git a/lib-src/taglib/taglib/wavpack/wavpackfile.h b/lib-src/taglib/taglib/wavpack/wavpackfile.h
new file mode 100644
index 0000000..e43a987
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/wavpackfile.h
@@ -0,0 +1,164 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_WVFILE_H
+#define TAGLIB_WVFILE_H
+
+#include <tfile.h>
+#include "taglib_export.h"
+#include "wavpackproperties.h"
+
+namespace TagLib {
+
+  class Tag;
+
+  namespace ID3v1 { class Tag; }
+  namespace APE { class Tag; }
+
+  //! An implementation of WavPack metadata
+
+  /*!
+   * This is implementation of WavPack metadata.
+   *
+   * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream
+   * properties from the file.
+   */
+
+  namespace WavPack {
+
+    //! An implementation of TagLib::File with WavPack specific methods
+
+    /*!
+     * This implements and provides an interface for WavPack files to the
+     * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
+     * the abstract TagLib::File API as well as providing some additional
+     * information specific to WavPack files.
+     */
+
+    class TAGLIB_EXPORT File : public TagLib::File
+    {
+    public:
+      /*!
+       * This set of flags is used for various operations and is suitable for
+       * being OR-ed together.
+       */
+      enum TagTypes {
+        //! Empty set.  Matches no tag types.
+        NoTags  = 0x0000,
+        //! Matches ID3v1 tags.
+        ID3v1   = 0x0001,
+        //! Matches APE tags.
+        APE     = 0x0002,
+        //! Matches all tag types.
+        AllTags = 0xffff
+      };
+
+      /*!
+       * Contructs an WavPack file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       */
+      File(FileName file, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Destroys this instance of the File.
+       */
+      virtual ~File();
+
+      /*!
+       * Returns the Tag for this file.  This will be an APE tag, an ID3v1 tag
+       * or a combination of the two.
+       */
+      virtual TagLib::Tag *tag() const;
+
+      /*!
+       * Returns the MPC::Properties for this file.  If no audio properties
+       * were read then this will return a null pointer.
+       */
+      virtual Properties *audioProperties() const;
+
+      /*!
+       * Saves the file.
+       */
+      virtual bool save();
+
+      /*!
+       * Returns a pointer to the ID3v1 tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid ID3v1 tag.  If \a create is true it will create
+       * an ID3v1 tag if one does not exist. If there is already an APE tag, the
+       * new ID3v1 tag will be placed after it.
+       *
+       * \note The Tag <b>is still</b> owned by the APE::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      ID3v1::Tag *ID3v1Tag(bool create = false);
+
+      /*!
+       * Returns a pointer to the APE tag of the file.
+       *
+       * If \a create is false (the default) this will return a null pointer
+       * if there is no valid APE tag.  If \a create is true it will create
+       * a APE tag if one does not exist.
+       *
+       * \note The Tag <b>is still</b> owned by the APE::File and should not be
+       * deleted by the user.  It will be deleted when the file (object) is
+       * destroyed.
+       */
+      APE::Tag *APETag(bool create = false);
+
+      /*!
+       * This will remove the tags that match the OR-ed together TagTypes from the
+       * file.  By default it removes all tags.
+       *
+       * \note This will also invalidate pointers to the tags
+       * as their memory will be freed.
+       * \note In order to make the removal permanent save() still needs to be called
+       */
+      void strip(int tags = AllTags);
+
+    private:
+      File(const File &);
+      File &operator=(const File &);
+
+      void read(bool readProperties, Properties::ReadStyle propertiesStyle);
+      void scan();
+      long findID3v1();
+      long findAPE();
+
+      class FilePrivate;
+      FilePrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/taglib/wavpack/wavpackproperties.cpp b/lib-src/taglib/taglib/wavpack/wavpackproperties.cpp
new file mode 100644
index 0000000..ec7a9bf
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/wavpackproperties.cpp
@@ -0,0 +1,143 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#include <tstring.h>
+#include <tdebug.h>
+#include <bitset>
+
+#include "wavpackproperties.h"
+#include "wavpackfile.h"
+
+using namespace TagLib;
+
+class WavPack::Properties::PropertiesPrivate
+{
+public:
+  PropertiesPrivate(const ByteVector &d, long length, ReadStyle s) :
+    data(d),
+    streamLength(length),
+    style(s),
+    length(0),
+    bitrate(0),
+    sampleRate(0),
+    channels(0),
+    version(0),
+    bitsPerSample(0) {}
+
+  ByteVector data;
+  long streamLength;
+  ReadStyle style;
+  int length;
+  int bitrate;
+  int sampleRate;
+  int channels;
+  int version;
+  int bitsPerSample;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// public members
+////////////////////////////////////////////////////////////////////////////////
+
+WavPack::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style)
+{
+  d = new PropertiesPrivate(data, streamLength, style);
+  read();
+}
+
+WavPack::Properties::~Properties()
+{
+  delete d;
+}
+
+int WavPack::Properties::length() const
+{
+  return d->length;
+}
+
+int WavPack::Properties::bitrate() const
+{
+  return d->bitrate;
+}
+
+int WavPack::Properties::sampleRate() const
+{
+  return d->sampleRate;
+}
+
+int WavPack::Properties::channels() const
+{
+  return d->channels;
+}
+
+int WavPack::Properties::version() const
+{
+  return d->version;
+}
+
+int WavPack::Properties::bitsPerSample() const
+{
+  return d->bitsPerSample;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// private members
+////////////////////////////////////////////////////////////////////////////////
+
+static const unsigned int sample_rates[] = { 6000, 8000, 9600, 11025, 12000,
+    16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 192000 };
+
+#define BYTES_STORED    3
+#define MONO_FLAG       4
+
+#define SHIFT_LSB       13
+#define SHIFT_MASK      (0x1fL << SHIFT_LSB)
+
+#define SRATE_LSB       23
+#define SRATE_MASK      (0xfL << SRATE_LSB)
+
+void WavPack::Properties::read()
+{
+  if(!d->data.startsWith("wvpk"))
+    return;
+
+  d->version = d->data.mid(8, 2).toShort(false);
+
+  unsigned int flags = d->data.mid(24, 4).toUInt(false);
+  d->bitsPerSample = ((flags & BYTES_STORED) + 1) * 8 -
+    ((flags & SHIFT_MASK) >> SHIFT_LSB);
+  d->sampleRate = sample_rates[(flags & SRATE_MASK) >> SRATE_LSB];
+  d->channels = (flags & MONO_FLAG) ? 1 : 2;
+
+  unsigned int samples = d->data.mid(12, 4).toUInt(false);
+  d->length = d->sampleRate > 0 ? (samples + (d->sampleRate / 2)) / d->sampleRate : 0;
+
+  d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;
+}
+
diff --git a/lib-src/taglib/taglib/wavpack/wavpackproperties.h b/lib-src/taglib/taglib/wavpack/wavpackproperties.h
new file mode 100644
index 0000000..a77e4de
--- /dev/null
+++ b/lib-src/taglib/taglib/wavpack/wavpackproperties.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+    copyright            : (C) 2006 by Lukáš Lalinský
+    email                : lalinsky at gmail.com
+
+    copyright            : (C) 2004 by Allan Sandfeld Jensen
+    email                : kde at carewolf.org
+                           (original MPC implementation)
+ ***************************************************************************/
+
+/***************************************************************************
+ *   This library is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License version   *
+ *   2.1 as published by the Free Software Foundation.                     *
+ *                                                                         *
+ *   This library is distributed in the hope that it will be useful, but   *
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
+ *   Lesser General Public License for more details.                       *
+ *                                                                         *
+ *   You should have received a copy of the GNU Lesser General Public      *
+ *   License along with this library; if not, write to the Free Software   *
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
+ *   USA                                                                   *
+ *                                                                         *
+ *   Alternatively, this file is available under the Mozilla Public        *
+ *   License Version 1.1.  You may obtain a copy of the License at         *
+ *   http://www.mozilla.org/MPL/                                           *
+ ***************************************************************************/
+
+#ifndef TAGLIB_WVPROPERTIES_H
+#define TAGLIB_WVPROPERTIES_H
+
+#include "taglib_export.h"
+#include "audioproperties.h"
+
+namespace TagLib {
+
+  namespace WavPack {
+
+    class File;
+
+    static const uint HeaderSize = 32;
+
+    //! An implementation of audio property reading for WavPack
+
+    /*!
+     * This reads the data from an WavPack stream found in the AudioProperties
+     * API.
+     */
+
+    class TAGLIB_EXPORT Properties : public AudioProperties
+    {
+    public:
+      /*!
+       * Create an instance of WavPack::Properties with the data read from the
+       * ByteVector \a data.
+       */
+      Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
+
+      /*!
+       * Destroys this WavPack::Properties instance.
+       */
+      virtual ~Properties();
+
+      // Reimplementations.
+
+      virtual int length() const;
+      virtual int bitrate() const;
+      virtual int sampleRate() const;
+      virtual int channels() const;
+
+      /*!
+       * Returns number of bits per sample.
+       */
+      int bitsPerSample() const;
+
+      /*!
+       * Returns WavPack version.
+       */
+      int version() const;
+
+    private:
+      Properties(const Properties &);
+      Properties &operator=(const Properties &);
+
+      void read();
+
+      class PropertiesPrivate;
+      PropertiesPrivate *d;
+    };
+  }
+}
+
+#endif
diff --git a/lib-src/taglib/tests/.deps/main.Po b/lib-src/taglib/tests/.deps/main.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/main.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_bytevector.Po b/lib-src/taglib/tests/.deps/test_bytevector.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_bytevector.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_fileref.Po b/lib-src/taglib/tests/.deps/test_fileref.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_fileref.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_id3v1.Po b/lib-src/taglib/tests/.deps/test_id3v1.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_id3v1.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_id3v2.Po b/lib-src/taglib/tests/.deps/test_id3v2.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_id3v2.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_list.Po b/lib-src/taglib/tests/.deps/test_list.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_list.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_map.Po b/lib-src/taglib/tests/.deps/test_map.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_map.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_mpeg.Po b/lib-src/taglib/tests/.deps/test_mpeg.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_mpeg.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_string.Po b/lib-src/taglib/tests/.deps/test_string.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_string.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_synchdata.Po b/lib-src/taglib/tests/.deps/test_synchdata.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_synchdata.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/.deps/test_trueaudio.Po b/lib-src/taglib/tests/.deps/test_trueaudio.Po
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/lib-src/taglib/tests/.deps/test_trueaudio.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/lib-src/taglib/tests/CMakeLists.txt b/lib-src/taglib/tests/CMakeLists.txt
new file mode 100644
index 0000000..bde62c1
--- /dev/null
+++ b/lib-src/taglib/tests/CMakeLists.txt
@@ -0,0 +1,44 @@
+if(BUILD_TESTS)
+
+INCLUDE_DIRECTORIES(
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/asf
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2/frames
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mp4
+  ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/trueaudio
+)
+
+SET(test_runner_SRCS
+  main.cpp
+  test_list.cpp
+  test_map.cpp
+  test_mpeg.cpp
+  test_synchdata.cpp
+  test_trueaudio.cpp
+  test_bytevector.cpp
+  test_string.cpp
+  test_fileref.cpp
+  test_id3v1.cpp
+  test_id3v2.cpp
+)
+IF(WITH_MP4)
+   SET(test_runner_SRCS ${test_runner_SRCS} test_mp4.cpp)
+ENDIF(WITH_MP4)
+
+IF(WITH_ASF)
+   SET(test_runner_SRCS ${test_runner_SRCS} test_asf.cpp)
+ENDIF(WITH_ASF)
+
+ADD_EXECUTABLE(test_runner ${test_runner_SRCS})
+TARGET_LINK_LIBRARIES(test_runner tag ${CPPUNIT_LIBRARIES})
+
+ADD_CUSTOM_TARGET(check
+    ./test_runner
+    DEPENDS test_runner
+)
+
+endif(BUILD_TESTS)
diff --git a/lib-src/taglib/tests/Makefile.am b/lib-src/taglib/tests/Makefile.am
new file mode 100644
index 0000000..6519180
--- /dev/null
+++ b/lib-src/taglib/tests/Makefile.am
@@ -0,0 +1,27 @@
+INCLUDES = \
+        -I$(top_srcdir)/taglib\
+        -I$(top_srcdir)/taglib/toolkit \
+        -I$(top_srcdir)/taglib/trueaudio \
+        -I$(top_srcdir)/taglib/mpeg \
+        -I$(top_srcdir)/taglib/mpeg/id3v1 \
+        -I$(top_srcdir)/taglib/mpeg/id3v2 \
+        -I$(top_srcdir)/taglib/mpeg/id3v2/frames
+
+test_runner_SOURCES = \
+	main.cpp \
+	test_list.cpp \
+	test_map.cpp \
+	test_mpeg.cpp \
+	test_synchdata.cpp \
+	test_trueaudio.cpp \
+	test_bytevector.cpp \
+	test_string.cpp \
+	test_fileref.cpp \
+	test_id3v1.cpp \
+	test_id3v2.cpp
+
+if build_tests
+TESTS = test_runner
+check_PROGRAMS = test_runner
+LDADD = ../taglib/libtag.la -lcppunit
+endif
diff --git a/lib-src/taglib/tests/Makefile.in b/lib-src/taglib/tests/Makefile.in
new file mode 100644
index 0000000..3a5ac48
--- /dev/null
+++ b/lib-src/taglib/tests/Makefile.in
@@ -0,0 +1,712 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+ at build_tests_TRUE@TESTS = test_runner$(EXEEXT)
+ at build_tests_TRUE@check_PROGRAMS = test_runner$(EXEEXT)
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_test_runner_OBJECTS = main.$(OBJEXT) test_list.$(OBJEXT) \
+	test_map.$(OBJEXT) test_mpeg.$(OBJEXT) \
+	test_synchdata.$(OBJEXT) test_trueaudio.$(OBJEXT) \
+	test_bytevector.$(OBJEXT) test_string.$(OBJEXT) \
+	test_fileref.$(OBJEXT) test_id3v1.$(OBJEXT) \
+	test_id3v2.$(OBJEXT)
+#>- test_runner_OBJECTS = $(am_test_runner_OBJECTS)
+#>+ 9
+test_runner_final_OBJECTS = test_runner.all_cpp.o 
+test_runner_nofinal_OBJECTS = main.$(OBJEXT) test_list.$(OBJEXT) \
+	test_map.$(OBJEXT) test_mpeg.$(OBJEXT) \
+	test_synchdata.$(OBJEXT) test_trueaudio.$(OBJEXT) \
+	test_bytevector.$(OBJEXT) test_string.$(OBJEXT) \
+	test_fileref.$(OBJEXT) test_id3v1.$(OBJEXT) \
+	test_id3v2.$(OBJEXT)
+ at KDE_USE_FINAL_FALSE@test_runner_OBJECTS = $(test_runner_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@test_runner_OBJECTS = $(test_runner_final_OBJECTS)
+test_runner_LDADD = $(LDADD)
+ at build_tests_TRUE@test_runner_DEPENDENCIES = ../taglib/libtag.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+#>- 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+#>- 	$(LDFLAGS) -o $@
+#>+ 3
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(test_runner_SOURCES)
+DIST_SOURCES = $(test_runner_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = \
+        -I$(top_srcdir)/taglib\
+        -I$(top_srcdir)/taglib/toolkit \
+        -I$(top_srcdir)/taglib/trueaudio \
+        -I$(top_srcdir)/taglib/mpeg \
+        -I$(top_srcdir)/taglib/mpeg/id3v1 \
+        -I$(top_srcdir)/taglib/mpeg/id3v2 \
+        -I$(top_srcdir)/taglib/mpeg/id3v2/frames
+
+test_runner_SOURCES = \
+	main.cpp \
+	test_list.cpp \
+	test_map.cpp \
+	test_mpeg.cpp \
+	test_synchdata.cpp \
+	test_trueaudio.cpp \
+	test_bytevector.cpp \
+	test_string.cpp \
+	test_fileref.cpp \
+	test_id3v1.cpp \
+	test_id3v2.cpp
+
+ at build_tests_TRUE@LDADD = ../taglib/libtag.la -lcppunit
+#>- all: all-am
+#>+ 1
+all: docs-am  all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+#>- 	@for dep in $?; do \
+#>- 	  case '$(am__configure_deps)' in \
+#>- 	    *$$dep*) \
+#>- 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+#>- 	        && { if test -f $@; then exit 0; else break; fi; }; \
+#>- 	      exit 1;; \
+#>- 	  esac; \
+#>- 	done; \
+#>- 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  tests/Makefile'; \
+#>- 	cd $(top_srcdir) && \
+#>- 	  $(AUTOMAKE) --foreign  tests/Makefile
+#>+ 12
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  tests/Makefile
+	cd $(top_srcdir) && perl admin/am_edit tests/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+test_runner$(EXEEXT): $(test_runner_OBJECTS) $(test_runner_DEPENDENCIES) 
+	@rm -f test_runner$(EXEEXT)
+	$(CXXLINK) $(test_runner_OBJECTS) $(test_runner_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_bytevector.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_fileref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_id3v1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_id3v2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_list.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_mpeg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_synchdata.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_trueaudio.Po at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+		echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+#>- clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+#>- 	mostlyclean-am
+#>+ 2
+clean-am: clean-bcheck clean-final  clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 2
+KDE_DIST=test_mp4.cpp utils.h Makefile.in test_asf.cpp Makefile.am CMakeLists.txt 
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+		@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  tests/Makefile
+	cd $(top_srcdir) && perl admin/am_edit tests/Makefile.in
+
+
+#>+ 21
+clean-bcheck: 
+	rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+	@for i in ; do \
+	    if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+	        echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+	        echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+	        echo "$$i"; \
+	        if ! $(CXXCOMPILE)  --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+	            rm -f $$i.bchecktest.cc; exit 1; \
+	        fi ; \
+	        echo "" >> $$i.bchecktest.cc.class; \
+	        perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+	        rm -f a.out; \
+	    fi ; \
+	done
+
+
+#>+ 11
+test_runner.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/main.cpp $(srcdir)/test_list.cpp $(srcdir)/test_map.cpp $(srcdir)/test_mpeg.cpp $(srcdir)/test_synchdata.cpp $(srcdir)/test_trueaudio.cpp $(srcdir)/test_bytevector.cpp $(srcdir)/test_string.cpp $(srcdir)/test_fileref.cpp $(srcdir)/test_id3v1.cpp $(srcdir)/test_id3v2.cpp 
+	@echo 'creating test_runner.all_cpp.cpp ...'; \
+	rm -f test_runner.all_cpp.files test_runner.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> test_runner.all_cpp.final; \
+	for file in main.cpp test_list.cpp test_map.cpp test_mpeg.cpp test_synchdata.cpp test_trueaudio.cpp test_bytevector.cpp test_string.cpp test_fileref.cpp test_id3v1.cpp test_id3v2.cpp ; do \
+	  echo "#include \"$$file\"" >> test_runner.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> test_runner.all_cpp.final; \
+	done; \
+	cat test_runner.all_cpp.final test_runner.all_cpp.files > test_runner.all_cpp.cpp; \
+	rm -f test_runner.all_cpp.final test_runner.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f test_runner.all_cpp.cpp
+
+#>+ 3
+final:
+	$(MAKE) test_runner_OBJECTS="$(test_runner_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+	$(MAKE) test_runner_OBJECTS="$(test_runner_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+	$(MAKE) test_runner_OBJECTS="$(test_runner_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+	$(MAKE) test_runner_OBJECTS="$(test_runner_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 3
+nmcheck: 
+nmcheck-am: nmcheck
diff --git a/lib-src/taglib/tests/data/005411.id3 b/lib-src/taglib/tests/data/005411.id3
new file mode 100644
index 0000000..ab2e099
Binary files /dev/null and b/lib-src/taglib/tests/data/005411.id3 differ
diff --git a/lib-src/taglib/tests/data/broken-tenc.id3 b/lib-src/taglib/tests/data/broken-tenc.id3
new file mode 100644
index 0000000..8090405
Binary files /dev/null and b/lib-src/taglib/tests/data/broken-tenc.id3 differ
diff --git a/lib-src/taglib/tests/data/click.mpc b/lib-src/taglib/tests/data/click.mpc
new file mode 100644
index 0000000..a41f14e
Binary files /dev/null and b/lib-src/taglib/tests/data/click.mpc differ
diff --git a/lib-src/taglib/tests/data/click.wv b/lib-src/taglib/tests/data/click.wv
new file mode 100644
index 0000000..f8bd1a8
Binary files /dev/null and b/lib-src/taglib/tests/data/click.wv differ
diff --git a/lib-src/taglib/tests/data/empty.ogg b/lib-src/taglib/tests/data/empty.ogg
new file mode 100644
index 0000000..aa53310
Binary files /dev/null and b/lib-src/taglib/tests/data/empty.ogg differ
diff --git a/lib-src/taglib/tests/data/empty.spx b/lib-src/taglib/tests/data/empty.spx
new file mode 100644
index 0000000..70572b4
Binary files /dev/null and b/lib-src/taglib/tests/data/empty.spx differ
diff --git a/lib-src/taglib/tests/data/empty.tta b/lib-src/taglib/tests/data/empty.tta
new file mode 100644
index 0000000..9cc00ba
Binary files /dev/null and b/lib-src/taglib/tests/data/empty.tta differ
diff --git a/lib-src/taglib/tests/data/has-tags.m4a b/lib-src/taglib/tests/data/has-tags.m4a
new file mode 100644
index 0000000..f48a28b
Binary files /dev/null and b/lib-src/taglib/tests/data/has-tags.m4a differ
diff --git a/lib-src/taglib/tests/data/mpeg2.mp3 b/lib-src/taglib/tests/data/mpeg2.mp3
new file mode 100644
index 0000000..13e8d53
Binary files /dev/null and b/lib-src/taglib/tests/data/mpeg2.mp3 differ
diff --git a/lib-src/taglib/tests/data/no-tags.3g2 b/lib-src/taglib/tests/data/no-tags.3g2
new file mode 100644
index 0000000..d31a6ce
Binary files /dev/null and b/lib-src/taglib/tests/data/no-tags.3g2 differ
diff --git a/lib-src/taglib/tests/data/no-tags.flac b/lib-src/taglib/tests/data/no-tags.flac
new file mode 100644
index 0000000..4171441
Binary files /dev/null and b/lib-src/taglib/tests/data/no-tags.flac differ
diff --git a/lib-src/taglib/tests/data/no-tags.m4a b/lib-src/taglib/tests/data/no-tags.m4a
new file mode 100644
index 0000000..ba4e92b
Binary files /dev/null and b/lib-src/taglib/tests/data/no-tags.m4a differ
diff --git a/lib-src/taglib/tests/data/silence-1.wma b/lib-src/taglib/tests/data/silence-1.wma
new file mode 100644
index 0000000..e06f917
Binary files /dev/null and b/lib-src/taglib/tests/data/silence-1.wma differ
diff --git a/lib-src/taglib/tests/data/unsynch.id3 b/lib-src/taglib/tests/data/unsynch.id3
new file mode 100644
index 0000000..cfe6ee1
Binary files /dev/null and b/lib-src/taglib/tests/data/unsynch.id3 differ
diff --git a/lib-src/taglib/tests/data/xing.mp3 b/lib-src/taglib/tests/data/xing.mp3
new file mode 100644
index 0000000..0c88015
Binary files /dev/null and b/lib-src/taglib/tests/data/xing.mp3 differ
diff --git a/lib-src/taglib/tests/main.cpp b/lib-src/taglib/tests/main.cpp
new file mode 100644
index 0000000..348751e
--- /dev/null
+++ b/lib-src/taglib/tests/main.cpp
@@ -0,0 +1,46 @@
+#include <stdexcept>
+#include <cppunit/TestResult.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/TestRunner.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/BriefTestProgressListener.h>
+#include <cppunit/CompilerOutputter.h>
+
+int main(int argc, char* argv[])
+{
+  std::string testPath = (argc > 1) ? std::string(argv[1]) : "";
+
+  // Create the event manager and test controller
+  CppUnit::TestResult controller;
+
+  // Add a listener that colllects test result
+  CppUnit::TestResultCollector result;
+  controller.addListener(&result);
+
+  // Add a listener that print dots as test run.
+  CppUnit::BriefTestProgressListener progress;
+  controller.addListener(&progress);
+
+  // Add the top suite to the test runner
+  CppUnit::TestRunner runner;
+  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
+
+  try {
+    std::cout << "Running "  << testPath;
+    runner.run(controller, testPath);
+
+    std::cerr << std::endl;
+
+    // Print test in a compiler compatible format.
+    CppUnit::CompilerOutputter outputter(&result, std::cerr);
+    outputter.write();
+  }
+  catch(std::invalid_argument &e){
+    std::cerr << std::endl
+              << "ERROR: " << e.what()
+              << std::endl;
+    return 0;
+  }
+
+  return result.wasSuccessful() ? 0 : 1;
+}
diff --git a/lib-src/taglib/tests/test_asf.cpp b/lib-src/taglib/tests/test_asf.cpp
new file mode 100644
index 0000000..2b1e7aa
--- /dev/null
+++ b/lib-src/taglib/tests/test_asf.cpp
@@ -0,0 +1,103 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <tag.h>
+#include <tstringlist.h>
+#include <tbytevectorlist.h>
+#include <asffile.h>
+#include "utils.h"
+
+using namespace std;
+using namespace TagLib;
+
+class TestASF : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestASF);
+  CPPUNIT_TEST(testProperties);
+  CPPUNIT_TEST(testRead);
+  CPPUNIT_TEST(testSaveMultipleValues);
+  CPPUNIT_TEST(testSaveStream);
+  CPPUNIT_TEST(testSaveLanguage);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testProperties()
+  {
+    ASF::File f("data/silence-1.wma");
+    CPPUNIT_ASSERT_EQUAL(4, f.audioProperties()->length());
+    CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitrate());
+    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
+    CPPUNIT_ASSERT_EQUAL(48000, f.audioProperties()->sampleRate());
+  }
+
+  void testRead()
+  {
+    ASF::File f("data/silence-1.wma");
+    CPPUNIT_ASSERT_EQUAL(String("test"), f.tag()->title());
+  }
+
+  void testSaveMultipleValues()
+  {
+    string newname = copyFile("silence-1", ".wma");
+
+    ASF::File *f = new ASF::File(newname.c_str());
+    ASF::AttributeList values;
+    values.append("Foo");
+    values.append("Bar");
+    f->tag()->attributeListMap()["WM/AlbumTitle"] = values;
+    f->save();
+    delete f;
+
+    f = new ASF::File(newname.c_str());
+    CPPUNIT_ASSERT_EQUAL(2, (int)f->tag()->attributeListMap()["WM/AlbumTitle"].size());
+    delete f;
+
+    deleteFile(newname);
+  }
+
+  void testSaveStream()
+  {
+    string newname = copyFile("silence-1", ".wma");
+
+    ASF::File *f = new ASF::File(newname.c_str());
+    ASF::AttributeList values;
+    ASF::Attribute attr("Foo");
+    attr.setStream(43);
+    values.append(attr);
+    f->tag()->attributeListMap()["WM/AlbumTitle"] = values;
+    f->save();
+    delete f;
+
+    f = new ASF::File(newname.c_str());
+    CPPUNIT_ASSERT_EQUAL(43, f->tag()->attributeListMap()["WM/AlbumTitle"][0].stream());
+    delete f;
+
+    deleteFile(newname);
+  }
+
+  void testSaveLanguage()
+  {
+    string newname = copyFile("silence-1", ".wma");
+
+    ASF::File *f = new ASF::File(newname.c_str());
+    ASF::AttributeList values;
+    ASF::Attribute attr("Foo");
+    attr.setStream(32);
+    attr.setLanguage(56);
+    values.append(attr);
+    f->tag()->attributeListMap()["WM/AlbumTitle"] = values;
+    f->save();
+    delete f;
+
+    f = new ASF::File(newname.c_str());
+    CPPUNIT_ASSERT_EQUAL(32, f->tag()->attributeListMap()["WM/AlbumTitle"][0].stream());
+    CPPUNIT_ASSERT_EQUAL(56, f->tag()->attributeListMap()["WM/AlbumTitle"][0].language());
+    delete f;
+
+    deleteFile(newname);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestASF);
diff --git a/lib-src/taglib/tests/test_bytevector.cpp b/lib-src/taglib/tests/test_bytevector.cpp
new file mode 100644
index 0000000..f92fce0
--- /dev/null
+++ b/lib-src/taglib/tests/test_bytevector.cpp
@@ -0,0 +1,178 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <tbytevector.h>
+#include <tbytevectorlist.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestByteVector : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestByteVector);
+  CPPUNIT_TEST(testByteVector);
+  CPPUNIT_TEST(testFind1);
+  CPPUNIT_TEST(testFind2);
+  CPPUNIT_TEST(testRfind1);
+  CPPUNIT_TEST(testRfind2);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testConversion(unsigned int i, unsigned char a, unsigned char b, unsigned char c, unsigned char d)
+  {
+    ByteVector v(4, 0);
+
+    v[3] = a;
+    v[2] = b;
+    v[1] = c;
+    v[0] = d;
+    CPPUNIT_ASSERT(v.toUInt(false) == i);
+
+    v[0] = a;
+    v[1] = b;
+    v[2] = c;
+    v[3] = d;
+    CPPUNIT_ASSERT(v.toUInt() == i);
+  }
+
+  void testByteVector()
+  {
+    ByteVector v("foobar");
+
+    CPPUNIT_ASSERT(v.find("ob") == 2);
+    CPPUNIT_ASSERT(v.find('b') == 3);
+
+    ByteVector n(4, 0);
+    n[0] = 1;
+    CPPUNIT_ASSERT(n.toUInt(true) == 16777216);
+    CPPUNIT_ASSERT(n.toUInt(false) == 1);
+    CPPUNIT_ASSERT(ByteVector::fromUInt(16777216, true) == n);
+    CPPUNIT_ASSERT(ByteVector::fromUInt(1, false) == n);
+
+    CPPUNIT_ASSERT(ByteVector::fromUInt(0xa0).toUInt() == 0xa0);
+
+    testConversion(0x000000a0, 0x00, 0x00, 0x00, 0xa0);
+    testConversion(0xd50bf072, 0xd5, 0x0b, 0xf0, 0x72);
+
+    ByteVector intVector(2, 0);
+    intVector[0] = char(0xfc);
+    intVector[1] = char(0x00);
+    CPPUNIT_ASSERT(intVector.toShort() == -1024);
+    intVector[0] = char(0x04);
+    intVector[1] = char(0x00);
+    CPPUNIT_ASSERT(intVector.toShort() == 1024);
+
+    CPPUNIT_ASSERT(ByteVector::fromLongLong(1).toLongLong() == 1);
+    CPPUNIT_ASSERT(ByteVector::fromLongLong(0).toLongLong() == 0);
+    CPPUNIT_ASSERT(ByteVector::fromLongLong(0xffffffffffffffffLL).toLongLong() == -1);
+    CPPUNIT_ASSERT(ByteVector::fromLongLong(0xfffffffffffffffeLL).toLongLong() == -2);
+    CPPUNIT_ASSERT(ByteVector::fromLongLong(1024).toLongLong() == 1024);
+
+    ByteVector a1("foo");
+    a1.append("bar");
+    CPPUNIT_ASSERT(a1 == "foobar");
+
+    ByteVector a2("foo");
+    a2.append("b");
+    CPPUNIT_ASSERT(a2 == "foob");
+
+    ByteVector a3;
+    a3.append("b");
+    CPPUNIT_ASSERT(a3 == "b");
+
+    ByteVector s1("foo");
+    CPPUNIT_ASSERT(ByteVectorList::split(s1, " ").size() == 1);
+
+    ByteVector s2("f");
+    CPPUNIT_ASSERT(ByteVectorList::split(s2, " ").size() == 1);
+
+
+    CPPUNIT_ASSERT(ByteVector().size() == 0);
+    CPPUNIT_ASSERT(ByteVector("asdf").clear().size() == 0);
+    CPPUNIT_ASSERT(ByteVector("asdf").clear() == ByteVector());
+  }
+
+  void testFind1()
+  {
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO"));
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO", 0));
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO", 1));
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO", 2));
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO", 3));
+    CPPUNIT_ASSERT_EQUAL(4, ByteVector("....SggO."). find("SggO", 4));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("....SggO."). find("SggO", 5));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("....SggO."). find("SggO", 6));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("....SggO."). find("SggO", 7));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("....SggO."). find("SggO", 8));
+  }
+
+  void testFind2()
+  {
+    CPPUNIT_ASSERT_EQUAL(0, ByteVector("\x01", 1).find("\x01"));
+    CPPUNIT_ASSERT_EQUAL(0, ByteVector("\x01\x02", 2).find("\x01\x02"));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("\x01", 1).find("\x02"));
+    CPPUNIT_ASSERT_EQUAL(-1, ByteVector("\x01\x02", 2).find("\x01\x03"));
+  }
+
+  void testRfind1()
+  {
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 0));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 1));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 2));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 3));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 4));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 5));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 6));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 7));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS", 8));
+    CPPUNIT_ASSERT_EQUAL(1, ByteVector(".OggS....").rfind("OggS"));
+  }
+
+  void testRfind2()
+  {
+    ByteVector r0("**************");
+    ByteVector r1("OggS**********");
+    ByteVector r2("**********OggS");
+    ByteVector r3("OggS******OggS");
+    ByteVector r4("OggS*OggS*OggS");
+
+    CPPUNIT_ASSERT_EQUAL(-1, r0.find("OggS"));
+    CPPUNIT_ASSERT_EQUAL(-1, r0.rfind("OggS"));
+    CPPUNIT_ASSERT_EQUAL(0, r1.find("OggS"));
+    CPPUNIT_ASSERT_EQUAL(0, r1.rfind("OggS"));
+    CPPUNIT_ASSERT_EQUAL(10, r2.find("OggS"));
+    CPPUNIT_ASSERT_EQUAL(10, r2.rfind("OggS"));
+    CPPUNIT_ASSERT_EQUAL(0, r3.find("OggS"));
+    CPPUNIT_ASSERT_EQUAL(10, r3.rfind("OggS"));
+    CPPUNIT_ASSERT_EQUAL(10, r4.rfind("OggS"));
+    CPPUNIT_ASSERT_EQUAL(10, r4.rfind("OggS", 0));
+    CPPUNIT_ASSERT_EQUAL(5, r4.rfind("OggS", 7));
+    CPPUNIT_ASSERT_EQUAL(10, r4.rfind("OggS", 12));
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestByteVector);
diff --git a/lib-src/taglib/tests/test_fileref.cpp b/lib-src/taglib/tests/test_fileref.cpp
new file mode 100644
index 0000000..c2cba17
--- /dev/null
+++ b/lib-src/taglib/tests/test_fileref.cpp
@@ -0,0 +1,125 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <tag.h>
+#include <fileref.h>
+#include "utils.h"
+
+using namespace std;
+using namespace TagLib;
+
+class TestFileRef : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestFileRef);
+  CPPUNIT_TEST(testASF);
+  CPPUNIT_TEST(testMusepack);
+  CPPUNIT_TEST(testVorbis);
+  CPPUNIT_TEST(testSpeex);
+  CPPUNIT_TEST(testFLAC);
+  CPPUNIT_TEST(testMP3);
+  CPPUNIT_TEST(testMP4_1);
+  CPPUNIT_TEST(testMP4_2);
+  CPPUNIT_TEST(testMP4_3);
+  CPPUNIT_TEST(testTrueAudio);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void fileRefSave(const string &filename, const string &ext)
+  {
+    string newname = copyFile(filename, ext);
+
+    FileRef *f = new FileRef(newname.c_str());
+    CPPUNIT_ASSERT(!f->isNull());
+    f->tag()->setArtist("test artist");
+    f->tag()->setTitle("test title");
+    f->tag()->setGenre("Test!");
+    f->tag()->setAlbum("albummmm");
+    f->tag()->setTrack(5);
+    f->tag()->setYear(2020);
+    f->save();
+    delete f;
+
+    f = new FileRef(newname.c_str());
+    CPPUNIT_ASSERT(!f->isNull());
+    CPPUNIT_ASSERT_EQUAL(f->tag()->artist(), String("test artist"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->title(), String("test title"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->genre(), String("Test!"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->album(), String("albummmm"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->track(), TagLib::uint(5));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->year(), TagLib::uint(2020));
+    f->tag()->setArtist("ttest artist");
+    f->tag()->setTitle("ytest title");
+    f->tag()->setGenre("uTest!");
+    f->tag()->setAlbum("ialbummmm");
+    f->tag()->setTrack(7);
+    f->tag()->setYear(2080);
+    f->save();
+    delete f;
+
+    f = new FileRef(newname.c_str());
+    CPPUNIT_ASSERT(!f->isNull());
+    CPPUNIT_ASSERT_EQUAL(f->tag()->artist(), String("ttest artist"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->title(), String("ytest title"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->genre(), String("uTest!"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->album(), String("ialbummmm"));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->track(), TagLib::uint(7));
+    CPPUNIT_ASSERT_EQUAL(f->tag()->year(), TagLib::uint(2080));
+    delete f;
+
+    deleteFile(newname);
+  }
+
+  void testMusepack()
+  {
+    fileRefSave("click", ".mpc");
+  }
+
+  void testASF()
+  {
+    fileRefSave("silence-1", ".wma");
+  }
+
+  void testVorbis()
+  {
+    fileRefSave("empty", ".ogg");
+  }
+
+  void testSpeex()
+  {
+    fileRefSave("empty", ".spx");
+  }
+
+  void testFLAC()
+  {
+    fileRefSave("no-tags", ".flac");
+  }
+
+  void testMP3()
+  {
+    fileRefSave("xing", ".mp3");
+  }
+
+  void testTrueAudio()
+  {
+    fileRefSave("empty", ".tta");
+  }
+
+  void testMP4_1()
+  {
+    fileRefSave("has-tags", ".m4a");
+  }
+
+  void testMP4_2()
+  {
+    fileRefSave("no-tags", ".m4a");
+  }
+
+  void testMP4_3()
+  {
+    fileRefSave("no-tags", ".3g2");
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestFileRef);
diff --git a/lib-src/taglib/tests/test_id3v1.cpp b/lib-src/taglib/tests/test_id3v1.cpp
new file mode 100644
index 0000000..308225c
--- /dev/null
+++ b/lib-src/taglib/tests/test_id3v1.cpp
@@ -0,0 +1,25 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <id3v1tag.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestID3v1 : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestID3v1);
+  CPPUNIT_TEST(testStripWhiteSpace);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testStripWhiteSpace()
+  {
+    ID3v1::StringHandler h;
+    CPPUNIT_ASSERT_EQUAL(String("Foo"), h.parse(ByteVector("Foo                ")));
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v1);
diff --git a/lib-src/taglib/tests/test_id3v2.cpp b/lib-src/taglib/tests/test_id3v2.cpp
new file mode 100644
index 0000000..07b33f1
--- /dev/null
+++ b/lib-src/taglib/tests/test_id3v2.cpp
@@ -0,0 +1,341 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <id3v2tag.h>
+#include <mpegfile.h>
+#include <id3v2frame.h>
+#include <uniquefileidentifierframe.h>
+#include <textidentificationframe.h>
+#include <attachedpictureframe.h>
+#include <generalencapsulatedobjectframe.h>
+#include <relativevolumeframe.h>
+#include <popularimeterframe.h>
+#include <urllinkframe.h>
+#include "utils.h"
+
+using namespace std;
+using namespace TagLib;
+
+class PublicFrame : public ID3v2::Frame
+{
+  public:
+    PublicFrame() : ID3v2::Frame(ByteVector("XXXX\0\0\0\0\0\0", 10)) {}
+    String readStringField(const ByteVector &data, String::Type encoding,
+                           int *positon = 0)
+      { return ID3v2::Frame::readStringField(data, encoding, positon); }
+    virtual String toString() const { return String::null; }
+    virtual void parseFields(const ByteVector &) {}
+    virtual ByteVector renderFields() const { return ByteVector::null; }
+};
+
+class TestID3v2 : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestID3v2);
+  CPPUNIT_TEST(testUnsynchDecode);
+  CPPUNIT_TEST(testUTF16BEDelimiter);
+  CPPUNIT_TEST(testUTF16Delimiter);
+  CPPUNIT_TEST(testReadStringField);
+  CPPUNIT_TEST(testParseAPIC);
+  CPPUNIT_TEST(testParseAPIC_UTF16_BOM);
+  CPPUNIT_TEST(testParseGEOB);
+  CPPUNIT_TEST(testPOPMtoString);
+  CPPUNIT_TEST(testParsePOPM);
+  CPPUNIT_TEST(testParsePOPMWithoutCounter);
+  CPPUNIT_TEST(testRenderPOPM);
+  CPPUNIT_TEST(testPOPMFromFile);
+  CPPUNIT_TEST(testParseRelativeVolumeFrame);
+  CPPUNIT_TEST(testParseUniqueFileIdentifierFrame);
+  CPPUNIT_TEST(testParseEmptyUniqueFileIdentifierFrame);
+  CPPUNIT_TEST(testBrokenFrame1);
+  CPPUNIT_TEST(testItunes24FrameSize);
+  CPPUNIT_TEST(testParseUrlLinkFrame);
+  CPPUNIT_TEST(testRenderUrlLinkFrame);
+  CPPUNIT_TEST(testParseUserUrlLinkFrame);
+  CPPUNIT_TEST(testRenderUserUrlLinkFrame);
+  CPPUNIT_TEST(testSaveUTF16Comment);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testUnsynchDecode()
+  {
+    MPEG::File f("data/unsynch.id3", false);
+    CPPUNIT_ASSERT(f.tag());
+    CPPUNIT_ASSERT_EQUAL(String("My babe just cares for me"), f.tag()->title());
+  }
+
+  void testUTF16BEDelimiter()
+  {
+    ID3v2::TextIdentificationFrame f(ByteVector("TPE1"), String::UTF16BE);
+    StringList sl;
+    sl.append("Foo");
+    sl.append("Bar");
+    f.setText(sl);
+    CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+6+2+6), f.render().size());
+  }
+
+  void testUTF16Delimiter()
+  {
+    ID3v2::TextIdentificationFrame f(ByteVector("TPE1"), String::UTF16);
+    StringList sl;
+    sl.append("Foo");
+    sl.append("Bar");
+    f.setText(sl);
+    CPPUNIT_ASSERT_EQUAL((unsigned int)(4+4+2+1+8+2+8), f.render().size());
+  }
+
+  void testBrokenFrame1()
+  {
+    MPEG::File f("data/broken-tenc.id3", false);
+    CPPUNIT_ASSERT(f.tag());
+    CPPUNIT_ASSERT(!f.ID3v2Tag()->frameListMap().contains("TENC"));
+  }
+
+  void testReadStringField()
+  {
+    PublicFrame f;
+    ByteVector data("abc\0", 4);
+    String str = f.readStringField(data, String::Latin1);
+    CPPUNIT_ASSERT_EQUAL(String("abc"), str);
+  }
+
+  // http://bugs.kde.org/show_bug.cgi?id=151078
+  void testParseAPIC()
+  {
+    ID3v2::AttachedPictureFrame f(ByteVector("APIC"
+                                             "\x00\x00\x00\x07"
+                                             "\x00\x00"
+                                             "\x00"
+                                             "m\x00"
+                                             "\x01"
+                                             "d\x00"
+                                             "\x00", 17));
+    CPPUNIT_ASSERT_EQUAL(String("m"), f.mimeType());
+    CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::FileIcon, f.type());
+    CPPUNIT_ASSERT_EQUAL(String("d"), f.description());
+  }
+
+  void testParseAPIC_UTF16_BOM()
+  {
+    ID3v2::AttachedPictureFrame f(ByteVector(
+      "\x41\x50\x49\x43\x00\x02\x0c\x59\x00\x00\x01\x69\x6d\x61\x67\x65"
+      "\x2f\x6a\x70\x65\x67\x00\x00\xfe\xff\x00\x63\x00\x6f\x00\x76\x00"
+      "\x65\x00\x72\x00\x2e\x00\x6a\x00\x70\x00\x67\x00\x00\xff\xd8\xff",
+      16 * 3));
+    CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), f.mimeType());
+    CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, f.type());
+    CPPUNIT_ASSERT_EQUAL(String("cover.jpg"), f.description());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\xd8\xff", 3), f.picture());
+  }
+
+  // http://bugs.kde.org/show_bug.cgi?id=151078
+  void testParseGEOB()
+  {
+    ID3v2::GeneralEncapsulatedObjectFrame f(ByteVector("GEOB"
+                                             "\x00\x00\x00\x08"
+                                             "\x00\x00"
+                                             "\x00"
+                                             "m\x00"
+                                             "f\x00"
+                                             "d\x00"
+                                             "\x00", 18));
+    CPPUNIT_ASSERT_EQUAL(String("m"), f.mimeType());
+    CPPUNIT_ASSERT_EQUAL(String("f"), f.fileName());
+    CPPUNIT_ASSERT_EQUAL(String("d"), f.description());
+  }
+
+  void testParsePOPM()
+  {
+    ID3v2::PopularimeterFrame f(ByteVector("POPM"
+                                           "\x00\x00\x00\x17"
+                                           "\x00\x00"
+                                           "email at example.com\x00"
+                                           "\x02"
+                                           "\x00\x00\x00\x03", 33));
+    CPPUNIT_ASSERT_EQUAL(String("email at example.com"), f.email());
+    CPPUNIT_ASSERT_EQUAL(2, f.rating());
+    CPPUNIT_ASSERT_EQUAL(TagLib::uint(3), f.counter());
+  }
+
+  void testParsePOPMWithoutCounter()
+  {
+    ID3v2::PopularimeterFrame f(ByteVector("POPM"
+                                           "\x00\x00\x00\x13"
+                                           "\x00\x00"
+                                           "email at example.com\x00"
+                                           "\x02", 29));
+    CPPUNIT_ASSERT_EQUAL(String("email at example.com"), f.email());
+    CPPUNIT_ASSERT_EQUAL(2, f.rating());
+    CPPUNIT_ASSERT_EQUAL(TagLib::uint(0), f.counter());
+  }
+
+  void testRenderPOPM()
+  {
+    ID3v2::PopularimeterFrame f;
+    f.setEmail("email at example.com");
+    f.setRating(2);
+    f.setCounter(3);
+    CPPUNIT_ASSERT_EQUAL(
+      ByteVector("POPM"
+                 "\x00\x00\x00\x17"
+                 "\x00\x00"
+                 "email at example.com\x00"
+                 "\x02"
+                 "\x00\x00\x00\x03", 33),
+      f.render());
+  }
+
+  void testPOPMtoString()
+  {
+    ID3v2::PopularimeterFrame f;
+    f.setEmail("email at example.com");
+    f.setRating(2);
+    f.setCounter(3);
+    CPPUNIT_ASSERT_EQUAL(
+      String("email at example.com rating=2 counter=3"), f.toString());
+  }
+
+  void testPOPMFromFile()
+  {
+    string newname = copyFile("xing", ".mp3");
+
+    ID3v2::PopularimeterFrame *f = new ID3v2::PopularimeterFrame();
+    f->setEmail("email at example.com");
+    f->setRating(200);
+    f->setCounter(3);
+
+    MPEG::File foo(newname.c_str());
+    foo.ID3v2Tag()->addFrame(f);
+    foo.save();
+
+    MPEG::File bar(newname.c_str());
+    CPPUNIT_ASSERT_EQUAL(String("email at example.com"), dynamic_cast<ID3v2::PopularimeterFrame *>(bar.ID3v2Tag()->frameList("POPM").front())->email());
+    CPPUNIT_ASSERT_EQUAL(200, dynamic_cast<ID3v2::PopularimeterFrame *>(bar.ID3v2Tag()->frameList("POPM").front())->rating());
+    deleteFile(newname);
+  }
+
+  // http://bugs.kde.org/show_bug.cgi?id=150481
+  void testParseRelativeVolumeFrame()
+  {
+    ID3v2::RelativeVolumeFrame f(
+      ByteVector("RVA2"              // Frame ID
+                 "\x00\x00\x00\x0B"  // Frame size
+                 "\x00\x00"          // Frame flags
+                 "ident\x00"         // Identification
+                 "\x02"              // Type of channel
+                 "\x00\x0F"          // Volume adjustment
+                 "\x08"              // Bits representing peak
+                 "\x45", 21));       // Peak volume
+    CPPUNIT_ASSERT_EQUAL(String("ident"), f.identification());
+    CPPUNIT_ASSERT_EQUAL(15.0f / 512.0f,
+                         f.volumeAdjustment(ID3v2::RelativeVolumeFrame::FrontRight));
+    CPPUNIT_ASSERT_EQUAL((uchar)8,
+                         f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).bitsRepresentingPeak);
+    CPPUNIT_ASSERT_EQUAL(ByteVector("\x45"),
+                         f.peakVolume(ID3v2::RelativeVolumeFrame::FrontRight).peakVolume);
+  }
+
+  void testParseUniqueFileIdentifierFrame()
+  {
+    ID3v2::UniqueFileIdentifierFrame f(
+      ByteVector("UFID"                 // Frame ID
+                 "\x00\x00\x00\x09"     // Frame size
+                 "\x00\x00"             // Frame flags
+                 "owner\x00"            // Owner identifier
+                 "\x00\x01\x02", 19));  // Identifier
+    CPPUNIT_ASSERT_EQUAL(String("owner"),
+                         f.owner());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("\x00\x01\x02", 3),
+                         f.identifier());
+  }
+
+  void testParseEmptyUniqueFileIdentifierFrame()
+  {
+    ID3v2::UniqueFileIdentifierFrame f(
+      ByteVector("UFID"                 // Frame ID
+                 "\x00\x00\x00\x01"     // Frame size
+                 "\x00\x00"             // Frame flags
+                 "\x00"                 // Owner identifier
+                 "", 11));              // Identifier
+    CPPUNIT_ASSERT_EQUAL(String(),
+                         f.owner());
+    CPPUNIT_ASSERT_EQUAL(ByteVector(),
+                         f.identifier());
+  }
+
+  void testParseUrlLinkFrame()
+  {
+    ID3v2::UrlLinkFrame f(
+      ByteVector("WOAF"                      // Frame ID
+                 "\x00\x00\x00\x12"          // Frame size
+                 "\x00\x00"                  // Frame flags
+                 "http://example.com", 28)); // URL
+    CPPUNIT_ASSERT_EQUAL(String("http://example.com"), f.url());
+  }
+
+  void testRenderUrlLinkFrame()
+  {
+    ID3v2::UrlLinkFrame f("WOAF");
+    f.setUrl("http://example.com");
+    CPPUNIT_ASSERT_EQUAL(
+      ByteVector("WOAF"                      // Frame ID
+                 "\x00\x00\x00\x12"          // Frame size
+                 "\x00\x00"                  // Frame flags
+                 "http://example.com", 28),  // URL
+      f.render());
+  }
+
+  void testParseUserUrlLinkFrame()
+  {
+    ID3v2::UserUrlLinkFrame f(
+      ByteVector("WXXX"                      // Frame ID
+                 "\x00\x00\x00\x17"          // Frame size
+                 "\x00\x00"                  // Frame flags
+                 "\x00"                      // Text encoding
+                 "foo\x00"                   // Description
+                 "http://example.com", 33)); // URL
+    CPPUNIT_ASSERT_EQUAL(String("foo"), f.description());
+    CPPUNIT_ASSERT_EQUAL(String("http://example.com"), f.url());
+  }
+
+  void testRenderUserUrlLinkFrame()
+  {
+    ID3v2::UserUrlLinkFrame f;
+    f.setDescription("foo");
+    f.setUrl("http://example.com");
+    CPPUNIT_ASSERT_EQUAL(
+      ByteVector("WXXX"                      // Frame ID
+                 "\x00\x00\x00\x17"          // Frame size
+                 "\x00\x00"                  // Frame flags
+                 "\x00"                      // Text encoding
+                 "foo\x00"                   // Description
+                 "http://example.com", 33),  // URL
+      f.render());
+  }
+
+  void testItunes24FrameSize()
+  {
+    MPEG::File f("data/005411.id3", false);
+    CPPUNIT_ASSERT(f.tag());
+    CPPUNIT_ASSERT(f.ID3v2Tag()->frameListMap().contains("TIT2"));
+    CPPUNIT_ASSERT_EQUAL(String("Sunshine Superman"), f.ID3v2Tag()->frameListMap()["TIT2"].front()->toString());
+  }
+
+  void testSaveUTF16Comment()
+  {
+    String::Type defaultEncoding = ID3v2::FrameFactory::instance()->defaultTextEncoding();
+    string newname = copyFile("xing", ".mp3");
+    ID3v2::FrameFactory::instance()->setDefaultTextEncoding(String::UTF16);
+    MPEG::File foo(newname.c_str());
+    foo.strip();
+    foo.tag()->setComment("Test comment!");
+    foo.save();
+    MPEG::File bar(newname.c_str());
+    CPPUNIT_ASSERT_EQUAL(String("Test comment!"), bar.tag()->comment());
+    deleteFile(newname);
+    ID3v2::FrameFactory::instance()->setDefaultTextEncoding(defaultEncoding);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2);
diff --git a/lib-src/taglib/tests/test_list.cpp b/lib-src/taglib/tests/test_list.cpp
new file mode 100644
index 0000000..39cbaf0
--- /dev/null
+++ b/lib-src/taglib/tests/test_list.cpp
@@ -0,0 +1,58 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <tlist.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestList : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestList);
+  CPPUNIT_TEST(testList);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testList()
+  {
+    List<int> l1;
+    List<int> l2;
+    List<int> l3;
+    l1.append(2);
+    l2.append(3);
+    l2.append(4);
+    l1.append(l2);
+    l1.prepend(1);
+    l3.append(1);
+    l3.append(2);
+    l3.append(3);
+    l3.append(4);
+    CPPUNIT_ASSERT(l1 == l3);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestList);
diff --git a/lib-src/taglib/tests/test_map.cpp b/lib-src/taglib/tests/test_map.cpp
new file mode 100644
index 0000000..b6f77aa
--- /dev/null
+++ b/lib-src/taglib/tests/test_map.cpp
@@ -0,0 +1,27 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <tstring.h>
+#include <tmap.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestMap : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestMap);
+  CPPUNIT_TEST(testInsert);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testInsert()
+  {
+    Map<String, int> m;
+    m.insert("foo", 3);
+    CPPUNIT_ASSERT_EQUAL(3, m["foo"]);
+    m.insert("foo", 7);
+    CPPUNIT_ASSERT_EQUAL(7, m["foo"]);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestMap);
diff --git a/lib-src/taglib/tests/test_mp4.cpp b/lib-src/taglib/tests/test_mp4.cpp
new file mode 100644
index 0000000..2bca203
--- /dev/null
+++ b/lib-src/taglib/tests/test_mp4.cpp
@@ -0,0 +1,103 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <tag.h>
+#include <mp4tag.h>
+#include <tbytevectorlist.h>
+#include <mp4atom.h>
+#include <mp4file.h>
+#include "utils.h"
+
+using namespace std;
+using namespace TagLib;
+
+class TestMP4 : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestMP4);
+  CPPUNIT_TEST(testProperties);
+  CPPUNIT_TEST(testFreeForm);
+  CPPUNIT_TEST(testUpdateStco);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testProperties()
+  {
+    MP4::File f("data/has-tags.m4a");
+    CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
+    CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->bitrate());
+    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
+    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
+    CPPUNIT_ASSERT_EQUAL(16, ((MP4::Properties *)f.audioProperties())->bitsPerSample());
+  }
+
+  void testUpdateStco()
+  {
+    string filename = copyFile("no-tags", ".3g2");
+
+    MP4::File *f = new MP4::File(filename.c_str());
+    f->tag()->setArtist(ByteVector(3000, 'x'));
+
+    ByteVectorList data1;
+    {
+      MP4::Atoms a(f);
+      MP4::Atom *stco = a.find("moov")->findall("stco", true)[0];
+      f->seek(stco->offset + 12);
+      ByteVector data = f->readBlock(stco->length - 12);
+      unsigned int count = data.mid(0, 4).toUInt();
+      int pos = 4;
+      while (count--) {
+        unsigned int offset = data.mid(pos, 4).toUInt();
+        f->seek(offset);
+        data1.append(f->readBlock(20));
+        pos += 4;
+      }
+    }
+
+    f->save();
+    delete f;
+    f = new MP4::File(filename.c_str());
+
+    {
+      MP4::Atoms a(f);
+      MP4::Atom *stco = a.find("moov")->findall("stco", true)[0];
+      f->seek(stco->offset + 12);
+      ByteVector data = f->readBlock(stco->length - 12);
+      unsigned int count = data.mid(0, 4).toUInt();
+      int pos = 4, i = 0;
+      while (count--) {
+        unsigned int offset = data.mid(pos, 4).toUInt();
+        f->seek(offset);
+        CPPUNIT_ASSERT_EQUAL(data1[i], f->readBlock(20));
+        pos += 4;
+        i++;
+      }
+    }
+
+    delete f;
+
+    deleteFile(filename);
+  }
+
+  void testFreeForm()
+  {
+    string filename = copyFile("has-tags", ".m4a");
+
+    MP4::File *f = new MP4::File(filename.c_str());
+    CPPUNIT_ASSERT(f->tag()->itemListMap().contains("----:com.apple.iTunes:iTunNORM"));
+    f->tag()->itemListMap()["----:org.kde.TagLib:Foo"] = StringList("Bar");
+    f->save();
+    delete f;
+
+    f = new MP4::File(filename.c_str());
+    CPPUNIT_ASSERT(f->tag()->itemListMap().contains("----:org.kde.TagLib:Foo"));
+    CPPUNIT_ASSERT_EQUAL(String("Bar"), f->tag()->itemListMap()["----:org.kde.TagLib:Foo"].toStringList()[0]);
+    f->save();
+    delete f;
+
+    deleteFile(filename);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestMP4);
diff --git a/lib-src/taglib/tests/test_mpeg.cpp b/lib-src/taglib/tests/test_mpeg.cpp
new file mode 100644
index 0000000..6278ff5
--- /dev/null
+++ b/lib-src/taglib/tests/test_mpeg.cpp
@@ -0,0 +1,25 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <mpegfile.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestMPEG : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestMPEG);
+  CPPUNIT_TEST(testVersion2DurationWithXingHeader);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testVersion2DurationWithXingHeader()
+  {
+    MPEG::File f("data/mpeg2.mp3");
+    CPPUNIT_ASSERT_EQUAL(5387, f.audioProperties()->length());
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestMPEG);
diff --git a/lib-src/taglib/tests/test_string.cpp b/lib-src/taglib/tests/test_string.cpp
new file mode 100644
index 0000000..b1b2c83
--- /dev/null
+++ b/lib-src/taglib/tests/test_string.cpp
@@ -0,0 +1,136 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <tstring.h>
+#include <string.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestString : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestString);
+  CPPUNIT_TEST(testString);
+  CPPUNIT_TEST(testUTF16Encode);
+  CPPUNIT_TEST(testUTF16Decode);
+  CPPUNIT_TEST(testUTF16DecodeInvalidBOM);
+  CPPUNIT_TEST(testUTF16DecodeEmptyWithBOM);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testString()
+  {
+    String s = "taglib string";
+    ByteVector v = "taglib string";
+    CPPUNIT_ASSERT(v == s.data(String::Latin1));
+
+    char str[] = "taglib string";
+    CPPUNIT_ASSERT(strcmp(s.toCString(), str) == 0);
+
+    String unicode("José Carlos", String::UTF8);
+    CPPUNIT_ASSERT(strcmp(unicode.toCString(), "Jos\xe9 Carlos") == 0);
+
+    String latin = "Jos\xe9 Carlos";
+    CPPUNIT_ASSERT(strcmp(latin.toCString(true), "José Carlos") == 0);
+
+    String unicode2(unicode.to8Bit(true), String::UTF8);
+    CPPUNIT_ASSERT(unicode == unicode2);
+
+    CPPUNIT_ASSERT(strcmp(String::number(0).toCString(), "0") == 0);
+    CPPUNIT_ASSERT(strcmp(String::number(12345678).toCString(), "12345678") == 0);
+    CPPUNIT_ASSERT(strcmp(String::number(-12345678).toCString(), "-12345678") == 0);
+
+    String n = "123";
+    CPPUNIT_ASSERT(n.toInt() == 123);
+
+    n = "-123";
+    CPPUNIT_ASSERT(n.toInt() == -123);
+
+    CPPUNIT_ASSERT(String("0").toInt() == 0);
+    CPPUNIT_ASSERT(String("1").toInt() == 1);
+
+    CPPUNIT_ASSERT(String("  foo  ").stripWhiteSpace() == String("foo"));
+    CPPUNIT_ASSERT(String("foo    ").stripWhiteSpace() == String("foo"));
+    CPPUNIT_ASSERT(String("    foo").stripWhiteSpace() == String("foo"));
+
+    CPPUNIT_ASSERT(memcmp(String("foo").data(String::Latin1).data(), "foo", 3) == 0);
+    CPPUNIT_ASSERT(memcmp(String("f").data(String::Latin1).data(), "f", 1) == 0);
+
+    ByteVector utf16 = unicode.data(String::UTF16);
+
+  // Check to make sure that the BOM is there and that the data size is correct
+
+    CPPUNIT_ASSERT(utf16.size() == 2 + (unicode.size() * 2));
+
+    CPPUNIT_ASSERT(unicode == String(utf16, String::UTF16));
+  }
+
+  void testUTF16Encode()
+  {
+    String a("foo");
+    ByteVector b("\0f\0o\0o", 6);
+    ByteVector c("f\0o\0o\0", 6);
+    ByteVector d("\377\376f\0o\0o\0", 8);
+    CPPUNIT_ASSERT(a.data(String::UTF16BE) != a.data(String::UTF16LE));
+    CPPUNIT_ASSERT(b == a.data(String::UTF16BE));
+    CPPUNIT_ASSERT(c == a.data(String::UTF16LE));
+    CPPUNIT_ASSERT_EQUAL(d, a.data(String::UTF16));
+  }
+
+  void testUTF16Decode()
+  {
+    String a("foo");
+    ByteVector b("\0f\0o\0o", 6);
+    ByteVector c("f\0o\0o\0", 6);
+    ByteVector d("\377\376f\0o\0o\0", 8);
+    CPPUNIT_ASSERT_EQUAL(a, String(b, String::UTF16BE));
+    CPPUNIT_ASSERT_EQUAL(a, String(c, String::UTF16LE));
+    CPPUNIT_ASSERT_EQUAL(a, String(d, String::UTF16));
+  }
+
+  // this test is expected to print "TagLib: String::prepare() -
+  // Invalid UTF16 string." on the console 3 times
+  void testUTF16DecodeInvalidBOM()
+  {
+    ByteVector b(" ", 1);
+    ByteVector c("  ", 2);
+    ByteVector d("  \0f\0o\0o", 8);
+    CPPUNIT_ASSERT_EQUAL(String(), String(b, String::UTF16));
+    CPPUNIT_ASSERT_EQUAL(String(), String(c, String::UTF16));
+    CPPUNIT_ASSERT_EQUAL(String(), String(d, String::UTF16));
+  }
+
+  void testUTF16DecodeEmptyWithBOM()
+  {
+    ByteVector a("\377\376", 2);
+    ByteVector b("\376\377", 2);
+    CPPUNIT_ASSERT_EQUAL(String(), String(a, String::UTF16));
+    CPPUNIT_ASSERT_EQUAL(String(), String(b, String::UTF16));
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
diff --git a/lib-src/taglib/tests/test_synchdata.cpp b/lib-src/taglib/tests/test_synchdata.cpp
new file mode 100644
index 0000000..04ef535
--- /dev/null
+++ b/lib-src/taglib/tests/test_synchdata.cpp
@@ -0,0 +1,88 @@
+/* Copyright (C) 2003 Scott Wheeler <wheeler at kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <id3v2synchdata.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestID3v2SynchData : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestID3v2SynchData);
+  CPPUNIT_TEST(test1);
+  CPPUNIT_TEST(test2);
+  CPPUNIT_TEST(test3);
+  CPPUNIT_TEST(testDecode1);
+  CPPUNIT_TEST(testDecode2);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void test1()
+  {
+    char data[] = { 0, 0, 0, 127 };
+    ByteVector v(data, 4);
+
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(127));
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(127), v);
+  }
+
+  void test2()
+  {
+    char data[] = { 0, 0, 1, 0 };
+    ByteVector v(data, 4);
+
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(128));
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(128), v);
+  }
+
+  void test3()
+  {
+    char data[] = { 0, 0, 1, 1 };
+    ByteVector v(data, 4);
+
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::toUInt(v), TagLib::uint(129));
+    CPPUNIT_ASSERT_EQUAL(ID3v2::SynchData::fromUInt(129), v);
+  }
+
+  void testDecode1()
+  {
+    ByteVector a("\xff\x00\x00", 3);
+    a = ID3v2::SynchData::decode(a);
+    CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\x00", 2), a);
+  }
+
+  void testDecode2()
+  {
+    ByteVector a("\xff\x44", 2);
+    a = ID3v2::SynchData::decode(a);
+    CPPUNIT_ASSERT_EQUAL((unsigned int)2, a.size());
+    CPPUNIT_ASSERT_EQUAL(ByteVector("\xff\x44", 2), a);
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2SynchData);
diff --git a/lib-src/taglib/tests/test_trueaudio.cpp b/lib-src/taglib/tests/test_trueaudio.cpp
new file mode 100644
index 0000000..b300eef
--- /dev/null
+++ b/lib-src/taglib/tests/test_trueaudio.cpp
@@ -0,0 +1,26 @@
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <trueaudiofile.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestTrueAudio : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE(TestTrueAudio);
+  CPPUNIT_TEST(testReadPropertiesWithoutID3v2);
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+
+  void testReadPropertiesWithoutID3v2()
+  {
+    TrueAudio::File f("data/empty.tta");
+    CPPUNIT_ASSERT(f.audioProperties());
+    CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
+  }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestTrueAudio);
diff --git a/lib-src/taglib/tests/utils.h b/lib-src/taglib/tests/utils.h
new file mode 100644
index 0000000..edcd3c3
--- /dev/null
+++ b/lib-src/taglib/tests/utils.h
@@ -0,0 +1,27 @@
+#include <string>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/fcntl.h>
+
+using namespace std;
+
+inline string copyFile(const string &filename, const string &ext)
+{
+  string newname = string(tempnam(NULL, NULL)) + ext;
+  string oldname = string("data/") + filename + ext;
+  char buffer[4096];
+  int bytes;
+  int inf = open(oldname.c_str(), O_RDONLY);
+  int outf = open(newname.c_str(), O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR);
+  while((bytes = read(inf, buffer, sizeof(buffer))) > 0)
+    write(outf, buffer, bytes);
+  close(outf);
+  close(inf);
+  return newname;
+}
+
+inline void deleteFile(const string &filename)
+{
+  remove(filename.c_str());
+}
diff --git a/m4/audacity_checklib_taglib.m4 b/m4/audacity_checklib_taglib.m4
new file mode 100644
index 0000000..9376418
--- /dev/null
+++ b/m4/audacity_checklib_taglib.m4
@@ -0,0 +1,56 @@
+dnl add Audacity / TagLib license ?
+dnl Please increment the serial number below whenever you alter this macro
+dnl for the benefit of automatic macro update systems
+# audacity_checklib_taglib.m4 serial 1
+
+AC_DEFUN([AUDACITY_CHECKLIB_TAGLIB], [
+   AC_ARG_WITH(taglib,
+               [AS_HELP_STRING([--with-taglib],
+                               [use TagLib for metadata support ])],
+               TAGLIB_ARGUMENT=$withval,
+               TAGLIB_ARGUMENT="unspecified")
+
+   if false ; then
+      AC_DEFINE(USE_TAGLIB, 1,
+                [Define if TagLib (metadata export) support should be enabled])
+   fi
+
+   dnl Check for a system copy of TagLib to use
+
+   PKG_CHECK_MODULES(TAGLIB, taglib >= 1.5,
+                     taglib_available_system="yes",
+                     taglib_available_system="no")
+
+   if test "x$taglib_available_system" = "xyes" ; then
+      TAGLIB_SYSTEM_AVAILABLE="yes"
+      TAGLIB_SYSTEM_LIBS=$TAGLIB_LIBS
+      TAGLIB_SYSTEM_CXXFLAGS=$TAGLIB_CFLAGS
+      TAGLIB_SYSTEM_CPPSYMBOLS="USE_TAGLIB"
+      AC_MSG_NOTICE([TagLib library available as system library])
+   else
+      TAGLIB_SYSTEM_AVAILABLE="no"
+      AC_MSG_NOTICE([TagLib library NOT available as system library])
+   fi
+
+   dnl see if TagLib is available locally
+
+   AC_CHECK_FILE(${srcdir}/lib-src/taglib/taglib/tag.h,
+                 tag_h_found="yes",
+                 tag_h_found="no")
+
+   if test "x$tag_h_found" = "xyes" ; then
+      TAGLIB_LOCAL_AVAILABLE="yes"
+      TAGLIB_LOCAL_LIBS="taglib.a"
+      TAGLIB_LOCAL_CXXFLAGS='-I$(top_srcdir)/lib-src/taglib/taglib'
+      TAGLIB_LOCAL_CPPSYMBOLS="USE_TAGLIB"
+	
+      dnl request library is configured
+      TAGLIB_LOCAL_CONFIG_SUBDIRS="lib-src/taglib"
+
+      AC_MSG_NOTICE([TagLib library is available in the local tree])
+   else
+      TAGLIB_LOCAL_AVAILABLE="no"
+      AC_MSG_NOTICE([TagLib library is NOT available in the local tree])
+   fi
+])
+
diff --git a/m4/ax_ld_check_flag.m4 b/m4/ax_ld_check_flag.m4
new file mode 100644
index 0000000..2339657
--- /dev/null
+++ b/m4/ax_ld_check_flag.m4
@@ -0,0 +1,96 @@
+# ===========================================================================
+#            http://autoconf-archive.cryp.to/ax_ld_check_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_LD_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+#
+# DESCRIPTION
+#
+#   This macro tests if the C++ compiler supports the flag FLAG-TO-CHECK. If
+#   successfull execute ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
+#   PROLOGUE and BODY are optional and should be used as in AC_LANG_PROGRAM
+#   macro.
+#
+#   Example:
+#
+#     AX_LD_CHECK_FLAG([-Wl,-L/usr/lib],[],[],[
+#       ...
+#     ],[
+#       ...
+#     ])
+#
+#   This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to
+#   Bogdan Drozdowski <bogdandr at op.pl> for testing and bug fixes.
+#
+# LAST MODIFICATION
+#
+#   2008-04-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2008 Francesco Salvestrini <salvestrini at users.sourceforge.net>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Macro Archive. When you make and
+#   distribute a modified version of the Autoconf Macro, you may extend this
+#   special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([AX_LD_CHECK_FLAG],[
+  AC_PREREQ([2.61])
+  AC_REQUIRE([AC_PROG_CXX])
+  AC_REQUIRE([AC_PROG_SED])
+
+  flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
+
+  AC_CACHE_CHECK([whether the linker accepts the $1 flag],
+    [ax_cv_ld_check_flag_$flag],[
+
+    #AC_LANG_PUSH([C])
+
+    save_LDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $1"
+    AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([$2],[$3])
+    ],[
+      eval "ax_cv_ld_check_flag_$flag=yes"
+    ],[
+      eval "ax_cv_ld_check_flag_$flag=no"
+    ])
+
+    LDFLAGS="$save_LDFLAGS"
+
+    #AC_LANG_POP
+
+  ])
+
+  AS_IF([eval "test \"`echo '$ax_cv_ld_check_flag_'$flag`\" = yes"],[
+    :
+    $4
+  ],[
+    :
+    $5
+  ])
+])
diff --git a/mac/wxMac-2.8.10.patch b/mac/wxMac-2.8.10.patch
new file mode 100644
index 0000000..ff4ee47
--- /dev/null
+++ b/mac/wxMac-2.8.10.patch
@@ -0,0 +1,339 @@
+diff -wruN wxWidgets-2.8.10-orig/include/wx/mac/carbon/sound.h wxWidgets-2.8.10/include/wx/mac/carbon/sound.h
+--- wxWidgets-2.8.10-orig/include/wx/mac/carbon/sound.h	2008-09-15 04:29:32.000000000 -0500
++++ wxWidgets-2.8.10/include/wx/mac/carbon/sound.h	2009-01-10 16:53:37.000000000 -0600
+@@ -21,13 +21,14 @@
+ {
+ public:
+   wxSound();
+-  wxSound(const wxString& fileName, bool isResource = FALSE);
++  wxSound(const wxString& fileName, bool isResource = false);
+   wxSound(int size, const wxByte* data);
+   virtual ~wxSound();
+ 
+ public:
+-  bool  Create(const wxString& fileName, bool isResource = FALSE);
+-  bool  IsOk() const { return !m_sndname.IsEmpty(); }
++  bool  Create(const wxString& fileName, bool isResource = false);
++  bool  Create(int size, const wxByte* data);
++  bool  IsOk() const { return !m_sndname.IsEmpty() || m_hSnd; }
+   static void  Stop();
+   static bool IsPlaying();
+ 
+diff -wruN wxWidgets-2.8.10-orig/src/mac/carbon/sound.cpp wxWidgets-2.8.10/src/mac/carbon/sound.cpp
+--- wxWidgets-2.8.10-orig/src/mac/carbon/sound.cpp	2008-09-15 04:29:28.000000000 -0500
++++ wxWidgets-2.8.10/src/mac/carbon/sound.cpp	2009-01-10 16:53:37.000000000 -0600
+@@ -86,6 +86,7 @@
+ #endif
+ 
+ #if USE_QUICKTIME
++
+ // ------------------------------------------------------------------
+ //          wxQTTimer - Handle Asyncronous Playing
+ // ------------------------------------------------------------------
+@@ -154,65 +155,6 @@
+ 
+ };
+ 
+-
+-class wxSMTimer : public wxTimer
+-{
+-public:
+-    wxSMTimer(void* hSnd, void* pSndChannel, bool bLoop, bool* playing)
+-        : m_hSnd(hSnd), m_pSndChannel(pSndChannel), m_bLoop(bLoop), m_pbPlaying(playing)
+-    {
+-    }
+-
+-    virtual ~wxSMTimer()
+-    {
+-        if(m_pbPlaying)
+-            *m_pbPlaying = false;
+-        SndDisposeChannel((SndChannelPtr)m_pSndChannel, TRUE);
+-        Stop();
+-    }
+-
+-    void Notify()
+-    {
+-        if (m_pbPlaying && !*m_pbPlaying)
+-        {
+-            Shutdown();
+-        }
+-
+-        SCStatus stat;
+-
+-        if (SndChannelStatus((SndChannelPtr)m_pSndChannel, sizeof(SCStatus), &stat) != 0)
+-            Shutdown();
+-
+-        //if the sound isn't playing anymore, see if it's looped,
+-        //and if so play it again, otherwise close things up
+-        if (stat.scChannelBusy == FALSE)
+-        {
+-            if (m_bLoop)
+-            {
+-                if(SndPlay((SndChannelPtr)m_pSndChannel, (SndListHandle) m_hSnd, true) != noErr)
+-                    Shutdown();
+-            }
+-            else
+-                Shutdown();
+-        }
+-    }
+-
+-    void Shutdown()
+-    {
+-        delete this;
+-    }
+-
+-    void* GetChannel() {return m_pSndChannel;}
+-
+-protected:
+-    void* m_hSnd;
+-    void* m_pSndChannel;
+-    bool m_bLoop;
+-
+-public:
+-    bool* m_pbPlaying;
+-};
+-
+ // ------------------------------------------------------------------
+ //          wxSound
+ // ------------------------------------------------------------------
+@@ -265,8 +207,9 @@
+ }
+ 
+ wxSound::wxSound(int size, const wxByte* data)
+-: m_hSnd((char*)data), m_waveLength(size), m_pTimer(NULL), m_type(wxSound_MEMORY)
++: m_hSnd(NULL), m_waveLength(0), m_pTimer(NULL), m_type(wxSound_NONE)
+ {
++   Create(size, data);
+ }
+ 
+ wxSound::~wxSound()
+@@ -277,19 +220,25 @@
+ {
+     Stop();
+ 
++    m_sndname.Empty();
++
+     if (isResource)
+     {
+ #ifdef __WXMAC__
+-        m_type = wxSound_RESOURCE;
+-
+-        Str255 lpSnd ;
+-
+-        wxMacStringToPascal( fileName , lpSnd ) ;
++        CFURLRef url;
++        CFStringRef path;
+ 
+-        m_sndname = fileName;
+-        m_hSnd = (char*) GetNamedResource('snd ', (const unsigned char *) lpSnd);
+-#else
+-        return false;
++        url = CFBundleCopyResourceURL(CFBundleGetMainBundle(),
++                                      wxMacCFStringHolder(fileName,wxLocale::GetSystemEncoding()),
++                                      NULL,
++                                      NULL);
++        if (url)
++        {
++            path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
++            CFRelease(url);
++            m_type = wxSound_FILE;
++            m_sndname = wxMacCFStringHolder(path).AsString(wxLocale::GetSystemEncoding());
++        }
+ #endif
+     }
+     else
+@@ -298,6 +247,15 @@
+         m_sndname = fileName;
+     }
+ 
++    return !m_sndname.IsEmpty();
++}
++
++bool wxSound::Create(int size, const wxByte* data)
++{
++   m_hSnd = (char *)data;
++   m_waveLength = size;
++   m_type = wxSound_MEMORY;
++
+     return true;
+ }
+ 
+@@ -308,107 +266,70 @@
+ #if USE_QUICKTIME
+ 
+     Movie movie;
++    Handle dataRef = nil;
++    OSType dataRefType;
++    OSErr err = noErr;
++    
++    if (!wxInitQT())
++        return false;
+ 
+     switch(m_type)
+     {
+     case wxSound_MEMORY:
+         {
+-            if (!wxInitQT())
+-                return false;
+-            Handle myHandle, dataRef = nil;
+-            MovieImportComponent miComponent;
+-            Track targetTrack = nil;
+-            TimeValue addedDuration = 0;
+-            long outFlags = 0;
+-            OSErr err;
+-            ComponentResult result;
+-
+-            myHandle = NewHandleClear((Size)m_waveLength);
+-
+-            BlockMove(m_hSnd, *myHandle, m_waveLength);
+-
+-            err = PtrToHand(&myHandle, &dataRef, sizeof(Handle));
++            Handle myHandle = nil;
++            unsigned long type;
++            unsigned long atoms[5];
+ 
+             if (memcmp(&m_hSnd[8], "WAVE", 4) == 0)
+-                miComponent = OpenDefaultComponent(MovieImportType, kQTFileTypeWave);
++                type = kQTFileTypeWave;
+             else if (memcmp(&m_hSnd[8], "AIFF", 4) == 0)
+-                miComponent = OpenDefaultComponent(MovieImportType, kQTFileTypeAIFF);
++                type = kQTFileTypeAIFF;
+             else if (memcmp(&m_hSnd[8], "AIFC", 4) == 0)
+-                miComponent = OpenDefaultComponent(MovieImportType, kQTFileTypeAIFC);
++                type = kQTFileTypeAIFC;
+             else
+             {
+                 wxLogSysError(wxT("wxSound - Location in memory does not contain valid data"));
+                 return false;
+             }
+ 
+-            movie = NewMovie(0);
+-
+-            result = MovieImportDataRef(miComponent,                dataRef,
+-                                        HandleDataHandlerSubType,   movie,
+-                                        nil,                        &targetTrack,
+-                                        nil,                        &addedDuration,
+-                                        movieImportCreateTrack,     &outFlags);
+-
+-            if (result != noErr)
+-            {
+-                wxLogSysError(wxString::Format(wxT("Couldn't import movie data\nError:%i"), (int)result));
+-            }
+-
+-            SetMovieVolume(movie, kFullVolume);
+-            GoToBeginningOfMovie(movie);
++            atoms[0] = EndianU32_NtoB(sizeof(long) * 3);
++            atoms[1] = EndianU32_NtoB(kDataRefExtensionMacOSFileType);
++            atoms[2] = EndianU32_NtoB(type);
++            atoms[3] = EndianU32_NtoB(sizeof(long) * 2 + m_waveLength);
++            atoms[4] = EndianU32_NtoB(kDataRefExtensionInitializationData);
++
++            err = 0;
++            err |= PtrToHand(&myHandle, &dataRef, sizeof(Handle));
++            err |= PtrAndHand("\p", dataRef, 1);
++            err |= PtrAndHand(atoms, dataRef, sizeof(long) * 5);
++            err |= PtrAndHand(m_hSnd, dataRef, m_waveLength);
+ 
+-            DisposeHandle(myHandle);
++            dataRefType = HandleDataHandlerSubType;
+         }
+         break;
+-    case wxSound_RESOURCE:
+-        {
+-            SoundComponentData data;
+-            unsigned long numframes, offset;
+-
+-            ParseSndHeader((SndListHandle)m_hSnd, &data, &numframes, &offset);
+-            //m_waveLength = numFrames * data.numChannels;
+-
+-            SndChannelPtr pSndChannel;
+-            SndNewChannel(&pSndChannel, sampledSynth,
+-                initNoInterp
+-                + (data.numChannels == 1 ? initMono : initStereo), NULL);
+-
+-            if(SndPlay(pSndChannel, (SndListHandle) m_hSnd, flags & wxSOUND_ASYNC ? 1 : 0) != noErr)
+-                return false;
+-
+-            if (flags & wxSOUND_ASYNC)
++    case wxSound_FILE:
+             {
+-                lastSoundTimer = ((wxSMTimer*&)m_pTimer)
+-                    = new wxSMTimer(pSndChannel, m_hSnd, flags & wxSOUND_LOOP ? 1 : 0,
+-                                    &lastSoundIsPlaying);
+-                lastSoundIsPlaying = true;
+-
+-                ((wxTimer*)m_pTimer)->Start(MOVIE_DELAY, wxTIMER_CONTINUOUS);
+-            }
+-            else
+-                SndDisposeChannel(pSndChannel, TRUE);
+-
+-            return true;
++            err = QTNewDataReferenceFromFullPathCFString(wxMacCFStringHolder(m_sndname,wxLocale::GetSystemEncoding()),
++                                                         (UInt32)kQTNativeDefaultPathStyle,
++                                                         0,
++                                                         &dataRef,
++                                                         &dataRefType);
+         }
+         break;
+-    case wxSound_FILE:
+-        {
+-            if (!wxInitQT())
++    default:
+                 return false;
+-
+-            OSErr err = noErr ;
+-
+-            Handle dataRef = NULL;
+-            OSType dataRefType;
+-
+-            err = QTNewDataReferenceFromFullPathCFString(wxMacCFStringHolder(m_sndname,wxLocale::GetSystemEncoding()),
+-                (UInt32)kQTNativeDefaultPathStyle, 0, &dataRef, &dataRefType);
++    }//end switch(m_type)
+ 
+             wxASSERT(err == noErr);
+ 
+             if (NULL != dataRef || err != noErr)
+             {
+-                err = NewMovieFromDataRef( &movie, newMovieDontAskUnresolvedDataRefs , NULL, dataRef, dataRefType );
++        err = NewMovieFromDataRef(&movie,
++                                  0,
++                                  nil,
++                                  dataRef,
++                                  dataRefType);
+                 wxASSERT(err == noErr);
+                 DisposeHandle(dataRef);
+             }
+@@ -416,17 +337,13 @@
+             if (err != noErr)
+             {
+                 wxLogSysError(
+-                    wxString::Format(wxT("wxSound - Could not open file: %s\nError:%i"), m_sndname.c_str(), err )
++            wxString::Format(wxT("wxSound - Could not create movie\nError:%i"), err)
+                     );
+                 return false;
+             }
+-        }
+-        break;
+-    default:
+-        return false;
+-    }//end switch(m_type)
+ 
+-    //Start the movie!
++    SetMovieVolume(movie, kFullVolume);
++    GoToBeginningOfMovie(movie);
+     StartMovie(movie);
+ 
+     if (flags & wxSOUND_ASYNC)
+@@ -473,12 +390,8 @@
+ void* wxSound::GetHandle()
+ {
+ #if USE_QUICKTIME
+-    if(m_type == wxSound_RESOURCE)
+-        return (void*)  ((wxSMTimer*)m_pTimer)->GetChannel();
+-
+     return (void*) ((wxQTTimer*) m_pTimer)->GetMovie();
+ #endif
+     return NULL;
+ }
+-
+ #endif //wxUSE_SOUND
diff --git a/nyquist/envelopes.lsp b/nyquist/envelopes.lsp
new file mode 100644
index 0000000..6797997
--- /dev/null
+++ b/nyquist/envelopes.lsp
@@ -0,0 +1,163 @@
+;; envelopes.lsp -- support functions for envelope editor in jNyqIDE
+
+#| In Nyquist, editable envelopes are saved as one entry in the workspace
+named *envelopes*. The entry is an association list where each element
+looks like this:
+
+(name type parameters... )
+
+where name is a symbol, e.g. MY-ENVELOPE-1,
+      type is a function name, e.g. PWL, PWLV, PWE, etc., and
+      parameters are breakpoint data, e.g. 0.1 1 0.2 0.5 1
+
+Example of two envelopes named FOO and BAR:
+
+((FOO PWL 0.1 1 1) (BAR PWE 0.2 1 1))
+
+To convert envelope data into functions, call (MAKE-ENV-FUNCTIONS).
+This function should be on the workspace's list of functions to call.
+(See ADD-ACTION-TO-WORKSPACE in Nyquist Manual.)
+
+When the jNyqIDE wants to get the envelope data from the workspace, it
+should call (GET-ENV-DATA), which will dump formatted data to Nyquist's
+standard output as follows:
+
+get-env-data: begin
+name (type parameters...) newline
+name (type parameters...) newline
+...
+get-env-data: end
+
+When the IDE wants to save a definition, it should call
+(DEFINE-ENV 'NAME 'EXPRESSION)
+
+To delete a definition, call:
+(DELETE-ENV 'NAME)
+
+Envelope data will be loaded when the editor window is opened and saved
+whenever the user issues a "save" command. If the user switches envelopes
+without saving, there is a prompt to save or ignore.
+
+The user will also be prompted to save when the editor window is closed
+or when Nyquist is exited.
+
+Saving the workspace automatically is something that Nyquist should do
+(or prompt the user to do) when it exits.
+
+|#
+
+;; WORKSPACE -- the workspace is just a set of variables, typically
+;;  with scores as values. These are stored in the file workspace.lsp
+;;  so that you can work on some data and then store it for use later.
+
+(cond ((not (boundp '*workspace*))
+       (setf *workspace* nil)))
+(cond ((not (boundp '*workspace-actions*))
+       (setf *workspace-actions* nil)))
+;; one of the variables in the workspace is *envelopes*
+(cond ((not (boundp '*envelopes*))
+       (setf *envelopes* nil)))
+
+;; DESCRIBE -- add a description to a global variable
+;;
+(defun describe (symbol &optional description)
+  (add-to-workspace symbol)
+  (cond (description
+         (putprop symbol description 'description))
+        (t
+         (get symbol 'description))))
+
+;; ADD-TO-WORKSPACE -- add a global symbol to workspace
+;;
+(defun add-to-workspace (symbol)
+  (cond ((not (symbolp symbol))
+         (format t "add-to-workspace expects a (quoted) symbol~%"))
+        ((not (member symbol *workspace*))
+         (push symbol *workspace*))))
+
+
+;; ADD-ACTION-TO-WORKSPACE -- call function when workspace is loaded
+;;
+(defun add-action-to-workspace (symbol)
+  (cond ((not (symbolp symbol))
+         (format t "add-action-to-workspace expects a (quoted) symbol~%"))
+        ((not (member symbol *workspace-actions*))
+         (push symbol *workspace-actions*))))
+
+;; SAVE-WORKSPACE -- write data to file
+;;
+(defun save-workspace ()
+  (let (val (outf (open "workspace.lsp" :direction :output)))
+    (dolist (sym *workspace*)
+      (format outf "(add-to-workspace '~A)~%" sym)
+      (cond ((get sym 'description)
+             (format outf "(putprop '~A \"~A\" 'description)~%"
+                          sym (get sym 'description))))
+      (format outf "(setf ~A '" sym)
+      (setf val (symbol-value sym))
+      (cond ((listp val)
+             (format outf "(~%")
+             (dolist (elem val)
+               (format outf "  ~A~%" elem))
+             (format outf " ))~%~%"))
+            (t
+             (format outf "~A)~%~%" val))))
+    (dolist (sym *workspace-actions*) ;; call hooks after reading data
+      (format outf "(add-action-to-workspace '~A)~%" sym)
+      (format outf "(if (fboundp '~A) (~A))~%" sym sym))
+    (format outf "(princ \"workspace loaded\\n\")~%")
+    (close outf)
+    (princ "workspace saved\n")
+    nil))
+
+
+;; DEFINE-ENV -- save the env data and make corresponding function
+;;
+(defun define-env (name expression)
+  (delete-env name)
+  (push (cons name expression) *envelopes*)
+  (make-env-function name expression)
+  ; make sure envelopes are redefined when workspace is loaded
+  (add-to-workspace '*envelopes*) ; so *envelopes* will be saved
+  (describe '*envelopes* "data for envelope editor in jNyqIDE")
+  (add-action-to-workspace 'make-env-functions)
+  nil)
+
+
+;; DELETE-ENV -- delete an envelope definition from workspace
+;;
+;; note that this will not undefine the corresponding envelope function
+;;
+(defun delete-env (name)
+  (setf *envelopes* 
+        (remove name *envelopes* 
+                :test #'(lambda (key item) (eql key (car item))))))
+
+
+;; MAKE-ENV-FUNCTION -- convert data to a defined function
+;;
+(defun make-env-function (name expression)
+  (setf (symbol-function name)
+        (eval (list 'lambda '() expression))))
+
+
+;; MAKE-ENV-FUNCTIONS -- convert data to defined functions
+;;
+(defun make-env-functions ()
+  (let (name type parameters)
+    (dolist (env *envelopes*)
+       (setf name (car env))
+       (setf type (cadr env))
+       (setf parameters (cddr env))
+       (make-env-function name (cons type parameters)))))
+
+
+;; GET-ENV-DATA -- print env data for IDE
+;;
+(defun get-env-data ()
+    (princ "get-env-data: begin\n")
+    (dolist (env *envelopes*)
+      (format t "~A ~A~%" (car env) (cdr env)))
+    (princ "get-env-data: end\n")
+    nil)
+
diff --git a/nyquist/equalizer.lsp b/nyquist/equalizer.lsp
new file mode 100644
index 0000000..12ff487
--- /dev/null
+++ b/nyquist/equalizer.lsp
@@ -0,0 +1,75 @@
+;; equalizer.lsp -- support functions for equalizer editor in jNyqIDE
+
+#| This is modeled after envelopes.lsp, which details how envelope data is 
+exchanged between Nyquist and jNyqIDE.
+
+The jNyqIDE code needs some work to make it look like the envelope
+editor (which also needs work, but that's another matter). For consistency,
+both should support named envelopes and equalizers.
+
+However, for now, we have equalizers numbered from 0 to 9. The format for
+exchange will be:
+
+get-eq-data: begin
+name parameters newline
+name parameters newline
+...
+get-eq-data: end
+
+and when the IDE wants to save a definition, it should call
+(DEFINE-EQ 'NAME 'PARAMETER-LIST)
+
+|#
+
+(cond ((not (boundp '*equalizers*))
+       (setf *equalizers* nil)))
+
+;; DEFINE-EQ -- save the eq data and make corresponding function
+;;
+(defun define-eq (name expression)
+  (setf *equalizers* (remove name *equalizers* 
+                            :test #'(lambda (key item) (eql key (car item)))))
+  (push (list name expression) *equalizers*)
+  (make-eq-function name expression)
+  ; make sure equalizers are redefined when workspace is loaded
+  (add-to-workspace '*equalizers*)
+  (describe '*equalizers* "data for equalizers in jNyqIDE")
+  (add-action-to-workspace 'make-eq-functions)
+  nil)
+
+
+;; MAKE-EQ-FUNCTION -- convert data to a defined function
+;;
+(defun make-eq-function (name parameters)
+  (cond ((numberp name)
+             (setf name (intern (format nil "EQ-~A" name)))))
+  (if (not (boundp '*grapheq-loaded*)) (load "grapheq.lsp"))
+  (setf (symbol-function name)
+        (eval `(lambda (s) (nband-range s ',parameters 60 14000)))))
+
+
+;; MAKE-EQ-FUNCTIONS -- convert data to defined functions
+;;
+(defun make-eq-functions ()
+  (let (name type parameters)
+    (dolist (eq *equalizers*)
+       (setf name (car eq))
+       (setf parameters (second parameters))
+       (make-eq-function name parameters))))
+
+
+;; GET-EQ-DATA -- print env data for IDE
+;;
+(defun get-eq-data ()
+  (let (parameters)
+    (princ "get-eq-data: begin\n")
+    (dolist (env *equalizers*)
+      (format t "~A" (car env))
+      (setf parameters (second env))
+      (dotimes (i (length parameters))
+        (format t " ~A" (aref parameters i)))
+      (format t "~%"))
+    (princ "get-eq-data: end\n")
+    nil))
+
+
diff --git a/nyquist/fileio.lsp b/nyquist/fileio.lsp
new file mode 100644
index 0000000..94fe59f
--- /dev/null
+++ b/nyquist/fileio.lsp
@@ -0,0 +1,304 @@
+;; fileio.lsp
+
+;; if *default-sf-dir* undefined, set it to user's tmp directory
+;;
+(cond ((not (boundp '*default-sf-dir*))
+       ;; it would be nice to use get-temp-path, but when running
+       ;; the Java-based IDE, Nyquist does not get environment
+       ;; variables to tell TMP or TEMP or USERPROFILE
+       ;; We want to avoid the current directory because it may
+       ;; be read-only. Search for some likely paths...
+       ;; Note that since these paths don't work for Unix or OS X,
+       ;; they will not be used, so no system-dependent code is 
+       ;; needed
+       (let ((current (setdir ".")))
+         (setf *default-sf-dir*
+               (or (setdir "c:\\tmp\\")
+                   (setdir "c:\\temp\\")
+                   (setdir "d:\\tmp\\")
+                   (setdir "d:\\temp\\")
+                   (setdir "e:\\tmp\\")
+                   (setdir "e:\\temp\\")
+	           (get-temp-path)))
+         (format t "Set *default-sf-dir* to \"~A\" in fileio.lsp~%" 
+		 *default-sf-dir*)
+	 (setdir current))))
+
+;; s-save -- saves a file
+(setf NY:ALL 1000000000)	; 1GIG constant for maxlen
+(defmacro s-save (expression &optional (maxlen NY:ALL) filename 
+                  &key (format '*default-sf-format*)
+                  (mode '*default-sf-mode*) (bits '*default-sf-bits*)
+                  (endian NIL) ; nil, :big, or :little -- specifies file format
+                  (play nil))
+  `(let ((ny:fname ,filename)
+         (ny:maxlen ,maxlen)
+         (ny:endian ,endian)
+         (ny:swap 0))
+     ; allow caller to omit maxlen, in which case the filename will
+     ; be a string in the maxlen parameter position and filename will be null
+     (cond ((null ny:fname)
+                 (cond ((stringp ny:maxlen)
+                            (setf ny:fname ny:maxlen)
+                            (setf ny:maxlen NY:ALL))
+                           (t
+                            (setf ny:fname *default-sound-file*)))))
+     
+     (cond ((equal ny:fname "")
+                 (cond ((not ,play)
+                       (format t "s-save: no file to write! play option is off!\n"))))
+           (t
+            (setf ny:fname (soundfilename ny:fname))
+            (format t "Saving sound file to ~A~%" ny:fname)))
+	 (cond ((eq ny:endian :big)
+	        (setf ny:swap (if (bigendianp) 0 1)))
+		   ((eq ny:endian :little)
+			(setf ny:swap (if (bigendianp) 1 0))))
+     (snd-save ',expression ny:maxlen ny:fname ,format ,mode ,bits ny:swap ,play)))
+
+;; MULTICHANNEL-MAX -- find peak over all channels
+;;
+(defun multichannel-max (snd samples)
+  (cond ((soundp snd)
+	 (snd-max snd samples))
+	((arrayp snd) ;; assume it is multichannel sound
+	 (let ((peak 0.0) (chans (length snd)))
+	   (dotimes (i chans)
+	     (setf peak (max peak (snd-max (aref snd i) (/ samples chans)))))
+	   peak))
+	(t (error "unexpected value in multichannel-max" snd))))
+
+
+;; AUTONORM -- look ahead to find peak and normalize sound to 80%
+;;
+(defun autonorm (snd)
+  (let (peak)
+    (cond (*autonormflag*
+	   (cond ((and (not (soundp snd))
+		       (not (eq (type-of snd) 'ARRAY)))
+		  (error "AUTONORM (or PLAY?) got unexpected value" snd))
+		 ((eq *autonorm-type* 'previous)
+		  (scale *autonorm* snd))
+		 ((eq *autonorm-type* 'lookahead)
+		  (setf peak (multichannel-max snd *autonorm-max-samples*))
+		  (setf peak (max 0.001 peak))
+                  (setf *autonorm* (/ *autonorm-target* peak))
+		  (scale *autonorm* snd))
+		 (t
+		  (error "unknown *autonorm-type*"))))
+	  (t snd))))
+	
+
+(defmacro s-save-autonorm (expression &rest arglist)
+  `(let ((peak (s-save (autonorm ,expression) , at arglist)))
+     (autonorm-update peak)))
+
+;; The "AutoNorm" facility: when you play something, the Nyquist play
+;; command will automatically compute what normalization factor you
+;; should have used. If you play the same thing again, the normalization
+;; factor is automatically applied.
+;;
+;; Call AUTONORM-OFF to turn off this feature, and AUTONORM-ON to turn
+;; it back on.
+;;
+;; *autonorm-target* is the peak value we're aiming for (it's set below 1
+;; so allow the next signal to get slightly louder without clipping)
+;;
+(init-global *autonorm-target* 0.9)
+;;
+;; *autonorm-type* selects the autonorm algorithm to use
+;;   'previous means normalize according to the last computed sound
+;;   'precompute means precompute *autonorm-max-samples* samples in
+;;       memory and normalize according to the peak
+;;
+(init-global *autonorm-type* 'lookahead)
+(init-global *autonorm-max-samples* 1000000) ; default is 4MB buffer
+;;
+(defun autonorm-on ()
+  (setf *autonorm* 1.0)
+  (setf *autonorm-previous-peak* 1.0)
+  (setf *autonormflag* t)
+  (format t "AutoNorm feature is on.~%"))
+
+(if (not (boundp '*autonormflag*)) (autonorm-on))
+
+(defun autonorm-off ()
+  (setf *autonormflag* nil)
+  (setf *autonorm* 1.0)
+  (format t "AutoNorm feature is off.~%"))
+
+;; AUTONORM-UPDATE -- called with true peak to report and prepare
+;;
+;; after saving/playing a file, we have the true peak. This along
+;; with the autonorm state is printed in a summary and the autonorm
+;; state is updated for next time.
+;;
+;; There are currently two types: PREVIOUS and LOOKAHEAD
+;; With PREVIOUS:
+;;   compute the true peak and print the before and after peak
+;;   along with the scale factor to be used next time
+;; With LOOKAHEAD:
+;;   compute the true peak and print the before and after peak
+;;   along with the "suggested scale factor" that would achieve
+;;   the *autonorm-target*
+;;
+(defun autonorm-update (peak)
+  (cond ((> peak 1.0)
+         (format t "*** CLIPPING DETECTED! ***~%")))
+  (cond ((and *autonormflag* (> peak 0.0))
+           (setf *autonorm-previous-peak* (/ peak *autonorm*))
+         (setf *autonorm* (/ *autonorm-target* *autonorm-previous-peak*))
+         (format t "AutoNorm: peak was ~A,~%" *autonorm-previous-peak*)
+         (format t "     peak after normalization was ~A,~%" peak)
+         (format t (if (eq *autonorm-type* 'PREVIOUS)
+                       "     new normalization factor is ~A~%"
+                       "     suggested normalization factor is ~A~%")
+                 *autonorm*))
+        (t
+         (format t "Peak was ~A,~%" peak)
+         (format t "     suggested normalization factor is ~A~%"
+                   (/ *autonorm-target* peak)))
+   peak
+  ))
+
+;; s-read -- reads a file
+(defun s-read (filename &key (time-offset 0) (srate *sound-srate*)
+        (dur 10000.0) (nchans 1) (format *default-sf-format*)
+        (mode *default-sf-mode*) (bits *default-sf-bits*) (endian NIL))
+  (let ((swap 0))
+    (cond ((eq endian :big)
+           (setf swap (if (bigendianp) 0 1)))
+          ((eq endian :little)
+           (setf swap (if (bigendianp) 1 0))))
+    (if (minusp dur) (error "s-read :dur is negative" dur))
+    (snd-read (soundfilename filename) time-offset
+            (local-to-global 0) format nchans mode bits swap srate
+            dur)))
+
+;; SF-INFO -- print sound file info
+;;
+(defun sf-info (filename)
+  (let (s format channels mode bits swap srate dur flags)
+    (format t "~A:~%" (soundfilename filename))
+    (setf s (s-read filename))
+    (setf format (car *rslt*))
+    (setf channels (cadr *rslt*))
+    (setf mode (caddr *rslt*))
+    (setf bits (cadddr *rslt*))
+    (setf *rslt* (cddddr *rslt*))
+    (setf swap (car *rslt*))
+    (setf srate (cadr *rslt*))
+    (setf dur (caddr *rslt*))
+    (setf flags (cadddr *rslt*))
+    (format t "Format: ~A~%" 
+            (nth format '("none" "AIFF" "IRCAM" "NeXT" "Wave" "PAF" "SVX"
+                          "NIST" "VOC" "W64" "MAT4" "Mat5" "PVF" "XI" "HTK"
+                          "SDS" "AVR" "SD2" "FLAC" "CAF")))
+    (cond ((setp (logand flags snd-head-channels))
+           (format t "Channels: ~A~%" channels)))
+    (cond ((setp (logand flags snd-head-mode))
+           (format t "Mode: ~A~%"
+                   (nth mode '("ADPCM" "PCM" "uLaw" "aLaw" "Float" "UPCM"
+                               "unknown" "double" "GSM610" "DWVW" "DPCM"
+                               "msadpcm")))))
+    (cond ((setp (logand flags snd-head-bits))
+           (format t "Bits/Sample: ~A~%" bits)))
+    (cond ((setp (logand flags snd-head-srate))
+           (format t "SampleRate: ~A~%" srate)))
+    (cond ((setp (logand flags snd-head-dur))
+           (format t "Duration: ~A~%" dur)))
+    ))
+
+;; SETP -- tests whether a bit is set (non-zero)
+;
+(defun setp (bits) (not (zerop bits)))
+
+;; IS-FILE-SEPARATOR -- is this a file path separation character, e.g. "/"?
+;;
+(defun is-file-separator (c)
+  (or (eq c *file-separator*)
+      (and (eq *file-separator* #\\) ;; if this is windows (indicated by "\")
+           (eq c #\/)))) ;; then "/" is also a file separator
+
+;; SOUNDFILENAME -- add default directory to name to get filename
+;;
+(defun soundfilename (filename)
+  (cond ((= 0 (length filename))
+         (break "filename must be at least one character long" filename))
+        ((full-name-p filename))
+        (t
+         ; if sf-dir nonempty and does not end with filename separator,
+         ; append one
+         (cond ((and (< 0 (length *default-sf-dir*))
+                     (not (is-file-separator
+                           (char *default-sf-dir* 
+                                 (1- (length *default-sf-dir*))))))
+                (setf *default-sf-dir* (strcat *default-sf-dir* (string *file-separator*)))
+                (format t "Warning: appending \"~A\" to *default-sf-dir*~%"
+                        *file-separator*)))
+         (setf filename (strcat *default-sf-dir* (string filename)))))
+  ;; now we have a file name, but it may be relative to current directory, so 
+  ;; expand it with the current directory
+  (cond ((relative-path-p filename)
+         ;; get current working directory and build full name
+         (let ((path (setdir ".")))
+           (cond (path
+                  (setf filename (strcat path (string *file-separator*) 
+                                         (string filename))))))))
+  filename)
+
+
+(setfn s-read-format car)
+(setfn s-read-channels cadr)
+(setfn s-read-mode caddr)
+(setfn s-read-bits cadddr)
+(defun s-read-swap (rslt) (car (cddddr rslt)))
+(defun s-read-srate (rslt) (cadr (cddddr rslt)))
+(defun s-read-dur (rslt) (caddr (cddddr rslt)))
+(defun s-read-byte-offset (rslt) (car (cddddr (cddddr rslt))))
+
+;; round is tricky because truncate rounds toward zero as does C
+;; in other words, rounding is down for positive numbers and up
+;; for negative numbers. You can convert rounding up to rounding
+;; down by subtracting one, but this fails on the integers, so
+;; we need a special test if (- x 0.5) is an integer
+(defun round (x) 
+  (cond ((> x 0) (truncate (+ x 0.5)))
+        ((= (- x 0.5) (truncate (- x 0.5))) (truncate x))
+        (t (truncate (- x 0.5)))))
+
+;; change defaults for PLAY macro:
+(init-global *soundenable* t)
+(defun sound-on () (setf *soundenable* t))
+(defun sound-off () (setf *soundenable* nil))
+
+(defmacro s-add-to (expr maxlen filename &optional (time-offset 0.0))
+  `(let ((ny:fname (soundfilename ,filename))
+         ny:peak ny:input (ny:offset ,time-offset))
+    (format t "Adding sound to ~A at offset ~A~%" 
+              ny:fname ,time-offset)
+    (setf ny:peak (snd-overwrite '(let ((ny:addend ,expr))
+                                   (sum (snd-coterm
+                                         (s-read ny:fname
+                                          :time-offset ny:offset)
+                                         ny:addend)
+                                    ny:addend))
+                   ,maxlen ny:fname ny:offset SND-HEAD-NONE 0 0 0))
+    (format t "Duration written: ~A~%" (car *rslt*))
+    ny:peak))
+
+
+(defmacro s-overwrite (expr maxlen filename &optional (time-offset 0.0))
+  `(let ((ny:fname (soundfilename ,filename))
+         (ny:peak 0.0)
+         ny:input ny:rslt ny:offset)
+    (format t "Overwriting ~A at offset ~A~%" ny:fname ny:offset)
+    (setf ny:offset (s-read-byte-offset ny:rslt))
+    (setf ny:peak (snd-overwrite `,expr ,maxlen ny:fname time-offset
+                   0, 0, 0, 0.0, 0))
+    (format t "Duration written: ~A~%" (car *rslt*))
+    ny:peak))
+
+
+
+
diff --git a/nyquist/nyquist-plot.txt b/nyquist/nyquist-plot.txt
new file mode 100644
index 0000000..003e6e0
--- /dev/null
+++ b/nyquist/nyquist-plot.txt
@@ -0,0 +1,3 @@
+set nokey
+plot "points.dat" with lines
+
diff --git a/nyquist/rawwaves/mand1.raw b/nyquist/rawwaves/mand1.raw
new file mode 100644
index 0000000..bc04a05
Binary files /dev/null and b/nyquist/rawwaves/mand1.raw differ
diff --git a/nyquist/rawwaves/mand10.raw b/nyquist/rawwaves/mand10.raw
new file mode 100644
index 0000000..4b35376
Binary files /dev/null and b/nyquist/rawwaves/mand10.raw differ
diff --git a/nyquist/rawwaves/mand11.raw b/nyquist/rawwaves/mand11.raw
new file mode 100644
index 0000000..94889be
Binary files /dev/null and b/nyquist/rawwaves/mand11.raw differ
diff --git a/nyquist/rawwaves/mand12.raw b/nyquist/rawwaves/mand12.raw
new file mode 100644
index 0000000..a128642
Binary files /dev/null and b/nyquist/rawwaves/mand12.raw differ
diff --git a/nyquist/rawwaves/mand2.raw b/nyquist/rawwaves/mand2.raw
new file mode 100644
index 0000000..6208008
Binary files /dev/null and b/nyquist/rawwaves/mand2.raw differ
diff --git a/nyquist/rawwaves/mand3.raw b/nyquist/rawwaves/mand3.raw
new file mode 100644
index 0000000..8857f86
Binary files /dev/null and b/nyquist/rawwaves/mand3.raw differ
diff --git a/nyquist/rawwaves/mand4.raw b/nyquist/rawwaves/mand4.raw
new file mode 100644
index 0000000..6058eb1
Binary files /dev/null and b/nyquist/rawwaves/mand4.raw differ
diff --git a/nyquist/rawwaves/mand5.raw b/nyquist/rawwaves/mand5.raw
new file mode 100644
index 0000000..9b308a8
Binary files /dev/null and b/nyquist/rawwaves/mand5.raw differ
diff --git a/nyquist/rawwaves/mand6.raw b/nyquist/rawwaves/mand6.raw
new file mode 100644
index 0000000..05f083d
Binary files /dev/null and b/nyquist/rawwaves/mand6.raw differ
diff --git a/nyquist/rawwaves/mand7.raw b/nyquist/rawwaves/mand7.raw
new file mode 100644
index 0000000..64941e9
Binary files /dev/null and b/nyquist/rawwaves/mand7.raw differ
diff --git a/nyquist/rawwaves/mand8.raw b/nyquist/rawwaves/mand8.raw
new file mode 100644
index 0000000..52027bf
Binary files /dev/null and b/nyquist/rawwaves/mand8.raw differ
diff --git a/nyquist/rawwaves/mand9.raw b/nyquist/rawwaves/mand9.raw
new file mode 100644
index 0000000..9e88a0c
Binary files /dev/null and b/nyquist/rawwaves/mand9.raw differ
diff --git a/nyquist/rawwaves/mandpluk.raw b/nyquist/rawwaves/mandpluk.raw
new file mode 100644
index 0000000..162a0da
Binary files /dev/null and b/nyquist/rawwaves/mandpluk.raw differ
diff --git a/nyquist/rawwaves/marmstk1.raw b/nyquist/rawwaves/marmstk1.raw
new file mode 100644
index 0000000..185b445
Binary files /dev/null and b/nyquist/rawwaves/marmstk1.raw differ
diff --git a/nyquist/rawwaves/sinewave.raw b/nyquist/rawwaves/sinewave.raw
new file mode 100644
index 0000000..a5cb349
Binary files /dev/null and b/nyquist/rawwaves/sinewave.raw differ
diff --git a/nyquist/sal-parse.lsp b/nyquist/sal-parse.lsp
new file mode 100644
index 0000000..6a75614
--- /dev/null
+++ b/nyquist/sal-parse.lsp
@@ -0,0 +1,1818 @@
+;; SAL parser -- replaces original pattern-directed parser with
+;;    a recursive descent one
+;;
+;; Parse functions either parse correctly and return
+;; compiled code as a lisp expression (which could be nil)
+;; or else they call parse-error, which does not return
+;; (instead, parse-error forces a return from parse)
+;; In the original SAL parser, triples were returned
+;; including the remainder if any of the tokens to be
+;; parsed. In this parser, tokens are on the list
+;; *sal-tokens*, and whatever remains on the list is
+;; the list of unparsed tokens.
+
+;; scanning delimiters.
+
+(setfn nreverse reverse)
+
+(defconstant +quote+ #\")		; "..." string 
+(defconstant +kwote+ #\')		; '...' kwoted expr
+(defconstant +comma+ #\,)                ; positional arg delimiter
+(defconstant +pound+ #\#)                ; for bools etc
+(defconstant +semic+ #\;)		; comment char
+(defconstant +lbrace+ #\{)               ; {} list notation 
+(defconstant +rbrace+ #\})
+(defconstant +lbrack+ #\[)               ; unused for now
+(defconstant +rbrack+ #\])
+(defconstant +lparen+ #\()               ; () expr and arg grouping
+(defconstant +rparen+ #\))
+
+;; these are defined so that SAL programs can name these symbols
+;; note that quote(>) doesn't work, so you need quote(symbol:greater)
+
+(setf symbol:greater '>)
+(setf symbol:less '<)
+(setf symbol:greater-equal '>=)
+(setf symbol:less-equal '<=)
+(setf symbol:equal '=)
+(setf symbol:not '!)
+(setf symbol:not-equal '/=)
+
+
+(defparameter +whites+ (list #\space #\tab #\newline (code-char 13)))
+
+(defparameter +kwstyle+ (list :suffix #\:)) ; let's try dylan
+
+(defparameter +operators+
+  ;; each op is: (<token-class> <sal-name> <lisp-form>)
+  '((:+ "+" sum)
+    (:- "-" diff)
+    (:* "*" mult)
+    (:/ "/" /)
+    (:% "%" rem)
+    (:^ "^" expt)
+    (:= "=" eql)   ; equality and assigment
+    (:!= "!=" not-eql)
+    (:< "<" <)
+    (:> ">" >)
+    (:<= "<=" <=) ; leq and assignment minimization
+    (:>= ">=" >=) ; geq and assignment maximization
+    (:~= "~=" equal) ; general equality
+    (:+= "+=" +=) ; assignment increment-and-store
+    (:-= "-=" -=) ; assignment increment-and-store
+    (:*= "*=" *=) ; assignment multiply-and-store
+    (:/= "/=" /=) ; assignment multiply-and-store
+    (:&= "&=" &=) ; assigment list collecting
+    (:@= "@=" @=) ; assigment list prepending
+    (:^= "^=" ^=) ; assigment list appending
+    (:! "!" not)
+    (:& "&" and)
+    (:\| "|" or)
+    (:~ "~" sal-stretch)
+    (:~~ "~~" sal-stretch-abs)
+    (:@ "@" sal-at)
+    (:@@ "@@" sal-at-abs)
+    ))
+
+(setf *sal-local-variables* nil) ;; used to avoid warning about variable
+ ;; names when the variable has been declared as a local
+
+(defparameter *sal-operators*
+  '(:+ :- :* :/ :% :^ := :!= :< :> :<= :>= :~= :+= :*= :&= :@= :^= :! :& :\|
+    :~ :~~ :@ :@@))
+
+(defparameter +delimiters+
+  '((:lp #\()
+    (:rp #\))
+    (:lc #\{)				; left curly
+    (:rc #\})
+    (:lb #\[)
+    (:rb #\])
+    (:co #\,)
+    (:kw #\')				; kwote
+    (nil #\")				; not token
+   ; (nil #\#)
+    (nil #\;)
+    ))
+
+(setf *reserved-words* '((::+ ":+") (::- ":-") (::* ":*") (::/ ":/") (::= ":=")
+                         (::!= ":!=") (::< ":<") (::> ":>") (::<= ":<=")
+                         (::>= ":>=") (::~= ":~=") (::! ":!") (::& ":&")
+                         (::\| ":|") (:IF "if") (:THEN "then") (:ELSE "else")
+                         (:WHEN "when") (:UNLESS "unless") (:SET "set")
+                         (:= "=") (:+= "+=") (:*= "*=") (:&= "&=") (:@= "@=")
+                         (:^= "^=") (:<= "<=") (:>= ">=") (:PRINT "print")
+                         (:LOOP "loop")
+                         (:RUN "run") (:REPEAT "repeat") (:FOR "for")
+                         (:FROM "from") (:IN "in") (:BELOW "below") (:TO "to")
+                         (:ABOVE "above") (:DOWNTO "downto") (:BY "by")
+                         (:OVER "over") (:WHILE "while") (:UNTIL "until")
+                         (:FINALLY "finally") (:RETURN "return")
+                         (:WAIT "wait") (:BEGIN "begin") (:WITH "with")
+                         (:END "end") (:VARIABLE "variable")
+                         (:FUNCTION "function") (:PROCESS "process")
+                         (:CHDIR "chdir") (:DEFINE "define") (:LOAD "load")
+                         (:PLAY "play")
+                         (:EXEC "exec") (:exit "exit") (:DISPLAY "display")
+                         (:~ "~") (:~~ "~~") (:@ ":@") (:@@ ":@@")))
+
+
+(setf *sal-fn-name* nil)
+
+(defun make-sal-error (&key type text (line nil) start)
+  ; (error 'make-sal-error-was-called-break)
+  (list 'sal-error type text line start))
+(setfn sal-error-type cadr)
+(setfn sal-error-text caddr)
+(setfn sal-error-line cadddr)
+(defun sal-error-start (x) (cadddr (cdr x)))
+(defun is-sal-error (x) (and x (eq (car x) 'sal-error)))
+(defun sal-tokens-error-start (start)
+  (cond (start 
+         start)
+        (*sal-tokens*
+         (token-start (car *sal-tokens*)))
+        (t
+         (length *sal-input-text*))))
+
+
+(defmacro errexit (message &optional start)
+  `(parse-error (make-sal-error :type "parse"
+		 :line *sal-input-text* :text ,message
+                 :start ,(sal-tokens-error-start start))))
+
+(defmacro sal-warning (message &optional start)
+  `(pperror (make-sal-error :type "parse" :line *sal-input-text*
+                            :text ,message
+                            :start ,(sal-tokens-error-start start))
+            "warning"))
+
+(setf *pos-to-line-source* nil)
+(setf *pos-to-line-pos* nil)
+(setf *pos-to-line-line* nil)
+
+(defun pos-to-line (pos source)
+  ;; this is really inefficient to search every line from
+  ;; the beginning, so cache results and search forward
+  ;; from there if possible
+  (let ((i 0) (line-no 1)) ;; assume no cache
+    ;; see if we can use the cache
+    (cond ((and (eq source *pos-to-line-source*)
+                *pos-to-line-pos* *pos-to-line-line*
+                (>= pos *pos-to-line-pos*))
+           (setf i *pos-to-line-pos*)
+           (setf line-no *pos-to-line-line*)))
+    ;; count newlines up to pos
+    (while (< i pos)
+      (if (char= (char source i) #\newline)
+          (incf line-no))
+      (setf i (1+ i)))
+    ;; save results in cache
+    (setf *pos-to-line-source* source
+          *pos-to-line-pos* pos
+          *pos-to-line-line* line-no)
+    ;; return the line number at pos in source
+    line-no))
+
+
+;; makes a string of n spaces, empty string if n <= 0
+(defun make-spaces (n)
+  (cond ((> n 16)
+         (let* ((half (/ n 2))
+                (s (make-spaces half)))
+           (strcat s s (make-spaces (- n half half)))))
+        (t
+         (subseq "                " 0 (max n 0)))))
+
+
+(defun pperror (x &optional (msg-type "error"))
+  (let* ((source (sal-error-line x))
+	 (llen (length source))
+         line-no
+         beg end)
+    ; (display "pperror" x (strcat "|" (sal-error-line x) "|"))
+    ;; isolate line containing error
+    (setf beg (sal-error-start x))
+    (setf beg (min beg (1- llen)))
+    (do ((i beg (- i 1))
+	 (n nil)) ; n gets set when we find a newline
+	((or (< i 0) n)
+	 (setq beg (or n 0)))
+      (if (char= (char source i) #\newline)
+	  (setq n (+ i 1))))
+    (do ((i (sal-error-start x) (+ i 1))
+	 (n nil))
+	((or (>= i llen) n)
+	 (setq end (or n llen)))
+      (if (char= (char source i) #\newline)
+	  (setq n i)))
+    (setf line-no (pos-to-line beg source))
+    ; (display "pperror" beg end (sal-error-start x))
+      
+    ;; print the error. include the specfic line of input containing
+    ;; the error as well as a line below it marking the error position
+    ;; with an arrow: ^
+    (let* ((pos (- (sal-error-start x) beg))
+	   (line (if (and (= beg 0) (= end llen)) 
+		     source
+		     (subseq source beg end)))
+	   (mark (make-spaces pos)))
+      (format t "~%>>> ~A ~A: ~A.~%>>> in ~A, line ~A, col ~A.~%~%~A~%~A^~%"
+              (sal-error-type x) msg-type (sal-error-text x)
+              *sal-input-file-name* line-no (1+ pos)
+              line mark)
+;      (format t "~%>>> ~A error in \"~A\", line ~A, col ~A: ~A.~%~%~A~%~A^~%" 
+;              (sal-error-type x) *sal-input-file-name* line-no pos
+;	      (sal-error-text x) line mark)
+      x)))
+
+
+;;;
+;;; the lexer. right now it assumes input string is complete and ready
+;;; to be processed as a valid expression.
+;;;
+
+(defun advance-white (str white start end)
+  ;; skip "white" chars, where white can be a char, list of chars
+  ;; or predicate test
+  (do ((i start )
+       (p nil))
+      ((or p (if (< start end)
+		 (not (< -1 i end))
+		 (not (> i end -1))))
+       (or p end))
+    (cond ((consp white)
+	   (unless (member (char str i) white :test #'char=)
+	     (setq p i)))
+	  ((characterp white)
+	   (unless (char= (char str i) white)
+	     (setq p i)))
+	  ((functionp white)
+	   (unless (funcall white (char str i))
+	     (setq p i))))
+    (if (< start end)
+	(incf i)
+	(decf i))))
+
+
+(defun search-delim (str delim start end)
+  ;; find position of "delim" chars, where delim can be
+  ;; a char, list of chars or predicate test
+  (do ((i start (+ i 1))
+       (p nil))
+      ((or (not (< i end)) p)
+       (or p end))
+    (cond ((consp delim)
+	   (if (member (char str i) delim :test #'char=)
+	       (setq p i)))
+	  ((characterp delim)
+	   (if (char= (char str i) delim)
+	       (setq p i)))
+	  ((functionp delim)
+	   (if (funcall delim (char str i))
+	       (setq p i))))))
+
+
+;; UNBALANCED-INPUT AND TOKENIZE HAVE BEEN REWRITTEN, SEE BELOW. THIS ONE IS 
+;; OLD AND JUST KEPT HERE FOR REFERENCE
+#|
+(defun unbalanced-input (errf line toks par bra brk kwo)
+  ;; search input for the starting position of some unbalanced
+  ;; delimiter, toks is reversed list of tokens with something
+  ;; unbalanced
+  (let (char text targ othr levl pos)
+    (cond ((> par 0) (setq char #\( targ ':lp othr ':rp levl par))
+          ((< par 0) (setq char #\) targ ':rp othr ':lp levl 0))
+          ((> bra 0) (setq char #\{ targ ':lc othr ':rc levl bra))
+          ((< bra 0) (setq char #\} targ ':rc othr ':lc levl 0))
+          ((> brk 0) (setq char #\[ targ ':ls othr ':rs levl brk))
+          ((< brk 0) (setq char #\] targ ':rs othr ':ls levl 0))
+          ((> kwo 0) (setq char #\' targ ':kw othr ':kw levl kwo)))
+    (setq text (format nil "Unmatched '~A'" char))
+    ;; search for start of error in token list
+    (do ((n levl)
+         (tail toks (cdr tail)))
+        ((or (null tail) pos)
+         (or pos (error (format nil "Shouldn't! can't find op ~A in ~A."
+                                 targ (reverse toks)))))
+      (if (eql (token-type (car tail)) targ)
+          (if (= n levl)
+              (setq pos (token-start (car tail)))
+              (decf n))
+          (if (eql (token-type (car tail)) othr)
+              (incf n))))    
+    (errexit text pos)))
+
+
+(defun tokenize (str reserved error-fn)
+  ;&key (start 0) (end (length str)) 
+  ;		 (white-space +whites+) (delimiters +delimiters+)
+  ;		 (operators +operators+) (null-ok t)
+  ;              (keyword-style +kwstyle+) (reserved nil) 
+  ;		 (error-fn nil)
+  ;		 &allow-other-keys)
+  ;; return zero or more tokens or a sal-error
+  (let ((toks (list t))
+        (start 0)
+        (end (length str))
+        (all-delimiters +whites+)
+	(errf (or error-fn 
+		  (lambda (x) (pperror x) (return-from tokenize x)))))
+    (dolist (x +delimiters+)
+      (push (cadr x) all-delimiters))
+    (do ((beg start)
+	 (pos nil)
+	 (all all-delimiters)
+	 (par 0)
+	 (bra 0)
+	 (brk 0)
+	 (kwo 0)
+	 (tok nil)
+	 (tail toks))
+	((not (< beg end))
+	 ;; since input is complete check parens levels.
+	 (if (= 0 par bra brk kwo)
+	     (if (null (cdr toks))
+		 (list)
+		 (cdr toks))
+	     (unbalanced-input errf str (reverse (cdr toks)) 
+			       par bra brk kwo)))
+      (setq beg (advance-white str +whites+ beg end))
+      (setf tok
+	(read-delimited str :start beg :end end 
+			:white +whites+ :delimit all
+			:skip-initial-white nil :errorf errf))
+      ;; multiple values are returned, so split them here:
+      (setf pos (second tok)) ; pos is the end of the token (!)
+      (setf tok (first tok))
+
+      ;; tok now string, char (delimiter), :eof or token since input
+      ;; is complete keep track of balancing delims
+      (cond ((eql tok +lbrace+) (incf bra))
+	    ((eql tok +rbrace+) (decf bra))
+	    ((eql tok +lparen+) (incf par))
+	    ((eql tok +rparen+) (decf par))
+	    ((eql tok +lbrack+) (incf brk))
+	    ((eql tok +rbrack+) (decf brk))
+	    ((eql tok +kwote+) (setq kwo (mod (+ kwo 1) 2))))
+      (cond ((eql tok ':eof)
+	     (setq beg end))
+	    
+	    (t
+             ;; may have to skip over comments to reach token, so
+             ;; token beginning is computed by backing up from current
+             ;; position (returned by read-delimited) by string length
+             (setf beg (if (stringp tok)
+                           (- pos (length tok))
+                           (1- pos)))
+	     (setq tok (classify-token tok beg str errf
+				       +delimiters+ +operators+
+				       +kwstyle+ reserved))
+             ;(display "classify-token-result" tok)
+	     (setf (cdr tail) (list tok ))
+	     (setf tail (cdr tail))
+	     (setq beg pos))))))
+|#
+
+
+;; old tokenize (above) counted delimiters to check for balance,
+;; but that does not catch constructions like ({)}. I think
+;; we could just leave this up to the parser, but this rewrite
+;; uses a stack to check balanced parens, braces, quotes, etc.
+;; The checking establishes at least some minimal global properties
+;; of the input before evaluating anything, which might be good
+;; even though it's doing some extra work. In fact, using a
+;; stack rather than counts is doing even more work, but the
+;; problem with counters is that some very misleading or just
+;; plain wrong error messages got generated.
+;;
+;; these five delimiter- functions do checks on balanced parens,
+;; braces, and brackets, leaving delimiter-mismatch set to bad
+;; token if there is a mismatch
+(defun delimiter-init ()
+  (setf delimiter-stack nil)
+  (setf delimiter-mismatch nil))
+(defun delimiter-match (tok what)
+  (cond ((eql (token-string (first delimiter-stack)) what)
+         (pop delimiter-stack))
+        ((null delimiter-mismatch)
+         ;(display "delimiter-mismatch" tok)
+         (setf delimiter-mismatch tok))))
+(defun delimiter-check (tok)
+  (let ((c (token-string tok)))
+    (cond ((member c '(#\( #\{ #\[))
+           (push tok delimiter-stack))
+          ((eql c +rbrace+)
+           (delimiter-match tok +lbrace+))
+          ((eql c +rparen+)
+           (delimiter-match tok +lparen+))
+          ((eql c +rbrack+)
+           (delimiter-match tok +lbrack+)))))
+(defun delimiter-error (tok)
+  (errexit (format nil "Unmatched '~A'" (token-string tok))
+           (token-start tok)))
+(defun delimiter-finish ()
+  (if delimiter-mismatch
+      (delimiter-error delimiter-mismatch))
+  (if delimiter-stack
+      (delimiter-error (car delimiter-stack))))
+(defun tokenize (str reserved error-fn)
+  ;; return zero or more tokens or a sal-error
+  (let ((toks (list t))
+        (start 0)
+        (end (length str))
+        (all-delimiters +whites+)
+	(errf (or error-fn 
+		  (lambda (x) (pperror x) (return-from tokenize x)))))
+    (dolist (x +delimiters+)
+      (push (cadr x) all-delimiters))
+    (delimiter-init)
+    (do ((beg start)
+	 (pos nil)
+	 (all all-delimiters)
+	 (tok nil)
+	 (tail toks))
+	((not (< beg end))
+	 ;; since input is complete check parens levels.
+         (delimiter-finish)
+         (if (null (cdr toks)) nil (cdr toks)))
+      (setq beg (advance-white str +whites+ beg end))
+      (setf tok
+	(read-delimited str :start beg :end end 
+			:white +whites+ :delimit all
+			:skip-initial-white nil :errorf errf))
+      ;; multiple values are returned, so split them here:
+      (setf pos (second tok)) ; pos is the end of the token (!)
+      (setf tok (first tok))
+
+      (cond ((eql tok ':eof)
+	     (setq beg end))
+	    (t
+             ;; may have to skip over comments to reach token, so
+             ;; token beginning is computed by backing up from current
+             ;; position (returned by read-delimited) by string length
+             (setf beg (if (stringp tok)
+                           (- pos (length tok))
+                           (1- pos)))
+	     (setq tok (classify-token tok beg str errf
+				       +delimiters+ +operators+
+				       +kwstyle+ reserved))
+             (delimiter-check tok)
+             ;(display "classify-token-result" tok)
+	     (setf (cdr tail) (list tok ))
+	     (setf tail (cdr tail))
+	     (setq beg pos))))))
+
+
+(defun read-delimited (input &key (start 0) end (null-ok t)
+		       (delimit +delims+) ; includes whites...
+		       (white +whites+)
+		       (skip-initial-white t)
+		       (errorf #'pperror))
+  ;; read a substring from input, optionally skipping any white chars
+  ;; first. reading a comment delim equals end-of-line, input delim
+  ;; reads whole input, pound reads next token. call errf if error
+  ;(FORMAT T "~%READ-DELIMITED: ~S :START ~S :END ~S" input start end)
+  (let ((len (or end (length input))))
+    (while t ;; loop over comment lines
+      (when skip-initial-white
+        (setq start (advance-white input white start len)))
+        (if (< start len)
+	  (let ((char (char input start)))
+	    (setq end (search-delim input delimit start len))
+            (if (equal start end)		; have a delimiter
+	       (cond ((char= char +semic+)
+                      ;; comment skips to next line and trys again...
+                      (while (and (< start len)
+                                  (char/= (char input start) #\newline))
+                        (incf start))
+                      (cond ((< start len) ;; advance past comment and iterate
+                             (incf start)
+                             (setf skip-initial-white t))
+                            (null-ok
+                             (return (list ':eof end)))
+                            (t
+                             (errexit "Unexpected end of input"))))
+;		     ((char= char +pound+)
+;		      ;; read # dispatch
+;		      (read-hash input delimit start len errorf))
+		     ((char= char +quote+)
+		      ;; input delim reads whole input
+		      (return (sal:read-string input delimit start len errorf)))
+		     ((char= char +kwote+)
+		      (errexit "Illegal delimiter" start))
+		     (t ;; all other delimiters are tokens in and of themselves
+		      (return (list char (+ start 1)))))
+            ; else part of (equal start end), so we have token before delimiter
+              (return (list (subseq input start end) end))))
+        ; else part of (< start len)...
+	  (if null-ok 
+              (return (list ':eof end))
+	      (errexit "Unexpected end of input" start))))))
+
+
+(defparameter hash-readers 
+  '(( #\t sal:read-bool)
+    ( #\f sal:read-bool)
+    ( #\? read-iftok)
+    ))
+
+
+(defun read-hash (str delims pos len errf)
+  (let ((e (+ pos 1)))
+    (if (< e len)
+	(let ((a (assoc (char str e) hash-readers)))
+	  (if (not a)
+	      (errexit "Illegal # character" e)
+	      (funcall (cadr a) str delims e len errf)))
+	(errexit "Missing # character" pos))))
+
+
+(defun read-iftok (str delims pos len errf)
+  str delims len errf
+  (list (make-token :type ':? :string "#?" :lisp 'if
+			 :start (- pos 1))
+	(+ pos 1)))
+
+; (sal:read-string str start len)
+
+(defun sal:read-bool (str delims pos len errf)
+  delims len errf
+  (let ((end (search-delim str delims pos len)))
+    (unless (= end (+ pos 1))
+      (errexit "Illegal # expression" (- pos 1)))
+    (list (let ((t? (char= (char str pos) #\t) ))
+            (make-token :type ':bool 
+                           :string (if t? "#t" "#f")
+			   :lisp t?
+			   :start (- pos 1)))
+          (+ pos 1))))
+
+
+(defun sal:read-string (str delims pos len errf)
+  (let* ((i (1+ pos)) ; i is index into string; start after open quote
+         c c2; c is the character at str[i]
+         (string (make-string-output-stream)))
+    ;; read string, processing escaped characters
+    ;; write the chars to string until end quote is found
+    ;; then retrieve the string. quotes are not included in result token
+
+    ;; in the loop, i is the next character location to examine
+    (while (and (< i len) 
+                (not (char= (setf c (char str i)) +quote+)))
+      (if (char= c #\\) ;; escape character, does another character follow this?
+          (cond ((< (1+ i) len)
+                 (incf i) ;; yes, set i so we'll get the escaped char
+                 (setf c2 (char str i))
+                 (setf c (assoc c2 `((#\n . #\newline) (#\t . #\tab) 
+                                     (#\r . ,(char "\r" 0))
+                                     (#\f . ,(char "\f" 0)))))
+                 (setf c (if c (cdr c) c2))) ;; use c2 if c wasn't listed
+                (t ;; no, we've hit the end of input too early
+                 (errexit "Unmatched \"" i))))
+      ;; we're good to take this character and move on to the next one
+      (write-char c string)
+      (incf i))
+    ;; done with loop, so either we're out of string or we found end quote
+    (if (>= i len) (errexit "Unmatched \"" i))
+    ;; must have found the quote
+    (setf string (get-output-stream-string string))
+    (list (make-token :type :string :start pos :string string :lisp string)
+          (1+ i))))
+
+;;;
+;;; tokens
+;;;
+
+(defun make-token (&key (type nil) (string "") start (info nil) lisp)
+  (list :token type string start info lisp))
+(setfn token-type cadr)
+(setfn token-string caddr)
+(defun token-start (x) (cadddr x))
+(defun token-info (token) (car (cddddr token)))
+(defun token-lisp (token) (cadr (cddddr token)))
+(defmacro set-token-type (tok val) `(setf (car (cdr ,tok)) ,val))
+(defmacro set-token-lisp (tok val) `(setf (car (cdr (cddddr ,tok))) ,val))
+(defun tokenp (tok) (and (consp tok) (eq (car tok) :token)))
+
+(defun token=? (tok op)
+  (if (tokenp tok)
+      (equal (token-type tok) op)
+      (eql tok op)))
+
+(defmethod token-print (obj stream)
+  (let ((*print-case* ':downcase))
+    (format stream "#<~s ~s>" 
+	    (token-type obj) 
+	    (token-string obj))))
+
+(defun parse-token ()
+  (prog1 (car *sal-tokens*)
+         (setf *sal-tokens* (cdr *sal-tokens*))))
+
+;;;
+;;; token classification. types not disjoint!
+;;;
+
+(defun classify-token (str pos input errf delims ops kstyle res)
+  (let ((tok nil))
+    (cond ((characterp str)
+	   ;; normalize char delimiter tokens
+	   (setq tok (delimiter-token? str pos input errf delims)))
+	  ((stringp str)
+	   (setq tok (or (number-token? str pos input errf)
+			 (operator-token? str pos input errf ops)
+			 (keyword-token? str pos input errf kstyle)
+			 (class-token? str pos input errf res)
+			 (reserved-token? str pos input errf res)
+			 (symbol-token? str pos input errf)
+			 ))
+	   (unless tok
+	     (errexit "Not an expression or symbol" pos)))
+	  (t (setq tok str)))
+    tok))
+
+
+(defun delimiter-token? (str pos input errf delims)
+  (let ((typ (member str delims :test (lambda (a b) (char= a (cadr b))))))
+    ;; member returns remainder of the list
+    ;(display "delimiter-token?" str delims typ)
+    (if (and typ (car typ) (caar typ))
+	(make-token :type (caar typ) :string str
+		       :start pos)
+	(+ (break) (errexit "Shouldn't: non-token delimiter" pos)))))
+
+
+(defun string-to-number (s)
+  (read (make-string-input-stream s)))
+
+
+(defun number-token? (str pos input errf)
+  errf input
+  (do ((i 0 (+ i 1))
+       (len (length str))
+       (c nil)
+       (dot 0)
+       (typ ':int)
+       (sig 0)
+       (sla 0)
+       (dig 0)
+       (non nil))
+      ((or (not (< i len)) non)
+       (if non nil
+	   (if (> dig 0) 
+	       (make-token :type typ :string str
+			      :start pos :lisp (string-to-number str))
+	       nil)))
+    (setq c (char str i))
+    (cond ((member c '(#\+ #\-))
+	   (if (> i 0) (setq non t)
+	       (incf sig)))
+	  ((char= c #\.)
+	   (if (> dot 0) (setq non t)
+	       (if (> sla 0) (setq non t)
+		   (incf dot))))
+; xlisp does not have ratios
+;	  ((char= c #\/)
+;	   (setq typ ':ratio)
+;	   (if (> sla 0) (setq non t)
+;	       (if (= dig 0) (setq non t)
+;		   (if (> dot 0) (setq non t)
+;		       (if (= i (1- len)) (setq non t)
+;			   (incf sla))))))
+	  ((digit-char-p c)
+	   (incf dig)
+	   (if (> dot 0) (setq typ ':float)))
+	  (t (setq non t)))))
+
+#||
+(number-token? "" 0 "" #'pperror)
+(number-token? " " 0 "" #'pperror)
+(number-token? "a"  0 "" #'pperror)
+(number-token? "1" 0 "" #'pperror)
+(number-token? "+" 0 "" #'pperror)
+(number-token? "-1/2" 0 "" #'pperror)
+(number-token? "1." 0 "" #'pperror)
+(number-token? "1.." 0 "" #'pperror)
+(number-token? ".1." 0 "" #'pperror)
+(number-token? ".1" 0 "" #'pperror)
+(number-token? "-0.1" 0 "" #'pperror)
+(number-token? "1/2" 0 "" #'pperror)
+(number-token? "1//2" 0 "" #'pperror)
+(number-token? "/12" 0 "" #'pperror)
+(number-token? "12/" 0 "" #'pperror)
+(number-token? "12/1" 0 "" #'pperror)
+(number-token? "12./1" 0 "" #'pperror)
+(number-token? "12/.1" 0 "" #'pperror)
+||#
+
+(defun operator-token? (str pos input errf ops)
+  ;; tok can be string or char
+  (let ((typ (member str ops :test (lambda (a b) (equal a (cadr b))))))
+    (cond (typ 
+           (setf typ (car typ)) ;; member returns remainder of list
+           (make-token :type (car typ) :string str
+		       :start pos :lisp (or (third typ)
+					    (read-from-string str)))))))
+
+(defun str-to-keyword (str)
+  (intern (strcat ":" (string-upcase str))))
+
+
+(defun keyword-token? (tok pos input errf style)
+  (let* ((tlen (length tok))
+	 (keys (cdr style))
+	 (klen (length keys)))
+    (cond ((not (< klen tlen)) nil)
+	  ((eql (car style) ':prefix)
+	   (do ((i 0 (+ i 1))
+		(x nil))
+	       ((or (not (< i klen)) x)
+		(if (not x)
+		    (let ((sym (symbol-token? (subseq tok i)
+					      pos input errf )))
+		      (cond (sym
+                             (set-token-type sym ':key)
+                             (set-token-lisp sym
+                                (str-to-keyword (token-string sym)))
+                             sym)))
+		    nil))
+	     (unless (char= (char tok i) (nth i keys))
+	       (setq x t))))
+	  ((eql (car style) ':suffix)
+	   (do ((j (- tlen klen) (+ j 1))
+		(i 0 (+ i 1))
+		(x nil))
+	       ((or (not (< i klen)) x)
+		(if (not x)
+		    (let ((sym (symbol-token? (subseq tok 0 (- tlen klen))
+					      pos input errf )))
+		      (cond (sym
+                             (set-token-type sym ':key)
+                             (set-token-lisp sym
+                                (str-to-keyword (token-string sym)))
+                             sym)))
+		    nil))
+	     (unless (char= (char tok j) (nth i keys))
+	       (setq x t)))))))
+
+
+(setfn alpha-char-p both-case-p)
+
+
+(defun class-token? (str pos input errf res)
+  res
+  (let ((a (char str 0)))
+    (if (char= a #\<)
+	(let* ((l (length str))
+	       (b (char str (- l 1))))
+	  (if (char= b #\>)
+	      (let ((tok (symbol-token? (subseq str 1 (- l 1))
+					pos input errf)))
+		;; class token has <> removed!
+		(if tok (progn (set-token-type tok ':class)
+			       tok)
+		    (errexit "Not a class identifer" pos)))
+	      (errexit "Not a class identifer" pos)))
+	nil)))
+
+; (keyword-token? ":asd" '(:prefix #\:))
+; (keyword-token? "asd" KSTYLE)
+; (keyword-token? "asd:"  KSTYLE)
+; (keyword-token? "123:"  KSTYLE)
+; (keyword-token? ":foo" '(:prefix #\:))
+; (keyword-token? "foo=" '(:suffix #\=))
+; (keyword-token? "--foo" '(:prefix #\- #\-))
+; (keyword-token? ":123" '(:suffix #\:))
+; (keyword-token? "--asd" '(:prefix #\-)) ; ok since -asd is legal symbol
+
+
+(defun reserved-token? (str pos input errf reserved)
+  errf input
+  (let ((typ (member str reserved :test (lambda (a b) (equal a (cadr b))))))
+    (if typ 
+	(make-token :type (caar typ) :string str
+		       :start pos)
+	nil)))
+
+
+(defun sal-string-to-symbol (str)
+  (let ((sym (intern (string-upcase str)))
+        sal-sym)
+    (cond ((and sym ;; (it might be "nil")
+                (setf sal-sym (get sym :sal-name)))
+           sal-sym)
+          (t sym))))
+
+
+(putprop 'simrep 'sal-simrep :sal-name)
+(putprop 'seqrep 'sal-seqrep :sal-name)
+
+(defun contains-op-char (s)
+  ;; assume most identifiers are very short, so we search
+  ;; over identifier letters, not over operator characters
+  ;; Minus (-) is so common, we don't complain about it.
+  (dotimes (i (length s))
+    (if (string-search (subseq s i (1+ i)) "*/+=<>!%^&|")
+        (return t))))
+
+(defun test-for-suspicious-symbol (token)
+  ;; assume token is of type :id
+  (let ((sym (token-lisp token))
+        (str (token-string token))
+        (pos (token-start token)))
+    (cond ((and sym  ; nil is not suspicious, but it's not "boundp"
+                (not (fboundp sym)) ; existing functions not suspicious
+                (not (boundp sym))  ; existing globals not suspicious
+                (not (member sym *sal-local-variables*))
+                (contains-op-char str)) ; suspicious if embedded operators
+           (sal-warning
+             (strcat "Identifier contains operator character(s).\n"
+                     "        Perhaps you omitted spaces around an operator")
+             pos)))))
+
+
+(defun symbol-token? (str pos input errf)
+  ;; if a potential symbol is preceded by #, drop the #
+  (if (and (> (length str) 1)
+           (char= (char str 0) #\#))
+      ;; there are a couple of special cases: SAL defines #f and #?
+      (cond ((equal str "#f")
+             (return-from symbol-token?
+               (make-token :type ':id :string str :start pos :lisp nil)))
+            ((equal str "#?")
+             (return-from symbol-token?
+               (make-token :type ':id :string str :start pos :lisp 'if)))
+            (t
+             (setf str (subseq str 1)))))
+  ;; let's insist on at least one letter for sanity's sake
+  ;; exception: allow '-> because it is used in markov pattern specs
+  (do ((i 0 (+ i 1))  ; i is index into string
+       (bad "Not an expression or symbol")
+       (chr nil)
+       (ltr 0)        ; ltr is count of alphabetic letters in string
+       (dot nil)      ; dot is index of "."
+       (pkg nil)      ; pkg is index if package name "xxx:" found
+       (len (length str))
+       (err nil))
+      ;; loop ends when i is at end of string or when err is set
+      ((or (not (< i len)) err)
+       (if (or (> ltr 0) ; must be at least one letter, or
+               (equal str "->")) ; symbol can be "->"
+	   (let ((info ()) sym)
+	     (if pkg (push (cons ':pkg pkg) info))
+	     (if dot (push (cons ':slot dot) info))	     
+             ;(display "in symbol-token?" str)
+             (setf sym (sal-string-to-symbol str))
+	     (make-token :type ':id :string str
+			    :info info :start pos
+                            :lisp sym))
+	   nil))
+    (setq chr (char str i))
+    (cond ((alpha-char-p chr) (incf ltr))
+; need to allow arbitrary lisp symbols
+;	  ((member chr '(#\* #\+)) ;; special variable names can start/end 
+;	   (if (< 0 i (- len 2))   ;; with + or *
+;	       (errexit bad pos)))
+	  ((char= chr #\/) ;; embedded / is not allowed
+	   (errexit bad pos))
+	  ;((char= chr #\-) ;; hyphens are allowed anywhere in symbol
+	  ; (if (= ltr 0) 
+	  ;     (errexit errf input bad pos )
+	  ;     (setq ltr 0)
+	  ;     ))
+	  ((char= chr #\:)
+           ; allowable forms are :foo, foo:bar, :foo:bar
+	   (if (> i 0) ;; lisp keyword symbols ok
+	       (cond ((= ltr 0)
+		      (errexit bad pos))
+		     ((not pkg)
+		      (setq pkg i))
+		     (t (errexit errf input
+				 (format nil "Too many colons in ~s" str)
+				 pos))))
+	   (setq ltr 0))
+	  ((char= chr #\.)
+	   (if (or dot (= i 0) (= i (- len 1)))
+	       (errexit bad pos)
+	       (progn (setq dot i) (setq ltr 0)))))))
+
+
+; (let ((i "foo")) (symbol-token? i 0 i #'pperror))
+; (let ((i "foo..bar")) (symbol-token? i 0 i #'pperror))
+; (let ((i ".bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "bar.")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "1...")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "a1..." )) (symbol-token? i 0 i #'pperror))
+; (let ((i  "a{b")) (symbol-token? i 0 i #'pperror))
+; (let ((i "foo-bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "123-a")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "1a23-a")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "*foo*")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "+foo+")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "foo+bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "foo/bar")) (symbol-token?  i 0 i #'pperror))
+
+; (let ((i ":bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "::bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "foo:bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "cl-user:bar")) (symbol-token?  i 0 i #'pperror))
+; (let ((i "cl-user::bar")) (symbol-token?  i 0 i #'pperror))
+; (tokenize "aaa + bbb \"asdasdd\" aaa(1,2,3)")
+; (tokenize "aaa+bbb \"asdasdd\" aaa(1,2,3)")
+
+
+(setf *in-sal-parser* nil)
+
+;; line number info for debugging
+(setf *sal-line-number-info* t)
+(setf *sal-line* 0)
+
+(defun add-line-info-to-expression (expr token)
+  (let (line-no)
+    (cond ((and token ;; null token means do not change expr
+                *sal-line-number-info* ;; is this feature enabled?
+                (stringp *sal-input-text*))
+           ;; first, get line number
+           (setf line-no (pos-to-line (token-start token) *sal-input-text*))
+           `(prog2 (setf *sal-line* ,line-no) ,expr))
+          (t expr))))
+
+;; single statement is handled just like an expression
+(setfn add-line-info-to-stmt add-line-info-to-expression)
+
+;; list of statements is simple to handle: prepend SETF
+(defun add-line-info-to-stmts (stmts token)
+  (let (line-no)
+    (cond ((and *sal-line-number-info* ;; is this feature enabled?
+                (stringp *sal-input-text*))
+           (setf line-no (pos-to-line (token-start token) *sal-input-text*))
+           (cons `(setf *sal-line* ,line-no) stmts))
+          (t stmts))))
+
+
+;; PARSE-ERROR -- print error message, return from top-level
+;;
+(defun parse-error (e)
+  (unless (sal-error-line e)
+    (setf (sal-error-line e) *sal-input*))
+  (pperror e)
+  (return-from sal-parse (values nil e *sal-tokens*)))
+
+
+;; SAL-PARSE -- parse string or token input, translate to Lisp
+;;
+;; If input is text, *sal-input-text* is set to the text and
+;;   read later (maybe) by ERREXIT. 
+;; If input is a token list, it is assumed these are leftovers
+;;   from tokenized text, so *sal-input-text* is already valid.
+;; *Therfore*, do not call sal-parse with tokens unless 
+;;   *sal-input-text* is set to the corresponding text.
+;;
+(defun sal-parse (grammar pat input multiple-statements file)
+  (progv '(*sal-input-file-name*) (list file)
+    (let (rslt expr rest)
+      ; ignore grammar and pat (just there for compatibility)
+      ; parse input and return lisp expression
+      (cond ((stringp input)
+             (setf *sal-input-text* input)
+             (setq input (tokenize input *reserved-words* #'parse-error))))
+      (setf *sal-input* input) ;; all input
+      (setf *sal-tokens* input) ;; current input
+      (cond ((null input)
+             (values t nil nil)) ; e.g. comments compile to nil
+            (t
+             (setf rslt (or (maybe-parse-command)
+                            (maybe-parse-block)
+                            (maybe-parse-conditional)
+                            (maybe-parse-assignment)
+                            (maybe-parse-loop)
+                            (maybe-parse-exec)
+                            (maybe-parse-exit)
+                            (errexit "Syntax error")))
+             ;; note: there is a return-from parse in parse-error that
+             ;; returns (values nil error <unparsed-tokens>)
+             (cond ((and *sal-tokens* (not multiple-statements))
+                    (errexit "leftover tokens")))
+                    ;((null rslt)
+                    ; (errexit "nothing to compile")))
+             (values t rslt *sal-tokens*))))))
+
+
+;; TOKEN-IS -- test if the type of next token matches expected type(s)
+;;
+;; type can be a list of possibilities or just a symbol
+;; Usually, suspicious-id-warn is true by default, and any symbol
+;; with embedded operator symbols, e.g. x+y results in a warning
+;; that this is an odd variable name. But if the symbol is declared
+;; as a local, a parameter, a function name, or a global variable,
+;; then the warning is supressed.
+;;
+(defun token-is (type &optional (suspicious-id-warn t))
+  (let ((token-type
+         (if *sal-tokens* (token-type (car *sal-tokens*)) nil))
+        rslt)
+    ; input can be list of possible types or just a type:
+    (setf rslt (or (and (listp type) 
+                        (member token-type type))
+                   (and (symbolp type) (eq token-type type))))
+    ; test if symbol has embedded operator characters:
+    (cond ((and rslt suspicious-id-warn (eq token-type :id))
+           (test-for-suspicious-symbol (car *sal-tokens*))))
+    rslt))
+
+
+(defun maybe-parse-command ()
+  (if (token-is '(:define :load :chdir :variable :function
+                  ;  :system 
+                  :play :print :display))
+      (parse-command)))
+
+
+(defun parse-command ()
+  (cond ((token-is '(:define :variable :function))
+         (parse-declaration))
+        ((token-is :load)
+         (parse-load))
+        ((token-is :chdir)
+         (parse-chdir))
+        ((token-is :play)
+         (parse-play))
+;        ((token-is :system)
+;         (parse-system))
+        ((token-is :print)
+         (parse-print-display :print 'sal-print))
+        ((token-is :display)
+         (parse-print-display :display 'display))
+;        ((token-is :output)
+;         (parse-output))
+        (t
+         (errexit "Command not found"))))
+
+
+(defun parse-stmt ()
+  (cond ((token-is :begin)
+         (parse-block))
+        ((token-is '(:if :when :unless))
+         (parse-conditional))
+        ((token-is :set)
+         (parse-assignment))
+        ((token-is :loop)
+         (parse-loop))
+        ((token-is :print)
+         (parse-print-display :print 'sal-print))
+        ((token-is :display)
+         (parse-print-display :display 'display))
+;        ((token-is :output)
+;         (parse-output))
+        ((token-is :exec)
+         (parse-exec))
+        ((token-is :exit)
+         (parse-exit))
+        ((token-is :return)
+         (parse-return))
+        ((token-is :load)
+         (parse-load))
+        ((token-is :chdir)
+         (parse-chdir))
+;        ((token-is :system)
+;         (parse-system))
+        ((token-is :play)
+         (parse-play))
+        (t
+         (errexit "Command not found"))))
+        
+
+;; GET-PARM-NAMES -- given parms like (a b &key (x 1) (y 2)),
+;;   return list of parameters: (a b x y)
+(defun get-parm-names (parms)
+  (let (rslt)
+    (dolist (p parms)
+      (cond ((symbolp p) 
+             (if (eq p '&key) nil (push p rslt)))
+            (t (push (car p) rslt))))
+    (reverse rslt)))
+
+
+;; RETURNIZE -- make a statement (list) end with a sal-return-from
+;;
+;;   SAL returns nil from begin-end statement lists
+;;
+(defun returnize (stmt)
+  (let (rev)
+    (setf rev (reverse stmt))
+    (setf expr (car rev)) ; last expression in list
+    (cond ((and (consp expr) (eq (car expr) 'sal-return-from))
+           stmt) ; already ends in sal-return-from
+          (t
+           (reverse (cons (list 'sal-return-from *sal-fn-name* nil)
+                          rev))))))
+
+
+(defun parse-declaration ()
+  (if (token-is :define) (parse-token)) ; SAL extension: "define" is optional
+  (let (bindings setf-args formals parms stmt locals loc)
+    (cond ((token-is :variable)
+           (setf bindings (parse-bindings))
+           (setf loc *rslt*) ; the "variable" token
+           (dolist (b bindings)
+             (cond ((symbolp b)
+                    (push b setf-args)
+                    (push `(if (boundp ',b) ,b) setf-args))
+                   (t
+                    (push (first b) setf-args)
+                    (push (second b) setf-args))))
+           (add-line-info-to-stmt (cons 'setf (reverse setf-args)) loc))
+          ((token-is :function)
+           (parse-token)
+           (if (token-is :id nil)
+               (setf *sal-fn-name* (token-lisp (parse-token)))
+               (errexit "function name expected here"))
+           (setf locals *sal-local-variables*)
+           (setf formals (parse-parms))
+           (setf stmt (parse-stmt))
+           ;; stmt may contain a return-from, so make this a progn or prog*
+           (cond ((and (consp stmt) 
+                       (not (eq (car stmt) 'progn))
+                       (not (eq (car stmt) 'prog*)))
+                  (setf stmt (list 'progn stmt))))
+           ;; need return to pop traceback stack
+           (setf stmt (returnize stmt))
+           ;; get list of parameter names
+           (setf parms (get-parm-names formals))
+           (setf *sal-local-variables* locals)
+           ;; build the defun
+           (prog1 (list 'defun *sal-fn-name* formals 
+                        (list 'sal-trace-enter 
+                              (list 'quote *sal-fn-name*) 
+                              (cons 'list parms)
+                              (list 'quote parms))
+                        stmt)
+                  (setf *sal-fn-name* nil)))
+          (t
+           (errexit "bad syntax")))))
+
+
+(defun parse-one-parm (kargs)
+  ;; kargs is a flag indicating previous parameter was a keyword (all
+  ;;   the following parameters must then also be keyword parameters)
+  ;; returns: (<keyword> <default>) or (nil <identifier>)
+  ;;   where <keyword> is a keyward parameter name (nil if not a keyword parm)
+  ;;         <default> is an expression for the default value
+  ;;         <identifier> is the parameter name (if not a keyword parm)
+  (let (key default-value id)
+    (cond ((and kargs (token-is :id))
+           (errexit "positional parameter not allowed after keyword parameter"))
+          ((token-is :id)
+           ;(display "parse-one-1" (token-is :id) (car *sal-tokens*))
+           (setf id (token-lisp (parse-token)))
+           (push id *sal-local-variables*)
+           (list nil id))
+          ((token-is :key)
+           (setf key (sal-string-to-symbol (token-string (parse-token))))
+           (cond ((or (token-is :co) (token-is :rp))) ; no default value
+                 (t
+                  (setf default-value (parse-sexpr))))
+           (list key default-value)) 
+          (kargs
+           (errexit "expected keyword name"))
+          (t
+           (errexit "expected parameter name")))))
+
+
+(defun parse-parms ()
+  ;(display "parse-parms" *sal-tokens*)
+  (let (parms parm kargs expecting)
+    (if (token-is :lp)
+        (parse-token) ;; eat the left paren
+        (errexit "expected left parenthesis"))
+    (setf expecting (not (token-is :rp)))
+    (while expecting
+      (setf parm (parse-one-parm kargs))
+      ;(display "parm" parm)
+      ;; returns list of (kargs . parm)
+      (if (and (car parm) (not kargs)) ; kargs just set
+          (push '&key parms))
+      (setf kargs (car parm))
+      ;; normally push the <id>; for keyword parms, push id and default value
+      (push (if kargs parm (cadr parm)) parms)
+      (if (token-is :co)
+          (parse-token)
+          (setf expecting nil)))
+    (if (token-is :rp) (parse-token)
+        (errexit "expected right parenthesis"))
+    ;(display "parse-parms" (reverse parms))
+    (reverse parms)))
+
+
+(defun parse-bindings ()
+  (let (bindings bind)
+    (setf *rslt* (parse-token)) ; skip "variable" or "with"
+      ; return token as "extra" return value
+    (setf bind (parse-bind))
+    (push (if (second bind) bind (car bind))
+          bindings)
+    (while (token-is :co)
+      (parse-token)
+      (setf bind (parse-bind))
+      ;; if non-nil initializer, push (id expr)
+      (push (if (second bind) bind (car bind))
+            bindings))
+    (reverse bindings)))
+
+
+(defun parse-bind ()
+  (let (id val)
+    (if (token-is :id nil)
+        (setf id (token-lisp (parse-token)))
+        (errexit "expected a variable name"))
+    (cond ((token-is :=)
+           (parse-token)
+           (setf val (parse-sexpr))))
+    (push id *sal-local-variables*)
+    (list id val)))
+
+
+(defun parse-chdir ()
+  ;; assume next token is :chdir
+  (or (token-is :chdir) (error "parse-chdir internal error"))
+  (let (path loc)
+   (setf loc (parse-token))
+   (setf path (parse-path))
+   (add-line-info-to-stmt (list 'setdir path) loc)))
+
+
+(defun parse-play ()
+ ;; assume next token is :play
+ (or (token-is :play) (error "parse-play internal error"))
+ (let ((loc (parse-token)))
+   (add-line-info-to-stmt (list 'sal-play (parse-sexpr)) loc)))
+
+
+(defun parse-return ()
+  (or (token-is :return) (error "parse-return internal error"))
+  (let (loc)
+    (if (null *sal-fn-name*)
+        (errexit "Return must be inside a function body"))
+    (setf loc (parse-token))
+    (add-line-info-to-stmt (list 'sal-return-from *sal-fn-name*
+                                 (parse-sexpr)) loc)))
+
+
+(defun parse-load ()
+  ;; assume next token is :load
+  (or (token-is :load) (error "parse-load internal error"))
+  (let (path args loc)
+   (setf loc (parse-token))
+   (setf path (parse-path)) ; must return path or raise error
+   (setf args (parse-keyword-args))
+   (add-line-info-to-stmt (cons 'sal-load (cons path args)) loc)))
+
+(defun parse-keyword-args ()
+  (let (args)
+    (while (token-is :co)
+      (parse-token)
+      (cond ((token-is :key)
+             (push (token-value) args)
+             (push (parse-sexpr) args))))
+    (reverse args)))
+
+
+'(defun parse-system ()
+  ;; assume next token is :system
+  (or (token-is :system) (error "parse-system internal error"))
+  (let (path arg args)
+   (parse-token)
+   (setf path (parse-sexpr))
+   (list 'sal-system path)))
+
+
+(defun parse-path ()
+  (if (token-is '(:id :string))
+      (token-lisp (parse-token))
+      (errexit "path not found")))
+
+
+(defun parse-print-display (token function)
+  ;; assumes next token is :print
+  (or (token-is token) (error "parse-print-display internal error"))
+  (let (args arg loc)
+   (setf loc (parse-token))
+   (setf arg (parse-sexpr))
+   (setf args (list arg))
+   (while (token-is :co)
+    (parse-token) ; remove and ignore the comma
+    (setf arg (parse-sexpr))
+    (push arg args))
+   (add-line-info-to-stmt (cons function (reverse args)) loc)))
+
+
+;(defun parse-output ()
+; ;; assume next token is :output
+; (or (token-is :output) (error "parse-output internal error"))
+; (parse-token)
+; (list 'sal-output (parse-sexpr)))
+
+
+(defun maybe-parse-block ()
+  (if (token-is :begin) (parse-block)))
+
+
+(defun parse-block ()
+  ;; assumes next token is :block
+  (or (token-is :begin) (error "parse-block internal error"))
+  (let (args stmts (locals *sal-local-variables*))
+   (parse-token)
+   (cond ((token-is :with)
+          (setf args (parse-bindings))))
+   (while (not (token-is :end))
+    (push (parse-stmt) stmts))
+   (parse-token)
+   (setf stmts (reverse stmts))
+   ;(display "parse-block" args stmts)
+   (setf *sal-local-variables* locals)
+   (cons 'prog* (cons args stmts))))
+
+ 
+;; MAKE-STATEMENT-LIST -- convert stmt to a stmt list
+;;
+;; if it is a (PROGN ...) then return cdr -- it's already a list
+;; otherwise, put single statement into a list
+;;
+(defun make-statement-list (stmt)
+  (cond ((atom stmt)
+         (list stmt))
+        ((eq (car stmt) 'progn)
+         (cdr stmt))
+        (t
+         (list stmt))))
+
+(setf *conditional-tokens* '(:if :when :unless))
+
+
+(defun maybe-parse-conditional ()
+  (if (token-is *conditional-tokens*)
+      (parse-conditional)))
+
+
+(defun parse-conditional ()
+  ;; assumes next token is :if
+  (or (token-is *conditional-tokens*)
+      (error "parse-conditional internal error"))
+  (let (test then-stmt else-stmt if-token)
+    (cond ((token-is :if)
+           (setf if-token (parse-token))
+           (setf test (parse-sexpr if-token))
+           (if (not (token-is :then))
+               (errexit "expected then after if"))
+           (parse-token)
+           (if (not (token-is :else)) ;; no then statement
+               (setf then-stmt (parse-stmt)))
+           (cond ((token-is :else)
+                  (parse-token)
+                  (setf else-stmt (parse-stmt))))
+           ;(display "cond" test then-stmt else-stmt)
+           (if else-stmt
+               (list 'if test then-stmt else-stmt)
+               (list 'if test then-stmt)))
+          ((token-is :when)
+           (parse-token)
+           (setf test (parse-sexpr))
+           (setf then-stmt (parse-stmt))
+           (cons 'when (cons test (make-statement-list then-stmt))))
+          ((token-is :unless)
+           (parse-token)
+           (setf test (parse-sexpr))
+           (setf else-stmt (parse-stmt))
+           (cons 'unless (cons test (make-statement-list else-stmt)))))))
+
+
+(defun maybe-parse-assignment ()
+  (if (token-is :set) (parse-assignment)))
+
+
+(defun parse-assignment ()
+  ;; first token must be set
+  (or (token-is :set) (error "parse-assignment internal error"))
+  (let (assignments rslt vref op expr set-token)
+    (setf set-token (parse-token))
+    (push (parse-assign) assignments) ; returns (target op value)
+    (while (token-is :co)
+      (parse-token) ; skip the comma
+      (push (parse-assign) assignments))
+    ; now assignments is ((target op value) (target op value)...)
+    (dolist (assign assignments)
+      (setf vref (first assign) op (second assign) expr (third assign))
+      (cond ((eq op '=))
+            ((eq op '-=) (setf expr `(diff ,vref ,expr)))
+            ((eq op '+=) (setf expr `(sum ,vref ,expr)))
+	    ((eq op '*=) (setq expr `(mult ,vref ,expr)))
+	    ((eq op '/=) (setq expr `(/ ,vref ,expr)))
+	    ((eq op '&=) (setq expr `(nconc ,vref (list ,expr))))
+	    ((eq op '@=) (setq expr `(cons ,expr ,vref)))
+            ((eq op '^=) (setq expr `(nconc ,vref (copy-list ,expr))))
+	    ((eq op '<=) (setq expr `(min ,vref ,expr)))
+	    ((eq op '>=) (setq expr `(max ,vref ,expr)))
+	    (t (errexit (format nil "unknown assigment operator ~A" op))))
+      (push (list 'setf vref expr) rslt))
+    (setf rslt (add-line-info-to-stmts rslt set-token))
+    (if (> (length rslt) 1)
+        (cons 'progn rslt)
+        (car rslt))))
+
+    
+;; PARSE-ASSIGN -- based on parse-bind, but with different operators
+;;
+;; allows arbitrary term on left because it could be an array
+;; reference. After parsing, we can check that the target of the
+;; assignment is either an identifier or an (aref ...)
+;;
+(defun parse-assign ()
+  (let ((lhs (parse-term) op val))
+    (cond ((token-is '(:= :-= :+= :*= :/= :&= :@= :^= :<= :>=))
+           (setf op (parse-token))
+           (setf op (if (eq (token-type op) ':=) '= (token-lisp op)))
+           (setf val (parse-sexpr))))
+    (cond ((and (consp lhs) (eq (car lhs) 'aref))) ;; aref good
+          ((symbolp lhs)) ;; id good
+          (t (errexit "expected a variable name or array reference")))
+    (list lhs op val)))
+
+
+(defun maybe-parse-loop ()
+  (if (token-is :loop) (parse-loop)))
+
+
+;; loops are compiled to do*
+;; bindings go next as usual, but bindings include for variables
+;; and repeat is converted to a for +count+ from 0 to <sexpr>
+;; stepping is done after statement
+;; termination clauses are combined with OR and
+;; finally goes after termination
+;; statement goes in do* body
+;;
+(defun parse-loop ()
+  (or (token-is :loop) (error "parse-loop: internal error"))
+  (let (bindings termination-tests stmts sexpr rslt finally
+        loc
+        (locals *sal-local-variables*))
+    (parse-token) ; skip "loop"
+    (if (token-is :with)
+        (setf bindings (reverse (parse-bindings))))
+    (while (token-is '(:repeat :for))
+      (cond ((token-is :repeat)
+             (setf loc (parse-token))
+             (push (list 'sal:loopcount 0 '(1+ sal:loopcount)) bindings)
+             (setf sexpr (parse-sexpr loc)) ; get final count expression
+             (push (list 'sal:loopfinal sexpr) bindings)
+             (push '(>= sal:loopcount sal:loopfinal) termination-tests))
+            ((token-is :for)
+             (setf rslt (parse-for-clause))
+             ; there can be multiple bindings, build bindings in reverse
+             (cond ((first rslt)
+                    (setf bindings (append (reverse (first rslt))
+                                           bindings))))
+             (if (second rslt) (push (second rslt) termination-tests)))))
+    (while (token-is '(:while :until))
+      (cond ((token-is :while)
+             (setf loc (parse-token))
+             (push (list 'not (parse-sexpr loc)) termination-tests))
+            ((token-is :until)
+             (setf loc (parse-token))
+             (push (parse-sexpr loc) termination-tests))))
+    ; (push (parse-stmt) stmts)
+    (while (not (token-is '(:end :finally)))
+      (push (parse-stmt) stmts))
+    (cond ((token-is :finally)
+           (parse-token) ; skip "finally"
+           (setf finally (parse-stmt))))
+    (if (token-is :end)
+        (parse-token)
+        (errexit "expected end after loop"))
+    (setf *sal-local-variables* locals)
+    `(do* ,(reverse bindings)
+          ,(list (or-ize (reverse termination-tests)) finally) 
+          ,@(reverse stmts))))
+
+
+;; OR-IZE -- compute the OR of a list of expressions
+;;
+(defun or-ize (exprs)
+ (if (> 1 (length exprs)) (cons 'or exprs)
+     (car exprs)))
+
+
+(defun maybe-parse-exec ()
+  (if (token-is :exec) (parse-exec)))
+
+
+(defun parse-exec ()
+  (or (token-is :exec) (error "parse-exec internal error"))
+  (let ((loc (parse-token))) ;  skip the :exec
+    (parse-sexpr loc)))
+          
+
+(defun maybe-parse-exit ()
+  (if (token-is :exit) (parse-exit)))
+
+
+(defun parse-exit ()
+  (let (tok loc)
+    (or (token-is :exit) (error "parse-exit internal error"))
+    (setf loc (parse-token)) ; skip the :exit
+    (cond ((token-is :id)
+           (setf tok (parse-token))
+           (cond ((eq (token-lisp tok) 'nyquist)
+                  (add-line-info-to-stmt '(exit) loc))
+                 ((eq (token-lisp tok) 'sal)
+                  (add-line-info-to-stmt '(sal-exit) loc))
+                 (t
+                  (errexit "expected \"nyquist\" or \"sal\" after \"exit\""))))
+          (t
+           (add-line-info-to-stmt '(sal-exit) loc)))))
+
+
+;; PARSE-FOR-CLAUSE - returns (bindings term-test)
+;;
+(defun parse-for-clause ()
+  (or (token-is :for) (error "parse-for-clause: internal error"))
+  (let (id init next rslt binding term-test list-id loc)
+    (setf loc (parse-token)) ; skip for
+    (if (token-is :id)
+        (setf id (token-lisp (parse-token)))
+        (errexit "expected identifier after for"))
+    (cond ((token-is :=)
+           ;; if the clause is just for id = expr, then assume that
+           ;; expr depends on something that changes each iteration:
+           ;; recompute and assign expr to id each time around
+           (parse-token) ; skip "="
+           (setf init (parse-sexpr loc))
+           (cond ((token-is :then)
+                  (parse-token) ; skip "then"
+                  (setf binding (list id init (parse-sexpr loc))))
+                 (t
+                  (setf binding (list id init init))))
+           (setf binding (list binding)))
+          ((token-is :in)
+           (setf loc (parse-token)) ; skip "in"
+           (setf list-id (intern (format nil "SAL:~A-LIST" id)))
+           (setf binding 
+                 (list (list list-id (parse-sexpr loc)
+                             (list 'cdr list-id))
+                       (list id (list 'car list-id) (list 'car list-id))))
+           (setf term-test (list 'null list-id)))
+          ((token-is :over)
+           (setf loc (parse-token)) ; skip "over"
+           (setf start (parse-sexpr loc))
+#|         (cond ((token-is :by)
+                  (parse-token) ; skip "by"
+                  (parse-sexpr))) ;-- I don't know what "by" means - RBD |#
+           (setf list-id (intern (format nil "SAL:~A-PATTERN" id)))
+           (setf binding
+                 (list (list list-id start)
+                       (list id (list 'next list-id) (list 'next list-id)))))
+          ((token-is '(:from :below :to :above :downto :by))
+           (cond ((token-is :from)
+                  (setf loc (parse-token)) ; skip "from"
+                  (setf init (parse-sexpr loc)))
+                 (t
+                  (setf init 0)))
+           (cond ((token-is :below)
+                  (setf loc (parse-token)) ; skip "below"
+                  (setf term-test (list '>= id (parse-sexpr loc))))
+                 ((token-is :to)
+                  (setf loc (parse-token)) ; skip "to"
+                  (setf term-test (list '> id (parse-sexpr loc))))
+                 ((token-is :above)
+                  (setf loc (parse-token)) ; skip "above"
+                  (setf term-test (list '<= id (parse-sexpr loc))))
+                 ((token-is :downto)
+                  (setf loc (parse-token)) ; skip "downto"
+                  (setf term-test (list '< id (parse-sexpr loc)))))
+           (cond ((token-is :by)
+                  (setf loc (parse-token)) ; skip "by"
+                  (setf binding (list id init (list '+ id (parse-sexpr loc)))))
+                 ((or (null term-test)
+                      (and term-test (member (car term-test) '(>= >))))
+                  (setf binding (list id init (list '1+ id))))
+                 (t ; loop goes down because of "above" or "downto"
+                  (display "for step" term-test)
+                  (setf binding (list id init (list '1- id)))))
+           (setf binding (list binding)))
+          (t
+           (errexit "for statement syntax error")))
+    (list binding term-test)))
+
+    
+;; parse-sexpr works by building a list: (term op term op term ...)
+;; later, the list is parsed again using operator precedence rules
+(defun parse-sexpr (&optional loc)
+  (let (term rslt)
+    (push (parse-term) rslt)
+    (while (token-is *sal-operators*)
+      (push (token-type (parse-token)) rslt)
+      (push (parse-term) rslt))
+    (setf rslt (reverse rslt))
+    ;(display "parse-sexpr before inf->pre" rslt)
+    (setf rslt (if (consp (cdr rslt))
+                (inf->pre rslt)
+                (car rslt)))
+    (if loc
+        (setf rslt (add-line-info-to-expression rslt loc)))
+    rslt))
+
+
+(defun get-lisp-op (op)
+  (third (assoc op +operators+)))
+
+
+;; a term is <unary-op> <term>, or
+;;           ( <sexpr> ), or
+;;           ? ( <sexpr> , <sexpr> , <sexpr> ), or
+;;           <id>, or
+;;           <id> ( <args> ), or
+;;           <term> [ <sexpr> ]
+;; Since any term can be followed by indexing, handle everything
+;; but the indexing here in parse-term-1, then write parse-term
+;; to do term-1 followed by indexing operations
+;;
+(defun parse-term-1 ()
+  (let (sexpr id)
+    (cond ((token-is '(:- :!))
+           (list (token-lisp (parse-token)) (parse-term)))
+          ((token-is :lp)
+           (parse-token) ; skip left paren
+           (setf sexpr (parse-sexpr))
+           (if (token-is :rp)
+               (parse-token)
+               (errexit "right parenthesis not found"))
+           sexpr)
+          ((token-is :?)
+           (parse-ifexpr))
+          ((token-is :lc)
+           (list 'quote (parse-list)))
+          ((token-is '(:int :float :bool :list :string))
+           ;(display "parse-term int float bool list string" (car *sal-tokens*))
+           (token-lisp (parse-token)))
+          ((token-is :id) ;; aref or funcall
+           (setf id (token-lisp (parse-token)))
+           ;; array indexing was here, but that only allows [x] after
+           ;; identifiers. Move this to expression parsing.
+           (cond ((token-is :lp)
+                  (parse-token)
+                  (setf sexpr (cons id (parse-pargs t)))
+                  (if (token-is :rp)
+                      (parse-token)
+                      (errexit "right paren not found"))
+                  sexpr)
+                 (t id)))
+          (t
+           (errexit "expression not found")))))
+
+
+(defun parse-term ()
+  (let ((term (parse-term-1)))
+    ; (display "parse-term" term (token-is :lb))
+    (while (token-is :lb)
+      (parse-token)
+      (setf term (list 'aref term (parse-sexpr)))
+      (if (token-is :rb)
+          (parse-token)
+          (errexit "right bracket not found")))
+    term))
+
+
+(defun parse-ifexpr ()
+  (or (token-is :?) (error "parse-ifexpr internal error"))
+  (let (condition then-sexpr else-sexpr)
+    (parse-token) ;  skip the :?
+    (if (token-is :lp) (parse-token) (errexit "expected left paren"))
+    (setf condition (parse-sexpr))
+    (if (token-is :co) (parse-token) (errexit "expected comma"))
+    (setf then-sexpr (parse-sexpr))
+    (if (token-is :co) (parse-token) (errexit "expected comma"))
+    (setf else-sexpr (parse-sexpr))
+    (if (token-is :rp) (parse-token) (errexit "expected left paren"))
+    (list 'if condition then-sexpr else-sexpr)))
+
+
+(defun keywordp (s)
+  (and (symbolp s) (eq (type-of (symbol-name s)) 'string)
+       (equal (char (symbol-name s) 0) #\:)))
+
+
+(defun functionp (x) (eq (type-of x) 'closure))
+
+
+(defun parse-pargs (keywords-allowed)
+  ;; get a list of sexprs. If keywords-allowed, then at any point
+  ;; the arg syntax can switch from [<co> <sexpr>]* to
+  ;; [<co> <keyword> <sexpr>]*
+  ;; also if keywords-allowed, it's a function call and the
+  ;; list may be empty. Otherwise, it's a list of indices and
+  ;; the list may not be empty
+  (let (pargs keyword-expected sexpr keyword)
+   (if (and keywords-allowed (token-is :rp))
+       nil ; return empty parameter list
+       (loop ; look for one or more [keyword] sexpr
+         ; optional keyword test
+         (setf keyword nil)
+         ;(display "pargs" (car *sal-tokens*))
+         (if (token-is :key)
+             (setf keyword (token-lisp (parse-token))))
+         ; (display "parse-pargs" keyword)
+         ; did we need a keyword?
+         (if (and keyword-expected (not keyword))
+             (errexit "expected keyword"))
+         ; was a keyword legal
+         (if (and keyword (not keywords-allowed))
+             (errexit "keyword not allowed here"))
+         (setf keyword-expected keyword) ; once we get a keyword, we need
+                                         ; one before each sexpr
+         ; now find sexpr
+         (setf sexpr (parse-sexpr))
+         (if keyword (push keyword pargs))
+         (push sexpr pargs)
+         ; (display "parse-pargs" keyword sexpr pargs)
+         (cond ((token-is :co)
+                (parse-token))
+               (t
+                (return (reverse pargs))))))))
+
+
+;; PARSE-LIST -- parse list in braces {}, return list not quoted list
+;;
+(defun parse-list ()
+  (or (token-is :lc) (error "parse-list internal error"))
+  (let (elts)
+    (parse-token)
+    (while (not (token-is :rc))
+           (cond ((token-is '(:int :float :id :bool :key :string))
+                  (push (token-lisp (parse-token)) elts))
+                 ((token-is :lc)
+                  (push (parse-list) elts))
+                 (t
+                  (errexit "expected list element or right brace"))))
+    (parse-token)
+    (reverse elts)))
+
+
+(defparameter *op-weights*
+  '(
+    (:\| 1)
+    (:& 2)
+    (:! 3)
+    (:= 4)
+    (:!= 4)
+    (:> 4)
+    (:>= 4)
+    (:< 4)
+    (:<= 4)
+    (:~= 4) ; general equality
+    (:+ 5)
+    (:- 5)
+    (:% 5)
+    (:* 6)
+    (:/ 6)
+    (:^ 7)
+    (:~ 8)
+    (:~~ 8)
+    (:@ 8)
+    (:@@ 8)))
+
+
+(defun is-op? (x)
+  ;; return op weight if x is operator
+  (let ((o (assoc (if (listp x) (token-type x) x)
+		 *op-weights*)))
+    (and o (cadr o))))
+
+
+(defun inf->pre (inf)
+  ;; this does NOT rewrite subexpressions because parser applies rules
+  ;; depth-first so subexprs are already processed
+  (let (op lh rh w1)
+    (if (consp inf)
+	(do ()
+	    ((null inf) lh)
+	  (setq op (car inf))		; look at each element of in
+          (pop inf)
+	  (setq w1 (is-op? op))
+	  (cond ((numberp w1)		; found op (w1 is precedence)
+		 (do ((w2 nil)
+		      (ok t)
+		      (li (list)))
+		     ((or (not inf) (not ok))
+		      (setq rh (inf->pre (nreverse li)))
+		      (setq lh (if lh (list (get-lisp-op op) lh rh)
+				   (list (get-lisp-op op) rh nil))))
+		   (setq w2 (is-op? (first inf)))
+		   (cond ((and w2 (<= w2 w1))
+		          (setq ok nil))
+                         (t
+                          (push (car inf) li)
+                          (pop inf)))))
+		(t
+		 (setq lh op))))
+	inf)))
+
diff --git a/nyquist/sal.lsp b/nyquist/sal.lsp
new file mode 100644
index 0000000..63b2bb7
--- /dev/null
+++ b/nyquist/sal.lsp
@@ -0,0 +1,555 @@
+;;; **********************************************************************
+;;; Copyright (C) 2006 Rick Taube
+;;; This program is free software; you can redistribute it and/or   
+;;; modify it under the terms of the Lisp Lesser Gnu Public License.
+;;; See http://www.cliki.net/LLGPL for the text of this agreement.
+;;; **********************************************************************
+
+;;; $Revision: 1.2 $
+;;; $Date: 2009/03/05 17:42:25 $
+
+;; DATA STRUCTURES AND ALGORITHMS (for sal.lsp and parse.lsp)
+;;
+;; TOKENIZE converts source language (a string) into a list of tokens
+;;    each token is represented as follows:
+;;    (:TOKEN <type> <string> <start> <info> <lisp>)
+;;    where <type> is one of:
+;;        :id -- an identifier
+;;        :lp -- left paren
+;;        :rp -- right paren
+;;        :+, etc. -- operators
+;;        :int -- an integer
+;;        :float -- a float
+;;        :print, etc. -- a reserved word
+;;    <string> is the source string for the token
+;;    <start> is the column of the string
+;;    <info> and <lisp> are ??
+;; Tokenize uses a list of reserved words extracted from terminals in
+;;    the grammar. Each reserved word has an associated token type, but
+;;    all other identifiers are simply of type :ID.
+;;
+;; *** WHY REWRITE THE ORIGINAL PARSER? ***
+;; Originally, the code interpreted a grammar using a recursive pattern
+;; matcher, but XLISP does not have a huge stack and there were
+;; stack overflow problems because even relatively small expressions
+;; went through a very deep nesting of productions. E.g. 
+;; "print note(between(30,odds(.5, 60, 90)))" 0 t nil))" was at recursion
+;; level 46 when the stack overflowed. The stack depth is 2000 or 4000,
+;; but all locals and parameters get pushed here, so since PARSE is the
+;; recursive function and it has lots of parameters and locals, it appears
+;; to use 80 elements in the stack per call.
+;; *** END ***
+;;
+;; The grammar for the recursive descent parser:
+;;   note: [ <x> ] means optional <x>, <x>* means 0 or more of <x>
+;;
+;; <number> = <int> | <float>
+;; <atom> = <int> | <float> | <id> | <bool>
+;; <list> = { <elt>* }
+;; <elt> = <atom> | <list> | <string>
+;; <aref> = <id> <lb> <pargs> <rb>
+;; <ifexpr> = ? "(" <sexpr> , <sexpr> [ , <sexpr> ] ")"
+;; <funcall> = <id> <funargs>
+;; <funargs> = "(" [ <args> ] ")"
+;; <args> =  <arg> [ , <arg> ]*
+;; <arg> = <sexpr> | <key> <sexpr>
+;; <op> = + | - | "*" | / | % | ^ | = | != |
+;;        "<" | ">" | "<=" | ">=" | ~= | ! | & | "|"
+;; <mexpr> = <term> [ <op> <term> ]*
+;; <term> = <-> <term> | <!> <term> | "(" <mexpr> ")" |
+;;          <ifexpr> | <funcall> | <aref> | <atom> | <list> | <string>
+;; <sexpr> = <mexpr> | <object> | class
+;; <top> = <command> | <block> | <conditional> | <assignment> | <loop> | <exec>
+;; <exec> = exec <sexpr>
+;; <command> = <define-cmd> | <file-cmd> | <output>
+;; <define-cmd> = define <declaration>
+;; <declaration> = <vardecl> | <fundecl>
+;; <vardecl> = variable <bindings>
+;; <bindings> = <bind> [ , <bind> ]*
+;; <bind> = <id> [ <=> <sexpr> ]
+;; <fundecl> = <function> <id> "(" [ <parms> ] ")" <statement>
+;; <parms> = <parm> [ , <parm> ]*
+;;  this is new: key: expression for keyword parameter
+;; <parm> = <id> | <key> [ <sexpr> ] 
+;; <statement> = <block> | <conditional> | <assignment> |
+;;               <output-stmt> <loop-stmt> <return-from> | <exec>
+;; <block> = begin [ with <bindings> [ <statement> ]* end
+;; <conditional> = if <sexpr> then [ <statement> ] [ else <statement> ] |
+;;                 when <sexpr> <statement> | unless <sexpr> <statement>
+;; <assignment> = set <assign> [ , <assign> ]*
+;; <assign> = ( <aref> | <id> ) <assigner> <sexpr>
+;; <assigner> = = | += | *= | &= | @= | ^= | "<=" | ">="
+;; <file-cmd> = <load-cmd> | chdir <pathref> | 
+;;              system <pathref> | play <sexpr>
+;; (note: system was removed)
+;; <load-cmd> = load <pathref> [ , <key> <sexpr> ]* 
+;; <pathref> = <string> | <id>
+;; <output-stmt> = print <sexpr> [ , <sexpr> ]* |
+;;                 output <sexpr>
+;; <loop-stmt> = loop [ with <bindings> ] [ <stepping> ]* 
+;;               [ <termination> ]* [ <statement> ]+
+;;               [ finally <statement> ] end
+;; <stepping> = repeat <sexpr> |
+;;              for <id> = <sexpr> [ then <sexpr> ] |
+;;              for <id> in <sexpr> |
+;;              for <id> over <sexpr> [ by <sexpr> ] |
+;;              for <id> [ from <sexpr> ]
+;;                       [ ( below | to | above | downto ) <sexpr> ]
+;;                       [ by <sexpr> ] |
+;; <termination> = while <sexpr> | until <sexpr>
+;; <return-from> = return <sexpr>
+
+;(in-package cm)
+
+; (progn (cd "/Lisp/sal/") (load "parse.lisp") (load "sal.lisp"))
+
+(setfn defconstant setf)
+(setfn defparameter setf)
+(setfn defmethod defun)
+(setfn defvar setf)
+(setfn values list)
+(if (not (boundp '*sal-secondary-prompt*))
+    (setf *sal-secondary-prompt* t))
+(if (not (boundp '*sal-xlispbreak*))
+    (setf *sal-xlispbreak* nil))
+
+(defun sal-trace-enter (fn &optional argvals argnames)
+  (push (list fn *sal-line* argvals argnames) *sal-call-stack*))
+
+(defun sal-trace-exit ()
+  (setf *sal-line* (second (car *sal-call-stack*)))
+  (pop *sal-call-stack*))
+
+;; SAL-RETURN-FROM is generated by Sal compiler and
+;;  performs a return as well as a sal-trace-exit()
+;;
+(defmacro sal-return-from (fn val)
+  `(prog ((sal:return-value ,val))
+     (setf *sal-line* (second (car *sal-call-stack*)))
+     (pop *sal-call-stack*)
+     (return-from ,fn sal:return-value)))
+
+
+(setf *sal-traceback* t)
+
+
+(defun sal-traceback (&optional (file t) 
+                      &aux comma name names line)
+  (format file "Call traceback:~%")
+  (setf line *sal-line*)
+  (dolist (frame *sal-call-stack*)
+    (setf comma "")
+    (format file "    ~A" (car frame))
+    (cond ((symbolp (car frame))
+           (format file "(")
+           (setf names (cadddr frame))
+           (dolist (arg (caddr frame))
+             (setf name (car names))
+             (format file "~A~%        ~A = ~A" comma name arg)
+             (setf names (cdr names))
+             (setf comma ","))
+           (format file ") at line ~A~%" line)
+           (setf line (second frame)))
+          (t 
+           (format file "~%")))))
+
+
+'(defmacro defgrammer (sym rules &rest args)
+  `(defparameter ,sym
+     (make-grammer :rules ',rules , at args)))
+
+'(defun make-grammer (&key rules literals)
+  (let ((g (list 'a-grammer rules literals)))
+    (grammer-initialize g)
+    g))
+
+'(defmethod grammer-initialize (obj)
+  (let (xlist)
+    ;; each literal is (:name "name")
+    (cond ((grammer-literals obj)
+           (dolist (x (grammer-literals obj))
+             (cond ((consp x)
+                    (push x xlist))
+                   (t
+                    (push (list (string->keyword (string-upcase (string x)))
+                                (string-downcase (string x)))
+                          xlist)))))
+          (t
+           (dolist (x (grammer-rules obj))
+             (cond ((terminal-rule? x)
+                    (push (list (car x)
+                                (string-downcase (subseq (string (car x)) 1)))
+                          xlist))))))
+    (set-grammer-literals obj (reverse xlist))))
+
+'(setfn grammer-rules cadr)
+'(setfn grammer-literals caddr)
+'(defun set-grammer-literals (obj val)
+  (setf (car (cddr obj)) val))
+'(defun is-grammer (obj) (and (consp obj) (eq (car obj) 'a-grammer)))
+
+(defun string->keyword (str)
+  (intern (strcat ":" (string-upcase str))))
+
+(defun terminal-rule? (rule)
+  (or (null (cdr rule)) (not (cadr rule))))
+
+(load "sal-parse.lsp" :verbose nil)
+
+(defparameter *sal-print-list* t)
+
+(defun sal-printer (x &key (stream *standard-output*) (add-space t))
+  (let ((*print-case* ':downcase))
+    (cond ((and (consp x) *sal-print-list*)
+	   (write-char #\{ stream)
+	   (do ((items x (cdr items)))
+               ((null items))
+	      (sal-printer (car items) :stream stream
+                                       :add-space (cdr items))
+	      (cond ((cdr items)
+                     (cond ((not (consp (cdr items)))
+                            (princ "<list not well-formed> " stream)
+                            (sal-printer (cdr items) :stream stream :add-space nil)
+                            (setf items nil))))))
+	   (write-char #\} stream))
+	  ((not x)     (princ "#f" stream) )
+	  ((eq x t)    (princ "#t" stream))
+	  (t           (princ x stream)))
+    (if add-space (write-char #\space stream))))
+
+(defparameter *sal-printer* #'sal-printer)
+
+(defun sal-message (string &rest args)
+  (format t "~&; ")
+  (apply #'format t string args))
+
+
+(defun sal-print (&rest args)
+  (terpri)
+  (mapc *sal-printer* args)
+  (values))
+
+(defmacro keyword (sym)
+  `(str-to-keyword (symbol-name ',sym)))
+
+(defun plus (&rest nums)
+  (apply #'+ nums))
+
+(defun minus (num &rest nums)
+  (apply #'- num nums))
+
+(defun times (&rest nums)
+  (apply #'* nums))
+
+(defun divide (num &rest nums)
+  (apply #'/ num nums))
+
+;; implementation of infix "!=" operator
+(defun not-eql (x y)
+  (not (eql x y)))
+
+; dir "*.*
+; chdir
+; load "rts.sys"
+
+(defun sal-chdir ( dir)
+  (cd (expand-path-name dir))
+  (sal-message "Directory: ~A" (pwd))
+  (values))
+
+;;; sigh, not all lisps support ~/ directory components.
+
+(defun expand-path-name (path &optional absolute?)
+  (let ((dir (pathname-directory path)))
+    (flet ((curdir ()
+	     (truename 
+	      (make-pathname :directory
+			     (pathname-directory
+			      *default-pathname-defaults*)))))
+      (cond ((null dir)
+	     (if (equal path "~") 
+		 (namestring (user-homedir-pathname))
+		 (if absolute? 
+		     (namestring (merge-pathnames path (curdir)))
+		     (namestring path))))
+	    ((eql (car dir) ':absolute)
+	     (namestring path))
+	    (t
+	     (let* ((tok (second dir))
+		    (len (length tok)))
+	       (if (char= (char tok 0) #\~)
+		   (let ((uhd (pathname-directory (user-homedir-pathname))))
+		     (if (= len 1)
+			 (namestring
+			  (make-pathname :directory (append uhd (cddr dir))
+					 :defaults path))
+			 (namestring
+			  (make-pathname :directory
+					 (append (butlast uhd)
+						 (list (subseq tok 1))
+						 (cddr dir))
+					 :defaults path))))
+		   (if absolute?
+		       (namestring (merge-pathnames  path (curdir)))
+		       (namestring path)))))))))
+
+
+(defun sal-load (filename &key (verbose t) print)
+  (progv '(*sal-input-file-name*) (list filename)
+    (prog (file extended-name)
+      ;; first try to load exact name
+      (cond ((setf file (open filename))
+             (close file) ;; found it: close it and load it
+             (return (generic-loader filename verbose print))))
+      ;; try to load name with ".sal" or ".lsp"
+      (cond ((string-search "." filename) ; already has extension
+             nil) ; don't try to add another extension
+            ((setf file (open (strcat filename ".sal")))
+             (close file)
+             (return (sal-loader (strcat filename ".sal")
+                                 :verbose verbose :print print)))
+            ((setf file (open (strcat filename ".lsp")))
+             (close file)
+             (return (lisp-loader filename :verbose verbose :print print))))
+      ;; search for file as is or with ".lsp" on path
+      (setf fullpath (find-in-xlisp-path filename))
+      (cond ((and (not fullpath) ; search for file.sal on path
+                  (not (string-search "." filename))) ; no extension yet
+             (setf fullpath (find-in-xlisp-path (strcat filename ".sal")))))
+      (cond ((null fullpath)
+             (format t "sal-load: could not find ~A~%" filename))
+            (t
+             (return (generic-loader filename verbose print)))))))
+
+
+;; GENERIC-LOADER -- load a sal or lsp file based on extension
+;;
+;; assumes that file exists, and if no .sal extension, type is Lisp
+;;
+(defun generic-loader (fullpath verbose print)
+  (cond ((has-extension fullpath ".sal")
+         (sal-loader fullpath :verbose verbose :print print))
+        (t
+         (lisp-loader fullpath :verbose verbose :print print))))
+
+#|
+(defun sal-load (filename &key (verbose t) print)
+  (progv '(*sal-input-file-name*) (list filename)
+    (let (file extended-name)
+      (cond ((has-extension filename ".sal")
+             (sal-loader filename :verbose verbose :print print))
+            ((has-extension filename ".lsp")
+             (lisp-load filename :verbose verbose :print print))
+            ;; see if we can just open the exact filename and load it
+            ((setf file (open filename))
+             (close file)
+             (lisp-load filename :verbose verbose :print print))
+            ;; if not, then try loading file.sal and file.lsp
+            ((setf file (open (setf *sal-input-file-name*
+                                    (strcat filename ".sal"))))
+             (close file)
+             (sal-loader *sal-input-file-name* :verbose verbose :print print))
+            ((setf file (open (setf *sal-input-file-name* 
+                                    (strcat filename ".lsp"))))
+             (close file)
+             (lisp-load *sal-input-file-name* :verbose verbose :print print))
+            (t
+             (format t "sal-load: could not find ~A~%" filename))))))
+|#
+
+(defun lisp-loader (filename &key (verbose t) print)
+  (if (load filename :verbose verbose :print print)
+      nil ; be quiet if things work ok
+      (format t "error loading lisp file ~A~%" filename)))
+
+
+(defun has-extension (filename ext)
+  (let ((loc (string-search ext filename
+                            :start (max 0 (- (length filename)
+                                             (length ext))))))
+    (not (null loc)))) ; coerce to t or nil
+    
+
+(defmacro sal-at (s x) (list 'at x s))
+(defmacro sal-at-abs (s x) (list 'at-abs x s))
+(defmacro sal-stretch (s x) (list 'stretch x s))
+(defmacro sal-stretch-abs (s x) (list 'stretch-abs x s))
+
+;; splice every pair of lines
+(defun strcat-pairs (lines)
+  (let (rslt)
+    (while lines
+      (push (strcat (car lines) (cadr lines)) rslt)
+      (setf lines (cddr lines)))
+    (reverse rslt)))
+
+
+(defun strcat-list (lines)
+  ;; like (apply 'strcat lines), but does not use a lot of stack
+  ;; When there are too many lines, XLISP will overflow the stack
+  ;; because args go on the stack.
+  (let (r)
+    (while (> (setf len (length lines)) 1)
+      (if (oddp len) (setf lines (cons "" lines)))
+      (setf lines (strcat-pairs lines)))
+    ; if an empty list, return "", else list has one string: return it
+    (if (null lines) "" (car lines))))
+
+
+(defun sal-loader (filename &key verbose print)
+  (let ((input "") (file (open filename)) line lines)
+    (cond (file
+           (push filename *loadingfiles*)
+           (while (setf line (read-line file))
+            (push line lines)
+            (push "\n" lines))
+           (close file)
+           (setf input (strcat-list (reverse lines)))
+           (sal-trace-enter (strcat "Loading " filename))
+           (sal-compile input t t filename)
+           (pop *loadingfiles*)
+           (sal-trace-exit))
+          (t
+           (format t "error loading SAL file ~A~%" filename)))))
+
+
+; SYSTEM command is not implemented
+;(defun sal-system (sys &rest pairs)
+;  (apply #'use-system sys pairs))
+
+
+(defun load-sal-file (file)
+  (with-open-file (f file :direction :input)
+    (let ((input (make-array '(512) :element-type 'character
+			     :fill-pointer 0 :adjustable t)))
+      (loop with flag
+	 for char = (read-char f nil ':eof)
+	 until (or flag (eql char ':eof))
+	 do
+	   (when (char= char #\;)
+	     (loop do (setq char (read-char f nil :eof))
+		until (or (eql char :eof)
+			  (char= char #\newline))))
+	   (unless (eql char ':eof)
+	     (vector-push-extend char input)))
+      (sal input :pattern :command-sequence))))
+
+
+(defmacro sal-play (snd)
+  (if (stringp snd) `(play-file ,snd)
+                    `(play ,snd)))
+
+
+(if (not (boundp '*sal-compiler-debug*))
+    (setf *sal-compiler-debug* nil))
+
+
+(defmacro sal-simrep (variable iterations body)
+  `(simrep (,variable ,iterations) ,body))
+
+
+(defmacro sal-seqrep (variable iterations body)
+  `(seqrep (,variable ,iterations) ,body))
+
+
+;; function called in sal programs to exit the sal read-compile-run-print loop
+(defun sal-exit () (setf *sal-exit* t))
+
+;; read-eval-print loop for sal commands
+(defun sal ()
+  (progv '(*breakenable* *tracenable* *sal-exit*)
+         (list *sal-xlispbreak* *sal-xlispbreak* nil)
+    (let (input line)
+      (setf *sal-call-stack* nil)
+      (read-line) ; read the newline after the one the user 
+                  ; typed to invoke this fn
+      (princ "Entering SAL mode ...\n");
+      (while (not *sal-exit*)
+        (princ "\nSAL> ")
+        (sal-trace-enter "SAL top-level command interpreter")
+        ;; get input terminated by two returns
+        (setf input "")
+        (while (> (length (setf line (read-line))) 0)
+          (if *sal-secondary-prompt* (princ " ... "))
+          (setf input (strcat input "\n" line)))
+        ;; input may have an extra return, remaining from previous read
+        ;; if so, trim it because it affects line count in error messages
+        (if (and (> (length input) 0) (char= (char input 0) #\newline))
+            (setf input (subseq input 1)))
+        (sal-compile input t nil "<console>")
+        (sal-trace-exit))
+      (princ "Returning to Lisp ...\n")
+      t ; return value
+      )))
+
+
+(defun sal-error-output (stack)
+  (if *sal-traceback* (sal-traceback))
+  (setf *sal-call-stack* stack)) ;; clear the stack
+
+;; SAL-COMPILE -- translate string or token list to lisp and eval
+;;
+;; input is either a string or a token list
+;; eval-flag tells whether to evaluate the program or return the lisp
+;; multiple-statements tells whether the input can contain multiple
+;;   top-level units (e.g. from a file) or just one (from command line)
+;; returns:
+;;   if eval-flag, then nothing is returned
+;;   otherwise, returns nil if an error is encountered
+;;   otherwise, returns a list (PROGN p1 p2 p3 ...) where pn are lisp
+;;      expressions
+;;
+(defun sal-compile (input eval-flag multiple-statements filename)
+  ;; save some globals because eval could call back recursively
+  (progv '(*sal-tokens* *sal-input* *sal-input-text*) '(nil nil nil)
+    (let (output remainder rslt stack)
+      (setf stack *sal-call-stack*)
+      ;; if first input char is "(", then eval as a lisp expression:
+      ;(display "sal-compile" input)
+      (cond ((input-starts-with-open-paren input)
+             ;(print "input is lisp expression")
+             (errset
+              (print (eval (read (make-string-input-stream input)))) t))
+            (t ;; compile SAL expression(s):
+             (loop
+                (setf output (sal-parse nil nil input multiple-statements 
+                                        filename))
+                (cond ((first output) ; successful parse
+                       (setf remainder *sal-tokens*)
+                       (setf output (second output))
+                       (when *sal-compiler-debug*
+                         (terpri)
+                         (pprint output))
+                       (cond (eval-flag ;; evaluate the compiled code
+                              (cond ((null (errset (eval output) t))
+                                     (sal-error-output stack)
+                                     (return)))) ;; stop on error
+                             (t
+                              (push output rslt)))
+                                        ;(display "sal-compile after eval" 
+                                        ;         remainder *sal-tokens*)
+                       ;; if there are statements left over, maybe compile again
+                       (cond ((and multiple-statements remainder)
+                              ;; move remainder to input and iterate
+                              (setf input remainder))
+                             ;; see if we've compiled everything
+                             ((and (not eval-flag) (not remainder))
+                              (return (cons 'progn (reverse rslt))))
+                             ;; if eval but no more input, return
+                             ((not remainder)
+                              (return))))
+                      (t ; error encountered
+                       (return)))))))))
+
+;; SAL just evaluates lisp expression if it starts with open-paren,
+;; but sometimes reader reads previous newline(s), so here we
+;; trim off initial newlines and check if first non-newline is open-paren
+(defun input-starts-with-open-paren (input)
+  (let ((i 0))
+    (while (and (stringp input)
+                (> (length input) i)
+                (eq (char input i) #\newline))
+      (incf i))
+    (and (stringp input)
+         (> (length input) i)
+         (eq (char input i) #\())))
diff --git a/nyquist/stk.lsp b/nyquist/stk.lsp
new file mode 100644
index 0000000..6ba7e55
--- /dev/null
+++ b/nyquist/stk.lsp
@@ -0,0 +1,189 @@
+;; stk.lsp -- STK-based instruments
+;;
+;; currently clarinet and saxophony are implemented
+
+(defun instr-parameter (parm)
+  ;; coerce parameter into a *sound-srate* signal
+  (cond ((numberp parm)
+         (stretch 30 (control-srate-abs *sound-srate* (const (float parm)))))
+        (t
+         (force-srate *sound-srate* parm))))
+
+
+(defun clarinet (step breath-env)
+  (snd-clarinet (step-to-hz step) (force-srate *sound-srate* breath-env) *sound-srate*))
+
+
+(defun clarinet-freq (step breath-env freq-env)
+  ;; note that the parameters are in a different order -- I defined 
+  ;; clarinet-freq this way so that the first two parameters are always
+  ;; step and breath. I didn't redo snd-clarinet-freq.
+  (snd-clarinet_freq (step-to-hz step) 
+                (instr-parameter breath-env)
+                (instr-parameter freq-env)
+                *sound-srate*))
+
+
+
+(defun clarinet-all (step breath-env freq-env vibrato-freq vibrato-gain reed-stiffness noise)
+  ;; note that the parameters are not in the same order as snd-clarinet-all
+  (setf breath-env (instr-parameter breath-env))
+  (setf freq-env (instr-parameter freq-env))
+  (setf reed-stiffness (instr-parameter reed-stiffness))
+  (setf noise (instr-parameter noise))
+  (snd-clarinet_all (step-to-hz step)
+                    breath-env freq-env 
+                    ;; STK scales 1.0 to 12Hz. Scale here so vibrato-freq is in Hz
+                    (/ vibrato-freq 12.0) vibrato-gain
+                    reed-stiffness noise 
+                    *sound-srate*))
+
+
+(defun sax (step breath-env)
+  (snd-sax (step-to-hz step) (force-srate *sound-srate* breath-env) *sound-srate*))
+
+(defun sax-freq (step breath-env freq-env)
+  (snd-sax_freq (step-to-hz step)
+          (instr-parameter breath-env)
+          (instr-parameter freq-env)
+          *sound-srate*))
+
+(defun sax-all (step breath-env freq-env vibrato-freq vibrato-gain reed-stiffness noise blow-pos reed-table-offset)
+  (snd-sax_all (step-to-hz step)
+	       (instr-parameter freq-env)
+               (instr-parameter breath-env)
+               (instr-parameter (/ vibrato-freq 12.0))
+               (instr-parameter vibrato-gain)
+               (instr-parameter reed-stiffness)
+               (instr-parameter noise)
+               (instr-parameter blow-pos)
+               (instr-parameter reed-table-offset)
+               *sound-srate*)
+)
+
+; instr-parameter already defined in stk.lsp
+
+(defun flute (step breath-env)
+  (snd-flute (step-to-hz step) (force-srate *sound-srate* breath-env) *sound-srate*))
+ 
+(defun flute-freq (step breath-env freq-env)
+  (snd-flute_freq (step-to-hz step) 
+		  (instr-parameter breath-env)
+		  (instr-parameter freq-env)
+		  *sound-srate*))
+
+(defun flute-all (step breath-env freq-env vibrato-freq vibrato-gain jet-delay noise)
+  ;; note that the parameters are not in the same order as snd-clarinet-all
+  (setf breath-env (instr-parameter breath-env))
+  (setf freq-env (instr-parameter freq-env))
+  (setf jet-delay (instr-parameter jet-delay))
+  (setf noise (instr-parameter noise))
+  (snd-flute_all (step-to-hz step)
+                    breath-env freq-env 
+                    ;; STK scales 1.0 to 12Hz. Scale here so vibrato-freq is in Hz
+                    (/ vibrato-freq 12.0) vibrato-gain
+                    jet-delay noise 
+                    *sound-srate*))
+
+
+(defun bowed (step bowpress-env)
+  (snd-bowed (step-to-hz step) (force-srate *sound-srate* bowpress-env) *sound-srate*))
+
+(defun bowed-freq (step bowpress-env freq-env)
+  (snd-bowed_freq (step-to-hz step)
+		  (instr-parameter bowpress-env)
+		  (instr-parameter freq-env)
+		  *sound-srate*))
+
+(defun mandolin (step dur &optional (detune 4.0))
+  (let ((d (get-duration dur)))
+    (snd-mandolin *rslt* (step-to-hz step) d 1.0 detune *sound-srate*)))
+
+(defun wg-uniform-bar (step bowpress-env)
+  (snd-bandedwg (step-to-hz step) (force-srate *sound-srate* bowpress-env) 0 *sound-srate*))
+
+(defun wg-tuned-bar (step bowpress-env)
+  (snd-bandedwg (step-to-hz step) (force-srate *sound-srate* bowpress-env) 1 *sound-srate*))
+
+(defun wg-glass-harm (step bowpress-env)
+  (snd-bandedwg (step-to-hz step) (force-srate *sound-srate* bowpress-env) 2 *sound-srate*))
+
+(defun wg-tibetan-bowl (step bowpress-env)
+  (snd-bandedwg (step-to-hz step) (force-srate *sound-srate* bowpress-env) 3 *sound-srate*))
+ 
+(defun modalbar (preset step duration)
+   (let ((preset (case preset
+			(MARIMBA 0)
+			(VIBRAPHONE 1)
+			(AGOGO 2)
+			(WOOD1 3)
+			(RESO 4)
+			(WOOD2 5)
+			(BEATS 6)
+			(TWO-FIXED 7)
+			(CLUMP 8)
+			(t (error (format nil "Unknown preset for modalbar %A" preset)))))
+	 (d (get-duration duration)))
+     (snd-modalbar *rslt* (step-to-hz step) preset d *sound-srate*)))
+
+(defun sitar (step dur)
+  (let ((d (get-duration dur)))
+    (snd-sitar *rslt* (step-to-hz step) d *sound-srate*)))
+
+(defun nyq:nrev (snd rev-time mix)
+  (snd-stkrev 0 snd rev-time mix *sound-srate*))
+
+(defun nyq:jcrev (snd rev-time mix)
+  (snd-stkrev 1 snd rev-time mix *sound-srate*))
+
+(defun nyq:prcrev (snd rev-time mix)
+  (snd-stkrev 2 snd rev-time mix *sound-srate*))
+
+(defun nrev (snd rev-time mix)
+  (multichan-expand #'nyq:nrev snd rev-time mix))
+
+(defun jcrev (snd rev-time mix)
+  (multichan-expand #'nyq:jcrev snd rev-time mix))
+
+(defun prcrev (snd rev-time mix)
+  (multichan-expand #'nyq:prcrev snd rev-time mix))
+
+(defun nyq:chorus (snd depth freq mix &optional (base-delay 6000))
+  (snd-stkchorus snd base-delay depth freq mix *sound-srate*))
+
+(defun stkchorus (snd depth freq mix &optional (base-delay 6000))
+  (multichan-expand #'nyq:chorus snd depth freq mix base-delay))
+
+(defun nyq:pitshift (snd shift mix)
+  (snd-stkpitshift snd shift mix *sound-srate*))
+
+(defun pitshift (snd shift mix)
+  (multichan-expand #'nyq:pitshift snd shift mix))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; HELPER FUNCTIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; pass in rates of increase/decrease in begin/end... this is like noteOn and noteOff
+;
+; STK uses setRate but the actual ramp time is also a function of the sample rate.
+; I will assume the clarinet was run at 44100Hz and fix things so that the envelope
+; is sample-rate independent.
+;
+; STK seemed to always give a very fast release, so I changed the numbers so that
+; note-off values from 0.01 to 1 give an interesting range of articulations.
+;
+; IMPORTANT: the returned envelope is 0.1s longer than dur. There is 0.1s of silence
+; at the end so that the clarinet can "ring" after the driving force is removed.
+;
+(defun stk-breath-env (dur note-on note-off)
+  (let* ((target (+ 0.55 (* 0.3 note-on)))
+         (on-time (/ (* target 0.0045) note-on))
+         (off-time (/ (* target 0.02) note-off)))
+    ;(display "clarinet-breath-env" target on-time off-time)
+    (pwl on-time target
+         (- dur off-time) target
+         dur 0 (+ dur 0.1))))
+
+
diff --git a/nyquist/xm.lsp b/nyquist/xm.lsp
new file mode 100644
index 0000000..dfb01b1
--- /dev/null
+++ b/nyquist/xm.lsp
@@ -0,0 +1,2332 @@
+;; X-Music, inspired by Commmon Music
+
+#|
+PATTERN SEMANTICS
+
+Patterns are objects that are generally accessed by calling 
+(next pattern). Each call returns the next item in an 
+infinite sequence generated by the pattern. Items are 
+organized into periods. You can access all (remaining) 
+items in the current period using (next pattern t).
+
+Patterns mark the end-of-period with +eop+, a distinguished
+atom. The +eop+ markers are filtered out by the next function
+but returned by the :next method.
+
+Pattern items may be patterns. This is called a nested
+pattern.  When patterns are nested, you return a period 
+from the innermost pattern, i.e. traversal is depth-first. 
+This means when you are using something like random, you
+have to remember the last thing returned and keep getting
+the next element from that thing until you see +eop+; 
+then you move on. It's a bit more complicated because 
+a pattern advances when its immediate child pattern
+finishes a cycle, but +eop+ is only returned from the
+"leaf" patterns.
+
+With nested patterns, i.e. patterns with items that
+are patterns, the implementation requires that
+*all* items must be patterns. The application does
+*not* have to make every item a pattern, so the
+implementation "cleans up" the item list: Any item
+that is not a pattern is be replaced with a cycle
+pattern whose list contains just the one item.
+
+EXPLICIT PATTERN LENGTH
+
+Pattern length may be given explicitly by a number or
+a pattern that generates numbers. Generally this is 
+specified as the optional :for keyword parameter when
+the pattern is created. If the explicit pattern
+length is a number, this will be the period length,
+overriding all implicit lengths. If the pattern length
+is itself a pattern, the pattern is evaluated every 
+period to determine the length of the next period,
+overriding any implicit length. 
+
+IMPLEMENTATION
+
+There are 3 ways to determine lengths: 
+1) The length is implicit. The length can be
+computed (at some point) and turned into an
+explicit length.
+
+2) The length is explicit. This overrides the
+implicit length. The explicit length is stored as
+a counter that tells how many more items to generate
+in the current period.
+
+3) The length can be generated by a pattern.
+The pattern is evaluated to generate an explicit
+length.
+
+So ultimately, we just need a mechanism to handle
+explicit lengths. This is incorporated into the
+pattern-class. The pattern-class sends :start-period
+before calling :advance when the first item in a
+period is about to be generated. Also, :next returns
++eop+ automatically at the end of a period.
+
+Because evaluation is "depth first," i.e. we 
+advance to the next top-level item only after a period
+is generated from a lower-level pattern, every pattern
+has a "current" field that holds the current item. the
+"have-current" field is a flag to tell when the "current"
+field is valid. It is initialized to nil.
+
+To generate an element, you need to follow the nested
+patterns all the way to the leaf pattern for every 
+generated item. This is perhaps less efficient than
+storing the current leaf pattern at the top level, but
+patterns can be shared, i.e. a pattern can be a 
+sub-pattern of multiple patterns, so current position
+in the tree structure of patterns can change at 
+any time.
+
+The evaluation of nested patterns is depth-first
+and the next shallower level advances when its current
+child pattern completes a cycle. To facilitate this
+step, the :advance method, which advances a pattern
+and computes "current", returns +eonp+, which is a
+marker that a nested pattern has completed a cycle.
+
+The :next method generates the next item or +eop+ from
+a pattern. The algorithm in psuedo-code is roughly this:
+
+next(p)
+    while true:
+        if not have-current
+            pattern-advance()
+            have-current = true
+            if is-nested and current = eop:
+                have-current = false
+                return eonp
+        if is-nested:
+            rslt = next(current)
+            if rslt == eonp
+                have-current = false
+            elif rslt == eop and not current.is-nested
+                have-current = false
+                return rslt
+            else
+                return rslt
+        else
+            have-current = nil
+            return current
+
+pattern-advance
+    // length-pattern is either a pattern or a constant
+    if null(count) and length-pattern:
+        count = next(length-pattern)
+        start-period() // subclass-specific computation
+    if null(count)
+        error
+    if count == 0
+        current = eop
+        count = nil
+    else
+        advance() // subclass-specific computation
+        count--
+
+
+SUBCLASS RESPONSIBILITIES
+
+Note that :advance is the method to override in the 
+various subclasses of pattern-class. The :advance()
+method computes the next element in the infinite
+sequence of items and puts the item in the "current"
+field. 
+
+The :start-period method is called before calling 
+advance to get the first item of a new period.
+
+Finally, set the is-nested flag if there are nested patterns,
+and make all items of any nested pattern be patterns (no
+mix of patterns and non-patterns is allowed; use 
+    (MAKE-CYCLE (LIST item))
+to convert a non-pattern to a pattern).
+
+|#
+
+(setf SCORE-EPSILON 0.000001)
+
+(setf pattern-class 
+  (send class :new '(current have-current is-nested name count
+                     length-pattern trace)))
+
+(defun patternp (x) 
+  (and (objectp x) (send x :isa pattern-class)))
+
+(setf +eop+ '+eop+)
+(setf +eonp+ '+eonp+) ;; end of nested period, this indicates you
+   ;; should advance yourself and call back to get the next element
+
+(defun check-for-list (lis name)
+  (if (not (listp lis))
+      (error (format nil "~A, requires a list of elements" name))))
+
+(defun check-for-list-or-pattern (lis name)
+  (if (not (or (listp lis) (patternp lis)))
+      (error (format nil "~A, requires a list of elements or a pattern" name))))
+
+(defun list-has-pattern (lis)
+  (dolist (e lis) 
+    (if (patternp e) (return t))))
+
+(defun is-homogeneous (lis)
+  (let (type)
+    (dolist (elem lis t)
+      (cond ((null type)
+             (setf type (if (patternp elem) 'pattern 'atom)))
+            ((and (eq type 'pattern)
+                  (not (patternp elem)))
+             (return nil))
+            ((and (eq type 'atom)
+                  (patternp elem))
+             (return nil))))))
+
+(defun make-homogeneous (lis)
+  (cond ((is-homogeneous lis) lis)
+        (t
+         (mapcar #'(lambda (item)
+                     (if (patternp item) item 
+                         (make-cycle (list item)
+                          ;; help debugging by naming the new pattern
+                          ;; probably, the name could be item, but
+                          ;; here we coerce item to a string to avoid
+                          ;; surprises in code that assumes string names.
+                          :name (format nil "~A" item))))
+                 lis))))
+
+
+(send pattern-class :answer :next '()
+  '(;(display ":next" name is-nested)
+    (loop
+     (cond ((not have-current)
+            (send self :pattern-advance)
+            (setf have-current t)
+            (cond (trace
+                   (format t "pattern ~A advanced to ~A~%"
+                           (if name name "<no-name>")
+                           (if (patternp current) 
+                               (if (send current :name)
+                                   (send current :name)
+                                   "<a-pattern>")
+                               current))))
+            (cond ((and is-nested (eq current +eop+))
+                   ;(display ":next returning eonp" name)
+                   (setf have-current nil)
+                   (return +eonp+)))))
+     (cond (is-nested
+            (let ((rslt (send current :next)))
+              (cond ((eq rslt +eonp+)
+                     (setf have-current nil))
+                    ;; advance next-to-leaf level at end of leaf's period
+                    ((and (eq rslt +eop+) (not (send current :is-nested)))
+                     (setf have-current nil)
+                     ;; return +eof+ because it's the end of leaf's period
+                     (return rslt))
+                    (t
+                     (return rslt)))))
+           (t
+            (setf have-current nil)
+            (return current))))))
+
+
+;; :PATTERN-ADVANCE -- advance to the next item in a pattern
+;; 
+;; this code is used by every class. class-specific behavior
+;; is implemented by :advance, which this method calls
+;;
+(send pattern-class :answer :pattern-advance '()
+  '(;(display "enter :pattern-advance" self name count current is-nested)
+    (cond ((null count)
+           ;(display "in :pattern-advance" name count length-pattern)
+           (if length-pattern
+               (setf count (next length-pattern)))
+           ;; if count is still null, :start-period must set count
+           (send self :start-period)))
+    (cond ((null count)
+           (error
+            (format nil
+             "~A, pattern-class :pattern-advance has null count" name))))
+    (cond ((zerop count)
+           (setf current +eop+)
+           (setf count nil))
+          (t
+           (send self :advance)
+           (decf count)))
+    ;(display "exit :pattern-advance" name count current)
+    ))
+
+
+(send pattern-class :answer :is-nested '() '(is-nested))
+
+
+(send pattern-class :answer :name '() '(name))
+
+
+(send pattern-class :answer :set-current '(c)
+  '((setf current c)
+    (let ((value
+           (if (patternp current) 
+               (send current :name)
+               current)))
+      ;(display ":set-current" name value)
+      )))
+
+
+;; next -- get the next element in a pattern
+;;
+;; any non-pattern value is simply returned
+;;
+(defun next (pattern &optional period-flag) 
+  ;(display "next" pattern period-flag (patternp pattern))
+  (cond ((and period-flag (patternp pattern))
+         (let (rslt elem)
+           (while (not (eq (setf elem (send pattern :next)) +eop+))
+               ;(display "next t" (send pattern :name) elem)
+               (if (not (eq elem +eonp+)) 
+                   (push elem rslt)))
+           (reverse rslt)))
+        (period-flag
+         (display "next" pattern)
+         (error (format nil "~A, next expected a pattern"
+                            (send pattern :name))))
+        ((patternp pattern)
+         ;(display "next" (send pattern :name) pattern)
+         (let (rslt)
+           (dotimes (i 10000 (error
+                 (format nil
+                  "~A, just retrieved 10000 empty periods -- is there a bug?"
+                  (send pattern :name))))
+             (if (not (member (setf rslt (send pattern :next)) 
+                              '(+eop+ +eonp+)))
+                 (return rslt)))))
+        (t ;; pattern not a pattern, so just return it:
+         ;(display "next" pattern)
+         pattern)))
+
+;; ---- LENGTH Class ----
+
+(setf length-class 
+  (send class :new '(pattern length-pattern) '() pattern-class))
+
+(send length-class :answer :isnew '(p l nm tr)
+  '((setf pattern p length-pattern l name nm trace tr)))
+
+;; note that count is used as a flag as well as a counter.
+;; If count is nil, then the pattern-length has not been
+;; determined. Count is nil intitially and again at the 
+;; end of each period. Otherwise, count is an integer
+;; used to count down the number of items remaining in 
+;; the period.
+
+(send length-class :answer :start-period '()
+  '((setf count (next length-pattern))))
+
+(send length-class :answer :advance '()
+  '((send self :set-current (next pattern))))
+
+(defun make-length (pattern length-pattern &key (name "length") trace)
+  (send length-class :new pattern length-pattern name trace))
+
+;; ---- CYCLE Class ---------
+
+(setf cycle-class (send class :new 
+                        '(lis cursor lis-pattern)
+                        '() pattern-class))
+
+(send cycle-class :answer :isnew '(l for nm tr)
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           (send self :set-list l))
+          (t
+           (error (format nil "~A, expected list" nm) l)))
+    (setf length-pattern for name nm trace tr)))
+
+
+(send cycle-class :answer :set-list '(l)
+  '((setf lis l)
+    (check-for-list lis "cycle-class :set-list")
+    (setf is-nested (list-has-pattern lis))
+    (setf lis (make-homogeneous lis))))
+
+
+(send cycle-class :answer :start-period '()
+  '(;(display "cycle-class :start-period" lis-pattern lis count length-pattern)
+    (cond (lis-pattern
+           (send self :set-list (next lis-pattern t))
+           (setf cursor lis)))
+    (if (null count)
+        (setf count (length lis)))))
+  
+
+(send cycle-class :answer :advance '()
+  '((cond ((and (null cursor) lis)
+           (setf cursor lis))
+          ((null cursor)
+           (error (format nil "~A, :advance - no items" name))))
+    (send self :set-current (car cursor))
+    (pop cursor)))
+
+
+(defun make-cycle (lis &key for (name "cycle") trace)
+   (check-for-list-or-pattern lis "make-cycle")
+   (send cycle-class :new lis for name trace))
+
+;; ---- LINE class ----
+
+(setf line-class (send class :new '(lis cursor lis-pattern) 
+                       '() pattern-class))
+
+(send line-class :answer :isnew '(l for nm tr)
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           (send self :set-list l))
+          (t
+           (error (format nil "~A, expected list" nm) l)))
+    (setf length-pattern for name nm trace tr)))
+
+(send line-class :answer :set-list '(l)
+  '((setf lis l)
+    (check-for-list lis "line-class :set-list")
+    (setf is-nested (list-has-pattern lis))
+    (setf lis (make-homogeneous l))
+    (setf cursor lis)))
+
+
+(send line-class :answer :start-period '()
+  '((cond (lis-pattern
+           (send self :set-list (next lis-pattern t))
+           (setf cursor lis)))
+    (if (null count)
+        (setf count (length lis)))))
+
+
+(send line-class :answer :advance '()
+  '((cond ((null cursor)
+           (error (format nil "~A, :advance - no items" name))))
+    (send self :set-current (car cursor))
+    (if (cdr cursor) (pop cursor))))
+  
+
+(defun make-line (lis &key for (name "line") trace)
+   (check-for-list-or-pattern lis "make-line")
+   (send line-class :new lis for name trace))
+
+
+;; ---- RANDOM class -----
+
+(setf random-class (send class :new 
+       '(lis lis-pattern len previous repeats mincnt maxcnt) 
+       '() pattern-class))
+
+;; the structure is (value weight weight-pattern max min)
+(setfn rand-item-value car)
+(defun set-rand-item-value (item value) (setf (car item) value))
+(setfn rand-item-weight cadr)
+(defun set-rand-item-weight (item weight) (setf (car (cdr item)) weight))
+(setfn rand-item-weight-pattern caddr)
+(setfn rand-item-max cadddr)
+(defun rand-item-min (lis) (car (cddddr lis)))
+
+
+(defun select-random (len lis previous repeats mincnt maxcnt)
+  (let (sum items r)
+    (cond ((zerop len)
+           (break "random-class has no list to choose from")
+           nil)
+          (t
+           (setf sum 0)
+           (dolist (item lis)
+             (setf sum (+ sum (rand-item-weight item))))
+           (setf items lis)
+           (setf r (rrandom))
+           (setf sum (* sum r))
+           (setf rbd-count-all (incf rbd-count-all))
+           (loop
+             (setf sum (- sum (rand-item-weight (car items))))
+             (if (<= sum 0) (return (car items)))
+             (setf rbd-count-two (incf rbd-count-two))
+             (setf items (cdr items)))))))
+
+
+(defun random-convert-spec (item)
+  ;; convert (value :weight wp :min min :max max) to (value nil wp max min)
+  (let (value (wp 1) mincnt maxcnt lis)
+    (setf value (car item))
+    (setf lis (cdr item))
+    (while lis
+      (cond ((eq (car lis) :weight)
+             (setf wp (cadr lis)))
+            ((eq (car lis) :min)
+             (setf mincnt (cadr lis)))
+            ((eq (car lis) :max)
+             (setf maxcnt (cadr lis)))
+            (t
+             (error "(make-random) item syntax error" item)))
+      (setf lis (cddr lis)))
+    (list value nil wp maxcnt mincnt)))
+
+
+(defun random-atom-to-list (a)
+  (if (atom a)
+      (list a nil 1 nil nil)
+      (random-convert-spec a)))
+
+
+(send random-class :answer :isnew '(l for nm tr)
+  ;; there are two things we have to normalize:
+  ;; (1) make all items lists
+  ;; (2) if any item is a pattern, make all items patterns
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           (send self :set-list l))
+          (t
+           (error (format nil "~A, expected list") l)))
+    (setf rbd-count-all 0 rbd-count-two 0)
+    (setf length-pattern for name nm trace tr)))
+
+
+(send random-class :answer :set-list '(l)
+  '((check-for-list l "random-class :set-list")
+    (setf lis (mapcar #'random-atom-to-list l))
+    (dolist (item lis)
+      (if (patternp (rand-item-value item))
+          (setf is-nested t)))
+    (if is-nested
+        (mapcar #'(lambda (item)
+                    (if (not (patternp (rand-item-value item)))
+                        (set-rand-item-value item 
+                         (make-cycle (list (rand-item-value item))))))
+                lis))
+    ;(display "random is-new" lis)
+    (setf repeats 0)
+    (setf len (length lis))))
+
+    
+(send random-class :answer :start-period '()
+  '(;(display "random-class :start-period" count len lis lis-pattern)
+    (cond (lis-pattern
+           (send self :set-list (next lis-pattern t))))
+    (if (null count)
+        (setf count len))
+    (dolist (item lis)
+      (set-rand-item-weight item (next (rand-item-weight-pattern item))))))
+
+
+(send random-class :answer :advance '()
+  '((let (selection (iterations 0))
+      ;(display "random-class :advance" mincnt repeats)
+      (cond ((and mincnt (< repeats mincnt))
+             (setf selection previous)
+             (incf repeats))
+            (t
+             (setf selection
+                   (select-random len lis previous repeats mincnt maxcnt))))
+      (loop ; make sure selection is ok, otherwise try again
+        (cond ((and (eq selection previous)
+                    maxcnt 
+                    (>= repeats maxcnt)) ; hit maximum limit, try again
+               (setf selection
+                     (select-random len lis previous repeats mincnt maxcnt))
+               (incf iterations)
+               (cond ((> iterations 10000)
+                      (error
+                        (format nil
+                         "~A, unable to pick next item after 10000 tries"
+                         name)
+                       lis))))
+              (t (return)))) ; break from loop, we found a selection
+
+        ; otherwise, we are ok
+        (if (not (eq selection previous))
+            (setf repeats 1)
+            (incf repeats))
+        (setf mincnt (rand-item-min selection))
+        (setf maxcnt (rand-item-max selection))
+        (setf previous selection)
+        ;(display "new selection" repeats mincnt maxcnt selection)
+        (send self :set-current (rand-item-value selection)))))
+      
+
+(defun make-random (lis &key for (name "random") trace)
+   (check-for-list-or-pattern lis "make-random")
+   (send random-class :new lis for name trace))
+
+
+;; ---- PALINDROME class -----
+
+#| Palindrome includes elide, which is either t, nil, :first, or :last.
+The pattern length is the "natural" length of the pattern, which goes
+forward and backward through the list. Thus, if the list is of length N,
+the palindrome length depends on elide as follows:
+    elide   length
+     nil      2N
+     t        2N - 2
+   :first     2N - 1
+   :last      2N - 1
+If elide is a pattern, and if length is not specified, then length should
+be computed based on elide. 
+|#
+
+
+(setf palindrome-class (send class :new 
+                         '(lis revlis lis-pattern 
+                           direction elide-pattern
+                           elide cursor)
+                         '() pattern-class))
+
+(send palindrome-class :answer :set-list '(l)
+  '((setf lis l)
+    (check-for-list lis "palindrome-class :start-period")
+    (setf is-nested (list-has-pattern lis))
+    (setf lis (make-homogeneous l))
+    (setf revlis (reverse lis)
+          direction t
+          cursor lis)))
+
+
+(send palindrome-class :answer :isnew '(l e for nm tr)
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           (send self :set-list l))
+          (t
+           (error (format nil "~A, expected list" nm) l)))
+    (setf elide-pattern e length-pattern for name nm trace tr)))
+
+
+(send palindrome-class :answer :start-period '()
+  '((cond (lis-pattern
+           (send self :set-list (next lis-pattern t))
+           (setf cursor lis)))
+    (setf elide (next elide-pattern))
+    (if (and elide (null lis))
+        (error (format nil "~A, cannot elide if list is empty" name)))
+    (if (null count)
+        (setf count (- (* 2 (length lis))
+                       (if (member elide '(:first :last)) 
+                           1
+                           (if elide 2 0)))))))
+
+
+(send palindrome-class :answer :next-item '()
+  '((send self :set-current (car cursor))
+    (pop cursor)
+    (cond ((and cursor (not (cdr cursor))
+                (or (and direction (member elide '(:last t)))
+                    (and (not direction) (member elide '(:first t)))))
+           (pop cursor)))))
+
+
+(send palindrome-class :answer :advance '()
+  '(
+    (cond (cursor
+           (send self :next-item))
+          (direction ;; we're going forward
+           (setf direction nil) ;; now going backward
+           (setf cursor revlis)
+           (send self :next-item))
+          (t ;; direction is reverse
+           (setf direction t)
+           (setf cursor lis)
+           (send self :next-item)))))
+
+
+(defun make-palindrome (lis &key elide for (name "palindrome") trace)
+  (check-for-list-or-pattern lis "make-palindrome")
+  (send palindrome-class :new lis elide for name trace))
+
+
+;; ================= HEAP CLASS ======================
+
+;; to handle the :max keyword, which tells the object to avoid
+;; repeating the last element of the previous period:
+;;
+;; maxcnt = 1 means "avoid the repetition"
+;; check-repeat signals we are at the beginning of the period and must check
+;; prev holds the previous value (initially nil)
+;; after each item is generated, check-repeat is cleared. It is
+;; recalculated when a new period is started.
+
+(setf heap-class (send class :new '(lis used maxcnt prev check-repeat
+                                    lis-pattern len)
+                       '() pattern-class))
+
+(send heap-class :answer :isnew '(l for mx nm tr)
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           ; make a copy of l to avoid side effects
+           (send self :set-list (append l nil)))
+          (t
+           (error (format nil "~A, expected list" nm) l)))
+    (setf length-pattern for maxcnt mx name nm trace tr)))
+
+
+(send heap-class :answer :set-list '(l)
+  '((setf lis l)
+    (check-for-list lis "heap-class :set-list")
+    (setf is-nested (list-has-pattern lis))
+    (setf lis (make-homogeneous lis))
+    (setf len (length lis))))
+
+
+(send heap-class :answer :start-period '()
+  '(;(display "heap-class :start-period" lis-pattern count lis)
+    (cond (lis-pattern
+           (send self :set-list (next lis-pattern t))))
+    ; start of period -- may need to avoid repeating previous item
+    (if (= maxcnt 1) (setf check-repeat t))
+    (if (null count)
+        (setf count len))))
+
+    
+(defun delete-first (elem lis)
+  (cond ((null lis) nil)
+        ((eq elem (car lis))
+         (cdr lis))
+        (t
+         (cons (car lis) (delete-first elem (cdr lis))))))
+
+
+;; NO-DISTINCT-ELEM -- check if any element of list is not val
+;;
+(defun no-distinct-elem (lis val)
+  (not 
+    (dolist (elem lis)
+      (if (not (equal elem val))
+          ;; there is a distinct element, return t from dolist
+          (return t)))))
+    ;; if no distinct element, dolist returns nil, but this is negated
+    ;; by the NOT so the function will return t
+
+
+(send heap-class :answer :advance '()
+  '((cond ((null lis)
+           (setf lis used)
+           (setf used nil)))
+    (let (n elem)
+      (cond ((and check-repeat (no-distinct-elem lis prev))
+             (error (format nil "~A, cannot avoid repetition, but :max is 1"
+                                name))))
+      (loop 
+        (setf n (random (length lis)))
+        (setf elem (nth n lis))
+        (if (or (not check-repeat) (not (equal prev elem))) 
+            (return))) ;; loop until suitable element is chosen
+      (setf lis (delete-first elem lis))
+      (push elem used)
+      (setf check-repeat nil)
+      (setf prev elem)
+      (send self :set-current elem))))
+
+(defun make-heap (lis &key for (max 2) (name "heap") trace)
+  (send heap-class :new lis for max name trace))
+
+;;================== COPIER CLASS ====================
+
+(setf copier-class (send class :new '(sub-pattern repeat repeat-pattern 
+                                      merge merge-pattern period cursor) 
+                                    '() pattern-class))
+
+(send copier-class :answer :isnew '(p r m for nm tr)
+  '((setf sub-pattern p repeat-pattern r merge-pattern m)
+    (setf length-pattern for name nm trace tr)))
+
+
+#| copier-class makes copies of periods from sub-pattern
+
+If merge is true, the copies are merged into one big period.
+If merge is false, then repeat separate periods are returned.
+If repeat is negative, then -repeat periods of sub-pattern
+are skipped.
+
+merge and repeat are computed from merge-pattern and 
+repeat-pattern initially and after making repeat copies
+
+To repeat individual items, set the :for keyword parameter of
+the sub-pattern to 1.
+|#
+
+(send copier-class :answer :start-period '()
+  '((cond ((null count) 
+           (cond ((or (null repeat) (zerop repeat))
+                  (send self :really-start-period))
+                 (t
+                  (setf count (length period))))))))
+
+
+(send copier-class :answer :really-start-period '()
+  '(;(display "copier-class :really-start-period" count)
+    (setf merge (next merge-pattern))
+    (setf repeat (next repeat-pattern))
+    (while (minusp repeat)
+      (dotimes (i (- repeat))
+        (setf period (next sub-pattern t)))
+      (setf repeat (next repeat-pattern))
+      (setf merge (next merge-pattern)))
+    (setf period (next sub-pattern t))
+    (setf cursor nil)
+    (if (null count)
+        (setf count (* (if merge repeat 1)
+                       (length period))))))
+
+
+(send copier-class :answer :advance '()
+  '((let ((loop-count 0))
+      (loop
+        ;(display "copier loop" repeat cursor period)
+        (cond (cursor
+               (send self :set-current (car cursor))
+               (pop cursor)
+               (return))
+              ((plusp repeat)
+               (decf repeat)
+               (setf cursor period))
+              ((> loop-count 10000)
+               (error (format nil
+                "~A, copier-class :advance encountered 10000 empty periods"
+                name)))
+              (t
+               (send self :really-start-period)))
+        (incf loop-count)))))
+
+
+(defun make-copier (sub-pattern &key for (repeat 1) merge (name "copier") trace)
+  (send copier-class :new sub-pattern repeat merge for name trace))
+   
+;; ================= ACCUMULATE-CLASS ===================
+
+(setf accumulate-class (send class :new '(sub-pattern period cursor sum mini maxi) 
+                                    '() pattern-class))
+
+
+(send accumulate-class :answer :isnew '(p for nm tr mn mx)
+  '((setf sub-pattern p length-pattern for name nm trace tr sum 0 mini mn maxi mx)
+    ; (display "accumulate isnew" self nm)
+    ))
+
+
+#| 
+accumulate-class creates sums of numbers from another pattern
+The output periods are the same as the input periods (by default).
+|#
+
+(send accumulate-class :answer :start-period '()
+  '((cond ((null count)
+           (send self :really-start-period)))))
+
+
+(send accumulate-class :answer :really-start-period '()
+  '((setf period (next sub-pattern t))
+    (setf cursor period)
+    ;(display "accumulate-class :really-start-period" period cursor count)
+    (if (null count)
+        (setf count (length period)))))
+
+
+(send accumulate-class :answer :advance '()
+  '((let ((loop-count 0) (minimum (next mini)) (maximum (next maxi)))
+      (loop
+        (cond (cursor
+               (setf sum (+ sum (car cursor)))
+               (cond ((and (numberp minimum) (< sum minimum))
+                      (setf sum minimum)))
+               (cond ((and (numberp maximum) (> sum maximum))
+                      (setf sum maximum)))
+               (send self :set-current sum)
+               (pop cursor)
+               (return))
+              ((> loop-count 10000)
+               (error (format nil
+                "~A, :advance encountered 10000 empty periods" name)))
+              (t
+               (send self :really-start-period)))
+        (incf loop-count)))))
+
+
+(defun make-accumulate (sub-pattern &key for min max (name "accumulate") trace)
+  (send accumulate-class :new sub-pattern for name trace min max))
+   
+;;================== ACCUMULATION CLASS ===================
+
+;; for each item, generate all items up to and including the item, e.g.
+;; (a b c) -> (a a b a b c)
+
+(setf accumulation-class (send class :new '(lis lis-pattern outer inner len)
+                               '() pattern-class))
+
+(send accumulation-class :answer :isnew '(l for nm tr)
+  '((cond ((patternp l)
+           (setf lis-pattern l))
+          ((listp l)
+           (send self :set-list l))
+          (t
+           (error (format nil "~A, expected list" nm) l)))
+      (setf length-pattern for name nm trace tr)))
+
+(send accumulation-class :answer :set-list '(l)
+  '((setf lis l)
+    (check-for-list lis "heap-class :set-list")
+    (setf lis (make-homogeneous lis))
+    (setf inner lis)
+    (setf outer lis)
+    (setf len (length lis))))
+
+(send accumulation-class :answer :start-period '()
+  '((cond (lis-pattern
+           (send self :set-list (next lis-pattern t))))
+    ; start of period, length = (n^2 + n) / 2
+    (if (null count) (setf count (/ (+ (* len len) len) 2)))))
+
+(send accumulation-class :answer :advance '()
+  ;; inner traverses lis from first to outer
+  ;; outer traverses lis
+  '((let ((elem (car inner)))
+      (cond ((eq inner outer)
+             (setf outer (rest outer))
+             (setf outer (if outer outer lis))
+             (setf inner lis))
+            (t
+             (setf inner (rest inner))))
+      (send self :set-current elem))))
+
+(defun make-accumulation (lis &key for (name "accumulation") trace)
+  (send accumulation-class :new lis for name trace))
+
+
+;;================== SUM CLASS =================
+
+(setf sum-class (send class :new '(x y period cursor fn) '() pattern-class))
+
+(send sum-class :answer :isnew '(xx yy for nm tr)
+  '((setf x xx y yy length-pattern for name nm trace tr fn #'+)))
+
+#|
+sum-class creates pair-wise sums of numbers from 2 streams.
+The output periods are the same as the input periods of the first
+pattern argument (by default).
+|#
+
+(send sum-class :answer :start-period '()
+  '((cond ((null count)
+           (send self :really-start-period)))))
+
+(send sum-class :answer :really-start-period '()
+  '((setf period (next x t))
+    (setf cursor period)
+    (if (null count)
+        (setf count (length period)))))
+
+(send sum-class :answer :advance '()
+  '((let ((loop-count 0) rslt)
+      (loop
+        (cond (cursor
+               (setf rslt (funcall fn (car cursor) (next y)))
+               (send self :set-current rslt)
+               (pop cursor)
+               (return))
+              ((> loop-count 10000)
+               (error (format nil
+                       "~A, :advance encountered 10000 empty periods" name)))
+              (t
+               (send self :really-start-period)))
+        (incf loop-count)))))
+
+
+(defun make-sum (x y &key for (name "sum") trace)
+  (send sum-class :new x y for name trace))               
+
+
+;;================== PRODUCT CLASS =================
+
+(setf product-class (send class :new '() '() sum-class))
+
+(send product-class :answer :isnew '(xx yy for nm tr)
+  '((setf x xx y yy length-pattern for name nm trace tr fn #'*)))
+
+(defun make-product (x y &key for (name "product") trace)
+  (send product-class :new x y for name trace))               
+
+
+;;================== EVAL CLASS =================
+
+(setf eval-class (send class :new '(expr expr-pattern) 
+                       '() pattern-class))
+
+(send eval-class :answer :isnew '(e for nm tr)
+  '((cond ((patternp e)
+           (setf expr-pattern e))
+          (t
+           (setf expr e)))
+    (setf length-pattern for name nm trace tr)))
+
+
+(send eval-class :answer :start-period '()
+  '(;(display "cycle-class :start-period" lis-pattern lis count length-pattern)
+    (cond (expr-pattern
+           (setf expr (next expr-pattern))))))
+  
+
+(send eval-class :answer :advance '()
+  '((send self :set-current (eval expr))))
+
+
+(defun make-eval (expr &key (for 1) (name "eval") trace)
+   (send eval-class :new expr for name trace))
+
+;;================== MARKOV CLASS ====================
+
+(setf markov-class (send class :new 
+      '(rules order state produces pattern len) 
+      '() pattern-class))
+
+
+(defun is-produces-homogeneous (produces)
+  (let (type elem)
+    (setf *rslt* nil)
+    (loop
+      (cond ((or (null produces) (eq produces :eval) (null (cadr produces)))
+             (return t)))
+      (setf elem (cadr produces))
+      (cond ((null type)
+             (setf type (if (patternp elem) 'pattern 'atom))
+           ;(display "is-produces-homogeneous" type)
+             (setf *rslt* (eq type 'pattern))
+             ;(display "is-produces-homogeneous" *rslt*)
+             )
+            ((and (eq type 'pattern) (not (patternp elem)))
+             (return nil))
+            ((and (eq type 'atom)
+                  (patternp elem))
+             (return nil)))
+      (setf produces (cddr produces)))))
+
+
+(defun make-produces-homogeneous (produces)
+  (let (result item)
+    (loop
+      (if (null produces) (return nil))
+      (push (car produces) result)
+      (setf produces (cdr produces))
+      (setf item (car produces))
+      (setf produces (cdr produces))
+      (if (not (patternp item)) 
+        (setf item (make-cycle (list item))))
+      (push item result))
+    (reverse result)))
+
+
+(send markov-class :answer :isnew '(r o s p for nm tr)
+  ;; input parameters are rules, order, state, produces, for, name, trace
+  '((setf order o state s produces p length-pattern for name nm trace tr)
+    (setf len (length r))
+    ;; input r looks like this:
+    ;; ((prev1 prev2 -> next1 next2 (next3 weight) ... ) ...)
+    ;; transition table will look like a list of these:
+    ;; ((prev1 prev2 ... prevn) (next1 weight weight-pattern) ...)
+    (dolist (rule r)
+      (let ((targets (cdr (nthcdr order rule)))
+            entry pattern)
+        ;; build entry in reverse order
+        (dolist (target targets)
+          (push (if (atom target)
+                    (list target 1 1) 
+                    (list (first target) 
+                          (next (second target)) 
+                          (second target))) 
+                entry))
+        ; (display "isnew" entry rule targets order (nthcdr order rule))
+        (dotimes (i order)
+          (push (nth i rule) pattern))
+        (push (cons (reverse pattern) entry) rules)))
+    (setf rules (reverse rules)) ;; keep rules in original order
+    (setf *rslt* nil) ;; in case produces is nil
+    (cond ((and produces (not (is-produces-homogeneous produces)))
+           (setf produces (make-produces-homogeneous produces))))
+    ;(display "markov-class :isnew" *rslt*)
+    (setf is-nested *rslt*) ;; returned by is-produces-homogeneous
+    ;(display "markov-class :isnew" is-nested)
+    ))
+
+
+(defun markov-match (state pattern)
+  (dolist (p pattern t) ;; return true if no mismatch
+    ;; compare element-by-element
+    (cond ((eq p '*)) ; anything matches '*
+          ((eql p (car state)))
+          (t (return nil))) ; a mismatch: return false
+    (setf state (cdr state))))
+
+(defun markov-sum-of-weights (rule)
+  ;(display "sum-of-weights" rule)
+  (let ((sum 0.0))
+    (dolist (target (cdr rule))
+      ;(display "markov-sum-of-weights" target)
+      (setf sum (+ sum (second target))))
+    sum))
+
+
+(defun markov-pick-target (sum rule)
+  (let ((total 0.0)
+        ;; want to choose a value in the interval [0, sum)
+        ;; but real-random is not open on the right, so fudge
+        ;; the range by a small amount:
+        (r (real-random 0.0 (- sum SCORE-EPSILON))))
+    (dolist (target (cdr rule))
+      (setf total (+ total (second target)))
+      (cond ((> total r) (return (car target)))))))
+
+
+(defun markov-update-weights (rule)
+  (dolist (target (cdr rule))
+    (setf (car (cdr target)) (next (caddr target)))))
+
+
+(defun markov-map-target (target produces)
+  (while (and produces (not (eq target (car produces))))
+    (setf produces (cddr produces)))
+  (cadr produces))
+
+
+(send markov-class :answer :find-rule '()
+  '((let (rslt)
+      ;(display "find-rule" rules)
+      (dolist (rule rules)
+        ;(display "find-rule" state rule)
+        (cond ((markov-match state (car rule))
+               (setf rslt rule)
+               (return rslt))))
+      (cond ((null rslt)
+             (display "Error, no matching rule found" state rules)
+             (error (format nil "~A, (markov-class)" name))))
+      rslt)))
+
+
+(send markov-class :answer :start-period '()
+  '((if (null count)
+        (setf count len))))
+
+(defun markov-general-rule-p (rule)
+  (let ((pre (car rule)))
+    (cond ((< (length pre) 2) nil) ;; 1st-order mm
+          (t
+           ;; return false if any member not *
+           ;; return t if all members are *
+           (dolist (s pre t)
+             (if (eq s '*) t (return nil)))))))
+
+(defun markov-find-state-leading-to (target rules)
+  (let (candidates)
+    (dolist (rule rules)
+      (let ((targets (cdr rule)))
+        (dolist (targ targets)
+          (cond ((eql (car targ) target)
+                 (push (car rule) candidates))))))
+    (cond (candidates ;; found at least one
+           (nth (random (length candidates)) candidates))
+          (t
+           nil))))
+
+(send markov-class :answer :advance '()
+  '((let (rule sum target rslt new-state)
+      ;(display "markov" pattern rules)
+      (setf rule (send self :find-rule))
+      ;(display "advance 1" rule)
+      (markov-update-weights rule)
+      ;(display "advance 2" rule)
+      (setf sum (markov-sum-of-weights rule))
+      ;; the target can be a pattern, so apply NEXT to it
+      (setf target (next (markov-pick-target sum rule)))
+      ;; if the matching rule is multiple *'s, then this
+      ;; is a higher-order Markov model, and we may now
+      ;; wander around in parts of the state space that
+      ;; never appeared in the training data. To avoid this
+      ;; we violate the strict interpretation of the rules
+      ;; and pick a random state sequence from the rule set
+      ;; that might have let to the current state. We jam
+      ;; this state sequence into state so that when we
+      ;; append target, we'll have a history that might
+      ;; have a corresponding rule next time.
+      (cond ((markov-general-rule-p rule)
+             (setf new-state (markov-find-state-leading-to target rules))
+             (cond (new-state
+                    ;(display "state replacement" new-state target)
+                    (setf state new-state)))))
+      (setf state (append (cdr state) (list target)))
+      ;(display "markov next" rule sum target state)
+      ;; target is the symbol for the current state. We can
+      ;; return target (default), the value of target, or a
+      ;; mapped value:
+      (cond ((eq produces :eval)
+             (setf target (eval target)))
+            ((and produces (listp produces))
+             ;(display "markov-produce" target produces)
+             (setf target (markov-map-target target produces))))
+      (if (not (eq is-nested (patternp target)))
+          (error (format nil 
+         "~A :is-nested keyword (~A) not consistent with result (~A)"
+                  name is-nested target)))
+      (send self :set-current target))))
+
+
+(defun make-markov (rules &key produces past for (name "markov") trace)
+  ;; check to make sure past and rules are consistent
+  (let ((order (length past)))
+    (dolist (rule rules)
+      (dotimes (i order)
+        (if (eq (car rule) '->)
+            (error (format nil "~A, a rule does not match the length of :past"
+                               name)))
+        (pop rule))
+      (if (eq (car rule) '->) nil
+          (error (format nil "~A, a rule does not match the length of :past"
+                             name)))))
+  (cond ((null for)
+         (setf for (length rules))))
+  (send markov-class :new rules (length past) past produces for name trace))
+
+
+(defun markov-rule-match (rule state)
+  (cond ((null state) t)
+        ((eql (car rule) (car state))
+         (markov-rule-match (cdr rule) (cdr state)))
+        (t nil)))
+
+
+(defun markov-find-rule (rules state)
+  (dolist (rule rules)
+    ;(display "find-rule" rule)
+    (cond ((markov-rule-match rule state)
+           (return rule)))))
+
+;; ------- functions below are for MARKOV-CREATE-RULES --------
+
+;; MARKOV-FIND-CHOICE -- given a next state, find it in rule
+;;
+;; use state to get the order of the Markov model, e.g. how
+;; many previous states to skip in the rule, (add 1 for '->).
+;; then use assoc to do a quick search
+;;
+;; example:
+;;  (markov-find-choice '(a b -> (c 1) (d 2)) '(a b) 'd)
+;; returns (d 2) from the rule
+;;
+(defun markov-find-choice (rule state next)
+  (assoc next (nthcdr (1+ (length state)) rule)))
+
+(defun markov-update-rule (rule state next)
+  (let ((choice (markov-find-choice rule state next)))
+    (cond (choice
+           (setf (car (cdr choice)) (1+ (cadr choice))))
+          (t
+           (nconc rule (list (list next 1)))))
+    rule))
+
+
+(defun markov-update-rules (rules state next)
+  (let ((rule (markov-find-rule rules state)))
+    (cond (rule
+           (markov-update-rule rule state next))
+          (t
+           (setf rules
+                 (nconc rules 
+                        (list (append state
+                                      (cons '-> (list 
+                                                 (list next 1)))))))))
+    rules))
+
+
+;; MARKOV-UPDATE-HISTOGRAM -- keep a list of symbols and counts
+;; 
+;; This histogram will become the right-hand part of a rule, so
+;; the format is ((symbol count) (symbol count) ...)
+;;
+(defun markov-update-histogram (histogram next)
+  (let ((pair (assoc next histogram)))
+    (cond (pair
+           (setf (car (cdr pair)) (1+ (cadr pair))))
+          (t
+           (setf histogram (cons (list next 1) histogram))))
+    histogram))
+
+
+(defun markov-create-rules (sequence order &optional generalize)
+  (let ((seqlen (length sequence)) state rules next histogram rule)
+    (cond ((<= seqlen order)
+           (error "markov-create-rules: sequence must be longer than order"))
+          ((< order 1)
+           (error "markov-create-rules: order must be 1 or greater")))
+    ; build initial state sequence
+    (dotimes (i order)
+      (setf state (nconc state (list (car sequence))))
+      (setf sequence (cdr sequence)))
+    ; for each symbol, either update a rule or add a rule
+    (while sequence
+      (setf next (car sequence))
+      (setf sequence (cdr sequence))
+      (setf rules (markov-update-rules rules state next))
+      (setf histogram (markov-update-histogram histogram next))
+      ; shift next state onto current state list
+      (setf state (nconc (cdr state) (list next))))
+    ; generalize?
+    (cond (generalize
+           (setf rule (cons '-> histogram))
+           (dotimes (i order)
+             (setf rule (cons '* rule)))
+           (setf rules (nconc rules (list rule)))))
+    rules))
+
+
+;; ----- WINDOW Class ---------
+
+(setf window-class (send class :new 
+                         '(pattern skip-pattern lis cursor)
+                         '() pattern-class))
+
+(send window-class :answer :isnew '(p for sk nm tr)
+  '((setf pattern p length-pattern for skip-pattern sk name nm trace tr)))
+
+
+(send window-class :answer :start-period '()
+  '((if (null count) (error (format nil "~A, :start-period -- count is null"
+                                        name)))
+    (cond ((null lis) ;; first time
+           (dotimes (i count)
+             (push (next pattern) lis))
+           (setf lis (reverse lis)))
+          (t
+           (let ((skip (next skip-pattern)))
+             (dotimes (i skip)
+               (if lis (pop lis) (next pattern))))
+           (setf lis (reverse lis))
+           (let ((len (length lis)))
+             (while (< len count)
+               (incf len)
+               (push (next pattern) lis))
+             (while (> len count)
+               (decf len)
+               (pop lis))
+             (setf lis (reverse lis)))))
+    (setf cursor lis)))
+
+
+(send window-class :answer :advance '()
+  '((send self :set-current (car cursor))
+    (pop cursor)))
+
+(defun make-window (pattern length-pattern skip-pattern
+                    &key (name "window") trace)
+  (send window-class :new pattern length-pattern skip-pattern name trace))
+
+;; SCORE-SORTED -- test if score is sorted
+;;
+(defun score-sorted (score)
+  (let ((result t))
+    (while (cdr score)
+      (cond ((event-before (cadr score) (car score))
+             (setf result nil)
+             (return nil)))
+      (setf score (cdr score)))
+    result))
+    
+
+(defmacro score-gen (&rest args)
+  (let (key val tim dur (name ''note) ioi trace save 
+        score-len score-dur others pre post
+        next-expr (score-begin 0) score-end)
+    (while (and args (cdr args))
+      (setf key (car args))
+      (setf val (cadr args))
+      (setf args (cddr args))       
+      (case key
+        (:time (setf tim val))
+        (:dur (setf dur val))
+        (:name (setf name val))
+        (:ioi (setf ioi val))
+        (:trace (setf trace val))
+        (:save (setf save val))
+        (:pre (setf pre val))
+        (:post (setf post val))
+        (:score-len (setf score-len val))
+        (:score-dur (setf score-dur val))
+        (:begin (setf score-begin val))
+        (:end (setf score-end val))
+        (t (setf others (cons key (cons val others))))))
+    ;; make sure at least one of score-len, score-dur is present
+    (cond ((and (null score-len) (null score-dur))
+           (error
+           "score-gen needs either :score-len or :score-dur to limit length")))
+    ;; compute expression for dur
+    (cond ((null dur)
+           (setf dur 'sg:ioi)))
+    ;; compute expression for ioi
+    (cond ((null ioi)
+           (setf ioi 1)))
+    ;; compute expression for next start time
+    (setf next-expr '(+ sg:start sg:ioi))
+    ; (display "score-gen" others)
+    `(let (sg:seq (sg:start ,score-begin) sg:ioi 
+           (sg:score-len ,score-len) (sg:score-dur ,score-dur)
+           (sg:count 0) (sg:save ,save) 
+           (sg:begin ,score-begin) (sg:end ,score-end))
+       ;; make sure at least one of score-len, score-dur is present
+       (loop
+         (cond ((or (and sg:score-len (<= sg:score-len sg:count))
+                    (and sg:score-dur (<= (+ sg:begin sg:score-dur) sg:start)))
+                (return)))
+         ,pre
+         ,(cond (tim (list 'setf 'sg:start tim)))
+         (setf sg:ioi ,ioi)
+         (setf sg:dur ,dur)
+         (push (list sg:start sg:dur (list ,name , at others))
+               sg:seq)
+         ,post
+         (cond (,trace
+                (format t "get-seq trace at ~A stretch ~A: ~A~%" 
+                          sg:start sg:dur (car sg:seq))))
+         (incf sg:count)
+         (setf sg:start ,next-expr))
+       (setf sg:seq (reverse sg:seq))
+       ;; avoid sorting a sorted list -- XLisp's quicksort can overflow the
+       ;; stack if the list is sorted because (apparently) the pivot points
+       ;; are not random.
+       (cond ((not (score-sorted sg:seq))
+              (setf sg:seq (bigsort sg:seq #'event-before))))
+       (cond ((and sg:seq (null sg:end))
+              (setf sg:end (event-end (car (last sg:seq)))))
+             ((null sg:end)
+              (setf sg:end 0)))
+       (push (list 0 0 (list 'SCORE-BEGIN-END ,score-begin sg:end)) sg:seq)
+       (cond (sg:save (set sg:save sg:seq)))
+       sg:seq)))
+
+;; ============== score manipulation ===========
+
+(defun event-before (a b)
+  (< (car a) (car b)))
+
+;; EVENT-END -- get the ending time of a score event
+;;
+(defun event-end (e) (+ (car e) (cadr e)))
+
+;; EVENT-TIME -- time of an event
+;;
+(setfn event-time car)
+
+;; EVENT-DUR -- duration of an event
+;;
+(setfn event-dur cadr)
+
+;; EVENT-SET-TIME -- new event with new time
+;;
+(defun event-set-time (event time)
+  (cons time (cdr event)))
+
+
+;; EVENT-SET-DUR -- new event with new dur
+;;
+(defun event-set-dur (event dur)
+  (list (event-time event) 
+        dur 
+        (event-expression event)))
+  
+  
+;; EVENT-SET-EXPRESSION -- new event with new expression
+;;
+(defun event-set-expression (event expression)
+  (list (event-time event) 
+        (event-dur event)
+        expression))
+  
+;; EXPR-HAS-ATTR -- test if expression has attribute
+;;
+(defun expr-has-attr (expression attr)
+  (member attr expression))
+
+
+;; EXPR-GET-ATTR -- get value of attribute from expression
+;;
+(defun expr-get-attr (expression attr &optional default)
+  (let ((m (member attr expression)))
+    (if m (cadr m) default)))
+
+
+;; EXPR-SET-ATTR -- set value of an attribute in expression
+;; (returns new expression)
+(defun expr-set-attr (expr attr value)
+  (cons (car expr) (expr-parameters-set-attr (cdr expr) attr value)))
+
+(defun expr-parameters-set-attr (lis attr value)
+  (cond ((null lis) (list attr value))
+        ((eq (car lis) attr) (cons attr (cons value (cddr lis))))
+        (t (cons (car lis) 
+                 (cons (cadr lis) 
+                       (expr-parameters-set-attr (cddr lis) attr value))))))
+
+
+;; EXPR-REMOVE-ATTR -- expression without attribute value pair
+(defun expr-remove-attr (event attr)
+  (cons (car expr) (expr-parameters-remove-attr (cdr expr) attr)))
+
+(defun expr-parameters-remove-attr (lis attr)
+   (cond ((null lis) nil)
+         ((eq (car lis) attr) (cddr lis))
+         (t (cons (car lis)
+                  (cons (cadr lis)
+                        (expr-parameters-remove-attr (cddr lis) attr))))))
+
+
+;; EVENT-GET-ATTR -- get value of attribute from event
+;;
+(defun event-get-attr (note attr &optional default)
+  (expr-get-attr (event-expression note) attr default))
+
+
+;; EVENT-SET-ATTR -- new event with attribute = value
+(defun event-set-attr (event attr value)
+  (event-set-expression 
+    event
+    (expr-set-attr (event-expression event) attr value)))
+
+
+;; EVENT-REMOVE-ATTR -- new event without atttribute value pair
+(defun event-remove-attr (event attr)
+  (event-set-expression
+     event
+     (event-remove-attr (event-expression event) attr)))
+
+
+;; SCORE-GET-BEGIN -- get the begin time of a score
+;;
+(defun score-get-begin (score)
+  (setf score (score-must-have-begin-end score))
+  (cadr (event-expression (car score))))
+
+
+;; SCORE-SET-BEGIN -- set the begin time of a score
+;;
+(defun score-set-begin (score time)
+  (setf score (score-must-have-begin-end score))
+  (cons (list 0 0 (list 'score-begin-end time 
+                        (caddr (event-expression (car score)))))
+        (cdr score)))
+
+
+;; SCORE-GET-END -- get the end time of a score
+;;
+(defun score-get-end (score)
+  (setf score (score-must-have-begin-end score))
+  (caddr (event-expression (car score))))
+
+
+;; SCORE-SET-END -- set the end time of a score
+;;
+(defun score-set-end (score time)
+  (setf score (score-must-have-begin-end score))
+  (cons (list 0 0 (list 'score-begin-end 
+                        (cadr (event-expression (car score))) time))
+        (cdr score)))
+
+
+;; FIND-FIRST-NOTE -- use keywords to find index of first selected note
+;;
+(defun find-first-note (score from-index from-time)
+  (let ((s (cdr score)))
+    ;; offset by one because we removed element 0
+    (setf from-index (if from-index (max 0 (- from-index 1)) 0))
+    (setf from-time (if from-time 
+                        (- from-time SCORE-EPSILON)
+                        (- SCORE-EPSILON)))
+    (if s (setf s (nthcdr from-index s)))
+    
+    (while (and s (>= from-time (event-time (car s))))
+      (setf s (cdr s))
+      (incf from-index))
+    (1+ from-index)))
+
+
+;; EVENT-BEFORE -- useful function for sorting scores
+;;
+(defun event-before (a b)
+  (< (car a) (car b)))
+  
+;; bigsort -- a sort routine that avoids recursion in order
+;; to sort large lists without overflowing the evaluation stack
+;;
+;; Does not modify input list. Does not minimize cons-ing.
+;;
+;; Algorithm: first accumulate sorted sub-sequences into lists
+;; Then merge pairs iteratively until only one big list remains
+;; 
+(defun bigsort (lis cmp) ; sort lis using cmp function
+  ;; if (funcall cmp a b) then a and b are in order
+  (prog (rslt sub pairs)
+    ;; first, convert to sorted sublists stored on rslt
+    ;; accumulate sublists in sub
+   get-next-sub
+    (if (null lis) (go done-1))
+    (setf sub (list (car lis)))
+    (setf lis (cdr lis))
+   fill-sub
+    ;; invariant: sub is non-empty, in reverse order
+    (cond ((and lis (funcall cmp (car sub) (car lis)))
+           (setf sub (cons (car lis) sub))
+           (setf lis (cdr lis))
+           (go fill-sub)))
+    (setf sub (reverse sub)) ;; put sub in correct order
+    (setf rslt (cons sub rslt)) ;; build rslt in reverse order
+    (go get-next-sub)
+   done-1
+    ;; invariant: rslt is list of sorted sublists
+    (if (cdr rslt) nil (go done-2))
+    ;; invariant: rslt has at least one list
+    (setf pairs rslt)
+    (setf rslt nil)
+   merge-pairs    ;; merge a pair and save on rslt
+    (if (car pairs) nil (go end-of-pass)) ;; loop until all pairs merged
+    ;; invariant: pairs has at least one list
+    (setf list1 (car pairs)) ;; list1 is non-empty
+    (setf list2 (cadr pairs)) ;; list2 could be empty
+    (setf pairs (cddr pairs))
+    (cond (list2
+           (setf rslt (cons (list-merge list1 list2 cmp) rslt)))
+          (t
+           (setf rslt (cons list1 rslt))))
+    (go merge-pairs)
+   end-of-pass
+    (go done-1)
+   done-2
+    ;; invariant: rslt has one sorted list!
+    (return (car rslt))))
+
+(defun list-merge (list1 list2 cmp)
+  (prog (rslt)
+   merge-loop
+    (cond ((and list1 list2)
+           (cond ((funcall cmp (car list1) (car list2))
+                  (setf rslt (cons (car list1) rslt))
+                  (setf list1 (cdr list1)))
+                 (t
+                  (setf rslt (cons (car list2) rslt))
+                  (setf list2 (cdr list2)))))
+          (list1
+           (return (nconc (reverse rslt) list1)))
+          (t
+           (return (nconc (reverse rslt) list2))))
+    (go merge-loop)))  
+
+
+;; SCORE-SORT -- sort a score into time order
+;;
+(defun score-sort (score &optional (copy-flag t)) 
+  (setf score (score-must-have-begin-end score))
+  (let ((begin-end (car score)))
+    (setf score (cdr score))
+    (if copy-flag (setf score (append score nil)))
+    (cons begin-end (bigsort score #'event-before))))
+  
+
+;; PUSH-SORT -- insert an event in (reverse) sorted order
+;;
+;; Note: Score should NOT have a score-begin-end expression
+;;
+(defun push-sort (event score)
+  (let (insert-after)
+    (cond ((null score) (list event))
+          ((event-before (car score) event)
+           (cons event score))
+          (t
+           (setf insert-after score)
+           (while (and (cdr insert-after) 
+                       (event-before event (cadr insert-after)))
+             (setf insert-after (cdr insert-after)))
+           (setf (cdr insert-after) (cons event (cdr insert-after)))
+           score))))
+
+
+(setf FOREVER 3600000000.0) ; 1 million hours
+
+;; FIND-LAST-NOTE -- use keywords to find index beyond last selected note
+;;
+;; note that the :to-index keyword is the index of the last note (numbered
+;; from zero), whereas this function returns the index of the last note
+;; plus one, i.e. selected notes have an index *less than* this one
+;;
+(defun find-last-note (score to-index to-time)
+  ;; skip past score-begin-end event
+  (let ((s (cdr score))
+        (n 1))
+    (setf to-index (if to-index (1+ to-index) (length score)))
+    (setf to-time (if to-time (- to-time SCORE-EPSILON)  FOREVER))
+    (while (and s (< n to-index) (< (event-time (car s)) to-time))
+      (setf s (cdr s))
+      (incf n))
+    n))
+
+
+;; SCORE-MUST-HAVE-BEGIN-END -- add score-begin-end event if necessary
+;;
+(defun score-must-have-begin-end (score)
+  (cond ((null score) 
+         (list (list 0 0 (list 'SCORE-BEGIN-END 0 0))))
+        ((eq (car (event-expression (car score))) 'SCORE-BEGIN-END)
+         score)
+        (t (cons (list 0 0 (list 'SCORE-BEGIN-END (event-time (car score))
+                                 (event-end (car (last score)))))
+                 score))))
+
+
+;; SCORE-SHIFT -- add offset to times of score events
+;;
+(defun score-shift (score offset &key from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((i 1) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        (end (caddr (event-expression (car score))))
+        result)
+    (dolist (event (cdr score))
+      (cond ((and (<= start i) (< i stop))
+             (setf event (event-set-time 
+                          event (+ (event-time event) offset)))
+             (setf end (max end (event-end event)))))
+      (setf result (push-sort event result))
+      (incf i))
+    (cons (list 0 0 (list 'SCORE-BEGIN-END
+                          (cadr (event-expression (car score)))
+                          end))
+          (reverse result))))
+
+
+;; TIME-STRETCH -- map a timestamp according to stretch factor
+;;
+(defun time-stretch (time stretch start-time stop-time)
+  (cond ((< time start-time) time)
+        ((< time stop-time) 
+         (+ start-time (* stretch (- time start-time))))
+        (t ; beyond stop-time
+         (+ (- time stop-time) ; how much beyond stop-time
+            start-time
+            (* stretch (- stop-time start-time))))))
+         
+
+;; EVENT-STRETCH -- apply time warp to an event
+(defun event-stretch (event stretch dur-flag time-flag start-time stop-time)
+  (let* ((new-time (event-time event))
+         (new-dur (event-dur event))
+         (end-time (+ new-time new-dur)))
+    (cond (time-flag
+           (setf new-time (time-stretch new-time stretch 
+                                        start-time stop-time))))
+    (cond ((and time-flag dur-flag)
+           ;; both time and dur are stretched, so map the end time just
+           ;; like the start time, then subtract to get new duration
+           (setf end-time (time-stretch end-time stretch
+                                        start-time stop-time))
+           (setf new-dur (- end-time new-time)))
+          ((and dur-flag (>= new-time start-time) (< new-time stop-time))
+           ;; stretch only duration, not time. If note starts in range
+           ;; scale to get the new duration.
+           (setf new-dur (* stretch new-dur))))
+    (list new-time new-dur (event-expression event))))
+
+
+;; SCORE-STRETCH -- stretch a region of the score
+;;
+(defun score-stretch (score factor &key (dur t) (time t)
+                      from-index to-index (from-time 0) (to-time FOREVER))
+  (setf score (score-must-have-begin-end score))
+  (let ((begin-end (event-expression (car score)))
+        (i 1))
+    (if from-index
+        (setf from-time (max from-time 
+                             (event-time (nth from-index score)))))
+    (if to-index
+        (setf to-time (min to-time 
+                           (event-end (nth to-index score)))))
+    ; stretch from start-time to stop-time
+    (cons (list 0 0 (list 'SCORE-BEGIN-END 
+                          (time-stretch (cadr begin-end) factor 
+                                        from-time to-time)
+                          (time-stretch (caddr begin-end) factor
+                                        from-time to-time)))
+          (mapcar #'(lambda (event) 
+                      (event-stretch event factor dur time
+                                     from-time to-time))
+                  (cdr score)))))
+    
+          
+(defun params-transpose (params keyword amount)
+  (cond ((null params) nil)
+        ((and (eq keyword (car params))
+              (numberp (cadr params)))
+         (cons (car params)
+               (cons (+ amount (cadr params))
+                     (cddr params))))
+        (t (cons (car params)
+                 (cons (cadr params)
+                       (params-transpose (cddr params) keyword amount))))))
+
+
+(defun score-transpose (score keyword amount &key
+                        from-index to-index from-time to-time)
+  (score-apply score 
+               #'(lambda (time dur expression)
+                   (list time dur 
+                         (cons (car expression)
+                               (params-transpose (cdr expression)
+                                                 keyword amount))))
+               :from-index from-index :to-index to-index
+               :from-time from-time :to-time to-time))
+
+
+(defun params-scale (params keyword amount)
+  (cond ((null params) nil)
+        ((and (eq keyword (car params))
+              (numberp (cadr params)))
+         (cons (car params)
+               (cons (* amount (cadr params))
+                     (cddr params))))
+        (t (cons (car params)
+                 (cons (cadr params)
+                       (params-scale (cddr params) keyword amount))))))
+
+
+(defun score-scale (score keyword amount &key
+                    from-index to-index from-time to-time)
+  (score-apply score 
+               #'(lambda (time dur expression)
+                   (list time dur
+                         (cons (car expression)
+                               (params-scale (cdr expression)
+                                             keyword amount))))
+               :from-index from-index :to-index to-index
+               :from-time from-time :to-time to-time))
+
+
+(defun score-sustain (score factor &key
+                      from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((i 0)
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    (dolist (event score)
+      (cond ((and (<= start i) (< i stop))
+             (setf event (event-set-dur
+                          event (* (event-dur event) factor)))))
+      (push event result)
+      (incf i))
+    (reverse result)))
+
+
+(defun map-voice (expression replacement-list)
+  (let ((mapping (assoc (car expression) replacement-list)))
+    (cond (mapping (cons (second mapping)
+                         (cdr expression)))
+          (t expression))))
+
+
+(defun score-voice (score replacement-list &key
+                    from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((i 0) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    (dolist (event score)
+      (cond ((and (<= start i) (< i stop))
+             (setf event (event-set-expression
+                          event (map-voice (event-expression event)
+                                           replacement-list)))))
+      (push event result)
+      (incf i))
+    (reverse result)))
+
+
+(defun score-merge (&rest scores)
+  ;; scores is a list of scores
+  (cond ((null scores) nil)
+        (t
+         (score-merge-1 (car scores) (cdr scores)))))
+
+
+;; SCORE-MERGE-1 -- merge list of scores into score
+;;
+(defun score-merge-1 (score scores)
+  ;; scores is a list of scores to merge
+  (cond ((null scores) score)
+        (t (score-merge-1 (score-merge-2 score (car scores))
+                          (cdr scores)))))
+
+;; SCORE-MERGE-2 -- merge 2 scores
+;;
+(defun score-merge-2 (score addin)
+  ;(display "score-merge-2 before" score addin)
+  (setf score (score-must-have-begin-end score))
+  (setf addin (score-must-have-begin-end addin))
+  ;(display "score-merge-2" score addin)
+  (let (start1 start2 end1 end2)
+    (setf start1 (score-get-begin score))
+    (setf start2 (score-get-begin addin))
+    (setf end1 (score-get-end score))
+    (setf end2 (score-get-end addin))
+    
+    ;; note: score-sort is destructive, but append copies score
+    ;;       and score-shift copies addin
+    (score-sort
+     (cons (list 0 0 (list 'SCORE-BEGIN-END (min start1 start2)
+                           (max end1 end2)))
+           (append (cdr score) (cdr addin) nil)))))
+
+
+
+;; SCORE-APPEND -- append scores together in sequence
+;;
+(defun score-append (&rest scores)
+  ;; scores is a list of scores
+  (cond ((null scores) nil)
+        (t
+         (score-append-1 (car scores) (cdr scores)))))
+
+
+;; SCORE-APPEND-1 -- append list of scores into score
+;;
+(defun score-append-1 (score scores)
+  ;; scores is a list of scores to append
+  (cond ((null scores) score)
+        (t (score-append-1 (score-append-2 score (car scores))
+                           (cdr scores)))))
+
+
+;; SCORE-APPEND-2 -- append 2 scores
+;;
+(defun score-append-2 (score addin)
+  ;(display "score-append-2" score addin)
+  (setf score (score-must-have-begin-end score))
+  (setf addin (score-must-have-begin-end addin))
+  (let (end1 start2 begin-end1 begin-end2)
+    (setf start1 (score-get-begin score))
+    (setf end1 (score-get-end score))
+    (setf start2 (score-get-begin addin))
+    (setf end2 (score-get-end addin))
+    (setf begin-end1 (event-expression (car score)))
+    (setf begin-end2 (event-expression (car addin)))
+    (setf addin (score-shift addin (- end1 start2)))
+    ;; note: score-sort is destructive, but append copies score
+    ;;       and score-shift copies addin
+    (score-sort
+     (cons (list 0 0 (list 'SCORE-BEGIN-END start1 (+ end1 (- end2 start2))))
+           (append (cdr score) (cdr addin) nil)))))
+
+
+(defun score-select (score predicate &key
+                    from-index to-index from-time to-time reject)
+  (setf score (score-must-have-begin-end score))
+  (let ((begin-end (car score))
+        (i 1) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    ;; selected if start <= i AND i < stop AND predicate(...)
+    ;; choose if not reject and selected or reject and not selected
+    ;; so in other words choose if reject != selected. Use NULL to
+    ;; coerce into boolean values and then use NOT EQ to compare
+    (dolist (event (cdr score))
+      (cond ((not (eq (null reject)
+                      (null (and (<= start i) (< i stop)
+                                 (or (eq predicate t)
+                                     (funcall predicate 
+                                      (event-time event) 
+                                      (event-dur event) 
+                                      (event-expression event)))))))
+             (push event result)))
+      (incf i))
+    (cons begin-end (reverse result))))
+
+
+;; SCORE-FILTER-LENGTH -- remove notes beyond cutoff time
+;;
+(defun score-filter-length (score cutoff)
+  (let (result)
+    (dolist (event score)
+      (cond ((<= (event-end event) cutoff)
+             (push event result))))
+    (reverse result)))
+
+
+;; SCORE-REPEAT -- make n copies of score in sequence
+;;
+(defun score-repeat (score n)
+  (let (result)
+    (dotimes (i n)
+      (setf result (score-append result score)))
+    result))
+
+
+;; SCORE-STRETCH-TO-LENGTH -- stretch score to have given length
+;;
+(defun score-stretch-to-length (score length)
+  (let ((begin-time (score-get-begin score))
+        (end-time (score-get-end score))
+        duration stretch)
+    (setf duration (- end-time begin-time))
+    (cond ((< 0 duration)
+           (setf stretch (/ length (- end-time begin-time)))
+           (score-stretch score stretch))
+          (t score))))
+
+
+(defun score-filter-overlap (score)
+  (setf score (score-must-have-begin-end score))
+  (prog (event end-time filtered-score
+         (begin-end (car score)))
+    (setf score (cdr score))
+    (cond ((null score) (return (list begin-end))))
+  loop
+    ;; get event from score
+    (setf event (car score))
+    ;; add a note to filtered-score
+    (push event filtered-score)
+    ;; save the end-time of this event: start + duration
+    (setf end-time (+ (car event) (cadr event)))
+    ;; now skip everything until end-time in score
+  loop2
+    (pop score) ;; move to next event in score
+    (cond ((null score) 
+           (return (cons begin-end (reverse filtered-score)))))
+    (setf event (car score)) ;; examine next event
+    (setf start-time (car event))
+    ;(display "overlap" start-time (- end-time SCORE-EPSILON))
+    (cond ((< start-time (- end-time SCORE-EPSILON))
+           ;(display "toss" event start-time end-time)
+           (go loop2)))
+    (go loop)))
+
+
+(defun score-print (score)
+ (format t "(")
+ (dolist (event score)
+  (format t "~S~%" event))
+ (format t ")~%"))
+
+(defun score-play (score)
+  (play (timed-seq score)))
+
+
+(defun score-adjacent-events (score function &key
+                              from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((begin-end (car score))
+        (a nil)
+        (b (second score))
+        (c-list (cddr score))
+        r newscore
+        (i 1)
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time)))
+    (dolist (event (cdr score))
+      (setf r b)
+      (cond ((and (<= start i) (< i stop))
+             (setf r (funcall function a b (car c-list)))))
+      (cond (r
+             (push r newscore)
+             (setf a r)))
+      (setf b (car c-list))
+      (setf c-list (cdr c-list))
+      (incf i))
+    (score-sort (cons begin-end newscore))))
+
+
+(defun score-apply (score fn &key
+                    from-index to-index from-time to-time)
+
+  (setf score (score-must-have-begin-end score))
+  (let ((begin-end (car score))
+        (i 1) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    (dolist (event (cdr score))
+      (push 
+       (cond ((and (<= start i) (< i stop))
+              (funcall fn (event-time event)
+                          (event-dur event) (event-expression event)))
+             (t event))
+       result)
+      (incf i))
+    (score-sort (cons begin-end result))))
+
+
+(defun score-indexof (score fn &key
+                      from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((i 1) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    (dolist (event (cdr score))
+      (cond ((and (<= start i) (< i stop)
+                  (funcall fn (event-time event)
+                              (event-dur event)
+                              (event-expression event)))
+             (setf result i)
+             (return)))
+      (incf i))
+    result))
+
+
+(defun score-last-indexof (score fn &key
+                           from-index to-index from-time to-time)
+  (setf score (score-must-have-begin-end score))
+  (let ((i 1) 
+        (start (find-first-note score from-index from-time))
+        (stop (find-last-note score to-index to-time))
+        result)
+    (dolist (event (cdr score))
+      (cond ((and (<= start i) (< i stop)
+                  (funcall fn (event-time event)
+                           (event-dur event)
+                           (event-expression event)))
+             (setf result i)))
+      (incf i))
+    result))
+
+
+;; SCORE-RANDOMIZE-START -- alter start times with offset
+;; keywords: jitter, offset, feel factor
+;;
+(defun score-randomize-start (score amt &key
+                              from-index to-index from-time to-time)
+  (score-apply score
+               (lambda (time dur expr)
+                 (setf time (+ (real-random (- amt) amt) time))
+                 (setf time (max 0.0 time))
+                 (list time dur expr))))
+
+
+;; SCORE-READ-SMF -- read a standard MIDI file to a score
+;;
+(defun score-read-smf (filename)
+  (let ((seq (seq-create))
+        (file (open-binary filename)))
+    (cond (file
+           (seq-read-smf seq file)
+           (close file)
+           (score-from-seq seq))
+          (t nil))))
+
+
+;; SET-PROGRAM-TO -- a helper function to set a list value
+(defun set-program-to (lis index value default)
+  ;; if length or lis <= index, extend the lis with default
+  (while (<= (length lis) index)
+    (setf lis (nconc lis (list default))))
+  ;; set the nth element
+  (setf (nth index lis) value)
+  ;; return the list
+  lis)
+
+
+(defun score-from-seq (seq)
+  (prog (event tag score programs)
+    (seq-reset seq)
+loop
+    (setf event (seq-get seq))
+    (setf tag (seq-tag event))
+    (cond ((= tag seq-done-tag)
+           (go exit))
+          ((= tag seq-prgm-tag)
+           (let ((chan (seq-channel event))
+                 (when (seq-time event))
+                 (program (seq-program event)))
+             (setf programs (set-program-to programs chan program 0))
+             (push (list (* when 0.001) 1
+                         (list 'NOTE :pitch nil :program program))
+                   score)))
+          ((= tag seq-note-tag)
+         (let ((chan (seq-channel event))
+                 (pitch (seq-pitch event))
+                 (vel (seq-velocity event))
+                 (when (seq-time event))
+                 (dur (seq-duration event)))
+             (push (list (* when 0.001) (* dur 0.001)
+                       (list 'NOTE :chan (1- chan) :pitch pitch :vel vel))
+                   score))))
+    (seq-next seq)
+    (go loop)
+exit
+    (setf *rslt* programs) ;; extra return value
+    (return (score-sort score))))
+
+
+(defun score-write-smf (score filename &optional programs)
+  (let ((file (open-binary filename :direction :output))
+        (seq (seq-create))
+        (chan 1))
+    (cond (file
+           (dolist (program programs)
+             ;; 6 = SEQ_PROGRAM
+             (seq-insert-ctrl seq 0 0 6 chan program)
+             ;(display "insert ctrl" seq 0 0 6 chan program)
+             (incf chan))
+
+           (dolist (event (cdr (score-must-have-begin-end score)))
+             (let ((time (event-time event))
+                   (dur (event-dur event))
+                   (chan (event-get-attr event :chan 0))
+                   (pitch (event-get-attr event :pitch))
+                   (program (event-get-attr event :program))
+                   (vel (event-get-attr event :vel 100)))
+               (cond (program
+                      ;(display "score-write-smf program" chan program)
+                      (seq-insert-ctrl seq (round (* time 1000))
+                                       0 6 (1+ chan)
+                                       (round program))))
+               (cond ((consp pitch)
+                      (dolist (p pitch)
+                        (seq-insert-note seq (round (* time 1000))
+                                         0 (1+ chan) (round p) 
+                                         (round (* dur 1000)) (round vel))))
+                     (pitch
+                      (seq-insert-note seq (round (* time 1000))
+                                       0 (1+ chan) (round pitch)
+                                       (round (* dur 1000)) (round vel))))))
+           (seq-write-smf seq file)
+           (close file)))))
+
+
+;; make a default note function for scores
+;;
+(defun note (&key (pitch 60) (vel 100))
+  ;; load the piano if it is not loaded already
+  (if (not (boundp '*piano-srate*)) 
+      (abs-env (load "pianosyn")))
+  (piano-note-2 pitch vel))
+
+;;================================================================
+
+;; WORKSPACE functions have moved to envelopes.lsp
+
+
+;; DESCRIBE -- add a description to a global variable
+;;
+(defun describe (symbol &optional description)
+  (add-to-workspace symbol)
+  (cond (description
+         (putprop symbol description 'description))
+        (t
+         (get symbol 'description))))
+
+;; INTERPOLATE -- linear interpolation function
+;;
+;; compute y given x by interpolating between points (x1, y1) and (x2, y2)
+(defun interpolate (x x1 y1 x2 y2)
+  (cond ((= x1 x2) x1)
+        (t (+ y1 (* (- x x1) (/ (- y2 y1) (- x2 (float x1))))))))
+
+
+;; INTERSECTION -- set intersection
+;;
+;; compute the intersection of two lists
+(defun intersection (a b)
+  (let (result)
+    (dolist (elem a)
+      (if (member elem b) (push elem result)))
+    result))
+
+;; UNION -- set union
+;;
+;; compute the union of two lists
+(defun union (a b)
+  (let (result)
+    (dolist (elem a)
+      (if (not (member elem result)) (push elem result)))
+    (dolist (elem b)
+      (if (not (member elem result)) (push elem result)))
+    result))
+
+;; SET-DIFFERENCE -- set difference
+;;
+;; compute the set difference between two sets
+(defun set-difference (a b)
+  (remove-if (lambda (elem) (member elem b)) a))
+
+;; SUBSETP -- test is list is subset
+;;
+;; test if a is subset of b
+(defun subsetp (a b)
+  (let ((result t))
+    (dolist (elem a)
+      (cond ((not (member elem b))
+             (setf result nil)
+             (return nil))))
+    result))
+
+;; functions to support score editing in jNyqIDE
+
+(if (not (boundp '*default-score-file*))
+    (setf *default-score-file* "score.dat"))
+
+;; SCORE-EDIT -- save a score for editing by jNyqIDE
+;;
+;; file goes to a data file to be read by jNyqIDE
+;; Note that the parameter is a global variable name, not a score,
+;; but you do not quote the global variable name, e.g. call
+;;    (score-edit my-score)
+;;
+(defmacro score-edit (score-name)
+    `(score-edit-symbol (quote ,score-name)))
+
+(defun score-edit-symbol (score-name)
+    (prog ((f (open *default-score-file* :direction :output))
+           score expr)
+      (cond ((symbolp score-name)
+             (setf score (eval score-name)))
+            (t
+             (error "score-edit expects a symbol naming the score to edit")))
+      (cond ((null f)
+        (format t "score-edit: error in output file ~A!~%" *default-score-file*)
+        (return nil)))
+
+      (format t "score-edit: writing ~A ...~%" *default-score-file*)
+      (format f "~A~%" score-name) ; put name on first line
+      (dolist (event score) ;cdr scor
+        (format f "~A " (event-time event))  ; print start time
+        (format f "~A " (event-dur event))   ; print duration
+
+        (setf expr (event-expression event))
+
+        ; print the pitch and the rest of the attributes
+        (format f "~A " (expr-get-attr expr :pitch))
+        (format f "~A~%" (expr-parameters-remove-attr expr :pitch)))
+      (close f)
+      (format t "score-edit: wrote ~A events~%" (length score))))
+
+
+;; Read in a data file stored in the score-edit format and save
+;; it to the global variable it came from
+(defun score-restore ()
+  (prog ((inf (open *default-score-file*))
+         name start dur pitch expr score)
+    (cond ((null inf)
+           (format t "score-restore: could not open ~A~%" *default-score-file*)
+           (return nil)))
+    (setf name (read inf)) ;; score name
+    (loop
+      (setf start (read inf))
+      (cond ((null start) (return)))
+      (setf dur (read inf))
+      (setf pitch (read inf))
+      (setf expr (read inf))
+      (cond (pitch
+             (setf expr (expr-set-attr expr :pitch pitch)))))
+    (close inf)
+    (setf (symbol-value name) score)))
diff --git a/src/GStreamerLoader.cpp b/src/GStreamerLoader.cpp
new file mode 100644
index 0000000..f579f8d
--- /dev/null
+++ b/src/GStreamerLoader.cpp
@@ -0,0 +1,244 @@
+/**********************************************************************
+
+Audacity: A Digital Audio Editor
+
+GStreamerLoader.cpp
+
+Audacity(R) is copyright (c) 1999-2009 Audacity Team.
+License: GPL v2.  See License.txt.
+
+******************************************************************//**
+
+\class GStreamerLoader
+\brief Class used to dynamically load and initialize GStreamer
+
+*//*******************************************************************/
+
+#include "Audacity.h"	// for config*.h
+#include "GStreamerLoader.h"
+#include "import/ImportGStreamer.h"
+#include "AudacityApp.h"
+
+#ifdef _DEBUG
+   #ifdef _MSC_VER
+      #undef THIS_FILE
+      static char*THIS_FILE= __FILE__;
+      #define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__)
+   #endif
+#endif
+
+#if !defined(USE_GSTREAMER)
+/// GStreamer support may or may not be compiled in,
+/// but Preferences dialog requires this function nevertheless
+wxString GetGStreamerVersion(wxWindow *parent)
+{
+   return wxString(wxT("GStreamer support is not compiled in"));
+}
+
+void GStreamerStartup()
+{
+}
+
+#else
+
+void GLogHandlerFunction(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
+
+GStreamerLoader *GStreamerInst = NULL;
+
+// This function should dump stream information to debug log.
+gboolean LogStructure(GQuark field_id, const GValue *value, gpointer user_data)
+{
+   GString *strinfo = (GString*)user_data;
+   // Get a name of a field
+   const gchar *field_name = g_quark_to_string(field_id);
+
+   gchar *value_str_value = gst_value_serialize(value);
+
+   // TODO: push this into future over and over until wxLogMessage becomes threadsafe (code already in trunk)
+#if wxCHECK_VERSION(2, 9, 0)
+   wxLogMessage(wxT("Field %s = %s"), wxString::FromUTF8(field_name).c_str(), wxString::FromUTF8(value_str_value).c_str());
+#endif
+   if (strinfo)
+      g_string_append_printf(strinfo, " %s[%s]",field_name, value_str_value);
+   g_free(value_str_value);
+   return TRUE;
+}
+
+
+void GstGLogHandlerFunction(const gchar *string)
+{
+#if 0
+   static bool runtimedebugvar = false;
+   if (runtimedebugvar)
+   {
+      FILE *f;
+      errno_t err = 1;
+      while (err != 0)
+         err = fopen_s(&f,"gstreamer.debug.log","ab");
+      fprintf(f,"%s",string);
+      fclose(f);
+   }
+#else
+  g_printerr("%s",string);
+#endif
+}
+
+bool GStreamerLoader::LoadGStreamer(bool showerror)
+{
+   // First, we need to intialize GLib threading system
+   if (!g_thread_supported())
+      g_thread_init(NULL);
+   else
+      return false;
+  
+   // This will be used in future to give GStreamer additional arguments
+   wxString arguments = wxEmptyString;
+   if (gPrefs) {
+      arguments = gPrefs->Read(wxT("/GStreamer/Arguments"), wxEmptyString);
+   }
+
+   // TODO: convert argument string into argc/argv pair.
+   // TODO: Also, convert prefs control states into arguments and append to argument string
+   int argc = 0;
+   char **argv = NULL;
+
+   wxLogMessage(wxT("Audacity is built against GStreamer version %d.%d.%d-%d"),GST_VERSION_MAJOR,GST_VERSION_MINOR,GST_VERSION_MICRO,GST_VERSION_NANO);
+   wxLogMessage(wxT("Initializing GStreamer with arguments: \"%s\""),arguments.c_str());
+   GError *errorptr = NULL;
+
+   if (!gst_init_check(&argc, &argv,&errorptr))
+   {
+      wxLogMessage(wxT("Failed to initialize GStreamer. Error %d: %s"),errorptr->code, wxString::FromUTF8(errorptr->message).c_str());
+      g_error_free(errorptr);
+      return false;
+   }
+
+   gst_version(&major, &minor, &micro, &nano);
+   wxLogMessage(wxT("Linked to GStreamer version %d.%d.%d-%d"),major,minor,micro,nano);
+
+   g_set_printerr_handler(GstGLogHandlerFunction);
+   // Debugging makes GStreamer roughly 4-5 times slower when it is not writing anything and 10 times slower with it writes info into a file
+#if 0
+   gst_debug_set_active(TRUE);
+   gst_debug_set_default_threshold(GST_LEVEL_LOG);
+#endif
+   mGStreamerLoaded = true;
+
+   return true;
+}
+
+// Obtains a list of supported extensions from typefind factories
+// TODO: improve the list. It is obviously incomplete and also contains unuseful extensions (such as .jpg)
+wxArrayString GStreamerLoader::GetExtensions()
+{
+   wxArrayString result;
+   if (!mGStreamerLoaded) return result;
+
+   GList *factories, *list;
+   factories = list = gst_type_find_factory_get_list();
+   while (list)
+   {
+      GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY(list->data);
+      list = g_list_next(list);
+
+      gchar **extensions = gst_type_find_factory_get_extensions(factory);
+      if (!extensions)
+        continue;
+      for (gint i = 0; extensions[i]; i++)
+      {
+         wxString extension = wxString::FromUTF8(extensions[i]);
+         if (result.Index(extension.c_str(), false) == wxNOT_FOUND)
+         {
+            result.Add(extension);
+         }
+      }
+   }
+   gst_plugin_feature_list_free(factories);
+
+   result.Sort();
+   wxString extensions = wxT("Extensions:");
+   for (size_t i = 0; i < result.GetCount(); i++)
+     extensions = extensions + wxT(" ") + result[i];
+   wxLogMessage(wxT("%s"),extensions.c_str());
+
+   return result;
+}
+
+// This one is for Glib.
+void GLogHandlerFunction(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
+{
+   wxString level;
+   switch (log_level)
+   {
+   case G_LOG_LEVEL_CRITICAL:
+      level = wxT("Critical");
+      break;
+   case G_LOG_LEVEL_DEBUG:
+      level = wxT("Debug");
+      break;
+   case G_LOG_LEVEL_ERROR:
+      level = wxT("Error");
+      break;
+   case G_LOG_LEVEL_INFO:
+      level = wxT("Info");
+      break;
+   case G_LOG_LEVEL_WARNING:
+      level = wxT("Warning");
+      break;
+   case G_LOG_LEVEL_MESSAGE:
+      level = wxT("Message");
+      break;
+   default:
+      level = wxT("Unknown");
+   }
+#if wxCHECK_VERSION(2, 9, 0)
+   wxLogMessage(_("GStreamer %s: %s"),level.c_str(),wxString::FromUTF8(message).c_str());
+#endif
+}
+
+void GStreamerStartup()
+{
+   GStreamerInst = new GStreamerLoader;
+   guint handler_id = g_log_set_handler(NULL,GLogLevelFlags(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION),GLogHandlerFunction,(gpointer)GStreamerInst);
+   
+   bool enabled = false;
+   gPrefs->Read(wxT("/GStreamer/Enabled"),&enabled);
+#if _DEBUG //experimental debugging
+   enabled = true;
+#endif
+   // 'false' means that no errors should be shown whatsoever
+   if (enabled && !GStreamerInst->LoadGStreamer(false))
+   {
+     wxMessageBox(_("GStreamer was configured in preferences and successfully loaded before,\n\
+                      but this time Audacity failed to load it at startup.\n\
+                      You may want to go back to Preferences > Libraries and re-configure it."),
+                      _("GStreamer startup failed"));
+     delete GStreamerInst;
+   }
+}
+
+wxString GetGStreamerVersion(wxWindow *parent)
+{
+   wxString versionString = wxT("GStreamer is not found");
+
+   if (GStreamerInst && GStreamerInst->Loaded()) {
+      versionString = GStreamerInst->GetVersion();
+   }
+
+   return versionString;
+}
+//----------------------------------------------------------------------------
+// GStreamerLoader
+//----------------------------------------------------------------------------
+
+GStreamerLoader::GStreamerLoader()
+{
+   mGStreamerLoaded = false;
+   major = minor = micro = nano = 0;
+}
+
+GStreamerLoader::~GStreamerLoader()
+{
+};
+
+#endif //USE_GSTREAMER
diff --git a/src/GStreamerLoader.h b/src/GStreamerLoader.h
new file mode 100644
index 0000000..a19b2d2
--- /dev/null
+++ b/src/GStreamerLoader.h
@@ -0,0 +1,103 @@
+/**********************************************************************
+
+Audacity: A Digital Audio Editor
+
+GStreamerLoader.h
+
+Audacity(R) is copyright (c) 1999-2008 Audacity Team.
+License: GPL v2.  See License.txt.
+
+******************************************************************//**
+
+Describes shared object that is used to access GStreamer
+
+*//*******************************************************************/
+
+#if !defined(__AUDACITY_GSTREAMER__)
+#define __AUDACITY_GSTREAMER__
+
+#include "Audacity.h"
+/* rather earlier than normal, but pulls in config*.h and other program stuff
+ * we need for the next bit */
+#include <wx/string.h>
+#include <wx/dynlib.h>
+#include <wx/log.h>			// for wxLogNull
+#include <wx/msgdlg.h>		// for wxMessageBox
+#include <wx/utils.h>
+#include "../widgets/LinkingHtmlWindow.h"
+#include "FileDialog.h"
+#include "ShuttleGui.h"
+#include "../Prefs.h"
+#include <wx/checkbox.h>
+#include <wx/textctrl.h>
+#include <wx/thread.h>
+
+class GStreamerLoader;
+
+extern GStreamerLoader *GStreamerInst;
+
+//----------------------------------------------------------------------------
+// Get GStreamer version
+//----------------------------------------------------------------------------
+wxString GetGStreamerVersion(wxWindow *parent);
+
+//----------------------------------------------------------------------------
+// Attempt to load and enable/disable GStreamer at startup
+//----------------------------------------------------------------------------
+void GStreamerStartup();
+
+/* From here on in, this stuff only applies when gstreamer is available */
+#if defined(USE_GSTREAMER)
+
+// On Windows we don't have configure script to turn this on or off,
+// so let's use msw-specific pragma to add required libraries.
+// Of course, library search path still has to be updated manually
+#   if defined(__WXMSW__)
+#      pragma comment(lib,"libgstreamer-0.10.lib")
+#      pragma comment(lib,"libgstapp-0.10.lib")
+#      pragma comment(lib,"libgstbase-0.10.lib")
+#      pragma comment(lib,"glib-2.0.lib")
+#      pragma comment(lib,"gobject-2.0.lib")
+#      pragma comment(lib,"gthread-2.0.lib")
+#      pragma comment(lib,"libxml2.lib")
+#   endif
+    extern "C" {
+#      include <gst/gst.h>
+#      include <glib.h>
+#      include <glib/gstdio.h>
+    }
+
+bool LoadGStreamer(bool showerror);
+
+gboolean LogStructure(GQuark field_id, const GValue *value, gpointer user_data);
+
+class GStreamerLoader
+{
+public:
+   GStreamerLoader();
+   ~GStreamerLoader();
+
+   bool Loaded()
+   {
+      return mGStreamerLoaded;
+   }
+
+   wxString GetVersion()
+   {
+      return wxString::Format(wxT("%d.%d.%d-%d"),major, minor, micro, nano);
+   }
+
+   wxArrayString GetExtensions();
+
+   bool LoadGStreamer(bool showerr);
+
+private:
+
+   unsigned int major, minor, micro, nano;
+
+   bool mGStreamerLoaded;
+};
+
+#endif // USE_GSTREAMER
+#endif // __AUDACITY_GSTREAMER__
+
diff --git a/src/Lyrics.cpp b/src/Lyrics.cpp
new file mode 100644
index 0000000..09b5e93
--- /dev/null
+++ b/src/Lyrics.cpp
@@ -0,0 +1,567 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  Lyrics.cpp
+
+  Dominic Mazzoni
+  Vaughan Johnson
+  
+**********************************************************************/
+
+#include <math.h>
+
+#include <wx/defs.h>
+#include <wx/dcmemory.h>
+#include <wx/mimetype.h>
+
+#include "Lyrics.h"
+#include "Internat.h"
+#include "Project.h" // for GetActiveProject
+
+#include <wx/arrimpl.cpp>
+WX_DEFINE_OBJARRAY(SyllableArray);
+
+
+BEGIN_EVENT_TABLE(HighlightTextCtrl, wxTextCtrl) 
+   EVT_MOUSE_EVENTS(HighlightTextCtrl::OnMouseEvent)
+END_EVENT_TABLE()
+
+HighlightTextCtrl::HighlightTextCtrl(Lyrics* parent, 
+                                       wxWindowID id, 
+                                       const wxString& value /*= ""*/, 
+                                       const wxPoint& pos /*= wxDefaultPosition*/, 
+                                       const wxSize& size /*= wxDefaultSize*/)
+: wxTextCtrl(parent, id, // wxWindow* parent, wxWindowID id, 
+               value, // const wxString& value = "", 
+               pos, // const wxPoint& pos = wxDefaultPosition, 
+               size, // const wxSize& size = wxDefaultSize, 
+               wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | wxTE_AUTO_URL | wxTE_NOHIDESEL), //v | wxHSCROLL)
+   mLyrics(parent)
+{
+}
+
+void HighlightTextCtrl::OnMouseEvent(wxMouseEvent& event)
+{
+   if (event.ButtonUp()) 
+   {
+      long from, to;
+      this->GetSelection(&from, &to);
+
+      int nCurSyl = mLyrics->GetCurrentSyllableIndex();
+      int nNewSyl = mLyrics->FindSyllable(from);
+      if (nNewSyl != nCurSyl)
+      {
+         Syllable* pCurSyl = mLyrics->GetSyllable(nNewSyl);
+         AudacityProject* pProj = GetActiveProject();
+         pProj->mViewInfo.sel0 = pCurSyl->t;
+
+         //vvv Should probably select to end as in AudacityProject::OnSelectCursorEnd, 
+         // but better to generalize that in AudacityProject methods. 
+         pProj->mViewInfo.sel1 = pCurSyl->t;
+      }
+   }
+
+   event.Skip();
+}
+
+
+//v static const kHighlightTextCtrlID = 7654;
+
+BEGIN_EVENT_TABLE(Lyrics, wxPanel) 
+   EVT_CHAR(Lyrics::OnKeyEvent)
+   EVT_PAINT(Lyrics::OnPaint)
+   EVT_SIZE(Lyrics::OnSize)
+
+   //v Doesn't seem to be a way to capture a selection event in a read-only wxTextCtrl.
+	//    EVT_COMMAND_LEFT_CLICK(kHighlightTextCtrlID, Lyrics::OnHighlightTextCtrl)
+END_EVENT_TABLE()
+
+IMPLEMENT_CLASS(Lyrics, wxPanel) 
+
+Lyrics::Lyrics(wxWindow* parent, wxWindowID id,
+               const wxPoint& pos /*= wxDefaultPosition*/,
+               const wxSize& size /*= wxDefaultSize*/):
+   wxPanel(parent, id, pos, size), 
+   mWidth(size.x), mHeight(size.y)
+{
+   mKaraokeHeight = mHeight;
+   mLyricsStyle = kBouncingBallLyrics; // default
+   mKaraokeFontSize = this->GetDefaultFontSize(); // Call only after mLyricsStyle is set.
+
+   mHighlightTextCtrl = 
+      new HighlightTextCtrl(this, -1, // wxWindow* parent, wxWindowID id, 
+                              wxT(""), // const wxString& value = wxT(""), 
+                              wxPoint(0, 0), // const wxPoint& pos = wxDefaultPosition, 
+                              size); // const wxSize& size = wxDefaultSize
+   this->SetHighlightFont();
+   mHighlightTextCtrl->Show(mLyricsStyle == kHighlightLyrics); // test, in case we conditionalize the default, above
+
+
+   mT = 0.0;
+
+   Clear();
+   Finish(0.0);
+
+   #ifdef __WXMAC__
+      wxSizeEvent dummyEvent;
+      OnSize(dummyEvent);
+   #endif
+}
+
+Lyrics::~Lyrics()
+{
+}
+
+#define I_FIRST_REAL_SYLLABLE 2
+
+void Lyrics::Clear()
+{
+   mSyllables.Clear();
+   mText = wxT("");
+
+   // Add two dummy syllables at the beginning
+   mSyllables.Add(Syllable());
+   mSyllables[0].t = -2.0;
+   mSyllables.Add(Syllable());
+   mSyllables[1].t = -1.0;
+
+   mHighlightTextCtrl->Clear();
+}
+
+void Lyrics::Add(double t, wxString syllable)
+{
+   int i = mSyllables.GetCount();
+
+   if (mSyllables[i-1].t == t) {
+      // We can't have two syllables with the same time, so append
+      // this to the end of the previous one if they're at the
+      // same time.
+      mSyllables[i-1].text += syllable;
+      mSyllables[i-1].textWithSpace += syllable;
+      mSyllables[i-1].char1 += syllable.Length();
+      return;
+   }
+
+   mSyllables.Add(Syllable());
+   mSyllables[i].t = t;
+   mSyllables[i].text = syllable;
+
+   mSyllables[i].char0 = mText.Length();
+
+   // Put a space between syllables unless the previous one
+   // ended in a hyphen
+   if (i > 0 && 
+         // mSyllables[i-1].text.Length() > 0 &&
+         mSyllables[i-1].text.Right(1) != wxT("-")) 
+      mSyllables[i].textWithSpace = wxT(" ") + syllable;
+   else 
+      mSyllables[i].textWithSpace = syllable;
+
+   mText += mSyllables[i].textWithSpace;
+   mSyllables[i].char1 = mText.Length();
+
+   int nTextLen = mSyllables[i].textWithSpace.Length();
+   if ((nTextLen > 0) && (mSyllables[i].textWithSpace.Right(1) == wxT("_")))
+      mHighlightTextCtrl->AppendText(mSyllables[i].textWithSpace.Left(nTextLen - 1) + wxT("\n"));
+   else 
+      mHighlightTextCtrl->AppendText(mSyllables[i].textWithSpace);
+}
+
+void Lyrics::Finish(double finalT)
+{
+   // Add 3 dummy syllables at the end
+   int i = mSyllables.GetCount();
+   mSyllables.Add(Syllable());
+   mSyllables[i].t = finalT + 1.0;
+   mSyllables.Add(Syllable());
+   mSyllables[i+1].t = finalT + 2.0;
+   mSyllables.Add(Syllable());
+   mSyllables[i+2].t = finalT + 3.0;
+
+   // Mark measurements as invalid
+   mMeasurementsDone = false; // only for drawn text
+   mCurrentSyllable = 0;
+   mHighlightTextCtrl->ShowPosition(0);
+}
+
+// Binary-search for the syllable syllable whose char0 <= startChar <= char1.
+int Lyrics::FindSyllable(long startChar)
+{
+   int i1, i2;
+
+   i1 = 0;
+   i2 = mSyllables.GetCount();
+   while (i2 > i1+1) {
+      int pmid = (i1+i2)/2;
+      if (mSyllables[pmid].char0 > startChar)
+         i2 = pmid;
+      else
+         i1 = pmid;
+   }
+
+   if (i1 < 2)
+      i1 = 2;
+   if (i1 > (int)(mSyllables.GetCount()) - 3)
+      i1 = mSyllables.GetCount() - 3;
+
+   return i1;
+}
+
+void Lyrics::SetLyricsStyle(const LyricsStyle newLyricsStyle)
+{
+   if (mLyricsStyle == newLyricsStyle)
+      return;
+
+   mLyricsStyle = newLyricsStyle;
+   mHighlightTextCtrl->Show(mLyricsStyle == kHighlightLyrics);
+
+   wxSizeEvent ignore;
+   this->OnSize(ignore);
+}
+
+
+unsigned int Lyrics::GetDefaultFontSize() const
+{
+   return (mLyricsStyle == kBouncingBallLyrics) ? 48 : 10;
+}
+
+void Lyrics::SetDrawnFont(wxDC *dc)
+{
+   dc->SetFont(wxFont(mKaraokeFontSize, wxSWISS, wxNORMAL, wxNORMAL));
+}
+
+void Lyrics::SetHighlightFont() // for kHighlightLyrics
+{
+   wxFont newFont(mKaraokeFontSize, wxSWISS, wxNORMAL, wxNORMAL);
+   mHighlightTextCtrl->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, newFont)); 
+   mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(), 
+                                 wxTextAttr(wxNullColour, wxNullColour, newFont));
+}
+
+void Lyrics::Measure(wxDC *dc) // only for drawn text
+{
+   this->SetDrawnFont(dc);
+   int width = 0, height = 0;
+   int maxLineWidth = 0; // only for kHighlightLyrics
+
+   const int kIndent = 4;
+   int x = 2*kIndent; 
+   int y = kIndent;
+
+   unsigned int i;
+   for(i=0; i<mSyllables.GetCount(); i++) {
+      if ((i < I_FIRST_REAL_SYLLABLE) || // Clear() starts the list with I_FIRST_REAL_SYLLABLE dummies.
+            (i >= mSyllables.GetCount()-3)) // Finish() ends with 3 dummies.
+      {
+         dc->GetTextExtent(wxT("DUMMY"), &width, &height); // Get the correct height even if we're at i=0.
+         width = 0;
+      }
+      else {
+         dc->GetTextExtent(mSyllables[i].textWithSpace, &width, &height);
+      }
+
+      // Add some space between words; the space is normally small but
+      // when there's a long pause relative to the previous word, insert
+      // extra space.
+      int extraWidth;
+      if (i >= I_FIRST_REAL_SYLLABLE && i < mSyllables.GetCount()-2)
+      {
+         double deltaThis = mSyllables[i+1].t - mSyllables[i].t;
+         double deltaPrev = mSyllables[i].t - mSyllables[i-1].t;
+
+         double ratio;
+         if (deltaPrev > 0.0)
+            ratio = deltaThis / deltaPrev;
+         else
+            ratio = deltaThis;
+
+         if (ratio > 2.0)
+            extraWidth = 15 + (int)(15.0 * ratio);
+         else
+            extraWidth = 15;
+      }
+      else
+         extraWidth = 20;
+      
+      mSyllables[i].width = width + extraWidth;
+      mSyllables[i].leftX = x;
+      mSyllables[i].x = x + width/2;
+      x += mSyllables[i].width;
+   }
+   
+   mTextHeight = height;
+
+   mMeasurementsDone = true;
+}
+
+// Binary-search for the syllable with the largest time not greater than t
+int Lyrics::FindSyllable(double t)
+{
+   int i1, i2;
+
+   i1 = 0;
+   i2 = mSyllables.GetCount();
+   while (i2 > i1+1) {
+      int pmid = (i1+i2)/2;
+      if (mSyllables[pmid].t > t)
+         i2 = pmid;
+      else
+         i1 = pmid;
+   }
+
+   if (i1 < 2)
+      i1 = 2;
+   if (i1 > (int)(mSyllables.GetCount()) - 3)
+      i1 = mSyllables.GetCount() - 3;
+
+   return i1;
+}
+
+// Bouncing Ball:
+// Given the current time t, returns the x/y position of the scrolling
+// karaoke display.  For some syllable i, when t==mSyllables[i].t,
+// it will return mSyllables[i].x for outX and 0 for outY.
+// In-between words, outX is interpolated using smooth acceleration
+// between the two neighboring words, and y is a positive number indicating
+// the bouncing ball height
+void Lyrics::GetKaraokePosition(double t,
+                                int *outX, double *outY)
+{
+   *outX = 0;
+   *outY = 0;
+
+   if (t < mSyllables[I_FIRST_REAL_SYLLABLE].t || t > mSyllables[mSyllables.GetCount()-3].t)
+      return;
+
+   int i0, i1, i2, i3;
+   int x0, x1, x2, x3;
+   double t0, t1, t2, t3;
+   i1 = FindSyllable(t);
+   i2 = i1 + 1;
+
+   // Because we've padded the syllables with two dummies at the beginning
+   // and end, we know that i0...i3 will always exist.  Also, we've made
+   // sure that we don't ever have two of the same time, so t2>t1 strictly.
+   //
+   //                          t
+   //                          \/
+   // time:  t0           t1                 t2              t3
+   // pos:   x0           x1                 x2              x3
+   // index: i0           i1                 i2              i3
+   // vel:               vel1               vel2
+
+   i0 = i1 - 1;
+   i3 = i2 + 1;
+
+   x0 = mSyllables[i0].x;
+   x1 = mSyllables[i1].x;
+   x2 = mSyllables[i2].x;
+   x3 = mSyllables[i3].x;
+
+   t0 = mSyllables[i0].t;
+   t1 = mSyllables[i1].t;
+   t2 = mSyllables[i2].t;
+   t3 = mSyllables[i3].t;
+
+   double linear_vel0 = (x1 - x0) / (t1 - t0);
+   double linear_vel1 = (x2 - x1) / (t2 - t1);
+   double linear_vel2 = (x3 - x2) / (t3 - t2);
+
+   // average velocities
+   double v1 = (linear_vel0 + linear_vel1) / 2;
+   double v2 = (linear_vel1 + linear_vel2) / 2;
+
+   // Solve a cubic equation f(t) = at^3 + bt^2 + ct + d
+   // which gives the position x as a function of
+   // (t - t1), by constraining f(0), f'(0), f(t2-t1), f'(t2-t1)
+   double delta_t = t2 - t1;
+   double delta_x = x2 - x1;
+   v1 *= delta_t;
+   v2 *= delta_t;
+   double a = v1 + v2 - 2*delta_x;
+   double b = 3*delta_x - 2*v1 - v2;
+   double c = v1;
+   double d = x1;
+
+   t = (t - t1) / (t2 - t1);
+   double xx = a*t*t*t + b*t*t + c*t + d;
+
+   // Unfortunately sometimes our cubic goes backwards.  This is a quick
+   // hack to stop that from happening.
+   if (xx < x1)
+      xx = x1;
+
+   *outX = (int)xx;
+
+   // The y position is a simple cosine curve; the max height is a
+   // function of the time.
+   double height = t2 - t1 > 4.0? 1.0: sqrt((t2-t1)/4.0);
+   *outY = height * sin(M_PI * t);
+}
+
+void Lyrics::Update(double t)
+{
+   if (t < 0.0) 
+   {
+      // TrackPanel::OnTimer passes gAudioIO->GetStreamTime(), which is -1000000000 if !IsStreamActive().
+      // In that case, use the selection start time. 
+      AudacityProject* pProj = GetActiveProject();
+      mT = pProj->GetSel0();
+   }
+   else
+      mT = t;
+
+   if (mLyricsStyle == kBouncingBallLyrics)
+   {
+      wxRect karaokeRect(0, 0, mWidth, mKaraokeHeight);
+      this->Refresh(false, &karaokeRect);
+   }
+
+   int i = FindSyllable(mT);
+   if (i == mCurrentSyllable)
+      return;
+
+   mCurrentSyllable = i;   
+
+   if (mLyricsStyle == kHighlightLyrics)
+   {
+      mHighlightTextCtrl->SetSelection(mSyllables[i].char0, mSyllables[i].char1);
+      
+      //v No trail for now.
+      //// Leave a trail behind the selection, by highlighting.
+      //if (i == I_FIRST_REAL_SYLLABLE) 
+      //   // Reset the trail to zero. 
+      //   mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(), wxTextAttr(wxNullColour, *wxWHITE));
+      //// Mark the trail for mSyllables[i].
+      //mHighlightTextCtrl->SetStyle(mSyllables[i].char0, mSyllables[i].char1, wxTextAttr(wxNullColour, *wxLIGHT_GREY));
+
+      //v Too much flicker:   mHighlightTextCtrl->ShowPosition(mSyllables[i].char0);
+   }
+}
+
+void Lyrics::OnKeyEvent(wxKeyEvent & event)
+{
+   GetActiveProject()->HandleKeyDown(event);
+}
+
+void Lyrics::OnPaint(wxPaintEvent &evt)
+{
+   if (!this->GetParent()->IsShown())
+      return;
+
+   if (mLyricsStyle == kBouncingBallLyrics) 
+   {
+      wxPaintDC dc(this);
+
+      if (!mMeasurementsDone)
+         Measure(&dc);
+
+      #ifdef __WXMAC__
+         // Mac OS X automatically double-buffers the screen for you,
+         // so our bitmap is unneccessary
+         HandlePaint(dc);
+      #else
+         wxBitmap bitmap(mWidth, mKaraokeHeight);
+         wxMemoryDC memDC;
+         memDC.SelectObject(bitmap);
+         HandlePaint(memDC);
+         dc.Blit(0, 0, mWidth, mKaraokeHeight, &memDC, 0, 0, wxCOPY, FALSE);
+      #endif
+   }
+   else // (mLyricsStyle == kHighlightLyrics)
+   {
+      //vvvvv causes flicker in ported version
+      //    this->SetHighlightFont();
+   }
+}
+
+void Lyrics::OnSize(wxSizeEvent &evt)
+{
+   GetClientSize(&mWidth, &mHeight);
+
+   mKaraokeHeight = mHeight;
+
+   mKaraokeFontSize = 
+      (int)((float)(this->GetDefaultFontSize() * mHeight) / (float)LYRICS_DEFAULT_HEIGHT);
+   // Usually don't get the size window we want, usually less than 
+   // LYRICS_DEFAULT_HEIGHT, so bump it a little.
+   mKaraokeFontSize += 2;
+
+   if (mLyricsStyle == kBouncingBallLyrics)
+   {
+      mMeasurementsDone = false;
+      wxPaintEvent ignore;
+      this->OnPaint(ignore);
+   }
+   else // (mLyricsStyle == kHighlightLyrics)
+   {
+      mHighlightTextCtrl->SetSize(mWidth, mKaraokeHeight);
+      this->SetHighlightFont();
+   }
+}
+
+//v Doesn't seem to be a way to capture a selection event in a read-only wxTextCtrl.
+//void Lyrics::OnHighlightTextCtrl(wxCommandEvent & event)
+//{
+//   long from, to;
+//
+//   mHighlightTextCtrl->GetSelection(&from, &to);
+//   // TODO: Find the start time of the corresponding syllable and set playback to start there.
+//}
+
+void Lyrics::HandlePaint(wxDC &dc)
+{
+   wxASSERT(mLyricsStyle == kBouncingBallLyrics);
+   dc.SetBrush(*wxWHITE_BRUSH);
+   dc.DrawRectangle(0, 0, mWidth, mKaraokeHeight);
+
+   this->HandlePaint_BouncingBall(dc); 
+}
+
+void Lyrics::HandlePaint_BouncingBall(wxDC &dc)
+{
+   int ctr = mWidth / 2;
+   int x;
+   double y;
+   GetKaraokePosition(mT, &x, &y);
+   
+   dc.SetTextForeground(wxColour(238, 0, 102));
+   bool changedColor = false;
+
+   SetDrawnFont(&dc);
+   unsigned int i;
+   wxCoord yTextTop = mKaraokeHeight - mTextHeight - 4;
+   for(i=0; i<mSyllables.GetCount(); i++) {
+      if (mSyllables[i].x + mSyllables[i].width < (x - ctr))
+         continue;
+      if (mSyllables[i].x > x + ctr)
+         continue;
+
+      if (!changedColor && mSyllables[i].x >= x) {
+         dc.SetTextForeground(*wxBLACK);
+         changedColor = true;
+      }
+
+      wxString text = mSyllables[i].text;
+      if (text.Length() > 0 && text.Right(1) == wxT("_")) {
+         text = text.Left(text.Length() - 1);
+      }
+
+      dc.DrawText(text,
+                  mSyllables[i].leftX + ctr - x,
+                  yTextTop);
+   }
+
+   int ballRadius = (int)(mTextHeight / 8.0);
+   int bounceTop = ballRadius * 2;
+   int bounceHeight = yTextTop - bounceTop;
+   int yi = (int)(yTextTop - 4 - (y * bounceHeight));
+
+   if (mT >= 0.0) {
+      wxRect ball(ctr - ballRadius, yi - ballRadius, 2 * ballRadius, 2 * ballRadius);
+      dc.SetBrush(wxBrush(wxColour(238, 0, 102), wxSOLID));
+      dc.DrawEllipse(ball);
+   }
+}
+
diff --git a/src/Lyrics.h b/src/Lyrics.h
new file mode 100644
index 0000000..c511c73
--- /dev/null
+++ b/src/Lyrics.h
@@ -0,0 +1,137 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  Lyrics.h
+
+  Dominic Mazzoni
+  Vaughan Johnson
+  
+**********************************************************************/
+
+#ifndef __AUDACITY_LYRICS__
+#define __AUDACITY_LYRICS__
+
+#include "Audacity.h"
+
+#include <wx/dynarray.h>
+#include <wx/panel.h>
+#include <wx/textctrl.h> 
+
+
+#define LYRICS_DEFAULT_WIDTH 608
+#define LYRICS_DEFAULT_HEIGHT 280
+
+struct Syllable {
+   double t;
+   wxString text;
+   wxString textWithSpace;
+   int char0; // index of first char of syllable in Lyrics::mText, used only for kHighlightLyrics
+   int char1; // index of last  char of syllable in Lyrics::mText, used only for kHighlightLyrics
+   int width;
+   int leftX;
+   int x; // centerX, used only for kBouncingBallLyrics
+};
+
+WX_DECLARE_OBJARRAY(Syllable, SyllableArray);
+
+class Lyrics;
+
+// Override wxTextCtrl to handle selection events, which the parent ignores if the control is read-only.
+class HighlightTextCtrl : public wxTextCtrl
+{
+public:
+   HighlightTextCtrl(Lyrics* parent, 
+                     wxWindowID id, 
+                     const wxString& value = wxT(""), 
+                     const wxPoint& pos = wxDefaultPosition, 
+                     const wxSize& size = wxDefaultSize);
+   virtual ~HighlightTextCtrl() {};
+
+   void OnMouseEvent(wxMouseEvent &evt);
+
+private:
+   Lyrics* mLyrics;
+
+   DECLARE_EVENT_TABLE()
+};
+
+class Lyrics : public wxPanel 
+{
+   DECLARE_DYNAMIC_CLASS(Lyrics)
+
+   enum LyricsStyle {
+      kBouncingBallLyrics, // Lyrics move from right to left with bouncing ball.
+      // kGuitarTab,       //v <<future>> Guitar Tablature moves from right to left.
+      kHighlightLyrics,    // Lyrics show in scrolling page and syllables highlight successively.
+   };
+
+ public:
+   Lyrics(wxWindow* parent, wxWindowID id,
+          const wxPoint& pos = wxDefaultPosition,
+          const wxSize& size = wxDefaultSize);
+   virtual ~Lyrics();
+
+   void Clear();
+   void Add(double t, wxString syllable);
+   void Finish(double finalT);
+
+   int FindSyllable(long startChar); // Find the syllable whose char0 <= startChar <= char1.
+   int GetCurrentSyllableIndex() { return mCurrentSyllable; };
+   Syllable* GetSyllable(int nSyl) { return &(mSyllables[nSyl]); };
+   void SetCurrentSyllableIndex(int nSyl) { mCurrentSyllable = nSyl; };
+
+   LyricsStyle GetLyricsStyle() { return mLyricsStyle; };
+   void SetLyricsStyle(const LyricsStyle newLyricsStyle);
+
+   void Update(double t);
+
+   //
+   // Event handlers
+   //
+   void OnKeyEvent(wxKeyEvent & event);
+   void OnPaint(wxPaintEvent &evt);
+   void OnSize(wxSizeEvent &evt);
+
+   // Doesn't seem to be a way to capture a selection event in a read-only wxTextCtrl.
+   // Thus the HighlightTextCtrl class.
+   //    void OnHighlightTextCtrl(wxCommandEvent & event); 
+
+   void HandlePaint(wxDC &dc);
+   void HandlePaint_BouncingBall(wxDC &dc);
+
+   void HandleLayout();
+
+private:
+   unsigned int GetDefaultFontSize() const; // Depends on mLyricsStyle. Call only after mLyricsStyle is set.
+   
+   void SetDrawnFont(wxDC *dc); // for kBouncingBallLyrics
+   void SetHighlightFont(); // for kHighlightLyrics
+
+   void Measure(wxDC *dc);
+   int FindSyllable(double t);
+   void GetKaraokePosition(double t, int *outX, double *outY);
+
+private:
+   int            mWidth;  // client width
+   int            mHeight; // client height
+
+   int            mKaraokeHeight; //vvv mHeight - mBrandingHeight (so just mHeight now that Branding is removed).
+   unsigned int   mKaraokeFontSize;
+
+   LyricsStyle          mLyricsStyle; // default kHighlightLyrics
+   HighlightTextCtrl*   mHighlightTextCtrl; // only for kHighlightLyrics
+
+   double         mT;
+
+   int            mCurrentSyllable;
+   SyllableArray  mSyllables;
+   wxString       mText; 
+
+   int            mTextHeight; // only for drawn text
+   bool           mMeasurementsDone; // only for drawn text
+
+   DECLARE_EVENT_TABLE()
+};
+
+#endif // __AUDACITY_LYRICS__
diff --git a/src/LyricsWindow.cpp b/src/LyricsWindow.cpp
new file mode 100644
index 0000000..499182d
--- /dev/null
+++ b/src/LyricsWindow.cpp
@@ -0,0 +1,135 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  LyricsWindow.cpp
+
+  Vaughan Johnson
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#include "Experimental.h"
+#ifdef EXPERIMENTAL_LYRICS_WINDOW
+
+#include "LyricsWindow.h"
+#include "Lyrics.h"
+#include "Project.h"
+
+#include <wx/radiobut.h>
+#include <wx/toolbar.h>
+#include <wx/settings.h>
+
+#ifdef __WXMSW__
+   #include "../images/AudacityLogo.xpm"
+#else
+   #include "../images/AudacityLogo48x48.xpm"
+#endif
+
+#ifdef __WXMAC__
+   #include <Carbon/Carbon.h>
+#endif
+
+enum {
+   kID_RadioButton_BouncingBall = 10101,
+   kID_RadioButton_Highlight,
+};
+
+BEGIN_EVENT_TABLE(LyricsWindow, wxFrame)
+   EVT_CLOSE(LyricsWindow::OnCloseWindow)
+   EVT_RADIOBUTTON(kID_RadioButton_BouncingBall, LyricsWindow::OnStyle_BouncingBall)
+   EVT_RADIOBUTTON(kID_RadioButton_Highlight, LyricsWindow::OnStyle_Highlight)
+END_EVENT_TABLE()
+
+const wxSize gSize = wxSize(LYRICS_DEFAULT_WIDTH, LYRICS_DEFAULT_HEIGHT);
+
+LyricsWindow::LyricsWindow(AudacityProject *parent):
+   wxFrame(parent, -1, 
+            wxString::Format(_("Audacity Lyrics%s"), 
+                              ((parent->GetName() == wxEmptyString) ? 
+                                 wxT("") :
+                                 wxString::Format(
+                                   wxT(" - %s"),
+                                   parent->GetName().c_str()).c_str())),
+            wxPoint(100, 300), gSize, 
+            wxDEFAULT_FRAME_STYLE
+#ifndef __WXMAC__
+           | ((parent == NULL) ? 0x0 : wxFRAME_FLOAT_ON_PARENT) //vvvvv
+#endif
+             )
+{
+#ifdef __WXMAC__
+   // WXMAC doesn't support wxFRAME_FLOAT_ON_PARENT, so we do
+   SetWindowClass((WindowRef) MacGetWindowRef(), kFloatingWindowClass);
+#endif
+   mProject = parent;
+
+   // loads either the XPM or the windows resource, depending on the platform
+#if !defined(__WXMAC__) && !defined(__WXX11__)
+   #ifdef __WXMSW__
+      wxIcon ic(wxICON(AudacityLogo));
+   #else
+      wxIcon ic(wxICON(AudacityLogo48x48));
+   #endif
+   SetIcon(ic);
+#endif
+
+   wxToolBar* pToolBar = this->CreateToolBar();
+   const int kHorizMargin = 8;
+   wxRadioButton* pRadioButton_BouncingBall = 
+      new wxRadioButton(pToolBar, kID_RadioButton_BouncingBall, _("Bouncing Ball"), wxPoint(kHorizMargin, 4),
+          wxDefaultSize, wxRB_GROUP);
+   // Reposition to center vertically. 
+   wxSize tbSize = pToolBar->GetSize();
+   wxSize btnSize = pRadioButton_BouncingBall->GetSize();
+   int top = (tbSize.GetHeight() - btnSize.GetHeight()) / 2;
+   pRadioButton_BouncingBall->Move(kHorizMargin, top);
+   pToolBar->AddControl(pRadioButton_BouncingBall);
+
+   int left = kHorizMargin + btnSize.GetWidth() + kHorizMargin; //vvv Doesn't actually work. Probably need sizers.
+   wxRadioButton* pRadioButton_Highlight = 
+      new wxRadioButton(pToolBar, kID_RadioButton_Highlight, _("Highlight"), wxPoint(left, top));
+   pToolBar->AddControl(pRadioButton_Highlight);
+   pRadioButton_Highlight->Enable(false); //vvvvv not working right in ported version, so disabled.
+
+#if defined(__WXMAC__)
+   wxColour face = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+   pRadioButton_BouncingBall->SetBackgroundColour(face);
+   pRadioButton_Highlight->SetBackgroundColour(face);
+#endif
+
+   pToolBar->Realize();
+
+   mLyricsPanel = 
+      new Lyrics(this, -1, 
+                  wxPoint(0, tbSize.GetHeight()), 
+                  wxSize(gSize.GetWidth(), gSize.GetHeight() - tbSize.GetHeight()));
+   switch (mLyricsPanel->GetLyricsStyle()) 
+   {
+      case Lyrics::kBouncingBallLyrics:
+         pRadioButton_BouncingBall->SetValue(true); break;
+      case Lyrics::kHighlightLyrics:
+      default:
+         pRadioButton_Highlight->SetValue(true); break;
+   }
+}
+
+LyricsWindow::~LyricsWindow()
+{}
+
+void LyricsWindow::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
+{
+  this->Hide();
+}
+
+void LyricsWindow::OnStyle_BouncingBall(wxCommandEvent &evt)
+{
+   mLyricsPanel->SetLyricsStyle(Lyrics::kBouncingBallLyrics);
+}
+
+void LyricsWindow::OnStyle_Highlight(wxCommandEvent &evt)
+{
+   mLyricsPanel->SetLyricsStyle(Lyrics::kHighlightLyrics);
+}
+
+#endif // EXPERIMENTAL_LYRICS_WINDOW
diff --git a/src/LyricsWindow.h b/src/LyricsWindow.h
new file mode 100644
index 0000000..29456da
--- /dev/null
+++ b/src/LyricsWindow.h
@@ -0,0 +1,45 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  LyricsWindow.h
+
+  Vaughan Johnson
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#include "Experimental.h"
+#ifdef EXPERIMENTAL_LYRICS_WINDOW
+
+#ifndef __AUDACITY_LYRICS_WINDOW__
+#define __AUDACITY_LYRICS_WINDOW__
+
+#include <wx/frame.h>
+
+class AudacityProject;
+class Lyrics;
+
+class LyricsWindow : public wxFrame {
+
+ public:
+   LyricsWindow(AudacityProject* parent);
+   virtual ~LyricsWindow();
+
+   Lyrics *GetLyricsPanel() { return mLyricsPanel; };
+
+ private:
+   void OnCloseWindow(wxCloseEvent & WXUNUSED(event));
+
+   void OnStyle_BouncingBall(wxCommandEvent &evt);
+   void OnStyle_Highlight(wxCommandEvent &evt);
+
+   AudacityProject *mProject;
+   Lyrics *mLyricsPanel;
+
+ public:
+   DECLARE_EVENT_TABLE()
+};
+
+#endif
+#endif // EXPERIMENTAL_LYRICS_WINDOW
diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp
new file mode 100644
index 0000000..e089997
--- /dev/null
+++ b/src/MixerBoard.cpp
@@ -0,0 +1,1337 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  MixerBoard.cpp
+
+  Vaughan Johnson, January 2007
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#include "Experimental.h"
+#ifdef EXPERIMENTAL_MIXER_BOARD
+
+#include <math.h>
+
+#include <wx/dcmemory.h>
+#include <wx/arrimpl.cpp>
+#include <wx/settings.h> // for wxSystemSettings::GetColour and wxSystemSettings::GetMetric
+
+#include "AColor.h"
+#include "MixerBoard.h"
+#include "Project.h"
+
+#include "../images/MusicalInstruments.h"
+
+#ifdef __WXMSW__
+   #include "../images/AudacityLogo.xpm"
+#else
+   #include "../images/AudacityLogo48x48.xpm"
+#endif
+
+// class MixerTrackCluster
+
+#define kInset 4
+#define kDoubleInset (2 * kInset)
+#define kTripleInset (3 * kInset)
+#define kQuadrupleInset (4 * kInset)
+
+#define TRACK_NAME_HEIGHT 18
+#define MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH 48
+#define MUTE_SOLO_HEIGHT 16
+#define PAN_HEIGHT 24
+
+// If we decide we want more than 1 frame, base it on sample rate. 
+const int kFramesPerBuffer = 4; // for calls to mMeter->UpdateDisplay
+
+const int kGainSliderMin = -36; 
+const int kGainSliderMax = 6; // headroom convention to match typical mixer boards layout
+
+enum {
+   ID_TOGGLEBUTTON_MUTE = 13000,
+   ID_TOGGLEBUTTON_SOLO,
+   ID_ASLIDER_PAN,
+   ID_SLIDER_GAIN,
+};
+
+BEGIN_EVENT_TABLE(MixerTrackCluster, wxPanel)
+   EVT_CHAR(MixerTrackCluster::OnKeyEvent)
+   EVT_MOUSE_EVENTS(MixerTrackCluster::OnMouseEvent)
+   EVT_COMMAND(ID_TOGGLEBUTTON_MUTE, wxEVT_COMMAND_BUTTON_CLICKED, MixerTrackCluster::OnButton_Mute)
+   EVT_COMMAND(ID_TOGGLEBUTTON_SOLO, wxEVT_COMMAND_BUTTON_CLICKED, MixerTrackCluster::OnButton_Solo)
+   EVT_PAINT(MixerTrackCluster::OnPaint)
+   EVT_SLIDER(ID_ASLIDER_PAN, MixerTrackCluster::OnSlider_Pan)
+   EVT_SLIDER(ID_SLIDER_GAIN, MixerTrackCluster::OnSlider_Gain)
+   //v EVT_COMMAND_SCROLL(ID_SLIDER_GAIN, MixerTrackCluster::OnSliderScroll_Gain)
+END_EVENT_TABLE()
+
+MixerTrackCluster::MixerTrackCluster(wxWindow* parent, 
+                                       MixerBoard* grandParent, AudacityProject* project, 
+                                       WaveTrack* pLeftTrack, WaveTrack* pRightTrack /*= NULL*/, 
+                                       const wxPoint& pos /*= wxDefaultPosition*/, 
+                                       const wxSize& size /*= wxDefaultSize*/) 
+: wxPanel(parent, -1, pos, size)
+{
+   mMixerBoard = grandParent;
+   mProject = project;
+   mLeftTrack = pLeftTrack;
+   mRightTrack = pRightTrack;
+
+   this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); 
+
+   // Create the controls programmatically.
+   
+   // Not sure why, but sizers weren't getting offset vertically, 
+   // probably because not using wxDefaultPosition, 
+   // so positions are calculated explicitly below, and sizers code was removed.
+   // (Still available in Audacity_UmixIt branch off 1.2.6.)
+
+   // track name
+   wxPoint ctrlPos(kInset, kInset);
+   wxSize ctrlSize(size.GetWidth() - kDoubleInset, TRACK_NAME_HEIGHT);
+   mStaticText_TrackName = 
+      new wxStaticText(this, -1, mLeftTrack->GetName(), ctrlPos, ctrlSize, 
+                        wxALIGN_CENTRE | wxST_NO_AUTORESIZE | wxSUNKEN_BORDER);
+   //v Useful when different tracks are different colors, but not now.   
+   //    mStaticText_TrackName->SetBackgroundColour(this->GetTrackColor());
+
+   
+   // musical instrument image
+   ctrlPos.x = (size.GetWidth() - MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH) / 2; // center
+   ctrlPos.y += TRACK_NAME_HEIGHT + kDoubleInset;
+   ctrlSize = wxSize(MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH, MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH);
+   wxBitmap* bitmap = mMixerBoard->GetMusicalInstrumentBitmap(mLeftTrack);
+   wxASSERT(bitmap);
+   mStaticBitmap_MusicalInstrument = 
+      new wxStaticBitmap(this, -1, *bitmap, ctrlPos, ctrlSize);
+
+   
+   // mute/solo buttons
+   int nHalfWidth = (size.GetWidth() / 2);
+   ctrlPos.x = ((nHalfWidth - mMixerBoard->mMuteSoloWidth) / 2) + kInset;
+   ctrlPos.y += MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kQuadrupleInset;
+   ctrlSize = wxSize(mMixerBoard->mMuteSoloWidth, MUTE_SOLO_HEIGHT);
+   mToggleButton_Mute = 
+      new AButton(this, ID_TOGGLEBUTTON_MUTE, 
+                  ctrlPos, ctrlSize, 
+                  *(mMixerBoard->mImageMuteUp), *(mMixerBoard->mImageMuteOver), 
+                  *(mMixerBoard->mImageMuteDown), *(mMixerBoard->mImageMuteDisabled), 
+                  true); // toggle button
+   mToggleButton_Mute->SetAlternateImages(
+      *(mMixerBoard->mImageMuteUp), *(mMixerBoard->mImageMuteOver), 
+      *(mMixerBoard->mImageMuteDown), *(mMixerBoard->mImageMuteDisabled));
+   this->UpdateMute();
+
+   ctrlPos.x = nHalfWidth + kInset;
+   mToggleButton_Solo = 
+      new AButton(this, ID_TOGGLEBUTTON_SOLO, 
+                  ctrlPos, ctrlSize, 
+                  *(mMixerBoard->mImageSoloUp), *(mMixerBoard->mImageSoloOver), 
+                  *(mMixerBoard->mImageSoloDown), *(mMixerBoard->mImageSoloDisabled), 
+                  true); // toggle button
+   this->UpdateSolo();
+
+   
+   // pan slider
+   ctrlPos.x = (size.GetWidth() / 10);
+   ctrlPos.y += MUTE_SOLO_HEIGHT + kQuadrupleInset;
+   ctrlSize = wxSize((size.GetWidth() * 4 / 5), PAN_HEIGHT);
+
+   // The width of the pan slider must be odd (don't ask)
+   if (!(ctrlSize.x & 1))
+      ctrlSize.x--;
+
+   /* i18n-hint: Title of the Pan slider, used to move the sound left or right */
+   mSlider_Pan = new ASlider(this, ID_ASLIDER_PAN, _("Pan"), ctrlPos, ctrlSize, PAN_SLIDER, true); 
+
+   this->UpdatePan();
+
+
+   // gain slider & level meter
+   ctrlPos.x = kDoubleInset;
+   ctrlPos.y += PAN_HEIGHT + kQuadrupleInset;
+
+   // Instead of an even split of the cluster width, give extra pixels to the meter
+   const int kExtraWidthForMeter = 8;
+   ctrlSize = wxSize((nHalfWidth - kTripleInset - kExtraWidthForMeter), 
+                     (size.GetHeight() - ctrlPos.y - kQuadrupleInset));
+
+   /* i18n-hint: Title of the Gain slider, used to adjust the volume */
+   mSlider_Gain = 
+      new ASlider(this, ID_SLIDER_GAIN, _("Gain"), ctrlPos, ctrlSize, DB_SLIDER, true, true, 0.0, wxVERTICAL);
+
+   // too much color:   mSlider_Gain->SetBackgroundColour(this->GetTrackColor());
+   // too dark:   mSlider_Gain->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW));
+   //#ifdef __WXMAC__
+   //   mSlider_Gain->SetBackgroundColour(wxColour(220, 220, 220));
+   //#else
+   //   mSlider_Gain->SetBackgroundColour(wxColour(192, 192, 192));
+   //#endif
+
+   this->UpdateGain();
+
+
+   ctrlPos.x = nHalfWidth - kExtraWidthForMeter;
+   ctrlSize.SetWidth(nHalfWidth - kInset + kExtraWidthForMeter);
+
+   mMeter = 
+      new Meter(this, -1, // wxWindow* parent, wxWindowID id, 
+                false, // bool isInput
+                ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+                Meter::MixerTrackCluster); // Style style = HorizontalStereo, 
+
+   #if wxUSE_TOOLTIPS
+      mStaticText_TrackName->SetToolTip(_T("Track Name"));
+      mToggleButton_Mute->SetToolTip(_T("Mute"));
+      mToggleButton_Solo->SetToolTip(_T("Solo"));
+      mMeter->SetToolTip(_T("Signal Level Meter"));
+   #endif // wxUSE_TOOLTIPS
+
+   #ifdef __WXMAC__
+      wxSizeEvent dummyEvent;
+      this->OnSize(dummyEvent);
+      UpdateGain();
+   #endif
+}
+
+void MixerTrackCluster::ResetMeter()
+{
+   mMeter->Reset(mLeftTrack->GetRate(), true);
+}
+
+void MixerTrackCluster::UpdateHeight() // For wxSizeEvents, update gain slider and meter.
+{
+   wxSize scrolledWindowClientSize = this->GetParent()->GetClientSize();   
+   int newClusterHeight = 
+      scrolledWindowClientSize.GetHeight() - 
+      wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y) + // wxScrolledWindow::GetClientSize doesn't account for its scrollbar size.
+      kDoubleInset;
+   
+   this->SetSize(-1, newClusterHeight); 
+
+   // Change only the heights of mSlider_Gain and mMeter.
+   int newHeight = 
+      newClusterHeight - 
+      (kInset + // margin above mStaticText_TrackName
+         TRACK_NAME_HEIGHT + kDoubleInset + // mStaticText_TrackName + margin
+         MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kQuadrupleInset + // musical instrument icon + margin
+         MUTE_SOLO_HEIGHT + kQuadrupleInset + // mute/solo buttons + margin
+         PAN_HEIGHT + kQuadrupleInset) - // pan slider
+      kQuadrupleInset; // margin below gain slider and meter 
+
+   // -1 doesn't work right to preserve width for wxSlider, and it doesn't implement GetSize(void).
+   //    mSlider_Gain->SetSize(-1, newHeight);
+   int oldWidth; 
+   int oldHeight;
+   mSlider_Gain->GetSize(&oldWidth, &oldHeight);
+   mSlider_Gain->SetSize(oldWidth, newHeight); 
+
+   mMeter->SetSize(-1, newHeight);
+}
+
+
+// These are used by TrackPanel for synchronizing control states, etc.
+void MixerTrackCluster::UpdateName()
+{
+   mStaticText_TrackName->SetLabel(mLeftTrack->GetName()); 
+   mStaticBitmap_MusicalInstrument->SetBitmap(*(mMixerBoard->GetMusicalInstrumentBitmap(mLeftTrack)));
+}
+
+void MixerTrackCluster::UpdateMute()
+{
+   mToggleButton_Mute->SetAlternate(mLeftTrack->GetSolo());
+   if (mLeftTrack->GetMute())
+      mToggleButton_Mute->PushDown(); 
+   else 
+      mToggleButton_Mute->PopUp(); 
+}
+
+void MixerTrackCluster::UpdateSolo()
+{
+   bool bValue = mLeftTrack->GetSolo();
+   if (bValue)
+      mToggleButton_Solo->PushDown(); 
+   else 
+      mToggleButton_Solo->PopUp(); 
+   mToggleButton_Mute->SetAlternate(bValue);
+}
+
+void MixerTrackCluster::UpdatePan()
+{
+   mSlider_Pan->Set(mLeftTrack->GetPan());
+}
+
+void MixerTrackCluster::UpdateGain()
+{
+   mSlider_Gain->Set(mLeftTrack->GetGain()); //v mSlider_Gain->SetValue(this->GetGainToSliderValue());
+}
+
+void MixerTrackCluster::UpdateMeter(double t0, double t1)
+{
+   if ((t0 < 0.0) || (t1 < 0.0) || (t0 > t1) || // bad time value
+         ((mMixerBoard->HasSolo() || mLeftTrack->GetMute()) && !mLeftTrack->GetSolo()))
+   {
+      this->ResetMeter();
+      return;
+   }
+
+   float min; // A dummy, since it's not shown in meters. 
+   float* maxLeft = new float[kFramesPerBuffer];
+   float* rmsLeft = new float[kFramesPerBuffer];
+   float* maxRight = new float[kFramesPerBuffer];
+   float* rmsRight = new float[kFramesPerBuffer];
+   const sampleCount kSampleCount = mLeftTrack->TimeToLongSamples(t1 - t0);
+   
+   bool bSuccess = true;
+   const double kFrameInterval = (t1 - t0) / (double)kFramesPerBuffer;
+   double dFrameT0 = t0;
+   double dFrameT1 = t0 + kFrameInterval;
+   unsigned int i = 0;
+   while (bSuccess && (i < kFramesPerBuffer))
+   {
+      bSuccess &= 
+         mLeftTrack->GetMinMax(&min, &(maxLeft[i]), dFrameT0, dFrameT1) && 
+         mLeftTrack->GetRMS(&(rmsLeft[i]), dFrameT0, dFrameT1);
+      if (bSuccess && mRightTrack)
+         bSuccess &=
+            mRightTrack->GetMinMax(&min, &(maxRight[i]), dFrameT0, dFrameT1) && 
+            mRightTrack->GetRMS(&(rmsRight[i]), dFrameT0, dFrameT1);
+      else
+      {
+         // Mono: Start with raw values same as left. 
+         // To be modified by bWantPostFadeValues and channel pan/gain.
+         maxRight[i] = maxLeft[i];
+         rmsRight[i] = rmsLeft[i];
+      }
+      dFrameT0 += kFrameInterval;
+      dFrameT1 += kFrameInterval;
+      i++;
+   }
+
+   bool bWantPostFadeValues = true; //vvv Turn this into a pref, default true.
+   if (bSuccess && bWantPostFadeValues)
+   {
+      for (i = 0; i < kFramesPerBuffer; i++)
+      {
+         float gain = mLeftTrack->GetChannelGain(0);
+         maxLeft[i] *= gain;
+         rmsLeft[i] *= gain;
+         if (mRightTrack)
+            gain = mRightTrack->GetChannelGain(1);
+         else
+            gain = mLeftTrack->GetChannelGain(1);
+         maxRight[i] *= gain;
+         rmsRight[i] *= gain;
+      }
+   }
+
+   if (bSuccess)
+      mMeter->UpdateDisplay(
+         2, // If mono, show left track values in both meters, as in MeterToolBar.      kNumChannels, 
+         kFramesPerBuffer, 
+         maxLeft, rmsLeft, 
+         maxRight, rmsRight, 
+         kSampleCount);
+
+   delete[] maxLeft;
+   delete[] rmsLeft;
+   delete[] maxRight;
+   delete[] rmsRight;
+}
+
+// private
+
+int MixerTrackCluster::GetGainToSliderValue()
+{
+   int nSliderValue = 
+      // Analog to LWSlider::Set() calc for DB_SLIDER. 
+      (int)(20.0f * log10(mLeftTrack->GetGain()));
+   if (nSliderValue < kGainSliderMin)
+      nSliderValue = kGainSliderMin;
+   if (nSliderValue > kGainSliderMax)
+      nSliderValue = kGainSliderMax;
+
+   #ifdef __WXMSW__
+      nSliderValue = -nSliderValue; // wxSlider on Windows has max at bottom!
+   #endif
+
+   return nSliderValue;
+}
+
+wxColour MixerTrackCluster::GetTrackColor()
+{
+   //#if (AUDACITY_BRANDING == BRAND_UMIXIT)
+   //   return AColor::GetTrackColor((void*)mLeftTrack);
+   //#else
+      return wxColour(102, 255, 102); // same as Meter playback color
+   //#endif
+}
+
+// event handlers
+void MixerTrackCluster::OnKeyEvent(wxKeyEvent & event)
+{
+   mProject->HandleKeyDown(event);
+}
+
+void MixerTrackCluster::OnMouseEvent(wxMouseEvent& event)
+{
+   if (event.ButtonUp()) 
+   {
+      if (event.ShiftDown()) 
+      {
+         // ShiftDown => Just toggle selection on this track.
+         bool bSelect = !mLeftTrack->GetSelected();
+         mLeftTrack->SetSelected(bSelect);
+         if (mRightTrack)
+            mRightTrack->SetSelected(bSelect);
+         this->Refresh(false); // Refresh only this MixerTrackCluster.
+      }
+      else
+      {
+         // exclusive select
+         mProject->SelectNone();
+         mLeftTrack->SetSelected(true);
+         if (mRightTrack)
+            mRightTrack->SetSelected(true);
+
+         if (mProject->GetSel0() >= mProject->GetSel1())
+         {
+            // No range previously selected, so use the range of this track. 
+            mProject->mViewInfo.sel0 = mLeftTrack->GetOffset();
+            mProject->mViewInfo.sel1 = mLeftTrack->GetEndTime();
+         }
+
+         // Exclusive select, so refresh all MixerTrackClusters.
+         //    This could just be a call to wxWindow::Refresh, but this is 
+         //    more efficient and when ProjectLogo is shown as background, 
+         //    it's necessary to prevent blinking.
+         mMixerBoard->RefreshTrackClusters();
+      }
+   }
+}
+
+void MixerTrackCluster::OnPaint(wxPaintEvent &evt)
+{
+   wxPaintDC dc(this);
+
+   #ifdef __WXMAC__
+      // Fill with correct color, not scroller background. Done automatically on Windows.
+      AColor::Medium(&dc, false);
+      dc.DrawRectangle(this->GetClientRect());
+   #endif
+
+   wxSize clusterSize = this->GetSize();
+   wxRect bev(0, 0, clusterSize.GetWidth() - 1, clusterSize.GetHeight() - 1);
+   if (mLeftTrack->GetSelected())
+   {
+      for (unsigned int i = 0; i < 2; i++) 
+      {
+         bev.Inflate(-1, -1);
+         AColor::Bevel(dc, false, bev);
+      }
+   }
+   else
+      AColor::Bevel(dc, true, bev);
+}
+
+
+void MixerTrackCluster::OnButton_Mute(wxCommandEvent& event)
+{
+   // Shift-click mutes this track and unmutes other tracks. Tell mMixerBoard to handle it.
+   if (mToggleButton_Mute->WasShiftDown())
+   {
+      mMixerBoard->UniquelyMuteOrSolo(mLeftTrack, false);
+      return;
+   }
+
+   bool bValue = mToggleButton_Mute->IsDown();
+   mLeftTrack->SetMute(bValue);
+   if (mRightTrack)
+      mRightTrack->SetMute(bValue);
+   mToggleButton_Mute->SetAlternate(mLeftTrack->GetSolo());
+
+   // Update the TrackPanel correspondingly. 
+   // Calling RedrawProject is inefficient relative to sending a msg to TrackPanel 
+   // for a particular track and control, but not a real performance hit.
+   mProject->RedrawProject();
+}
+
+void MixerTrackCluster::OnButton_Solo(wxCommandEvent& event)
+{
+   // Shift-click solos this track and unsolos other tracks. Tell mMixerBoard to handle it.
+   if (mToggleButton_Solo->WasShiftDown())
+   {
+      mMixerBoard->UniquelyMuteOrSolo(mLeftTrack, true);
+      return;
+   }
+
+   bool bValue = mToggleButton_Solo->IsDown();
+   mLeftTrack->SetSolo(bValue);
+   if (mRightTrack)
+      mRightTrack->SetSolo(bValue);
+   mMixerBoard->IncrementSoloCount(bValue ? 1 : -1);
+   mToggleButton_Mute->SetAlternate(bValue);
+
+   // Update the TrackPanel correspondingly. 
+   // Calling RedrawProject is inefficient relative to sending a msg to TrackPanel 
+   // for a particular track and control, but not a real performance hit.
+   mProject->RedrawProject(); 
+}
+
+void MixerTrackCluster::OnSlider_Pan(wxCommandEvent& event)
+{
+   float fValue = mSlider_Pan->Get();
+   mLeftTrack->SetPan(fValue);
+   if (mRightTrack != NULL)
+      mRightTrack->SetPan(fValue);
+   mProject->TP_PushState(_("Moved pan slider"), _("Pan"), true /* consolidate */);
+
+   // Update the TrackPanel correspondingly. 
+   // Calling RedrawProject is inefficient relative to sending a msg to TrackPanel 
+   // for a particular track and control, but not a real performance hit.
+   mProject->RedrawProject();
+}
+
+void MixerTrackCluster::OnSlider_Gain(wxCommandEvent& event)
+{
+   float fValue = mSlider_Gain->Get();
+   mLeftTrack->SetGain(fValue);
+   if (mRightTrack != NULL)
+      mRightTrack->SetGain(fValue);
+   mProject->TP_PushState(_("Moved gain slider"), _("Gain"), true /* consolidate */);
+
+   // Update the TrackPanel correspondingly. 
+   // Calling RedrawProject is inefficient relative to sending a msg to TrackPanel 
+   // for a particular track and control, but not a real performance hit.
+   mProject->RedrawProject();
+}
+
+//v void MixerTrackCluster::OnSliderScroll_Gain(wxScrollEvent& event)
+//{
+   //int sliderValue = (int)(mSlider_Gain->Get()); //v mSlider_Gain->GetValue();
+   //#ifdef __WXMSW__
+   //   // Negate because wxSlider on Windows has min at top, max at bottom. 
+   //   // mSlider_Gain->GetValue() is in [-6,36]. wxSlider has min at top, so this is [-36dB,6dB]. 
+   //   sliderValue = -sliderValue;
+   //#endif
+   //wxString str = _T("Gain: ");
+   //if (sliderValue > 0) 
+   //   str += "+";
+   //str += wxString::Format("%d dB", sliderValue);
+   //mSlider_Gain->SetToolTip(str);
+//}
+
+
+// class MusicalInstrument
+
+MusicalInstrument::MusicalInstrument(wxBitmap* pBitmap, const wxString strXPMfilename)
+{
+   mBitmap = pBitmap;
+
+   size_t nFirstCharIndex = 0;
+   int nUnderscoreIndex;
+   wxString strFilename = strXPMfilename;
+   strFilename.MakeLower(); // Make sure, so we don't have to do case insensitive comparison.
+   wxString strKeyword;
+   while ((nUnderscoreIndex = strFilename.Find(wxT('_'))) != -1) 
+   {
+      strKeyword = strFilename.Left(nUnderscoreIndex);
+      mKeywords.Add(strKeyword);
+      strFilename = strFilename.Mid(nUnderscoreIndex + 1);
+   }
+   if (!strFilename.IsEmpty()) // Skip trailing underscores.
+      mKeywords.Add(strFilename); // Add the last one. 
+}
+
+MusicalInstrument::~MusicalInstrument()
+{
+   delete mBitmap;
+   mKeywords.Clear();
+}
+
+WX_DEFINE_OBJARRAY(MusicalInstrumentArray);
+
+
+// class MixerBoardScrolledWindow 
+
+// wxScrolledWindow ignores mouse clicks in client area, 
+// but they don't get passed to Mixerboard.
+// We need to catch them to deselect all track clusters.
+
+BEGIN_EVENT_TABLE(MixerBoardScrolledWindow, wxScrolledWindow)
+   EVT_MOUSE_EVENTS(MixerBoardScrolledWindow::OnMouseEvent)
+END_EVENT_TABLE()
+
+MixerBoardScrolledWindow::MixerBoardScrolledWindow(AudacityProject* project, 
+                                                   MixerBoard* parent, wxWindowID id /*= -1*/, 
+                                                   const wxPoint& pos /*= wxDefaultPosition*/, 
+                                                   const wxSize& size /*= wxDefaultSize*/, 
+                                                   long style /*= wxHSCROLL | wxVSCROLL*/)
+: wxScrolledWindow(parent, id, pos, size, style)
+{
+   mMixerBoard = parent;
+   mProject = project;
+}
+
+MixerBoardScrolledWindow::~MixerBoardScrolledWindow()
+{
+}
+
+void MixerBoardScrolledWindow::OnMouseEvent(wxMouseEvent& event)
+{
+   if (event.ButtonUp()) 
+   {
+      //v Even when I implement MixerBoard::OnMouseEvent and call event.Skip() 
+      // here, MixerBoard::OnMouseEvent never gets called.
+      // So, added mProject to MixerBoardScrolledWindow and just directly do what's needed here.
+      mProject->SelectNone();
+      mMixerBoard->RefreshTrackClusters();
+   }
+   else
+      event.Skip();
+}
+
+
+// class MixerBoard
+
+#define MIXER_BOARD_MIN_HEIGHT 500
+#define MIXER_TRACK_CLUSTER_WIDTH 100 - kInset
+
+BEGIN_EVENT_TABLE(MixerBoard, wxWindow)
+   EVT_SIZE(MixerBoard::OnSize)
+END_EVENT_TABLE()
+
+MixerBoard::MixerBoard(AudacityProject* pProject, 
+                        wxFrame* parent, 
+                        const wxPoint& pos /*= wxDefaultPosition*/, 
+                        const wxSize& size /*= wxDefaultSize*/)
+: wxWindow(parent, -1, pos, size)
+{
+   // public data members
+
+   // mute & solo button images: Create once and store on MixerBoard for use in all MixerTrackClusters.
+   mImageMuteUp = NULL;
+   mImageMuteOver = NULL;
+   mImageMuteDown = NULL;
+   mImageMuteDownWhileSolo = NULL;
+   mImageMuteDisabled = NULL;
+   mImageSoloUp = NULL;
+   mImageSoloOver = NULL;
+   mImageSoloDown = NULL;
+   mImageSoloDisabled = NULL;
+
+   mMuteSoloWidth = 44; //v good estimate, but really set in MixerBoard::CreateMuteSoloImages
+
+   // private data members
+   this->LoadMusicalInstruments(); // Set up mMusicalInstruments.
+   mProject = pProject;
+   
+   mScrolledWindow = 
+      new MixerBoardScrolledWindow(
+         pProject, // AudacityProject* project,
+         this, -1, // wxWindow* parent, wxWindowID id = -1, 
+         this->GetClientAreaOrigin(), // const wxPoint& pos = wxDefaultPosition, 
+         size, // const wxSize& size = wxDefaultSize, 
+         wxHSCROLL); // long style = wxHSCROLL | wxVSCROLL, const wxString& name = "scrolledWindow")
+
+   // Set background color to same as TrackPanel background.
+   #ifdef EXPERIMENTAL_THEMING
+      mScrolledWindow->SetBackgroundColour(this->GetParent()->GetBackgroundColour());
+   #else
+      mScrolledWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); 
+   #endif
+   
+   mScrolledWindow->SetScrollRate(10, 0); // no vertical scroll
+   mScrolledWindow->SetVirtualSize(size);
+
+   /* This doesn't work to make the mScrolledWindow automatically resize, so do it explicitly in OnSize.
+         wxBoxSizer* pBoxSizer = new wxBoxSizer(wxVERTICAL);
+         pBoxSizer->Add(mScrolledWindow, 0, wxExpand, 0);
+         this->SetAutoLayout(true);
+         this->SetSizer(pBoxSizer);
+         pBoxSizer->Fit(this);
+         pBoxSizer->SetSizeHints(this);
+      */
+
+   mSoloCount = 0;
+   mPrevT1 = 0.0;
+   mTracks = mProject->GetTracks();
+}
+
+MixerBoard::~MixerBoard()
+{
+   // public data members
+   delete mImageMuteUp;
+   delete mImageMuteOver;
+   delete mImageMuteDown;
+   delete mImageMuteDownWhileSolo;
+   delete mImageMuteDisabled;
+   delete mImageSoloUp;
+   delete mImageSoloOver;
+   delete mImageSoloDown;
+   delete mImageSoloDisabled;
+
+   // private data members
+   mMusicalInstruments.Clear();
+}
+
+void MixerBoard::UpdateTrackClusters() 
+{
+   if (mImageMuteUp == NULL) 
+      this->CreateMuteSoloImages();
+
+   const int kClusterHeight = mScrolledWindow->GetClientSize().GetHeight() - kDoubleInset;
+   const size_t kClusterCount = mMixerTrackClusters.GetCount();
+   unsigned int nClusterIndex = 0;
+   TrackListIterator iterTracks(mTracks);
+   MixerTrackCluster* pMixerTrackCluster = NULL;
+   Track* pLeftTrack;
+   Track* pRightTrack;
+
+   pLeftTrack = iterTracks.First();
+   while (pLeftTrack) {
+      pRightTrack = pLeftTrack->GetLinked() ? iterTracks.Next() : NULL;
+
+      if (pLeftTrack->GetKind() == Track::Wave) 
+      {
+         if (nClusterIndex < kClusterCount)
+         {
+            // Already showing it. 
+            // Track clusters are maintained in the same order as the WaveTracks.
+            // Track pointers can change for the "same" track for different states 
+            // on the undo stack, so update the pointers and display name.
+            mMixerTrackClusters[nClusterIndex]->mLeftTrack = (WaveTrack*)pLeftTrack;
+            mMixerTrackClusters[nClusterIndex]->mRightTrack = (WaveTrack*)pRightTrack;
+            mMixerTrackClusters[nClusterIndex]->UpdateName();
+         }
+         else
+         {
+            // Not already showing it. Add a new MixerTrackCluster.
+            wxPoint clusterPos(
+               ((nClusterIndex * 
+                  (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each to its left
+                  kInset), // plus left margin for new cluster
+               kInset); 
+            wxSize clusterSize(MIXER_TRACK_CLUSTER_WIDTH, kClusterHeight);
+            pMixerTrackCluster = 
+               new MixerTrackCluster(mScrolledWindow, this, mProject, 
+                                       (WaveTrack*)pLeftTrack, (WaveTrack*)pRightTrack, 
+                                       clusterPos, clusterSize);
+            if (pMixerTrackCluster)
+            {
+               mMixerTrackClusters.Add(pMixerTrackCluster);
+               this->IncrementSoloCount((int)(pLeftTrack->GetSolo()));
+            }
+         }
+         nClusterIndex++;
+      }
+      pLeftTrack = iterTracks.Next();
+   }
+
+   if (pMixerTrackCluster)
+   {
+      // Added at least one MixerTrackCluster.
+      this->UpdateWidth();
+      for (nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.GetCount(); nClusterIndex++)
+         mMixerTrackClusters[nClusterIndex]->UpdateHeight();
+   }
+   else if (nClusterIndex < kClusterCount)
+   {
+      // We've got too many clusters. 
+      // This can only on things like Undo New Audio Track or Undo Import
+      // that don't call RemoveTrackCluster explicitly. 
+      // We've already updated the track pointers for the clusters to the left, so just remove these.
+      for (; nClusterIndex < kClusterCount; nClusterIndex++)
+         this->RemoveTrackCluster(mMixerTrackClusters[nClusterIndex]->mLeftTrack);
+   }
+}
+
+int MixerBoard::GetTrackClustersWidth()
+{
+   return 
+      (mMixerTrackClusters.GetCount() *            // number of tracks times
+         (kInset + MIXER_TRACK_CLUSTER_WIDTH)) +   // left margin and width for each
+      kInset;                                      // plus final right margin
+}
+
+void MixerBoard::MoveTrackCluster(const WaveTrack* pLeftTrack, 
+                                  bool bUp) // Up in TrackPanel is left in MixerBoard.
+{
+   MixerTrackCluster* pMixerTrackCluster;
+   int nIndex = this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+   if (pMixerTrackCluster == NULL) 
+      return; // Couldn't find it.
+
+   wxPoint pos;
+   if (bUp)
+   {  // Move it up (left).
+      wxASSERT(nIndex > 0); // Shouldn't be called if already first.
+
+      pos = pMixerTrackCluster->GetPosition();
+      mMixerTrackClusters[nIndex] = mMixerTrackClusters[nIndex - 1];
+      mMixerTrackClusters[nIndex]->Move(pos);
+
+      mMixerTrackClusters[nIndex - 1] = pMixerTrackCluster;
+      pMixerTrackCluster->Move(pos.x - (kInset + MIXER_TRACK_CLUSTER_WIDTH), pos.y);
+   }
+   else
+   {  // Move it down (right).
+      wxASSERT(((unsigned int)nIndex + 1) < mMixerTrackClusters.GetCount()); // Shouldn't be called if already last.
+
+      pos = pMixerTrackCluster->GetPosition();
+      mMixerTrackClusters[nIndex] = mMixerTrackClusters[nIndex + 1];
+      mMixerTrackClusters[nIndex]->Move(pos);
+
+      mMixerTrackClusters[nIndex + 1] = pMixerTrackCluster;
+      pMixerTrackCluster->Move(pos.x + (kInset + MIXER_TRACK_CLUSTER_WIDTH), pos.y);
+   }
+}
+
+void MixerBoard::RemoveTrackCluster(const WaveTrack* pLeftTrack)
+{
+   // Find and destroy.
+   MixerTrackCluster* pMixerTrackCluster;
+   int nIndex = this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+   if (pMixerTrackCluster == NULL) 
+      return; // Couldn't find it.
+      
+   mMixerTrackClusters.RemoveAt(nIndex);
+   pMixerTrackCluster->Destroy(); // delete is unsafe on wxWindow.
+
+   // Close the gap, if any.
+   wxPoint pos;
+   int targetX;
+   for (unsigned int i = nIndex; i < mMixerTrackClusters.GetCount(); i++)
+   {
+      pos = mMixerTrackClusters[i]->GetPosition();
+      targetX = 
+         (i * (kInset + MIXER_TRACK_CLUSTER_WIDTH)) + // left margin and width for each
+         kInset; // plus left margin for this cluster
+      if (pos.x != targetX)
+         mMixerTrackClusters[i]->Move(targetX, pos.y);
+   }
+
+   this->UpdateWidth();
+}
+
+
+wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(const WaveTrack* pLeftTrack)
+{
+   if (mMusicalInstruments.IsEmpty())
+      return NULL;
+
+   // random choice:    return mMusicalInstruments[(int)pLeftTrack % mMusicalInstruments.GetCount()].mBitmap; 
+   
+   const wxString strTrackName(pLeftTrack->GetName().MakeLower());
+   size_t nBestItemIndex = 0;
+   unsigned int nBestScore = 0;
+   unsigned int nInstrIndex = 0;
+   unsigned int nKeywordIndex;
+   unsigned int nNumKeywords;
+   unsigned int nPointsPerMatch;
+   unsigned int nScore;
+   for (nInstrIndex = 0; nInstrIndex < mMusicalInstruments.GetCount(); nInstrIndex++)
+   {
+      nScore = 0;
+
+      nNumKeywords = mMusicalInstruments[nInstrIndex].mKeywords.GetCount();
+      if (nNumKeywords > 0)
+      {
+         nPointsPerMatch = 10 / nNumKeywords;
+         for (nKeywordIndex = 0; nKeywordIndex < nNumKeywords; nKeywordIndex++)
+            if (strTrackName.Contains(mMusicalInstruments[nInstrIndex].mKeywords[nKeywordIndex]))
+            {
+               nScore += 
+                  nPointsPerMatch + 
+                  // Longer keywords get more points.
+                  (2 * mMusicalInstruments[nInstrIndex].mKeywords[nKeywordIndex].Length());
+            }
+      }
+
+      // Choose later one if just matching nBestScore, for better variety, 
+      // and so default works as last element.
+      if (nScore >= nBestScore) 
+      {
+         nBestScore = nScore;
+         nBestItemIndex = nInstrIndex;
+      }
+   }
+   return mMusicalInstruments[nBestItemIndex].mBitmap;
+}
+
+bool MixerBoard::HasSolo() 
+{  
+   return (mSoloCount > 0); 
+}
+
+void MixerBoard::IncrementSoloCount(int nIncrement /*= 1*/) 
+{  
+   mSoloCount += nIncrement; 
+}
+
+void MixerBoard::RefreshTrackClusters()
+{
+   for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+      mMixerTrackClusters[i]->Refresh();
+}
+
+void MixerBoard::ResetMeters()
+{
+   mPrevT1 = 0.0;
+
+   if (!this->IsShown())
+      return;
+
+   for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+      mMixerTrackClusters[i]->ResetMeter();
+}
+
+void MixerBoard::UniquelyMuteOrSolo(const WaveTrack* pTargetLeftTrack, bool bSolo)
+{
+   wxASSERT(mTracks && !mTracks->IsEmpty());
+   TrackListIterator iterTracks(mTracks);
+   Track* pLeftTrack = iterTracks.First();
+   while (pLeftTrack) {
+      if (pLeftTrack->GetKind() == Track::Wave) {
+         if (bSolo)
+            pLeftTrack->SetSolo(pLeftTrack == pTargetLeftTrack);
+         else 
+            pLeftTrack->SetMute(pLeftTrack == pTargetLeftTrack);
+      }
+      if (pLeftTrack->GetLinked()) 
+         pLeftTrack = iterTracks.Next(); // Skip the right track.
+      pLeftTrack = iterTracks.Next();
+   }
+
+   if (bSolo)
+   {
+      mSoloCount = 1;
+      this->UpdateSolo(); // Update all the MixerTrackCluster solo buttons.
+   }
+   else 
+      this->UpdateMute(); // Update all the MixerTrackCluster mute buttons.
+   mProject->RedrawProject(); // Update all the TrackLabel mute buttons.
+}
+
+void MixerBoard::UpdateName(const WaveTrack* pLeftTrack)
+{
+   MixerTrackCluster* pMixerTrackCluster;
+   this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+   if (pMixerTrackCluster != NULL) // Found it.
+      pMixerTrackCluster->UpdateName();
+}
+
+void MixerBoard::UpdateMute(const WaveTrack* pLeftTrack /*= NULL*/) // NULL means update for all tracks.
+{
+   if (pLeftTrack == NULL) 
+   {
+      for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+         mMixerTrackClusters[i]->UpdateMute();
+   }
+   else 
+   {
+      MixerTrackCluster* pMixerTrackCluster;
+      this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+      if (pMixerTrackCluster != NULL) // Found it.
+         pMixerTrackCluster->UpdateMute();
+   }
+}
+
+void MixerBoard::UpdateSolo(const WaveTrack* pLeftTrack /*= NULL*/) // NULL means update for all tracks.
+{
+   if (pLeftTrack == NULL) 
+   {
+      for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+         mMixerTrackClusters[i]->UpdateSolo();
+   }
+   else 
+   {
+      MixerTrackCluster* pMixerTrackCluster;
+      this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+      if (pMixerTrackCluster != NULL) // Found it.
+         pMixerTrackCluster->UpdateSolo();
+   }
+}
+
+void MixerBoard::UpdatePan(const WaveTrack* pLeftTrack)
+{
+   MixerTrackCluster* pMixerTrackCluster;
+   this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+   if (pMixerTrackCluster != NULL) // Found it.
+      pMixerTrackCluster->UpdatePan();
+}
+
+void MixerBoard::UpdateGain(const WaveTrack* pLeftTrack)
+{
+   MixerTrackCluster* pMixerTrackCluster;
+   this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster);
+   if (pMixerTrackCluster != NULL) // Found it.
+      pMixerTrackCluster->UpdateGain();
+}
+
+void MixerBoard::UpdateMeters(double t1)
+{
+   if (!this->IsShown() || (t1 <= mPrevT1))
+      return;
+
+   for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+      mMixerTrackClusters[i]->UpdateMeter(mPrevT1, t1);
+
+   mPrevT1 = t1;
+}
+
+void MixerBoard::UpdateWidth()
+{
+   // All these calculations have extra padding on right, so there's 
+   // always gray area to click to deselect all tracks. 
+   int newWidth = this->GetTrackClustersWidth() + kDoubleInset;
+
+   // Min width is one cluster wide, plus margins.
+   const int kMinWidth = kInset + MIXER_TRACK_CLUSTER_WIDTH + kTripleInset;
+   if (newWidth < kMinWidth)
+      newWidth = kMinWidth;
+
+   mScrolledWindow->SetVirtualSize(newWidth, -1);
+
+   // Now limit newWidth to visible screen.
+   wxWindow* pParent = this->GetParent(); // In UmixIt, would be mProject. But here, always its MixerBoardFrame.
+   wxPoint parentPos = pParent->GetPosition();
+   const int kMaxWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X) - parentPos.x;
+   if (newWidth > kMaxWidth) 
+      newWidth = kMaxWidth;
+
+   int width;
+   int height;
+   pParent->GetSize(&width, &height);
+   if (newWidth == width) 
+      return; // No need to update. 
+
+   pParent->SetSizeHints(
+      kMinWidth, // int minW=-1, 
+      MIXER_BOARD_MIN_HEIGHT, // int minH=-1, 
+      newWidth); // int maxW=-1, 
+   pParent->SetSize(newWidth, -1);
+}
+
+//
+// private methods
+//
+
+void MixerBoard::CreateMuteSoloImages()
+{
+   // Much of this is taken TrackLabel::DrawMuteSolo 
+   wxMemoryDC dc;
+   wxString str = _("Mute"); 
+   long textWidth, textHeight;
+
+   int fontSize = 10;
+   #ifdef __WXMSW__
+      fontSize = 8;
+   #endif
+   dc.SetFont(wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL));
+   dc.GetTextExtent(str, &textWidth, &textHeight);
+   mMuteSoloWidth = textWidth + (3 * kInset);
+
+   wxBitmap bitmap(mMuteSoloWidth, MUTE_SOLO_HEIGHT);
+   dc.SelectObject(bitmap);
+   wxRect bev(0, 0, mMuteSoloWidth - 1, MUTE_SOLO_HEIGHT - 1);
+
+   // mute button images
+   AColor::Mute(&dc, false, false, false);
+   dc.DrawRectangle(bev);
+
+   wxCoord x = bev.x + (bev.width - textWidth) / 2;
+   wxCoord y = bev.y + (bev.height - textHeight) / 2;
+   dc.DrawText(str, x, y);
+
+   AColor::Bevel(dc, true, bev);
+
+   mImageMuteUp = new wxImage(bitmap.ConvertToImage());
+   mImageMuteOver = new wxImage(bitmap.ConvertToImage()); // Same as up, for now.
+
+   AColor::Mute(&dc, true, true, false);
+   dc.DrawRectangle(bev);
+   dc.DrawText(str, x, y);
+   AColor::Bevel(dc, false, bev);
+   mImageMuteDown = new wxImage(bitmap.ConvertToImage());
+
+   AColor::Mute(&dc, true, true, true);
+   dc.DrawRectangle(bev);
+   dc.DrawText(str, x, y);
+   AColor::Bevel(dc, false, bev);
+   mImageMuteDownWhileSolo = new wxImage(bitmap.ConvertToImage());
+
+   mImageMuteDisabled = new wxImage(mMuteSoloWidth, MUTE_SOLO_HEIGHT); // Leave empty because unused.
+
+
+   // solo button images
+   AColor::Solo(&dc, false, false);
+   dc.DrawRectangle(bev);
+
+   str = _("Solo");
+   dc.GetTextExtent(str, &textWidth, &textHeight);
+   x = bev.x + (bev.width - textWidth) / 2;
+   y = bev.y + (bev.height - textHeight) / 2;
+   dc.DrawText(str, x, y);
+
+   AColor::Bevel(dc, true, bev);
+
+   mImageSoloUp = new wxImage(bitmap.ConvertToImage());
+   mImageSoloOver = new wxImage(bitmap.ConvertToImage()); // Same as up, for now.
+
+   AColor::Solo(&dc, true, true);
+   dc.DrawRectangle(bev);
+   dc.DrawText(str, x, y);
+   AColor::Bevel(dc, false, bev);
+   mImageSoloDown = new wxImage(bitmap.ConvertToImage());
+
+   mImageSoloDisabled = new wxImage(mMuteSoloWidth, MUTE_SOLO_HEIGHT); // Leave empty because unused.
+}
+
+int MixerBoard::FindMixerTrackCluster(const WaveTrack* pLeftTrack, 
+                                      MixerTrackCluster** hMixerTrackCluster) const
+{
+   *hMixerTrackCluster = NULL;
+   for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+   {
+      if (mMixerTrackClusters[i]->mLeftTrack == pLeftTrack)
+      {
+         *hMixerTrackCluster = mMixerTrackClusters[i];
+         return i;
+      }
+   }
+   return -1;
+}
+
+void MixerBoard::LoadMusicalInstruments()
+{
+   wxRect bev(1, 1, MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH - 2, MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH - 2);
+   wxBitmap* bitmap;
+   wxMemoryDC dc;
+   MusicalInstrument* pMusicalInstrument;
+
+
+   bitmap = new wxBitmap((const char**)acoustic_guitar_gtr_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("acoustic_guitar_gtr"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+   
+   bitmap = new wxBitmap((const char**)acoustic_piano_pno_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("acoustic_piano_pno"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)back_vocal_bg_vox_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("back_vocal_bg_vox"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)clap_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("clap"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   bitmap = new wxBitmap((const char**)drums_dr_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("drums_dr"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+  
+   bitmap = new wxBitmap((const char**)electric_bass_guitar_bs_gtr_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("electric_bass_guitar_bs_gtr"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)electric_guitar_gtr_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("electric_guitar_gtr"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)electric_piano_pno_key_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("electric_piano_pno_key"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   bitmap = new wxBitmap((const char**)kick_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("kick"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)loop_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("loop"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)organ_org_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("organ_org"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)perc_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("perc"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   bitmap = new wxBitmap((const char**)sax_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("sax"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)snare_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("snare"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)string_violin_cello_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("string_violin_cello"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)synth_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("synth"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   bitmap = new wxBitmap((const char**)tambo_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("tambo"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)trumpet_horn_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("trumpet_horn"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)turntable_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("turntable"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+   bitmap = new wxBitmap((const char**)vibraphone_vibes_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("vibraphone_vibes"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   bitmap = new wxBitmap((const char**)vocal_vox_xpm);
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxT("vocal_vox"));
+   mMusicalInstruments.Add(pMusicalInstrument);
+
+
+   // This one must be last, so it wins when best score is 0.
+   bitmap = new wxBitmap((const char**)_default_instrument_xpm); 
+   dc.SelectObject(*bitmap);
+   AColor::Bevel(dc, false, bev);
+   pMusicalInstrument = new MusicalInstrument(bitmap, wxEmptyString);
+   mMusicalInstruments.Add(pMusicalInstrument);
+}
+
+// event handlers
+
+void MixerBoard::OnSize(wxSizeEvent &evt)
+{
+   // this->FitInside() doesn't work, and it doesn't happen automatically. Is wxScrolledWindow wrong?
+   mScrolledWindow->SetSize(evt.GetSize());
+   
+   this->UpdateWidth(); // primarily to update mScrolledWindow's virtual width
+   for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++)
+      mMixerTrackClusters[i]->UpdateHeight();
+   this->RefreshTrackClusters();
+}
+
+
+// class MixerBoardFrame
+
+BEGIN_EVENT_TABLE(MixerBoardFrame, wxFrame)
+   EVT_CLOSE(MixerBoardFrame::OnCloseWindow)
+   EVT_MAXIMIZE(MixerBoardFrame::OnMaximize)
+   EVT_SIZE(MixerBoardFrame::OnSize)
+END_EVENT_TABLE()
+
+// Default to fitting one track.
+const wxSize kDefaultSize = 
+   wxSize((kInset + MIXER_TRACK_CLUSTER_WIDTH) + // left margin and width for one track.
+               kDoubleInset, // plus final right margin
+            MIXER_BOARD_MIN_HEIGHT); 
+
+MixerBoardFrame::MixerBoardFrame(AudacityProject* parent)
+: wxFrame(parent, -1,
+            wxString::Format(_("Audacity Mixer Board%s"), 
+                              ((parent->GetName() == wxEmptyString) ? 
+                                 wxT("") : 
+                                 wxString::Format(wxT(" - %s"),
+                                                parent->GetName().c_str()).c_str())), 
+            wxDefaultPosition, kDefaultSize, 
+            wxDEFAULT_FRAME_STYLE
+            #ifndef __WXMAC__
+               | ((parent == NULL) ? 0x0 : wxFRAME_FLOAT_ON_PARENT)
+            #endif
+            )
+{
+   mMixerBoard = new MixerBoard(parent, this, wxDefaultPosition, kDefaultSize);
+  
+   this->SetSizeHints(kInset + MIXER_TRACK_CLUSTER_WIDTH, // int minW=-1, // Show at least one cluster wide. 
+                        MIXER_BOARD_MIN_HEIGHT); // int minH=-1, 
+
+   mMixerBoard->UpdateTrackClusters();
+
+   // loads either the XPM or the windows resource, depending on the platform
+   #if !defined(__WXMAC__) && !defined(__WXX11__)
+      #ifdef __WXMSW__
+         wxIcon ic(wxICON(AudacityLogo));
+      #else
+         wxIcon ic(wxICON(AudacityLogo48x48));
+      #endif
+      SetIcon(ic);
+   #endif
+}
+
+MixerBoardFrame::~MixerBoardFrame()
+{
+}
+
+// event handlers
+void MixerBoardFrame::OnCloseWindow(wxCloseEvent &WXUNUSED(event))
+{
+   this->Hide();
+}
+
+void MixerBoardFrame::OnMaximize(wxMaximizeEvent &event)
+{
+   // Update the size hints to show all tracks before skipping to let default handling happen.
+   mMixerBoard->UpdateWidth();
+   event.Skip();
+}
+
+void MixerBoardFrame::OnSize(wxSizeEvent &event)
+{
+   mMixerBoard->SetSize(this->GetClientSize());
+}
+
+#endif // EXPERIMENTAL_MIXER_BOARD
\ No newline at end of file
diff --git a/src/MixerBoard.h b/src/MixerBoard.h
new file mode 100644
index 0000000..42a399c
--- /dev/null
+++ b/src/MixerBoard.h
@@ -0,0 +1,234 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  MixerBoard.h
+
+  Vaughan Johnson, January 2007
+
+**********************************************************************/
+
+#include "Experimental.h"
+#ifdef EXPERIMENTAL_MIXER_BOARD
+
+#ifndef __AUDACITY_MIXER_BOARD__
+#define __AUDACITY_MIXER_BOARD__
+
+#include <wx/frame.h>
+#include <wx/hashmap.h>
+#include <wx/image.h>
+#include <wx/panel.h>
+#include <wx/scrolwin.h>
+#include <wx/statbmp.h>
+#include <wx/stattext.h>
+
+#include "widgets/AButton.h"
+#include "widgets/ASlider.h"
+#include "widgets/Meter.h"
+
+class AudacityProject;
+class MixerBoard;
+class WaveTrack;
+
+// containment hierarchy: 
+//    MixerBoardFrame -> MixerBoard -> MixerBoardScrolledWindow -> MixerTrackCluster(s)
+
+class MixerTrackCluster : public wxPanel { 
+public:
+   MixerTrackCluster(wxWindow* parent, 
+                     MixerBoard* grandParent, AudacityProject* project, 
+                     WaveTrack* pLeftTrack, WaveTrack* pRightTrack = NULL, 
+                     const wxPoint& pos = wxDefaultPosition, 
+                     const wxSize& size = wxDefaultSize);
+   virtual ~MixerTrackCluster() {};
+
+   void ResetMeter();
+
+   void UpdateHeight(); // For wxSizeEvents, update gain slider and meter.
+
+   // These are used by TrackPanel for synchronizing control states, etc.
+   void UpdateName();
+   void UpdateMute();
+   void UpdateSolo();
+   void UpdatePan();
+   void UpdateGain();
+   void UpdateMeter(double t0, double t1);
+
+private:
+   int GetGainToSliderValue();
+   wxColour GetTrackColor();
+
+   // event handlers
+   void OnKeyEvent(wxKeyEvent& event);
+   void OnMouseEvent(wxMouseEvent& event);
+   void OnPaint(wxPaintEvent& evt);
+
+   void OnButton_Mute(wxCommandEvent& event);
+   void OnButton_Solo(wxCommandEvent& event);
+   void OnSlider_Pan(wxCommandEvent& event);
+   void OnSlider_Gain(wxCommandEvent& event);
+   //v void OnSliderScroll_Gain(wxScrollEvent& event);
+
+public:
+   WaveTrack* mLeftTrack;
+   WaveTrack* mRightTrack; // NULL if mono
+
+private:
+   MixerBoard* mMixerBoard;
+   AudacityProject* mProject;
+
+   // controls
+   wxStaticText* mStaticText_TrackName;
+   wxStaticBitmap* mStaticBitmap_MusicalInstrument;
+   AButton* mToggleButton_Mute;
+   AButton* mToggleButton_Solo;
+   ASlider* mSlider_Pan;
+   ASlider* mSlider_Gain;
+   Meter* mMeter;
+
+public:
+   DECLARE_EVENT_TABLE()
+};
+
+WX_DEFINE_ARRAY(MixerTrackCluster*, MixerTrackClusterArray);
+
+
+class MusicalInstrument {
+public:
+   MusicalInstrument(wxBitmap* pBitmap, const wxString strXPMfilename);
+   virtual ~MusicalInstrument();
+
+   wxBitmap*      mBitmap;
+   wxArrayString  mKeywords;
+};
+WX_DECLARE_OBJARRAY(MusicalInstrument, MusicalInstrumentArray);
+
+
+
+// wxScrolledWindow ignores mouse clicks in client area, 
+// but they don't get passed to Mixerboard.
+// We need to catch them to deselect all track clusters.
+class MixerBoardScrolledWindow : public wxScrolledWindow {
+public: 
+   MixerBoardScrolledWindow(AudacityProject* project, 
+                              MixerBoard* parent, wxWindowID id = -1, 
+                              const wxPoint& pos = wxDefaultPosition, 
+                              const wxSize& size = wxDefaultSize, 
+                              long style = wxHSCROLL | wxVSCROLL);
+   virtual ~MixerBoardScrolledWindow();
+
+private:
+   void OnMouseEvent(wxMouseEvent& event);
+
+private: 
+   MixerBoard* mMixerBoard;
+   AudacityProject* mProject;
+
+public:
+   DECLARE_EVENT_TABLE()
+};
+
+
+class MixerBoardFrame;
+class TrackList;
+
+class MixerBoard : public wxWindow { 
+   friend class MixerBoardFrame;
+
+public:
+   MixerBoard(AudacityProject* pProject, 
+               wxFrame* parent, 
+               const wxPoint& pos = wxDefaultPosition, 
+               const wxSize& size = wxDefaultSize);
+   virtual ~MixerBoard();
+
+   // Add clusters for any tracks we're not yet showing.
+   // Update pointers for tracks we're aleady showing. 
+   void UpdateTrackClusters(); 
+
+   int GetTrackClustersWidth();
+   void MoveTrackCluster(const WaveTrack* pLeftTrack, bool bUp); // Up in TrackPanel is left in MixerBoard.
+   void RemoveTrackCluster(const WaveTrack* pLeftTrack);
+
+
+   wxBitmap* GetMusicalInstrumentBitmap(const WaveTrack* pLeftTrack);
+
+   bool HasSolo();
+   void IncrementSoloCount(int nIncrement = 1);
+
+   void RefreshTrackClusters();
+   void ResetMeters();
+
+   void UniquelyMuteOrSolo(const WaveTrack* pTargetLeftTrack, bool bSolo);
+
+   void UpdateName(const WaveTrack* pLeftTrack);
+   void UpdateMute(const WaveTrack* pLeftTrack = NULL); // NULL means update for all tracks.
+   void UpdateSolo(const WaveTrack* pLeftTrack = NULL); // NULL means update for all tracks.
+   void UpdatePan(const WaveTrack* pLeftTrack);
+   void UpdateGain(const WaveTrack* pLeftTrack);
+   
+   void UpdateMeters(double t1);
+
+   void UpdateWidth();
+
+private:
+   void CreateMuteSoloImages();
+   int FindMixerTrackCluster(const WaveTrack* pLeftTrack, 
+                              MixerTrackCluster** hMixerTrackCluster) const;
+   void LoadMusicalInstruments();
+
+   // event handlers
+   void OnSize(wxSizeEvent &evt);
+
+
+public:
+   // mute & solo button images: Create once and store on MixerBoard for use in all MixerTrackClusters.
+   wxImage* mImageMuteUp;
+   wxImage* mImageMuteOver;
+   wxImage* mImageMuteDown;
+   wxImage* mImageMuteDownWhileSolo; // the one actually alternate image
+   wxImage* mImageMuteDisabled;
+   wxImage* mImageSoloUp;
+   wxImage* mImageSoloOver;
+   wxImage* mImageSoloDown;
+   wxImage* mImageSoloDisabled;
+
+   int mMuteSoloWidth;
+
+private:
+   // Track clusters are maintained in the same order as the WaveTracks.
+   MixerTrackClusterArray     mMixerTrackClusters; 
+
+   MusicalInstrumentArray     mMusicalInstruments; 
+   AudacityProject*           mProject;
+   MixerBoardScrolledWindow*  mScrolledWindow; // Holds the MixerTrackClusters and handles scrolling.
+   unsigned int               mSoloCount;
+   double                     mPrevT1;
+   TrackList*                 mTracks;
+
+public:
+   DECLARE_EVENT_TABLE()
+};
+
+
+class MixerBoardFrame : public wxFrame { 
+public:
+   MixerBoardFrame(AudacityProject* parent);
+   virtual ~MixerBoardFrame();
+
+private:
+   // event handlers
+   void OnCloseWindow(wxCloseEvent &WXUNUSED(event));
+   void OnMaximize(wxMaximizeEvent &event);
+   void OnSize(wxSizeEvent &evt);
+
+public:
+   MixerBoard* mMixerBoard;
+
+public:
+   DECLARE_EVENT_TABLE()
+};
+
+#endif // __AUDACITY_MIXER_BOARD__
+
+#endif // EXPERIMENTAL_MIXER_BOARD
\ No newline at end of file
diff --git a/src/RealFFTf.cpp b/src/RealFFTf.cpp
new file mode 100644
index 0000000..6aa71bf
--- /dev/null
+++ b/src/RealFFTf.cpp
@@ -0,0 +1,382 @@
+/*
+ *     Program: REALFFTF.C
+ *      Author: Philip Van Baren
+ *        Date: 2 September 1993
+ *
+ * Description: These routines perform an FFT on real data to get a conjugate-symmetric
+ *              output, and an inverse FFT on conjugate-symmetric input to get a real
+ *              output sequence.
+ *
+ *              This code is for floating point data.
+ *
+ *              Modified 8/19/1998 by Philip Van Baren
+ *                 - made the InitializeFFT and EndFFT routines take a structure
+ *                   holding the length and pointers to the BitReversed and SinTable
+ *                   tables.
+ *              Modified 5/23/2009 by Philip Van Baren
+ *                 - Added GetFFT and ReleaseFFT routines to retain common SinTable
+ *                   and BitReversed tables so they don't need to be reallocated
+ *                   and recomputed on every call.
+ *                 - Added Reorder* functions to undo the bit-reversal
+ *
+ *  Copyright (C) 2009  Philip VanBaren
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include "RealFFTf.h"
+
+#ifndef M_PI
+#define	M_PI		3.14159265358979323846  /* pi */
+#endif
+
+/*
+ *  Initialize the Sine table and Twiddle pointers (bit-reversed pointers)
+ *  for the FFT routine.
+ */
+HFFT InitializeFFT(int fftlen)
+{
+   int i;
+   int temp;
+   int mask;
+   HFFT h;
+
+   if((h=(HFFT)malloc(sizeof(FFTParam)))==NULL)
+   {
+	   fprintf(stderr,"Error allocating memory for FFT\n");
+	   exit(8);
+   }
+   /*
+    *  FFT size is only half the number of data points
+    *  The full FFT output can be reconstructed from this FFT's output.
+    *  (This optimization can be made since the data is real.)
+    */
+   h->Points = fftlen/2;
+
+   if((h->SinTable=(fft_type *)malloc(2*h->Points*sizeof(fft_type)))==NULL)
+   {
+      fprintf(stderr,"Error allocating memory for Sine table.\n");
+      exit(8);
+   }
+   if((h->BitReversed=(int *)malloc(h->Points*sizeof(int)))==NULL)
+   {
+      fprintf(stderr,"Error allocating memory for BitReversed.\n");
+      exit(8);
+   }
+
+   for(i=0;i<h->Points;i++)
+   {
+      temp=0;
+      for(mask=h->Points/2;mask>0;mask >>= 1)
+         temp=(temp >> 1) + (i&mask ? h->Points : 0);
+
+      h->BitReversed[i]=temp;
+   }
+
+   for(i=0;i<h->Points;i++)
+   {
+      h->SinTable[h->BitReversed[i]  ]=(fft_type)-sin(2*M_PI*i/(2*h->Points));
+      h->SinTable[h->BitReversed[i]+1]=(fft_type)-cos(2*M_PI*i/(2*h->Points));
+   }
+   return h;
+}
+
+/*
+ *  Free up the memory allotted for Sin table and Twiddle Pointers
+ */
+void EndFFT(HFFT h)
+{
+	if(h->Points>0) {
+		free(h->BitReversed);
+		free(h->SinTable);
+	}
+	h->Points=0;
+	free(h);
+}
+
+#define MAX_HFFT 10
+static HFFT hFFTArray[MAX_HFFT] = { NULL };
+static int nFFTLockCount[MAX_HFFT] = { 0 };
+
+/* Get a handle to the FFT tables of the desired length */
+/* This version keeps common tables rather than allocating a new table every time */
+HFFT GetFFT(int fftlen)
+{
+   int h,n = fftlen/2;
+   for(h=0; (h<MAX_HFFT) && (hFFTArray[h] != NULL) && (n != hFFTArray[h]->Points); h++);
+   if(h<MAX_HFFT) {
+      if(hFFTArray[h] == NULL) {
+         hFFTArray[h] = InitializeFFT(fftlen);
+         nFFTLockCount[h] = 0;
+      }
+      nFFTLockCount[h]++;
+      return hFFTArray[h];
+   } else {
+      // All buffers used, so fall back to allocating a new set of tables
+      return InitializeFFT(fftlen);;
+   }
+}
+
+/* Release a previously requested handle to the FFT tables */
+void ReleaseFFT(HFFT hFFT)
+{
+   int h;
+   for(h=0; (h<MAX_HFFT) && (hFFTArray[h] != hFFT); h++);
+   if(h<MAX_HFFT) {
+      nFFTLockCount[h]--;
+   } else {
+      EndFFT(hFFT);
+   }
+}
+
+/* Deallocate any unused FFT tables */
+void CleanupFFT()
+{
+   int h;
+   for(h=0; (h<MAX_HFFT); h++) {
+      if((nFFTLockCount[h] <= 0) && (hFFTArray[h] != NULL)) {
+         EndFFT(hFFTArray[h]);
+         hFFTArray[h] = NULL;
+      }
+   }
+}
+
+/*
+ *  Forward FFT routine.  Must call InitializeFFT(fftlen) first!
+ *
+ *  Note: Output is BIT-REVERSED! so you must use the BitReversed to
+ *        get legible output, (i.e. Real_i = buffer[ h->BitReversed[i] ]
+ *                                  Imag_i = buffer[ h->BitReversed[i]+1 ] )
+ *        Input is in normal order.
+ *
+ * Output buffer[0] is the DC bin, and output buffer[1] is the Fs/2 bin
+ * - this can be done because both values will always be real only
+ * - this allows us to not have to allocate an extra complex value for the Fs/2 bin
+ *
+ *  Note: The scaling on this is done according to the standard FFT definition,
+ *        so a unit amplitude DC signal will output an amplitude of (N)
+ *        (Older revisions would progressively scale the input, so the output
+ *        values would be similar in amplitude to the input values, which is
+ *        good when using fixed point arithmetic)
+ */
+void RealFFTf(fft_type *buffer,HFFT h)
+{
+   fft_type *A,*B;
+   fft_type *sptr;
+   fft_type *endptr1,*endptr2;
+   int *br1,*br2;
+   fft_type HRplus,HRminus,HIplus,HIminus;
+   fft_type v1,v2,sin,cos;
+
+   int ButterfliesPerGroup=h->Points/2;
+
+   /*
+    *  Butterfly:
+    *     Ain-----Aout
+    *         \ /
+    *         / \
+    *     Bin-----Bout
+    */
+
+   endptr1=buffer+h->Points*2;
+
+   while(ButterfliesPerGroup>0)
+   {
+      A=buffer;
+      B=buffer+ButterfliesPerGroup*2;
+      sptr=h->SinTable;
+
+      while(A<endptr1)
+      {
+         sin=*sptr;
+         cos=*(sptr+1);
+         endptr2=B;
+         while(A<endptr2)
+         {
+            v1=*B*cos + *(B+1)*sin;
+            v2=*B*sin - *(B+1)*cos;
+			*B=(*A+v1);
+			*(A++)=*(B++)-2*v1;
+			*B=(*A-v2);
+			*(A++)=*(B++)+2*v2;
+		 }
+		 A=B;
+		 B+=ButterfliesPerGroup*2;
+         sptr+=2;
+      }
+      ButterfliesPerGroup >>= 1;
+   }
+   /* Massage output to get the output for a real input sequence. */
+   br1=h->BitReversed+1;
+   br2=h->BitReversed+h->Points-1;
+
+   while(br1<br2)
+   {
+      sin=h->SinTable[*br1];
+		cos=h->SinTable[*br1+1];
+      A=buffer+*br1;
+      B=buffer+*br2;
+      HRplus = (HRminus = *A     - *B    ) + (*B     * 2);
+      HIplus = (HIminus = *(A+1) - *(B+1)) + (*(B+1) * 2);
+      v1 = (sin*HRminus - cos*HIplus);
+      v2 = (cos*HRminus + sin*HIplus);
+      *A = (HRplus  + v1) * (fft_type)0.5;
+      *B = *A - v1;
+      *(A+1) = (HIminus + v2) * (fft_type)0.5;
+      *(B+1) = *(A+1) - HIminus;
+
+      br1++;
+      br2--;
+   }
+   /* Handle the center bin (just need a conjugate) */
+   A=buffer+*br1+1;
+   *A=-*A;
+   /* Handle DC bin separately - and ignore the Fs/2 bin
+   buffer[0]+=buffer[1];
+   buffer[1]=(fft_type)0;*/
+   /* Handle DC and Fs/2 bins separately */
+   /* Put the Fs/2 value into the imaginary part of the DC bin */
+   v1=buffer[0]-buffer[1];
+   buffer[0]+=buffer[1];
+   buffer[1]=v1;
+}
+
+
+/* Description: This routine performs an inverse FFT to real data.
+ *              This code is for floating point data.
+ *
+ *  Note: Output is BIT-REVERSED! so you must use the BitReversed to
+ *        get legible output, (i.e. wave[2*i]   = buffer[ BitReversed[i] ]
+ *                                  wave[2*i+1] = buffer[ BitReversed[i]+1 ] )
+ *        Input is in normal order, interleaved (real,imaginary) complex data
+ *        You must call InitializeFFT(fftlen) first to initialize some buffers!
+ *
+ * Input buffer[0] is the DC bin, and input buffer[1] is the Fs/2 bin
+ * - this can be done because both values will always be real only
+ * - this allows us to not have to allocate an extra complex value for the Fs/2 bin
+ *
+ *  Note: The scaling on this is done according to the standard FFT definition,
+ *        so a unit amplitude DC signal will output an amplitude of (N)
+ *        (Older revisions would progressively scale the input, so the output
+ *        values would be similar in amplitude to the input values, which is
+ *        good when using fixed point arithmetic)
+ */
+void InverseRealFFTf(fft_type *buffer,HFFT h)
+{
+   fft_type *A,*B;
+   fft_type *sptr;
+   fft_type *endptr1,*endptr2;
+   int *br1;
+   fft_type HRplus,HRminus,HIplus,HIminus;
+   fft_type v1,v2,sin,cos;
+
+   int ButterfliesPerGroup=h->Points/2;
+
+   /* Massage input to get the input for a real output sequence. */
+   A=buffer+2;
+   B=buffer+h->Points*2-2;
+   br1=h->BitReversed+1;
+   while(A<B)
+   {
+      sin=h->SinTable[*br1];
+      cos=h->SinTable[*br1+1];
+      HRplus = (HRminus = *A     - *B    ) + (*B     * 2);
+      HIplus = (HIminus = *(A+1) - *(B+1)) + (*(B+1) * 2);
+      v1 = (sin*HRminus + cos*HIplus);
+      v2 = (cos*HRminus - sin*HIplus);
+      *A = (HRplus  + v1) * (fft_type)0.5;
+      *B = *A - v1;
+      *(A+1) = (HIminus - v2) * (fft_type)0.5;
+      *(B+1) = *(A+1) - HIminus;
+
+      A+=2;
+      B-=2;
+      br1++;
+   }
+   /* Handle center bin (just need conjugate) */
+   *(A+1)=-*(A+1);
+   /* Handle DC bin separately - this ignores any Fs/2 component
+   buffer[1]=buffer[0]=buffer[0]/2;*/
+   /* Handle DC and Fs/2 bins specially */
+   /* The DC bin is passed in as the real part of the DC complex value */
+   /* The Fs/2 bin is passed in as the imaginary part of the DC complex value */
+   /* (v1+v2) = buffer[0] == the DC component */
+   /* (v1-v2) = buffer[1] == the Fs/2 component */
+   v1=0.5f*(buffer[0]+buffer[1]);
+   v2=0.5f*(buffer[0]-buffer[1]);
+   buffer[0]=v1;
+   buffer[1]=v2;
+
+   /*
+    *  Butterfly:
+    *     Ain-----Aout
+    *         \ /
+    *         / \
+    *     Bin-----Bout
+    */
+
+   endptr1=buffer+h->Points*2;
+
+   while(ButterfliesPerGroup>0)
+   {
+      A=buffer;
+      B=buffer+ButterfliesPerGroup*2;
+      sptr=h->SinTable;
+
+      while(A<endptr1)
+      {
+         sin=*(sptr++);
+         cos=*(sptr++);
+         endptr2=B;
+         while(A<endptr2)
+         {
+            v1=*B*cos - *(B+1)*sin;
+			v2=*B*sin + *(B+1)*cos;
+			*B=(*A+v1)*(fft_type)0.5;
+			*(A++)=*(B++)-v1;
+			*B=(*A+v2)*(fft_type)0.5;
+			*(A++)=*(B++)-v2;
+         }
+	     A=B;
+         B+=ButterfliesPerGroup*2;
+      }
+      ButterfliesPerGroup >>= 1;
+   }
+}
+
+void ReorderToFreq(HFFT hFFT, fft_type *buffer, fft_type *RealOut, fft_type *ImagOut)
+{
+   // Copy the data into the real and imaginary outputs
+	for(int i=1;i<hFFT->Points;i++) {
+		RealOut[i]=buffer[hFFT->BitReversed[i]  ];
+		ImagOut[i]=buffer[hFFT->BitReversed[i]+1];
+   }
+   RealOut[0] = buffer[0]; // DC component
+   ImagOut[0] = 0;
+   RealOut[hFFT->Points] = buffer[1]; // Fs/2 component
+   ImagOut[hFFT->Points] = 0;
+}
+
+void ReorderToTime(HFFT hFFT, fft_type *buffer, fft_type *TimeOut)
+{
+   // Copy the data into the real outputs
+	for(int i=0;i<hFFT->Points;i++) {
+	   TimeOut[i*2  ]=buffer[hFFT->BitReversed[i]  ];
+	   TimeOut[i*2+1]=buffer[hFFT->BitReversed[i]+1];
+   }
+}
\ No newline at end of file
diff --git a/src/RealFFTf.h b/src/RealFFTf.h
new file mode 100644
index 0000000..764319b
--- /dev/null
+++ b/src/RealFFTf.h
@@ -0,0 +1,23 @@
+#ifndef __realfftf_h
+#define __realfftf_h
+
+#define fft_type float
+typedef struct FFTParamType {
+	int *BitReversed;
+	fft_type *SinTable;
+	int Points;
+} FFTParam;
+#define HFFT FFTParam *
+
+HFFT InitializeFFT(int);
+void EndFFT(HFFT);
+HFFT GetFFT(int);
+void ReleaseFFT(HFFT);
+void CleanupFFT();
+void RealFFTf(fft_type *,HFFT);
+void InverseRealFFTf(fft_type *,HFFT);
+void ReorderToTime(HFFT hFFT, fft_type *buffer, fft_type *TimeOut);
+void ReorderToFreq(HFFT hFFT, fft_type *buffer, fft_type *RealOut, fft_type *ImagOut);
+
+#endif
+
diff --git a/src/commands/AppCommandEvent.cpp b/src/commands/AppCommandEvent.cpp
new file mode 100644
index 0000000..94e19a7
--- /dev/null
+++ b/src/commands/AppCommandEvent.cpp
@@ -0,0 +1,75 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file AppCommandEvent.cpp
+\brief Implements AppCommandEvent.
+
+*//****************************************************************//**
+
+\class AppCommandEvent
+\brief An event 'envelope' for sending Command objects through the wxwidgets
+event loop.
+
+   This allows commands to be communicated from the script thread to the main
+   thread.
+
+*//*******************************************************************/
+
+#include "AppCommandEvent.h"
+
+DEFINE_EVENT_TYPE(wxEVT_APP_COMMAND_RECEIVED)
+IMPLEMENT_DYNAMIC_CLASS(AppCommandEvent, wxEvent)
+
+AppCommandEvent::AppCommandEvent(wxEventType commandType, int id)
+: wxCommandEvent(commandType, id), mCommand(NULL)
+{ }
+
+// Copy constructor
+AppCommandEvent::AppCommandEvent(const AppCommandEvent &event) : wxCommandEvent(event)
+{
+   this->mCommand = event.mCommand;
+}
+
+AppCommandEvent::~AppCommandEvent()
+{
+}
+
+// Clone is required by wxwidgets; implemented via copy constructor
+wxEvent *AppCommandEvent::Clone() const
+{
+   return new AppCommandEvent(*this);
+}
+
+/// Store a pointer to a command object
+void AppCommandEvent::SetCommand(Command *cmd)
+{
+   wxASSERT(NULL == mCommand);
+   mCommand = cmd;
+}
+
+// When the command pointer is retrieved, the caller is responsible for
+// deletion.
+Command *AppCommandEvent::GetCommand()
+{
+   Command *tmp = mCommand;
+   mCommand     = NULL;
+   return tmp;
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/AppCommandEvent.h b/src/commands/AppCommandEvent.h
new file mode 100644
index 0000000..0b6ce67
--- /dev/null
+++ b/src/commands/AppCommandEvent.h
@@ -0,0 +1,63 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file AppCommandEvent.h
+\brief Headers and event table macros for AppCommandEvent
+
+*//*******************************************************************/
+
+#ifndef __APPCOMMANDEVENT__
+#define __APPCOMMANDEVENT__
+
+#include <wx/event.h>
+#include "../Audacity.h"
+
+DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, wxEVT_APP_COMMAND_RECEIVED, -1);
+
+class Command;
+
+class AppCommandEvent : public wxCommandEvent
+{
+private:
+   Command *mCommand;
+
+public:
+   AppCommandEvent(wxEventType commandType = wxEVT_APP_COMMAND_RECEIVED, int id = 0);
+
+   AppCommandEvent(const AppCommandEvent &event);
+   ~AppCommandEvent();
+
+   virtual wxEvent *Clone() const;
+   void SetCommand(Command *cmd);
+   Command *GetCommand();
+
+private:
+   DECLARE_DYNAMIC_CLASS(AppCommandEvent)
+};
+
+typedef void (wxEvtHandler::*wxAppCommandEventFunction)(AppCommandEvent&);
+
+#define wxAppCommandEventHandler(func) \
+    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAppCommandEventFunction, &func)
+
+#define EVT_APP_COMMAND(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_APP_COMMAND_RECEIVED, winid, wxID_ANY, wxAppCommandEventHandler(fn), (wxObject *) NULL ),
+
+#endif /* End of include guard: __APPCOMMANDEVENT__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/BatchEvalCommand.h b/src/commands/BatchEvalCommand.h
new file mode 100644
index 0000000..eae8537
--- /dev/null
+++ b/src/commands/BatchEvalCommand.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+
+   Audacity: A Digital Audio Editor
+   Audacity(R) is copyright (c) 1999-2009 Audacity Team.
+   File License: wxwidgets
+
+   BatchEvalCommand.h
+   Dan Horgan
+
+******************************************************************//**
+
+\class BatchEvalCommand
+\brief Given a string representing a command, pass it to the BatchCommands
+system.
+
+The eventual aim is to move the code from BatchCommands out into separate
+command classes, but until this happens, BatchEvalCommand can act as a 'bridge'
+to that system.
+
+*//*******************************************************************/
+
+#ifndef __BATCHEVALCOMMAND__
+#define __BATCHEVALCOMMAND__
+
+#include "Command.h"
+#include "../BatchCommands.h"
+
+
+class BatchEvalCommand : public Command
+{
+public:
+   BatchEvalCommand()
+      : Command(wxT("BatchEvalCommand"))
+   { }
+   ~BatchEvalCommand() { }
+
+   virtual bool Apply(CommandExecutionContext context)
+   {
+      wxString cmdName = GetString(wxT("CommandName"));
+      wxString cmdParams = GetString(wxT("ParamString"));
+
+      // Create a Batch that will have just one command in it...
+      BatchCommands Batch;
+
+      return Batch.ApplyCommand(cmdName, cmdParams);
+   }
+
+   static ParamMap GetSignature()
+   {
+      ParamMap signature;
+      Validator paramValidator;
+      signature[wxT("ParamString")] =
+         std::pair<wxVariant, Validator>(wxT(""), paramValidator);
+      return signature;
+   }
+};
+
+#endif /* End of include guard: __BATCHEVALCOMMAND__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/Command.h b/src/commands/Command.h
new file mode 100644
index 0000000..0337761
--- /dev/null
+++ b/src/commands/Command.h
@@ -0,0 +1,282 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file Command.h
+\brief Contains declaration of Command base class.
+
+*//*******************************************************************/
+
+#ifndef __COMMAND__
+#define __COMMAND__
+
+#include <map>
+#include <utility>
+#include <wx/string.h>
+#include <wx/msgout.h>
+#include <wx/variant.h>
+#include <wx/arrstr.h>
+
+#include "CommandMisc.h"
+#include "CommandBuilder.h"
+#include "CommandTargets.h"
+
+class AudacityApp;
+class AudacityProject;
+class wxVariant;
+
+class CommandExecutionContext
+{
+   public:
+      AudacityApp *app;
+      AudacityProject *proj;
+      CommandExecutionContext(AudacityApp *app, AudacityProject *proj)
+         : app(app), proj(proj) {}
+};
+
+/// A Validator is an object which checks whether a wxVariant satisfies
+//  a certain criterion. This is a base validator which allows anything.
+class Validator
+{
+public:
+   Validator() {};
+   virtual ~Validator() {};
+
+   virtual bool Validate(const wxVariant &v) const
+   {
+      return true;
+   }
+
+   // For error messages
+   virtual wxString GetDescription() const
+   {
+      return wxT("any value");
+   }
+};
+
+/// Must be one of the defined options
+class OptionValidator : public Validator
+{
+private:
+   wxArrayString mOptions;
+
+public:
+   void AddOption(const wxString &option)
+   {
+      mOptions.Add(option);
+   }
+   virtual bool Validate(const wxVariant &v) const
+   {
+      return (mOptions.Index(v.GetString()) != wxNOT_FOUND);
+   }
+   virtual wxString GetDescription()
+   {
+      wxString desc = wxT("one of: ");
+      int optionCount = mOptions.GetCount();
+      int i = 0;
+      for (i = 0; i+1 < optionCount; ++i)
+      {
+         desc += mOptions[i] + wxT(", ");
+      }
+      desc += mOptions[optionCount-1];
+      return desc;
+   }
+};
+
+/// Must be a boolean
+class BoolValidator : public Validator
+{
+public:
+   virtual bool Validate(const wxVariant &v) const
+   {
+      return v.IsType(wxT("bool"));
+   }
+   virtual wxString GetDescription() const
+   {
+      return wxT("y/n");
+   }
+};
+
+/// Must be a floating-point number
+class DoubleValidator : public Validator
+{
+public:
+   virtual bool Validate(const wxVariant &v) const
+   {
+      return v.IsType(wxT("double"));
+   }
+   virtual wxString GetDescription() const
+   {
+      return wxT("a floating-point number");
+   }
+};
+
+/// Must lie between the two given numbers
+class RangeValidator : public Validator
+{
+private:
+   double lower, upper;
+public:
+
+   virtual bool Validate(const wxVariant &v) const
+   {
+      double d = v.GetDouble();
+      return ((lower < d) && (d < upper));
+   }
+   virtual wxString GetDescription() const
+   {
+      return wxString::Format(wxT("between %d and %d"), lower, upper);
+   }
+};
+
+/// Must be integral
+class IntValidator : public Validator
+{
+public:
+   virtual bool Validate(const wxVariant &v) const
+   {
+      if (!v.IsType(wxT("double"))) return false;
+      double d = v.GetDouble();
+      return ((long)d == d);
+   }
+   virtual wxString GetDescription() const
+   {
+      return wxT("an integer");
+   }
+};
+
+/// Must pass both of the supplied validators
+class AndValidator : public Validator
+{
+   private:
+      const Validator &v1, &v2;
+   public:
+      AndValidator(const Validator &u1, const Validator &u2)
+         : v1(u1), v2(u2)
+      { }
+      virtual bool Validate(const wxVariant &v) const
+      {
+         if (!v1.Validate(v)) return false;
+         return v2.Validate(v);
+      }
+      virtual wxString GetDescription() const
+      {
+         return v1.GetDescription() + wxT(" and ") + v2.GetDescription();
+      }
+};
+
+class Command
+{
+private:
+   wxString mName;
+   ParamMap mParams;
+
+   bool Valid(wxString paramName, const wxVariant &paramValue)
+   {
+      return mParams[paramName].second.Validate(paramValue);
+   }
+
+protected:
+   CommandOutputTarget *mOutput;
+
+   // Convenience methods for allowing subclasses to access parameters
+   bool GetBool(const wxString &paramName)
+   {
+      const wxVariant &v = mParams[paramName].first;
+      wxASSERT(v.IsType(wxT("bool")));
+      return v.GetBool();
+   }
+   long GetLong(const wxString &paramName)
+   {
+      const wxVariant &v = mParams[paramName].first;
+      wxASSERT(v.IsType(wxT("double")));
+      return (long)v.GetDouble();
+   }
+   double GetDouble(const wxString &paramName)
+   {
+      const wxVariant &v = mParams[paramName].first;
+      wxASSERT(v.IsType(wxT("double")));
+      return v.GetDouble();
+   }
+   wxString GetString(const wxString &paramName)
+   {
+      const wxVariant &v = mParams[paramName].first;
+      wxASSERT(v.IsType(wxT("string")));
+      return v.GetString();
+   }
+
+   void Progress(double completed)
+   {
+      if (mOutput)
+         mOutput->Progress(completed);
+   }
+   void Status(wxString status)
+   {
+      if (mOutput)
+         mOutput->Status(status);
+   }
+   void Error(wxString message)
+   {
+      if (mOutput)
+         mOutput->Error(message);
+   }
+
+public:
+   Command(const wxString &name, CommandOutputTarget *output = new CommandOutputTarget())
+      : mName(name),
+        mParams(CommandBuilder::GetSignature(name)),
+        mOutput(output)
+   { }
+
+   virtual ~Command()
+   {
+      if (mOutput)
+         delete mOutput;
+   }
+
+   // Note: wxVariant is reference counted
+   bool SetParameter(const wxString &paramName, wxVariant paramValue)
+   {
+      wxASSERT(!paramValue.IsType(wxT("null")));
+
+      if (!Valid(paramName, paramValue))
+      {
+         Error(wxT("Invalid value for parameter '")
+               + paramName + wxT("': should be ")
+               + mParams[paramName].second.GetDescription());
+         return false;
+      }
+      mParams[paramName].first = paramValue;
+      return true;
+   }
+
+   // Subclasses should override the following:
+
+   virtual bool Apply(CommandExecutionContext context)
+   {
+      return true;
+   }
+
+   static ParamMap GetSignature()
+   {
+      return ParamMap();
+   }
+};
+#endif /* End of include guard: __COMMAND__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/CommandBuilder.cpp b/src/commands/CommandBuilder.cpp
new file mode 100644
index 0000000..72c5929
--- /dev/null
+++ b/src/commands/CommandBuilder.cpp
@@ -0,0 +1,155 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file CommandBuilder.cpp
+\brief Contains definitions for CommandBuilder class.
+
+*//****************************************************************//**
+
+\class CommandBuilder
+\brief A type of factory for Commands of various sorts.
+
+CommandBuilder has the task of deciding what command is meant by a given
+command string, and producing a suitable command object. For now, it doesn't
+actually do any processing - it just passes everything on to the BatchCommand
+system by constructing BatchCommandEval objects.
+
+*//*******************************************************************/
+
+#include "CommandBuilder.h"
+#include <wx/log.h>
+#include <wx/wx.h>
+#include "DebugPrintCommand.h"
+#include "BatchEvalCommand.h"
+#include "ScreenshotCommand.h"
+#include "../Shuttle.h"
+
+CommandBuilder::CommandBuilder(const wxString &cmdString)
+: mValid(false), mCommand(NULL)
+{
+   BuildCommand(cmdString);
+}
+
+CommandBuilder::CommandBuilder(const wxString &cmdName, const wxString &params)
+: mValid(false), mCommand(NULL)
+{
+   BuildCommand(cmdName, params);
+}
+
+CommandBuilder::~CommandBuilder() { }
+
+bool CommandBuilder::WasValid() { return mValid; }
+
+const wxString &CommandBuilder::GetErrorMessage() { return mError; }
+
+Command *CommandBuilder::GetCommand()
+{
+   wxASSERT(mValid);
+   wxASSERT(NULL != mCommand);
+   return mCommand;
+}
+
+// Short-term solution!
+bool CommandBuilder::LookUpCommand(wxString name, std::pair<Command*,ParamMap> &result)
+{
+   if (name.IsSameAs(wxT("screenshot")))
+   {
+      CommandOutputTarget *output
+         = new CommandOutputTarget(new NullProgressTarget(),
+                                   new MessageBoxTarget(),
+                                   new MessageBoxTarget());
+      result = std::pair<Command*,ParamMap>(new ScreenshotCommand(output),
+                                            ScreenshotCommand::GetSignature());
+      return true;
+   } // Other cases...
+   return false;
+}
+
+// Short-term solution!
+ParamMap CommandBuilder::GetSignature(wxString name)
+{
+   if(name.IsSameAs(wxT("screenshot")))
+   {
+      return ScreenshotCommand::GetSignature();
+   }
+   return Command::GetSignature();
+}
+
+void CommandBuilder::BuildCommand(const wxString &cmdName, const wxString &cmdParams)
+{
+   // Stage 1: work out what command to create
+
+   ParamMap signature;
+
+   std::pair<Command*,ParamMap> commandEntry;
+   if (LookUpCommand(cmdName, commandEntry))
+   {
+      mCommand = commandEntry.first;
+      signature = commandEntry.second;
+   }
+   else
+   {
+      // Fall back to hoping the Batch Command system can handle it
+      mCommand = new BatchEvalCommand();
+      mCommand->SetParameter(wxT("CommandName"), cmdName);
+      mCommand->SetParameter(wxT("ParamString"), cmdParams);
+      mValid = true;
+      return;
+   }
+
+   // Stage 2: set the parameters
+
+   ShuttleCli shuttle;
+   shuttle.mParams = cmdParams;
+   shuttle.mbStoreInClient = true;
+
+   ParamMap::const_iterator iter;
+   for (iter = signature.begin(); iter != signature.end(); ++iter)
+   {
+      wxString paramString;
+      if (shuttle.TransferString(iter->first, paramString, wxT(""))
+         && (!mCommand->SetParameter(iter->first, paramString)))
+      {
+         mError = wxT("Invalid value for parameter '") + iter->first;
+         mValid = false;
+         return;
+      }
+   }
+   // TODO check for unrecognised parameters
+
+   mValid = true;
+}
+
+void CommandBuilder::BuildCommand(const wxString &cmdString)
+{
+   // Find the command name terminator...  If there is more than one word and
+   // no terminator, the command is badly formed
+   int splitAt = cmdString.Find(wxT(':'));
+   if (splitAt < 0 && cmdString.Strip(wxString::both).Find(wxT(' ')) >= 0) {
+      mError = wxT("BAD - Missing ':'?");
+      mValid = false;
+      return;
+   }
+
+   wxString cmdName = cmdString.Left(splitAt).Strip(wxString::both);
+   wxString cmdParams = cmdString.Mid(splitAt+1).Strip(wxString::both);
+   BuildCommand(cmdName, cmdParams);
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/CommandBuilder.h b/src/commands/CommandBuilder.h
new file mode 100644
index 0000000..d786c97
--- /dev/null
+++ b/src/commands/CommandBuilder.h
@@ -0,0 +1,62 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file CommandBuilder.h
+\brief Contains declaration of CommandBuilder class.
+
+*//*******************************************************************/
+
+#ifndef __COMMANDBUILDER__
+#define __COMMANDBUILDER__
+
+#include <wx/string.h>
+#include <wx/variant.h>
+#include <utility>
+#include <map>
+#include "CommandMisc.h"
+
+class Command;
+class Validator;
+
+// CommandBuilder has the task of validating and interpreting a command string.
+// If the string represents a valid command, it builds the command object.
+
+class CommandBuilder
+{
+   private:
+      bool mValid;
+      Command *mCommand;
+      wxString mError;
+
+      void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
+      void BuildCommand(const wxString &cmdString);
+   public:
+      CommandBuilder(const wxString &cmdString);
+      CommandBuilder(const wxString &cmdName, const wxString &cmdParams);
+      ~CommandBuilder();
+      bool WasValid();
+      Command *GetCommand();
+      const wxString &GetErrorMessage();
+
+      static bool LookUpCommand(wxString name, std::pair<Command*,ParamMap> &result);
+      static ParamMap GetSignature(wxString name);
+};
+#endif /* End of include guard: __COMMANDBUILDER__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/CommandHandler.cpp b/src/commands/CommandHandler.cpp
new file mode 100644
index 0000000..81ee0d1
--- /dev/null
+++ b/src/commands/CommandHandler.cpp
@@ -0,0 +1,77 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file CommandHandler.cpp
+\brief Contains definitions for the CommandHandler class.
+
+*//****************************************************************//**
+
+\class CommandHandler
+\brief Contains methods for applying commands that are passed to it.
+
+May possibly inherit from wxEvtHandler in the future...
+
+*//*******************************************************************/
+
+#include <wx/event.h>
+#include "CommandHandler.h"
+#include "../Project.h"
+#include "Command.h"
+#include "AppCommandEvent.h"
+#include "ScriptCommandRelay.h"
+
+CommandHandler::CommandHandler(AudacityApp &app)
+ : mCurrentContext(new CommandExecutionContext(&app, GetActiveProject()))
+{
+}
+
+CommandHandler::~CommandHandler()
+{
+   delete mCurrentContext;
+}
+
+void CommandHandler::SetProject(AudacityProject *proj)
+{
+   mCurrentContext->proj = proj;
+}
+
+void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
+{
+   // First retrieve the actual command from the event 'envelope'.
+   Command *cmd = event.GetCommand();
+
+   // Then apply it to current application & project.  Note that the
+   // command may change the context - for example, switching to a
+   // different project.
+   bool rc = cmd->Apply(*mCurrentContext);
+
+   // Rudimentary error handling
+   wxString msgOut;
+   if (rc)
+      msgOut = wxT("OK");
+   else
+      msgOut = wxT("Command FAILED!");
+
+   ScriptCommandRelay::SendResponse(msgOut);
+
+   // Done with the command so delete it.
+   delete cmd;
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/CommandHandler.h b/src/commands/CommandHandler.h
new file mode 100644
index 0000000..4a3d3da
--- /dev/null
+++ b/src/commands/CommandHandler.h
@@ -0,0 +1,53 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file CommandHandler.h
+\brief Contains declarations for the CommandHandler class.
+
+*//******************************************************************/
+
+
+#ifndef __COMMANDHANDLER__
+#define __COMMANDHANDLER__
+
+#include "../AudacityApp.h"
+class AudacityProject;
+class AppCommandEvent;
+class CommandExecutionContext;
+
+class CommandHandler
+{
+   private:
+      CommandExecutionContext *mCurrentContext;
+
+   public:
+      CommandHandler(AudacityApp &app);
+      ~CommandHandler();
+
+      // This should only be used during initialization
+      void SetProject(AudacityProject *proj);
+
+      // Whenever a command is recieved, process it.
+      void OnReceiveCommand(AppCommandEvent &event);
+
+};
+
+#endif /* End of include guard: __COMMANDHANDLER__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/CommandMisc.h b/src/commands/CommandMisc.h
new file mode 100644
index 0000000..52a90d2
--- /dev/null
+++ b/src/commands/CommandMisc.h
@@ -0,0 +1,14 @@
+#ifndef __COMMANDMISC__
+#define __COMMANDMISC__
+
+#include <map>
+#include <utility>
+
+class wxString;
+class wxVariant;
+class Validator;
+
+// Map from parameter name to the value of the parameter, with a suitable Validator
+typedef std::map<wxString, std::pair<wxVariant, Validator> > ParamMap;
+
+#endif /* End of include guard: __COMMANDMISC__ */
diff --git a/src/commands/CommandTargets.h b/src/commands/CommandTargets.h
new file mode 100644
index 0000000..b545658
--- /dev/null
+++ b/src/commands/CommandTargets.h
@@ -0,0 +1,176 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   License: GPL v2 - see LICENSE.txt
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file CommandTargets
+\brief Contains classes for 'command output targets' - objects which can
+receive output from a command. For instance, a progress target might pass the
+information to a GUI ProgressDialog. Using abstract targets means the command
+objects needn't be concerned with what happens to the information.
+
+*//*******************************************************************/
+
+#ifndef __COMMANDTARGETS__
+#define __COMMANDTARGETS__
+
+#include <wx/string.h>
+#include <wx/msgdlg.h>
+#include <wx/statusbr.h>
+#include "../widgets/ProgressDialog.h"
+
+/// Interface for objects that can receive command progress information
+class CommandProgressTarget
+{
+public:
+   virtual ~CommandProgressTarget() {}
+   virtual void Update(double completed) = 0;
+};
+
+/// Used to ignore a command's progress updates
+class NullProgressTarget : public CommandProgressTarget
+{
+public:
+   virtual ~NullProgressTarget() {}
+   virtual void Update(double completed) {}
+};
+
+/// Sends command progress information to a ProgressDialog
+class GUIProgressTarget : public CommandProgressTarget
+{
+private:
+   ProgressDialog &mProgress;
+public:
+   GUIProgressTarget(ProgressDialog &pd)
+      : mProgress(pd)
+   {}
+   virtual void Update(double completed)
+   {
+      mProgress.Update(completed);
+   }
+};
+
+/// Interface for objects that can receive (string) messages from a command
+class CommandMessageTarget
+{
+public:
+   virtual ~CommandMessageTarget() {}
+   virtual void Update(wxString message) = 0;
+};
+
+/// Used to ignore a command's message updates
+class NullMessageTarget : public CommandMessageTarget
+{
+public:
+   virtual ~NullMessageTarget() {}
+   virtual void Update(wxString message) {}
+};
+
+/// Displays messages from a command in a wxMessageBox
+class MessageBoxTarget : public CommandMessageTarget
+{
+public:
+   virtual ~MessageBoxTarget() {}
+   virtual void Update(wxString message)
+   {
+      wxMessageBox(message);
+   }
+};
+
+/// Displays messages from a command in a wxStatusBar
+class StatusBarTarget : public CommandMessageTarget
+{
+private:
+   wxStatusBar &mStatus;
+public:
+   StatusBarTarget(wxStatusBar &sb)
+      : mStatus(sb)
+   {}
+   virtual void Update(wxString message)
+   {
+      mStatus.SetStatusText(message);
+   }
+};
+
+// By default, we ignore progress updates but display all other messages directly
+class TargetFactory
+{
+public:
+   static CommandProgressTarget *ProgressDefault()
+   {
+      return CreateProgressTarget<NullProgressTarget>();
+   }
+
+   static CommandMessageTarget *MessageDefault()
+   {
+      return CreateMessageTarget<MessageBoxTarget>();
+   }
+
+   template<typename T>
+   static CommandProgressTarget *CreateProgressTarget()
+   {
+      return (new T);
+   }
+
+   template<typename T>
+   static CommandMessageTarget *CreateMessageTarget()
+   {
+      return (new T);
+   }
+
+};
+
+/// Used to aggregate the various output targets a command may have
+// Assumes responsibility for pointers passed into it
+class CommandOutputTarget
+{
+private:
+   CommandProgressTarget *mProgressTarget;
+   CommandMessageTarget *mStatusTarget;
+   CommandMessageTarget *mErrorTarget;
+public:
+   CommandOutputTarget(CommandProgressTarget *pt = TargetFactory::ProgressDefault(),
+                       CommandMessageTarget  *st = TargetFactory::MessageDefault(),
+                       CommandMessageTarget  *et = TargetFactory::MessageDefault())
+      : mProgressTarget(pt), mStatusTarget(st), mErrorTarget(et)
+   { }
+   ~CommandOutputTarget()
+   {
+      delete mProgressTarget;
+      delete mStatusTarget;
+      delete mErrorTarget;
+   }
+   void Progress(double completed)
+   {
+      if (mProgressTarget)
+         mProgressTarget->Update(completed);
+   }
+   void Status(wxString status)
+   {
+      if (mStatusTarget)
+         mStatusTarget->Update(status);
+   }
+   void Error(wxString message)
+   {
+      if (mErrorTarget)
+         mErrorTarget->Update(message);
+   }
+};
+
+#endif /* End of include guard: __COMMANDTARGETS__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/DebugPrintCommand.h b/src/commands/DebugPrintCommand.h
new file mode 100644
index 0000000..07d56bc
--- /dev/null
+++ b/src/commands/DebugPrintCommand.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file DebugPrintCommand.h
+\brief Contains definition of DebugPrintCommand class.
+
+*//***************************************************************//***
+
+\class DebugPrintCommand
+\brief Command to tell Audacity to print out a message.
+
+   Intended for testing and debugging.
+
+*//*******************************************************************/
+
+#ifndef __DEBUGPRINTCOMMAND__
+#define __DEBUGPRINTCOMMAND__
+
+#include <wx/msgout.h>
+#include "Command.h"
+
+
+class DebugPrintCommand : public Command
+{
+private:
+   wxString mMessage;
+
+public:
+   DebugPrintCommand(const wxString &message)
+      : Command(wxT("DebugPrintCommand")),
+      mMessage(message) { }
+   ~DebugPrintCommand() {}
+
+   virtual bool Apply(CommandExecutionContext context)
+   {
+      wxMessageOutputDebug().Printf(wxT("In DebugPrintCommand::Apply"));
+      wxMessageOutputDebug().Printf(mMessage);
+      return true;
+   }
+
+   static ParamMap GetSignature()
+   {
+      ParamMap signature;
+      Validator stringValidator;
+      signature[wxT("DebugString")] =
+         std::pair<wxVariant, Validator>(wxT(""), stringValidator);
+      return signature;
+   }
+};
+
+#endif /* End of include guard: __DEBUGPRINTCOMMAND__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/ResponseQueue.cpp b/src/commands/ResponseQueue.cpp
new file mode 100644
index 0000000..3ae8ccc
--- /dev/null
+++ b/src/commands/ResponseQueue.cpp
@@ -0,0 +1,55 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file ResponseQueue.cpp
+\brief Contains definitions for the ResponseQueue class
+
+*//*******************************************************************/
+
+#include "ResponseQueue.h"
+#include <queue>
+#include <string>
+#include <wx/thread.h>
+
+ResponseQueue::ResponseQueue()
+   : mCondition(mMutex)
+{
+}
+
+ResponseQueue::~ResponseQueue()
+{ }
+
+void ResponseQueue::AddResponse(Response response)
+{
+   wxMutexLocker locker(mMutex);
+   mResponses.push(response);
+   mCondition.Signal();
+}
+
+Response ResponseQueue::WaitAndGetResponse()
+{
+   wxMutexLocker locker(mMutex);
+   mCondition.Wait();
+   wxASSERT(!mResponses.empty());
+   Response msg = mResponses.front();
+   mResponses.pop();
+   return msg;
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/ResponseQueue.h b/src/commands/ResponseQueue.h
new file mode 100644
index 0000000..690b949
--- /dev/null
+++ b/src/commands/ResponseQueue.h
@@ -0,0 +1,85 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file ResponseQueue.h
+\brief Contains declarations for Response and ResponseQueue classes
+
+*//****************************************************************//**
+
+\class Response
+\brief Stores a command response string (and other response data if it becomes
+necessary)
+
+The string is internally stored as a std::string rather than wxString
+because of thread-safety concerns.
+
+*//****************************************************************//**
+
+\class ResponseQueue
+\brief Allow messages to be sent from the main thread to the script thread
+
+Based roughly on wxMessageQueue<T> (which hasn't reached the stable wxwidgets
+yet). Wraps a std::queue<Response> inside a wxMutex with a wxCondition to
+force the script thread to wait until a response is available.
+
+*//*******************************************************************/
+
+#ifndef __RESPONSEQUEUE__
+#define __RESPONSEQUEUE__
+
+#include <queue>
+#include <string>
+#include <wx/thread.h>
+#include <wx/string.h>
+
+class wxMutex;
+class wxCondition;
+class wxMutexLocker;
+
+class Response {
+   private:
+      std::string mMessage;
+   public:
+      Response(const wxString &response)
+         : mMessage(response.mb_str())
+      { }
+
+      wxString GetMessage()
+      {
+         return wxString(mMessage.c_str(), wxConvUTF8);
+      }
+};
+
+class ResponseQueue {
+   private:
+      std::queue<Response> mResponses;
+      wxMutex mMutex;
+      wxCondition mCondition;
+
+   public:
+      ResponseQueue();
+      ~ResponseQueue();
+
+      void AddResponse(Response response);
+      Response WaitAndGetResponse();
+};
+
+#endif /* End of include guard: __RESPONSEQUEUE__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp
new file mode 100644
index 0000000..ebe5e99
--- /dev/null
+++ b/src/commands/ScreenshotCommand.cpp
@@ -0,0 +1,497 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   License: GPL v2 - see LICENSE.txt
+
+   Dominic Mazzoni
+   Dan Horgan
+
+******************************************************************//**
+
+\class ScreenshotCommand
+\brief Implements a command for capturing various areas of the screen or
+project window.
+
+*//*******************************************************************/
+
+#include "ScreenshotCommand.h"
+#include "../AudacityApp.h"
+#include "../Project.h"
+#include <wx/toplevel.h>
+#include <wx/dcscreen.h>
+#include <wx/dcmemory.h>
+#include <wx/settings.h>
+#include <wx/bitmap.h>
+
+#include "../TrackPanel.h"
+#include "../toolbars/ToolManager.h"
+#include "../toolbars/ToolBar.h"
+#include "../toolbars/ControlToolBar.h"
+#include "../toolbars/DeviceToolBar.h"
+#include "../toolbars/EditToolBar.h"
+#include "../toolbars/MeterToolBar.h"
+#include "../toolbars/MixerToolBar.h"
+#include "../toolbars/SelectionBar.h"
+#include "../toolbars/ToolsToolBar.h"
+#include "../toolbars/TranscriptionToolBar.h"
+#include "../widgets/Ruler.h"
+
+wxTopLevelWindow *ScreenshotCommand::GetFrontWindow(AudacityProject *project)
+{
+   wxWindow *front = NULL;
+   wxWindow *proj = wxGetTopLevelParent(project);
+
+   // This is kind of an odd hack.  There's no method to enumerate all
+   // possible windows, so we search the whole screen for any windows
+   // that are not this one and not the given Audacity project and
+   // if we find anything, we assume that's the dialog the user wants
+   // to capture.
+
+   int width, height, x, y;
+   wxDisplaySize(&width, &height);
+   for (x = 0; x < width; x += 50) {
+      for (y = 0; y < height; y += 50) {
+         wxWindow *win = wxFindWindowAtPoint(wxPoint(x, y));
+         if (win) {
+            win = wxGetTopLevelParent(win);
+            if (win != mIgnore && win != proj) {
+               front = win;
+               break;
+            }
+         }
+      }
+   }
+
+   if (!front || !front->IsTopLevel()) {
+      return (wxTopLevelWindow *)proj;
+   }
+
+   return (wxTopLevelWindow *)front;
+}
+
+wxRect ScreenshotCommand::GetBackgroundRect()
+{
+   wxRect r;
+
+   r.x = 16;
+   r.y = 16;
+   r.width = r.x * 2;
+   r.height = r.y * 2;
+
+   return r;
+}
+
+static void Yield()
+{
+   int cnt;
+   for (cnt = 10; cnt && !wxGetApp().Yield(true); cnt--) {
+      wxMilliSleep(10);
+   }
+   wxMilliSleep(200);
+   for (cnt = 10; cnt && !wxGetApp().Yield(true); cnt--) {
+      wxMilliSleep(10);
+   }
+}
+
+void ScreenshotCommand::Capture(wxString filename,
+                          wxWindow *window,
+                          int x, int y, int width, int height,
+                          bool bg)
+{
+   if (window) {
+      if (window->IsTopLevel()) {
+         window->Raise();
+      }
+      else {
+         wxGetTopLevelParent(window)->Raise();
+      }
+   }
+
+   Yield();
+
+   int screenW, screenH;
+   wxDisplaySize(&screenW, &screenH);
+   wxBitmap full(screenW, screenH);
+
+   wxScreenDC screenDC;
+   wxMemoryDC fullDC;
+
+   // We grab the whole screen image since there seems to be a problem with
+   // using non-zero source coordinates on OSX.  (as of wx2.8.9)
+   fullDC.SelectObject(full);
+   fullDC.Blit(0, 0, screenW, screenH, &screenDC, 0, 0);
+   fullDC.SelectObject(wxNullBitmap);
+
+   wxRect r(x, y, width, height);
+
+   // Ensure within bounds (x/y are negative on Windows when maximized)
+   r.Intersect(wxRect(0, 0, screenW, screenH));
+
+   // Convert to screen coordinates if needed
+   if (window && window->GetParent() && !window->IsTopLevel()) {
+      r.SetPosition(window->GetParent()->ClientToScreen(r.GetPosition()));
+   }
+
+   // Extract the actual image
+   wxBitmap part = full.GetSubBitmap(r);
+
+   // Add a background
+   if (bg && mBackground) {
+      wxRect b = GetBackgroundRect();
+
+      wxBitmap back(width + b.width, height + b.height);
+      fullDC.SelectObject(back);
+
+      fullDC.SetBackground(wxBrush(mBackColor, wxSOLID));
+      fullDC.Clear();
+
+      fullDC.DrawBitmap(part, b.x, b.y);
+      fullDC.SelectObject(wxNullBitmap);
+
+      part = back;
+   }
+
+   // Save the final image
+   wxImage image = part.ConvertToImage();
+   if (image.SaveFile(filename)) {
+      mOutput->Status(_("Saved ") + filename);
+   }
+   else {
+      mOutput->Error(_("Error trying to save file: ") + filename);
+   }
+
+   ::wxBell();
+}
+
+void ScreenshotCommand::CaptureToolbar(ToolManager *man, int type, wxString name)
+{
+   bool visible = man->IsVisible(type);
+   if (!visible) {
+      man->ShowHide(type);
+      Yield();
+   }
+
+   wxWindow *w = man->GetToolBar(type);
+   int x = 0, y = 0;
+   int width, height;
+
+   w->ClientToScreen(&x, &y);
+   w->GetParent()->ScreenToClient(&x, &y);
+   w->GetClientSize(&width, &height);
+
+   Capture(name, w, x, y, width, height);
+
+   if (!visible) {
+      man->ShowHide(type);
+      if (mIgnore)
+         mIgnore->Raise();
+   }
+}
+
+void ScreenshotCommand::CaptureDock(wxWindow *win, wxString fileName)
+{
+   int x = 0, y = 0;
+   int width, height;
+
+   win->ClientToScreen(&x, &y);
+   win->GetParent()->ScreenToClient(&x, &y);
+   win->GetClientSize(&width, &height);
+
+   Capture(fileName, win, x, y, width, height);
+}
+
+ScreenshotCommand::ScreenshotCommand(CommandOutputTarget *output,
+                                     wxWindow *ignore)
+   : Command(wxT("screenshot"), output),
+     mIgnore(ignore),
+     mBackground(false)
+{ }
+
+ParamMap ScreenshotCommand::GetSignature()
+{
+   OptionValidator captureModeValidator;
+   captureModeValidator.AddOption(wxT("window"));
+   captureModeValidator.AddOption(wxT("fullwindow"));
+   captureModeValidator.AddOption(wxT("windowplus"));
+   captureModeValidator.AddOption(wxT("fullscreen"));
+   captureModeValidator.AddOption(wxT("toolbars"));
+   captureModeValidator.AddOption(wxT("selectionbar"));
+   captureModeValidator.AddOption(wxT("tools"));
+   captureModeValidator.AddOption(wxT("control"));
+   captureModeValidator.AddOption(wxT("mixer"));
+   captureModeValidator.AddOption(wxT("meter"));
+   captureModeValidator.AddOption(wxT("edit"));
+   captureModeValidator.AddOption(wxT("device"));
+   captureModeValidator.AddOption(wxT("transcription"));
+   captureModeValidator.AddOption(wxT("trackpanel"));
+   captureModeValidator.AddOption(wxT("ruler"));
+   captureModeValidator.AddOption(wxT("tracks"));
+   captureModeValidator.AddOption(wxT("firsttrack"));
+   captureModeValidator.AddOption(wxT("secondtrack"));
+
+   OptionValidator backgroundValidator;
+   backgroundValidator.AddOption(wxT("Blue"));
+   backgroundValidator.AddOption(wxT("White"));
+   backgroundValidator.AddOption(wxT("None"));
+
+   Validator filePathValidator;
+
+   ParamMap signature;
+   signature[wxT("CaptureMode")] =
+      std::pair<wxVariant, Validator>(wxT("fullscreen"), captureModeValidator);
+   signature[wxT("Background")] =
+      std::pair<wxVariant, Validator>(wxT("None"), backgroundValidator);
+   signature[wxT("FilePath")] =
+      std::pair<wxVariant, Validator>(wxT(""), filePathValidator);
+   return signature;
+}
+
+wxString ScreenshotCommand::MakeFileName(wxString path, wxString basename)
+{
+   wxFileName prefixPath;
+   prefixPath.AssignDir(path);
+   wxString prefix = prefixPath.GetPath
+      (wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
+
+   wxString filename;
+   int i = 0;
+   do {
+      filename.Printf(wxT("%s%s%03d.png"),
+                      prefix.c_str(), basename.c_str(), i);
+      i++;
+   } while (::wxFileExists(filename));
+
+   return filename;
+}
+
+bool ScreenshotCommand::Apply(CommandExecutionContext context)
+{
+   // Read the parameters that were passed in
+   wxString filePath    = GetString(wxT("FilePath"));
+   wxString captureMode = GetString(wxT("CaptureMode"));
+   wxString background  = GetString(wxT("Background"));
+
+   // Build a suitable filename
+   wxString fileName = MakeFileName(filePath, captureMode);
+
+   if (background.IsSameAs(wxT("Blue")))
+   {
+      mBackground = true;
+      mBackColor = wxColour(51, 102, 153);
+   }
+   else if (background.IsSameAs(wxT("White")))
+   {
+      mBackground = true;
+      mBackColor = wxColour(255, 255, 255);
+   }
+   else
+   {
+      mBackground = false;
+   }
+
+   // Reset the toolbars to a known state
+   context.proj->mToolManager->Reset();
+
+   wxTopLevelWindow *w = GetFrontWindow(context.proj);
+   if (!w)
+   {
+      return false;
+   }
+
+   if (captureMode.IsSameAs(wxT("window")))
+   {
+      int x = 0, y = 0;
+      int width, height;
+
+      w->ClientToScreen(&x, &y);
+      w->GetClientSize(&width, &height);
+
+      if (w != context.proj && w->GetTitle() != wxT("")) {
+         fileName = MakeFileName(filePath,
+               captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
+      }
+
+      Capture(fileName, w, x, y, width, height);
+   }
+   else if (captureMode.IsSameAs(wxT("fullwindow"))
+         || captureMode.IsSameAs(wxT("windowplus")))
+   {
+
+      wxRect r = w->GetRect();
+      r.SetPosition(w->GetScreenPosition());
+      r = w->GetScreenRect();
+
+      if (w != context.proj && w->GetTitle() != wxT("")) {
+         fileName = MakeFileName(filePath,
+               captureMode + (wxT("-") + w->GetTitle() + wxT("-")));
+      }
+
+#if defined(__WXGTK__)
+      // In wxGTK, we need to include decoration sizes
+      r.width += (wxSystemSettings::GetMetric(wxSYS_BORDER_X, w) * 2);
+      r.height += wxSystemSettings::GetMetric(wxSYS_CAPTION_Y, w) +
+         wxSystemSettings::GetMetric(wxSYS_BORDER_Y, w);
+#endif
+      if (!mBackground && captureMode.IsSameAs(wxT("windowplus")))
+      {
+         // background colour not selected but we want a background
+         wxRect b = GetBackgroundRect();
+         r.x = (r.x - b.x) >= 0 ? (r.x - b.x): 0;
+         r.y = (r.y - b.y) >= 0 ? (r.y - b.y): 0;
+         r.width += b.width;
+         r.height += b.height;
+      }
+
+      Capture(fileName, w, r.x, r.y, r.width, r.height, true);
+   }
+   else if (captureMode.IsSameAs(wxT("fullscreen")))
+   {
+      int width, height;
+      wxDisplaySize(&width, &height);
+
+      Capture(fileName, w, 0, 0, width, height);
+   }
+   else if (captureMode.IsSameAs(wxT("toolbars")))
+   {
+      CaptureDock(context.proj->mToolManager->GetTopDock(), fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("selectionbar")))
+   {
+      CaptureDock(context.proj->mToolManager->GetBotDock(), fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("tools")))
+   {
+      CaptureToolbar(context.proj->mToolManager, ToolsBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("control")))
+   {
+      CaptureToolbar(context.proj->mToolManager, ControlBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("mixer")))
+   {
+      CaptureToolbar(context.proj->mToolManager, MixerBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("meter")))
+   {
+      CaptureToolbar(context.proj->mToolManager, MeterBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("edit")))
+   {
+      CaptureToolbar(context.proj->mToolManager, EditBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("device")))
+   {
+      CaptureToolbar(context.proj->mToolManager, DeviceBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("transcription")))
+   {
+      CaptureToolbar(context.proj->mToolManager, TranscriptionBarID, fileName);
+   }
+   else if (captureMode.IsSameAs(wxT("trackpanel")))
+   {
+      TrackPanel *panel = context.proj->mTrackPanel;
+      AdornedRulerPanel *ruler = panel->mRuler;
+
+      int h = ruler->GetRulerHeight();
+      int x = 0, y = -h;
+      int width, height;
+
+      panel->ClientToScreen(&x, &y);
+      panel->GetParent()->ScreenToClient(&x, &y);
+      panel->GetClientSize(&width, &height);
+
+      Capture(fileName, panel, x, y, width, height + h);
+   }
+   else if (captureMode.IsSameAs(wxT("ruler")))
+   {
+      TrackPanel *panel = context.proj->mTrackPanel;
+      AdornedRulerPanel *ruler = panel->mRuler;
+
+      int x = 0, y = 0;
+      int width, height;
+
+      ruler->ClientToScreen(&x, &y);
+      ruler->GetParent()->ScreenToClient(&x, &y);
+      ruler->GetClientSize(&width, &height);
+      height = ruler->GetRulerHeight();
+
+      Capture(fileName, ruler, x, y, width, height);
+   }
+   else if (captureMode.IsSameAs(wxT("tracks")))
+   {
+      TrackPanel *panel = context.proj->mTrackPanel;
+
+      int x = 0, y = 0;
+      int width, height;
+
+      panel->ClientToScreen(&x, &y);
+      panel->GetParent()->ScreenToClient(&x, &y);
+      panel->GetClientSize(&width, &height);
+
+      Capture(fileName, panel, x, y, width, height);
+   }
+   else if (captureMode.IsSameAs(wxT("firsttrack")))
+   {
+      TrackPanel *panel = context.proj->mTrackPanel;
+      TrackListIterator iter(context.proj->GetTracks());
+      Track * t = iter.First();
+      if (!t) {
+         return false;
+      }
+      wxRect r = panel->FindTrackRect(t, true);
+
+      int x = 0, y = r.y - 3;
+      int width, height;
+
+      panel->ClientToScreen(&x, &y);
+      panel->GetParent()->ScreenToClient(&x, &y);
+      panel->GetClientSize(&width, &height);
+
+      Capture(fileName, panel, x, y, width, r.height + 6);
+
+   }
+   else if (captureMode.IsSameAs(wxT("secondtrack")))
+   {
+      TrackPanel *panel = context.proj->mTrackPanel;
+      TrackListIterator iter(context.proj->GetTracks());
+      Track * t = iter.First();
+      if (!t) {
+         return false;
+      }
+      if (t->GetLinked()) {
+         t = iter.Next();
+      }
+      t = iter.Next();
+      if (!t) {
+         return false;
+      }
+      wxRect r = panel->FindTrackRect(t, true);
+
+      int x = 0, y = r.y - 3;
+      int width, height;
+
+      panel->ClientToScreen(&x, &y);
+      panel->GetParent()->ScreenToClient(&x, &y);
+      panel->GetClientSize(&width, &height);
+
+      Capture(fileName, panel, x, y, width, r.height + 6);
+   }
+   else
+   {
+      // Invalid capture mode!
+      return false;
+   }
+
+   return true;
+}
+
+// Indentation settings for Vim and Emacs.
+// Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
diff --git a/src/commands/ScreenshotCommand.h b/src/commands/ScreenshotCommand.h
new file mode 100644
index 0000000..618d357
--- /dev/null
+++ b/src/commands/ScreenshotCommand.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   License: GPL v2 - see LICENSE.txt
+
+   Dominic Mazzoni
+   Dan Horgan
+
+**********************************************************************/
+
+#ifndef __SCREENSHOTCOMMAND__
+#define __SCREENSHOTCOMMAND__
+
+#include "Command.h"
+
+class wxWindow;
+class wxTopLevelWindow;
+class wxCommandEvent;
+class wxRect;
+class ToolManager;
+
+class ScreenshotCommand : public Command
+{
+private:
+   // May need to ignore the screenshot dialog
+   wxWindow *mIgnore;
+
+   bool mBackground;
+   wxColour mBackColor;
+
+   wxString MakeFileName(wxString path, wxString basename);
+
+   wxRect GetBackgroundRect();
+   void Capture(wxString basename,
+         wxWindow *window,
+         int x, int y, int width, int height,
+         bool bg = false);
+   void CaptureToolbar(ToolManager *man, int type, wxString name);
+   void CaptureDock(wxWindow *win, wxString fileName);
+
+public:
+   wxTopLevelWindow *GetFrontWindow(AudacityProject *project);
+   ScreenshotCommand(CommandOutputTarget *output, wxWindow *ignore = NULL);
+   bool Apply(CommandExecutionContext context);
+   static ParamMap GetSignature();
+};
+
+#endif /* End of include guard: __SCREENSHOTCOMMAND__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/ScriptCommandRelay.cpp b/src/commands/ScriptCommandRelay.cpp
new file mode 100644
index 0000000..26995ba
--- /dev/null
+++ b/src/commands/ScriptCommandRelay.cpp
@@ -0,0 +1,95 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file ScriptCommandRelay.cpp
+\brief Contains definitions for ScriptCommandRelay
+
+*//****************************************************************//**
+
+\class ScriptCommandRelay
+\brief ScriptCommandRelay is just a way to move some of the scripting-specific
+code out of LoadModules.
+
+*//*******************************************************************/
+
+#include "ScriptCommandRelay.h"
+#include "../BatchCommands.h"
+#include "../Audacity.h"
+#include "Command.h"
+#include "CommandBuilder.h"
+#include "AppCommandEvent.h"
+#include "CommandHandler.h"
+#include "ResponseQueue.h"
+#include <wx/wx.h>
+
+#include "../Project.h"
+
+// Declare static class members
+CommandHandler *ScriptCommandRelay::sCmdHandler;
+tpRegScriptServerFunc ScriptCommandRelay::sScriptFn;
+ResponseQueue ScriptCommandRelay::sResponseQueue;
+
+void ScriptCommandRelay::SetRegScriptServerFunc(tpRegScriptServerFunc scriptFn)
+{ sScriptFn = scriptFn; }
+
+void ScriptCommandRelay::SetCommandHandler(CommandHandler &ch)
+{ sCmdHandler = &ch; }
+
+void ScriptCommandRelay::Run()
+{
+   wxASSERT( sScriptFn != NULL );
+   while( true )
+      sScriptFn(&ExecCommand);
+}
+
+/// This is the function which actually obeys one command.  Rather than applying
+/// the command directly, an event containing a reference to the command is sent
+/// to the main (GUI) thread. This is because having more than one thread access
+/// the GUI at a time causes problems with wxwidgets.
+int ExecCommand(wxString *pIn, wxString *pOut)
+{
+   CommandBuilder builder(*pIn);
+   if (builder.WasValid())
+   {
+      Command *cmd = builder.GetCommand();
+      AppCommandEvent ev;
+      ev.SetCommand(cmd);
+      GetActiveProject()->AddPendingEvent(ev);
+      Response r = ScriptCommandRelay::ReceiveResponse();
+      *pOut      = r.GetMessage();
+   } else
+   {
+      *pOut = wxT("Syntax error!\n");
+      *pOut += builder.GetErrorMessage();
+   }
+
+   return 0;
+}
+
+void ScriptCommandRelay::SendResponse(const wxString &response)
+{
+   sResponseQueue.AddResponse(response);
+}
+
+Response ScriptCommandRelay::ReceiveResponse()
+{
+   return ScriptCommandRelay::sResponseQueue.WaitAndGetResponse();
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/commands/ScriptCommandRelay.h b/src/commands/ScriptCommandRelay.h
new file mode 100644
index 0000000..a0663f4
--- /dev/null
+++ b/src/commands/ScriptCommandRelay.h
@@ -0,0 +1,65 @@
+/**********************************************************************
+
+   Audacity - A Digital Audio Editor
+   Copyright 1999-2009 Audacity Team
+   File License: wxWidgets
+
+   Dan Horgan
+
+******************************************************************//**
+
+\file ScriptCommandRelay.h
+\brief Contains declarations for ScriptCommandRelay
+
+*//*******************************************************************/
+
+#ifndef __SCRIPTCOMMANDRELAY__
+#define __SCRIPTCOMMANDRELAY__
+
+#include "../Audacity.h"
+#include <wx/string.h>
+
+class CommandHandler;
+class ResponseQueue;
+class Response;
+
+
+
+typedef int (*tpExecScriptServerFunc)( wxString * pIn, wxString * pOut);
+typedef int (*tpRegScriptServerFunc)(tpExecScriptServerFunc pFn);
+
+extern "C" {
+      AUDACITY_DLL_API int ExecCommand(wxString *pIn, wxString *pOut);
+} // End 'extern C'
+
+class ScriptCommandRelay
+{
+   private:
+      // N.B. Static class members also have to be declared in the .cpp file
+      static CommandHandler *sCmdHandler;
+      static tpRegScriptServerFunc sScriptFn;
+      static ResponseQueue sResponseQueue;
+
+   public:
+
+      static void SetRegScriptServerFunc(tpRegScriptServerFunc scriptFn);
+      static void SetCommandHandler(CommandHandler &ch);
+
+      static void Run();
+
+      static void SendResponse(const wxString &response);
+      static Response ReceiveResponse();
+};
+
+#endif /* End of include guard: __SCRIPTCOMMANDRELAY__ */
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: TBD
diff --git a/src/effects/Generator.cpp b/src/effects/Generator.cpp
new file mode 100644
index 0000000..1dd4986
--- /dev/null
+++ b/src/effects/Generator.cpp
@@ -0,0 +1,105 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  Generator.h
+
+  Two Abstract classes, Generator, and BlockGenerator, that effects which
+  generate audio should derive from.  
+  
+  Block Generator breaks the synthesis task up into smaller parts.
+
+  Dominic Mazzoni
+  Vaughan Johnson
+
+**********************************************************************/
+#include "Generator.h"
+
+
+bool Generator::Process()
+{
+   if (mDuration < 0.0)
+      return false;
+
+   BeforeGenerate();
+
+   // Set up mOutputTracks. This effect needs Track::All because it uses ClearAndPaste
+   // that need to have label tracks.
+   this->CopyInputTracks(Track::All);
+
+   // Iterate over the tracks
+   bool bGoodResult = true;
+   int ntrack = 0;
+   SelectedTrackListOfKindIterator iter(Track::Wave, mOutputTracks);
+   WaveTrack *track = (WaveTrack *)iter.First();
+   while (track) {
+      if (mDuration > 0.0)
+      {
+         // Create a temporary track
+         WaveTrack *tmp = mFactory->NewWaveTrack(track->GetSampleFormat(),
+                                                 track->GetRate());
+         BeforeTrack(*track);
+
+         // Fill it with data
+         if (!GenerateTrack(tmp, *track, ntrack))
+            bGoodResult = false;
+
+         // Transfer the data from the temporary track to the actual one
+         tmp->Flush();
+         track->ClearAndPaste(mT0, mT1, tmp, true, true, mOutputTracks);
+         delete tmp;
+
+         if (!bGoodResult) {
+            Failure();
+            return false;
+         }
+      }
+      else
+      {
+         // If the duration is zero, there's no need to actually
+         // generate anything
+         track->Clear(mT0, mT1);
+      }
+
+      // Move on to the next track
+      ntrack++;
+      track = (WaveTrack *)iter.Next();
+   }
+
+   Success();
+
+   this->ReplaceProcessedTracks(bGoodResult);
+
+   mT1 = mT0 + mDuration; // Update selection.
+
+   return true;
+}
+
+bool BlockGenerator::GenerateTrack(WaveTrack *tmp,
+                                   const WaveTrack &track,
+                                   int ntrack)
+{
+   bool bGoodResult = true;
+   numSamples = track.TimeToLongSamples(mDuration);
+   sampleCount i = 0;
+   float *data = new float[tmp->GetMaxBlockSize()];
+   sampleCount block = 0;
+
+   while ((i < numSamples) && bGoodResult) {
+      block = tmp->GetBestBlockSize(i);
+      if (block > (numSamples - i))
+         block = numSamples - i;
+
+      GenerateBlock(data, track, block);
+
+      // Add the generated data to the temporary track
+      tmp->Append((samplePtr)data, floatSample, block);
+      i += block;
+
+      // Update the progress meter
+      if (TrackProgress(ntrack, (double)i / numSamples))
+         bGoodResult = false;
+   }
+   delete[] data;
+   return bGoodResult;
+}
diff --git a/src/effects/Generator.h b/src/effects/Generator.h
new file mode 100644
index 0000000..ccd40dc
--- /dev/null
+++ b/src/effects/Generator.h
@@ -0,0 +1,75 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  Generator.h
+
+  Two Abstract classes, Generator, and BlockGenerator, that effects which
+  generate audio should derive from.  
+  
+  Block Generator breaks the synthesis task up into smaller parts.
+
+  Dominic Mazzoni
+  Vaughan Johnson
+
+**********************************************************************/
+
+
+#ifndef __AUDACITY_GENERATOR__
+#define __AUDACITY_GENERATOR__
+
+#include "Effect.h"
+
+// Base class for Generators (effects which fill a given duration)
+class Generator : public Effect
+{
+public:
+   Generator() : mDuration(sDefaultGenerateLen) { }
+
+protected:
+   // Amount of time to generate, in seconds
+   double mDuration;
+
+   // [ GenerateTrack() must be overridden by the actual generator class ]
+   // Precondition:  mDuration > 0.0
+   // Postcondition: <tmp> is filled with the data intended for <track>
+   virtual bool GenerateTrack(WaveTrack *tmp,
+                              const WaveTrack &track,
+                              int ntrack) = 0;
+
+   // Actions to perform at the respective points in the generation process
+   virtual void BeforeGenerate() { };
+   virtual void BeforeTrack(const WaveTrack &track) { };
+
+   // Actions to perform upon respective outcomes
+   // (For example, Success might save the parameters that were used.)
+   virtual void Success() { };
+   virtual void Failure() { };
+
+   // Precondition:
+   // mDuration is set to the amount of time to generate in seconds
+   // Postcondition:
+   // If mDuration was valid (>= 0), then the tracks are replaced by the
+   // generated results and true is returned. Otherwise, return false.
+   bool Process();
+};
+
+// Abstract generator which creates the sound in discrete blocks, whilst
+// showing a progress bar
+class BlockGenerator : public Generator {
+public:
+   BlockGenerator() { }
+protected:
+   // Number of samples to generate
+   sampleCount numSamples;
+
+   // Postcondition: data[0..block) filled with generated samples
+   virtual void GenerateBlock(float *data,
+                              const WaveTrack &track,
+                              sampleCount block) = 0;
+
+   // Generate the track, one block at a time, & adding the results to tmp
+   bool GenerateTrack(WaveTrack *tmp, const WaveTrack &track, int ntrack);
+};
+
+#endif
diff --git a/src/effects/VST/LoadVST.cpp b/src/effects/VST/LoadVST.cpp
new file mode 100644
index 0000000..b612532
--- /dev/null
+++ b/src/effects/VST/LoadVST.cpp
@@ -0,0 +1,315 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  LoadVST.cpp
+
+  Dominic Mazzoni
+
+**********************************************************************/
+
+#include "../../Audacity.h"
+
+#if USE_VST
+
+#if defined(__WXMAC__)
+   #include <wx/mac/private.h>
+#else
+   #include <wx/dynlib.h>
+#endif
+
+#if defined(__WXMSW__)
+   #include <windows.h>
+   #include <shlwapi.h>
+   #pragma comment(lib, "shlwapi")
+#endif
+
+#include "../../AudacityApp.h"
+#include "../../Internat.h"
+#include "../EffectManager.h"
+
+#include "VSTEffect.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef AEffect *(*vstPluginMain)(audioMasterCallback audioMaster);
+
+static long int audioMaster(AEffect * effect,
+                            long int opcode,
+                            long int index,
+                            long int value,
+                            void * ptr,
+                            float opt)
+{
+   // Forward to VSTEffect if it's active
+   if (effect && effect->user) {
+      VSTEffect *vst = (VSTEffect *) effect->user;
+      return vst->audioMaster(effect, opcode, index, value, ptr, opt);
+   }
+
+   // Handles operations during initialization...before VSTEffect has had a
+   // chance to set its instance pointer.
+   switch (opcode)
+   {
+      case audioMasterVersion:
+         return 2;
+
+      case audioMasterCurrentId:
+         return audacityVSTID;
+
+      // Ignore these
+      case audioMasterIdle:
+      case audioMasterWantMidi:
+         return 0;
+
+      default:
+#if 0
+#if defined(__WXDEBUG__)
+         wxPrintf(wxT("effect: %p opcode: %d index: %d value: %d ptr: %p opt: %f user: %p\n"),
+                  effect, opcode, index, value, ptr, opt, effect->user);
+         wxLogDebug(wxT("effect: %p opcode: %d index: %d value: %d ptr: %p opt: %f user: %p"),
+                    effect, opcode, index, value, ptr, opt, effect->user);
+#endif
+#endif
+         return 0;
+   }
+}
+
+static void LoadVSTPlugin(const wxString & fname)
+{
+   vstPluginMain pluginMain;
+   void *module = NULL;
+
+#if defined(__WXDEBUG__)
+//   wxPrintf(wxT("%s\n"), fname.c_str());
+//   wxLogDebug(wxT("%s"), fname.c_str());
+#endif
+
+#if defined(__WXMAC__)
+
+   // Remove the 'Contents/Info.plist' portion of the name and create a
+   // CFString
+   wxString name(wxPathOnly(wxPathOnly(fname)));
+   wxMacCFStringHolder path(name);
+
+   // Convert the path to a URL
+   CFURLRef urlRef =
+      CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
+                                    path,
+                                    kCFURLPOSIXPathStyle,
+                                    true);
+   if (urlRef == NULL) {
+      return;
+   }
+
+   // Create the bundle using the URL
+   CFBundleRef bundleRef = CFBundleCreate(kCFAllocatorDefault, urlRef);
+
+   // Done with the URL
+   CFRelease(urlRef);
+
+   // Bail if the bundle wasn't created
+   if (bundleRef == NULL) {
+      return;
+   }
+
+   // Try to locate the new plugin entry point
+   pluginMain = (vstPluginMain)
+      CFBundleGetFunctionPointerForName(bundleRef,
+                                        CFSTR("VSTPluginMain"));
+
+   // If not found, try finding the old entry point
+   if (pluginMain == NULL) {
+      pluginMain = (vstPluginMain)
+         CFBundleGetFunctionPointerForName(bundleRef,
+                                           CFSTR("main_macho"));
+   }
+
+   // Must not be a VST plugin
+   if (pluginMain == NULL) {
+      CFRelease(bundleRef);
+      return;
+   }
+
+   // Save the bundle reference
+   module = bundleRef;
+
+#else
+
+   // Try to load the library
+   wxDynamicLibrary *lib = new wxDynamicLibrary(fname);
+   if (!lib) {
+      return;
+   }
+
+   // Bail if it wasn't successful
+   if (!lib->IsLoaded()) {
+      delete lib;
+      return;
+   }
+
+   // Try to find the entry point, while suppressing error messages
+   {
+      wxLogNull logNo;
+      pluginMain = (vstPluginMain) lib->GetSymbol(wxT("main"));
+      if (pluginMain == NULL) {
+         delete lib;
+         return;
+      }
+   }
+
+   // Save the library reference
+   module = lib;
+
+#endif
+
+   // Initialize the plugin
+   AEffect *aeffect = pluginMain(audioMaster);
+
+   // Was it successful?
+   if (aeffect) {
+
+      // Ensure that it looks like a plugin and can deal with ProcessReplacing
+      // calls.  Also exclude synths for now.
+      if (aeffect->magic == kEffectMagic &&
+         !(aeffect->flags & effFlagsIsSynth) &&
+         aeffect->flags & effFlagsCanReplacing) {
+
+         // Looks good...try to create the VSTEffect
+         VSTEffect *vst = new VSTEffect(fname, module, aeffect);
+         if (vst != NULL) {
+
+            // Success...register it and get out
+            EffectManager::Get().RegisterEffect(vst);
+            return;
+         }
+      }
+#if defined(__WXDEBUG__)
+      else {
+         wxPrintf(wxT("bypassing %s - magic %08x flags %08x\n"),
+                  fname.c_str(), aeffect->magic, aeffect->flags);
+         wxLogDebug(wxT("bypassing %s - magic %08x flags %08x"),
+                    fname.c_str(), aeffect->magic, aeffect->flags);
+      }
+#endif
+   }
+
+   // Only way we can get here is if something went wrong...clean up
+   
+#if defined(__WXMAC__)
+   CFRelease(bundleRef);
+#else
+   delete lib;
+#endif
+}
+
+void LoadVSTPlugins()
+{
+   wxArrayString audacityPathList = wxGetApp().audacityPathList;
+   wxArrayString pathList;
+   wxArrayString files;
+
+   // Check for the VST_PATH environment variable
+   wxString vstpath = wxGetenv(wxT("VST_PATH"));
+   if (!vstpath.IsEmpty()) {
+      wxGetApp().AddUniquePathToPathList(vstpath, pathList);
+   }
+
+   // Add Audacity specific paths
+   for (size_t i = 0; i < audacityPathList.GetCount(); i++) {
+      wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
+      wxGetApp().AddUniquePathToPathList(prefix + wxT("VST"),
+                                         pathList);
+      wxGetApp().AddUniquePathToPathList(prefix + wxT("plugins"),
+                                         pathList);
+      wxGetApp().AddUniquePathToPathList(prefix + wxT("plug-ins"),
+                                         pathList);
+   }
+
+#if defined(__WXMAC__)
+#define VSTPATH wxT("/Library/Audio/Plug-Ins/VST")
+
+   // Look in /Library/Audio/Plug-Ins/VST and $HOME/Library/Audio/Plug-Ins/VST
+   wxGetApp().AddUniquePathToPathList(VSTPATH, pathList);
+   wxGetApp().AddUniquePathToPathList(wxString(wxGetenv(wxT("HOME"))) + VSTPATH,
+                                      pathList);
+
+   // Recursively search all paths for Info.plist files.  This will identify all
+   // bundles.
+   wxGetApp().FindFilesInPathList(wxT("Info.plist"), pathList, files, wxDIR_DEFAULT);
+#elif defined(__WXMSW__)
+   TCHAR dpath[MAX_PATH];
+   TCHAR tpath[MAX_PATH];
+   DWORD len = WXSIZEOF(tpath);
+
+   // Setup the default VST path.
+   dpath[0] = '\0';
+   ExpandEnvironmentStrings(wxT("%ProgramFiles%\\Steinberg\\VSTPlugins"),
+                            dpath,
+                            WXSIZEOF(dpath));
+
+   // Check registry for the real path
+   if (SHRegGetUSValue(wxT("Software\\VST"),
+                          wxT("VSTPluginsPath"),
+                          NULL,
+                          tpath,
+                          &len,
+                          FALSE,
+                          dpath,
+                          (DWORD) _tcslen(dpath)) == ERROR_SUCCESS) {
+      tpath[len] = 0;
+      ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath));
+      wxGetApp().AddUniquePathToPathList(LAT1CTOWX(dpath), pathList);
+   }
+
+   // Recursively scan for all DLLs
+   wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, files, wxDIR_DEFAULT);
+
+#else
+
+   // Recursively scan for all shared objects
+   wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
+
+#endif
+
+   // Try loading everything found
+   for (size_t i = 0; i < files.GetCount(); i++) {
+      LoadVSTPlugin(files[i]);
+   }
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#else
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void LoadVSTPlugins()
+{
+   return;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // USE_VST
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: d75c9c59-4f9b-4398-b4e8-11ffddc283cf
+
diff --git a/src/effects/VST/LoadVST.h b/src/effects/VST/LoadVST.h
new file mode 100644
index 0000000..a24b834
--- /dev/null
+++ b/src/effects/VST/LoadVST.h
@@ -0,0 +1,26 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  LoadVST.h
+
+  Mark Tomlinson
+
+**********************************************************************/
+
+extern "C"
+{
+   void LoadVSTPlugins();
+};
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 3a891fd3-bbb4-430f-8486-f2e31bc8da78
diff --git a/src/effects/VST/aeffectx.h b/src/effects/VST/aeffectx.h
new file mode 100644
index 0000000..164b104
--- /dev/null
+++ b/src/effects/VST/aeffectx.h
@@ -0,0 +1,288 @@
+/*
+ * aeffectx.h - simple header to allow VeSTige compilation and eventually work
+ *
+ * Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
+ * 
+ * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program (see COPYING); if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ */
+
+
+#ifndef _AEFFECTX_H
+#define _AEFFECTX_H
+
+#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) |		\
+				( ( (int) b ) << 16 ) |		\
+				( ( (int) c ) << 8 ) |		\
+				( ( (int) d ) << 0 ) )
+
+const int audioMasterAutomate = 0;
+const int audioMasterVersion = 1;
+const int audioMasterCurrentId = 2;
+const int audioMasterIdle = 3;
+const int audioMasterPinConnected = 4;
+// unsupported? 5
+const int audioMasterWantMidi = 6;
+const int audioMasterGetTime = 7;
+const int audioMasterProcessEvents = 8;
+const int audioMasterSetTime = 9;
+const int audioMasterTempoAt = 10;
+const int audioMasterGetNumAutomatableParameters = 11;
+const int audioMasterGetParameterQuantization = 12;
+const int audioMasterIOChanged = 13;
+const int audioMasterNeedIdle = 14;
+const int audioMasterSizeWindow = 15;
+const int audioMasterGetSampleRate = 16;
+const int audioMasterGetBlockSize = 17;
+const int audioMasterGetInputLatency = 18;
+const int audioMasterGetOutputLatency = 19;
+const int audioMasterGetPreviousPlug = 20;
+const int audioMasterGetNextPlug = 21;
+const int audioMasterWillReplaceOrAccumulate = 22;
+const int audioMasterGetCurrentProcessLevel = 23;
+const int audioMasterGetAutomationState = 24;
+const int audioMasterOfflineStart = 25;
+const int audioMasterOfflineRead = 26;
+const int audioMasterOfflineWrite = 27;
+const int audioMasterOfflineGetCurrentPass = 28;
+const int audioMasterOfflineGetCurrentMetaPass = 29;
+const int audioMasterSetOutputSampleRate = 30;
+// unsupported? 31
+const int audioMasterGetSpeakerArrangement = 31; // deprecated in 2.4?
+const int audioMasterGetVendorString = 32;
+const int audioMasterGetProductString = 33;
+const int audioMasterGetVendorVersion = 34;
+const int audioMasterVendorSpecific = 35;
+const int audioMasterSetIcon = 36;
+const int audioMasterCanDo = 37;
+const int audioMasterGetLanguage = 38;
+const int audioMasterOpenWindow = 39;
+const int audioMasterCloseWindow = 40;
+const int audioMasterGetDirectory = 41;
+const int audioMasterUpdateDisplay = 42;
+const int audioMasterBeginEdit = 43;
+const int audioMasterEndEdit = 44;
+const int audioMasterOpenFileSelector = 45;
+const int audioMasterCloseFileSelector = 46; // currently unused
+const int audioMasterEditFile = 47; // currently unused
+const int audioMasterGetChunkFile = 48; // currently unused
+const int audioMasterGetInputSpeakerArrangement = 49; // currently unused
+
+const int effFlagsHasEditor = 1;
+const int effFlagsCanReplacing = 1 << 4; // very likely
+const int effFlagsProgramChunks = 1 << 5; // from Ardour
+const int effFlagsIsSynth = 1 << 8; // currently unused
+
+const int effOpen = 0;
+const int effClose = 1; // currently unused
+const int effSetProgram = 2; // currently unused
+const int effGetProgram = 3; // currently unused
+// The next one was gleaned from http://www.kvraudio.com/forum/viewtopic.php?p=1905347
+const int effSetProgramName = 4;
+const int effGetProgramName = 5; // currently unused
+// The next two were gleaned from http://www.kvraudio.com/forum/viewtopic.php?p=1905347
+const int effGetParamLabel = 6;
+const int effGetParamDisplay = 7;
+const int effGetParamName = 8; // currently unused
+const int effSetSampleRate = 10;
+const int effSetBlockSize = 11;
+const int effMainsChanged = 12;
+const int effEditGetRect = 13;
+const int effEditOpen = 14;
+const int effEditClose = 15;
+const int effEditIdle = 19;
+const int effEditTop = 20;
+const int effGetChunk = 23; // from Ardour
+const int effSetChunk = 24; // from Ardour
+const int effProcessEvents = 25;
+// The next one was gleaned from http://www.kvraudio.com/forum/viewtopic.php?p=1905347
+const int effGetProgramNameIndexed = 29;
+const int effGetEffectName = 45;
+const int effGetParameterProperties = 56; // missing
+const int effGetVendorString = 47;
+const int effGetProductString = 48;
+const int effGetVendorVersion = 49;
+const int effCanDo = 51; // currently unused
+const int effGetVstVersion = 58; // currently unused
+
+const int kEffectMagic = CCONST( 'V', 's', 't', 'P' );
+const int kVstLangEnglish = 1;
+const int kVstMidiType = 1;
+const int kVstParameterUsesFloatStep = 1 << 2;
+const int kVstTempoValid = 1 << 10;
+const int kVstTransportPlaying = 1 << 1;
+
+
+class remoteVstPlugin;
+
+
+class VstMidiEvent
+{
+public:
+	// 00
+	int type;
+	// 04
+	int byteSize;
+	// 08
+	int deltaFrames;
+	// 0c?
+	int flags;
+	// 10?
+	int noteLength;
+	// 14?
+	int noteOffset;
+	// 18
+	char midiData[4];
+	// 1c?
+	char detune;
+	// 1d?
+	char noteOffVelocity;
+	// 1e?
+	char reserved1;
+	// 1f?
+	char reserved2;
+
+} ;
+
+
+
+
+class VstEvent
+{
+	char dump[sizeof( VstMidiEvent )];
+
+} ;
+
+
+
+
+class VstEvents
+{
+public:
+	// 00
+	int numEvents;
+	// 04
+	int reserved;
+	// 08
+	VstEvent * events;
+
+} ;
+
+
+
+
+// Not finished, neither really used
+class VstParameterProperties
+{
+public:
+	float stepFloat;
+	char label[64];
+	int flags;
+	int minInteger;
+	int maxInteger;
+	int stepInteger;
+	char shortLabel[8];
+	int category;
+	char categoryLabel[24];
+	char empty[128];
+
+} ;
+
+
+#include <stdint.h>
+
+class AEffect
+{
+public:
+	// Never use virtual functions!!!
+	// 00-03
+	int magic;
+	// dispatcher 04-07
+	int (* dispatcher)( AEffect * , int , int , int , void * , float );
+	// process, quite sure 08-0b
+	void (* process)( AEffect * , float * * , float * * , int );
+	// setParameter 0c-0f
+	void (* setParameter)( AEffect * , int , float );
+	// getParameter 10-13
+	float (* getParameter)( AEffect * , int );
+	// programs 14-17
+	int numPrograms;
+	// Params 18-1b
+	int numParams;
+	// Input 1c-1f
+	int numInputs;
+	// Output 20-23
+	int numOutputs;
+	// flags 24-27
+	int flags;
+	// Fill somewhere 28-2b
+	void * user;
+	// Zeroes 2c-2f 30-33 34-37 38-3b
+	char empty3[4 + 4 + 4 + 4];
+	// 1.0f 3c-3f
+	float unkown_float;
+	// An object? pointer 40-43
+	char empty4[4];
+	// Zeroes 44-47
+	char empty5[4];
+	// Id 48-4b
+	int32_t uniqueID;
+	// Don't know 4c-4f
+	char unknown1[4];
+	// processReplacing 50-53
+	void (* processReplacing)( AEffect * , float * * , float * * , int );
+
+} ;
+
+
+class VstTimeInfo
+{
+public:
+	// 00
+	double samplePos;
+	// 08
+	double sampleRate;
+	// unconfirmed 10 18
+	char empty1[8 + 8];
+	// 20?
+	double tempo;
+	// unconfirmed 28 30 38
+	char empty2[8 + 8 + 8];
+	// 40?
+	int timeSigNumerator;
+	// 44?
+	int timeSigDenominator;
+	// unconfirmed 48 4c 50
+	char empty3[4 + 4 + 4];
+	// 54
+	int flags;
+
+} ;
+
+
+
+
+typedef long int (* audioMasterCallback)( AEffect * , long int , long int ,
+						long int , void * , float );
+// we don't use it, may be noise
+#define VSTCALLBACK
+
+
+
+
+#endif
diff --git a/src/import/ImportGStreamer.cpp b/src/import/ImportGStreamer.cpp
new file mode 100644
index 0000000..b5e86b7
--- /dev/null
+++ b/src/import/ImportGStreamer.cpp
@@ -0,0 +1,1037 @@
+/**********************************************************************
+
+Audacity: A Digital Audio Editor
+
+ImportGStreamer.cpp
+
+Copyright 2008  LRN
+Based on ImportFFmpeg.cpp by LRN
+Licensed under the GNU General Public License v2 or later
+
+*//****************************************************************//**
+
+\class GStreamerImportFileHandle
+\brief An ImportFileHandle for GStreamer data
+
+*//****************************************************************//**
+
+\class GStreamerImportPlugin
+\brief An ImportPlugin for GStreamer data
+
+*//*******************************************************************/
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include <wx/wxprec.h>
+
+#include "../Audacity.h"	// needed before GStreamer.h
+#include "../GStreamerLoader.h"		// which brings in gst.h
+#ifndef WX_PRECOMP
+// Include your minimal set of headers here, or wx.h
+#include <wx/window.h>
+#endif
+
+#define DESC _("GStreamer-compatible files")
+
+#if defined(USE_GSTREAMER)
+// all the includes live here by default
+#include "Import.h"
+#include "ImportGStreamer.h"
+#include "../Tags.h"
+#include "../Internat.h"
+#include "../WaveTrack.h"
+#include "ImportPlugin.h"
+extern "C" {
+#include <gio/gio.h>
+#include <gst/app/gstappsink.h>
+}
+#include "stdint.h" //for int16_t
+
+// A stucture, we create and maintain one for each audio stream
+struct GStreamContext {
+   gchar       *mAConvName;   // Name of an audio converter element that serves this stream
+   gchar       *mASinkName;   // Name of an AppSink element that passes this stream to Audacity
+   GstElement  *mConv;        // Audio converter
+   GstElement  *mSink;        // Application sink
+   bool         mUse;         // True if this stream should be imported, False if it should not be
+   WaveTrack  **mChannels;    // Array of WaveTrack pointers, one for each channel
+   gint         mNumChannels; // Number of channels
+   gdouble      mSampleRate;  // Sample rate
+   gint         mWidth;       // Alignment
+   gint         mDepth;       // Sample resolution
+   GstClockTime mLastTime;     // For synchronization
+};
+
+class GStreamerImportFileHandle;
+
+/// A representative of GStreamer loader in
+/// the Audacity import plugin list
+class GStreamerImportPlugin : public ImportPlugin
+{
+public:
+   GStreamerImportPlugin():
+      ImportPlugin(wxArrayString())
+      {
+         if (GStreamerInst != NULL)
+         {
+           mExtensions = GStreamerInst->GetExtensions();
+         }
+         else
+         {
+           // It should be an empty list, but i've noticed that empty list doesn't work here
+           mExtensions.Add(wxT("wav"));
+         }
+      }
+
+   ~GStreamerImportPlugin() { }
+
+   wxString GetPluginFormatDescription();
+
+   ///! Probes the file and opens it if appropriate
+   ImportFileHandle *Open(wxString Filename);
+};
+
+///! Does actual import, returned by GStreamerImportPlugin::Open
+class GStreamerImportFileHandle : public ImportFileHandle
+{
+
+public:
+   GStreamerImportFileHandle(const wxString & name);
+   ~GStreamerImportFileHandle();
+
+   ///! Format initialization
+   ///\param nameIsUri - true if mName should be treated as uri, false if mName is a filename
+   ///\return true if successful, false otherwise
+   bool Init(bool nameIsUri);
+
+   wxString GetFileDescription();
+   int GetFileUncompressedBytes();
+
+   ///! Imports audio
+   ///\return import status (see Import.cpp)
+   int Import(TrackFactory *trackFactory, Track ***outTracks,
+      int *outNumTracks, Tags *tags);
+
+   ///! Called when pad-added signal comes in from UriDecodeBin (as GstElement)
+   ///\param uridecodebin - element that sent the signal
+   ///\param pad - source pad of uridecodebin that will be serving the data
+   void OnNewStream(GstElement *uridecodebin, GstPad *pad);
+
+   ///! Called when unknown-pad signal comes in from UriDecodeBin
+   ///\param uridecodebin - element that sent the signal
+   ///\param pad - source pad of uridecodebin that will not be serving any data
+   ///\param caps - information about the stream
+   void OnUnknownStream(GstElement *uridecodebin, GstPad *pad, GstCaps *caps);
+
+   ///! Adds new stream context
+   ///\return pointer to newly-allocated context
+   GStreamContext *AddNewStream();
+
+   ///! Removes stream context
+   ///\param index - index of a context in context array
+   void DeleteStream(guint index);
+
+   ///! Called when a message comes through GStreamer message bus
+   ///\param bus - a bus that served the message
+   ///\param message - a message
+   ///\return true if we want to continue to watch the bus, false otherwise
+   gboolean OnBusMessage(GstBus *bus, GstMessage *message);
+
+   ///! Called when new data comes in from the pipeline
+   ///\param sc - stream context
+   ///\param buffer - GStreamer Audio Buffer
+   ///\return eImportSuccess if everything is OK
+   int WriteData(GStreamContext *sc, GstBuffer *buffer);
+
+   ///! Called by the pipeline when GST_MESSAGE_TAG arrives
+   ///\param list - list of tags
+   ///\param tag - a tag in the list
+   void WriteTags(const GstTagList *list, const gchar *tag);
+
+   ///! Called by Import.cpp
+   ///\return number of readable audio streams in the file
+   wxInt32 GetStreamCount()
+   {
+      return mScs->len;
+   }
+   
+   ///! Called by Import.cpp
+   ///\return array of strings - descriptions of the streams
+   wxArrayString *GetStreamInfo()
+   {
+      return mStreamInfo;
+   }
+
+   ///! Called by Import.cpp
+   ///\param StreamID - index of the stream in mStreamInfo and mScs arrays
+   ///\param Use - true if this stream should be imported, false otherwise
+   void SetStreamUsage(wxInt32 StreamID, bool Use)
+   {
+      if ((guint)StreamID < mScs->len)
+      {
+         GStreamContext *c = (GStreamContext*)g_ptr_array_index(mScs,StreamID);
+         c->mUse = Use;
+      }
+   }
+
+   //! Convenience function - processes all the messages on the bus
+   void ProcessMessages()
+   {
+      GstMessage *msg = gst_bus_pop(mBus);
+      while (msg != NULL)
+      {
+         OnBusMessage(mBus,msg);
+         msg = gst_bus_pop(mBus);
+      }
+   }
+
+private:
+
+   GstElement             *mPipeline;      //!< GStreamer pipeline
+   GstBus                 *mBus;           //!< Message bus
+   GstElement             *mDec;           //!< uridecodebin element
+   GstStaticCaps           mStaticCaps;    //!< Decribes our input capabilities
+
+   GPtrArray              *mScs;           //!< Array of pointers to stream contexts.
+   wxArrayString          *mStreamInfo;    //!< Array of stream descriptions. Length is the same as mScs
+
+   wxString                mName;          //!< Source name
+
+   Track                ***mOutTracks;     //!< Tracks to be passed back to Audacity
+   int                    *mOutNumTracks;  //!< Number of tracks to be passed back to Audacity
+   Tags                    mTags;          //!< Tags to be passed back to Audacity
+};
+
+void GetGStreamerImportPlugin(ImportPluginList *importPluginList,
+                           UnusableImportPluginList *unusableImportPluginList)
+{
+   importPluginList->Append(new GStreamerImportPlugin);
+}
+
+wxString GStreamerImportPlugin::GetPluginFormatDescription()
+{
+   return DESC;
+}
+
+ImportFileHandle *GStreamerImportPlugin::Open(wxString filename)
+{
+   if (!GStreamerInst || !GStreamerInst->Loaded())
+      return NULL;
+
+   GStreamerImportFileHandle *handle = new GStreamerImportFileHandle(filename);
+
+   // Open the file for import  
+   bool success = handle->Init(false);
+   if (!success) {
+      delete handle;
+      return NULL;
+   }
+
+   return handle;
+}
+
+GStreamerImportFileHandle::GStreamerImportFileHandle(const wxString & name)
+:  ImportFileHandle(name)
+{
+
+   mStreamInfo = new wxArrayString();
+   mName = name;
+
+   mPipeline = mDec = NULL;
+   mScs = g_ptr_array_new();
+
+   memset(&mStaticCaps,0,sizeof(mStaticCaps));
+   mStaticCaps.string = (               // We are guaranteed to get audio in following format:
+        "audio/x-raw-int, "             // Audaciy can handle floats too, but ints should be ok.
+        "signed = (boolean) { TRUE }, " // I don't think that Audacity supports unsigned ints.
+        "width = (int) { 16, 32 }, "    // 2- (for 16-bit depth) or 4-byte (for 24-bit depth) alignment.
+        "depth = (int) { 16, 24 }, "    // 16- and 24-bit depth. 32-bit ints are not supported.
+        "rate = (int) [ 1, MAX ], "     // AFAIK Audacity supports any sample rate.
+        "channels = (int) [ 1, MAX ], " // Same here - Audacity supports any number of channel.
+        "endianness = (int) BYTE_ORDER" // I think 'BYTE_ORDER' means 'native'. Right?
+        );
+}
+
+GStreamerImportFileHandle::~GStreamerImportFileHandle()
+{
+   delete mStreamInfo;
+   if (mBus != NULL)
+     gst_object_unref(mBus);
+   while (mScs->len > 0)
+     DeleteStream(0);
+   g_ptr_array_free(mScs,TRUE);
+   if (mPipeline != NULL)
+   {
+      gst_object_unref(GST_OBJECT(mPipeline));
+   }
+}
+
+// Transforms a taglist to a string
+void ConvertTagsToString(const GstTagList *list, const gchar *tag, gpointer user_data)
+{
+   GString *gstring = (GString*)user_data;
+   guint valuecount = gst_tag_list_get_tag_size(list, tag);
+   const gchar *strvalue = NULL;
+   GValue value = {0};
+
+   // Get a GValue of the tag
+   if (gst_tag_list_copy_value(&value, list, tag))
+   {
+     GType valtype = G_VALUE_TYPE(&value);
+     const gchar *gtypename = g_type_name(valtype);
+
+     GValue value_str = {0};
+     // Transform it to string GValue
+     g_value_init(&value_str, G_TYPE_STRING);
+     if (g_value_transform(&value, &value_str))
+     {
+        // Get the string representation
+        strvalue = g_value_get_string(&value_str);
+        if (strvalue)
+           g_string_append_printf(gstring, "%s[%s] ", tag, strvalue, NULL);
+     }
+   }
+}
+
+void GStreamerWriteTags(const GstTagList *list, const gchar *tag, gpointer user_data)
+{
+   GStreamerImportFileHandle *handle = (GStreamerImportFileHandle*)user_data;
+   handle->WriteTags(list, tag);
+}
+
+// Writes tags to mTags member
+void GStreamerImportFileHandle::WriteTags(const GstTagList *list, const gchar *tag)
+{
+   guint valuecount = gst_tag_list_get_tag_size(list, tag);
+   const gchar *strvalue = NULL;
+
+   GValue value = {0};
+
+   if (gst_tag_list_copy_value(&value, list, tag))
+   {
+      GValue value_str = {0};
+      g_value_init(&value_str, G_TYPE_STRING);
+      if (g_value_transform(&value, &value_str))
+      {
+         strvalue = g_value_get_string(&value_str);
+         if (strvalue)
+         {
+            wxString wxstrvalue = wxString::FromUTF8(strvalue);
+            if (g_utf8_collate(tag, GST_TAG_TITLE) == 0)
+               mTags.SetTag(TAG_TITLE, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_ARTIST) == 0)
+               mTags.SetTag(TAG_ARTIST, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_ALBUM) == 0)
+               mTags.SetTag(TAG_ALBUM, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_TRACK_NUMBER) == 0)
+               mTags.SetTag(TAG_TRACK, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_DATE) == 0)
+               mTags.SetTag(TAG_YEAR, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_GENRE) == 0)
+               mTags.SetTag(TAG_GENRE, wxstrvalue);
+            else if (g_utf8_collate(tag, GST_TAG_COMMENT) == 0)
+               mTags.SetTag(TAG_COMMENTS, wxstrvalue);
+         }
+      }
+   }
+}
+
+// Message handling
+gboolean GStreamerImportFileHandle::OnBusMessage(GstBus *bus, GstMessage *message)
+{
+   if (message != NULL && message->src != NULL)
+   {
+      gchar *objname = gst_object_get_name(message->src);
+      if (objname != NULL)
+      {
+        wxLogMessage(wxT("GStreamer: Got message %s from object %s"), wxString::FromUTF8(GST_MESSAGE_TYPE_NAME(message)).c_str() ,wxString::FromUTF8(objname).c_str());
+      }
+      g_free(objname);
+   }
+   else
+     if (message)
+        wxLogMessage(wxT("GStreamer: Got message %s"), wxString::FromUTF8(GST_MESSAGE_TYPE_NAME(message)).c_str());
+
+   GError *err;
+   gchar *debug;
+   GstTagList *storedTaglist;
+
+   switch (GST_MESSAGE_TYPE(message))
+   {
+   case GST_MESSAGE_ERROR:
+      gst_message_parse_error(message, &err, &debug);
+      wxLogMessage(wxT("GStreamer Error: %s - %s"), wxString::FromUTF8(err->message).c_str(), wxString::FromUTF8(debug).c_str());
+      g_error_free(err);
+      g_free(debug);
+      return FALSE;
+      break;
+   case GST_MESSAGE_WARNING:
+      gst_message_parse_warning(message, &err, &debug);
+      wxLogMessage(wxT("GStreamer Warning: %s - %s"), wxString::FromUTF8(err->message).c_str(), wxString::FromUTF8(debug).c_str());
+      g_error_free(err);
+      g_free(debug);
+      break;
+   case GST_MESSAGE_INFO:
+      gst_message_parse_info(message, &err, &debug);
+      wxLogMessage(wxT("GStreamer Info: %s - %s"), wxString::FromUTF8(err->message).c_str(), wxString::FromUTF8(debug).c_str());
+      g_error_free(err);
+      g_free(debug);
+      break;
+   case GST_MESSAGE_STATE_CHANGED:
+      GstState oldstate, newstate, pending;
+      gst_message_parse_state_changed(message, &oldstate, &newstate, &pending);
+      wxLogMessage(wxT("GStreamer State: %d -> %d ... %d"), oldstate, newstate, pending);
+      break;
+   case GST_MESSAGE_ASYNC_DONE:
+      wxLogMessage(wxT("GStreamer: Asynchronous state change is done"));
+      return FALSE;
+      break;
+   case GST_MESSAGE_EOS:
+      wxLogMessage(wxT("GStreamer: End of the source stream"));
+      gst_element_set_state(mPipeline, GST_STATE_NULL);
+      return FALSE;
+      break;
+   case GST_MESSAGE_TAG:
+      GstTagList *tags;
+      tags = NULL;
+      gst_message_parse_tag(message, &tags);
+      storedTaglist = (GstTagList*)g_object_get_data(G_OBJECT(message->src), "Audacity::StoredTagList");
+      if (storedTaglist)
+      {
+         gst_tag_list_insert(storedTaglist, tags, GST_TAG_MERGE_APPEND);
+      }
+      gst_tag_list_foreach(tags, GStreamerWriteTags, (gpointer)this);
+      break;
+   default:
+      /* unhandled message */
+      break;
+   }
+ 
+  /* we want to be notified again the next time there is a message
+    * on the bus, so returning TRUE (FALSE means we want to stop watching
+    * for messages on the bus and our callback should not be called again)
+    */
+   return TRUE;
+}
+
+gboolean GStreamerBusCallback(GstBus *bus, GstMessage *message, gpointer data)
+{
+   GStreamerImportFileHandle *handle = (GStreamerImportFileHandle*)data;
+   return handle->OnBusMessage(bus, message);
+}
+
+void GStreamerUnknownStreamCallback(GstElement *uridecodebin, GstPad *pad, GstCaps *caps, gpointer data)
+{
+   GStreamerImportFileHandle *handle = (GStreamerImportFileHandle*)data;
+   handle->OnUnknownStream(uridecodebin, pad, caps);
+}
+
+// Event handler for audioconv'es sink pads, reroutes tags to to the message bus
+gboolean GStreamerConvEventCallback(GstPad *pad, GstEvent *event)
+{
+   gboolean ret;
+   GstTagList *taglist;
+   GstObject *element = gst_pad_get_parent(pad);
+
+   switch (GST_EVENT_TYPE (event)) {
+     case GST_EVENT_TAG:
+       gst_event_parse_tag (event, &taglist);
+       gst_element_post_message (GST_ELEMENT(element), gst_message_new_tag (element, gst_tag_list_copy(taglist)));
+       break;
+   }
+   gst_object_unref(element);
+   return gst_pad_event_default (pad, event);
+}
+
+// Called when there is going to be no more pads, i.e. demuxer found and autoplugged all streams
+void GStreamerNoMorePadsCallback(GstElement *gstelement, gpointer data)
+{
+   GStreamerImportFileHandle *handle = (GStreamerImportFileHandle*)data;
+ 
+   gpointer itdata;
+   gboolean done;
+   GstIterator *it;
+
+   it = gst_element_iterate_src_pads(gstelement);
+   done = FALSE;
+
+   while (!done) {
+     switch (gst_iterator_next (it, &itdata)) {
+       case GST_ITERATOR_OK:
+         handle->OnNewStream(gstelement, GST_PAD(itdata));
+         gst_object_unref (itdata);
+         break;
+       case GST_ITERATOR_RESYNC:
+         // Rollback changes to items
+         gst_iterator_resync (it);
+         break;
+       case GST_ITERATOR_ERROR:
+         // Wrong parameter were given
+         done = TRUE;
+         break;
+       case GST_ITERATOR_DONE:
+         done = TRUE;
+         break;
+     }
+   }
+
+   gst_iterator_free(it);
+}
+
+// This "gint" is really GstAutoplugSelectResult enum, but we may not have gstplay-enum.h, so just use gint
+gint GStreamerAutoplugSelectCallback(GstElement *element, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data)
+{
+   // Check factory class
+   const gchar *fclass = gst_element_factory_get_klass(factory);
+   gboolean quit = FALSE;
+   // Skip video decoding
+   if (g_strrstr(fclass,"Video"))
+      return 2;
+   return 0;
+}
+
+// Called for each new stream
+void GStreamerImportFileHandle::OnNewStream(GstElement *uridecodebin, GstPad *pad)
+{
+   GstCaps *caps;
+   GstStructure *str;
+   gboolean quit;
+   const gchar *name;
+
+   caps = gst_pad_get_caps(pad);
+   str = gst_caps_get_structure(caps, 0);
+
+   // Check stream type
+   name = gst_structure_get_name(str);
+   // Only accept audio streams
+   quit = FALSE;
+   if (!g_strrstr(name, "audio"))
+   {
+      quit = TRUE;
+   }
+   gst_caps_unref (caps);
+   if (quit)
+     return;
+
+   // Create unique name
+   gchar *mAConvName = g_strdup_printf("aconv-%d",mScs->len);
+   // Create an audioconv   
+   GstElement *mConv = gst_element_factory_make("audioconvert", mAConvName);
+   // Get it's sink pad
+   GstPad *convpad = gst_element_get_static_pad(mConv, "sink");
+   GstTagList *storedTaglist = gst_tag_list_new();
+   g_object_set_data(G_OBJECT(mConv), "Audacity::StoredTagList", (gpointer)storedTaglist);
+
+   gst_pad_set_event_function(convpad, GStreamerConvEventCallback);
+
+   // Add it to the pipeline
+   gst_bin_add(GST_BIN(mPipeline), mConv);
+
+   GstPadLinkReturn ret = gst_pad_link(pad, convpad);
+   gst_object_unref(convpad);
+   if (ret)
+   {
+      // TODO: insert wxLogMessage here
+      g_print("Failed to link uridecodebin to audioconvert - %d\n",ret);
+      g_free(mAConvName);
+      gst_bin_remove(GST_BIN(mPipeline), mConv);
+      gst_object_unref(mConv);
+      return;
+   }
+
+   gchar *mASinkName = g_strdup_printf("asink-%d",mScs->len);
+   GstElement *mSink = gst_element_factory_make("appsink", mASinkName);
+   // Set up sink properties
+   caps = gst_static_caps_get(&mStaticCaps);
+   gst_app_sink_set_caps(GST_APP_SINK(mSink), caps);          //!< NULL by default? (only accept data that matches caps)
+   gst_caps_unref(caps);
+   gst_base_sink_set_sync(GST_BASE_SINK(mSink), FALSE);       //!< TRUE by default (sync to the clock)
+   gst_app_sink_set_drop(GST_APP_SINK(mSink), FALSE);         //!< FALSE by default (don't drop buffers when queue is full)
+   gst_app_sink_set_emit_signals(GST_APP_SINK(mSink), FALSE); //!< FALSE by default (work in blocking mode)
+   //gst_app_sink_set_max_buffers(GST_APP_SINK(mSink), 0);     //!< 0 by default, which means unlimited buffering
+
+   gst_bin_add(GST_BIN(mPipeline), mSink);
+
+   if (!gst_element_link(mConv, mSink))
+   {
+      g_print("Failed to link autioconvert to appsink\n");
+      g_free(mAConvName);
+      gst_bin_remove(GST_BIN(mPipeline), mConv);
+      gst_object_unref(mConv);
+      g_free(mASinkName);
+      gst_bin_remove(GST_BIN(mPipeline), mSink);
+      gst_object_unref(mSink);
+   }
+
+   // Run newly added elements
+   GstStateChangeReturn statechange;
+   statechange = gst_element_set_state(mConv, GST_STATE_PAUSED);
+   statechange = gst_element_set_state(mSink, GST_STATE_PAUSED);
+   
+   // Allocate memory
+   GStreamContext *c = g_new0(GStreamContext,1);
+   c->mAConvName = mAConvName;
+   c->mASinkName = mASinkName;
+   c->mConv = mConv;
+   c->mSink = mSink;
+   // Add new stream context to context array
+   g_ptr_array_add(mScs,c);
+}
+
+// For unknown streams just dump info to the debug log
+void GStreamerImportFileHandle::OnUnknownStream(GstElement *uridecodebin, GstPad *pad, GstCaps *caps)
+{
+   GstStructure *str;
+   str = gst_caps_get_structure(caps, 0);
+   gst_structure_foreach(str, LogStructure, NULL);
+}
+
+// Free memory occupied by the stream and remove it
+void GStreamerImportFileHandle::DeleteStream(guint index)
+{
+   if (index < mScs->len)
+   {
+      GStreamContext *str = (GStreamContext*)g_ptr_array_index(mScs,index);
+      g_free(str->mAConvName);
+      g_free(str->mASinkName);
+      gst_bin_remove(GST_BIN(mPipeline), str->mSink);
+      gst_bin_remove(GST_BIN(mPipeline), str->mConv);
+      gst_object_unref(GST_OBJECT(str->mSink));
+      gst_object_unref(GST_OBJECT(str->mConv));
+      g_ptr_array_remove(mScs,(gpointer)str);
+      g_free(str);
+   }
+}
+
+// Pipeline initialization
+bool GStreamerImportFileHandle::Init(bool nameIsUri)
+{
+   // Create a pipeline
+   mPipeline = gst_pipeline_new("pipeline");
+   // Get it's bus an add a message watch to it
+   mBus = gst_pipeline_get_bus(GST_PIPELINE(mPipeline));   
+
+   // Set up source location
+   gchar *name_utf8 = g_strdup(mName.ToUTF8());
+   gchar *name_with_proto_utf8;
+   if (!nameIsUri)
+      name_with_proto_utf8 = g_strdup_printf("file:///%s",name_utf8);
+   
+   // FIXME: it is possible that g_filename_from_utf8 should be used to convert uri to filesystem encoding
+/*
+   GError *err = NULL;
+   gchar *name_filesystem = g_filename_from_utf8(name_with_proto_utf8, -1, NULL, NULL, &err);
+   g_free(name_with_proto_utf8);
+   if (err != NULL)
+   {
+      return false;
+   }
+*/
+   
+   // Create uridecodebin and set up signal handlers
+   mDec = gst_element_factory_make("uridecodebin", "decoder");
+   g_object_set_data(G_OBJECT(mDec), "Audacity.Object", (gpointer)this);
+   g_signal_connect(mDec, "no-more-pads", G_CALLBACK(GStreamerNoMorePadsCallback), (gpointer)this);
+   g_signal_connect(mDec, "unknown-type", G_CALLBACK(GStreamerUnknownStreamCallback), (gpointer)this);
+   g_signal_connect(mDec, "autoplug-select", G_CALLBACK(GStreamerAutoplugSelectCallback), (gpointer)this);
+   
+   if (!nameIsUri)
+   {
+      g_object_set(G_OBJECT(mDec), "uri", name_with_proto_utf8, NULL);
+      g_free(name_with_proto_utf8);
+   }
+   else
+      g_object_set(G_OBJECT(mDec), "uri", name_utf8, NULL);
+
+   g_free(name_utf8);
+
+   // Add everything into the pipeline
+   gst_bin_add_many(GST_BIN(mPipeline), mDec, NULL);
+
+   // Run the pipeline
+   GstStateChangeReturn statechange = gst_element_set_state(mPipeline, GST_STATE_PAUSED);
+
+   while (TRUE)
+   {
+      GstMessage *msg = gst_bus_pop(mBus);
+      if (msg)
+      {
+        if (!OnBusMessage(mBus,msg))
+          break;
+      }
+   }
+
+   // Make streaminfo strings for stream selector
+   for (gint i = 0; i < mScs->len; i++)
+   {
+      wxString sinfo;
+      GString *gstring_tags, *gstring_caps;
+      GstTagList *storedTaglist;
+
+      GstPad *convpad;
+      GstCaps *ncaps;
+      GstStructure *str;
+
+      gstring_tags = g_string_new(NULL);
+      gstring_caps = g_string_new(NULL);
+
+      GStreamContext *c = (GStreamContext*) g_ptr_array_index(mScs, i);
+      // Retrieve the taglist for that pad
+      storedTaglist = (GstTagList *)g_object_get_data(G_OBJECT(c->mConv), "Audacity::StoredTagList");
+      // Remove it from the pad so it won't accumulate tags anymore
+      g_object_set_data(G_OBJECT(c->mConv), "Audacity::StoredTagList", NULL);
+
+      // Convert taglist to string
+      gst_tag_list_foreach(storedTaglist,ConvertTagsToString, (gpointer)gstring_tags);
+      
+      // Get negotiated caps
+      convpad = gst_element_get_static_pad(c->mConv, "sink");
+      ncaps = gst_pad_get_negotiated_caps(convpad);
+      str = gst_caps_get_structure(ncaps, 0);
+
+      // Convert it to gstring
+      gst_structure_foreach(str, LogStructure, (gpointer)gstring_caps);
+      
+      sinfo.Printf(wxT("%s negotiated as: %s"), wxString::FromUTF8(gstring_tags->str).c_str(), wxString::FromUTF8(gstring_caps->str).c_str());
+      mStreamInfo->Add(sinfo);
+      
+      gst_caps_unref(ncaps);
+      gst_object_unref(convpad);
+      gst_object_unref(storedTaglist);
+      g_string_free(gstring_tags, TRUE);
+      g_string_free(gstring_caps, TRUE);
+   }
+
+   return true;
+}
+
+wxString GStreamerImportFileHandle::GetFileDescription()
+{
+   return DESC;
+}
+
+int GStreamerImportFileHandle::GetFileUncompressedBytes()
+{
+   // TODO: Get Uncompressed byte count. Is it possible for GStreamer?
+   return 0;
+}
+
+int GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
+              Track ***outTracks,
+              int *outNumTracks,
+              Tags *tags)
+{
+   CreateProgress();
+
+   mOutTracks = outTracks;
+   mOutNumTracks = outNumTracks;
+/*
+   // Dumps pipeline to file. At the moment it's for debugging only.
+   FILE *f = fopen("gstreamer.import.pipeline.xml", "wb");
+
+   xmlDocPtr cur = gst_xml_write (mPipeline);
+   int memsize;
+   xmlChar *mem;
+   xmlDocDumpMemory (cur, &mem, &memsize);
+   fwrite(mem,1,memsize,f);
+
+   fclose(f);
+*/
+/*   
+   for (guint i = 0; i < mScs->len; i++)
+   {
+     GStreamContext *sc = (GStreamContext *)g_ptr_array_index(mScs, i);
+     if (!sc->mUse)
+     {
+       DeleteStream(i);
+       i--;
+     }
+   }
+*/
+   // For each stream
+   for (guint i = 0; i < mScs->len; i++)
+   {
+      GStreamContext *sc = (GStreamContext *)g_ptr_array_index(mScs, i);
+      // For used streams - get actual stream caps
+      if (sc->mUse)
+      {
+         GstPad *pad = gst_element_get_static_pad(sc->mSink,"sink");
+         if (pad != NULL)
+         {
+            GstCaps *caps = gst_pad_get_negotiated_caps(pad);
+            if (caps != NULL)
+            {
+               gint capcount = gst_caps_get_size(caps);
+               GstStructure *str = gst_caps_get_structure(caps, 0);
+               gint channels = -1;
+               gst_structure_get_int(str, "channels", &channels);
+               gint rate = 0;
+               gst_structure_get_int(str, "rate", &rate);
+               sc->mNumChannels = channels;
+               sc->mSampleRate = (double)rate;
+               gst_structure_get_int(str, "width", &sc->mWidth);
+               gst_structure_get_int(str, "depth", &sc->mDepth);
+               gst_caps_unref(caps);
+               if (channels <= 0) sc->mUse = false;
+            }
+            gst_object_unref(pad);
+         }
+         else sc->mUse = false;
+      }
+      // For used streams that got negotiated properly - allocate stuff
+      if (sc->mUse)
+      {
+         sc->mChannels = new WaveTrack *[sc->mNumChannels];
+         
+         sampleFormat sfmt = int16Sample;
+         switch(sc->mDepth)
+         {
+         case 16:
+           sfmt = int16Sample;
+           break;
+         case 24:
+           sfmt = int24Sample;
+           break;
+         default:
+           ;// TODO: Error? We do not support 32-bit int samples, do we?
+         }
+
+         for (int ch = 0; ch < sc->mNumChannels; ch++)
+         {
+            sc->mChannels[ch] = trackFactory->NewWaveTrack(sfmt, sc->mSampleRate);
+            if (sc->mNumChannels == 2)
+            {
+               switch (ch)
+               {
+               case 0:
+                  sc->mChannels[ch]->SetChannel(Track::LeftChannel);
+                  sc->mChannels[ch]->SetLinked(true);
+                  break;
+               case 1:
+                  sc->mChannels[ch]->SetChannel(Track::RightChannel);
+                  sc->mChannels[ch]->SetTeamed(true);
+                  break;
+               }
+            }
+            else
+            {
+               sc->mChannels[ch]->SetChannel(Track::MonoChannel);
+            }
+         }
+      }
+      // I'm not sure this is going to work with queue limit set to zero...
+      else
+      {
+        gst_app_sink_set_drop(GST_APP_SINK(sc->mSink), true);
+      }
+   }
+
+   // The result of Import() to be returend. It will be something other than zero if user canceled or some error appears.
+   int res = eProgressSuccess;
+
+   // Run the pipeline
+   GstStateChangeReturn statechange = gst_element_set_state(mPipeline, GST_STATE_PLAYING);
+   if (statechange == GST_STATE_CHANGE_FAILURE)
+      res = eProgressFailed;
+
+   
+   
+   
+   // This is the heart of the importing process
+   gboolean doIt = TRUE;
+   while (doIt && res == eProgressSuccess)
+   {
+      doIt = FALSE;
+      // Keep an eye on any messages we could have
+      ProcessMessages();
+
+      guint sinkToPull = 0;
+      GstClockTime lowestTime = -1;
+      GstFormat fmt = GST_FORMAT_TIME;
+      // Find a sink with lowest last timestamp (the one that lags behind the most)
+      for (guint i = 0; i < mScs->len; i++)
+      {
+         GStreamContext *c = (GStreamContext *)g_ptr_array_index(mScs, i);
+         if (c->mUse)
+         {
+            if (c->mLastTime < lowestTime || lowestTime < 0)
+            {
+              sinkToPull = i;
+              lowestTime = c->mLastTime;
+            }
+         }
+      }
+      // Pull the data from that sink
+      GStreamContext *c = (GStreamContext *)g_ptr_array_index(mScs, sinkToPull);
+      GstBuffer *incbuf = gst_app_sink_pull_buffer(GST_APP_SINK(c->mSink));
+      if (incbuf)
+      {
+        c->mLastTime = GST_BUFFER_TIMESTAMP(incbuf);
+        doIt = TRUE;
+        res = WriteData(c, incbuf);
+        gst_buffer_unref(incbuf);
+      }
+   }
+
+   // Something bad happened - destroy everything!
+   if (res == eProgressFailed || res == eProgressCancelled)
+   {
+      for (guint s = 0; s < mScs->len; s++)
+      {
+         GStreamContext *c = (GStreamContext *)g_ptr_array_index(mScs, s);
+         delete[] c->mChannels;
+      }
+
+      return res;
+   }
+
+   *outNumTracks = 0;
+   for (guint s = 0; s < mScs->len; s++)
+   {
+      GStreamContext *c = (GStreamContext*)g_ptr_array_index(mScs,s);
+      if (c->mUse)
+        *outNumTracks += c->mNumChannels;
+   }
+
+   // Create new tracks
+   *outTracks = new Track *[*outNumTracks];
+
+   // Copy audio from mChannels to newly created tracks (destroying mChannels elements in process)
+   int trackindex = 0;
+   for (guint s = 0; s < mScs->len; s++)
+   {
+      GStreamContext *c = (GStreamContext*)g_ptr_array_index(mScs,s);
+      if (c->mUse)
+      {
+         for(int ch = 0; ch < c->mNumChannels; ch++)
+         {
+            c->mChannels[ch]->Flush();
+            (*outTracks)[trackindex++] = c->mChannels[ch];
+         }
+         delete[] c->mChannels;
+         c->mChannels = NULL;
+         c->mUse = false;
+      }
+   }
+
+   // Pray that copycon works correctly
+   *tags = mTags;
+
+   return eProgressSuccess;
+}
+
+int GStreamerImportFileHandle::WriteData(GStreamContext *sc,GstBuffer *buffer)
+{
+   size_t pos = 0;
+
+   int updateResult = eProgressSuccess;
+
+   gpointer data = GST_BUFFER_DATA(buffer);
+   guint length = GST_BUFFER_SIZE(buffer);
+   
+   // Allocate the buffer to store audio.
+   int nChannels = sc->mNumChannels;
+   int16_t **tmp16 = NULL;
+   int32_t **tmp32 = NULL;
+   // For 16-bit samples use 16-bit output buffer
+   if (sc->mWidth == 16)
+   {
+      tmp16 = (int16_t**)malloc(sizeof(int16_t*)*nChannels);
+      for (int chn = 0; chn < nChannels; chn++)
+      {
+         tmp16[chn] = (int16_t*)malloc(sizeof(int16_t) * length/sizeof(int16_t)/nChannels);
+      }
+   }
+   // For 24- and 32-bit samples use 32-bit output buffer
+   else if (sc->mWidth == 24 || sc->mWidth == 32)
+   {
+      tmp32 = (int32_t**)malloc(sizeof(int32_t*)*nChannels);
+      for (int chn = 0; chn < nChannels; chn++)
+      {
+         tmp32[chn] = (int32_t*)malloc(sizeof(int32_t) * length/sizeof(int32_t)/nChannels);
+      }      
+   }
+
+   // Separate the channels
+   int16_t *int16_data = NULL;
+   int32_t *int32_data = NULL;
+   int index = 0;
+   // Samples may be 16-, 24- or 32-bit, but input buffer's width is independant
+   // I'm assuming that we'll never get width=16 and depth=24 or 32, that's impossible
+   // Or width=32 and depth=16, that's stupid
+   if (sc->mWidth == 16)
+   {
+      int16_data = (int16_t*)data;
+      for (pos = 0; pos < length/sizeof(int16_t);)
+      {
+         for (int chn = 0; chn < nChannels; chn++)
+         {
+            tmp16[chn][index] = int16_data[pos];
+            pos++;
+         }
+         index++;
+      }
+   }
+   else if (sc->mWidth == 24 || sc->mWidth == 32)
+   {
+      int32_data = (int32_t*)data;
+      for (pos = 0; pos < length/sizeof(int32_t);)
+      {
+         for (int chn = 0; chn < nChannels; chn++)
+         {
+            tmp32[chn][index] = int32_data[pos];
+            pos++;
+         }
+         index++;
+      }
+   }
+
+   // Write audio into WaveTracks
+   if (sc->mDepth == 16)
+   {
+      for (int chn = 0; chn < nChannels; chn++)
+      {
+         sc->mChannels[chn]->Append((samplePtr)tmp16[chn],int16Sample,index);
+         free(tmp16[chn]);
+      }
+      free(tmp16);
+   }
+   else if (sc->mDepth == 24 || sc->mDepth == 32)
+   {
+      for (int chn = 0; chn < nChannels; chn++)
+      {
+         sc->mChannels[chn]->Append((samplePtr)tmp32[chn],int24Sample,index);
+         free(tmp32[chn]);
+      }
+      free(tmp32);
+   }
+   
+   // Try to update the progress indicator (and see if user wants to stop or cancel)
+   GstFormat fmt = GST_FORMAT_TIME;
+   gint64 tpos, tlen;
+   if (gst_element_query_position (mPipeline, &fmt, &tpos) &&
+       gst_element_query_duration (mPipeline, &fmt, &tlen) )
+   {
+      updateResult = mProgress->Update((wxLongLong)tpos, (wxLongLong)tlen);
+      if (((gdouble)tpos/tlen) >= 0.98103365830952650)
+      {
+        if (tpos > 0)
+          tpos = 0;
+      }
+      if (updateResult != 1)
+      {
+         if (updateResult == 0)
+         {
+           updateResult = eProgressCancelled;
+         }
+         else
+           updateResult = eProgressStopped;
+         GstStateChangeReturn statechange = gst_element_set_state(mPipeline, GST_STATE_NULL);
+      }
+      else
+        updateResult = eProgressSuccess;
+   }
+   
+   return updateResult;
+}
+
+#endif //USE_GSTREAMER
diff --git a/src/import/ImportGStreamer.h b/src/import/ImportGStreamer.h
new file mode 100644
index 0000000..335bdfc
--- /dev/null
+++ b/src/import/ImportGStreamer.h
@@ -0,0 +1,22 @@
+/**********************************************************************
+
+Audacity: A Digital Audio Editor
+
+ImportGStreamer.h
+
+LRN
+
+**********************************************************************/
+
+#ifndef __AUDACITY_IMPORT_GSTREAMER__
+#define __AUDACITY_IMPORT_GSTREAMER__
+
+#include "ImportPlugin.h"
+
+class ImportPluginList;
+class UnusableImportPluginList;
+
+void GetGStreamerImportPlugin(ImportPluginList *importPluginList,
+                           UnusableImportPluginList *unusableImportPluginList);
+
+#endif
diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp
new file mode 100644
index 0000000..f768d32
--- /dev/null
+++ b/src/prefs/DevicePrefs.cpp
@@ -0,0 +1,324 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  DevicePrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class DevicePrefs
+\brief A PrefsPanel used to select recording and playback devices and
+other settings.
+
+  Presents interface for user to select the recording device and
+  playback device, from the list of choices that PortAudio
+  makes available.
+
+  Also lets user decide how many channels to record.
+
+*//********************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+
+#include <wx/choice.h>
+#include <wx/intl.h>
+
+#include "portaudio.h"
+
+#include "../AudioIO.h"
+#include "../Internat.h"
+#include "../Prefs.h"
+#include "../ShuttleGui.h"
+
+#include "DevicePrefs.h"
+
+enum {
+   HostID = 10000,
+   PlayID,
+   RecordID,
+   ChannelsID
+};
+
+BEGIN_EVENT_TABLE(DevicePrefs, PrefsPanel)
+   EVT_CHOICE(HostID, DevicePrefs::OnHost)
+   EVT_CHOICE(RecordID, DevicePrefs::OnDevice)
+END_EVENT_TABLE()
+
+DevicePrefs::DevicePrefs(wxWindow * parent)
+:  PrefsPanel(parent, _("Devices"))
+{
+   Populate();
+}
+
+DevicePrefs::~DevicePrefs()
+{
+}
+
+void DevicePrefs::Populate()
+{
+   // First any pre-processing for constructing the GUI.
+   GetNamesAndLabels();
+
+   // Get current setting for devices
+   mPlayDevice = gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), wxT(""));
+   mRecordDevice = gPrefs->Read(wxT("/AudioIO/RecordingDevice"), wxT(""));
+   mRecordChannels = gPrefs->Read(wxT("/AudioIO/RecordChannels"), 2L);
+
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+
+   wxCommandEvent e;
+   OnHost(e);
+}
+
+void DevicePrefs::GetNamesAndLabels()
+{
+   // Gather list of hosts.  Only added hosts that have devices attached.
+   int nDevices = Pa_GetDeviceCount();
+   for (int i = 0; i < nDevices; i++) {
+      const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
+      if (info->maxOutputChannels > 0 || info->maxInputChannels > 0) {
+         wxString name(Pa_GetHostApiInfo(info->hostApi)->name, wxConvLocal);
+         if (mHostNames.Index(name) == wxNOT_FOUND) {
+            mHostNames.Add(name);
+            mHostLabels.Add(name);
+         }
+      }
+   }
+}
+
+void DevicePrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   wxArrayString empty;
+
+   S.SetBorder(2);
+
+   S.StartStatic(_("Interface"));
+   {
+      S.StartMultiColumn(2);
+      {
+         S.Id(HostID);
+         mHost = S.TieChoice(_("Host") + wxString(wxT(":")),
+                             wxT("/AudioIO/Host"), 
+                             wxT(""),
+                             mHostNames,
+                             mHostLabels);
+         S.SetSizeHints(mHostNames);
+
+         S.AddPrompt(_("Using:"));
+         S.AddFixedText(wxString(Pa_GetVersionText(), wxConvLocal));
+      }
+      S.EndMultiColumn();
+   }                              
+   S.EndStatic();
+
+   S.StartStatic(_("Playback"));
+   {
+      S.StartMultiColumn(2);
+      {
+         S.Id(PlayID);
+         mPlay = S.AddChoice(_("Device") + wxString(wxT(":")),
+                             wxEmptyString,
+                             &empty);
+      }
+      S.EndMultiColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Recording"));
+   {
+      S.StartMultiColumn(2);
+      {
+         S.Id(RecordID);
+         mRecord = S.AddChoice(_("Device") + wxString(wxT(":")),
+                               wxEmptyString,
+                               &empty);
+
+         S.Id(ChannelsID);
+         mChannels = S.AddChoice(_("Channels") + wxString(wxT(":")),
+                                 wxEmptyString,
+                                 &empty);
+      }
+      S.EndMultiColumn();
+   }
+   S.EndStatic();
+}
+
+void DevicePrefs::OnHost(wxCommandEvent & e)
+{
+   int index = mHost->GetCurrentSelection();
+   int nDevices = Pa_GetDeviceCount();
+
+   if (nDevices == 0) {
+      mHost->Clear();
+      mHost->Append(_("No audio interfaces"), (void *) NULL);
+      mHost->SetSelection(0);
+   }
+
+   mPlay->Clear();
+   mRecord->Clear();
+
+   wxArrayString playnames;
+   wxArrayString recordnames;
+
+   for (int i = 0; i < nDevices; i++) {
+      const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
+      if (info->hostApi == index) {
+         wxString name(info->name, wxConvLocal);
+         wxString device = DeviceName(info);
+         int index;
+
+         if (info->maxOutputChannels > 0) {
+            playnames.Add(name);
+            index = mPlay->Append(name, (void *) info);
+            if (device == mPlayDevice) {
+               mPlay->SetSelection(index);
+            }
+         }
+
+         if (info->maxInputChannels > 0) {
+            recordnames.Add(name);
+            index = mRecord->Append(name, (void *) info);
+            if (device == mRecordDevice) {
+               mRecord->SetSelection(index);
+            }
+         }
+      }
+   }
+
+   if (mPlay->GetCount() == 0) {
+      playnames.Add(_("No devices found"));
+      mPlay->Append(playnames[0], (void *) NULL);
+   }
+
+   if (mRecord->GetCount() == 0) {
+      recordnames.Add(_("No devices found"));
+      mRecord->Append(recordnames[0], (void *) NULL);
+   }
+
+   if (mPlay->GetCount() && mPlay->GetSelection() == wxNOT_FOUND) {
+      mPlay->SetSelection(0);
+   }
+
+   if (mRecord->GetCount() && mRecord->GetSelection() == wxNOT_FOUND) {
+      mRecord->SetSelection(0);
+   }
+
+   ShuttleGui S(this, eIsCreating);
+   S.SetSizeHints(mPlay, playnames);
+   S.SetSizeHints(mRecord, recordnames);
+   OnDevice(e);
+}
+
+void DevicePrefs::OnDevice(wxCommandEvent & e)
+{
+   int ndx = mRecord->GetCurrentSelection();
+   if (ndx == wxNOT_FOUND) {
+      ndx = 0;
+   }
+
+   int sel = mChannels->GetSelection();
+   int cnt = 0;
+
+   const PaDeviceInfo *info = (const PaDeviceInfo *) mRecord->GetClientData(ndx);
+   if (info != NULL) {
+      cnt = info->maxInputChannels;
+   }
+
+   if (sel != wxNOT_FOUND) {
+      mRecordChannels = sel + 1;
+   }
+
+   mChannels->Clear();
+
+   // Mimic old behavior
+   if (cnt <= 0) {
+      cnt = 16;
+   }
+
+   // Place an artifical limit on the number of channels to prevent an
+   // outrageous number.  I don't know if this is really necessary, but
+   // it doesn't hurt. 
+   if (cnt > 256) {
+      cnt = 256;
+   }
+      
+   wxArrayString channelnames;
+
+   // Channel counts, mono, stereo etc...
+   for (int i = 0; i < cnt; i++) {
+      wxString name;
+
+      if (i == 0) {
+         name = _("1 (Mono)");
+      }
+      else if (i == 1) {
+         name = _("2 (Stereo)");
+      }
+      else {
+         name = wxString::Format(wxT("%d"), i + 1);
+      }
+
+      channelnames.Add(name);
+      int index = mChannels->Append(name);
+      if (i == mRecordChannels - 1) {
+         mChannels->SetSelection(index);
+      }
+   }
+
+   if (mChannels->GetCount() && mChannels->GetCurrentSelection() == wxNOT_FOUND) {
+      mChannels->SetSelection(0);
+   }
+
+   ShuttleGui S(this, eIsCreating);
+   S.SetSizeHints(mChannels, channelnames);
+   Layout();
+}
+
+bool DevicePrefs::Apply()
+{
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);
+
+   const PaDeviceInfo *info;
+
+   info = (const PaDeviceInfo *) mPlay->GetClientData(mPlay->GetSelection());
+   if (info) {
+      gPrefs->Write(wxT("/AudioIO/PlaybackDevice"),
+                    DeviceName(info));
+   }
+
+   info = (const PaDeviceInfo *) mRecord->GetClientData(mRecord->GetSelection());
+   if (info) {
+      gPrefs->Write(wxT("/AudioIO/RecordingDevice"),
+                    DeviceName(info));
+
+      gPrefs->Write(wxT("/AudioIO/RecordChannels"),
+                    mChannels->GetSelection() + 1);
+   }
+
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: d6904b91-a320-4194-8d60-caa9175b6bb4
diff --git a/src/prefs/DevicePrefs.h b/src/prefs/DevicePrefs.h
new file mode 100644
index 0000000..f05229e
--- /dev/null
+++ b/src/prefs/DevicePrefs.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  DevicePrefs.h
+
+  Joshua Haberman
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_DEVICE_PREFS__
+#define __AUDACITY_DEVICE_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/choice.h>
+#include <wx/string.h>
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class DevicePrefs:public PrefsPanel
+{
+ public:
+   DevicePrefs(wxWindow * parent);
+   virtual ~DevicePrefs();
+   virtual bool Apply();
+
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+   void GetNamesAndLabels();
+
+   void OnHost(wxCommandEvent & e);
+   void OnDevice(wxCommandEvent & e);
+
+   wxArrayString mHostNames;
+   wxArrayString mHostLabels;
+
+   wxString mPlayDevice;
+   wxString mRecordDevice;
+   long mRecordChannels;
+
+   wxChoice *mHost;
+   wxChoice *mPlay;
+   wxChoice *mRecord;
+   wxChoice *mChannels;
+
+   DECLARE_EVENT_TABLE();
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: df22b108-e989-4ec4-a8b6-dddbcc7be6a7
diff --git a/src/prefs/ImportExportPrefs.cpp b/src/prefs/ImportExportPrefs.cpp
new file mode 100644
index 0000000..c000ef2
--- /dev/null
+++ b/src/prefs/ImportExportPrefs.cpp
@@ -0,0 +1,107 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  ImportExportPrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class ImportExportPrefs
+\brief A PrefsPanel used to select import and export options.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+
+#include "../Prefs.h"
+#include "../ShuttleGui.h"
+
+#include "ImportExportPrefs.h"
+
+ImportExportPrefs::ImportExportPrefs(wxWindow * parent)
+:   PrefsPanel(parent, _("Import / Export"))
+{
+   Populate();
+}
+
+ImportExportPrefs::~ImportExportPrefs()
+{
+}
+
+/// Creates the dialog and its contents.
+void ImportExportPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void ImportExportPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   S.SetBorder(2);
+
+   S.StartStatic(_("When importing audio files"));
+   {
+      S.StartRadioButtonGroup(wxT("/FileFormats/CopyOrEditUncompressedData"), wxT("edit"));
+      {
+         S.TieRadioButton(_("&Make a copy of uncompressed audio files before editing (safer)"),
+                          wxT("copy"));
+         S.TieRadioButton(_("&Read uncompressed audio files directly from the original (faster)"),
+                          wxT("edit"));
+      }
+      S.EndRadioButtonGroup();
+
+      S.TieCheckBox(_("&Normalize all tracks in project"), 
+                    wxT("/AudioFiles/NormalizeOnLoad"),
+                    false);
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("When exporting tracks to an audio file"));
+   {
+      S.StartRadioButtonGroup(wxT("/FileFormats/ExportDownMix"), true);
+      {
+         S.TieRadioButton(_("A&lways mix all tracks down to Stereo or Mono channel(s)."),
+                          true);
+         S.TieRadioButton(_("&Use custom mix (for example to export a 5.1 multichannel file)"),
+                          false);
+      }
+      S.EndRadioButtonGroup();
+
+      S.TieCheckBox(_("S&how Metadata Editor prior to export step"),
+                    wxT("/AudioFiles/ShowId3Dialog"),
+                    true);
+      S.AddFixedText(_("Note: Export quality options can be chosen by clicking the Options\nbutton in the Export dialog."));
+   }
+   S.EndStatic();
+}
+
+bool ImportExportPrefs::Apply()
+{  
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);    
+   
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 427b9e64-3fc6-40ef-bbf8-e6fff1d442f0
diff --git a/src/prefs/ImportExportPrefs.h b/src/prefs/ImportExportPrefs.h
new file mode 100644
index 0000000..143d387
--- /dev/null
+++ b/src/prefs/ImportExportPrefs.h
@@ -0,0 +1,47 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  ImportExportPrefs.h
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_IMPORT_EXPORT_PREFS__
+#define __AUDACITY_IMPORT_EXPORT_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class ImportExportPrefs:public PrefsPanel
+{
+ public:
+   ImportExportPrefs(wxWindow * parent);
+   ~ImportExportPrefs();
+   virtual bool Apply();
+   
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 300a00cc-0770-45a1-8ab5-88cfb7ae1239
diff --git a/src/prefs/LibraryPrefs.cpp b/src/prefs/LibraryPrefs.cpp
new file mode 100644
index 0000000..72df2e8
--- /dev/null
+++ b/src/prefs/LibraryPrefs.cpp
@@ -0,0 +1,231 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  LibraryPrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class LibraryPrefs
+\brief A PrefsPanel used to select manage external libraries like the
+MP3 and FFmpeg encoding libraries.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+#include <wx/button.h>
+
+#include "../FFmpeg.h"
+#include "../ShuttleGui.h"
+#include "../export/ExportMP3.h"
+#include "../widgets/LinkingHtmlWindow.h"
+
+#include "LibraryPrefs.h"
+
+////////////////////////////////////////////////////////////////////////////////
+
+#define ID_MP3_FIND_BUTTON          7001
+#define ID_MP3_DOWN_BUTTON          7002
+#define ID_FFMPEG_FIND_BUTTON       7003
+#define ID_FFMPEG_DOWN_BUTTON       7004
+
+BEGIN_EVENT_TABLE(LibraryPrefs, PrefsPanel)
+   EVT_BUTTON(ID_MP3_FIND_BUTTON, LibraryPrefs::OnMP3FindButton)
+   EVT_BUTTON(ID_MP3_DOWN_BUTTON, LibraryPrefs::OnMP3DownButton)
+   EVT_BUTTON(ID_FFMPEG_FIND_BUTTON, LibraryPrefs::OnFFmpegFindButton)
+   EVT_BUTTON(ID_FFMPEG_DOWN_BUTTON, LibraryPrefs::OnFFmpegDownButton)
+END_EVENT_TABLE()
+
+LibraryPrefs::LibraryPrefs(wxWindow * parent)
+:   PrefsPanel(parent, _("Libraries"))
+{
+   Populate();
+}
+
+LibraryPrefs::~LibraryPrefs()
+{
+}
+
+/// Creates the dialog and its contents.
+void LibraryPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+
+   // Set the MP3 Version string.
+   SetMP3VersionText();
+   SetFFmpegVersionText();
+}
+
+/// This PopulateOrExchange function is a good example of mixing the fully 
+/// automatic style of reading/writing from GUI to prefs with the partial form.
+/// 
+/// You'll notice that some of the Tie functions have Prefs identifiers in them
+/// and others don't.  
+void LibraryPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   S.SetBorder(2);
+   S.StartStatic(_("MP3 Export Library"));
+   {
+      S.StartTwoColumn();
+      {
+         S.AddVariableText(_("MP3 Library Version:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+         mMP3Version = S.AddVariableText(wxT("9.99"),
+                                         true,
+                                         wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+         S.AddVariableText(_("MP3 Library:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+         S.Id(ID_MP3_FIND_BUTTON).AddButton(_("&Locate..."),
+                                            wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+         S.AddVariableText(_("LAME MP3 Library:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+         S.Id(ID_MP3_DOWN_BUTTON).AddButton(_("&Download"),
+                                            wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+      }
+      S.EndTwoColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("FFmpeg Import/Export Library"));
+   {
+      S.StartTwoColumn();
+      {
+         S.AddVariableText(_("FFmpeg Library Version:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+#if defined(USE_FFMPEG)
+         mFFmpegVersion = S.AddVariableText(_("No compatible FFmpeg library was found"),
+                                            true,
+                                            wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+#else
+         mFFmpegVersion = S.AddVariableText(wxT("FFmpeg support is not compiled in"),
+                                            true,
+                                            wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+#endif
+         S.AddVariableText(_("FFmpeg Library:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+         S.Id(ID_FFMPEG_FIND_BUTTON);
+         wxButton *bfnd = S.AddButton(_("&Locate..."), 
+                                      wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+         S.AddVariableText(_("FFmpeg Library:"),
+                           true,
+                           wxALL | wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL);
+         S.Id(ID_FFMPEG_DOWN_BUTTON);
+         wxButton *bdwn = S.AddButton(_("&Download"),
+                                      wxALL | wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
+#if !defined(USE_FFMPEG)
+         bdwn->Enable(FALSE);
+         bfnd->Enable(FALSE);
+#endif
+      }
+      S.EndTwoColumn();
+   }
+   S.EndStatic();
+}
+
+/// Sets the a text area on the dialog to have the name
+/// of the MP3 Library version.
+void LibraryPrefs::SetMP3VersionText(bool prompt)
+{
+   mMP3Version->SetLabel(GetMP3Version(this, prompt));
+}
+
+/// Opens a file-finder dialog so that the user can
+/// tell us where the MP3 library is.
+void LibraryPrefs::OnMP3FindButton(wxCommandEvent & e)
+{
+   SetMP3VersionText(true);
+}
+
+/// Opens a file-finder dialog so that the user can
+/// tell us where the MP3 library is.
+void LibraryPrefs::OnMP3DownButton(wxCommandEvent & e)
+{
+   wxString url = wxT("http://www.audacityteam.org/manual/index.php?title=FAQ:Installation_and_Plug-Ins%23How_do_I_download_and_install_the_LAME_MP3_encoder.3F");
+   ::OpenInDefaultBrowser(url);
+}
+
+void LibraryPrefs::SetFFmpegVersionText()
+{
+   mFFmpegVersion->SetLabel(GetFFmpegVersion(this));
+}
+
+void LibraryPrefs::OnFFmpegFindButton(wxCommandEvent & e)
+{
+#ifdef USE_FFMPEG
+   FFmpegLibs* FFmpegLibsInst = PickFFmpegLibs();
+   bool showerrs =
+#if defined(__WXDEBUG__)
+      true;
+#else
+      false;
+#endif
+
+   FFmpegLibsInst->FreeLibs();
+   // Load the libs ('true' means that all errors will be shown)
+   bool locate = !LoadFFmpeg(showerrs);
+
+   // Libs are fine, don't show "locate" dialog unless user really wants it
+   if (!locate) {
+      int response = wxMessageBox(wxT("Audacity has automatically detected valid FFmpeg libraries.\
+                                      \nDo you still want to locate them manually?"),
+                                  wxT("Success"),
+                                  wxCENTRE | wxYES_NO | wxNO_DEFAULT |wxICON_QUESTION);
+      if (response == wxYES) {
+        locate = true;
+      }
+   }
+
+   if (locate) {
+      // Show "Locate FFmpeg" dialog
+      FFmpegLibsInst->FindLibs(this);
+      FFmpegLibsInst->FreeLibs();
+      LoadFFmpeg(showerrs);
+   }
+   SetFFmpegVersionText();
+
+   DropFFmpegLibs();
+#endif
+}
+
+void LibraryPrefs::OnFFmpegDownButton(wxCommandEvent & e)
+{
+   wxString url = wxT("http://www.audacityteam.org/manual/index.php?title=FAQ:Installation_and_Plug-Ins%23installffmpeg");
+   ::OpenInDefaultBrowser(url);
+}
+
+bool LibraryPrefs::Apply()
+{  
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);    
+   
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 427b9e64-3fc6-40ef-bbf8-e6fff1d442f0
diff --git a/src/prefs/LibraryPrefs.h b/src/prefs/LibraryPrefs.h
new file mode 100644
index 0000000..be2d633
--- /dev/null
+++ b/src/prefs/LibraryPrefs.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  FileFormatPrefs.h
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_FILE_FORMAT_PREFS__
+#define __AUDACITY_FILE_FORMAT_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/stattext.h>
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class LibraryPrefs:public PrefsPanel 
+{
+ public:
+   LibraryPrefs(wxWindow * parent);
+   ~LibraryPrefs();
+   virtual bool Apply();
+   
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+   void SetMP3VersionText(bool prompt = false);
+	void SetFFmpegVersionText();
+
+   void OnMP3FindButton(wxCommandEvent & e);
+   void OnMP3DownButton(wxCommandEvent & e);
+   void OnFFmpegFindButton(wxCommandEvent & e);
+   void OnFFmpegDownButton(wxCommandEvent & e);
+
+   wxStaticText *mMP3Version;
+   wxStaticText *mFFmpegVersion;
+
+   DECLARE_EVENT_TABLE();
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 300a00cc-0770-45a1-8ab5-88cfb7ae1239
diff --git a/src/prefs/PlaybackPrefs.cpp b/src/prefs/PlaybackPrefs.cpp
new file mode 100644
index 0000000..5384f37
--- /dev/null
+++ b/src/prefs/PlaybackPrefs.cpp
@@ -0,0 +1,135 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  PlaybackPrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class PlaybackPrefs
+\brief A PrefsPanel used to select playback options.
+
+  Presents interface for user to update the various playback options
+  like previewing and seeking.
+
+*//********************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+#include <wx/textctrl.h>
+
+#include "../ShuttleGui.h"
+
+#include "PlaybackPrefs.h"
+
+PlaybackPrefs::PlaybackPrefs(wxWindow * parent)
+:  PrefsPanel(parent, _("Playback"))
+{
+   Populate();
+}
+
+PlaybackPrefs::~PlaybackPrefs()
+{
+}
+
+void PlaybackPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   wxTextCtrl *w;
+
+   S.SetBorder(2);
+
+   S.StartStatic(_("Effects Preview"));
+   {
+      S.StartThreeColumn();
+      {
+         w = S.TieTextBox(_("Length of preview:"),
+                          wxT("/AudioIO/EffectsPreviewLen"),
+                          3.0,
+                          9);
+         S.AddUnits(_("seconds"));
+         w->SetName(w->GetName() + wxT(" ") + _("seconds"));
+      }
+      S.EndThreeColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Cut Preview"));
+   {
+      S.StartThreeColumn();
+      {
+         w = S.TieTextBox(_("Preview before cut region:"),
+                          wxT("/AudioIO/CutPreviewBeforeLen"),
+                          1.0,
+                          9);
+         S.AddUnits(_("seconds"));
+         w->SetName(w->GetName() + wxT(" ") + _("seconds"));
+
+         w = S.TieTextBox(_("Preview after cut region:"),
+                          wxT("/AudioIO/CutPreviewAfterLen"),
+                          1.0,
+                          9);
+         S.AddUnits(_("seconds"));
+         w->SetName(w->GetName() + wxT(" ") + _("seconds"));
+      }
+      S.EndThreeColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Seek Time when playing"));
+   {
+      S.StartThreeColumn();
+      {
+         w = S.TieTextBox(_("Short period:"),
+                          wxT("/AudioIO/SeekShortPeriod"),
+                          1.0,
+                          9);
+         S.AddUnits(_("seconds"));
+         w->SetName(w->GetName() + wxT(" ") + _("seconds"));
+
+         w = S.TieTextBox(_("Long period:"),
+                          wxT("/AudioIO/SeekLongPeriod"),
+                          15.0,
+                          9);
+         S.AddUnits(_("seconds"));
+         w->SetName(w->GetName() + wxT(" ") + _("seconds"));
+      }
+      S.EndThreeColumn();
+   }
+   S.EndStatic();
+}
+
+bool PlaybackPrefs::Apply()
+{
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);
+
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: d6904b91-a320-4194-8d60-caa9175b6bb4
diff --git a/src/prefs/PlaybackPrefs.h b/src/prefs/PlaybackPrefs.h
new file mode 100644
index 0000000..e6d3cfe
--- /dev/null
+++ b/src/prefs/PlaybackPrefs.h
@@ -0,0 +1,46 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  PlaybackPrefs.h
+
+  Joshua Haberman
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_PLAYBACK_PREFS__
+#define __AUDACITY_PLAYBACK_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class PlaybackPrefs:public PrefsPanel
+{
+ public:
+   PlaybackPrefs(wxWindow * parent);
+   virtual ~PlaybackPrefs();
+   virtual bool Apply();
+
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: df22b108-e989-4ec4-a8b6-dddbcc7be6a7
diff --git a/src/prefs/ProjectsPrefs.cpp b/src/prefs/ProjectsPrefs.cpp
new file mode 100644
index 0000000..ad1c384
--- /dev/null
+++ b/src/prefs/ProjectsPrefs.cpp
@@ -0,0 +1,112 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  ProjectsPrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class ProjectsPrefs
+\brief A PrefsPanel used to select options related to Audacity Project
+handling.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+#include <wx/textctrl.h>
+
+#include "../Prefs.h"
+#include "../ShuttleGui.h"
+
+#include "ProjectsPrefs.h"
+
+////////////////////////////////////////////////////////////////////////////////
+
+ProjectsPrefs::ProjectsPrefs(wxWindow * parent)
+:   PrefsPanel(parent, _("Projects"))
+{
+   Populate();
+}
+
+ProjectsPrefs::~ProjectsPrefs()
+{
+}
+
+/// Creates the dialog and its contents.
+void ProjectsPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void ProjectsPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   wxTextCtrl *w;
+
+   S.SetBorder(2);
+
+   S.StartStatic(_("When saving a project that depends on other audio files"));
+   {
+      S.StartRadioButtonGroup(wxT("/FileFormats/SaveProjectWithDependencies"), wxT("ask"));
+      {
+         S.TieRadioButton(_("Always &copy all audio into project (safest)"),
+                          wxT("copy"));
+         S.TieRadioButton(_("&Do not copy any audio"),
+                          wxT("never"));
+         S.TieRadioButton(_("&Ask user"),
+                          wxT("ask"));
+      }
+      S.EndRadioButtonGroup();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Auto save"));
+   {
+      S.TieCheckBox(_("Auto save a copy of the project in a separate folder"),
+                    wxT("/Directories/AutoSaveEnabled"),
+                    true);
+
+      S.StartThreeColumn();
+      {
+         w = S.TieTextBox(_("Auto save interval:"),
+                          wxT("/Directories/AutoSaveMinutes"),
+                          2.0,
+                          9);
+         S.AddUnits(_("minutes"));
+         w->SetName(w->GetName() + wxT(" ") + _("minutes"));
+      }
+      S.EndThreeColumn();
+   }
+   S.EndStatic();
+}
+
+bool ProjectsPrefs::Apply()
+{  
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);    
+   
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 427b9e64-3fc6-40ef-bbf8-e6fff1d442f0
diff --git a/src/prefs/ProjectsPrefs.h b/src/prefs/ProjectsPrefs.h
new file mode 100644
index 0000000..a5f7c5a
--- /dev/null
+++ b/src/prefs/ProjectsPrefs.h
@@ -0,0 +1,47 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  ProjectsPrefs.h
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_PROJECT_PREFS__
+#define __AUDACITY_PROJECT_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class ProjectsPrefs:public PrefsPanel
+{
+ public:
+   ProjectsPrefs(wxWindow * parent);
+   ~ProjectsPrefs();
+   virtual bool Apply();
+   
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 300a00cc-0770-45a1-8ab5-88cfb7ae1239
diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp
new file mode 100644
index 0000000..4c4f3ba
--- /dev/null
+++ b/src/prefs/RecordingPrefs.cpp
@@ -0,0 +1,149 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  RecordingPrefs.cpp
+
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+*******************************************************************//**
+
+\class RecordingPrefs
+\brief A PrefsPanel used to select recording options.
+
+  Presents interface for user to update the various recording options
+  like playthrough, latency correction, and others.
+
+*//********************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+#include <wx/textctrl.h>
+
+#include "../AudioIO.h"
+#include "../Envelope.h"
+#include "../Prefs.h"
+#include "../ShuttleGui.h"
+
+#include "RecordingPrefs.h"
+
+RecordingPrefs::RecordingPrefs(wxWindow * parent)
+:  PrefsPanel(parent, _("Recording"))
+{
+   Populate();
+}
+
+RecordingPrefs::~RecordingPrefs()
+{
+}
+
+void RecordingPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void RecordingPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   wxTextCtrl *w;
+
+   S.SetBorder(2);
+
+   S.StartStatic(_("Playthrough"));
+   {
+      S.TieCheckBox(_("Overdub: &Play other tracks while recording new one"),
+                    wxT("/AudioIO/Duplex"),
+                    true);
+#if defined(__WXMAC__)
+      S.TieCheckBox(_("&Hardware Playthrough: Play new track while recording it"),
+                    wxT("/AudioIO/Playthrough"),
+                    false);
+#endif
+      S.TieCheckBox(_("&Software Playthrough: Play new track while recording or monitoring"),
+                    wxT("/AudioIO/SWPlaythrough"),
+                    false);
+#if !defined(__WXMAC__)
+      S.AddUnits(wxString(wxT("     ")) + _("(uncheck when recording \"stereo mix\")"));
+#endif
+   }
+   S.EndStatic();
+
+   S.StartStatic( _("Latency"));
+   {
+      S.StartThreeColumn();
+      {
+         // only show the following controls if we use Portaudio v19, because
+         // for Portaudio v18 we always use default buffer sizes
+         w = S.TieTextBox(_("Audio to buffer:"),
+                          wxT("/AudioIO/LatencyDuration"),
+                          DEFAULT_LATENCY_DURATION,
+                          9);
+         S.AddUnits(_("milliseconds (higher = more latency)"));
+         w->SetName(w->GetName() + wxT(" ") + _("milliseconds (higher = more latency)"));
+
+         w = S.TieTextBox(_("Latency correction:"),
+                          wxT("/AudioIO/LatencyCorrection"),
+                          DEFAULT_LATENCY_CORRECTION,
+                          9);
+         S.AddUnits(_("milliseconds (negative = backwards)"));
+         w->SetName(w->GetName() + wxT(" ") + _("milliseconds (negative = backwards)"));
+      }
+      S.EndThreeColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Sound Activated Recording"));
+   {
+      S.TieCheckBox(_("Sound Activated Recording"),
+                    wxT("/AudioIO/SoundActivatedRecord"),
+                    false);
+
+      S.StartMultiColumn(2, wxEXPAND);
+      {
+         S.SetStretchyCol(1);
+
+         int dBRange = gPrefs->Read(wxT("/GUI/EnvdBRange"), ENV_DB_RANGE);
+         S.TieSlider(_("Sound Activation Level (dB):"),
+                     wxT("/AudioIO/SilenceLevel"),
+                     -50,
+                     0,
+                     -dBRange);
+      }
+      S.EndMultiColumn();
+   }
+   S.EndStatic();
+}
+
+bool RecordingPrefs::Apply()
+{
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);
+
+   double latencyDuration = DEFAULT_LATENCY_DURATION;
+   gPrefs->Read(wxT("/AudioIO/LatencyDuration"), &latencyDuration);
+   if (latencyDuration < 0) {
+      gPrefs->Write(wxT("/AudioIO/LatencyDuration"), DEFAULT_LATENCY_DURATION);
+   }
+
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: d6904b91-a320-4194-8d60-caa9175b6bb4
diff --git a/src/prefs/RecordingPrefs.h b/src/prefs/RecordingPrefs.h
new file mode 100644
index 0000000..a118a01
--- /dev/null
+++ b/src/prefs/RecordingPrefs.h
@@ -0,0 +1,46 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  RecordingPrefs.h
+
+  Joshua Haberman
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_RECORDING_PREFS__
+#define __AUDACITY_RECORDING_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class RecordingPrefs:public PrefsPanel
+{
+ public:
+   RecordingPrefs(wxWindow * parent);
+   virtual ~RecordingPrefs();
+   virtual bool Apply();
+
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: df22b108-e989-4ec4-a8b6-dddbcc7be6a7
diff --git a/src/prefs/TracksPrefs.cpp b/src/prefs/TracksPrefs.cpp
new file mode 100644
index 0000000..a0a3af2
--- /dev/null
+++ b/src/prefs/TracksPrefs.cpp
@@ -0,0 +1,151 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  TracksPrefs.cpp
+
+  Brian Gunlogson
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+
+*******************************************************************//**
+
+\class TracksPrefs
+\brief A PrefsPanel for track display and behavior properties.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+
+#include "../ShuttleGui.h"
+
+#include "TracksPrefs.h"
+
+////////////////////////////////////////////////////////////////////////////////
+
+TracksPrefs::TracksPrefs(wxWindow * parent)
+:  PrefsPanel(parent, _("Tracks"))
+{
+   Populate();
+}
+
+TracksPrefs::~TracksPrefs()
+{
+}
+
+void TracksPrefs::Populate()
+{
+   mSoloCodes.Add(wxT("Standard"));
+   mSoloCodes.Add(wxT("Simple"));
+   mSoloCodes.Add(wxT("None"));
+
+   mSoloChoices.Add(_("Standard"));
+   mSoloChoices.Add(_("Simple"));
+   mSoloChoices.Add(_("None"));
+
+   mViewCodes.Add(wxT("Waveform"));
+   mViewCodes.Add(wxT("WaveformdB"));
+   mViewCodes.Add(wxT("Spectrum"));
+   mViewCodes.Add(wxT("SpectrumLogF"));
+   mViewCodes.Add(wxT("PitchEAC"));
+
+   mViewChoices.Add(_("Waveform"));
+   mViewChoices.Add(_("Waveform (dB)"));
+   mViewChoices.Add(_("Spectrum"));
+   mViewChoices.Add(_("Spectrum log(f)"));
+   mViewChoices.Add(_("Pitch (EAC)"));
+
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   S.SetBorder(2);
+
+   S.StartStatic(_("Display"));
+   {
+      S.TieCheckBox(_("&Update display while playing"),
+                    wxT("/GUI/AutoScroll"),
+                    true);
+      S.TieCheckBox(_("Automatically &fit tracks vertically zoomed"), 
+                    wxT("/GUI/TracksFitVerticallyZoomed"),
+                    false);
+
+      S.AddSpace(10);
+
+      S.StartMultiColumn(2);
+      {
+         S.TieChoice(_("Default View Mode:"),
+                     wxT("/GUI/DefaultViewMode"),
+                     wxT("Waveform"),
+                     mViewChoices,
+                     mViewCodes);
+         S.SetSizeHints(mViewChoices);
+      }
+      S.EndMultiColumn();
+   }
+   S.EndStatic();
+
+   S.StartStatic(_("Behaviors"));
+   {
+      S.TieCheckBox(_("&Select all audio in project, if none selected"),    
+                    wxT("/GUI/SelectAllOnNone"),
+                    true);
+	   S.TieCheckBox(_("Enable cut &lines"),
+                    wxT("/GUI/EnableCutLines"),
+                    false);
+      S.TieCheckBox(_("Enable &dragging of left and right selection edges"),
+                    wxT("/GUI/AdjustSelectionEdges"),
+                    true);
+      S.TieCheckBox(_("\"Move track focus\" c&ycles repeatedly through tracks"), 
+                    wxT("/GUI/CircularTrackNavigation"),
+                    false);
+      S.TieCheckBox(_("Editing a &clip can move other clips"),
+                    wxT("/GUI/EditClipCanMove"),
+                    true);
+
+      S.AddSpace(10);
+
+      S.StartMultiColumn(2);
+      {
+         S.TieChoice(_("Solo Button:"),
+                     wxT("/GUI/Solo"),
+                     wxT("Standard"),
+                     mSoloChoices,
+                     mSoloCodes);
+         S.SetSizeHints(mSoloChoices);
+      }
+      S.EndMultiColumn();
+   }
+   S.EndStatic();
+}
+
+bool TracksPrefs::Apply()
+{
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);
+
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 7e997d04-6b94-4abb-b3d6-748400f86598
diff --git a/src/prefs/TracksPrefs.h b/src/prefs/TracksPrefs.h
new file mode 100644
index 0000000..5dfaba3
--- /dev/null
+++ b/src/prefs/TracksPrefs.h
@@ -0,0 +1,53 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  TracksPrefs.h
+
+  Brian Gunlogson
+  Joshua Haberman
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_TRACKS_PREFS__
+#define __AUDACITY_TRACKS_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/arrstr.h>
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class TracksPrefs:public PrefsPanel
+{
+ public:
+   TracksPrefs(wxWindow * parent);
+   ~TracksPrefs();
+   virtual bool Apply();
+
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+
+   wxArrayString mSoloCodes;
+   wxArrayString mSoloChoices;
+   wxArrayString mViewCodes;
+   wxArrayString mViewChoices;
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 57018e2b-d264-4f93-bfa7-06752ebf631e
diff --git a/src/prefs/WarningsPrefs.cpp b/src/prefs/WarningsPrefs.cpp
new file mode 100644
index 0000000..5f55608
--- /dev/null
+++ b/src/prefs/WarningsPrefs.cpp
@@ -0,0 +1,94 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  WarningsPrefs.cpp
+
+  Brian Gunlogson
+  Joshua Haberman
+  Dominic Mazzoni
+  James Crook
+
+
+*******************************************************************//**
+
+\class WarningsPrefs
+\brief A PrefsPanel to enable/disable certain warning messages.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+
+#include "../ShuttleGui.h"
+
+#include "WarningsPrefs.h"
+
+////////////////////////////////////////////////////////////////////////////////
+
+WarningsPrefs::WarningsPrefs(wxWindow * parent)
+:  PrefsPanel(parent, _("Warnings"))
+{
+   Populate();
+}
+
+WarningsPrefs::~WarningsPrefs()
+{
+}
+
+void WarningsPrefs::Populate()
+{
+   //------------------------- Main section --------------------
+   // Now construct the GUI itself.
+   // Use 'eIsCreatingFromPrefs' so that the GUI is 
+   // initialised with values from gPrefs.
+   ShuttleGui S(this, eIsCreatingFromPrefs);
+   PopulateOrExchange(S);
+   // ----------------------- End of main section --------------
+}
+
+void WarningsPrefs::PopulateOrExchange(ShuttleGui & S)
+{
+   S.SetBorder(2);
+
+   S.StartStatic(_("Show Warnings/Prompts"));
+   {
+      S.TieCheckBox(_("When saving &projects"),
+                    wxT("/Warnings/FirstProjectSave"),
+                    true);
+      S.TieCheckBox(_("When saving &empty project"),    
+                    wxT("/GUI/EmptyCanBeDirty"),
+                    true);
+      S.TieCheckBox(_("When &disk space is getting low"),
+                    wxT("/Warnings/DiskSpaceWarning"),
+                    true);
+      S.TieCheckBox(_("When mixing down to &stereo during export"),
+                    wxT("/Warnings/MixStereo"),
+                    true);
+      S.TieCheckBox(_("When mixing down to &mono during export"),
+                    wxT("/Warnings/MixMono"),
+                    true);
+   }
+   S.EndStatic();
+}
+
+bool WarningsPrefs::Apply()
+{
+   ShuttleGui S(this, eIsSavingToPrefs);
+   PopulateOrExchange(S);
+
+   return true;
+}
+
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 7e997d04-6b94-4abb-b3d6-748400f86598
diff --git a/src/prefs/WarningsPrefs.h b/src/prefs/WarningsPrefs.h
new file mode 100644
index 0000000..83d0e14
--- /dev/null
+++ b/src/prefs/WarningsPrefs.h
@@ -0,0 +1,47 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  WarningsPrefs.h
+
+  Brian Gunlogson
+  Joshua Haberman
+  James Crook
+
+**********************************************************************/
+
+#ifndef __AUDACITY_WARNINGS_PREFS__
+#define __AUDACITY_WARNINGS_PREFS__
+
+#include <wx/defs.h>
+
+#include <wx/window.h>
+
+#include "../ShuttleGui.h"
+
+#include "PrefsPanel.h"
+
+class WarningsPrefs:public PrefsPanel
+{
+ public:
+   WarningsPrefs(wxWindow * parent);
+   ~WarningsPrefs();
+   virtual bool Apply();
+
+ private:
+   void Populate();
+   void PopulateOrExchange(ShuttleGui & S);
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 57018e2b-d264-4f93-bfa7-06752ebf631e
diff --git a/src/widgets/FileHistory.cpp b/src/widgets/FileHistory.cpp
new file mode 100644
index 0000000..f0d0453
--- /dev/null
+++ b/src/widgets/FileHistory.cpp
@@ -0,0 +1,187 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  FileHistory.cpp
+
+  Leland Lucius
+
+*******************************************************************//**
+
+\class FileHistory
+\brief Similar to FileHistory, but customized to our needs.
+
+*//*******************************************************************/
+
+#include "../Audacity.h"
+
+#include <wx/defs.h>
+#include <wx/fileconf.h>
+#include <wx/menu.h>
+
+#include "FileHistory.h"
+
+FileHistory::FileHistory(int maxfiles, wxWindowID base)
+{
+   mMaxFiles = maxfiles;
+   mIDBase = base;
+}
+
+FileHistory::~FileHistory()
+{
+}
+
+// File history management
+void FileHistory::AddFileToHistory(const wxString & file, bool update)
+{
+   // Needed to transition from wxFileHistory to FileHistory since there
+   // can be empty history "slots". 
+   if (file.IsEmpty()) {
+      return;
+   }
+
+#if defined(__WXMSW__)
+   int i = mHistory.Index(file, false);
+#else
+   int i = mHistory.Index(file, true);
+#endif
+
+   if (i != wxNOT_FOUND) {
+      mHistory.RemoveAt(i);
+   }
+
+   if (mMaxFiles == mHistory.GetCount()) {
+      mHistory.RemoveAt(mHistory.GetCount() - 1);
+   }
+
+   mHistory.Insert(file, 0);
+
+   if (update) {
+      AddFilesToMenu();
+   }
+}
+
+void FileHistory::RemoveFileFromHistory(size_t i, bool update)
+{
+   wxASSERT(i < mHistory.GetCount());
+
+   if (i < mHistory.GetCount()) {
+      mHistory.RemoveAt(i);
+
+      if (update) {
+         AddFilesToMenu();
+      }
+   }
+}
+
+void FileHistory::Clear()
+{
+   mHistory.Clear();
+
+   AddFilesToMenu();
+}
+
+wxString FileHistory::GetHistoryFile(size_t i) const
+{
+   wxASSERT(i < mHistory.GetCount());
+
+   if (i < mHistory.GetCount()) {
+      return mHistory[i];
+   }
+
+   return wxEmptyString;
+}
+
+size_t FileHistory::GetCount()
+{
+   return mHistory.GetCount();
+}
+
+void FileHistory::UseMenu(wxMenu *menu)
+{
+   wxASSERT(mMenus.Index(menu) == wxNOT_FOUND);
+
+   if (mMenus.Index(menu) == wxNOT_FOUND) {
+      mMenus.Add(menu);
+   }
+}
+
+void FileHistory::RemoveMenu(wxMenu *menu)
+{
+   wxASSERT(mMenus.Index(menu) != wxNOT_FOUND);
+
+   if (mMenus.Index(menu) != wxNOT_FOUND) {
+      mMenus.Remove(menu);
+   }
+}
+
+void FileHistory::Load(wxConfigBase & config, const wxString & group)
+{
+   mHistory.Clear();
+
+   config.SetPath(group);
+
+   wxString file;
+   long ndx;
+   bool got = config.GetFirstEntry(file, ndx);
+   while (got) {
+      AddFileToHistory(config.Read(file), false);
+      got = config.GetNextEntry(file, ndx);
+   }
+
+   config.SetPath(wxT(".."));
+
+   AddFilesToMenu();
+}
+
+void FileHistory::Save(wxConfigBase & config, const wxString & group)
+{
+   config.DeleteGroup(group);
+   config.SetPath(group);
+
+   // Stored in reverse order
+   int n = mHistory.GetCount() - 1;
+   for (size_t i = 1; i <= mHistory.GetCount(); i++) {
+      config.Write(wxString::Format(wxT("file%d"), i), mHistory[n--]);
+   }
+
+   config.SetPath(wxT(".."));
+}
+
+void FileHistory::AddFilesToMenu()
+{
+   for (size_t i = 0; i < mMenus.GetCount(); i++) {
+      AddFilesToMenu((wxMenu *) mMenus[i]);
+   }
+}
+
+void FileHistory::AddFilesToMenu(wxMenu *menu)
+{
+   wxMenuItemList items = menu->GetMenuItems();
+   wxMenuItemList::compatibility_iterator node = items.GetFirst();
+   while (node) {
+      menu->Destroy((wxMenuItem *) node->GetData());
+      node = node->GetNext();
+   }
+
+   for (size_t i = 0; i < mHistory.GetCount(); i++) {
+      menu->Append(mIDBase + 1 + i, mHistory[i]);
+   }
+
+   if (mHistory.GetCount() > 0) {
+      menu->AppendSeparator();
+   }
+   menu->Append(mIDBase, _("&Clear"));
+   menu->Enable(mIDBase, mHistory.GetCount() > 0);
+}
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 94f72c32-970b-4f4e-bbf3-3880fce7b965
diff --git a/src/widgets/FileHistory.h b/src/widgets/FileHistory.h
new file mode 100644
index 0000000..b4ddfbe
--- /dev/null
+++ b/src/widgets/FileHistory.h
@@ -0,0 +1,62 @@
+/**********************************************************************
+
+  Audacity: A Digital Audio Editor
+
+  FileHistory.h
+
+  Leland Lucius
+
+**********************************************************************/
+
+#ifndef __AUDACITY_WIDGETS_FILEHISTORY__
+#define __AUDACITY_WIDGETS_FILEHISTORY__
+
+#include <wx/defs.h>
+#include <wx/choice.h>
+#include <wx/dynarray.h>
+#include <wx/event.h>
+#include <wx/grid.h>
+#include <wx/string.h>
+#include <wx/window.h>
+
+class AUDACITY_DLL_API FileHistory
+{
+ public:
+   FileHistory(int maxfiles = 9, wxWindowID idbase = wxID_FILE);
+   virtual ~FileHistory();
+
+   void AddFileToHistory(const wxString & file, bool update = true);
+   void RemoveFileFromHistory(size_t i, bool update = true);
+   void Clear();
+   void UseMenu(wxMenu *menu);
+   void RemoveMenu(wxMenu *menu);
+   void Load(wxConfigBase& config, const wxString & group);
+   void Save(wxConfigBase& config, const wxString & group);
+
+   void AddFilesToMenu();
+   void AddFilesToMenu(wxMenu *menu);
+
+   size_t GetCount();
+   wxString GetHistoryFile(size_t i) const;
+
+ private:
+   int mMaxFiles;
+   wxWindowID mIDBase;
+
+   wxArrayPtrVoid mMenus;
+   wxArrayString mHistory;
+
+};
+
+#endif
+
+// Indentation settings for Vim and Emacs and unique identifier for Arch, a
+// version control system. Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3
+// arch-tag: 94f72c32-970b-4f4e-bbf3-3880fce7b965
diff --git a/win/Projects/help/help.vcproj b/win/Projects/help/help.vcproj
new file mode 100644
index 0000000..840cbce
--- /dev/null
+++ b/win/Projects/help/help.vcproj
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="help"
+	ProjectGUID="{02F94A40-586A-4403-8464-13B50801FFEC}"
+	RootNamespace="help"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="10"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="set SRC=&quot;$(SolutionDir)\..\help\manual&quot;&#x0D;&#x0A;set DEST=&quot;$(OutDir)\help\manual&quot;&#x0D;&#x0A;&#x0D;&#x0A;cd ..\..\..\scripts\mw2html_audacity&#x0D;&#x0A;&#x0D;&#x0A;if EXIST %SRC% goto built&#x0D;&#x0A;&#x0D;&#x0A;wiki2htm.bat&#x0D;&#x0A;&#x0D;&#x0A;:built&#x0D;&#x0A;&#x0D;&#x0A;xcopy /I /E /C /Y /Q %SRC% %DEST%&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="10"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="set SRC=&quot;$(SolutionDir)\..\help\manual&quot;&#x0D;&#x0A;set DEST=&quot;$(OutDir)\help\manual&quot;&#x0D;&#x0A;&#x0D;&#x0A;cd ..\..\..\scripts\mw2html_audacity&#x0D;&#x0A;&#x0D;&#x0A;if EXIST %SRC% goto built&#x0D;&#x0A;&#x0D;&#x0A;wiki2htm.bat&#x0D;&#x0A;&#x0D;&#x0A;:built&#x0D;&#x0A;&#x0D;&#x0A;xcopy /I /E /C /Y /Q %SRC% %DEST%&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="10"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="set SRC=&quot;$(SolutionDir)\..\help\manual&quot;&#x0D;&#x0A;set DEST=&quot;$(OutDir)\help\manual&quot;&#x0D;&#x0A;&#x0D;&#x0A;cd ..\..\..\scripts\mw2html_audacity&#x0D;&#x0A;&#x0D;&#x0A;if EXIST %SRC% goto built&#x0D;&#x0A;&#x0D;&#x0A;wiki2htm.bat&#x0D;&#x0A;&#x0D;&#x0A;:built&#x0D;&#x0A;&#x0D;&#x0A;xcopy /I /E /C /Y /Q %SRC% %DEST%&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="10"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="set SRC=&quot;$(SolutionDir)\..\help\manual&quot;&#x0D;&#x0A;set DEST=&quot;$(OutDir)\help\manual&quot;&#x0D;&#x0A;&#x0D;&#x0A;cd ..\..\..\scripts\mw2html_audacity&#x0D;&#x0A;&#x0D;&#x0A;if EXIST %SRC% goto built&#x0D;&#x0A;&#x0D;&#x0A;wiki2htm.bat&#x0D;&#x0A;&#x0D;&#x0A;:built&#x0D;&#x0A;&#x0D;&#x0A;xcopy /I /E /C /Y /Q %SRC% %DEST%&#x0D;&#x0A;"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/win/Projects/libsndfile/config.h b/win/Projects/libsndfile/config.h
new file mode 100644
index 0000000..d88791d
--- /dev/null
+++ b/win/Projects/libsndfile/config.h
@@ -0,0 +1,376 @@
+/*
+** Copyright (C) 2002-2004 Erik de Castro Lopo <erikd at mega-nerd.com>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 2.1 of the License, or
+** (at your option) any later version.
+**
+** This 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 Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser 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.
+*/
+
+/*
+** This is the Win32 version of the file config.h which is autogenerated
+** on Unix systems.
+*/
+#if defined(LIBSNDFILE_PRIVATE_CONFIG) && !defined(LIBSNDFILE_HAVE_CONFIG)
+#define LIBSNDFILE_HAVE_CONFIG 1
+
+#pragma warning (disable : 4244)
+#pragma warning (disable : 4761)
+
+typedef __int8            int8_t;
+typedef __int16           int16_t;
+typedef __int32           int32_t;
+typedef __int64           int64_t;
+typedef unsigned __int8   uint8_t;
+typedef unsigned __int16  uint16_t;
+typedef unsigned __int32  uint32_t;
+typedef unsigned __int64  uint64_t;
+
+#define ssize_t           SSIZE_T
+#define __func__          __FUNCTION__
+
+/*	Win32 doesn't seem to have these functions. 
+**	Therefore implement inline versions of these functions here.
+*/
+
+__inline long int 
+lrint (double flt)
+{	int intgr;
+
+	_asm
+	{	fld flt
+		fistp intgr
+		} ;
+		
+	return intgr ;
+} 
+
+__inline long int 
+lrintf (float flt)
+{	int intgr;
+
+	_asm
+	{	fld flt
+		fistp intgr
+		} ;
+		
+	return intgr ;
+}
+
+__inline long long int 
+llrint (double flt)
+{	long long int intgr;
+
+	_asm
+	{	fld flt
+		fistp intgr
+		} ;
+		
+	return intgr ;
+} 
+
+__inline long long int 
+llrintf (float flt)
+{	long long int intgr;
+
+	_asm
+	{	fld flt
+		fistp intgr
+		} ;
+		
+	return intgr ;
+}
+
+/* Set to 1 if the compile is GNU GCC. */
+/* #undef COMPILER_IS_GCC */
+
+/* Target processor clips on negative float to int conversion. */
+#define CPU_CLIPS_NEGATIVE 1
+
+/* Target processor clips on positive float to int conversion. */
+#define CPU_CLIPS_POSITIVE 0
+
+/* Target processor is big endian. */
+#define CPU_IS_BIG_ENDIAN 0
+
+/* Target processor is little endian. */
+#define CPU_IS_LITTLE_ENDIAN 1
+
+/* Set to 1 to enable experimental code. */
+#define ENABLE_EXPERIMENTAL_CODE 0
+
+/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
+/* #undef HAVE_ALSA_ASOUNDLIB_H */
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+/* #undef HAVE_BYTESWAP_H */
+
+/* Define to 1 if you have the `calloc' function. */
+#define HAVE_CALLOC 1
+
+/* Define to 1 if you have the `ceil' function. */
+#define HAVE_CEIL 1
+
+/* Set to 1 if S_IRGRP is defined. */
+#define HAVE_DECL_S_IRGRP 0
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the <endian.h> header file. */
+/* #undef HAVE_ENDIAN_H */
+
+/* Will be set to 1 if flac, ogg and vorbis are available. */
+/* #undef HAVE_EXTERNAL_LIBS */
+
+/* Set to 1 if the compile supports the struct hack. */
+#define HAVE_FLEXIBLE_ARRAY 1
+
+/* Define to 1 if you have the `floor' function. */
+#define HAVE_FLOOR 1
+
+/* Define to 1 if you have the `fmod' function. */
+#define HAVE_FMOD 1
+
+/* Define to 1 if you have the `free' function. */
+#define HAVE_FREE 1
+
+/* Define to 1 if you have the `fstat' function. */
+#define HAVE_FSTAT 1
+
+/* Define to 1 if you have the `fsync' function. */
+/* #undef HAVE_FSYNC */
+
+/* Define to 1 if you have the `ftruncate' function. */
+/* #undef HAVE_FTRUNCATE */
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #undef HAVE_GETTIMEOFDAY */
+
+/* Define to 1 if you have the `gmtime' function. */
+#define HAVE_GMTIME 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+/* #undef HAVE_GMTIME_R */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Set to 1 if you have JACK. */
+/* #undef HAVE_JACK */
+
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+/* #undef HAVE_LOCALE_H */
+
+/* Define to 1 if you have the `localtime' function. */
+#define HAVE_LOCALTIME 1
+
+/* Define to 1 if you have the `localtime_r' function. */
+/* #undef HAVE_LOCALTIME_R */
+
+/* Define if you have C99's lrint function. */
+/* #undef HAVE_LRINT */
+
+/* Define if you have C99's lrintf function. */
+/* #undef HAVE_LRINTF */
+
+/* Define to 1 if you have the `lseek' function. */
+#define HAVE_LSEEK 1
+
+/* Define to 1 if you have the `malloc' function. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mmap' function. */
+/* #undef HAVE_MMAP */
+
+/* Define to 1 if you have the `open' function. */
+#define HAVE_OPEN 1
+
+/* Define to 1 if you have the `pread' function. */
+/* #undef HAVE_PREAD */
+
+/* Define to 1 if you have the `pwrite' function. */
+/* #undef HAVE_PWRITE */
+
+/* Define to 1 if you have the `read' function. */
+#define HAVE_READ 1
+
+/* Define to 1 if you have the `realloc' function. */
+#define HAVE_REALLOC 1
+
+/* Define to 1 if you have the `setlocale' function. */
+/* #undef HAVE_SETLOCALE */
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Set to 1 if you have libsqlite3. */
+/* #undef HAVE_SQLITE3 */
+
+/* Define to 1 if the system has the type `ssize_t'. */
+/* #undef HAVE_SSIZE_T */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #undef HAVE_SYS_TIME_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `write' function. */
+#define HAVE_WRITE 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Set to 1 if compiling for MacOSX */
+#define OS_IS_MACOSX 0
+
+/* Set to 1 if compiling for Win32 */
+#define OS_IS_WIN32 1
+
+/* Name of package */
+#define PACKAGE "libsndfile"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "erikd at mega-nerd.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libsndfile"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libsndfile 1.0.18"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libsndfile"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.0.18"
+
+/* Set to maximum allowed value of sf_count_t type. */
+#define SF_COUNT_MAX LLONG_MAX
+
+/* The size of `double', as computed by sizeof. */
+#define SIZEOF_DOUBLE 8
+
+/* The size of `float', as computed by sizeof. */
+#define SIZEOF_FLOAT 4
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `int64_t', as computed by sizeof. */
+#define SIZEOF_INT64_T 0
+
+/* The size of `loff_t', as computed by sizeof. */
+/* #undef SIZEOF_LOFF_T */
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `off64_t', as computed by sizeof. */
+/* #undef SIZEOF_OFF64_T */
+
+/* The size of `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T 4
+
+/* Set to sizeof (long) if unknown. */
+#define SIZEOF_SF_COUNT_T 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 4
+
+/* The size of `ssize_t', as computed by sizeof. */
+#define SIZEOF_SSIZE_T 4
+
+/* The size of `void*', as computed by sizeof. */
+#define SIZEOF_VOIDP 4
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Set to long if unknown. */
+#define TYPEOF_SF_COUNT_T __int64
+
+/* Set to 1 to use the native windows API */
+#define USE_WINDOWS_API 1
+
+/* Version number of package */
+#define VERSION "1.0.18"
+
+/* Set to 1 if windows DLL is being built. */
+#define WIN32_TARGET_DLL 0
+
+/* Target processor is big endian. */
+#define WORDS_BIGENDIAN 0
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to make fseeko etc. visible, on some hosts. */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+#undef CPU_IS_BIG_ENDIAN
+#undef CPU_IS_LITTLE_ENDIAN
+#if defined(__BIG_ENDIAN__)
+#define CPU_IS_BIG_ENDIAN 1
+#define CPU_IS_LITTLE_ENDIAN 0
+#else
+#define CPU_IS_BIG_ENDIAN 0
+#define CPU_IS_LITTLE_ENDIAN 1
+#endif
+
+#endif
diff --git a/win/Projects/libsndfile/sndfile.h b/win/Projects/libsndfile/sndfile.h
new file mode 100644
index 0000000..004973d
--- /dev/null
+++ b/win/Projects/libsndfile/sndfile.h
@@ -0,0 +1,624 @@
+/*
+** Copyright (C) 1999-2008 Erik de Castro Lopo <erikd at mega-nerd.com>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU Lesser General Public License as published by
+** the Free Software Foundation; either version 2.1 of the License, or
+** (at your option) any later version.
+**
+** This 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 Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser 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.
+*/
+
+/*
+** sndfile.h -- system-wide definitions
+**
+** API documentation is in the doc/ directory of the source code tarball
+** and at http://www.mega-nerd.com/libsndfile/api.html.
+*/
+
+#ifndef SNDFILE_H
+#define SNDFILE_H
+
+/* This is the version 1.0.X header file. */
+#define	SNDFILE_1
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif	/* __cplusplus */
+
+/* The following file types can be read and written.
+** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise
+** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and
+** SF_FORMAT_SUBMASK can be used to separate the major and minor file
+** types.
+*/
+
+enum
+{	/* Major formats. */
+	SF_FORMAT_WAV			= 0x010000,		/* Microsoft WAV format (little endian default). */
+	SF_FORMAT_AIFF			= 0x020000,		/* Apple/SGI AIFF format (big endian). */
+	SF_FORMAT_AU			= 0x030000,		/* Sun/NeXT AU format (big endian). */
+	SF_FORMAT_RAW			= 0x040000,		/* RAW PCM data. */
+	SF_FORMAT_PAF			= 0x050000,		/* Ensoniq PARIS file format. */
+	SF_FORMAT_SVX			= 0x060000,		/* Amiga IFF / SVX8 / SV16 format. */
+	SF_FORMAT_NIST			= 0x070000,		/* Sphere NIST format. */
+	SF_FORMAT_VOC			= 0x080000,		/* VOC files. */
+	SF_FORMAT_IRCAM			= 0x0A0000,		/* Berkeley/IRCAM/CARL */
+	SF_FORMAT_W64			= 0x0B0000,		/* Sonic Foundry's 64 bit RIFF/WAV */
+	SF_FORMAT_MAT4			= 0x0C0000,		/* Matlab (tm) V4.2 / GNU Octave 2.0 */
+	SF_FORMAT_MAT5			= 0x0D0000,		/* Matlab (tm) V5.0 / GNU Octave 2.1 */
+	SF_FORMAT_PVF			= 0x0E0000,		/* Portable Voice Format */
+	SF_FORMAT_XI			= 0x0F0000,		/* Fasttracker 2 Extended Instrument */
+	SF_FORMAT_HTK			= 0x100000,		/* HMM Tool Kit format */
+	SF_FORMAT_SDS			= 0x110000,		/* Midi Sample Dump Standard */
+	SF_FORMAT_AVR			= 0x120000,		/* Audio Visual Research */
+	SF_FORMAT_WAVEX			= 0x130000,		/* MS WAVE with WAVEFORMATEX */
+	SF_FORMAT_SD2			= 0x160000,		/* Sound Designer 2 */
+	SF_FORMAT_FLAC			= 0x170000,		/* FLAC lossless file format */
+	SF_FORMAT_CAF			= 0x180000,		/* Core Audio File format */
+	SF_FORMAT_WVE			= 0x190000,		/* Psion WVE format */
+	SF_FORMAT_OGG			= 0x200000,		/* Xiph OGG container */
+	SF_FORMAT_MPC2K			= 0x210000,		/* Akai MPC 2000 sampler */
+	SF_FORMAT_RF64			= 0x220000,		/* RF64 WAV file */
+
+	/* Subtypes from here on. */
+
+	SF_FORMAT_PCM_S8		= 0x0001,		/* Signed 8 bit data */
+	SF_FORMAT_PCM_16		= 0x0002,		/* Signed 16 bit data */
+	SF_FORMAT_PCM_24		= 0x0003,		/* Signed 24 bit data */
+	SF_FORMAT_PCM_32		= 0x0004,		/* Signed 32 bit data */
+
+	SF_FORMAT_PCM_U8		= 0x0005,		/* Unsigned 8 bit data (WAV and RAW only) */
+
+	SF_FORMAT_FLOAT			= 0x0006,		/* 32 bit float data */
+	SF_FORMAT_DOUBLE		= 0x0007,		/* 64 bit float data */
+
+	SF_FORMAT_ULAW			= 0x0010,		/* U-Law encoded. */
+	SF_FORMAT_ALAW			= 0x0011,		/* A-Law encoded. */
+	SF_FORMAT_IMA_ADPCM		= 0x0012,		/* IMA ADPCM. */
+	SF_FORMAT_MS_ADPCM		= 0x0013,		/* Microsoft ADPCM. */
+
+	SF_FORMAT_GSM610		= 0x0020,		/* GSM 6.10 encoding. */
+	SF_FORMAT_VOX_ADPCM		= 0x0021,		/* OKI / Dialogix ADPCM */
+
+	SF_FORMAT_G721_32		= 0x0030,		/* 32kbs G721 ADPCM encoding. */
+	SF_FORMAT_G723_24		= 0x0031,		/* 24kbs G723 ADPCM encoding. */
+	SF_FORMAT_G723_40		= 0x0032,		/* 40kbs G723 ADPCM encoding. */
+
+	SF_FORMAT_DWVW_12		= 0x0040, 		/* 12 bit Delta Width Variable Word encoding. */
+	SF_FORMAT_DWVW_16		= 0x0041, 		/* 16 bit Delta Width Variable Word encoding. */
+	SF_FORMAT_DWVW_24		= 0x0042, 		/* 24 bit Delta Width Variable Word encoding. */
+	SF_FORMAT_DWVW_N		= 0x0043, 		/* N bit Delta Width Variable Word encoding. */
+
+	SF_FORMAT_DPCM_8		= 0x0050,		/* 8 bit differential PCM (XI only) */
+	SF_FORMAT_DPCM_16		= 0x0051,		/* 16 bit differential PCM (XI only) */
+
+	SF_FORMAT_VORBIS		= 0x0060,		/* Xiph Vorbis encoding. */
+
+	/* Endian-ness options. */
+
+	SF_ENDIAN_FILE			= 0x00000000,	/* Default file endian-ness. */
+	SF_ENDIAN_LITTLE		= 0x10000000,	/* Force little endian-ness. */
+	SF_ENDIAN_BIG			= 0x20000000,	/* Force big endian-ness. */
+	SF_ENDIAN_CPU			= 0x30000000,	/* Force CPU endian-ness. */
+
+	SF_FORMAT_SUBMASK		= 0x0000FFFF,
+	SF_FORMAT_TYPEMASK		= 0x0FFF0000,
+	SF_FORMAT_ENDMASK		= 0x30000000
+} ;
+
+/*
+** The following are the valid command numbers for the sf_command()
+** interface.  The use of these commands is documented in the file
+** command.html in the doc directory of the source code distribution.
+*/
+
+enum
+{	SFC_GET_LIB_VERSION				= 0x1000,
+	SFC_GET_LOG_INFO				= 0x1001,
+	SFC_GET_CURRENT_SF_INFO			= 0x1002,
+
+
+	SFC_GET_NORM_DOUBLE				= 0x1010,
+	SFC_GET_NORM_FLOAT				= 0x1011,
+	SFC_SET_NORM_DOUBLE				= 0x1012,
+	SFC_SET_NORM_FLOAT				= 0x1013,
+	SFC_SET_SCALE_FLOAT_INT_READ	= 0x1014,
+	SFC_SET_SCALE_INT_FLOAT_WRITE	= 0x1015,
+
+	SFC_GET_SIMPLE_FORMAT_COUNT		= 0x1020,
+	SFC_GET_SIMPLE_FORMAT			= 0x1021,
+
+	SFC_GET_FORMAT_INFO				= 0x1028,
+
+	SFC_GET_FORMAT_MAJOR_COUNT		= 0x1030,
+	SFC_GET_FORMAT_MAJOR			= 0x1031,
+	SFC_GET_FORMAT_SUBTYPE_COUNT	= 0x1032,
+	SFC_GET_FORMAT_SUBTYPE			= 0x1033,
+
+	SFC_CALC_SIGNAL_MAX				= 0x1040,
+	SFC_CALC_NORM_SIGNAL_MAX		= 0x1041,
+	SFC_CALC_MAX_ALL_CHANNELS		= 0x1042,
+	SFC_CALC_NORM_MAX_ALL_CHANNELS	= 0x1043,
+	SFC_GET_SIGNAL_MAX				= 0x1044,
+	SFC_GET_MAX_ALL_CHANNELS		= 0x1045,
+
+	SFC_SET_ADD_PEAK_CHUNK			= 0x1050,
+	SFC_SET_ADD_HEADER_PAD_CHUNK	= 0x1051,
+
+	SFC_UPDATE_HEADER_NOW			= 0x1060,
+	SFC_SET_UPDATE_HEADER_AUTO		= 0x1061,
+
+	SFC_FILE_TRUNCATE				= 0x1080,
+
+	SFC_SET_RAW_START_OFFSET		= 0x1090,
+
+	SFC_SET_DITHER_ON_WRITE			= 0x10A0,
+	SFC_SET_DITHER_ON_READ			= 0x10A1,
+
+	SFC_GET_DITHER_INFO_COUNT		= 0x10A2,
+	SFC_GET_DITHER_INFO				= 0x10A3,
+
+	SFC_GET_EMBED_FILE_INFO			= 0x10B0,
+
+	SFC_SET_CLIPPING				= 0x10C0,
+	SFC_GET_CLIPPING				= 0x10C1,
+
+	SFC_GET_INSTRUMENT				= 0x10D0,
+	SFC_SET_INSTRUMENT				= 0x10D1,
+
+	SFC_GET_LOOP_INFO				= 0x10E0,
+
+	SFC_GET_BROADCAST_INFO			= 0x10F0,
+	SFC_SET_BROADCAST_INFO			= 0x10F1,
+
+	SFC_GET_CHANNEL_MAP_INFO		= 0x1100,
+	SFC_SET_CHANNEL_MAP_INFO		= 0x1101,
+
+	SFC_RAW_DATA_NEEDS_ENDSWAP		= 0x1110,
+
+	/* Support for Wavex Ambisonics Format */
+	SFC_WAVEX_SET_AMBISONIC			= 0x1200,
+	SFC_WAVEX_GET_AMBISONIC			= 0x1201,
+
+	SFC_SET_VBR_ENCODING_QUALITY	= 0x1300,
+
+	/* Following commands for testing only. */
+	SFC_TEST_IEEE_FLOAT_REPLACE		= 0x6001,
+
+	/*
+	** SFC_SET_ADD_* values are deprecated and will disappear at some
+	** time in the future. They are guaranteed to be here up to and
+	** including version 1.0.8 to avoid breakage of existng software.
+	** They currently do nothing and will continue to do nothing.
+	*/
+	SFC_SET_ADD_DITHER_ON_WRITE		= 0x1070,
+	SFC_SET_ADD_DITHER_ON_READ		= 0x1071
+} ;
+
+
+/*
+** String types that can be set and read from files. Not all file types
+** support this and even the file types which support one, may not support
+** all string types.
+*/
+
+enum
+{	SF_STR_TITLE					= 0x01,
+	SF_STR_COPYRIGHT				= 0x02,
+	SF_STR_SOFTWARE					= 0x03,
+	SF_STR_ARTIST					= 0x04,
+	SF_STR_COMMENT					= 0x05,
+	SF_STR_DATE						= 0x06,
+	SF_STR_ALBUM					= 0x07,
+	SF_STR_LICENSE					= 0x08
+} ;
+
+/*
+** Use the following as the start and end index when doing metadata
+** transcoding.
+*/
+
+#define	SF_STR_FIRST	SF_STR_TITLE
+#define	SF_STR_LAST		SF_STR_LICENSE
+
+enum
+{	/* True and false */
+	SF_FALSE	= 0,
+	SF_TRUE		= 1,
+
+	/* Modes for opening files. */
+	SFM_READ	= 0x10,
+	SFM_WRITE	= 0x20,
+	SFM_RDWR	= 0x30,
+
+	SF_AMBISONIC_NONE		= 0x40,
+	SF_AMBISONIC_B_FORMAT	= 0x41
+} ;
+
+/* Public error values. These are guaranteed to remain unchanged for the duration
+** of the library major version number.
+** There are also a large number of private error numbers which are internal to
+** the library which can change at any time.
+*/
+
+enum
+{	SF_ERR_NO_ERROR				= 0,
+	SF_ERR_UNRECOGNISED_FORMAT	= 1,
+	SF_ERR_SYSTEM				= 2,
+	SF_ERR_MALFORMED_FILE		= 3,
+	SF_ERR_UNSUPPORTED_ENCODING	= 4
+} ;
+
+
+/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP).
+*/
+
+enum
+{	SF_CHANNEL_MAP_INVALID = 0,
+	SF_CHANNEL_MAP_MONO = 1,
+	SF_CHANNEL_MAP_LEFT,
+	SF_CHANNEL_MAP_RIGHT,
+	SF_CHANNEL_MAP_CENTER,
+	SF_CHANNEL_MAP_FRONT_LEFT,
+	SF_CHANNEL_MAP_FRONT_RIGHT,
+	SF_CHANNEL_MAP_FRONT_CENTER,
+	SF_CHANNEL_MAP_REAR_CENTER,
+	SF_CHANNEL_MAP_REAR_LEFT,
+	SF_CHANNEL_MAP_REAR_RIGHT,
+	SF_CHANNEL_MAP_LFE,
+	SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,
+	SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,
+	SF_CHANNEL_MAP_SIDE_LEFT,
+	SF_CHANNEL_MAP_SIDE_RIGHT,
+	SF_CHANNEL_MAP_TOP_CENTER,
+	SF_CHANNEL_MAP_TOP_FRONT_LEFT,
+	SF_CHANNEL_MAP_TOP_FRONT_RIGHT,
+	SF_CHANNEL_MAP_TOP_FRONT_CENTER,
+	SF_CHANNEL_MAP_TOP_REAR_LEFT,
+	SF_CHANNEL_MAP_TOP_REAR_RIGHT,
+	SF_CHANNEL_MAP_TOP_REAR_CENTER
+} ;
+
+
+/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */
+
+typedef	struct SNDFILE_tag	SNDFILE ;
+
+/* The following typedef is system specific and is defined when libsndfile is
+** compiled. sf_count_t can be one of loff_t (Linux), off_t (*BSD), off64_t 
+** (Solaris), __int64_t (Win32) etc. On windows, we need to allow the same
+** header file to be compiler by both GCC and the microsoft compiler.
+*/
+
+
+#ifdef _MSC_VER
+#include <limits.h>
+typedef __int64	sf_count_t ;
+#define SF_COUNT_MAX		LLONG_MAX
+#else
+#ifdef _MSCVER
+typedef __int64_t	sf_count_t ;
+#define SF_COUNT_MAX		0x7fffffffffffffffi64
+#else
+typedef off_t	sf_count_t ;
+#define SF_COUNT_MAX		0x7FFFFFFFFFFFFFFFLL
+#endif
+#endif
+
+
+/* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.
+** On write, the SF_INFO structure is filled in by the user and passed into
+** sf_open_write ().
+*/
+
+struct SF_INFO
+{	sf_count_t	frames ;		/* Used to be called samples.  Changed to avoid confusion. */
+	int			samplerate ;
+	int			channels ;
+	int			format ;
+	int			sections ;
+	int			seekable ;
+} ;
+
+typedef	struct SF_INFO SF_INFO ;
+
+/* The SF_FORMAT_INFO struct is used to retrieve information about the sound
+** file formats libsndfile supports using the sf_command () interface.
+**
+** Using this interface will allow applications to support new file formats
+** and encoding types when libsndfile is upgraded, without requiring
+** re-compilation of the application.
+**
+** Please consult the libsndfile documentation (particularly the information
+** on the sf_command () interface) for examples of its use.
+*/
+
+typedef struct
+{	int			format ;
+	const char	*name ;
+	const char	*extension ;
+} SF_FORMAT_INFO ;
+
+/*
+** Enums and typedefs for adding dither on read and write.
+** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE
+** and SFC_SET_DITHER_ON_READ.
+*/
+
+enum
+{	SFD_DEFAULT_LEVEL	= 0,
+	SFD_CUSTOM_LEVEL	= 0x40000000,
+
+	SFD_NO_DITHER		= 500,
+	SFD_WHITE			= 501,
+	SFD_TRIANGULAR_PDF	= 502
+} ;
+
+typedef struct
+{	int			type ;
+	double		level ;
+	const char	*name ;
+} SF_DITHER_INFO ;
+
+/* Struct used to retrieve information about a file embedded within a
+** larger file. See SFC_GET_EMBED_FILE_INFO.
+*/
+
+typedef struct
+{	sf_count_t	offset ;
+	sf_count_t	length ;
+} SF_EMBED_FILE_INFO ;
+
+/*
+**	Structs used to retrieve music sample information from a file.
+*/
+
+enum
+{	/*
+	**	The loop mode field in SF_INSTRUMENT will be one of the following.
+	*/
+	SF_LOOP_NONE = 800,
+	SF_LOOP_FORWARD,
+	SF_LOOP_BACKWARD,
+	SF_LOOP_ALTERNATING
+} ;
+
+typedef struct
+{	int gain ;
+	char basenote, detune ;
+	char velocity_lo, velocity_hi ;
+	char key_lo, key_hi ;
+	int loop_count ;
+
+	struct
+	{	int mode ;
+		unsigned int start ;
+		unsigned int end ;
+		unsigned int count ;
+	} loops [16] ; /* make variable in a sensible way */
+} SF_INSTRUMENT ;
+
+
+
+/* Struct used to retrieve loop information from a file.*/
+typedef struct
+{
+	short	time_sig_num ;	/* any positive integer    > 0  */
+	short	time_sig_den ;	/* any positive power of 2 > 0  */
+	int		loop_mode ;		/* see SF_LOOP enum             */
+
+	int		num_beats ;		/* this is NOT the amount of quarter notes !!!*/
+							/* a full bar of 4/4 is 4 beats */
+							/* a full bar of 7/8 is 7 beats */
+
+	float	bpm ;			/* suggestion, as it can be calculated using other fields:*/
+							/* file's lenght, file's sampleRate and our time_sig_den*/
+							/* -> bpms are always the amount of _quarter notes_ per minute */
+
+	int	root_key ;			/* MIDI note, or -1 for None */
+	int future [6] ;
+} SF_LOOP_INFO ;
+
+
+/*	Struct used to retrieve broadcast (EBU) information from a file.
+**	Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE.
+*/
+#define	SF_BROADCAST_INFO_VAR(coding_hist_size) \
+			struct \
+			{	char			description [256] ; \
+				char			originator [32] ; \
+				char			originator_reference [32] ; \
+				char			origination_date [10] ; \
+				char			origination_time [8] ; \
+				unsigned int	time_reference_low ; \
+				unsigned int	time_reference_high ; \
+				short			version ; \
+				char			umid [64] ; \
+				char			reserved [190] ; \
+				unsigned int	coding_history_size ; \
+				char			coding_history [coding_hist_size] ; \
+			}
+
+/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */
+typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ;
+
+
+/*	Virtual I/O functionality. */
+
+typedef sf_count_t		(*sf_vio_get_filelen)	(void *user_data) ;
+typedef sf_count_t		(*sf_vio_seek)		(sf_count_t offset, int whence, void *user_data) ;
+typedef sf_count_t		(*sf_vio_read)		(void *ptr, sf_count_t count, void *user_data) ;
+typedef sf_count_t		(*sf_vio_write)		(const void *ptr, sf_count_t count, void *user_data) ;
+typedef sf_count_t		(*sf_vio_tell)		(void *user_data) ;
+
+struct SF_VIRTUAL_IO
+{	sf_vio_get_filelen	get_filelen ;
+	sf_vio_seek			seek ;
+	sf_vio_read			read ;
+	sf_vio_write		write ;
+	sf_vio_tell			tell ;
+} ;
+
+typedef	struct SF_VIRTUAL_IO SF_VIRTUAL_IO ;
+
+/* Open the specified file for read, write or both. On error, this will
+** return a NULL pointer. To find the error number, pass a NULL SNDFILE
+** to sf_strerror ().
+** All calls to sf_open() should be matched with a call to sf_close().
+*/
+
+SNDFILE* 	sf_open		(const char *path, int mode, SF_INFO *sfinfo) ;
+
+/* Use the existing file descriptor to create a SNDFILE object. If close_desc
+** is TRUE, the file descriptor will be closed when sf_close() is called. If
+** it is FALSE, the descritor will not be closed.
+** When passed a descriptor like this, the library will assume that the start
+** of file header is at the current file offset. This allows sound files within
+** larger container files to be read and/or written.
+** On error, this will return a NULL pointer. To find the error number, pass a
+** NULL SNDFILE to sf_strerror ().
+** All calls to sf_open_fd() should be matched with a call to sf_close().
+
+*/
+
+SNDFILE* 	sf_open_fd	(int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
+
+SNDFILE* 	sf_open_virtual	(SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
+
+/* sf_error () returns a error number which can be translated to a text
+** string using sf_error_number().
+*/
+
+int		sf_error		(SNDFILE *sndfile) ;
+
+/* sf_strerror () returns to the caller a pointer to the current error message for
+** the given SNDFILE.
+*/
+
+const char* sf_strerror (SNDFILE *sndfile) ;
+
+/* sf_error_number () allows the retrieval of the error string for each internal
+** error number.
+**
+*/
+
+const char*	sf_error_number	(int errnum) ;
+
+/* The following two error functions are deprecated but they will remain in the
+** library for the forseeable future. The function sf_strerror() should be used
+** in their place.
+*/
+
+int		sf_perror		(SNDFILE *sndfile) ;
+int		sf_error_str	(SNDFILE *sndfile, char* str, size_t len) ;
+
+
+/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
+
+int		sf_command	(SNDFILE *sndfile, int command, void *data, int datasize) ;
+
+/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */
+
+int		sf_format_check	(const SF_INFO *info) ;
+
+/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses
+** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as
+** stdio.h function fseek ().
+** An offset of zero with whence set to SEEK_SET will position the
+** read / write pointer to the first data sample.
+** On success sf_seek returns the current position in (multi-channel)
+** samples from the start of the file.
+** Please see the libsndfile documentation for moving the read pointer
+** separately from the write pointer on files open in mode SFM_RDWR.
+** On error all of these functions return -1.
+*/
+
+sf_count_t	sf_seek 		(SNDFILE *sndfile, sf_count_t frames, int whence) ;
+
+/* Functions for retrieving and setting string data within sound files.
+** Not all file types support this features; AIFF and WAV do. For both
+** functions, the str_type parameter must be one of the SF_STR_* values
+** defined above.
+** On error, sf_set_string() returns non-zero while sf_get_string()
+** returns NULL.
+*/
+
+int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ;
+
+const char* sf_get_string (SNDFILE *sndfile, int str_type) ;
+
+/* Functions for reading/writing the waveform data of a sound file.
+*/
+
+sf_count_t	sf_read_raw		(SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
+sf_count_t	sf_write_raw 	(SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ;
+
+/* Functions for reading and writing the data chunk in terms of frames.
+** The number of items actually read/written = frames * number of channels.
+**     sf_xxxx_raw		read/writes the raw data bytes from/to the file
+**     sf_xxxx_short	passes data in the native short format
+**     sf_xxxx_int		passes data in the native int format
+**     sf_xxxx_float	passes data in the native float format
+**     sf_xxxx_double	passes data in the native double format
+** All of these read/write function return number of frames read/written.
+*/
+
+sf_count_t	sf_readf_short	(SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
+sf_count_t	sf_writef_short	(SNDFILE *sndfile, const short *ptr, sf_count_t frames) ;
+
+sf_count_t	sf_readf_int	(SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
+sf_count_t	sf_writef_int 	(SNDFILE *sndfile, const int *ptr, sf_count_t frames) ;
+
+sf_count_t	sf_readf_float	(SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
+sf_count_t	sf_writef_float	(SNDFILE *sndfile, const float *ptr, sf_count_t frames) ;
+
+sf_count_t	sf_readf_double		(SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
+sf_count_t	sf_writef_double	(SNDFILE *sndfile, const double *ptr, sf_count_t frames) ;
+
+/* Functions for reading and writing the data chunk in terms of items.
+** Otherwise similar to above.
+** All of these read/write function return number of items read/written.
+*/
+
+sf_count_t	sf_read_short	(SNDFILE *sndfile, short *ptr, sf_count_t items) ;
+sf_count_t	sf_write_short	(SNDFILE *sndfile, const short *ptr, sf_count_t items) ;
+
+sf_count_t	sf_read_int		(SNDFILE *sndfile, int *ptr, sf_count_t items) ;
+sf_count_t	sf_write_int 	(SNDFILE *sndfile, const int *ptr, sf_count_t items) ;
+
+sf_count_t	sf_read_float	(SNDFILE *sndfile, float *ptr, sf_count_t items) ;
+sf_count_t	sf_write_float	(SNDFILE *sndfile, const float *ptr, sf_count_t items) ;
+
+sf_count_t	sf_read_double	(SNDFILE *sndfile, double *ptr, sf_count_t items) ;
+sf_count_t	sf_write_double	(SNDFILE *sndfile, const double *ptr, sf_count_t items) ;
+
+/* Close the SNDFILE and clean up all memory allocations associated with this
+** file.
+** Returns 0 on success, or an error number.
+*/
+
+int		sf_close		(SNDFILE *sndfile) ;
+
+/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file
+** to force the writing of data to disk. If the file is opened SFM_READ
+** no action is taken.
+*/
+
+void	sf_write_sync	(SNDFILE *sndfile) ;
+
+#ifdef __cplusplus
+}		/* extern "C" */
+#endif	/* __cplusplus */
+
+#endif	/* SNDFILE_H */
diff --git a/win/Projects/portmidi/portmidi.vcproj b/win/Projects/portmidi/portmidi.vcproj
new file mode 100644
index 0000000..40a3ae5
--- /dev/null
+++ b/win/Projects/portmidi/portmidi.vcproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="portmidi"
+	ProjectGUID="{D5AB2D87-51DC-4277-A9AB-2A6018D0E947}"
+	RootNamespace="portmidi"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\portmidi\pm_common&quot;;&quot;..\..\..\lib-src\portmidi\pm_win&quot;;&quot;..\..\..\lib-src\portmidi\porttime&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				CompileAs="0"
+				DisableSpecificWarnings="4996"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\portmidi\pm_common&quot;;&quot;..\..\..\lib-src\portmidi\pm_win&quot;;&quot;..\..\..\lib-src\portmidi\porttime&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				StringPooling="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				CompileAs="0"
+				DisableSpecificWarnings="4996"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\portmidi\pm_common&quot;;&quot;..\..\..\lib-src\portmidi\pm_win&quot;;&quot;..\..\..\lib-src\portmidi\porttime&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				StringPooling="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				CompileAs="0"
+				DisableSpecificWarnings="4996"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\portmidi\pm_common&quot;;&quot;..\..\..\lib-src\portmidi\pm_win&quot;;&quot;..\..\..\lib-src\portmidi\porttime&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				CompileAs="0"
+				DisableSpecificWarnings="4996"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_common\pmutil.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_win\pmwin.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_win\pmwinmm.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_common\portmidi.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\porttime\porttime.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\porttime\ptwinmm.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_common\pminternal.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_common\pmutil.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_win\pmwinmm.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\pm_common\portmidi.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lib-src\portmidi\porttime\porttime.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/win/Projects/taglib/taglib.vcproj b/win/Projects/taglib/taglib.vcproj
new file mode 100644
index 0000000..7451719
--- /dev/null
+++ b/win/Projects/taglib/taglib.vcproj
@@ -0,0 +1,934 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="taglib"
+	ProjectGUID="{D912E7BF-61FE-4D17-9D1B-3F1D268429D6}"
+	RootNamespace="taglib"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Unicode Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\taglib\taglib&quot;;&quot;..\..\..\lib-src\taglib\taglib\ape&quot;;&quot;..\..\..\lib-src\taglib\taglib\asf&quot;;&quot;..\..\..\lib-src\taglib\taglib\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\mp4&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpc&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v1&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\speex&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\vorbis&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\aiff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\wav&quot;;&quot;..\..\..\lib-src\taglib\taglib\toolkit&quot;;&quot;..\..\..\lib-src\taglib\taglib\trueaudio&quot;;&quot;..\..\..\lib-src\taglib\taglib\wavpack&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_ZLIB=0;MAKE_TAGLIB_LIB=1;WITH_ASF=1;WITH_MP4=1"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Unicode Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\taglib\taglib&quot;;&quot;..\..\..\lib-src\taglib\taglib\ape&quot;;&quot;..\..\..\lib-src\taglib\taglib\asf&quot;;&quot;..\..\..\lib-src\taglib\taglib\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\mp4&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpc&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v1&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\speex&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\vorbis&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\aiff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\wav&quot;;&quot;..\..\..\lib-src\taglib\taglib\toolkit&quot;;&quot;..\..\..\lib-src\taglib\taglib\trueaudio&quot;;&quot;..\..\..\lib-src\taglib\taglib\wavpack&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_ZLIB=0;MAKE_TAGLIB_LIB=1;WITH_ASF=1;WITH_MP4=1"
+				StringPooling="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\taglib\taglib&quot;;&quot;..\..\..\lib-src\taglib\taglib\ape&quot;;&quot;..\..\..\lib-src\taglib\taglib\asf&quot;;&quot;..\..\..\lib-src\taglib\taglib\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\mp4&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpc&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v1&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\speex&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\vorbis&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\aiff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\wav&quot;;&quot;..\..\..\lib-src\taglib\taglib\toolkit&quot;;&quot;..\..\..\lib-src\taglib\taglib\trueaudio&quot;;&quot;..\..\..\lib-src\taglib\taglib\wavpack&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_ZLIB=0;MAKE_TAGLIB_LIB=1;WITH_ASF=1;WITH_MP4=1"
+				StringPooling="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				AdditionalIncludeDirectories="&quot;..\..\..\lib-src\taglib\taglib&quot;;&quot;..\..\..\lib-src\taglib\taglib\ape&quot;;&quot;..\..\..\lib-src\taglib\taglib\asf&quot;;&quot;..\..\..\lib-src\taglib\taglib\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\mp4&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpc&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v1&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2&quot;;&quot;..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\flac&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\speex&quot;;&quot;..\..\..\lib-src\taglib\taglib\ogg\vorbis&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\aiff&quot;;&quot;..\..\..\lib-src\taglib\taglib\riff\wav&quot;;&quot;..\..\..\lib-src\taglib\taglib\toolkit&quot;;&quot;..\..\..\lib-src\taglib\taglib\trueaudio&quot;;&quot;..\..\..\lib-src\taglib\taglib\wavpack&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_ZLIB=0;MAKE_TAGLIB_LIB=1;WITH_ASF=1;WITH_MP4=1"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				CompileAs="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="taglib"
+			>
+			<Filter
+				Name="ape"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apefooter.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apefooter.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apeitem.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apeitem.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apetag.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ape\apetag.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="asf"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asfattribute.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asfattribute.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asffile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asffile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asfproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asfproperties.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asftag.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\asf\asftag.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="flac"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\flac\flacfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\flac\flacfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\flac\flacproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\flac\flacproperties.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="mp4"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4atom.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4atom.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4file.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4file.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4item.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4item.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4properties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4properties.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4tag.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mp4\mp4tag.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="mpc"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpc\mpcfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpc\mpcfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpc\mpcproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpc\mpcproperties.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="mpeg"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegheader.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegheader.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\mpegproperties.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\xingheader.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\xingheader.h"
+					>
+				</File>
+				<Filter
+					Name="id3v1"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v1\id3v1genres.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v1\id3v1genres.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v1\id3v1tag.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v1\id3v1tag.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="id3v2"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2extendedheader.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2extendedheader.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2footer.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2footer.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2frame.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2frame.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2framefactory.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2framefactory.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2header.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2header.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2synchdata.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2synchdata.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2tag.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\id3v2tag.h"
+						>
+					</File>
+					<Filter
+						Name="frames"
+						>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\attachedpictureframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\attachedpictureframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\commentsframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\commentsframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\generalencapsulatedobjectframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\generalencapsulatedobjectframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\popularimeterframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\popularimeterframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\privateframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\privateframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\relativevolumeframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\relativevolumeframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\textidentificationframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\textidentificationframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\uniquefileidentifierframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\uniquefileidentifierframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\unknownframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\unknownframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\unsynchronizedlyricsframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\unsynchronizedlyricsframe.h"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\urllinkframe.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\..\..\lib-src\taglib\taglib\mpeg\id3v2\frames\urllinkframe.h"
+							>
+						</File>
+					</Filter>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="ogg"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggpage.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggpage.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggpageheader.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\oggpageheader.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\xiphcomment.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\ogg\xiphcomment.h"
+					>
+				</File>
+				<Filter
+					Name="flac"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\flac\oggflacfile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\flac\oggflacfile.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="speex"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\speex\speexfile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\speex\speexfile.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\speex\speexproperties.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\speex\speexproperties.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="vorbis"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\vorbis\vorbisfile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\vorbis\vorbisfile.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\vorbis\vorbisproperties.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\ogg\vorbis\vorbisproperties.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="riff"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\riff\rifffile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\riff\rifffile.h"
+					>
+				</File>
+				<Filter
+					Name="aiff"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\aiff\aifffile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\aiff\aifffile.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\aiff\aiffproperties.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\aiff\aiffproperties.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="wav"
+					>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\wav\wavfile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\wav\wavfile.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\wav\wavproperties.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\lib-src\taglib\taglib\riff\wav\wavproperties.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="toolkit"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\taglib.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tbytevector.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tbytevector.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tbytevectorlist.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tbytevectorlist.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tdebug.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tdebug.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tlist.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tmap.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tstring.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tstring.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tstringlist.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\tstringlist.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\unicode.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\toolkit\unicode.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="trueaudio"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\trueaudio\trueaudiofile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\trueaudio\trueaudiofile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\trueaudio\trueaudioproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\trueaudio\trueaudioproperties.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="wavpack"
+				>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\wavpack\wavpackfile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\wavpack\wavpackfile.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\wavpack\wavpackproperties.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\lib-src\taglib\taglib\wavpack\wavpackproperties.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\audioproperties.cpp"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\audioproperties.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\fileref.cpp"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\fileref.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\tag.cpp"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\tag.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\taglib_export.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\tagunion.cpp"
+			>
+		</File>
+		<File
+			RelativePath="..\..\..\lib-src\taglib\taglib\tagunion.h"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/win/ny.rules b/win/ny.rules
new file mode 100644
index 0000000..2170a83
--- /dev/null
+++ b/win/ny.rules
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<VisualStudioToolFile
+	Name="Nyquist Plugin"
+	Version="8.00"
+	>
+	<Rules>
+		<CustomBuildRule
+			Name="copy"
+			DisplayName="Copy Nyquist file"
+			CommandLine="copy /Y [inputs] [$OutputName]"
+			Outputs="[$OutputName]"
+			FileExtensions="*.ny;*.lsp;*.raw"
+			ExecutionDescription="Copying $(InputName)"
+			SupportsFileBatching="true"
+			>
+			<Properties>
+				<StringProperty
+					Name="OutputName"
+					DisplayName="Output File"
+					Description="Specifies a name to override the default file name"
+					Switch="&quot;[value]&quot;"
+					DefaultValue="&quot;$(OutDir)\$(ParentName)\$(InputFileName)&quot;"
+				/>
+			</Properties>
+		</CustomBuildRule>
+	</Rules>
+</VisualStudioToolFile>

-- 
Audacity debian packaging



More information about the pkg-multimedia-commits mailing list